yc-vep-ui 0.0.25 → 0.0.26

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.
@@ -0,0 +1,6 @@
1
+ export interface ICardProps {
2
+ title?: string
3
+ bodyClass?: string
4
+ hideBorder?: boolean
5
+ icon?: string
6
+ }
@@ -0,0 +1,15 @@
1
+ import type { DescriptionProps } from 'element-plus'
2
+
3
+ export interface IDescriptionsField<T> {
4
+ label: string
5
+ prop: keyof T
6
+ render?: (props: IDescriptionsRenderProps) => VNode | string | number
7
+ span?: number
8
+ }
9
+
10
+ export interface IDescriptionsProps<T> extends DescriptionProps<T> {
11
+ data: T
12
+ fields: IDescriptionsField<T>[]
13
+ column?: number
14
+ title?: string
15
+ }
@@ -0,0 +1,4 @@
1
+ export interface IEditorProps {
2
+ defaultValue?: string
3
+ disabled?: boolean
4
+ }
@@ -0,0 +1,48 @@
1
+ import type { IRender } from '..'
2
+
3
+ interface IFieldSlot<T> extends IField<T> {
4
+ prop: string
5
+ width?: number
6
+ render?: (props: IFilterRenderProps<T>) => VNode | string | number
7
+ defaultValue?: any
8
+ placeholder?: string
9
+ }
10
+
11
+ // 表格筛选
12
+ export interface IField<T> {
13
+ label?: string
14
+ prop?: keyof T
15
+ required?: boolean
16
+ rules?: Record<string, any>
17
+ span?: number
18
+ slots?: IFieldSlot<T>[]
19
+ /** 整个宽度 */
20
+ width?: number
21
+ /** label宽度 */
22
+ labelWidth?: number
23
+ /** value宽度 */
24
+ valueWidth?: number
25
+ render?: (props: IFilterRenderProps<T>) => VNode | string | number | symbol
26
+ }
27
+
28
+ type IFilterRenderProps<T> = {
29
+ h: IRender
30
+ data: T
31
+ }
32
+
33
+ export interface IFilterProps<T> {
34
+ type?: 'default' | 'simple'
35
+ size?: 'small' | 'default' | 'large'
36
+ fields: IField<T>[]
37
+ expandNum?: number
38
+ valueWidth?: string
39
+ labelWidth?: string
40
+ /** 重置需要省略的字段 */
41
+ omitFields?: (keyof T)[]
42
+ rules?: Record<string, any>
43
+ required?: boolean
44
+ /** 每行显示的字段数量,默认为4 */
45
+ column?: number
46
+ // 每次请求的固定值
47
+ filterFixedValues?: Record<string, any>
48
+ }
@@ -0,0 +1,33 @@
1
+ import type { FormInstance } from 'element-plus'
2
+ import type { IField } from '../Filter/type'
3
+
4
+ export interface IFormProps<T> {
5
+ fields: IField<T>[]
6
+ /** 下拉框展开数量 */
7
+ expandNum?: number
8
+ valueWidth?: string
9
+ labelWidth?: string
10
+ labelPosition?: 'top' | 'left' | 'right'
11
+ /** 重置需要省略的字段 */
12
+ omitFields?: (keyof T)[]
13
+ rules?: Record<string, any> | Reactive<Record<string, any>>
14
+ /** 必填 */
15
+ required?: boolean
16
+ /** 每行显示的字段数量,默认为4 */
17
+ column?: number
18
+ /** 默认值 */
19
+ defaultValues?: Record<string, any>
20
+ /** 表单双向绑定 (配合 v-model:form 使用) */
21
+ form?: Record<string, any>
22
+ valueModel?: 'default' | 'underline'
23
+ /** 按钮尺寸 */
24
+ size?: '' | 'small' | 'default' | 'large'
25
+ }
26
+
27
+ export interface IFormInstance {
28
+ getValues: () => Reactive<Record<string, any>>
29
+ setValues: (values: Record<string, any>) => void
30
+ clearValidate: () => void
31
+ onSubmit: (el: FormInstance) => void
32
+ validate: () => Promise<any>
33
+ }
@@ -0,0 +1,8 @@
1
+ export interface IInfiniteScrollProps<T> {
2
+ loading?: Ref<boolean>
3
+ data: T[]
4
+ placeholder?: string
5
+ props?: Record<string, string>
6
+ vInfiniteScroll?: () => void
7
+ filterable?: boolean
8
+ }
@@ -0,0 +1,101 @@
1
+ import type { VNode } from 'vue'
2
+
3
+ export interface IRender {
4
+ button: (props: ButtonProps | ButtonProps[]) => VNode | string | number
5
+ link: (props?: LinkProps) => VNode | string | number
6
+ tag: (props?: TagProps | TagProps[]) => VNode | string | number
7
+ switch: (props?: SwitchProps) => VNode | string | number
8
+ select: (props?: SelectProps) => VNode | string | number
9
+ datePicker: (props?: DatePickerProps) => VNode | string | number
10
+ timeSelect: (props?: TimeSelectProps) => VNode | string | number
11
+ input: (props?: InputProps) => VNode | string | number
12
+ inputNumber: (props?: InputNumberProps) => VNode | string | number
13
+ textarea: (props?: InputProps) => VNode | string | number
14
+ inputTag: (props?: InputTagProps) => VNode | string | number
15
+ staffSelect: (props?: IStaffSelectProps) => VNode | string | number
16
+ editor: (props?: any) => VNode | string | number
17
+ radio: (props?: RadioProps) => VNode | string | number
18
+ upload: (props?: IUploadProps) => VNode | string | number
19
+ text: (props?: TextProps) => VNode | string | number
20
+ }
21
+
22
+ export type IRenderProps =
23
+ | ButtonProps
24
+ | ButtonProps[]
25
+ | LinkProps
26
+ | TagProps
27
+ | TagProps[]
28
+ | SwitchProps
29
+ | SelectProps
30
+ | DatePickerProps
31
+ | InputProps
32
+ | InputNumberProps
33
+ | InputTagProps
34
+ | TimeSelectProps
35
+ | IStaffSelectProps
36
+ | RadioProps
37
+ | IUploadProps
38
+ | TextProps
39
+
40
+ // 组件属性扩展
41
+ export interface IExtra {
42
+ width?: string | number
43
+ sortable?: boolean
44
+ }
45
+
46
+ export interface IColumn<T> extends IExtra {
47
+ type?: 'index' | 'selection'
48
+ label?: string
49
+ prop?: keyof T
50
+ fixed?: 'left' | 'right' | boolean
51
+ showOverflowTooltip?: boolean
52
+ render?: (props: IColumnRenderProps<T>) => VNode | string | number
53
+ children?: IColumn<T>[]
54
+ lineClamp?: number // 文本行数限制
55
+ }
56
+
57
+ type IColumnRenderProps<T> = {
58
+ h: IRender
59
+ data: T
60
+ index?: number
61
+ column?: IColumn<T>
62
+ }
63
+
64
+ export interface ITableProps<T> {
65
+ /** 加载状态 */
66
+ loading?: boolean | Ref<boolean>
67
+ /** 是否显示边框 */
68
+ border?: boolean
69
+ /** 表格尺寸 */
70
+ size?: 'large' | 'default' | 'small'
71
+ /** 表格数据 */
72
+ data: Reactive<T[]>
73
+ /** 表格列 */
74
+ columns: IColumn<T>[]
75
+ /** 表格对齐方式 */
76
+ align?: 'center' | 'left' | 'right'
77
+ /** 是否隐藏分页 */
78
+ hidePagination?: boolean
79
+ /** 分页数据 */
80
+ pagination?: Reactive<{ page: number; pageSize: number; total: number; pageSizes?: number[] }>
81
+ /** 当前行改变时触发 */
82
+ currentChange?: (currentRow: T, oldCurrentRow: T) => void
83
+ /** 选择项改变时触发 */
84
+ selectionChange?: (selection: Array<T>) => void
85
+ /** 是否可选择 */
86
+ selectable?: (row: T) => boolean
87
+ /** 默认选中的rowKey */
88
+ defaultCheckedKeys?: any[]
89
+ rowKey?: keyof T
90
+ }
91
+
92
+ export interface ITableInstance<T = any> {
93
+ columns: IColumn<T>[]
94
+ data: Reactive<T[]>
95
+ loading: boolean
96
+ pagination: Reactive<{ page: number; pageSize: number; total: number }>
97
+ selection: Array<T>
98
+ currentRow: T | null
99
+ // 任意
100
+ [key: string]: any
101
+ }
@@ -0,0 +1,21 @@
1
+ import type { TreeNodeData } from 'element-plus'
2
+ export interface ITreeProps {
3
+ id?: string
4
+ data: TreeNodeData[]
5
+ filterable?: boolean
6
+ placeholder?: string
7
+ /** 因此添加操作节点 */
8
+ hidePlusHandle?: boolean
9
+ /** 隐藏节点添加子目录按钮 */
10
+ hideNodeAdd?: boolean
11
+ /** 隐藏节点的编辑按钮 */
12
+ hideNodeEdit?: boolean
13
+ /** 隐藏节点的删除按钮 */
14
+ hideNodeDel?: boolean
15
+ /** 隐藏所偶遇节点操作 */
16
+ hideNodeHandle?: boolean
17
+ nodeKey?: string
18
+ props?: {
19
+ label?: string
20
+ }
21
+ }
@@ -0,0 +1,9 @@
1
+ export type IProp = string | number | boolean | null | undefined
2
+ export * from './Table/type'
3
+ export * from './Filter/type'
4
+ export * from './Form/type'
5
+ export * from './Descriptions/type'
6
+ export * from './InfiniteScroll/type'
7
+ export * from './Tree/type'
8
+ export * from './Card/type'
9
+ export * from './Editor/type'
package/dist/entry.d.ts CHANGED
@@ -18,6 +18,7 @@ export type { ITreeProps } from './components/Tree/type';
18
18
  export type { IInfiniteScrollProps } from './components/InfiniteScroll/type';
19
19
  export type { IEditorProps } from './components/Editor/type';
20
20
  export type { ICardProps } from './components/Card/type';
21
+ export type * from 'element-plus';
21
22
  declare const _default: {
22
23
  install(app: App): void;
23
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yc-vep-ui",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "type": "module",
5
5
  "description": "基于 Vue 3 + Element Plus 的企业级 UI 组件库",
6
6
  "keywords": [