UNPKG

vue-gantt-3

Version:

A gantt component for Vue 3

65 lines (64 loc) 2.6 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const vue = require("vue"); const Thumb_vue_vue_type_script_setup_true_lang = require("./Thumb.vue.js"); const _sfc_main = /* @__PURE__ */ vue.defineComponent({ __name: "Bar", props: { horizontalWidth: {}, verticalHeight: {}, horizontalVisible: { type: Boolean }, verticalVisible: { type: Boolean }, scrollbarHeight: { default: 0 }, scrollbarWidth: { default: 0 } }, emits: ["triggerScrollFromThumb"], setup(__props, { expose: __expose, emit: __emit }) { const emit = __emit; const horizontalThumbRef = vue.ref(); const verticalThumbRef = vue.ref(); const handleScroll = (wrap) => { const { scrollTop, scrollLeft } = wrap; if (horizontalThumbRef.value) { horizontalThumbRef.value.handleScroll({ top: 0, left: scrollLeft }); } if (verticalThumbRef.value) { verticalThumbRef.value.handleScroll({ top: scrollTop, left: 0 }); } }; const triggerScrollFromThumb = (options) => { emit("triggerScrollFromThumb", options); }; __expose({ handleScroll }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.withDirectives(vue.createVNode(Thumb_vue_vue_type_script_setup_true_lang.default, { ref_key: "horizontalThumbRef", ref: horizontalThumbRef, isHorizontal: true, width: _ctx.horizontalWidth, height: _ctx.scrollbarHeight, style: vue.normalizeStyle({ maxHeight: _ctx.scrollbarHeight + "px", width: `calc(100% - ${_ctx.verticalVisible ? _ctx.scrollbarWidth : 0}px)` }), onTriggerScrollFromThumb: triggerScrollFromThumb }, null, 8, ["width", "height", "style"]), [ [vue.vShow, _ctx.horizontalVisible] ]), vue.withDirectives(vue.createVNode(Thumb_vue_vue_type_script_setup_true_lang.default, { ref_key: "verticalThumbRef", ref: verticalThumbRef, isHorizontal: false, height: _ctx.verticalHeight, width: _ctx.scrollbarWidth, style: vue.normalizeStyle({ maxWidth: _ctx.scrollbarWidth + "px", height: `calc(100% - ${_ctx.horizontalVisible ? _ctx.scrollbarHeight : 0}px)` }), onTriggerScrollFromThumb: triggerScrollFromThumb }, null, 8, ["height", "width", "style"]), [ [vue.vShow, _ctx.verticalVisible] ]) ], 64); }; } }); exports.default = _sfc_main; //# sourceMappingURL=Bar.vue.js.map