UNPKG

yanzhen-design-vue

Version:

213 lines (212 loc) 10.6 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const vue = require("vue"); const iconsVue = require("@ant-design/icons-vue"); const antDesignVue = require("ant-design-vue"); require("./list/contacts-list.vue.cjs"); require("./list/contacts-group.vue.cjs"); require("./item/contacts-selected-icon.vue.cjs"); const useContacts = require("./use-contacts.cjs"); const contacts = require("./contacts.cjs"); const contactsGroup_vue_vue_type_script_setup_true_lang = require("./list/contacts-group.vue2.cjs"); const contactsSelectedIcon_vue_vue_type_script_setup_true_lang = require("./item/contacts-selected-icon.vue2.cjs"); const contactsList_vue_vue_type_script_setup_true_lang = require("./list/contacts-list.vue2.cjs"); const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...{ name: contacts.contactsName }, __name: "contacts", props: contacts.contactsProps, emits: contacts.contactsEmits, setup(__props, { expose: __expose, emit: __emit }) { const { ns } = contacts.contactsOptions; const props = __props; const emit = __emit; const { ctx: { _ref, _dataSource, _query, searchQueryList, _contactsTabs, _activeTab, _userTabs, _userActiveTab, _noMore, _placeholder, _leftElRef, _rightElRef, _loading, _selectedValue, _selectedIds, _disabledIds, _isTreeMode, multiple, selectState, allExpand }, methods, handleSearch, handleLoadMore, handleTreeExpand, handleTreeSelect, handleDelete, handleItemClick, handleTabChange, handleAllSelectTrigger } = useContacts.useContacts(props, emit); __expose({ ref: _ref, selectState, refresh: handleTabChange, allSelectTrigger: handleAllSelectTrigger, ...methods }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.unref(multiple) && _ctx.$slots["all-select"] && vue.unref(_query).keywords.length === 0 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [], 64)) : vue.createCommentVNode("", true), vue.createVNode(vue.unref(antDesignVue.Row), { class: vue.normalizeClass([vue.unref(ns).b()]) }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(antDesignVue.Col), { ref_key: "_leftElRef", ref: _leftElRef, class: vue.normalizeClass([vue.unref(ns).e("left")]), span: 12 }, { default: vue.withCtx(() => [ vue.createElementVNode("div", { class: vue.normalizeClass([vue.unref(ns).e("list-header")]) }, [ vue.createVNode(vue.unref(antDesignVue.Input), { value: vue.unref(_query).keywords, "onUpdate:value": _cache[0] || (_cache[0] = ($event) => vue.unref(_query).keywords = $event), valueModifiers: { trim: true }, placeholder: vue.unref(_placeholder), "allow-clear": "", onChange: vue.unref(handleSearch), onPressEnter: _cache[1] || (_cache[1] = () => vue.unref(handleSearch)(true)) }, { suffix: vue.withCtx(() => [ vue.createVNode(vue.unref(iconsVue.SearchOutlined)) ]), _: 1 }, 8, ["value", "placeholder", "onChange"]), vue.unref(_query).keywords.length === 0 ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Tabs), { key: 0, "active-key": vue.unref(_activeTab), "onUpdate:activeKey": vue.unref(handleTabChange) }, { default: vue.withCtx(() => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(_contactsTabs), (item) => { return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Tabs).TabPane, { key: item.value, tab: item.label }, null, 8, ["tab"]); }), 128)) ]), _: 1 }, 8, ["active-key", "onUpdate:activeKey"])) : vue.createCommentVNode("", true) ], 2), vue.unref(_query).keywords.length !== 0 ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: vue.normalizeClass([vue.unref(ns).e("list-main"), vue.unref(ns).is("search")]) }, [ vue.createVNode(contactsGroup_vue_vue_type_script_setup_true_lang.default, { "all-expand": "", loading: vue.unref(_query).loading, "empty-text": "没有满足条件的数据!", "selected-ids": vue.unref(_selectedIds), "active-tab": vue.unref(_activeTab), "disable-ids": vue.unref(_disabledIds), "data-source": vue.unref(searchQueryList), onItemClick: vue.unref(handleItemClick), onSuffixClick: vue.unref(handleItemClick) }, { suffix: vue.withCtx(({ item }) => { var _a, _b; return [ vue.createVNode(contactsSelectedIcon_vue_vue_type_script_setup_true_lang.default, { class: vue.normalizeClass([vue.unref(ns).is("search-selected-icon")]), multiple: vue.unref(multiple), disabled: (_a = vue.unref(_disabledIds)) == null ? void 0 : _a.includes(item.value), checked: (_b = vue.unref(_selectedIds)) == null ? void 0 : _b.includes(item == null ? void 0 : item.value) }, null, 8, ["class", "multiple", "disabled", "checked"]) ]; }), _: 1 }, 8, ["loading", "selected-ids", "active-tab", "disable-ids", "data-source", "onItemClick", "onSuffixClick"]) ], 2)) : (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: vue.normalizeClass([vue.unref(ns).e("list-main")]) }, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(_contactsTabs), (tab) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: tab.value }, [ tab.value === vue.unref(_activeTab) ? (vue.openBlock(), vue.createBlock(contactsList_vue_vue_type_script_setup_true_lang.default, { key: tab.value, loading: vue.unref(_loading), "onUpdate:loading": _cache[2] || (_cache[2] = ($event) => vue.isRef(_loading) ? _loading.value = $event : null), "child-active-tab": vue.unref(_userActiveTab), "onUpdate:childActiveTab": _cache[3] || (_cache[3] = ($event) => vue.isRef(_userActiveTab) ? _userActiveTab.value = $event : null), "active-tab": tab.value, "data-source": vue.unref(_dataSource), disabled: vue.unref(_noMore), "child-tabs": vue.unref(_userTabs), "is-tree-mode": vue.unref(_isTreeMode), multiple: vue.unref(multiple), "selected-value": vue.unref(_selectedValue), "selected-ids": vue.unref(_selectedIds), "disable-ids": vue.unref(_disabledIds), onLoadMore: vue.unref(handleLoadMore), onTreeExpand: vue.unref(handleTreeExpand), onTreeSelect: vue.unref(handleTreeSelect), onItemClick: vue.unref(handleItemClick) }, null, 8, ["loading", "child-active-tab", "active-tab", "data-source", "disabled", "child-tabs", "is-tree-mode", "multiple", "selected-value", "selected-ids", "disable-ids", "onLoadMore", "onTreeExpand", "onTreeSelect", "onItemClick"])) : vue.createCommentVNode("", true) ], 64); }), 128)) ], 2)) ]), _: 1 }, 8, ["class"]), vue.createVNode(vue.unref(antDesignVue.Col), { ref_key: "_rightElRef", ref: _rightElRef, class: vue.normalizeClass([vue.unref(ns).e("right")]), span: 12 }, { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "right", {}, () => [ vue.createVNode(contactsGroup_vue_vue_type_script_setup_true_lang.default, { "all-expand": vue.unref(allExpand), "active-tab": vue.unref(_activeTab), "disable-ids": vue.unref(_disabledIds), "data-source": vue.unref(_selectedValue), onSuffixClick: vue.unref(handleDelete) }, { title: vue.withCtx(() => { var _a; return [ vue.createElementVNode("span", null, "已选择的数据(" + vue.toDisplayString((_a = vue.unref(_selectedValue)) == null ? void 0 : _a.length) + ")", 1) ]; }), suffix: vue.withCtx(({ item }) => [ !vue.unref(_disabledIds).includes(item.value) ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DeleteOutlined), { key: 0, class: vue.normalizeClass([vue.unref(ns).e("delete-icon")]) }, null, 8, ["class"])) : vue.createCommentVNode("", true) ]), _: 1 }, 8, ["all-expand", "active-tab", "disable-ids", "data-source", "onSuffixClick"]) ]) ]), _: 3 }, 8, ["class"]) ]), _: 3 }, 8, ["class"]) ], 64); }; } }); exports.default = _sfc_main;