vue3-ep-biz-lib 0.1.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/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/style.css +1 -0
- package/dist/types/components/biz-button/index.d.ts +161 -0
- package/dist/types/components/biz-button/src/types.d.ts +36 -0
- package/dist/types/components/biz-divide-title/index.d.ts +175 -0
- package/dist/types/components/biz-divide-title/src/types.d.ts +22 -0
- package/dist/types/components/biz-image-viewer/src/types.d.ts +41 -0
- package/dist/types/components/biz-modal/index.d.ts +349 -0
- package/dist/types/components/biz-modal/src/bind-caller.d.ts +22 -0
- package/dist/types/components/biz-modal/src/biz-modal-child.d.ts +44 -0
- package/dist/types/components/biz-modal/src/core.d.ts +20 -0
- package/dist/types/components/biz-modal/src/plugin.d.ts +7 -0
- package/dist/types/components/biz-modal/src/types.d.ts +173 -0
- package/dist/types/components/biz-modal/src/use-biz-modal-shell.d.ts +35 -0
- package/dist/types/components/biz-modal/src/use-biz-modal.d.ts +23 -0
- package/dist/types/components/biz-modal/src/utils.d.ts +31 -0
- package/dist/types/components/biz-search-form/index.d.ts +250 -0
- package/dist/types/components/biz-search-form/src/types.d.ts +72 -0
- package/dist/types/components/biz-table/index.d.ts +71 -0
- package/dist/types/components/biz-table/src/column-render.d.ts +29 -0
- package/dist/types/components/biz-table/src/types.d.ts +110 -0
- package/dist/types/components/index.d.ts +14 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/use-namespace/index.d.ts +28 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/types/index.d.ts +33 -0
- package/dist/types/utils/index.d.ts +15 -0
- package/dist/vue3-ep-biz-lib.es.js +1740 -0
- package/dist/vue3-ep-biz-lib.umd.cjs +1 -0
- package/package.json +72 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present syanjun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# vue3-ep-biz-lib
|
|
2
|
+
|
|
3
|
+
基于 **Vue3 + Element Plus + TypeScript + SCSS + VitePress** 的企业级业务组件库,工程规范对标 Element Plus。
|
|
4
|
+
|
|
5
|
+
## 工程结构
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
packages/
|
|
9
|
+
├── components/ # 组件源码(每个组件独立目录:src/组件.vue + style/index.scss + index.ts)
|
|
10
|
+
├── hooks/ # 公共组合式函数
|
|
11
|
+
├── utils/ # 工具方法(withInstall / makeInstaller)
|
|
12
|
+
├── types/ # 全局 TS 类型定义
|
|
13
|
+
└── theme/ # SCSS 全局变量、Element Plus 主题变量复用
|
|
14
|
+
|
|
15
|
+
docs/
|
|
16
|
+
├── .vitepress/ # VitePress 配置 + 主题 + :::demo 容器插件
|
|
17
|
+
├── zh-CN/
|
|
18
|
+
│ ├── guide/ # 开发指南
|
|
19
|
+
│ └── components/ # 组件文档(md)
|
|
20
|
+
└── examples/ # 文档 demo 示例(组件名/示例名.vue)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 命令
|
|
24
|
+
|
|
25
|
+
| 命令 | 说明 |
|
|
26
|
+
| ---- | ---- |
|
|
27
|
+
| `npm run dev` | 启动文档站本地开发 |
|
|
28
|
+
| `npm run build` | 构建组件库(ES + UMD + d.ts) |
|
|
29
|
+
| `npm run typecheck` | TS 类型检查 |
|
|
30
|
+
| `npm run docs:build` | 构建文档站 |
|
|
31
|
+
| `npm run release` | 发布 npm 包(release 分支 + tag,见[发布指南](docs/zh-CN/guide/release.md)) |
|
|
32
|
+
|
|
33
|
+
## 新增组件三步
|
|
34
|
+
|
|
35
|
+
1. 在 `packages/components/xxx-component/` 开发组件,`index.ts` 中 `withInstall` 导出;
|
|
36
|
+
2. 在 `packages/components/index.ts` 的 `components` 数组中注册;
|
|
37
|
+
3. 补充 `docs/zh-CN/components/xxx-component.md` 文档与 `docs/examples/xxx-component/basic.vue` 示例。
|
|
38
|
+
|
|
39
|
+
## 使用方式
|
|
40
|
+
|
|
41
|
+
### 全局注册
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { createApp } from 'vue'
|
|
45
|
+
import ElementPlus from 'element-plus'
|
|
46
|
+
import 'element-plus/dist/index.css'
|
|
47
|
+
import Vue3EpBizLib from 'vue3-ep-biz-lib'
|
|
48
|
+
import 'vue3-ep-biz-lib/dist/style.css' // 组件样式(npm 安装时必引)
|
|
49
|
+
import App from './App.vue'
|
|
50
|
+
|
|
51
|
+
const app = createApp(App)
|
|
52
|
+
app.use(ElementPlus)
|
|
53
|
+
app.use(Vue3EpBizLib)
|
|
54
|
+
app.mount('#app')
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 按需导入
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
import { BizButton } from 'vue3-ep-biz-lib'
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<BizButton type="primary">按需导入</BizButton>
|
|
66
|
+
</template>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## 发布
|
|
70
|
+
|
|
71
|
+
统一命令(自动完成 release 分支、版本号、tag、构建、发布、合回 master):
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm run release # patch;minor/major/显式版本号:npm run release -- minor
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
完整流程与注意事项见 [发布指南](docs/zh-CN/guide/release.md)。
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.biz-button__icon-font{display:inline-flex;align-items:center;justify-content:center;width:1em;height:1em;font-size:inherit;font-style:normal;line-height:1}.biz-button .biz-button__icon-font+.biz-button__text{margin-left:6px}.biz-button.el-button--small .biz-button__icon-font+.biz-button__text{margin-left:4px}.biz-button.el-button--large .biz-button__icon-font+.biz-button__text{margin-left:8px}.biz-button.is-only-icon .biz-button__text{display:none}.biz-button.is-only-icon:not(.is-circle):not(.is-text):not(.is-link):not(.el-button--text){width:var(--el-component-size);padding-inline:0}.biz-button.is-only-icon.el-button--small:not(.is-circle):not(.is-text):not(.is-link):not(.el-button--text){width:var(--el-component-size-small);padding-inline:0}.biz-button.is-only-icon.el-button--large:not(.is-circle):not(.is-text):not(.is-link):not(.el-button--text){width:var(--el-component-size-large);padding-inline:0}.biz-divide-title{display:block;width:100%;font-size:var(--el-font-size-base);line-height:var(--el-font-line-height-primary);color:var(--el-text-color-primary)}.biz-divide-title--large{font-size:var(--el-font-size-medium)}.biz-divide-title--small{font-size:var(--el-font-size-small)}.biz-divide-title__header{display:flex;align-items:center;gap:8px;min-width:0;width:100%}.biz-divide-title__accent{flex-shrink:0;width:4px;height:1em;border-radius:2px;background-color:var(--el-color-primary)}.biz-divide-title__text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.biz-divide-title.is-bold .biz-divide-title__text{font-weight:600}.biz-divide-title__extra{flex-shrink:0;margin-left:auto;display:flex;align-items:center;gap:8px;font-size:var(--el-font-size-base);font-weight:400;color:var(--el-text-color-regular)}.biz-divide-title.is-collapsible .biz-divide-title__header{cursor:pointer;-webkit-user-select:none;user-select:none;min-height:var(--el-component-size)}.biz-divide-title__arrow{color:var(--el-text-color-secondary);transition:transform var(--el-transition-duration) ease}.biz-divide-title.is-collapsed .biz-divide-title__arrow{transform:rotate(-90deg)}.biz-divide-title__content{display:grid;grid-template-rows:1fr;margin-top:12px;transition:grid-template-rows var(--el-transition-duration) ease}.biz-divide-title__content.is-collapsed{grid-template-rows:0fr;margin-top:0}.biz-divide-title__content-inner{overflow:hidden;min-height:0}.biz-divide-title.is-divider .biz-divide-title__header{padding-bottom:8px;border-bottom:1px solid var(--el-border-color-light)}.biz-divide-title.is-divider-dashed .biz-divide-title__header{border-bottom-style:dashed}.biz-divide-title.is-divider .biz-divide-title__content{margin-top:16px}.biz-divide-title.is-divider .biz-divide-title__content.is-collapsed{margin-top:0}.biz-divide-title--small .biz-divide-title__content{margin-top:8px}.biz-divide-title--small .biz-divide-title__content.is-collapsed{margin-top:0}.biz-image-viewer{--biz-image-viewer-thumb-width: 120px;--biz-image-viewer-thumb-height: 90px;display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;width:100%}.biz-image-viewer__item{position:relative;flex-shrink:0}.biz-image-viewer__thumb{width:var(--biz-image-viewer-thumb-width);height:var(--biz-image-viewer-thumb-height);border-radius:var(--el-border-radius-base);border:1px solid var(--el-border-color-lighter);box-sizing:border-box;cursor:pointer;transition:border-color var(--el-transition-duration-fast) ease}.biz-image-viewer__thumb:hover{border-color:var(--el-color-primary)}.biz-image-viewer__loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:var(--el-fill-color-light);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.biz-image-viewer__error{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;height:100%;background:var(--el-fill-color-light);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.biz-image-viewer__extra{position:absolute;inset-inline:0;bottom:0;pointer-events:auto}.biz-image-viewer__more{display:flex;align-items:center;justify-content:center;width:var(--biz-image-viewer-thumb-width);height:var(--biz-image-viewer-thumb-height);border-radius:var(--el-border-radius-base);border:1px solid var(--el-border-color-lighter);box-sizing:border-box;background:var(--el-fill-color-light);color:var(--el-text-color-regular);font-size:var(--el-font-size-medium);font-weight:600;cursor:pointer;transition:all var(--el-transition-duration-fast) ease}.biz-image-viewer__more:hover{background:var(--el-fill-color);color:var(--el-color-primary);border-color:var(--el-color-primary)}.biz-image-viewer__empty{width:100%;padding:4px 0}.biz-modal__header{display:flex;align-items:center;gap:8px;width:100%;min-width:0}.biz-modal__title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--el-dialog-title-font-size, var(--el-font-size-medium));font-weight:600;line-height:var(--el-font-line-height-primary);color:var(--el-text-color-primary)}.biz-modal__fullscreen-btn{flex-shrink:0;margin-left:auto;font-size:var(--el-font-size-medium);color:var(--el-text-color-secondary);cursor:pointer;transition:color var(--el-transition-duration-fast)}.biz-modal__fullscreen-btn:hover{color:var(--el-color-primary)}.biz-modal__body.is-scrollable{max-height:var(--biz-modal-body-max-height);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--el-border-color) transparent}.biz-modal__async-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:48px 0;color:var(--el-text-color-secondary)}.biz-modal__async-loading-icon{width:24px;height:24px;border:2px solid var(--el-border-color-light);border-top-color:var(--el-color-primary);border-radius:50%;animation:biz-modal-rotate .8s linear infinite}.biz-modal__async-loading-text{font-size:var(--el-font-size-base)}@keyframes biz-modal-rotate{to{transform:rotate(360deg)}}.biz-search-form .el-form-item{margin-bottom:18px}.biz-search-form__actions{display:flex;align-items:center;justify-content:flex-end;margin-bottom:18px}.biz-search-form__expand-icon{margin-left:4px;transition:transform var(--el-transition-duration)}.biz-table{display:flex;flex-direction:column;min-width:0}.biz-table__toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:12px}.biz-table__toolbar-left{display:flex;align-items:center;min-width:0;overflow:hidden}.biz-table__toolbar-title{font-size:16px;font-weight:600;color:var(--el-text-color-primary);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.biz-table__toolbar-actions{display:flex;flex-shrink:0;align-items:center;gap:4px}.biz-table__action{width:28px;height:28px;padding:0;margin-left:0;border-radius:var(--el-border-radius-base);font-size:16px;color:var(--el-text-color-regular);transition:color var(--el-transition-duration),background-color var(--el-transition-duration)}.biz-table__action+.biz-table__action{margin-left:4px}.biz-table__action:hover{color:var(--el-color-primary);background-color:var(--el-fill-color-light)}.biz-table__action:focus-visible{outline:none;color:var(--el-color-primary);background-color:var(--el-fill-color-light)}.biz-table__main{position:relative;flex:1;min-height:180px;overflow:hidden}.biz-table__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10;display:flex;align-items:center;justify-content:center;background-color:var(--el-mask-color-lighter);color:var(--el-color-primary)}.biz-table__loading .el-icon.is-loading{animation:rotating 2s linear infinite}.biz-table .el-table__header{margin:0}.biz-table .el-table--large th.el-table__cell{padding-top:calc(var(--biz-table-header-padding-y) + 2px);padding-bottom:calc(var(--biz-table-header-padding-y) + 2px)}.biz-table .el-table--default th.el-table__cell{padding-top:var(--biz-table-header-padding-y);padding-bottom:var(--biz-table-header-padding-y)}.biz-table .el-table--small th.el-table__cell{padding-top:calc(var(--biz-table-header-padding-y) - 2px);padding-bottom:calc(var(--biz-table-header-padding-y) - 2px)}.biz-table th.el-table__cell .cell{white-space:nowrap}.biz-table__pagination{flex-shrink:0;display:flex;align-items:center;justify-content:flex-end;padding-top:12px}.biz-table__pagination .el-pagination{min-width:0;flex-wrap:wrap;row-gap:8px;justify-content:flex-end}.biz-table__pagination .el-pager{margin:0;padding:0}.biz-table.is-fullscreen{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--el-index-top);padding:16px;background-color:var(--el-bg-color)}.biz-table__column-setting .el-checkbox{width:100%;height:28px;margin-right:0}.biz-table__column-setting-head{display:flex;align-items:center;justify-content:space-between;padding-bottom:4px;margin-bottom:4px;border-bottom:1px solid var(--el-border-color-lighter)}.biz-table__column-setting-head .el-checkbox{height:auto;width:auto}.biz-table__density-popper .el-dropdown-menu__item.is-active{color:var(--el-color-primary);background-color:var(--el-color-primary-light-9)}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/** 业务按钮:el-button 全量透传 + only-icon 图标按钮模式(hover tooltip)+ 图标三通道(组件/字体 class/插槽) */
|
|
2
|
+
export declare const BizButton: import('..').SFCWithInstall<{
|
|
3
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
4
|
+
icon: {
|
|
5
|
+
type: import('vue').PropType<import('.').BizButtonIcon>;
|
|
6
|
+
default: undefined;
|
|
7
|
+
};
|
|
8
|
+
onlyIcon: {
|
|
9
|
+
type: import('vue').PropType<boolean>;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
tooltip: {
|
|
13
|
+
type: import('vue').PropType<string>;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
tooltipPlacement: {
|
|
17
|
+
type: import('vue').PropType<import('.').BizButtonTooltipPlacement>;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
tooltipEffect: {
|
|
21
|
+
type: import('vue').PropType<import('.').BizButtonTooltipEffect>;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
tooltipDisabled: {
|
|
25
|
+
type: import('vue').PropType<boolean>;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
tooltipShowAfter: {
|
|
29
|
+
type: import('vue').PropType<number>;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
tooltipHideAfter: {
|
|
33
|
+
type: import('vue').PropType<number>;
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
}>> & Readonly<{}>, {
|
|
37
|
+
buttonRef: import('vue').Ref<import('element-plus').ButtonInstance | null, import('element-plus').ButtonInstance | null>;
|
|
38
|
+
focus: () => void;
|
|
39
|
+
blur: () => void;
|
|
40
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
41
|
+
icon: import('.').BizButtonIcon;
|
|
42
|
+
onlyIcon: boolean;
|
|
43
|
+
tooltip: string;
|
|
44
|
+
tooltipPlacement: import('.').BizButtonTooltipPlacement;
|
|
45
|
+
tooltipEffect: import('.').BizButtonTooltipEffect;
|
|
46
|
+
tooltipDisabled: boolean;
|
|
47
|
+
tooltipShowAfter: number;
|
|
48
|
+
tooltipHideAfter: number;
|
|
49
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
50
|
+
P: {};
|
|
51
|
+
B: {};
|
|
52
|
+
D: {};
|
|
53
|
+
C: {};
|
|
54
|
+
M: {};
|
|
55
|
+
Defaults: {};
|
|
56
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
57
|
+
icon: {
|
|
58
|
+
type: import('vue').PropType<import('.').BizButtonIcon>;
|
|
59
|
+
default: undefined;
|
|
60
|
+
};
|
|
61
|
+
onlyIcon: {
|
|
62
|
+
type: import('vue').PropType<boolean>;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
tooltip: {
|
|
66
|
+
type: import('vue').PropType<string>;
|
|
67
|
+
default: string;
|
|
68
|
+
};
|
|
69
|
+
tooltipPlacement: {
|
|
70
|
+
type: import('vue').PropType<import('.').BizButtonTooltipPlacement>;
|
|
71
|
+
default: string;
|
|
72
|
+
};
|
|
73
|
+
tooltipEffect: {
|
|
74
|
+
type: import('vue').PropType<import('.').BizButtonTooltipEffect>;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
tooltipDisabled: {
|
|
78
|
+
type: import('vue').PropType<boolean>;
|
|
79
|
+
default: boolean;
|
|
80
|
+
};
|
|
81
|
+
tooltipShowAfter: {
|
|
82
|
+
type: import('vue').PropType<number>;
|
|
83
|
+
default: number;
|
|
84
|
+
};
|
|
85
|
+
tooltipHideAfter: {
|
|
86
|
+
type: import('vue').PropType<number>;
|
|
87
|
+
default: number;
|
|
88
|
+
};
|
|
89
|
+
}>> & Readonly<{}>, {
|
|
90
|
+
buttonRef: import('vue').Ref<import('element-plus').ButtonInstance | null, import('element-plus').ButtonInstance | null>;
|
|
91
|
+
focus: () => void;
|
|
92
|
+
blur: () => void;
|
|
93
|
+
}, {}, {}, {}, {
|
|
94
|
+
icon: import('.').BizButtonIcon;
|
|
95
|
+
onlyIcon: boolean;
|
|
96
|
+
tooltip: string;
|
|
97
|
+
tooltipPlacement: import('.').BizButtonTooltipPlacement;
|
|
98
|
+
tooltipEffect: import('.').BizButtonTooltipEffect;
|
|
99
|
+
tooltipDisabled: boolean;
|
|
100
|
+
tooltipShowAfter: number;
|
|
101
|
+
tooltipHideAfter: number;
|
|
102
|
+
}>;
|
|
103
|
+
__isFragment?: never;
|
|
104
|
+
__isTeleport?: never;
|
|
105
|
+
__isSuspense?: never;
|
|
106
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
107
|
+
icon: {
|
|
108
|
+
type: import('vue').PropType<import('.').BizButtonIcon>;
|
|
109
|
+
default: undefined;
|
|
110
|
+
};
|
|
111
|
+
onlyIcon: {
|
|
112
|
+
type: import('vue').PropType<boolean>;
|
|
113
|
+
default: boolean;
|
|
114
|
+
};
|
|
115
|
+
tooltip: {
|
|
116
|
+
type: import('vue').PropType<string>;
|
|
117
|
+
default: string;
|
|
118
|
+
};
|
|
119
|
+
tooltipPlacement: {
|
|
120
|
+
type: import('vue').PropType<import('.').BizButtonTooltipPlacement>;
|
|
121
|
+
default: string;
|
|
122
|
+
};
|
|
123
|
+
tooltipEffect: {
|
|
124
|
+
type: import('vue').PropType<import('.').BizButtonTooltipEffect>;
|
|
125
|
+
default: string;
|
|
126
|
+
};
|
|
127
|
+
tooltipDisabled: {
|
|
128
|
+
type: import('vue').PropType<boolean>;
|
|
129
|
+
default: boolean;
|
|
130
|
+
};
|
|
131
|
+
tooltipShowAfter: {
|
|
132
|
+
type: import('vue').PropType<number>;
|
|
133
|
+
default: number;
|
|
134
|
+
};
|
|
135
|
+
tooltipHideAfter: {
|
|
136
|
+
type: import('vue').PropType<number>;
|
|
137
|
+
default: number;
|
|
138
|
+
};
|
|
139
|
+
}>> & Readonly<{}>, {
|
|
140
|
+
buttonRef: import('vue').Ref<import('element-plus').ButtonInstance | null, import('element-plus').ButtonInstance | null>;
|
|
141
|
+
focus: () => void;
|
|
142
|
+
blur: () => void;
|
|
143
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
144
|
+
icon: import('.').BizButtonIcon;
|
|
145
|
+
onlyIcon: boolean;
|
|
146
|
+
tooltip: string;
|
|
147
|
+
tooltipPlacement: import('.').BizButtonTooltipPlacement;
|
|
148
|
+
tooltipEffect: import('.').BizButtonTooltipEffect;
|
|
149
|
+
tooltipDisabled: boolean;
|
|
150
|
+
tooltipShowAfter: number;
|
|
151
|
+
tooltipHideAfter: number;
|
|
152
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
153
|
+
$slots: {
|
|
154
|
+
icon?(_: {}): any;
|
|
155
|
+
default?(_: {}): any;
|
|
156
|
+
};
|
|
157
|
+
})>;
|
|
158
|
+
export default BizButton;
|
|
159
|
+
export type { BizButtonIcon, BizButtonTooltipPlacement, BizButtonTooltipEffect, BizButtonProps, } from './src/types';
|
|
160
|
+
/** 组件实例类型:`ref` 获取 { buttonRef, focus, blur } */
|
|
161
|
+
export type BizButtonInstance = InstanceType<typeof BizButton>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 图标入参(三通道之一/之二):
|
|
5
|
+
* - `Component`:`@element-plus/icons-vue` 图标组件 / 业务自定义 SVG 组件
|
|
6
|
+
* - `string`:任意第三方字体图标 class(如 `'iconfont icon-edit'`、`'ri-home-line'`)
|
|
7
|
+
*
|
|
8
|
+
* 说明:el-button 的 `icon` prop 内部按组件名解析字符串,无法承载字体 class,
|
|
9
|
+
* 字体图标由 BizButton 自渲染 `<i :class>`,因此 icon 不透传给 el-button。
|
|
10
|
+
*/
|
|
11
|
+
export type BizButtonIcon = Component | string;
|
|
12
|
+
/** tooltip 弹出方位(对齐 el-tooltip placement 取值) */
|
|
13
|
+
export type BizButtonTooltipPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
14
|
+
/** tooltip 主题 */
|
|
15
|
+
export type BizButtonTooltipEffect = 'dark' | 'light';
|
|
16
|
+
export interface BizButtonProps {
|
|
17
|
+
/** 图标:组件(EP 图标 / 自定义 SVG 组件)或 字体图标 class 字符串 */
|
|
18
|
+
icon?: BizButtonIcon;
|
|
19
|
+
/**
|
|
20
|
+
* 图标按钮模式:隐藏按钮文本、按钮方形化(等宽等高),
|
|
21
|
+
* 鼠标移入以 tooltip 呈现按钮文本(`tooltip` prop 留空时自动取默认插槽文本)
|
|
22
|
+
*/
|
|
23
|
+
onlyIcon?: boolean;
|
|
24
|
+
/** tooltip 文本;留空时自动取默认插槽文本;两者皆空则 tooltip 自动禁用 */
|
|
25
|
+
tooltip?: string;
|
|
26
|
+
/** tooltip 弹出方位 */
|
|
27
|
+
tooltipPlacement?: BizButtonTooltipPlacement;
|
|
28
|
+
/** tooltip 主题 */
|
|
29
|
+
tooltipEffect?: BizButtonTooltipEffect;
|
|
30
|
+
/** 关闭 tooltip */
|
|
31
|
+
tooltipDisabled?: boolean;
|
|
32
|
+
/** tooltip 显示延迟(ms) */
|
|
33
|
+
tooltipShowAfter?: number;
|
|
34
|
+
/** tooltip 隐藏延迟(ms) */
|
|
35
|
+
tooltipHideAfter?: number;
|
|
36
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/** 业务分块标题:装饰竖条 + 标题/操作区/分割线 + 可折叠内容区 */
|
|
2
|
+
export declare const BizDivideTitle: import('..').SFCWithInstall<{
|
|
3
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
4
|
+
size: {
|
|
5
|
+
type: import('vue').PropType<import('.').BizDivideTitleSize>;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
bold: {
|
|
9
|
+
type: import('vue').PropType<boolean>;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
title: {
|
|
13
|
+
type: import('vue').PropType<string>;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
accent: {
|
|
17
|
+
type: import('vue').PropType<boolean>;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
20
|
+
accentColor: {
|
|
21
|
+
type: import('vue').PropType<string>;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
divider: {
|
|
25
|
+
type: import('vue').PropType<import('.').BizDivideTitleDivider>;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
collapsible: {
|
|
29
|
+
type: import('vue').PropType<boolean>;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
collapsed: {
|
|
33
|
+
type: import('vue').PropType<boolean>;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
}>> & Readonly<{
|
|
37
|
+
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
38
|
+
onCollapse?: ((value: boolean) => any) | undefined;
|
|
39
|
+
"onClick-title"?: ((event: MouseEvent) => any) | undefined;
|
|
40
|
+
}>, {
|
|
41
|
+
toggle: () => void;
|
|
42
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
43
|
+
"update:collapsed": (value: boolean) => void;
|
|
44
|
+
collapse: (value: boolean) => void;
|
|
45
|
+
"click-title": (event: MouseEvent) => void;
|
|
46
|
+
}, import('vue').PublicProps, {
|
|
47
|
+
size: import('.').BizDivideTitleSize;
|
|
48
|
+
bold: boolean;
|
|
49
|
+
title: string;
|
|
50
|
+
accent: boolean;
|
|
51
|
+
accentColor: string;
|
|
52
|
+
divider: import('.').BizDivideTitleDivider;
|
|
53
|
+
collapsible: boolean;
|
|
54
|
+
collapsed: boolean;
|
|
55
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
56
|
+
P: {};
|
|
57
|
+
B: {};
|
|
58
|
+
D: {};
|
|
59
|
+
C: {};
|
|
60
|
+
M: {};
|
|
61
|
+
Defaults: {};
|
|
62
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
63
|
+
size: {
|
|
64
|
+
type: import('vue').PropType<import('.').BizDivideTitleSize>;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
bold: {
|
|
68
|
+
type: import('vue').PropType<boolean>;
|
|
69
|
+
default: boolean;
|
|
70
|
+
};
|
|
71
|
+
title: {
|
|
72
|
+
type: import('vue').PropType<string>;
|
|
73
|
+
default: string;
|
|
74
|
+
};
|
|
75
|
+
accent: {
|
|
76
|
+
type: import('vue').PropType<boolean>;
|
|
77
|
+
default: boolean;
|
|
78
|
+
};
|
|
79
|
+
accentColor: {
|
|
80
|
+
type: import('vue').PropType<string>;
|
|
81
|
+
default: string;
|
|
82
|
+
};
|
|
83
|
+
divider: {
|
|
84
|
+
type: import('vue').PropType<import('.').BizDivideTitleDivider>;
|
|
85
|
+
default: boolean;
|
|
86
|
+
};
|
|
87
|
+
collapsible: {
|
|
88
|
+
type: import('vue').PropType<boolean>;
|
|
89
|
+
default: boolean;
|
|
90
|
+
};
|
|
91
|
+
collapsed: {
|
|
92
|
+
type: import('vue').PropType<boolean>;
|
|
93
|
+
default: boolean;
|
|
94
|
+
};
|
|
95
|
+
}>> & Readonly<{
|
|
96
|
+
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
97
|
+
onCollapse?: ((value: boolean) => any) | undefined;
|
|
98
|
+
"onClick-title"?: ((event: MouseEvent) => any) | undefined;
|
|
99
|
+
}>, {
|
|
100
|
+
toggle: () => void;
|
|
101
|
+
}, {}, {}, {}, {
|
|
102
|
+
size: import('.').BizDivideTitleSize;
|
|
103
|
+
bold: boolean;
|
|
104
|
+
title: string;
|
|
105
|
+
accent: boolean;
|
|
106
|
+
accentColor: string;
|
|
107
|
+
divider: import('.').BizDivideTitleDivider;
|
|
108
|
+
collapsible: boolean;
|
|
109
|
+
collapsed: boolean;
|
|
110
|
+
}>;
|
|
111
|
+
__isFragment?: never;
|
|
112
|
+
__isTeleport?: never;
|
|
113
|
+
__isSuspense?: never;
|
|
114
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
115
|
+
size: {
|
|
116
|
+
type: import('vue').PropType<import('.').BizDivideTitleSize>;
|
|
117
|
+
default: string;
|
|
118
|
+
};
|
|
119
|
+
bold: {
|
|
120
|
+
type: import('vue').PropType<boolean>;
|
|
121
|
+
default: boolean;
|
|
122
|
+
};
|
|
123
|
+
title: {
|
|
124
|
+
type: import('vue').PropType<string>;
|
|
125
|
+
default: string;
|
|
126
|
+
};
|
|
127
|
+
accent: {
|
|
128
|
+
type: import('vue').PropType<boolean>;
|
|
129
|
+
default: boolean;
|
|
130
|
+
};
|
|
131
|
+
accentColor: {
|
|
132
|
+
type: import('vue').PropType<string>;
|
|
133
|
+
default: string;
|
|
134
|
+
};
|
|
135
|
+
divider: {
|
|
136
|
+
type: import('vue').PropType<import('.').BizDivideTitleDivider>;
|
|
137
|
+
default: boolean;
|
|
138
|
+
};
|
|
139
|
+
collapsible: {
|
|
140
|
+
type: import('vue').PropType<boolean>;
|
|
141
|
+
default: boolean;
|
|
142
|
+
};
|
|
143
|
+
collapsed: {
|
|
144
|
+
type: import('vue').PropType<boolean>;
|
|
145
|
+
default: boolean;
|
|
146
|
+
};
|
|
147
|
+
}>> & Readonly<{
|
|
148
|
+
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
149
|
+
onCollapse?: ((value: boolean) => any) | undefined;
|
|
150
|
+
"onClick-title"?: ((event: MouseEvent) => any) | undefined;
|
|
151
|
+
}>, {
|
|
152
|
+
toggle: () => void;
|
|
153
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
154
|
+
"update:collapsed": (value: boolean) => void;
|
|
155
|
+
collapse: (value: boolean) => void;
|
|
156
|
+
"click-title": (event: MouseEvent) => void;
|
|
157
|
+
}, string, {
|
|
158
|
+
size: import('.').BizDivideTitleSize;
|
|
159
|
+
bold: boolean;
|
|
160
|
+
title: string;
|
|
161
|
+
accent: boolean;
|
|
162
|
+
accentColor: string;
|
|
163
|
+
divider: import('.').BizDivideTitleDivider;
|
|
164
|
+
collapsible: boolean;
|
|
165
|
+
collapsed: boolean;
|
|
166
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
167
|
+
$slots: {
|
|
168
|
+
title?(_: {}): any;
|
|
169
|
+
extra?(_: {}): any;
|
|
170
|
+
default?(_: {}): any;
|
|
171
|
+
};
|
|
172
|
+
})>;
|
|
173
|
+
export default BizDivideTitle;
|
|
174
|
+
export type { BizDivideTitleSize, BizDivideTitleDivider, BizDivideTitleProps, } from './src/types';
|
|
175
|
+
export type BizDivideTitleInstance = InstanceType<typeof BizDivideTitle>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** 分块标题尺寸档位(映射主题字号变量) */
|
|
2
|
+
export type BizDivideTitleSize = 'large' | 'default' | 'small';
|
|
3
|
+
/** 分割线:true / 'solid' 实线,'dashed' 虚线 */
|
|
4
|
+
export type BizDivideTitleDivider = boolean | 'solid' | 'dashed';
|
|
5
|
+
export interface BizDivideTitleProps {
|
|
6
|
+
/** 标题文本(#title 插槽优先) */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** 尺寸档位:large 16px / default 14px / small 13px(竖条高度随字号自适应) */
|
|
9
|
+
size?: BizDivideTitleSize;
|
|
10
|
+
/** 是否加粗标题 */
|
|
11
|
+
bold?: boolean;
|
|
12
|
+
/** 是否展示左侧装饰竖条 */
|
|
13
|
+
accent?: boolean;
|
|
14
|
+
/** 竖条自定义颜色(默认 var(--el-color-primary)) */
|
|
15
|
+
accentColor?: string;
|
|
16
|
+
/** 标题行下方分割线(占满整行,右侧操作区随行居上) */
|
|
17
|
+
divider?: BizDivideTitleDivider;
|
|
18
|
+
/** 是否可折叠:标题可点击切换,右侧渲染箭头,default 插槽为折叠内容 */
|
|
19
|
+
collapsible?: boolean;
|
|
20
|
+
/** 折叠状态(v-model:collapsed,仅 collapsible 时有意义) */
|
|
21
|
+
collapsed?: boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** 归一化后的图片项(组件内部使用 / 插槽作用域类型) */
|
|
2
|
+
export interface BizImageViewerItem {
|
|
3
|
+
/** 缩略图地址 */
|
|
4
|
+
src: string;
|
|
5
|
+
/** 预览大图地址(缺省用 src) */
|
|
6
|
+
previewSrc?: string;
|
|
7
|
+
/** 图片名称(渲染为 alt,提升无障碍) */
|
|
8
|
+
name?: string;
|
|
9
|
+
}
|
|
10
|
+
/** 图片数据源单项:url / 归一化对象 / 业务记录(配合字段映射 props) */
|
|
11
|
+
export type BizImageViewerDataItem = string | BizImageViewerItem | Record<string, unknown>;
|
|
12
|
+
/** 图片数据源:url 字符串数组、归一化对象数组,或业务记录数组(配合 src-key 等字段映射 props) */
|
|
13
|
+
export type BizImageViewerDataSource = string[] | BizImageViewerItem[] | Record<string, unknown>[];
|
|
14
|
+
export interface BizImageViewerProps {
|
|
15
|
+
/** 图片数据:string[] 直传;对象数组可用 src-key / preview-src-key / name-key 映射字段 */
|
|
16
|
+
images?: BizImageViewerDataSource;
|
|
17
|
+
/** 对象数组时缩略图地址字段名('' 表示直接读 item.src) */
|
|
18
|
+
srcKey?: string;
|
|
19
|
+
/** 对象数组时预览大图字段名('' 表示与缩略图同源) */
|
|
20
|
+
previewSrcKey?: string;
|
|
21
|
+
/** 对象数组时名称字段名('' 表示不读取) */
|
|
22
|
+
nameKey?: string;
|
|
23
|
+
/** 点击缩略图是否打开全屏预览 */
|
|
24
|
+
preview?: boolean;
|
|
25
|
+
/** 最多展示缩略图数量,0 全部展示;超出部分聚合为 +N 占位(点击打开预览定位到首张隐藏图) */
|
|
26
|
+
limit?: number;
|
|
27
|
+
/** 缩略图懒加载(滚动进入视口才加载) */
|
|
28
|
+
lazy?: boolean;
|
|
29
|
+
/** 空数据时是否展示占位 */
|
|
30
|
+
showEmpty?: boolean;
|
|
31
|
+
/** 空数据占位文案 */
|
|
32
|
+
emptyText?: string;
|
|
33
|
+
/** 全屏预览:点击遮罩关闭 */
|
|
34
|
+
hideOnClickModal?: boolean;
|
|
35
|
+
/** 全屏预览:Esc 关闭 */
|
|
36
|
+
closeOnPressEscape?: boolean;
|
|
37
|
+
/** 全屏预览:滚轮缩放速率 */
|
|
38
|
+
zoomRate?: number;
|
|
39
|
+
/** 全屏预览:是否挂载到 body */
|
|
40
|
+
teleported?: boolean;
|
|
41
|
+
}
|