import { Component, Prop, Vue } from "vue-property-decorator"; // Components import Icon from "@/components/Icon/index.vue"; import Logo from "@/components/Logo/index.vue"; import Button from "@/components/Button/index.vue"; import Notification from "@/components/TopBar/Notification/index.vue"; import TerminalList from "@/components/TopBar/TerminalList/index.vue"; import NotificationBadge from "@/components/NotificationBadge/index.vue"; import Tooltip from "@/components/Tooltip/index.vue"; import { IDropdownOptions, INavigationBarTerminal, TitleTooltip } from "@/types"; import UserProfile from "./UserProfile/index.vue"; @Component({ components: { Icon, Logo, Button, Notification, TerminalList, NotificationBadge, UserProfile, Tooltip, }, }) export default class TopBar extends Vue { @Prop({ type: Array }) terminals!: []; @Prop({ type: Boolean, default: true }) readonly hasMenu?: boolean; @Prop({ type: Boolean, default: false }) readonly centerLogo?: boolean; @Prop({ type: String, default: "عنوان درگاه؟؟" }) titleTerminal?: string; @Prop({ type: String }) readonly notificationBadge?: string; @Prop({ type: String }) readonly ticketingBadge?: string; @Prop({ type: Array }) readonly profileList!: IDropdownOptions[]; @Prop({ type: Array }) readonly footerList!: IDropdownOptions[]; @Prop({ type: String }) readonly username?: string; @Prop({ type: String }) readonly userPhone?: string; @Prop({ type: Boolean }) readonly userPremium?: boolean; @Prop({ type: Boolean, default: false }) readonly noTerminal?: boolean; @Prop({ type: Boolean, default: false }) readonly showTerminal?: boolean; @Prop({ type: Boolean, default: false }) readonly noLogo?: boolean; @Prop({ type: Boolean, default: false }) readonly showLogo?: boolean; @Prop({ type: Object }) readonly titleTooltip?: TitleTooltip; @Prop({ type: Object }) readonly activeTerminal?: INavigationBarTerminal; @Prop({ type: String }) readonly dashboard?: string; @Prop({ type: String }) readonly homePage?: string; @Prop({ type: String }) readonly userAvatar?: string; showTerminalList = false; showProfileBox = false; toggleTerminalList(): void { this.showTerminalList = !this.showTerminalList; } windowWidth: number | string = ""; mounted() { this.windowWidth = window.innerWidth; window.addEventListener("resize", this.handleResize); } beforeDestroy() { window.removeEventListener("resize", this.handleResize); } handleResize() { this.windowWidth = window.innerWidth; } terminalClick(payload: any): void { this.toggleTerminalList(); this.$emit("terminalClick", payload); } }