@opensig/opendesign
Version:
38 lines (37 loc) • 1.09 kB
JavaScript
import { defineComponent, computed, createElementBlock, openBlock, createBlock, resolveDynamicComponent } from "vue";
import { getRenderableComponent } from "../_utils/vue-utils.mjs";
const _hoisted_1 = { class: "o-table-cell__inner-content" };
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "TableCellRenderer",
props: {
row: {},
column: {},
cellValue: {},
rowIndex: {},
colIndex: {}
},
setup(__props) {
const props = __props;
const renderContent = computed(() => {
const { row, column, cellValue, rowIndex, colIndex } = props;
const { formatter } = column;
const formatterOptions = {
row,
column,
cellValue,
rowIndex,
colIndex
};
const content = formatter(formatterOptions);
return getRenderableComponent(content);
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("span", _hoisted_1, [
(openBlock(), createBlock(resolveDynamicComponent(renderContent.value)))
]);
};
}
});
export {
_sfc_main as default
};