UNPKG

winbox-ui-next

Version:

We Design Vue 2.0: A Vue.js 3 UI Library

119 lines (118 loc) 5.04 kB
"use strict"; var vue = require("vue"); var is = require("../../_utils/is.js"); var index = require("../../icon/icon-left/index.js"); var index$1 = require("../../icon/icon-right/index.js"); var index$2 = require("../../icon/icon-double-left/index.js"); var index$3 = require("../../icon/icon-double-right/index.js"); var renderFunction = require("../../_components/render-function.js"); var pluginVue_exportHelper = require("../../_virtual/plugin-vue_export-helper"); const _sfc_main = vue.defineComponent({ name: "PanelHeader", components: { IconLeft: index, IconRight: index$1, IconDoubleLeft: index$2, IconDoubleRight: index$3, RenderFunction: renderFunction }, props: { prefixCls: { type: String, required: true }, title: { type: String, required: true }, icons: { type: Object }, onPrev: { type: Function }, onSuperPrev: { type: Function }, onNext: { type: Function }, onSuperNext: { type: Function } }, setup(props) { return { showPrev: vue.computed(() => is.isFunction(props.onPrev)), showSuperPrev: vue.computed(() => is.isFunction(props.onSuperPrev)), showNext: vue.computed(() => is.isFunction(props.onNext)), showSuperNext: vue.computed(() => is.isFunction(props.onSuperNext)), getIconClassName: (show) => [ `${props.prefixCls}-header-icon`, { [`${props.prefixCls}-header-icon-hidden`]: !show } ] }; } }); function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_RenderFunction = vue.resolveComponent("RenderFunction"); const _component_IconDoubleLeft = vue.resolveComponent("IconDoubleLeft"); const _component_IconLeft = vue.resolveComponent("IconLeft"); const _component_IconRight = vue.resolveComponent("IconRight"); const _component_IconDoubleRight = vue.resolveComponent("IconDoubleRight"); return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass(`${_ctx.prefixCls}-header`) }, [ vue.createElementVNode("div", { class: vue.normalizeClass(_ctx.getIconClassName(_ctx.showSuperPrev)), onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onSuperPrev && _ctx.onSuperPrev(...args)) }, [ _ctx.showSuperPrev ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ _ctx.icons && _ctx.icons.prevDouble ? (vue.openBlock(), vue.createBlock(_component_RenderFunction, { key: 0, "render-func": _ctx.icons && _ctx.icons.prevDouble }, null, 8, ["render-func"])) : (vue.openBlock(), vue.createBlock(_component_IconDoubleLeft, { key: 1 })) ], 2112)) : vue.createCommentVNode("v-if", true) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass(_ctx.getIconClassName(_ctx.showPrev)), onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onPrev && _ctx.onPrev(...args)) }, [ _ctx.showPrev ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ _ctx.icons && _ctx.icons.prev ? (vue.openBlock(), vue.createBlock(_component_RenderFunction, { key: 0, "render-func": _ctx.icons && _ctx.icons.prev }, null, 8, ["render-func"])) : (vue.openBlock(), vue.createBlock(_component_IconLeft, { key: 1 })) ], 2112)) : vue.createCommentVNode("v-if", true) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass(`${_ctx.prefixCls}-header-title`) }, vue.toDisplayString(_ctx.title), 3), vue.createElementVNode("div", { class: vue.normalizeClass(_ctx.getIconClassName(_ctx.showNext)), onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onNext && _ctx.onNext(...args)) }, [ _ctx.showNext ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ _ctx.icons && _ctx.icons.next ? (vue.openBlock(), vue.createBlock(_component_RenderFunction, { key: 0, "render-func": _ctx.icons && _ctx.icons.next }, null, 8, ["render-func"])) : (vue.openBlock(), vue.createBlock(_component_IconRight, { key: 1 })) ], 2112)) : vue.createCommentVNode("v-if", true) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass(_ctx.getIconClassName(_ctx.showSuperNext)), onClick: _cache[3] || (_cache[3] = (...args) => _ctx.onSuperNext && _ctx.onSuperNext(...args)) }, [ _ctx.showSuperNext ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ _ctx.icons && _ctx.icons.nextDouble ? (vue.openBlock(), vue.createBlock(_component_RenderFunction, { key: 0, "render-func": _ctx.icons && _ctx.icons.nextDouble }, null, 8, ["render-func"])) : (vue.openBlock(), vue.createBlock(_component_IconDoubleRight, { key: 1 })) ], 2112)) : vue.createCommentVNode("v-if", true) ], 2) ], 2); } var PanelHeader = /* @__PURE__ */ pluginVue_exportHelper(_sfc_main, [["render", _sfc_render]]); module.exports = PanelHeader;