import Utils from '../utils/utils'; import Mixins from '../utils/mixins'; /* phenome-dts-imports import { Tooltip as TooltipNamespace } from 'framework7/components/tooltip/tooltip'; */ /* phenome-dts-instance f7Tooltip: TooltipNamespace.Tooltip */ export default { name: 'f7-fab', props: { id: [String, Number], className: String, // phenome-react-line style: Object, // phenome-react-line morphTo: String, href: [Boolean, String], target: String, text: String, position: { type: String, default: 'right-bottom', }, tooltip: String, ...Mixins.colorProps, }, render() { const self = this; const props = self.props; const { className, id, style, morphTo, href: initialHref, position, text, target, } = props; let href = initialHref; if (href === true) href = '#'; if (href === false) href = undefined; // no href attribute const linkChildren = []; const rootChildren = []; const { link: linkSlots, default: defaultSlots, root: rootSlots, text: textSlots } = self.slots; if (defaultSlots) { for (let i = 0; i < defaultSlots.length; i += 1) { const child = defaultSlots[i]; let isRoot; if (process.env.COMPILER === 'react') { const tag = child.type && (child.type.displayName || child.type.name); if (tag === 'F7FabButtons' || tag === 'f7-fab-buttons') isRoot = true; } if (process.env.COMPILER === 'vue') { if (child.tag && child.tag.indexOf('fab-buttons') >= 0) isRoot = true; } if (isRoot) rootChildren.push(child); else linkChildren.push(child); } } let textEl; if (text || (textSlots && textSlots.length)) { textEl = (