UNPKG

tk-eui-plus

Version:

86 lines (85 loc) 2.46 kB
import { defineComponent as g, useSlots as y, resolveComponent as C, openBlock as f, createElementBlock as d, createVNode as b, mergeProps as p, unref as c, withCtx as o, renderSlot as n, toDisplayString as u, createCommentVNode as i } from "vue"; const $ = { key: 1 }, x = /* @__PURE__ */ g({ __name: "index", props: { data: { type: Array, default: [] }, leftDefaultChecked: { type: Array, default: [2, 3] }, rightDefaultChecked: { type: Array, default: [1] }, titles: { type: Array, default: ["Source", "Target"] }, buttonTexts: { type: Array, default: ["To left", "To right"] }, format: { type: Object, default: { noChecked: "${total}", hasChecked: "${checked}/${total}" } } }, emits: ["handleChange"], setup(e, { emit: h }) { let r = y(), m = h, k = (t, s, l) => { m("handleChange", { value: t, direction: s, movedKeys: l }); }; return console.log(r), (t, s) => { const l = C("el-transfer"); return f(), d("div", null, [ b(l, p({ style: { "text-align": "left", display: "inline-block" }, filterable: "", "left-default-checked": e.leftDefaultChecked, "right-default-checked": e.rightDefaultChecked, titles: e.titles, "button-texts": e.buttonTexts, format: e.format, data: e.data, onChange: c(k) }, t.$attrs), { default: o(({ option: a }) => [ c(r).default ? n(t.$slots, "default", { key: 0, option: a }) : (f(), d( "span", $, u(a.key) + " - " + u(a.label), 1 /* TEXT */ )) ]), "left-footer": o(() => [ n(t.$slots, "left-footer"), i(' <el-button class="transfer-footer" size="small">Operation</el-button> ') ]), "right-footer": o(() => [ n(t.$slots, "right-footer"), i(' <el-button class="transfer-footer" size="small">Operation</el-button> ') ]), _: 3 /* FORWARDED */ }, 16, ["left-default-checked", "right-default-checked", "titles", "button-texts", "format", "data", "onChange"]) ]); }; } }), A = { install(e) { e.component("tkTransfer", x); } }; export { A as default };