| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/framework7/node_modules/framework7-vue/components/ |
Upload File : |
import { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass } from "vue";
const _hoisted_1 = {
key: 0,
className: "toolbar-inner"
};
function render(_ctx, _cache) {
return _openBlock(), _createElementBlock("div", {
ref: "elRef",
class: _normalizeClass(_ctx.classes)
}, [_renderSlot(_ctx.$slots, "before-inner"), _ctx.inner ? (_openBlock(), _createElementBlock("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default")])) : _renderSlot(_ctx.$slots, "default", {
key: 1
}), _renderSlot(_ctx.$slots, "after-inner")], 2);
}
import { computed, ref, provide, onMounted, onBeforeUnmount } from 'vue';
import { classNames } from '../shared/utils.js';
import { colorClasses, colorProps } from '../shared/mixins.js';
import { f7 } from '../shared/f7.js';
import { useTheme } from '../shared/use-theme.js';
export default {
name: 'f7-toolbar',
render,
props: {
tabbar: Boolean,
icons: Boolean,
scrollable: Boolean,
hidden: Boolean,
outline: {
type: Boolean,
default: true
},
position: {
type: String,
default: undefined
},
topMd: {
type: Boolean,
default: undefined
},
topIos: {
type: Boolean,
default: undefined
},
top: {
type: Boolean,
default: undefined
},
bottomMd: {
type: Boolean,
default: undefined
},
bottomIos: {
type: Boolean,
default: undefined
},
bottom: {
type: Boolean,
default: undefined
},
inner: {
type: Boolean,
default: true
},
...colorProps
},
emits: ['toolbar:hide', 'toolbar:show'],
setup(props, _ref) {
let {
emit
} = _ref;
const elRef = ref(null);
const theme = useTheme();
const onHide = toolbarEl => {
if (elRef.value !== toolbarEl) return;
emit('toolbar:hide');
};
const onShow = toolbarEl => {
if (elRef.value !== toolbarEl) return;
emit('toolbar:show');
};
const hide = animate => {
if (!f7) return;
f7.toolbar.hide(elRef.value, animate);
};
const show = animate => {
if (!f7) return;
f7.toolbar.show(elRef.value, animate);
};
onMounted(() => {
if (props.tabbar && f7 && elRef.value) {
f7.toolbar.setHighlight(elRef.value);
}
f7.on('toolbarShow', onShow);
f7.on('toolbarHide', onHide);
});
onBeforeUnmount(() => {
f7.off('toolbarShow', onShow);
f7.off('toolbarHide', onHide);
});
const TabbarContext = computed(() => ({
tabbarHasIcons: props.icons
}));
provide('TabbarContext', TabbarContext);
const classes = computed(() => {
const {
tabbar,
bottomMd,
bottomIos,
bottom,
position,
topMd,
topIos,
top,
icons,
scrollable,
hidden,
outline
} = props;
return classNames('toolbar', {
tabbar,
'toolbar-bottom': theme.value && theme.value.md && bottomMd || theme.value && theme.value.ios && bottomIos || bottom || position === 'bottom',
'toolbar-top': theme.value && theme.value.md && topMd || theme.value && theme.value.ios && topIos || top || position === 'top',
'tabbar-icons': icons,
'tabbar-scrollable': scrollable,
'toolbar-hidden': hidden,
'no-outline': !outline
}, colorClasses(props));
});
return {
classes,
elRef,
hide,
show
};
}
};