hongluan-ui
Version:
Hongluan Component Library for Vue 3
59 lines (54 loc) • 2.43 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var lodashUnified = require('lodash-unified');
var index = require('../../../icon/index.js');
require('../../../system-icon/index.js');
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
var arrowRight = require('../../../system-icon/src/arrow-right.js');
const _sfc_main = vue.defineComponent({
components: { HlIcon: index.HlIcon, SystemArrowRight: arrowRight["default"] },
props: {
row: Object,
column: Object,
rowIndex: Number,
columnIndex: Number
},
emits: ["cell-click", "expand"],
setup(props) {
const cellValue = vue.computed(() => lodashUnified.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 = vue.resolveComponent("system-arrow-right");
const _component_hl_icon = vue.resolveComponent("hl-icon");
return vue.openBlock(), vue.createElementBlock("div", {
class: "cell",
style: vue.normalizeStyle(_ctx.column.align ? `justify-content:${_ctx.column.align}` : ""),
onClick: ($event) => _ctx.$emit("cell-click", $event)
}, [
vue.renderSlot(_ctx.$slots, "expand-icon"),
((_a = _ctx.column.expand) == null ? void 0 : _a.slotName) ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: "expand-icon cursor-pointer",
onClick: vue.withModifiers(($event) => _ctx.$emit("expand"), ["stop"])
}, [
vue.createVNode(_component_hl_icon, null, {
default: vue.withCtx(() => [
vue.createVNode(_component_system_arrow_right)
]),
_: 1
})
], 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
!((_b = _ctx.column.expand) == null ? void 0 : _b.hideLabel) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
vue.createTextVNode(vue.toDisplayString(_ctx.column.formatter ? _ctx.column.formatter(_ctx.row, _ctx.column, _ctx.cellValue, _ctx.rowIndex, _ctx.columnIndex) : _ctx.cellValue), 1)
], 2112)) : vue.createCommentVNode("v-if", true)
], 12, ["onClick"]);
}
var DefaultCellContent = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render]]);
exports["default"] = DefaultCellContent;
//# sourceMappingURL=default-cell-content.js.map