@progress/kendo-vue-buttons
Version:
47 lines (46 loc) • 2.04 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 "@progress/kendo-vue-popup";
const s = "16px", i = (o) => typeof o == "number" ? o + "px" : o, u = (o, e) => {
const t = { horizontal: e ? "right" : "left", vertical: "bottom" };
return o.horizontal === "end" && (t.horizontal = e ? "left" : "right"), t;
}, m = (o, e) => {
const t = { horizontal: e ? "right" : "left", vertical: "top" };
return o.horizontal === "end" && (t.horizontal = e ? "left" : "right"), t;
}, b = (o, e) => {
const t = e === "end" ? "end" : "start";
return {
rtl: { end: "k-text-left", start: "k-text-right" },
ltr: { start: "k-text-left", end: "k-text-right" }
}[o][t];
}, z = (o, e, t, c) => {
const n = e.horizontal, r = e.vertical;
if (o) {
const l = t && t.x !== void 0 ? i(t.x) : s, d = t && t.x !== void 0 ? `calc(50% + ${i(t.x)})` : "50%", h = t && t.y !== void 0 ? i(t.y) : s, p = t && t.y !== void 0 ? `calc(50% + ${i(t.y)})` : "50%";
o.style.setProperty(a(e, c), n === "center" ? d : l), o.style.setProperty(y(e), r === "middle" ? p : h), c && ((r === "top" || r === "bottom") && n === "start" && o.style.setProperty("left", "unset"), r === "middle" && n === "end" && o.style.setProperty("right", "unset"), r === "middle" && n === "start" && o.style.setProperty("left", "unset"));
}
}, a = (o, e) => {
const { horizontal: t } = o;
return {
end: e ? "left" : "right",
center: "left",
start: e ? "right" : "left"
}[t || "end"];
}, y = (o) => ({
top: "top",
middle: "top",
bottom: "bottom"
})[o.vertical || "bottom"];
export {
s as DEFAULT_OFFSET,
u as getAnchorAlign,
m as getPopupAlign,
b as getTextDirectionClass,
z as position,
i as toStringValues
};