vue-gantt-3
Version:
A gantt component for Vue 3
68 lines (67 loc) • 2.79 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
const shrink = require("../../assets/images/shrink.svg.js");
const spread = require("../../assets/images/spread.svg.js");
const _hoisted_1 = { class: "vg-cell-shrink-icon" };
const _hoisted_2 = { class: "vg-cell-spread-icon" };
const _hoisted_3 = { key: 2 };
const basePaddingLeft = 18;
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
__name: "FirstColumnCellRender",
props: {
params: {}
},
setup(__props) {
var _a;
const props = __props;
const rowNode = vue.shallowRef(props.params.rowNode);
const level = vue.ref(((_a = rowNode.value) == null ? void 0 : _a.level) || 0);
const currentPaddingLeft = basePaddingLeft + level.value * 14;
const positionLeft = currentPaddingLeft - 14;
const setExpand = (event) => {
const currentRowNode = rowNode.value;
if (currentRowNode) {
event.button === 0 && currentRowNode.setExpand(currentRowNode.id, !currentRowNode.expand);
currentRowNode.setSelect(currentRowNode.id);
}
};
return (_ctx, _cache) => {
var _a2;
return vue.openBlock(), vue.createElementBlock("div", {
class: "vg-cell-expandable",
style: vue.normalizeStyle({ paddingLeft: currentPaddingLeft + "px" })
}, [
((_a2 = rowNode.value) == null ? void 0 : _a2.hasChildren) ? (vue.openBlock(), vue.createElementBlock("span", {
key: 0,
class: "vg-cell-expand-box",
style: vue.normalizeStyle({ left: positionLeft + "px" }),
onMousedown: vue.withModifiers(setExpand, ["stop"])
}, [
vue.withDirectives(vue.createElementVNode("span", _hoisted_1, _cache[0] || (_cache[0] = [
vue.createElementVNode("img", {
src: shrink.default,
alt: ""
}, null, -1)
]), 512), [
[vue.vShow, rowNode.value.expand]
]),
vue.withDirectives(vue.createElementVNode("span", _hoisted_2, _cache[1] || (_cache[1] = [
vue.createElementVNode("img", {
src: spread.default,
alt: ""
}, null, -1)
]), 512), [
[vue.vShow, !rowNode.value.expand]
])
], 36)) : vue.createCommentVNode("", true),
_ctx.params.component ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.params.component), {
key: 1,
params: _ctx.params
}, null, 8, ["params"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, vue.toDisplayString(props.params.value), 1))
], 4);
};
}
});
exports.default = _sfc_main;
//# sourceMappingURL=FirstColumnCellRender.vue.js.map