UNPKG

@coderjc/element-plus-pro

Version:

基于 Element Plus 二次封装的业务组件库

1,150 lines (994 loc) 35.1 kB
import { App } from 'vue'; import type { AppContext } from 'vue'; import type { ButtonType } from 'element-plus'; import type { CascaderInstance } from 'element-plus'; import type { CheckboxGroupProps } from 'element-plus'; import type { ColorPickerProps } from 'element-plus'; import { ColProps } from 'element-plus'; import { Component } from 'vue'; import { ComponentOptionsMixin } from 'vue'; import { ComponentProvideOptions } from 'vue'; import type { ComponentSize } from 'element-plus'; import type { DatePickType } from 'element-plus'; import { DefineComponent } from 'vue'; import type { DialogProps } from 'element-plus'; import type { Directive } from 'vue'; import type { DrawerProps } from 'element-plus'; import type { EmitsOptions } from 'vue'; import { ExtractPropTypes } from 'vue'; import { FormInstance } from 'element-plus'; import type { FormItemProps } from 'element-plus'; import type { InputNumberProps } from 'element-plus'; import type { InputProps } from 'element-plus'; import { OperationColumnConfig as OperationColumnConfig_2 } from 'packages/element-plus-pro/index.js'; import type { Plugin as Plugin_2 } from 'vue'; import type { ProgressProps } from 'element-plus'; import { PropType } from 'vue'; import { PublicProps } from 'vue'; import type { RadioGroupProps } from 'element-plus'; import type { SelectProps } from 'element-plus'; import type { SetupContext } from 'vue'; import type { SwitchProps } from 'element-plus'; import type { TableColumnInstance } from 'element-plus'; import type { TagProps } from 'element-plus'; import type { TimePickerDefaultPropsPublic } from 'element-plus'; declare const __VLS_component: DefineComponent<ExtractPropTypes< { readonly modelValue: { readonly type: PropType<Record<string, any>>; readonly default: () => {}; }; readonly formItems: { readonly type: PropType<ProFormItemConfig[]>; readonly default: () => never[]; }; readonly gutter: { readonly type: PropType<number>; readonly default: 0; }; readonly col: { readonly type: PropType<Partial<ColProps>>; readonly default: () => { span: number; }; }; readonly footerConfig: { readonly type: PropType<ProFormFooterConfig | null>; readonly default: () => {}; }; }>, FormInstance, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { reset: () => void; submit: (value: any) => void; "update:modelValue": (value: any) => void; }, string, PublicProps, Readonly<ExtractPropTypes< { readonly modelValue: { readonly type: PropType<Record<string, any>>; readonly default: () => {}; }; readonly formItems: { readonly type: PropType<ProFormItemConfig[]>; readonly default: () => never[]; }; readonly gutter: { readonly type: PropType<number>; readonly default: 0; }; readonly col: { readonly type: PropType<Partial<ColProps>>; readonly default: () => { span: number; }; }; readonly footerConfig: { readonly type: PropType<ProFormFooterConfig | null>; readonly default: () => {}; }; }>> & Readonly<{ onReset?: (() => any) | undefined; onSubmit?: ((value: any) => any) | undefined; "onUpdate:modelValue"?: ((value: any) => any) | undefined; }>, { readonly col: Partial<ColProps>; readonly modelValue: Record<string, any>; readonly formItems: ProFormItemConfig[]; readonly gutter: number; readonly footerConfig: ProFormFooterConfig | null; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_2: DefineComponent<ExtractPropTypes< { readonly data: { readonly type: ArrayConstructor; readonly default: () => never[]; }; readonly tableColumns: { readonly type: PropType<ProTableColumnType[]>; readonly default: () => never[]; }; readonly operationColumn: { readonly type: PropType<OperationColumnConfig_2 | null>; readonly default: null; }; readonly align: { readonly type: PropType<"left" | "center" | "right">; readonly default: "center"; }; readonly requestApi: { readonly type: PropType<(params: any) => Promise<any>>; }; readonly requestAuto: { readonly type: BooleanConstructor; readonly default: true; }; readonly requestError: { readonly type: PropType<(params: any) => void>; }; readonly dataCallback: { readonly type: PropType<(data: any) => any>; }; readonly componentStyle: { readonly type: PropType<"" | "card">; readonly default: "card"; }; readonly pagination: { readonly type: BooleanConstructor; readonly default: true; }; readonly title: { readonly type: StringConstructor; readonly default: ""; }; readonly showHeader: { readonly type: BooleanConstructor; readonly default: true; }; readonly toolButton: { readonly type: PropType<("refresh" | "setting" | "search")[] | boolean>; readonly default: () => string[]; }; readonly initParams: { readonly type: ObjectConstructor; readonly default: () => {}; }; readonly selection: { readonly type: BooleanConstructor; readonly default: false; }; readonly loading: { readonly type: BooleanConstructor; readonly default: true; }; readonly page: { readonly type: NumberConstructor; readonly default: 1; }; readonly pageSize: { readonly type: NumberConstructor; readonly default: 10; }; readonly pageSizes: { readonly type: PropType<number[]>; readonly default: () => number[]; }; }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { cellChange: (row: Record<string, any>, column: ProTableColumnType, newValue: any) => void; }, string, PublicProps, Readonly<ExtractPropTypes< { readonly data: { readonly type: ArrayConstructor; readonly default: () => never[]; }; readonly tableColumns: { readonly type: PropType<ProTableColumnType[]>; readonly default: () => never[]; }; readonly operationColumn: { readonly type: PropType<OperationColumnConfig_2 | null>; readonly default: null; }; readonly align: { readonly type: PropType<"left" | "center" | "right">; readonly default: "center"; }; readonly requestApi: { readonly type: PropType<(params: any) => Promise<any>>; }; readonly requestAuto: { readonly type: BooleanConstructor; readonly default: true; }; readonly requestError: { readonly type: PropType<(params: any) => void>; }; readonly dataCallback: { readonly type: PropType<(data: any) => any>; }; readonly componentStyle: { readonly type: PropType<"" | "card">; readonly default: "card"; }; readonly pagination: { readonly type: BooleanConstructor; readonly default: true; }; readonly title: { readonly type: StringConstructor; readonly default: ""; }; readonly showHeader: { readonly type: BooleanConstructor; readonly default: true; }; readonly toolButton: { readonly type: PropType<("refresh" | "setting" | "search")[] | boolean>; readonly default: () => string[]; }; readonly initParams: { readonly type: ObjectConstructor; readonly default: () => {}; }; readonly selection: { readonly type: BooleanConstructor; readonly default: false; }; readonly loading: { readonly type: BooleanConstructor; readonly default: true; }; readonly page: { readonly type: NumberConstructor; readonly default: 1; }; readonly pageSize: { readonly type: NumberConstructor; readonly default: 10; }; readonly pageSizes: { readonly type: PropType<number[]>; readonly default: () => number[]; }; }>> & Readonly<{ onCellChange?: ((row: Record<string, any>, column: ProTableColumnType, newValue: any) => any) | undefined; }>, { readonly data: unknown[]; readonly title: string; readonly align: "center" | "left" | "right"; readonly loading: boolean; readonly initParams: Record<string, any>; readonly tableColumns: ProTableColumnType[]; readonly operationColumn: OperationColumnConfig_2 | null; readonly requestAuto: boolean; readonly componentStyle: "" | "card"; readonly pagination: boolean; readonly showHeader: boolean; readonly toolButton: boolean | ("search" | "refresh" | "setting")[]; readonly selection: boolean; readonly page: number; readonly pageSize: number; readonly pageSizes: number[]; }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_3: DefineComponent< { modelValue?: any; }, DrawerExpose, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { "update:visible": (value: boolean) => void; }, string, PublicProps, Readonly<{ modelValue?: any; }> & Readonly<{ "onUpdate:visible"?: ((value: boolean) => any) | undefined; }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_4: DefineComponent< { modelValue?: any; autoHeight?: any; }, DialogExpose, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { "update:modelValue": (value: boolean) => void; }, string, PublicProps, Readonly<{ modelValue?: any; autoHeight?: any; }> & Readonly<{ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined; }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare const __VLS_component_5: DefineComponent< { modelValue?: any; formData?: any; formProps?: any; }, { proFormInstance: FormInstance; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { submit: (value: any) => void; "update:modelValue": (value: boolean) => void; "update:formData": (value: Record<string, any>) => void; }, string, PublicProps, Readonly<{ modelValue?: any; formData?: any; formProps?: any; }> & Readonly<{ onSubmit?: ((value: any) => any) | undefined; "onUpdate:modelValue"?: ((value: boolean) => any) | undefined; "onUpdate:formData"?: ((value: Record<string, any>) => any) | undefined; }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; declare type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_30>]?: (props: typeof __VLS_31) => any; } & { [K in NonNullable<typeof __VLS_39>]?: (props: typeof __VLS_40) => any; } & { footer?: (props: typeof __VLS_57) => any; }; declare type __VLS_Slots_2 = {} & { [K in NonNullable<typeof __VLS_28>]?: (props: typeof __VLS_29) => any; } & { tableHeader?: (props: typeof __VLS_10) => any; } & { toolButton?: (props: typeof __VLS_12) => any; }; declare type __VLS_Slots_3 = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any; }; declare type __VLS_Slots_4 = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any; }; declare type __VLS_Slots_5 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof __VLS_17) => any; } & { footer?: (props: typeof __VLS_20) => any; }; declare type __VLS_WithSlots<T, S> = T & { new (): { $slots: S; }; }; declare type __VLS_WithSlots_2<T, S> = T & { new (): { $slots: S; }; }; declare type __VLS_WithSlots_3<T, S> = T & { new (): { $slots: S; }; }; declare type __VLS_WithSlots_4<T, S> = T & { new (): { $slots: S; }; }; declare type __VLS_WithSlots_5<T, S> = T & { new (): { $slots: S; }; }; /** * 通用类型断言函数 - 将可选类型断言为必需类型 * 用于处理经过处理函数后,原本可选的属性变为必需的情况 */ export declare function assertRequired<T>(value: T): NonNullable<T>; declare interface BaseSearchType { label?: string | Component; } export declare interface BtnConfig { text?: string; onClick?: Function; icon?: string | Component; disabled?: boolean; type?: Omit<ButtonType, 'text'>; plain?: boolean; } declare interface CascaderSearchType extends BaseSearchType, MyFormItemPropsByCascaderWithTopLevel { } export declare type CellConfig = PresetCellType | CellRenderConfig | PresetCellTypeProps; export declare interface CellRenderConfig { /** * @description 渲染函数-优先级大于 slot 配置 */ render?: (row: any) => Component; /** * @description 插槽名称 */ slot?: string; } export declare type ComponentOrUndefined = Component | undefined; declare interface DatePickSearchType extends BaseSearchType, MyFormItemPropsByDatePickTypeWithTopLevel { } declare const _default: { version: string; install: (app: App) => void; }; export default _default; declare const _default_2: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>; declare const _default_3: __VLS_WithSlots_2<typeof __VLS_component_2, __VLS_Slots_2>; declare const _default_4: __VLS_WithSlots_3<typeof __VLS_component_3, __VLS_Slots_3>; declare const _default_5: __VLS_WithSlots_4<typeof __VLS_component_4, __VLS_Slots_4>; declare const _default_6: __VLS_WithSlots_5<typeof __VLS_component_5, __VLS_Slots_5>; declare type DialogExpose = { handleClose: () => void; }; export declare type DisplayMode = 'icon-text' | 'icon-only' | 'text-only'; declare type DrawerExpose = { handleClose: () => void; }; export declare type EmitFn<E extends EmitsOptions> = SetupContext<E>['emit']; export declare const EMPTY_OBJ: {}; export declare interface EnumCellTypeProps { cellType: 'enum'; valueEnum: ValueEnum; render?: (row: any) => Component; } /** * 获取枚举值的联合类型 * 支持字符串枚举和数字枚举 */ export declare type EnumValues<T> = T extends Record<string, infer V> ? V extends string | number ? V : never : never; export declare interface FooterBtn { text?: string; icon?: string | Component; hide?: boolean; } /** * 获取从 options 传递过来的默认插槽 * @param elSlots element slots */ export declare const getElDefaultSlot: (elSlots: any) => any; /** * 获取默认插槽并转换为组件 * @param option * @returns component */ export declare const getElDefaultSlotAndToComponent: (option: any) => Component; export declare type HeaderConfig = string | HeaderRenderConfig; export declare interface HeaderRenderConfig { /** * @description 渲染函数-优先级低于 slot 配置 */ render?: Component; /** * @description 插槽名称 */ slot?: string; } export declare interface ImageCellTypeProps { cellType: 'image'; width?: number; height?: number; isCircle?: boolean; errorSlot?: Component; } export declare interface InputCellTypeProps { cellType: 'input'; size?: ComponentSize; placeholder?: string; disabled?: boolean; } export declare interface InputNumberCellTypeProps { cellType: 'input_number'; size?: ComponentSize; min: number; max: number; step: number; disabled?: boolean; } declare interface InputNumberSearchType extends BaseSearchType, MyFormItemPropsByInputNumber { } declare interface InputSearchType extends BaseSearchType, MyFormItemPropsByInputWithTopLevel { } export declare const install: (app: App) => void; export declare const INSTALLED_KEY: unique symbol; export declare const isArray: (arg: any) => arg is any[]; export declare const isBoolean: (val: any) => val is boolean; export declare const isEmpty: (val: unknown) => boolean; export declare const isEmptyObj: (val: any) => boolean; export declare const isFunction: (val: any) => val is Function; export declare const isNumber: (val: any) => val is number; export declare const isObject: (val: any) => val is object; export declare const isPresetCellType: (type: any) => type is PresetCellType; export declare const isPresetCellTypeProps: (props: any) => props is PresetCellTypeProps; export declare const isString: (val: any) => val is string; export declare const isStringNumber: (val: string) => boolean; export declare const isSymbol: (val: any) => val is symbol; export declare const isUndefined: (val: any) => val is undefined; /** * 合并配置 */ export declare function mergeConfig(defaultConfig: any, userConfig: any, customizer?: Function): any; export declare type MyFormItemPropsByCascader = { type?: 'cascader'; props?: Partial<Omit<CascaderInstance['$props'], 'modelValue'>>; }; export declare type MyFormItemPropsByCascaderWithTopLevel = { type?: 'cascader'; } & MyFormItemPropsByCascader & Partial<Omit<CascaderInstance['$props'], 'modelValue'>>; export declare type MyFormItemPropsByCheckbox = { type?: 'checkbox'; options: OptionType; props?: Partial<Omit<CheckboxGroupProps, 'modelValue'>>; }; export declare type MyFormItemPropsByCheckboxButton = { type?: 'checkbox_button'; options: OptionType; props?: Partial<Omit<CheckboxGroupProps, 'modelValue'>>; }; export declare type MyFormItemPropsByCheckboxButtonWithTopLevel = { type?: 'checkbox_button'; } & MyFormItemPropsByCheckboxButton & Partial<Omit<CheckboxGroupProps, 'modelValue'>>; export declare type MyFormItemPropsByCheckboxWithTopLevel = { type?: 'checkbox'; } & MyFormItemPropsByCheckbox & Partial<Omit<CheckboxGroupProps, 'modelValue'>>; export declare type MyFormItemPropsByColor = { type?: 'color'; props?: Partial<Omit<ColorPickerProps, 'modelValue'>>; }; export declare type MyFormItemPropsByColorWithTopLevel = { type?: 'color'; } & MyFormItemPropsByColor & Partial<Omit<ColorPickerProps, 'modelValue'>>; export declare type MyFormItemPropsByDatePickType = { type?: DatePickType; props?: Partial<Omit<TimePickerDefaultPropsPublic, 'modelValue'>>; }; export declare type MyFormItemPropsByDatePickTypeWithTopLevel = { type?: DatePickType; } & MyFormItemPropsByDatePickType & Partial<Omit<TimePickerDefaultPropsPublic, 'modelValue'>>; export declare type MyFormItemPropsByGroupSelect = { type?: 'group_select'; options: OptionType; props?: Partial<Omit<SelectProps, 'modelValue'>>; }; export declare type MyFormItemPropsByGroupSelectWithTopLevel = { type?: 'group_select'; } & MyFormItemPropsByGroupSelect & Partial<Omit<SelectProps, 'modelValue'>>; export declare type MyFormItemPropsByInput = { type?: 'input'; props?: Partial<Omit<InputProps, 'modelValue' | 'rows' | 'autosize' | 'show-password'>>; }; export declare type MyFormItemPropsByInputNumber = { type?: 'input_number'; props?: Partial<Omit<InputNumberProps, 'modelValue'>>; }; export declare type MyFormItemPropsByInputNumberWithTopLevel = { type?: 'input_number'; } & MyFormItemPropsByInputNumber & Partial<Omit<InputNumberProps, 'modelValue'>>; export declare type MyFormItemPropsByInputWithTopLevel = { type?: 'input'; } & MyFormItemPropsByInput & Partial<Omit<InputProps, 'modelValue' | 'rows' | 'autosize' | 'show-password'>>; export declare type MyFormItemPropsByPassword = { type?: 'password'; props?: Partial<Omit<InputProps, 'modelValue' | 'rows' | 'autosize' | 'parser'>>; }; export declare type MyFormItemPropsByPasswordWithTopLevel = { type?: 'password'; } & MyFormItemPropsByPassword & Partial<Omit<InputProps, 'modelValue' | 'rows' | 'autosize' | 'parser'>>; export declare type MyFormItemPropsByRadio = { type?: 'radio'; options: OptionType; props?: Partial<Omit<RadioGroupProps, 'modelValue'>>; }; export declare type MyFormItemPropsByRadioButton = { type?: 'radio_button'; options: OptionType; props?: Partial<Omit<RadioGroupProps, 'modelValue'>>; }; export declare type MyFormItemPropsByRadioButtonWithTopLevel = { type?: 'radio_button'; } & MyFormItemPropsByRadioButton & Partial<Omit<RadioGroupProps, 'modelValue'>>; export declare type MyFormItemPropsByRadioWithTopLevel = { type?: 'radio'; } & MyFormItemPropsByRadio & Partial<Omit<RadioGroupProps, 'modelValue'>>; export declare type MyFormItemPropsBySelect = { type?: 'select'; options: OptionType; props?: Partial<Omit<SelectProps, 'modelValue'>>; }; export declare type MyFormItemPropsBySelectWithTopLevel = { type?: 'select'; } & MyFormItemPropsBySelect & Partial<Omit<SelectProps, 'modelValue'>>; export declare type MyFormItemPropsBySwitch = { type?: 'switch'; props?: Partial<Omit<SwitchProps, 'modelValue'>>; }; export declare type MyFormItemPropsBySwitchWithTopLevel = { type?: 'switch'; } & MyFormItemPropsBySwitch & Partial<Omit<SwitchProps, 'modelValue'>>; export declare type MyFormItemPropsByTextarea = { type?: 'textarea'; props?: Partial<Omit<InputProps, 'modelValue' | 'clearable' | 'parser' | 'size' | 'show-password'>>; }; export declare type MyFormItemPropsByTextareaWithTopLevel = { type?: 'textarea'; } & MyFormItemPropsByTextarea & Partial<Omit<InputProps, 'modelValue' | 'clearable' | 'parser' | 'size' | 'show-password'>>; export declare type MyFormItemPropsByTypes = MyFormItemPropsByInputWithTopLevel | MyFormItemPropsByPasswordWithTopLevel | MyFormItemPropsByInputNumberWithTopLevel | MyFormItemPropsByTextareaWithTopLevel | MyFormItemPropsBySelectWithTopLevel | MyFormItemPropsByGroupSelectWithTopLevel | MyFormItemPropsByRadioWithTopLevel | MyFormItemPropsByRadioButtonWithTopLevel | MyFormItemPropsByCheckboxWithTopLevel | MyFormItemPropsByCheckboxButtonWithTopLevel | MyFormItemPropsBySwitchWithTopLevel | MyFormItemPropsByUploadWithTopLevel | MyFormItemPropsByCascaderWithTopLevel | MyFormItemPropsByColorWithTopLevel | MyFormItemPropsByDatePickTypeWithTopLevel; export declare type MyFormItemPropsByUpload = { type?: 'upload'; props?: any; mode: MyFormItemUploadMode; accept?: string; fileSize?: number; limit?: number; multiple?: boolean; onExceed?: () => void; onFileSizeExceed?: (currentFile: File) => void; tip?: string; }; export declare type MyFormItemPropsByUploadWithTopLevel = { type?: 'upload'; } & MyFormItemPropsByUpload; export declare type MyFormItemType = 'input' | 'password' | 'input_number' | 'textarea' | 'select' | 'group_select' | 'radio' | 'radio_button' | 'checkbox' | 'checkbox_button' | 'switch' | 'upload' | 'cascader' | 'color'; export declare type MyFormItemUploadMode = 'drag' | 'thumb'; export declare function omit(obj: Object, keys: string[]): any; export declare interface OperationColumnConfig extends Partial<Pick<TableColumnInstance, 'width' | 'minWidth' | 'align'>> { fixed?: 'left' | 'right' | null; label?: HeaderConfig; btnConfig?: Partial<OperationColumnConfigBtnOption>; } export declare interface OperationColumnConfigBtnOption { isTextBtn: boolean; displayMode: DisplayMode; editBtn: BtnConfig | boolean; viewBtn: BtnConfig | boolean; deleteBtn: BtnConfig | boolean; plain: boolean; } declare interface OptionGroupItem { label: string | number; options: OptionItem[]; [key: string]: any; } declare interface OptionItem { label: string | number; value: string | number; disabled?: boolean; [key: string]: any; } declare type OptionType = OptionItem[] | OptionGroupItem[]; /** * @description 预设单元格类型 */ export declare type PresetCellType = 'txt' | 'image' | 'switch' | 'input' | 'input_number' | 'select' | 'progress' | 'enum'; export declare const presetCellTypeKeys: readonly ["txt", "image", "switch", "input", "input_number", "select", "progress", "enum"]; export declare type PresetCellTypeProps = TxtCellTypeProps | ImageCellTypeProps | SwitchCellTypeProps | InputCellTypeProps | InputNumberCellTypeProps | SelectCellTypeProps | ProgressCellTypeProps | EnumCellTypeProps; export declare const ProDialog: SFCWithInstall<typeof _default_5>; export declare type ProDialogEmits = typeof proDialogEmits; export declare const proDialogEmits: { 'update:modelValue': (value: boolean) => boolean; }; export declare type ProDialogProps = DialogProps; export declare const ProDrawer: SFCWithInstall<typeof _default_4>; export declare type ProDrawerEmits = typeof proDrawerEmits; export declare const proDrawerEmits: { 'update:visible': (value: boolean) => boolean; }; export declare type ProDrawerProps = DrawerProps; export declare const ProForm: SFCWithInstall<typeof _default_2>; export declare const ProFormDialog: SFCWithInstall<typeof _default_6>; export declare type ProFormDialogEmits = typeof proFormDialogEmits; export declare const proFormDialogEmits: { 'update:modelValue': (value: boolean) => boolean; 'update:formData': (value: Record<string, any>) => boolean; submit: (value: any) => boolean; }; export declare type ProFormDialogProps = DialogProps & { formProps: Omit<ProFormProps, 'modelValue'>; formData: Record<string, any>; }; export declare type ProFormEmits = typeof proFormEmits; export declare const proFormEmits: { "update:modelValue": (value: any) => boolean; submit: (value: any) => boolean; reset: () => boolean; }; export declare type ProFormFooterConfig = { align?: 'left' | 'center' | 'right'; onSubmit?: (data: any) => void; onReset?: () => void; col?: Partial<ColProps>; resetBtn?: FooterBtn | boolean; submitBtn?: FooterBtn | boolean; }; export declare interface ProFormItemCommonType extends Partial<Omit<FormItemProps, 'label' | 'prop'>> { /** * @description 表单名称 */ label: string | Component; /** * @description 表单key */ key: string; /** * @description 隐藏label */ hideLabel?: boolean; /** * @description 提示信息-仅label为文本时有效 */ tooltip?: string; /** * @description 隐藏表单项 */ hidden?: boolean; /** * @description 传递给原 ElementPlus 表单项的插槽 */ elSlots?: Record<string, Function | string>; /** * @description 启用自定义插槽,插槽名默认取用当前表单项的 key,则不会渲染默认的表单项,需要自行实现表单项 */ customSlot?: boolean; /** * @description 表单项所占栅格数-优先级高于form的span */ col?: Partial<ColProps>; } export declare type ProFormItemConfig = ProFormItemCommonType & MyFormItemPropsByTypes; export declare type ProFormItemTypeKeys = MyFormItemType | DatePickType; export declare type ProFormProps = Partial<ExtractPropTypes<typeof proFormProps>> & Omit<FormInstance['$props'], 'modelValue'>; export declare const proFormProps: { /** * @description 表单数据 */ readonly modelValue: { readonly type: PropType<Record<string, any>>; readonly default: () => {}; }; /** * @description 表单项配置 */ readonly formItems: { readonly type: PropType<ProFormItemConfig[]>; readonly default: () => never[]; }; /** * @description 表单项间距 */ readonly gutter: { readonly type: PropType<number>; readonly default: 0; }; /** * @description 表单项所占栅格数 */ readonly col: { readonly type: PropType<Partial<ColProps>>; readonly default: () => { span: number; }; }; /** * @description 页脚配置 */ readonly footerConfig: { readonly type: PropType<ProFormFooterConfig | null>; readonly default: () => {}; }; }; export declare interface ProgressCellTypeProps extends Partial<Omit<ProgressProps, 'percentage'>> { cellType: 'progress'; } export declare const ProTable: SFCWithInstall<typeof _default_3>; export declare interface ProTableColumnType extends Omit<TableColumnInstance['$props'], 'label' | 'prop'> { /** * @description 列名-表头显示的名称 */ label?: HeaderConfig; /** * @description 字段名-对应数据中的字段名 */ prop?: string; /** * @description 单元格配置-不传递默认为 EP 的默认行为 */ cell?: CellConfig; /** * @description 是否隐藏该列 */ hidden?: boolean; /** * @description 对齐方式 */ align?: 'left' | 'center' | 'right'; /** * @description 搜索配置 */ search?: SearchType; /** * @description 子列 */ children?: ProTableColumnType[]; /** * @description 枚举值 */ [key: string]: any; } export declare interface ProTableContext { tableColumns: ProTableColumnType[]; cellChange: (row: Record<string, any>, prop: string | number, newValue: any) => void; } export declare type ProTableEmits = typeof proTableEmits; export declare const proTableEmits: { cellChange: (row: Record<string, any>, column: ProTableColumnType, newValue: any) => boolean; }; export declare type ProTableProps = ExtractPropTypes<typeof proTableProps>; export declare const proTableProps: { /** * @description 表格数据 */ readonly data: { readonly type: ArrayConstructor; readonly default: () => never[]; }; /** * @description 表格列配置 */ readonly tableColumns: { readonly type: PropType<ProTableColumnType[]>; readonly default: () => never[]; }; /** * @description 操作列-即在表格末尾添加一列,用于存放操作按钮,如果需要配置,可以传递配置对象 */ readonly operationColumn: { readonly type: PropType<OperationColumnConfig | null>; readonly default: null; }; /** * @description 对齐方式 */ readonly align: { readonly type: PropType<"left" | "center" | "right">; readonly default: "center"; }; /** * @description 请求表格数据的 api */ readonly requestApi: { readonly type: PropType<(params: any) => Promise<any>>; }; /** * @description 是否自动执行请求 api */ readonly requestAuto: { readonly type: BooleanConstructor; readonly default: true; }; /** * @description 表格 api 请求错误监听 */ readonly requestError: { readonly type: PropType<(params: any) => void>; }; /** * @description 返回数据的回调函数,可以对数据进行处理 */ readonly dataCallback: { readonly type: PropType<(data: any) => any>; }; /** * @description 组件风格 */ readonly componentStyle: { readonly type: PropType<"" | "card">; readonly default: "card"; }; /** * @description 是否需要分页 */ readonly pagination: { readonly type: BooleanConstructor; readonly default: true; }; /** * @description 表格标题 */ readonly title: { readonly type: StringConstructor; readonly default: ""; }; /** * @description 是否显示 Header 部分 */ readonly showHeader: { readonly type: BooleanConstructor; readonly default: true; }; /** * @description 功能按钮 */ readonly toolButton: { readonly type: PropType<("refresh" | "setting" | "search")[] | boolean>; readonly default: () => string[]; }; /** * @description 查询初始参数 */ readonly initParams: { readonly type: ObjectConstructor; readonly default: () => {}; }; /** * @description 是否开启多选 */ readonly selection: { readonly type: BooleanConstructor; readonly default: false; }; /** * @description 是否显示加载状态,默认开启(在有 requestApi 时自动控制) */ readonly loading: { readonly type: BooleanConstructor; readonly default: true; }; /** * @description 初始页码 */ readonly page: { readonly type: NumberConstructor; readonly default: 1; }; /** * @description 初始每页显示条数 */ readonly pageSize: { readonly type: NumberConstructor; readonly default: 10; }; /** * @description 每页显示个数选择器的选项设置 */ readonly pageSizes: { readonly type: PropType<number[]>; readonly default: () => number[]; }; }; declare type Request_2 = Function; export { Request_2 as Request } export declare type RequestApiConfig = (params: Record<string, any>) => Promise<any>; declare type SearchType = InputSearchType | InputNumberSearchType | SelectSearchType | SwitchSearchType | CascaderSearchType | DatePickSearchType; declare type SelectCellOptions = { label: string; value: any; disabled?: boolean; }; export declare interface SelectCellTypeProps { cellType: 'select'; options: SelectCellOptions[]; multiple?: boolean; size?: ComponentSize; disabled?: boolean; } declare interface SelectSearchType extends BaseSearchType, MyFormItemPropsBySelectWithTopLevel { } export declare type SFCInstallWithContext<T> = SFCWithInstall<T> & { _context: AppContext | null; }; export declare type SFCWithInstall<T> = T & Plugin_2; export declare type StringOrUndefined = string | undefined; export declare interface SwitchCellTypeProps { cellType: 'switch'; size?: ComponentSize; inactiveColor?: string; activeColor?: string; activeText?: string; inactiveText?: string; } declare interface SwitchSearchType extends BaseSearchType, MyFormItemPropsBySwitchWithTopLevel { } /** * 将驼峰命名或帕斯卡命名转换为短横线分隔的命名格式 * @param str 需要转换的字符串 * @returns 固定长度为2的数组,[转换后的值, 原值] * @example * toKebabCase('showOverflowTooltip') // ['show-overflow-tooltip', 'showOverflowTooltip'] * toKebabCase('ShowOverflowTooltip') // ['show-overflow-tooltip', 'ShowOverflowTooltip'] * toKebabCase('HTMLElement') // ['html-element', 'HTMLElement'] */ export declare function toKebabCase(str: string): [string, string]; export declare interface TxtCellTypeProps { cellType: 'txt'; formatValue?: (value: any, row: any) => string; isCopy?: boolean; } export declare const UPDATE_MODEL_EVENT = "update:modelValue"; export declare interface ValueEnum { [key: string]: string | number | ValueEnumInTag; } declare interface ValueEnumInTag extends Partial<Omit<TagProps, 'closable'>> { text: string | number; } export declare const version: string; export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E; export declare const withInstallDirective: <T extends Directive>(directive: T, name: string) => SFCWithInstall<T>; export declare const withInstallFunction: <T>(fn: T, name: string) => SFCInstallWithContext<T>; export declare const withNoopInstall: <T>(component: T) => SFCWithInstall<T>; export { }