@yeepay/yee-boss-ui 0.1.4 → 0.1.6
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 +65 -0
- package/dist/components/descriptions/YeeDescriptions.vue.d.ts +20 -0
- package/dist/components/descriptions/index.d.ts +2 -0
- package/dist/components/descriptions/types.d.ts +20 -0
- package/dist/components/file-upload/YeeFileUpload.vue.d.ts +28 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/file-upload/types.d.ts +26 -0
- package/dist/components/modal/YeeModal.vue.d.ts +59 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/types.d.ts +21 -0
- package/dist/components/select/YeeSelect.vue.d.ts +30 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/types.d.ts +18 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +895 -228
- package/dist/style.css +1 -1
- package/dist/theme.css +6 -6
- package/dist/theme.js +1 -1
- package/dist/{tokens-Dj_CxJpe.js → tokens-CHaQtlyD.js} +3 -3
- package/dist/utils/copy-text.d.ts +1 -0
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
- `YeePage` 页面容器。
|
|
15
15
|
- `YeeForm` Schema 查询表单。
|
|
16
16
|
- `useYeeGrid` 与 `gridApi/formApi`。
|
|
17
|
+
- `YeeDescriptions` 配置驱动的详情展示。
|
|
18
|
+
- `YeeFileUpload` 业务无关的文件选择与上传生命周期。
|
|
19
|
+
- `YeeModal` 统一的 Modal / Drawer 容器。
|
|
20
|
+
- `YeeSelect` 带完整文案提示的选择器。
|
|
17
21
|
- Tailwind CSS 语义主题 preset。
|
|
18
22
|
|
|
19
23
|
不提供主题切换器、业务组件或对 Ant Design Vue 基础组件的机械封装,也不依赖任何 `@vben-*` 包。
|
|
@@ -67,6 +71,8 @@ import '@yeepay/yee-boss-ui/theme.css'
|
|
|
67
71
|
}
|
|
68
72
|
```
|
|
69
73
|
|
|
74
|
+
`--yee-radius`、`--yee-radius-lg` 与 `--yee-radius-sm` 默认分别为 `4px`、`8px` 与 `2px`。公共组件使用基础圆角,Ant Design Vue 映射按对应尺寸消费这组语义化变量;需要特殊圆角时由 Portal 通过 `theme.tokens` 显式覆盖。
|
|
75
|
+
|
|
70
76
|
## Tailwind CSS
|
|
71
77
|
|
|
72
78
|
```js
|
|
@@ -81,6 +87,55 @@ export default {
|
|
|
81
87
|
|
|
82
88
|
业务页面可以直接使用 `bg-background`、`bg-background-deep`、`bg-card`、`bg-accent`、`text-foreground`、`text-muted-foreground` 和 `border-border`,底层统一映射到 `--yee-*`。
|
|
83
89
|
|
|
90
|
+
## 通用业务组件
|
|
91
|
+
|
|
92
|
+
### YeeDescriptions
|
|
93
|
+
|
|
94
|
+
配置项使用稳定的 `name` 时,可通过 `content-${name}` 覆盖内容。`copyable` 仅复制展示值,`info` 用于补充说明。
|
|
95
|
+
|
|
96
|
+
```vue
|
|
97
|
+
<YeeDescriptions
|
|
98
|
+
bordered
|
|
99
|
+
:items="[
|
|
100
|
+
{ label: '订单号', name: 'orderNo', value: orderNo, copyable: true },
|
|
101
|
+
{ label: '状态', name: 'status', value: status },
|
|
102
|
+
]"
|
|
103
|
+
/>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### YeeFileUpload
|
|
107
|
+
|
|
108
|
+
组件不接受上传 URL,也不依赖业务请求客户端。自动上传由 `customRequest` 完成;手动模式监听 `file-select`,完成后调用组件实例的 `addResult(uid, { url, name? })` 或 `addError(uid)`。
|
|
109
|
+
|
|
110
|
+
```vue
|
|
111
|
+
<YeeFileUpload
|
|
112
|
+
v-model:file-list="fileList"
|
|
113
|
+
:custom-request="uploadFile"
|
|
114
|
+
@file-removed="removeFile"
|
|
115
|
+
/>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### YeeModal
|
|
119
|
+
|
|
120
|
+
使用标准 `v-model:open`。Modal 默认在 header 右侧显示全屏切换按钮,可通过 `v-model:fullscreen` 控制状态,或通过 `:fullscreen-button="false"` 隐藏。`type="drawer"` 适合长详情或复杂表单,不显示全屏按钮;`confirm` 只通知父组件,不会主动关闭,便于父组件在异步提交成功后再更新 `open`。
|
|
121
|
+
|
|
122
|
+
```vue
|
|
123
|
+
<YeeModal
|
|
124
|
+
v-model:fullscreen="fullscreen"
|
|
125
|
+
v-model:open="open"
|
|
126
|
+
title="提交确认"
|
|
127
|
+
@confirm="submit"
|
|
128
|
+
/>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### YeeSelect
|
|
132
|
+
|
|
133
|
+
`YeeSelect` 保持 Ant Design Vue `Select` 的透传能力,并针对当前选中项和默认 option 提供完整文案提示。
|
|
134
|
+
|
|
135
|
+
```vue
|
|
136
|
+
<YeeSelect v-model:value="status" :options="statusOptions" />
|
|
137
|
+
```
|
|
138
|
+
|
|
84
139
|
## YeePage 与 VXE Grid
|
|
85
140
|
|
|
86
141
|
```vue
|
|
@@ -153,3 +208,13 @@ pnpm install
|
|
|
153
208
|
pnpm check
|
|
154
209
|
pnpm pack --dry-run
|
|
155
210
|
```
|
|
211
|
+
|
|
212
|
+
## 组件演示
|
|
213
|
+
|
|
214
|
+
本地演示入口覆盖当前公共组件与 light/dark 主题切换:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
pnpm example
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
执行 `pnpm build:example` 可验证演示入口的生产构建。示例仅用于本地开发,不会打入 npm 包。
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { YeeDescriptionItem, YeeDescriptionsProps } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Partial<Record<`content-${string}`, (_: {
|
|
5
|
+
item: YeeDescriptionItem;
|
|
6
|
+
}) => any>> & Partial<Record<`content-${string}`, (_: {
|
|
7
|
+
item: YeeDescriptionItem;
|
|
8
|
+
}) => any>>;
|
|
9
|
+
refs: {};
|
|
10
|
+
rootEl: any;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<YeeDescriptionsProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<YeeDescriptionsProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StyleValue } from 'vue';
|
|
2
|
+
export interface YeeDescriptionItem {
|
|
3
|
+
copyable?: boolean;
|
|
4
|
+
ellipsis?: boolean;
|
|
5
|
+
info?: string;
|
|
6
|
+
infoStyle?: StyleValue;
|
|
7
|
+
label: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
span?: number;
|
|
10
|
+
value: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface YeeDescriptionsProps {
|
|
13
|
+
bordered?: boolean;
|
|
14
|
+
colon?: boolean;
|
|
15
|
+
column?: number;
|
|
16
|
+
items: readonly YeeDescriptionItem[];
|
|
17
|
+
layout?: 'horizontal' | 'vertical';
|
|
18
|
+
size?: 'default' | 'middle' | 'small';
|
|
19
|
+
title?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { YeeFileUploadProps, YeeUploadResult } from './types';
|
|
2
|
+
declare function addResult(uid: string, result: Required<Pick<YeeUploadResult, 'url'>> & YeeUploadResult): void;
|
|
3
|
+
declare function addError(uid: string): void;
|
|
4
|
+
declare function getFiles(): File[];
|
|
5
|
+
declare const _default: import('vue').DefineComponent<YeeFileUploadProps, {
|
|
6
|
+
addError: typeof addError;
|
|
7
|
+
addResult: typeof addResult;
|
|
8
|
+
getFiles: typeof getFiles;
|
|
9
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
fileRemoved: (file: import('ant-design-vue').UploadFile<unknown>) => any;
|
|
11
|
+
fileSelect: (payload: {
|
|
12
|
+
file: File;
|
|
13
|
+
uid: string;
|
|
14
|
+
}) => any;
|
|
15
|
+
"update:fileList": (fileList: import('ant-design-vue').UploadFile<unknown>[]) => any;
|
|
16
|
+
uploadSuccess: () => any;
|
|
17
|
+
uploadingChange: (isUploading: boolean) => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<YeeFileUploadProps> & Readonly<{
|
|
19
|
+
onFileRemoved?: (file: import('ant-design-vue').UploadFile<unknown>) => any;
|
|
20
|
+
onFileSelect?: (payload: {
|
|
21
|
+
file: File;
|
|
22
|
+
uid: string;
|
|
23
|
+
}) => any;
|
|
24
|
+
"onUpdate:fileList"?: (fileList: import('ant-design-vue').UploadFile<unknown>[]) => any;
|
|
25
|
+
onUploadSuccess?: () => any;
|
|
26
|
+
onUploadingChange?: (isUploading: boolean) => any;
|
|
27
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UploadProps } from 'ant-design-vue';
|
|
2
|
+
export type YeeUploadFile = NonNullable<NonNullable<UploadProps['fileList']>[number]>;
|
|
3
|
+
export interface YeeUploadResult {
|
|
4
|
+
name?: string;
|
|
5
|
+
url?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface YeeUploadRequestOptions {
|
|
8
|
+
file: File;
|
|
9
|
+
onError: (error: Error) => void;
|
|
10
|
+
onProgress: (percent: number) => void;
|
|
11
|
+
onSuccess: (result?: YeeUploadResult) => void;
|
|
12
|
+
uid: string;
|
|
13
|
+
}
|
|
14
|
+
export interface YeeFileUploadProps {
|
|
15
|
+
accept?: string;
|
|
16
|
+
customRequest?: (options: YeeUploadRequestOptions) => Promise<void> | void;
|
|
17
|
+
fileList?: YeeUploadFile[];
|
|
18
|
+
height?: number | string;
|
|
19
|
+
manual?: boolean;
|
|
20
|
+
maxCount?: number;
|
|
21
|
+
maxSize?: number;
|
|
22
|
+
multiple?: boolean;
|
|
23
|
+
readonly?: boolean;
|
|
24
|
+
uploadText?: string;
|
|
25
|
+
width?: number | string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { VNodeChild } from 'vue';
|
|
2
|
+
import { YeeModalProps } from './types';
|
|
3
|
+
type __VLS_Props = YeeModalProps;
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
'open'?: boolean;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: Readonly<{
|
|
10
|
+
closeIcon(): VNodeChild;
|
|
11
|
+
default(): VNodeChild;
|
|
12
|
+
footer(): VNodeChild;
|
|
13
|
+
header(): VNodeChild;
|
|
14
|
+
}> & {
|
|
15
|
+
closeIcon(): VNodeChild;
|
|
16
|
+
default(): VNodeChild;
|
|
17
|
+
footer(): VNodeChild;
|
|
18
|
+
header(): VNodeChild;
|
|
19
|
+
};
|
|
20
|
+
refs: {};
|
|
21
|
+
rootEl: any;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
24
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
25
|
+
close: () => any;
|
|
26
|
+
confirm: (event: Event) => any;
|
|
27
|
+
cancel: (event: Event) => any;
|
|
28
|
+
"update:fullscreen": (fullscreen: boolean) => any;
|
|
29
|
+
"update:open": (value: boolean) => any;
|
|
30
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
31
|
+
onClose?: () => any;
|
|
32
|
+
onConfirm?: (event: Event) => any;
|
|
33
|
+
onCancel?: (event: Event) => any;
|
|
34
|
+
"onUpdate:fullscreen"?: (fullscreen: boolean) => any;
|
|
35
|
+
"onUpdate:open"?: (value: boolean) => any;
|
|
36
|
+
}>, {
|
|
37
|
+
type: import('./types').YeeModalType;
|
|
38
|
+
title: string;
|
|
39
|
+
width: number | string;
|
|
40
|
+
keyboard: boolean;
|
|
41
|
+
closable: boolean;
|
|
42
|
+
maskClosable: boolean;
|
|
43
|
+
destroyOnClose: boolean;
|
|
44
|
+
cancelButtonText: string;
|
|
45
|
+
centered: boolean;
|
|
46
|
+
confirmButtonLoading: boolean;
|
|
47
|
+
confirmButtonText: string;
|
|
48
|
+
fullscreen: boolean;
|
|
49
|
+
fullscreenButton: boolean;
|
|
50
|
+
showCancelButton: boolean;
|
|
51
|
+
showConfirmButton: boolean;
|
|
52
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
53
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
54
|
+
export default _default;
|
|
55
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
56
|
+
new (): {
|
|
57
|
+
$slots: S;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StyleValue } from 'vue';
|
|
2
|
+
export type YeeModalType = 'drawer' | 'modal';
|
|
3
|
+
export interface YeeModalProps {
|
|
4
|
+
cancelButtonText?: string;
|
|
5
|
+
centered?: boolean;
|
|
6
|
+
closable?: boolean;
|
|
7
|
+
confirmButtonLoading?: boolean;
|
|
8
|
+
confirmButtonText?: string;
|
|
9
|
+
destroyOnClose?: boolean;
|
|
10
|
+
fullscreen?: boolean;
|
|
11
|
+
fullscreenButton?: boolean;
|
|
12
|
+
keyboard?: boolean;
|
|
13
|
+
maskClosable?: boolean;
|
|
14
|
+
showCancelButton?: boolean;
|
|
15
|
+
showConfirmButton?: boolean;
|
|
16
|
+
style?: StyleValue;
|
|
17
|
+
title?: string;
|
|
18
|
+
type?: YeeModalType;
|
|
19
|
+
width?: number | string;
|
|
20
|
+
wrapProps?: Record<string, unknown>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { YeeSelectProps, YeeSelectValue } from './types';
|
|
2
|
+
type __VLS_Props = YeeSelectProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
'value'?: YeeSelectValue;
|
|
5
|
+
} & __VLS_Props;
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: any): any;
|
|
10
|
+
option?(_: any): any;
|
|
11
|
+
tagRender?(_: any): any;
|
|
12
|
+
dropdownRender?(_: any): any;
|
|
13
|
+
notFoundContent?(_: any): any;
|
|
14
|
+
};
|
|
15
|
+
refs: {};
|
|
16
|
+
rootEl: any;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
19
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
+
"update:value": (value: (string | number) | import('ant-design-vue/es/select').LabeledValue | (string | number)[] | import('ant-design-vue/es/select').LabeledValue[] | undefined) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
+
"onUpdate:value"?: (value: (string | number) | import('ant-design-vue/es/select').LabeledValue | (string | number)[] | import('ant-design-vue/es/select').LabeledValue[] | undefined) => any;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SelectProps } from 'ant-design-vue';
|
|
2
|
+
export interface YeeSelectOption {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
label?: unknown;
|
|
5
|
+
options?: YeeSelectOption[];
|
|
6
|
+
title?: unknown;
|
|
7
|
+
value?: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface YeeSelectFieldNames {
|
|
10
|
+
label: string;
|
|
11
|
+
options: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
export type YeeSelectValue = SelectProps['value'];
|
|
15
|
+
export interface YeeSelectProps {
|
|
16
|
+
fieldNames?: YeeSelectFieldNames;
|
|
17
|
+
options?: YeeSelectOption[];
|
|
18
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export { default as PlatformConfigProvider } from './components/PlatformConfigProvider.vue';
|
|
2
|
+
export * from './components/descriptions';
|
|
3
|
+
export * from './components/file-upload';
|
|
2
4
|
export * from './components/form';
|
|
3
5
|
export * from './components/grid';
|
|
6
|
+
export * from './components/modal';
|
|
4
7
|
export * from './components/page';
|
|
8
|
+
export * from './components/select';
|
|
5
9
|
export { toAntDesignTheme } from './theme/ant-theme';
|
|
6
10
|
export { platformThemeKey, usePlatformTheme } from './theme/context';
|
|
7
11
|
export { toPlatformCssVariables } from './theme/css-variables';
|