winbox-ui-next
Version:
We Design Vue 2.0: A Vue.js 3 UI Library
18 lines (17 loc) • 713 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports[Symbol.toStringTag] = "Module";
var NP = require("number-precision");
function _interopDefaultLegacy(e) {
return e && typeof e === "object" && "default" in e ? e : { "default": e };
}
var NP__default = /* @__PURE__ */ _interopDefaultLegacy(NP);
const getOffsetPercent = (value, [min, max]) => {
const percent = (value - min) / (max - min);
return `${NP__default["default"].round(percent * 100, 2)}%`;
};
const getPositionStyle = (offset, direction) => {
return direction === "vertical" ? { bottom: offset } : { left: offset };
};
exports.getOffsetPercent = getOffsetPercent;
exports.getPositionStyle = getPositionStyle;