yanzhen-design-vue
Version:
58 lines (57 loc) • 1.82 kB
JavaScript
import { buildProps, definePropType, buildEmits, propsSeparate } from "@yanzhen-libs/utils-vue";
import "../../../../hooks/index.mjs";
import "../../../list/index.mjs";
import { contactsOptionsProps } from "../hook/use-contacts-options.mjs";
import { Contacts } from "../constants/contacts.mjs";
import { useNamespace } from "../../../../hooks/use-namespace/index.mjs";
import { listProps } from "../../../list/src/list.mjs";
const ns = useNamespace(`contacts-list`);
const contactsListOptions = {
ns,
class: ns.b(),
name: ns.defineVNodeName()
};
const contactsListName = contactsListOptions.name;
const contactsListProps = buildProps({
...listProps,
...contactsOptionsProps(),
defaultNode: {
type: definePropType([Function, Object])
},
activeTab: {
type: definePropType([String, Array]),
default: Contacts.USER
},
childActiveTab: {
type: definePropType([String, Array]),
default: ""
},
childTabs: {
type: definePropType(Array),
default: () => []
},
selectedValue: definePropType(Array),
selectedIds: definePropType(Array),
// 禁用的id列表(不区分类型);从外部传入,内部只参与判断;
disableIds: definePropType(Array),
multiple: Boolean,
isTreeMode: Boolean,
itemClass: String,
headerClass: String,
treeClass: String,
selectedIconClass: String,
onLoadMore: definePropType(Function),
onItemClick: definePropType(Function),
onSuffixClick: definePropType(Function),
onTreeExpand: definePropType(Function),
onTreeSelect: definePropType(Function),
"onUpdate:childActiveTab": definePropType(Function),
"onUpdate:loading": definePropType(Function)
});
const contactsListEmits = buildEmits(propsSeparate(contactsListProps).emits);
export {
contactsListEmits,
contactsListName,
contactsListOptions,
contactsListProps
};