UNPKG

@inkline/inkline

Version:

Inkline is the Vue.js UI/UX Library built for creating your next design system

78 lines 1.87 kB
import { defineComponent } from 'vue'; import { defaultPropValue, colorVariantClass, sizePropValidator } from '../../mixins/index.mjs'; /** * Slot for default nav content * @name default * @kind slot */ const componentName = 'INav'; export default defineComponent({ name: componentName, provide() { return { nav: this }; }, inject: { navbar: { default: () => ({ onItemClick: () => { } }) }, sidebar: { default: () => ({ onItemClick: () => { } }) } }, props: { /** * The color variant of the nav * @type light | dark * @default light * @name color */ color: { type: String, default: defaultPropValue(componentName, 'color') }, /** * The size variant of the nav * @type sm | md | lg * @default md * @name size */ size: { type: String, default: defaultPropValue(componentName, 'size'), validator: sizePropValidator }, /** * Display the nav with vertical orientation * @type Boolean * @default false * @name vertical */ vertical: { type: Boolean, default: false } }, computed: { classes() { return { ...colorVariantClass(this), [`-${this.size}`]: Boolean(this.size), '-vertical': this.vertical }; } }, methods: { onItemClick() { [this.navbar, this.sidebar].forEach((parent) => { parent.onItemClick(); }); } } }); //# sourceMappingURL=script.mjs.map