UNPKG

element-plus

Version:

A Component Library for Vue 3

116 lines (114 loc) 5.96 kB
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const require_runtime = require('../../../_virtual/_rolldown/runtime.js'); const require__plugin_vue_export_helper = require('../../../_virtual/_plugin-vue_export-helper.js'); const require_filter_panel_vue_vue_type_script_lang = require('./filter-panel.vue_vue_type_script_lang.js'); let vue = require("vue"); //#region ../../packages/components/table/src/filter-panel.vue const _hoisted_1 = ["disabled"]; const _hoisted_2 = ["tabindex", "aria-checked"]; const _hoisted_3 = [ "tabindex", "aria-checked", "onClick" ]; const _hoisted_4 = ["aria-label"]; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_el_checkbox = (0, vue.resolveComponent)("el-checkbox"); const _component_el_checkbox_group = (0, vue.resolveComponent)("el-checkbox-group"); const _component_el_scrollbar = (0, vue.resolveComponent)("el-scrollbar"); const _component_arrow_up = (0, vue.resolveComponent)("arrow-up"); const _component_arrow_down = (0, vue.resolveComponent)("arrow-down"); const _component_el_icon = (0, vue.resolveComponent)("el-icon"); const _component_el_tooltip = (0, vue.resolveComponent)("el-tooltip"); return (0, vue.openBlock)(), (0, vue.createBlock)(_component_el_tooltip, { ref: "tooltipRef", offset: 0, placement: _ctx.placement, "show-arrow": false, trigger: "click", role: "dialog", teleported: "", effect: "light", pure: "", loop: "", "popper-class": _ctx.filterClassName, persistent: "", "append-to": _ctx.appendTo, onShow: _ctx.handleShowTooltip, onHide: _ctx.handleHideTooltip }, { content: (0, vue.withCtx)(() => [_ctx.multiple ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", { key: 0, ref: "rootRef", tabindex: "-1", class: (0, vue.normalizeClass)(_ctx.ns.e("multiple")) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("content")) }, [(0, vue.createVNode)(_component_el_scrollbar, { "wrap-class": _ctx.ns.e("wrap") }, { default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_checkbox_group, { modelValue: _ctx.filteredValue, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.filteredValue = $event), class: (0, vue.normalizeClass)(_ctx.ns.e("checkbox-group")) }, { default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.filters, (filter) => { return (0, vue.openBlock)(), (0, vue.createBlock)(_component_el_checkbox, { key: filter.value, value: filter.value }, { default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(filter.text), 1)]), _: 2 }, 1032, ["value"]); }), 128))]), _: 1 }, 8, ["modelValue", "class"])]), _: 1 }, 8, ["wrap-class"])], 2), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("bottom")) }, [(0, vue.createElementVNode)("button", { class: (0, vue.normalizeClass)(_ctx.ns.is("disabled", _ctx.filteredValue.length === 0)), disabled: _ctx.filteredValue.length === 0, type: "button", onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleConfirm && _ctx.handleConfirm(...args)) }, (0, vue.toDisplayString)(_ctx.t("el.table.confirmFilter")), 11, _hoisted_1), (0, vue.createElementVNode)("button", { type: "button", onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleReset && _ctx.handleReset(...args)) }, (0, vue.toDisplayString)(_ctx.t("el.table.resetFilter")), 1)], 2)], 2)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("ul", { key: 1, ref: "rootRef", tabindex: "-1", role: "radiogroup", class: (0, vue.normalizeClass)(_ctx.ns.e("list")), onKeydown: _cache[4] || (_cache[4] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args)) }, [(0, vue.createElementVNode)("li", { role: "radio", class: (0, vue.normalizeClass)([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isPropAbsent(_ctx.filterValue))]), tabindex: _ctx.checkedIndex === 0 ? 0 : -1, "aria-checked": _ctx.isPropAbsent(_ctx.filterValue), onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleSelect(null, 0)) }, (0, vue.toDisplayString)(_ctx.t("el.table.clearFilter")), 11, _hoisted_2), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.filters, (filter, idx) => { return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", { key: filter.value, role: "radio", class: (0, vue.normalizeClass)([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isActive(filter))]), tabindex: _ctx.checkedIndex === idx + 1 ? 0 : -1, "aria-checked": _ctx.isActive(filter), onClick: ($event) => _ctx.handleSelect(filter.value, idx + 1) }, (0, vue.toDisplayString)(filter.text), 11, _hoisted_3); }), 128))], 34))]), default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("button", { type: "button", class: (0, vue.normalizeClass)(`${_ctx.ns.namespace.value}-table__column-filter-trigger`), "aria-label": _ctx.t("el.table.filterLabel", { column: _ctx.column?.label || "" }) }, [(0, vue.createVNode)(_component_el_icon, null, { default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "filter-icon", {}, () => [_ctx.column?.filterOpened ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_arrow_up, { key: 0 })) : ((0, vue.openBlock)(), (0, vue.createBlock)(_component_arrow_down, { key: 1 }))])]), _: 3 })], 10, _hoisted_4)]), _: 3 }, 8, [ "placement", "popper-class", "append-to", "onShow", "onHide" ]); } var filter_panel_default = /* @__PURE__ */ require__plugin_vue_export_helper.default(require_filter_panel_vue_vue_type_script_lang.default, [["render", _sfc_render]]); //#endregion exports.default = filter_panel_default; //# sourceMappingURL=filter-panel.js.map