yanzhen-design-vue
Version:
80 lines (79 loc) • 2.92 kB
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const utilsVue = require("@yanzhen-libs/utils-vue");
require("../../../hooks/index.cjs");
const lodashEs = require("lodash-es");
const contacts = require("./contacts.cjs");
const index = require("../../../hooks/use-namespace/index.cjs");
const ns = index.useNamespace("contacts-select");
const contactsSelectOptions = {
ns,
class: ns.b(),
name: ns.defineVNodeName()
};
const contactsSelectListType = ["avatar", "input"];
function defineContactsSelectProps(info) {
return {
maxCount: (info == null ? void 0 : info.maxCount) ?? 5,
placeholder: (info == null ? void 0 : info.placeholder) ?? void 0,
primaryIcon: (info == null ? void 0 : info.primaryIcon) ?? void 0,
autoClear: lodashEs.isBoolean(info == null ? void 0 : info.autoClear) ? info == null ? void 0 : info.autoClear : true,
multiple: lodashEs.isBoolean(info == null ? void 0 : info.autoClear) ? info == null ? void 0 : info.autoClear : false
};
}
const contactsSelectName = contactsSelectOptions.name;
const contactsModalIgnoreProp = ["open", "onCancel", "onOk"];
const contactsSelectProps = utilsVue.buildProps({
...contacts.contactsProps,
// ant modal props
modalProps: {
type: utilsVue.definePropType(Object),
default: () => ({})
},
// ant modal title props
modalTitle: {
type: String,
default: "通讯录"
},
// ant modal open props
modalOpen: Boolean,
// 单选时候,选择后,立即执行
immediate: {
type: Boolean,
default: true
},
listType: {
type: utilsVue.definePropType([String, Boolean]),
default: () => contactsSelectListType[0]
},
autoClear: {
type: Boolean,
default: void 0
},
selectProps: utilsVue.definePropType(Object),
/**
* 点击“确认”按钮时的钩子函数,如果该函数返回值为true,那么会执行confirm,否则会返回
*/
beforeConfirm: utilsVue.definePropType(Function),
onChange: contacts.contactsProps["onChange"],
onBlur: utilsVue.definePropType(Function),
// 确认按钮事件
onConfirm: utilsVue.definePropType(Function),
// 取消按钮事件
onCancel: utilsVue.definePropType(Function)
});
const contactsSelectEmits = utilsVue.buildEmits({
...contacts.contactsEmits,
...utilsVue.propsSeparate(contactsSelectProps).emits
});
const contactsSelectOmitModalProps = (props) => {
return lodashEs.omit(props, ...contactsModalIgnoreProp);
};
exports.contactsModalIgnoreProp = contactsModalIgnoreProp;
exports.contactsSelectEmits = contactsSelectEmits;
exports.contactsSelectListType = contactsSelectListType;
exports.contactsSelectName = contactsSelectName;
exports.contactsSelectOmitModalProps = contactsSelectOmitModalProps;
exports.contactsSelectOptions = contactsSelectOptions;
exports.contactsSelectProps = contactsSelectProps;
exports.defineContactsSelectProps = defineContactsSelectProps;