UNPKG

tass-ui

Version:

A high quality UI Toolkit built on Vue.js3+.

62 lines (61 loc) 2.18 kB
import { defineComponent, reactive, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, createElementVNode, Fragment, renderList, createBlock } from "vue"; import _sfc_main$1 from "../../checkbox/src/checkbox.vue.mjs"; import _sfc_main$2 from "../../checkbox-group/src/checkbox-group.vue.mjs"; import { useCheck } from "./composables/use-check.mjs"; const _hoisted_1 = { class: "tas-transfer__item" }; const _hoisted_2 = { class: "tas-transfer__body" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "transferItem", props: { data: { type: Array, default: () => [] }, props: { type: Object } }, emits: ["checkChange"], setup(__props) { const props = __props; const state = reactive({ checked: [], allCheck: false }); let { keyProps, disabledProps, handlerChange } = useCheck(props, state); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1, [ createVNode(_sfc_main$1, { modelValue: state.allCheck, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.allCheck = $event), onChange: unref(handlerChange) }, { default: withCtx(() => [ createTextVNode("全选 / 半选") ]), _: 1 }, 8, ["modelValue", "onChange"]), createElementVNode("div", _hoisted_2, [ createVNode(_sfc_main$2, { modelValue: state.checked, "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => state.checked = $event) }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.data, (item) => { return openBlock(), createBlock(_sfc_main$1, { key: item[unref(keyProps)], label: item[unref(keyProps)], disabled: item[unref(disabledProps)] }, null, 8, ["label", "disabled"]); }), 128)) ]), _: 1 }, 8, ["modelValue"]) ]) ]); }; } }); export { _sfc_main as default };