yc-vep-ui 0.0.36 → 0.0.37

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,18 @@
1
+ import { ICardProps } from './type.d';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: any;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<ICardProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ICardProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
13
+ export default _default;
14
+ type __VLS_WithTemplateSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,6 @@
1
+ export interface ICardProps {
2
+ title?: string
3
+ bodyClass?: string
4
+ hideBorder?: boolean
5
+ icon?: string
6
+ }
@@ -0,0 +1,16 @@
1
+ import { IDescriptionsProps } from './type.d';
2
+ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & IDescriptionsProps<T> & Partial<{}>> & import('vue').PublicProps;
4
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
5
+ attrs: any;
6
+ slots: {
7
+ title?(_: {}): any;
8
+ };
9
+ emit: {};
10
+ }>) => import('vue').VNode & {
11
+ __ctx?: Awaited<typeof __VLS_setup>;
12
+ };
13
+ export default _default;
14
+ type __VLS_PrettifyLocal<T> = {
15
+ [K in keyof T]: T[K];
16
+ } & {};
@@ -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,20 @@
1
+ import { Component } from 'vue';
2
+ interface IProps {
3
+ visible: boolean;
4
+ width?: string;
5
+ disabled?: boolean;
6
+ component: Component;
7
+ componentProps?: Record<string, any>;
8
+ }
9
+ declare const _default: import('vue').DefineComponent<IProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ close: (...args: any[]) => void;
11
+ submit: (...args: any[]) => void;
12
+ "update:visible": (...args: any[]) => void;
13
+ }, string, import('vue').PublicProps, Readonly<IProps> & Readonly<{
14
+ onClose?: ((...args: any[]) => any) | undefined;
15
+ onSubmit?: ((...args: any[]) => any) | undefined;
16
+ "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
18
+ slotRef: unknown;
19
+ }, any>;
20
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { IEditorProps } from './type.d';
2
+ type __VLS_Props = IEditorProps;
3
+ declare const modelValue: import('vue').ModelRef<string, string, string, string>;
4
+ type __VLS_PublicProps = {
5
+ modelValue?: typeof modelValue['value'];
6
+ } & __VLS_Props;
7
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ change: (...args: any[]) => void;
9
+ "update:modelValue": (value: string) => void;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
+ onChange?: ((...args: any[]) => any) | undefined;
12
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
14
+ editorRef: HTMLDivElement;
15
+ }, HTMLDivElement>;
16
+ export default _default;
@@ -0,0 +1,4 @@
1
+ export interface IEditorProps {
2
+ defaultValue?: string
3
+ disabled?: boolean
4
+ }
@@ -0,0 +1,28 @@
1
+ import { IFilterProps } from './type.d';
2
+ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly onSearch?: ((...args: any[]) => any) | undefined;
5
+ readonly onReset?: ((...args: any[]) => any) | undefined;
6
+ readonly onSubmit?: ((...args: any[]) => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onReset" | "onSubmit" | "onSearch"> & IFilterProps<T> & Partial<{}>> & import('vue').PublicProps;
8
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
9
+ attrs: any;
10
+ slots: {
11
+ left?(_: {
12
+ form: import('@vue/reactivity').DistributeRef<import('vue').Reactive<T>>;
13
+ }): any;
14
+ handle?(_: {
15
+ form: import('@vue/reactivity').DistributeRef<import('vue').Reactive<T>>;
16
+ }): any;
17
+ right?(_: {
18
+ form: import('@vue/reactivity').DistributeRef<import('vue').Reactive<T>>;
19
+ }): any;
20
+ };
21
+ emit: (event: "search" | "reset" | "submit", ...args: any[]) => void;
22
+ }>) => import('vue').VNode & {
23
+ __ctx?: Awaited<typeof __VLS_setup>;
24
+ };
25
+ export default _default;
26
+ type __VLS_PrettifyLocal<T> = {
27
+ [K in keyof T]: T[K];
28
+ } & {};
@@ -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,24 @@
1
+ import { IFormProps, IFormInstance } from '../type';
2
+ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly onReset?: ((...args: any[]) => any) | undefined;
5
+ readonly onSubmit?: ((...args: any[]) => any) | undefined;
6
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onReset" | "onSubmit"> & IFormProps<T> & Partial<{}>> & import('vue').PublicProps;
7
+ expose(exposed: import('vue').ShallowUnwrapRef<IFormInstance>): void;
8
+ attrs: any;
9
+ slots: {
10
+ default?(_: {
11
+ form: import('@vue/reactivity').DistributeRef<import('vue').Reactive<T>>;
12
+ }): any;
13
+ handle?(_: {
14
+ form: import('@vue/reactivity').DistributeRef<import('vue').Reactive<T>>;
15
+ }): any;
16
+ };
17
+ emit: (event: "reset" | "submit", ...args: any[]) => void;
18
+ }>) => import('vue').VNode & {
19
+ __ctx?: Awaited<typeof __VLS_setup>;
20
+ };
21
+ export default _default;
22
+ type __VLS_PrettifyLocal<T> = {
23
+ [K in keyof T]: T[K];
24
+ } & {};
@@ -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,22 @@
1
+ import { IInfiniteScrollProps } from './type.d';
2
+ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly "onNode-click"?: ((...args: any[]) => any) | undefined;
5
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onNode-click"> & IInfiniteScrollProps<T> & Partial<{}>> & import('vue').PublicProps;
6
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
7
+ attrs: any;
8
+ slots: {
9
+ plus?(_: {}): any;
10
+ handle?(_: {}): any;
11
+ itemHandle?(_: {
12
+ data: T;
13
+ }): any;
14
+ };
15
+ emit: (event: "node-click", ...args: any[]) => void;
16
+ }>) => import('vue').VNode & {
17
+ __ctx?: Awaited<typeof __VLS_setup>;
18
+ };
19
+ export default _default;
20
+ type __VLS_PrettifyLocal<T> = {
21
+ [K in keyof T]: T[K];
22
+ } & {};
@@ -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,22 @@
1
+ import { IColumn } from './type.d';
2
+ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly "onUpdate:data"?: ((...args: any[]) => any) | undefined;
5
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:data"> & {
6
+ key?: string;
7
+ data: T[];
8
+ column: IColumn<T>;
9
+ align?: "center" | "left" | "right";
10
+ size?: "large" | "default" | "small";
11
+ } & Partial<{}>> & import('vue').PublicProps;
12
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
13
+ attrs: any;
14
+ slots: {};
15
+ emit: (event: "update:data", ...args: any[]) => void;
16
+ }>) => import('vue').VNode & {
17
+ __ctx?: Awaited<typeof __VLS_setup>;
18
+ };
19
+ export default _default;
20
+ type __VLS_PrettifyLocal<T> = {
21
+ [K in keyof T]: T[K];
22
+ } & {};
@@ -0,0 +1,18 @@
1
+ import { ITableProps } from './type';
2
+ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly onPagination?: ((...args: any[]) => any) | undefined;
5
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onPagination"> & ITableProps<T> & Partial<{}>> & import('vue').PublicProps;
6
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
7
+ attrs: any;
8
+ slots: {
9
+ default?(_: {}): any;
10
+ };
11
+ emit: (event: "pagination", ...args: any[]) => void;
12
+ }>) => import('vue').VNode & {
13
+ __ctx?: Awaited<typeof __VLS_setup>;
14
+ };
15
+ export default _default;
16
+ type __VLS_PrettifyLocal<T> = {
17
+ [K in keyof T]: T[K];
18
+ } & {};
@@ -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,31 @@
1
+ import { ITreeProps } from './type';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ handle?(_: {
6
+ style: {};
7
+ }): any;
8
+ 'node-handle'?(_: {
9
+ data: any;
10
+ }): any;
11
+ };
12
+ refs: {
13
+ treeRef: unknown;
14
+ };
15
+ rootEl: HTMLDivElement;
16
+ };
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
+ declare const __VLS_component: import('vue').DefineComponent<ITreeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
+ change: (...args: any[]) => void;
20
+ }, string, import('vue').PublicProps, Readonly<ITreeProps> & Readonly<{
21
+ onChange?: ((...args: any[]) => any) | undefined;
22
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
23
+ treeRef: unknown;
24
+ }, HTMLDivElement>;
25
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
26
+ export default _default;
27
+ type __VLS_WithTemplateSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };
@@ -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,10 @@
1
+ import { default as UiCard } from './Card/index.vue';
2
+ import { default as UiTable } from './Table/index.vue';
3
+ import { default as UiFilter } from './Filter/index.vue';
4
+ import { default as UiForm } from './Form/index.vue';
5
+ import { default as UiEditor } from './Editor/index.vue';
6
+ import { default as UiTree } from './Tree/index.vue';
7
+ import { default as UiInfiniteScroll } from './InfiniteScroll/index.vue';
8
+ import { default as UiDescriptions } from './Descriptions/index.vue';
9
+ import { default as UiDialog } from './Dialog/index.vue';
10
+ export { UiCard, UiTable, UiFilter, UiForm, UiEditor, UiTree, UiInfiniteScroll, UiDescriptions, UiDialog };
@@ -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'
@@ -0,0 +1,70 @@
1
+ import { LinkProps, TagProps, SwitchProps, SelectProps, DatePickerProps, InputProps, InputTagProps, TimeSelectProps, ButtonProps, InputNumberProps, RadioGroupProps, TextProps } from 'element-plus';
2
+ declare function button(props: ButtonProps | ButtonProps[]): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
3
+ [key: string]: any;
4
+ }>;
5
+ declare function link(props: LinkProps & {
6
+ prop: string;
7
+ lineClamp?: number;
8
+ type?: 'primary' | 'success' | 'warning' | 'info' | 'danger';
9
+ }): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
10
+ [key: string]: any;
11
+ }>;
12
+ declare function tag(props: TagProps & {
13
+ prop: string;
14
+ }): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
15
+ [key: string]: any;
16
+ }>;
17
+ declare function _switch(props: SwitchProps): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
18
+ [key: string]: any;
19
+ }>;
20
+ declare function select(props: SelectProps): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
21
+ [key: string]: any;
22
+ }>;
23
+ declare function datePicker(props: DatePickerProps & {
24
+ onChange?: (val: string) => void;
25
+ }): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
26
+ [key: string]: any;
27
+ }>;
28
+ declare function timeSelect(props: TimeSelectProps): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
29
+ [key: string]: any;
30
+ }>;
31
+ declare function input(props: InputProps): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
32
+ [key: string]: any;
33
+ }>;
34
+ declare function inputNumber(props: InputNumberProps): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
35
+ [key: string]: any;
36
+ }>;
37
+ declare function textarea(props: InputProps): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
38
+ [key: string]: any;
39
+ }>;
40
+ declare function inputTag(props: InputTagProps): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
41
+ [key: string]: any;
42
+ }>;
43
+ declare function editor(props: any): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
44
+ [key: string]: any;
45
+ }>;
46
+ declare function radio(props: RadioGroupProps): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
47
+ [key: string]: any;
48
+ }>;
49
+ declare function text(props: TextProps & {
50
+ prop: string;
51
+ }): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
52
+ [key: string]: any;
53
+ }>;
54
+ declare const _default: {
55
+ button: typeof button;
56
+ link: typeof link;
57
+ tag: typeof tag;
58
+ switch: typeof _switch;
59
+ select: typeof select;
60
+ datePicker: typeof datePicker;
61
+ timeSelect: typeof timeSelect;
62
+ input: typeof input;
63
+ inputNumber: typeof inputNumber;
64
+ textarea: typeof textarea;
65
+ inputTag: typeof inputTag;
66
+ editor: typeof editor;
67
+ radio: typeof radio;
68
+ text: typeof text;
69
+ };
70
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { IField } from '../type';
2
+ export declare function getLabelWidth(width?: string | number): string;
3
+ export declare function getValueWidth(width: number | string): string;
4
+ export declare function getRenderAttr<T>(field: IField<T>, data: T): any;
5
+ export declare function renderNode<T>(field: IField<T>, data: T): any;
@@ -0,0 +1,16 @@
1
+ import type { ComponentResolver } from 'unplugin-vue-components/types'
2
+
3
+ export interface YcVepUiResolverOptions {
4
+ /**
5
+ * 组件前缀(默认 'Ui')
6
+ * @default 'Ui'
7
+ */
8
+ prefix?: string
9
+ }
10
+
11
+ /**
12
+ * yc-vep-ui 组件库的自动导入解析器
13
+ */
14
+ export declare function YcVepUiResolver(options?: YcVepUiResolverOptions): ComponentResolver
15
+
16
+ export default YcVepUiResolver
@@ -0,0 +1,65 @@
1
+ /**
2
+ * unplugin-vue-components 解析器
3
+ * 用于自动导入 yc-vep-ui 组件
4
+ *
5
+ * 使用方式:
6
+ * ```ts
7
+ * import Components from 'unplugin-vue-components/vite'
8
+ * import { YcVepUiResolver } from 'yc-vep-ui/resolver'
9
+ *
10
+ * export default defineConfig({
11
+ * plugins: [
12
+ * Components({
13
+ * resolvers: [YcVepUiResolver()],
14
+ * }),
15
+ * ],
16
+ * })
17
+ * ```
18
+ */
19
+
20
+ /**
21
+ * @typedef {Object} YcVepUiResolverOptions
22
+ * @property {string} [prefix='Ui'] - 组件前缀
23
+ */
24
+
25
+ /**
26
+ * yc-vep-ui 组件库的自动导入解析器
27
+ * @param {YcVepUiResolverOptions} [options={}]
28
+ * @returns {import('unplugin-vue-components/types').ComponentResolver}
29
+ */
30
+ export function YcVepUiResolver(options = {}) {
31
+ const { prefix = 'Ui' } = options
32
+
33
+ return {
34
+ type: 'component',
35
+ resolve: (name) => {
36
+ // 匹配以 Ui 开头的组件名
37
+ if (name.startsWith(prefix)) {
38
+ const componentName = name.slice(prefix.length)
39
+
40
+ // 组件名称映射(将驼峰命名转换为实际的文件名)
41
+ const componentMap = {
42
+ Card: 'Card',
43
+ Table: 'Table',
44
+ Filter: 'Filter',
45
+ Form: 'Form',
46
+ Editor: 'Editor',
47
+ Tree: 'Tree',
48
+ InfiniteScroll: 'InfiniteScroll',
49
+ Descriptions: 'Descriptions',
50
+ Dialog: 'Dialog',
51
+ }
52
+
53
+ const mappedName = componentMap[componentName]
54
+ if (mappedName) {
55
+ return {
56
+ name: `Ui${mappedName}`,
57
+ from: 'yc-vep-ui',
58
+ }
59
+ }
60
+ }
61
+ },
62
+ }
63
+ }
64
+
65
+ export default YcVepUiResolver