UNPKG

hongluan-ui

Version:
55 lines (52 loc) 2.38 kB
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, normalizeStyle, renderSlot, withModifiers, createVNode, withCtx, createCommentVNode, Fragment, createTextVNode, toDisplayString } from 'vue'; import { get } from 'lodash-unified'; import { HlIcon } from '../../../icon/index.mjs'; import '../../../system-icon/index.mjs'; import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs'; import SystemArrowRight from '../../../system-icon/src/arrow-right.mjs'; const _sfc_main = defineComponent({ components: { HlIcon, SystemArrowRight }, props: { row: Object, column: Object, rowIndex: Number, columnIndex: Number }, emits: ["cell-click", "expand"], setup(props) { const cellValue = computed(() => get(props.row, props.column.prop)); return { cellValue }; } }); function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { var _a, _b; const _component_system_arrow_right = resolveComponent("system-arrow-right"); const _component_hl_icon = resolveComponent("hl-icon"); return openBlock(), createElementBlock("div", { class: "cell", style: normalizeStyle(_ctx.column.align ? `justify-content:${_ctx.column.align}` : ""), onClick: ($event) => _ctx.$emit("cell-click", $event) }, [ renderSlot(_ctx.$slots, "expand-icon"), ((_a = _ctx.column.expand) == null ? void 0 : _a.slotName) ? (openBlock(), createElementBlock("div", { key: 0, class: "expand-icon cursor-pointer", onClick: withModifiers(($event) => _ctx.$emit("expand"), ["stop"]) }, [ createVNode(_component_hl_icon, null, { default: withCtx(() => [ createVNode(_component_system_arrow_right) ]), _: 1 }) ], 8, ["onClick"])) : createCommentVNode("v-if", true), !((_b = _ctx.column.expand) == null ? void 0 : _b.hideLabel) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createTextVNode(toDisplayString(_ctx.column.formatter ? _ctx.column.formatter(_ctx.row, _ctx.column, _ctx.cellValue, _ctx.rowIndex, _ctx.columnIndex) : _ctx.cellValue), 1) ], 2112)) : createCommentVNode("v-if", true) ], 12, ["onClick"]); } var DefaultCellContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { DefaultCellContent as default }; //# sourceMappingURL=default-cell-content.mjs.map