UNPKG

@progress/kendo-vue-dialogs

Version:
140 lines (139 loc) 4.11 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { defineComponent as I, h as n, createVNode as i } from "vue"; import { getTemplate as e } from "@progress/kendo-vue-common"; import { Button as l } from "@progress/kendo-vue-buttons"; import { provideLocalizationService as M } from "@progress/kendo-vue-intl"; import { windowStage as a } from "./StageEnum.mjs"; import { dialogsWindowMinimizeButton as r, messages as c, dialogsWindowMaximizeButton as u, dialogsWindowRestoreButton as d, dialogsWindowCloseButton as m } from "./messages/main.mjs"; import { windowMinimizeIcon as v, windowIcon as L, windowRestoreIcon as $, xIcon as j } from "@progress/kendo-svg-icons"; const K = /* @__PURE__ */ I({ name: "KendoWindowTitleBar", props: { id: String, stage: String, closeButton: [String, Function, Object, Boolean], minimizeButton: [String, Function, Object, Boolean], maximizeButton: [String, Function, Object, Boolean], restoreButton: [String, Function, Object, Boolean], title: String, titleId: String, titleRender: [String, Function, Object, Boolean], onDoubleclick: Function, onMinimizeclick: Function, onFullscreenclick: Function, onRestoreclick: Function, onCloseclick: Function }, inject: { kendoLocalizationService: { default: null } }, methods: { onDoubleClick(t) { this.$emit("doubleclick", t); }, onMinimizeClick(t) { this.$emit("minimizeclick", t); }, onFullScreenClick(t) { this.$emit("fullscreenclick", t); }, onRestoreClick(t) { this.$emit("restoreclick", t); }, onCloseClick(t) { this.$emit("closeclick", t); } }, render() { const t = this.$props, { stage: s, title: g, titleRender: w, minimizeButton: k, maximizeButton: p, restoreButton: B, closeButton: f } = t, o = M(this); let h = e.call(this, { h: n, template: w, defaultRendering: g }); const b = i(l, { type: "button", class: "k-window-titlebar-action", size: "xs", icon: "window-minimize", svgIcon: v, fillMode: "flat", onClick: this.onMinimizeClick, "aria-label": o.toLanguageString(r, c[r]) }, null), z = e.call(this, { h: n, template: k, defaultRendering: b }), C = i(l, { type: "button", class: "k-window-titlebar-action", size: "xs", icon: "window", svgIcon: L, fillMode: "flat", onClick: this.onFullScreenClick, "aria-label": o.toLanguageString(u, c[u]) }, null), S = e.call(this, { h: n, template: p, defaultRendering: C }), F = i(l, { type: "button", class: "k-window-titlebar-action", size: "xs", icon: "window-restore", svgIcon: $, fillMode: "flat", onClick: this.onRestoreClick, "aria-label": o.toLanguageString(d, c[d]) }, null), R = e.call(this, { h: n, template: B, defaultRendering: F }), x = i(l, { type: "button", class: "k-window-titlebar-action", size: "xs", icon: "x", svgIcon: j, fillMode: "flat", onClick: this.onCloseClick, "aria-label": o.toLanguageString(m, c[m]) }, null), D = e.call(this, { h: n, template: f, defaultRendering: x }); return i("div", { class: "k-window-titlebar", style: { touchAction: "none" }, onDblclick: this.onDoubleClick }, [i("span", { class: "k-window-title", id: this.$props.titleId }, [h]), i("div", { class: "k-window-titlebar-actions" }, [s === a.DEFAULT && z, s === a.DEFAULT && S, s !== a.DEFAULT && R, D])]); } }); export { K as WindowTitleBar };