@progress/kendo-vue-inputs
Version:
161 lines (160 loc) • 4.21 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { defineComponent as $, createVNode as i } from "vue";
import { Dialog as B } from "@progress/kendo-vue-dialogs";
import { SignatureBottomActions as O } from "./SignatureBottomActions.mjs";
import { SignatureLine as L } from "./SignatureLine.mjs";
import { Button as N } from "@progress/kendo-vue-buttons";
import { provideLocalizationService as W } from "@progress/kendo-vue-intl";
import { getRef as x, setRef as o } from "@progress/kendo-vue-common";
import { hyperlinkOpenIcon as I } from "@progress/kendo-svg-icons";
import { SignatureCanvas as F } from "./SignatureCanvas.mjs";
import { signatureMinimize as r, messages as l, signatureClear as a } from "../messages/main.mjs";
const J = /* @__PURE__ */ $({
name: "KendoSignatureDialog",
emits: {
change: null,
clear: null,
close: null,
focus: null,
blur: null,
overlayclick: null,
draw: null,
drawend: null
},
props: {
openWrapperClass: Object,
size: String,
dir: String,
popupWidth: Number,
popupHeight: Number,
showClear: Boolean,
strokeWidth: Number,
popupScale: Number,
scale: Number,
value: String,
tabIndex: Number,
disabled: Boolean,
readOnly: Boolean,
color: String,
backgroundColor: String,
elementSize: Function,
smooth: Boolean
},
inject: {
kendoLocalizationService: {
default: null
}
},
data() {
return {
isDrawing: !1
};
},
mounted() {
this.openCanvas = x(this, "openCanvas");
},
render() {
const {
showClear: e,
popupWidth: s,
popupHeight: u,
dir: c,
size: p,
value: m,
tabIndex: h,
disabled: d,
readOnly: g,
color: C,
backgroundColor: f,
strokeWidth: k,
smooth: b,
popupScale: S,
scale: v,
elementSize: w
} = this.$props, n = W(this), t = n.toLanguageString(r, l[r]), z = n.toLanguageString(a, l[a]), D = !this.$props.hideLine && i(L, null, null), y = i(O, {
showClear: e,
size: p,
onClear: this.onClear,
title: z
}, null);
return i(B, {
ref: o(this, "dialog"),
onOverlayclick: this.onOverlayClick
}, {
default: () => [i("div", {
style: {
width: s + "px",
height: u + "px"
},
dir: c,
class: this.openWrapperClass,
onFocus: this.onFocus,
onBlur: this.onBlur
}, [i(F, {
ref: o(this, "openCanvas"),
value: m,
tabIndex: h,
disabled: d,
readOnly: g,
color: C,
backgroundColor: f,
strokeWidth: k,
smooth: b,
popupScale: S,
scale: v,
onChange: this.onValueChange,
elementSize: w,
onDraw: this.onDraw,
onDrawend: this.onDrawEnd
}, null), i("div", {
class: "k-signature-actions k-signature-actions-top"
}, [!this.isDrawing && i(N, {
class: "k-signature-action k-signature-minimize k-rotate-180",
ref: o(this, "minimizeButton"),
icon: "hyperlink-open",
svgIcon: I,
shape: null,
fillMode: "flat",
size: this.$props.size,
onClick: this.onMinimizeClick,
"aria-label": t,
title: t
}, null)]), D, y])]
});
},
methods: {
onDraw() {
this.isDrawing = !0, this.$emit("draw");
},
onDrawEnd() {
this.isDrawing = !1, this.$emit("drawend");
},
onValueChange(e) {
this.$emit("change", e);
},
onClear() {
this.$emit("clear");
},
onMinimizeClick() {
this.$emit("close");
},
onFocus(e) {
this.$emit("focus", e);
},
onBlur(e) {
this.$emit("blur", e);
},
onOverlayClick(e) {
this.$emit("overlayclick", e);
}
}
});
export {
J as SignatureDialog
};