/** * 动态列表组件,支持拖拽排序 */ import { h } from 'vue'; import { PlusOutlined, HolderOutlined, MinusCircleOutlined } from '@ant-design/icons-vue'; import vuedraggable from 'vuedraggable'; import { isFunction } from 'lodash-es'; import type { PropType } from 'vue'; import { AST_CLASS_PREFIX } from '../constants/classPrefix'; declare const messages: import("vue").ComputedRef; declare const dataList: import("vue").Ref[], Record[]>; /** * 添加数据,加到指定索引后面 * @param {number} index - 插入位置的索引 */ declare const insertItem: (index: number) => void; /** * 删除数据 * @param {number} index - 要删除的项的索引 */ declare const deleteItem: (index: number) => void; declare const __VLS_ctx: InstanceType<__VLS_PickNotAny {}>>; declare var __VLS_5: { item: any; index: any; }; type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex & { default?: (props: typeof __VLS_5) => any; }>; declare const __VLS_self: import("vue").DefineComponent[]>; default: () => never[]; }; /** * 最大条数 * @default 10 */ maxLength: { type: NumberConstructor; default: number; }; /** * 组件class * @default '' */ className: { type: StringConstructor; default: string; }; /** * 列表中每一项对应的 class * @default '' */ itemClassName: { type: StringConstructor; default: string; }; /** * 添加按钮属性 * @default () => ({}) */ addButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => {}; }; /** * 添加按钮文案 * @default '添加数据' */ addButtonText: { type: StringConstructor; default: string; }; /** * 删除按钮属性 * @default () => ({ icon: h(MinusCircleOutlined) }) */ deleteButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => { icon: import("vue").VNode; }; }; /** * 删除按钮文案 * @default '' */ deleteButtonText: { type: StringConstructor; default: string; }; /** * 排序按钮属性 * @default () => ({ icon: h(HolderOutlined) }) */ sortButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => { icon: import("vue").VNode; }; }; /** * 是否开启拖拽排序 * @default true */ sortable: { type: BooleanConstructor; default: boolean; }; /** * vuedraggable itemKey * @default 'id' */ itemKey: { type: StringConstructor; default: string; }; /** * 获取新增加的数据默认值 * @param {Record} item - 当前项数据 * @returns {Record} 新增项的默认数据 * @default () => (item) => item */ getNewItemData: { type: FunctionConstructor; default: () => (item: Record) => Record; }; }>, { h: typeof h; PlusOutlined: typeof PlusOutlined; HolderOutlined: typeof HolderOutlined; MinusCircleOutlined: typeof MinusCircleOutlined; vuedraggable: typeof vuedraggable; isFunction: typeof isFunction; AST_CLASS_PREFIX: typeof AST_CLASS_PREFIX; messages: typeof messages; dataList: typeof dataList; insertItem: typeof insertItem; deleteItem: typeof deleteItem; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { add: (...args: any[]) => void; change: (...args: any[]) => void; "update:value": (...args: any[]) => void; remove: (...args: any[]) => void; }, string, import("vue").PublicProps, Readonly[]>; default: () => never[]; }; /** * 最大条数 * @default 10 */ maxLength: { type: NumberConstructor; default: number; }; /** * 组件class * @default '' */ className: { type: StringConstructor; default: string; }; /** * 列表中每一项对应的 class * @default '' */ itemClassName: { type: StringConstructor; default: string; }; /** * 添加按钮属性 * @default () => ({}) */ addButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => {}; }; /** * 添加按钮文案 * @default '添加数据' */ addButtonText: { type: StringConstructor; default: string; }; /** * 删除按钮属性 * @default () => ({ icon: h(MinusCircleOutlined) }) */ deleteButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => { icon: import("vue").VNode; }; }; /** * 删除按钮文案 * @default '' */ deleteButtonText: { type: StringConstructor; default: string; }; /** * 排序按钮属性 * @default () => ({ icon: h(HolderOutlined) }) */ sortButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => { icon: import("vue").VNode; }; }; /** * 是否开启拖拽排序 * @default true */ sortable: { type: BooleanConstructor; default: boolean; }; /** * vuedraggable itemKey * @default 'id' */ itemKey: { type: StringConstructor; default: string; }; /** * 获取新增加的数据默认值 * @param {Record} item - 当前项数据 * @returns {Record} 新增项的默认数据 * @default () => (item) => item */ getNewItemData: { type: FunctionConstructor; default: () => (item: Record) => Record; }; }>> & Readonly<{ onAdd?: ((...args: any[]) => any) | undefined; onChange?: ((...args: any[]) => any) | undefined; "onUpdate:value"?: ((...args: any[]) => any) | undefined; onRemove?: ((...args: any[]) => any) | undefined; }>, { value: Record[]; itemKey: string; maxLength: number; className: string; itemClassName: string; addButtonProps: Function | Record; addButtonText: string; deleteButtonProps: Function | Record; deleteButtonText: string; sortButtonProps: Function | Record; sortable: boolean; getNewItemData: Function; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare const __VLS_component: import("vue").DefineComponent[]>; default: () => never[]; }; /** * 最大条数 * @default 10 */ maxLength: { type: NumberConstructor; default: number; }; /** * 组件class * @default '' */ className: { type: StringConstructor; default: string; }; /** * 列表中每一项对应的 class * @default '' */ itemClassName: { type: StringConstructor; default: string; }; /** * 添加按钮属性 * @default () => ({}) */ addButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => {}; }; /** * 添加按钮文案 * @default '添加数据' */ addButtonText: { type: StringConstructor; default: string; }; /** * 删除按钮属性 * @default () => ({ icon: h(MinusCircleOutlined) }) */ deleteButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => { icon: import("vue").VNode; }; }; /** * 删除按钮文案 * @default '' */ deleteButtonText: { type: StringConstructor; default: string; }; /** * 排序按钮属性 * @default () => ({ icon: h(HolderOutlined) }) */ sortButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => { icon: import("vue").VNode; }; }; /** * 是否开启拖拽排序 * @default true */ sortable: { type: BooleanConstructor; default: boolean; }; /** * vuedraggable itemKey * @default 'id' */ itemKey: { type: StringConstructor; default: string; }; /** * 获取新增加的数据默认值 * @param {Record} item - 当前项数据 * @returns {Record} 新增项的默认数据 * @default () => (item) => item */ getNewItemData: { type: FunctionConstructor; default: () => (item: Record) => Record; }; }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { add: (...args: any[]) => void; change: (...args: any[]) => void; "update:value": (...args: any[]) => void; remove: (...args: any[]) => void; }, string, import("vue").PublicProps, Readonly[]>; default: () => never[]; }; /** * 最大条数 * @default 10 */ maxLength: { type: NumberConstructor; default: number; }; /** * 组件class * @default '' */ className: { type: StringConstructor; default: string; }; /** * 列表中每一项对应的 class * @default '' */ itemClassName: { type: StringConstructor; default: string; }; /** * 添加按钮属性 * @default () => ({}) */ addButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => {}; }; /** * 添加按钮文案 * @default '添加数据' */ addButtonText: { type: StringConstructor; default: string; }; /** * 删除按钮属性 * @default () => ({ icon: h(MinusCircleOutlined) }) */ deleteButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => { icon: import("vue").VNode; }; }; /** * 删除按钮文案 * @default '' */ deleteButtonText: { type: StringConstructor; default: string; }; /** * 排序按钮属性 * @default () => ({ icon: h(HolderOutlined) }) */ sortButtonProps: { type: (ObjectConstructor | FunctionConstructor)[]; default: () => { icon: import("vue").VNode; }; }; /** * 是否开启拖拽排序 * @default true */ sortable: { type: BooleanConstructor; default: boolean; }; /** * vuedraggable itemKey * @default 'id' */ itemKey: { type: StringConstructor; default: string; }; /** * 获取新增加的数据默认值 * @param {Record} item - 当前项数据 * @returns {Record} 新增项的默认数据 * @default () => (item) => item */ getNewItemData: { type: FunctionConstructor; default: () => (item: Record) => Record; }; }>> & Readonly<{ onAdd?: ((...args: any[]) => any) | undefined; onChange?: ((...args: any[]) => any) | undefined; "onUpdate:value"?: ((...args: any[]) => any) | undefined; onRemove?: ((...args: any[]) => any) | undefined; }>, { value: Record[]; itemKey: string; maxLength: number; className: string; itemClassName: string; addButtonProps: Function | Record; addButtonText: string; deleteButtonProps: Function | Record; deleteButtonText: string; sortButtonProps: Function | Record; sortable: boolean; getNewItemData: Function; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare const _default: __VLS_WithSlots; export default _default; type __VLS_WithSlots = T & { new (): { $slots: S; }; };