New-OMIS/public/assets/js/pages/form-masks.init.js
2024-04-16 10:54:23 +05:45

74 lines
2.0 KiB
JavaScript

var cleaveDate,
cleaveDateFormat,
cleaveTime,
cleaveTimeFormat,
cleaveNumeral,
cleaveDelimiter,
cleaveDelimiters,
cleavePrefix,
cleaveBlocks;
document.querySelector("#cleave-date") &&
(cleaveDate = new Cleave("#cleave-date", {
date: !0,
delimiter: "-",
datePattern: ["d", "m", "Y"],
})),
document.querySelector("#cleave-date-format") &&
(cleaveDateFormat = new Cleave("#cleave-date-format", {
date: !0,
datePattern: ["m", "y"],
})),
document.querySelector("#cleave-time") &&
(cleaveTime = new Cleave("#cleave-time", {
time: !0,
timePattern: ["h", "m", "s"],
})),
document.querySelector("#cleave-time-format") &&
(cleaveTimeFormat = new Cleave("#cleave-time-format", {
time: !0,
timePattern: ["h", "m"],
})),
document.querySelectorAll(".cleave-numeral").forEach(function (element) {
new Cleave(element, {
numeral: !0,
numeralThousandsGroupStyle: "thousand",
});
});
// document.querySelector("cleave-numeral") &&
// (cleaveNumeral = new Cleave(".cleave-numeral", {
// numeral: !0,
// numeralThousandsGroupStyle: "thousand",
// })),
document.querySelector("#cleave-ccard") &&
(cleaveBlocks = new Cleave("#cleave-ccard", {
blocks: [4, 4, 4, 4],
uppercase: !0,
})),
document.querySelector("#cleave-delimiter") &&
(cleaveDelimiter = new Cleave("#cleave-delimiter", {
delimiter: "·",
blocks: [3, 3, 3],
uppercase: !0,
})),
document.querySelector("#cleave-delimiters") &&
(cleaveDelimiters = new Cleave("#cleave-delimiters", {
delimiters: [".", ".", "-"],
blocks: [3, 3, 3, 2],
uppercase: !0,
})),
document.querySelector("#cleave-prefix") &&
(cleavePrefix = new Cleave("#cleave-prefix", {
prefix: "INV",
delimiter: "-",
blocks: [3, 4, 4, 4],
uppercase: !0,
})),
document.querySelector("#cleave-phone") &&
(cleaveBlocks = new Cleave("#cleave-phone", {
delimiters: ["(", ")", "-"],
blocks: [0, 3, 3, 4],
}));