xdesign-vue-next
Version:
XDesign Component for vue-next
26 lines (22 loc) • 719 B
JavaScript
/**
* xdesign v1.0.6
* (c) 2023 xdesign
* @license MIT
*/
import { d as dayjs } from '../../../_chunks/dep-6fe15f5a.mjs';
import '../../../_chunks/dep-82805301.mjs';
import '../../../_chunks/dep-10a947a6.mjs';
function validateInputValue(value, format) {
return dayjs(value, format).format(format) === value;
}
function formatInputValue(value, format) {
return dayjs(value, format).format(format);
}
function closestLookup(availableArr, calcVal, step) {
if (step <= 1) return calcVal;
return availableArr.sort(function (a, b) {
return Math.abs(calcVal + 1 - a) - Math.abs(calcVal + 1 - b);
})[0];
}
export { closestLookup, formatInputValue, validateInputValue };
//# sourceMappingURL=utils.mjs.map