anq-server-data-table
Version:
A powerful server-side data table component for Vue 3 applications, built with Quasar Framework. This component provides a seamless way to handle server-side pagination, filtering, sorting, and data management in your Vue applications.
1,267 lines (1,263 loc) • 435 kB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.flex{display:flex}.table{display:table}.w-full{width:100%}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.\\!items-start{align-items:flex-start!important}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.\\!justify-between{justify-content:space-between!important}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.p-2{padding:.5rem}.font-bold{font-weight:700}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.\\[\\&\\>div\\>div\\:before\\]\\:\\!border-solid>div>div:before{border-style:solid!important}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
import { computed as d, markRaw as Dl, defineComponent as Fl, reactive as ol, h as f, withDirectives as Wt, getCurrentInstance as ge, ref as W, onMounted as $t, watch as ce, onBeforeUpdate as Wr, inject as Wu, onBeforeUnmount as Ye, nextTick as Me, onDeactivated as nn, onActivated as jl, Transition as mt, unref as Jo, onUnmounted as Qr, Teleport as Xr, onBeforeMount as Hl, onUpdated as Qu, toRaw as Zt, createBlock as Vt, openBlock as Je, withCtx as $e, createVNode as Ce, mergeProps as Nn, createElementVNode as Ze, renderSlot as Et, toDisplayString as yl, provide as Xu, useSlots as Ju, createElementBlock as It, Fragment as Dn, createSlots as ga, normalizeClass as Zu, createCommentVNode as Xe, createTextVNode as Gu, renderList as Gl, normalizeProps as ba } from "vue";
const Oo = {
xs: 18,
sm: 24,
md: 32,
lg: 38,
xl: 46
}, Ln = {
size: String
};
function Bn(e, t = Oo) {
return d(() => e.size !== void 0 ? { fontSize: e.size in t ? `${t[e.size]}px` : e.size } : null);
}
function _t(e, t, n, l) {
return Object.defineProperty(e, t, {
get: n,
set: l,
enumerable: !0
}), e;
}
function es(e, t) {
for (const n in t)
_t(e, n, t[n]);
return e;
}
function Te(e) {
return Dl(Fl(e));
}
function Zo(e) {
return Dl(e);
}
const ts = (e, t) => {
const n = ol(e);
for (const l in e)
_t(
t,
l,
() => n[l],
(o) => {
n[l] = o;
}
);
return t;
};
function ot(e, t) {
return e !== void 0 && e() || t;
}
function Jr(e, t) {
if (e !== void 0) {
const n = e();
if (n != null)
return n.slice();
}
return t;
}
function At(e, t) {
return e !== void 0 ? t.concat(e()) : t;
}
function ns(e, t) {
return e === void 0 ? t : t !== void 0 ? t.concat(e()) : e();
}
function ls(e, t, n, l, o, a) {
t.key = l + o;
const r = f(e, t, n);
return o === !0 ? Wt(r, a()) : r;
}
const pa = "0 0 24 24", eo = (e) => e, to = (e) => `ionicons ${e}`, Zr = {
"mdi-": (e) => `mdi ${e}`,
"icon-": eo,
// fontawesome equiv
"bt-": (e) => `bt ${e}`,
"eva-": (e) => `eva ${e}`,
"ion-md": to,
"ion-ios": to,
"ion-logo": to,
"iconfont ": eo,
"ti-": (e) => `themify-icon ${e}`,
"bi-": (e) => `bootstrap-icons ${e}`,
"i-": eo
// UnoCSS pure icons
}, Gr = {
o_: "-outlined",
r_: "-round",
s_: "-sharp"
}, ei = {
sym_o_: "-outlined",
sym_r_: "-rounded",
sym_s_: "-sharp"
}, os = new RegExp("^(" + Object.keys(Zr).join("|") + ")"), as = new RegExp("^(" + Object.keys(Gr).join("|") + ")"), ya = new RegExp("^(" + Object.keys(ei).join("|") + ")"), rs = /^[Mm]\s?[-+]?\.?\d/, is = /^img:/, us = /^svguse:/, ss = /^ion-/, cs = /^(fa-(classic|sharp|solid|regular|light|brands|duotone|thin)|[lf]a[srlbdk]?) /, wt = Te({
name: "QIcon",
props: {
...Ln,
tag: {
type: String,
default: "i"
},
name: String,
color: String,
left: Boolean,
right: Boolean
},
setup(e, { slots: t }) {
const { proxy: { $q: n } } = ge(), l = Bn(e), o = d(
() => "q-icon" + (e.left === !0 ? " on-left" : "") + (e.right === !0 ? " on-right" : "") + (e.color !== void 0 ? ` text-${e.color}` : "")
), a = d(() => {
let r, i = e.name;
if (i === "none" || !i)
return { none: !0 };
if (n.iconMapFn !== null) {
const u = n.iconMapFn(i);
if (u !== void 0)
if (u.icon !== void 0) {
if (i = u.icon, i === "none" || !i)
return { none: !0 };
} else
return {
cls: u.cls,
content: u.content !== void 0 ? u.content : " "
};
}
if (rs.test(i) === !0) {
const [u, v = pa] = i.split("|");
return {
svg: !0,
viewBox: v,
nodes: u.split("&&").map((p) => {
const [b, m, _] = p.split("@@");
return f("path", { style: m, d: b, transform: _ });
})
};
}
if (is.test(i) === !0)
return {
img: !0,
src: i.substring(4)
};
if (us.test(i) === !0) {
const [u, v = pa] = i.split("|");
return {
svguse: !0,
src: u.substring(7),
viewBox: v
};
}
let c = " ";
const s = i.match(os);
if (s !== null)
r = Zr[s[1]](i);
else if (cs.test(i) === !0)
r = i;
else if (ss.test(i) === !0)
r = `ionicons ion-${n.platform.is.ios === !0 ? "ios" : "md"}${i.substring(3)}`;
else if (ya.test(i) === !0) {
r = "notranslate material-symbols";
const u = i.match(ya);
u !== null && (i = i.substring(6), r += ei[u[1]]), c = i;
} else {
r = "notranslate material-icons";
const u = i.match(as);
u !== null && (i = i.substring(2), r += Gr[u[1]]), c = i;
}
return {
cls: r,
content: c
};
});
return () => {
const r = {
class: o.value,
style: l.value,
"aria-hidden": "true"
};
return a.value.none === !0 ? f(e.tag, r, ot(t.default)) : a.value.img === !0 ? f(e.tag, r, At(t.default, [
f("img", { src: a.value.src })
])) : a.value.svg === !0 ? f(e.tag, r, At(t.default, [
f("svg", {
viewBox: a.value.viewBox || "0 0 24 24"
}, a.value.nodes)
])) : a.value.svguse === !0 ? f(e.tag, r, At(t.default, [
f("svg", {
viewBox: a.value.viewBox
}, [
f("use", { "xlink:href": a.value.src })
])
])) : (a.value.cls !== void 0 && (r.class += " " + a.value.cls), f(e.tag, r, At(t.default, [
a.value.content
])));
};
}
}), ds = {
size: {
type: [String, Number],
default: "1em"
},
color: String
};
function fs(e) {
return {
cSize: d(() => e.size in Oo ? `${Oo[e.size]}px` : e.size),
classes: d(
() => "q-spinner" + (e.color ? ` text-${e.color}` : "")
)
};
}
const ti = Te({
name: "QSpinner",
props: {
...ds,
thickness: {
type: Number,
default: 5
}
},
setup(e) {
const { cSize: t, classes: n } = fs(e);
return () => f("svg", {
class: n.value + " q-spinner-mat",
width: t.value,
height: t.value,
viewBox: "25 25 50 50"
}, [
f("circle", {
class: "path",
cx: "50",
cy: "50",
r: "20",
fill: "none",
stroke: "currentColor",
"stroke-width": e.thickness,
"stroke-miterlimit": "10"
})
]);
}
});
let no, ul = 0;
const lt = new Array(256);
for (let e = 0; e < 256; e++)
lt[e] = (e + 256).toString(16).substring(1);
const vs = (() => {
const e = typeof crypto < "u" ? crypto : typeof window < "u" ? window.crypto || window.msCrypto : void 0;
if (e !== void 0) {
if (e.randomBytes !== void 0)
return e.randomBytes;
if (e.getRandomValues !== void 0)
return (t) => {
const n = new Uint8Array(t);
return e.getRandomValues(n), n;
};
}
return (t) => {
const n = [];
for (let l = t; l > 0; l--)
n.push(Math.floor(Math.random() * 256));
return n;
};
})(), wa = 4096;
function Lo() {
(no === void 0 || ul + 16 > wa) && (ul = 0, no = vs(wa));
const e = Array.prototype.slice.call(no, ul, ul += 16);
return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, lt[e[0]] + lt[e[1]] + lt[e[2]] + lt[e[3]] + "-" + lt[e[4]] + lt[e[5]] + "-" + lt[e[6]] + lt[e[7]] + "-" + lt[e[8]] + lt[e[9]] + "-" + lt[e[10]] + lt[e[11]] + lt[e[12]] + lt[e[13]] + lt[e[14]] + lt[e[15]];
}
const Zn = W(
!1
);
let Bo;
function ms(e, t) {
const n = /(edg|edge|edga|edgios)\/([\w.]+)/.exec(e) || /(opr)[\/]([\w.]+)/.exec(e) || /(vivaldi)[\/]([\w.]+)/.exec(e) || /(chrome|crios)[\/]([\w.]+)/.exec(e) || /(version)(applewebkit)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(e) || /(webkit)[\/]([\w.]+).*(version)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(e) || /(firefox|fxios)[\/]([\w.]+)/.exec(e) || /(webkit)[\/]([\w.]+)/.exec(e) || /(opera)(?:.*version|)[\/]([\w.]+)/.exec(e) || [];
return {
browser: n[5] || n[3] || n[1] || "",
version: n[4] || n[2] || "0",
platform: t[0] || ""
};
}
function hs(e) {
return /(ipad)/.exec(e) || /(ipod)/.exec(e) || /(windows phone)/.exec(e) || /(iphone)/.exec(e) || /(kindle)/.exec(e) || /(silk)/.exec(e) || /(android)/.exec(e) || /(win)/.exec(e) || /(mac)/.exec(e) || /(linux)/.exec(e) || /(cros)/.exec(e) || /(playbook)/.exec(e) || /(bb)/.exec(e) || /(blackberry)/.exec(e) || [];
}
const ni = "ontouchstart" in window || window.navigator.maxTouchPoints > 0;
function gs(e) {
const t = e.toLowerCase(), n = hs(t), l = ms(t, n), o = {
mobile: !1,
desktop: !1,
cordova: !1,
capacitor: !1,
nativeMobile: !1,
// nativeMobileWrapper: void 0,
electron: !1,
bex: !1,
linux: !1,
mac: !1,
win: !1,
cros: !1,
chrome: !1,
firefox: !1,
opera: !1,
safari: !1,
vivaldi: !1,
edge: !1,
edgeChromium: !1,
ie: !1,
webkit: !1,
android: !1,
ios: !1,
ipad: !1,
iphone: !1,
ipod: !1,
kindle: !1,
winphone: !1,
blackberry: !1,
playbook: !1,
silk: !1
};
l.browser && (o[l.browser] = !0, o.version = l.version, o.versionNumber = parseInt(l.version, 10)), l.platform && (o[l.platform] = !0);
const a = o.android || o.ios || o.bb || o.blackberry || o.ipad || o.iphone || o.ipod || o.kindle || o.playbook || o.silk || o["windows phone"];
if (a === !0 || t.indexOf("mobile") !== -1 ? o.mobile = !0 : o.desktop = !0, o["windows phone"] && (o.winphone = !0, delete o["windows phone"]), o.edga || o.edgios || o.edg ? (o.edge = !0, l.browser = "edge") : o.crios ? (o.chrome = !0, l.browser = "chrome") : o.fxios && (o.firefox = !0, l.browser = "firefox"), (o.ipod || o.ipad || o.iphone) && (o.ios = !0), o.vivaldi && (l.browser = "vivaldi", o.vivaldi = !0), // Chrome, Opera 15+, Vivaldi and Safari are webkit based browsers
(o.chrome || o.opr || o.safari || o.vivaldi || o.mobile === !0 && o.ios !== !0 && a !== !0) && (o.webkit = !0), o.opr && (l.browser = "opera", o.opera = !0), o.safari && (o.blackberry || o.bb ? (l.browser = "blackberry", o.blackberry = !0) : o.playbook ? (l.browser = "playbook", o.playbook = !0) : o.android ? (l.browser = "android", o.android = !0) : o.kindle ? (l.browser = "kindle", o.kindle = !0) : o.silk && (l.browser = "silk", o.silk = !0)), o.name = l.browser, o.platform = l.platform, t.indexOf("electron") !== -1)
o.electron = !0;
else if (document.location.href.indexOf("-extension://") !== -1)
o.bex = !0;
else {
if (window.Capacitor !== void 0 ? (o.capacitor = !0, o.nativeMobile = !0, o.nativeMobileWrapper = "capacitor") : (window._cordovaNative !== void 0 || window.cordova !== void 0) && (o.cordova = !0, o.nativeMobile = !0, o.nativeMobileWrapper = "cordova"), Zn.value === !0 && (Bo = { is: { ...o } }), ni === !0 && o.mac === !0 && (o.desktop === !0 && o.safari === !0 || o.nativeMobile === !0 && o.android !== !0 && o.ios !== !0 && o.ipad !== !0)) {
delete o.mac, delete o.desktop;
const r = Math.min(window.innerHeight, window.innerWidth) > 414 ? "ipad" : "iphone";
Object.assign(o, {
mobile: !0,
ios: !0,
platform: r,
[r]: !0
});
}
o.mobile !== !0 && window.navigator.userAgentData && window.navigator.userAgentData.mobile && (delete o.desktop, o.mobile = !0);
}
return o;
}
const Sa = navigator.userAgent || navigator.vendor || window.opera, bs = {
has: {
touch: !1,
webStorage: !1
},
within: { iframe: !1 }
}, tt = {
userAgent: Sa,
is: gs(Sa),
has: {
touch: ni
},
within: {
iframe: window.self !== window.top
}
}, Vo = {
install(e) {
const { $q: t } = e;
Zn.value === !0 ? (e.onSSRHydrated.push(() => {
Object.assign(t.platform, tt), Zn.value = !1;
}), t.platform = ol(this)) : t.platform = this;
}
};
{
let e;
_t(tt.has, "webStorage", () => {
if (e !== void 0)
return e;
try {
if (window.localStorage)
return e = !0, !0;
} catch {
}
return e = !1, !1;
}), Object.assign(Vo, tt), Zn.value === !0 && (Object.assign(Vo, Bo, bs), Bo = null);
}
function ps(e) {
return e ?? null;
}
function ka(e, t) {
return e ?? (t === !0 ? `f_${Lo()}` : null);
}
function ys({ getValue: e, required: t = !0 } = {}) {
if (Zn.value === !0) {
const n = e !== void 0 ? W(ps(e())) : W(null);
return t === !0 && n.value === null && $t(() => {
n.value = `f_${Lo()}`;
}), e !== void 0 && ce(e, (l) => {
n.value = ka(l, t);
}), n;
}
return e !== void 0 ? d(() => ka(e(), t)) : W(`f_${Lo()}`);
}
const xa = /^on[A-Z]/;
function ws() {
const { attrs: e, vnode: t } = ge(), n = {
listeners: W({}),
attributes: W({})
};
function l() {
const o = {}, a = {};
for (const r in e)
r !== "class" && r !== "style" && xa.test(r) === !1 && (o[r] = e[r]);
for (const r in t.props)
xa.test(r) === !0 && (a[r] = t.props[r]);
n.attributes.value = o, n.listeners.value = a;
}
return Wr(l), l(), n;
}
const ct = {
dark: {
type: Boolean,
default: null
}
};
function dt(e, t) {
return d(() => e.dark === null ? t.dark.isActive : e.dark);
}
const Ss = "_q_fo_";
function ks({ validate: e, resetValidation: t, requiresQForm: n }) {
const l = Wu(Ss, !1);
if (l !== !1) {
const { props: o, proxy: a } = ge();
Object.assign(a, { validate: e, resetValidation: t }), ce(() => o.disable, (r) => {
r === !0 ? (typeof t == "function" && t(), l.unbindComponent(a)) : l.bindComponent(a);
}), $t(() => {
o.disable !== !0 && l.bindComponent(a);
}), Ye(() => {
o.disable !== !0 && l.unbindComponent(a);
});
} else n === !0 && console.error("Parent QForm not found on useFormChild()!");
}
const _a = /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/, Ca = /^#[0-9a-fA-F]{4}([0-9a-fA-F]{4})?$/, qa = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, sl = /^rgb\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5])\)$/, cl = /^rgba\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),(0|0\.[0-9]+[1-9]|0\.[1-9]+|1)\)$/, lo = {
date: (e) => /^-?[\d]+\/[0-1]\d\/[0-3]\d$/.test(e),
time: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d$/.test(e),
fulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(e),
timeOrFulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/.test(e),
// -- RFC 5322 --
// -- Added in v2.6.6 --
// This is a basic helper validation.
// For something more complex (like RFC 822) you should write and use your own rule.
// We won't be accepting PRs to enhance the one below because of the reason above.
// eslint-disable-next-line
email: (e) => /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),
hexColor: (e) => _a.test(e),
hexaColor: (e) => Ca.test(e),
hexOrHexaColor: (e) => qa.test(e),
rgbColor: (e) => sl.test(e),
rgbaColor: (e) => cl.test(e),
rgbOrRgbaColor: (e) => sl.test(e) || cl.test(e),
hexOrRgbColor: (e) => _a.test(e) || sl.test(e),
hexaOrRgbaColor: (e) => Ca.test(e) || cl.test(e),
anyColor: (e) => qa.test(e) || sl.test(e) || cl.test(e)
};
function li(e, t = 250, n) {
let l = null;
function o() {
const a = arguments, r = () => {
l = null, e.apply(this, a);
};
l !== null && clearTimeout(l), l = setTimeout(r, t);
}
return o.cancel = () => {
l !== null && clearTimeout(l);
}, o;
}
const xs = [!0, !1, "ondemand"], _s = {
modelValue: {},
error: {
type: Boolean,
default: null
},
errorMessage: String,
noErrorIcon: Boolean,
rules: Array,
reactiveRules: Boolean,
lazyRules: {
type: [Boolean, String],
default: !1,
// statement unneeded but avoids future vue implementation changes
validator: (e) => xs.includes(e)
}
};
function Cs(e, t) {
const { props: n, proxy: l } = ge(), o = W(!1), a = W(null), r = W(!1);
ks({ validate: _, resetValidation: m });
let i = 0, c;
const s = d(
() => n.rules !== void 0 && n.rules !== null && n.rules.length !== 0
), u = d(() => n.disable !== !0 && s.value === !0 && t.value === !1), v = d(
() => n.error === !0 || o.value === !0
), p = d(() => typeof n.errorMessage == "string" && n.errorMessage.length !== 0 ? n.errorMessage : a.value);
ce(() => n.modelValue, () => {
r.value = !0, u.value === !0 && n.lazyRules === !1 && h();
});
function b() {
n.lazyRules !== "ondemand" && u.value === !0 && r.value === !0 && h();
}
ce(() => n.reactiveRules, (M) => {
M === !0 ? c === void 0 && (c = ce(() => n.rules, b, { immediate: !0, deep: !0 })) : c !== void 0 && (c(), c = void 0);
}, { immediate: !0 }), ce(() => n.lazyRules, b), ce(e, (M) => {
M === !0 ? r.value = !0 : u.value === !0 && n.lazyRules !== "ondemand" && h();
});
function m() {
i++, t.value = !1, r.value = !1, o.value = !1, a.value = null, h.cancel();
}
function _(M = n.modelValue) {
if (n.disable === !0 || s.value === !1)
return !0;
const C = ++i, q = t.value !== !0 ? () => {
r.value = !0;
} : () => {
}, w = (D, L) => {
D === !0 && q(), o.value = D, a.value = L || null, t.value = !1;
}, y = [];
for (let D = 0; D < n.rules.length; D++) {
const L = n.rules[D];
let I;
if (typeof L == "function" ? I = L(M, lo) : typeof L == "string" && lo[L] !== void 0 && (I = lo[L](M)), I === !1 || typeof I == "string")
return w(!0, I), !1;
I !== !0 && I !== void 0 && y.push(I);
}
return y.length === 0 ? (w(!1), !0) : (t.value = !0, Promise.all(y).then(
(D) => {
if (D === void 0 || Array.isArray(D) === !1 || D.length === 0)
return C === i && w(!1), !0;
const L = D.find((I) => I === !1 || typeof I == "string");
return C === i && w(L !== void 0, L), L === void 0;
},
(D) => (C === i && (console.error(D), w(!0)), !1)
));
}
const h = li(_, 0);
return Ye(() => {
c == null || c(), h.cancel();
}), Object.assign(l, { resetValidation: m, validate: _ }), _t(l, "hasError", () => v.value), {
isDirtyModel: r,
hasRules: s,
hasError: v,
errorMessage: p,
validate: _,
resetValidation: m
};
}
const et = {
hasPassive: !1,
passiveCapture: !0,
notPassiveCapture: !0
};
try {
const e = Object.defineProperty({}, "passive", {
get() {
Object.assign(et, {
hasPassive: !0,
passive: { passive: !0 },
notPassive: { passive: !1 },
passiveCapture: { passive: !0, capture: !0 },
notPassiveCapture: { passive: !1, capture: !0 }
});
}
});
window.addEventListener("qtest", null, e), window.removeEventListener("qtest", null, e);
} catch {
}
function oi() {
}
function qs(e) {
return e.button === 0;
}
function Pn(e) {
return e.touches && e.touches[0] ? e = e.touches[0] : e.changedTouches && e.changedTouches[0] ? e = e.changedTouches[0] : e.targetTouches && e.targetTouches[0] && (e = e.targetTouches[0]), {
top: e.clientY,
left: e.clientX
};
}
function Es(e) {
if (e.path)
return e.path;
if (e.composedPath)
return e.composedPath();
const t = [];
let n = e.target;
for (; n; ) {
if (t.push(n), n.tagName === "HTML")
return t.push(document), t.push(window), t;
n = n.parentElement;
}
}
function pt(e) {
e.stopPropagation();
}
function st(e) {
e.cancelable !== !1 && e.preventDefault();
}
function ze(e) {
e.cancelable !== !1 && e.preventDefault(), e.stopPropagation();
}
function oo(e, t) {
if (e === void 0 || t === !0 && e.__dragPrevented === !0)
return;
const n = t === !0 ? (l) => {
l.__dragPrevented = !0, l.addEventListener("dragstart", st, et.notPassiveCapture);
} : (l) => {
delete l.__dragPrevented, l.removeEventListener("dragstart", st, et.notPassiveCapture);
};
e.querySelectorAll("a, img").forEach(n);
}
function un(e, t, n) {
const l = `__q_${t}_evt`;
e[l] = e[l] !== void 0 ? e[l].concat(n) : n, n.forEach((o) => {
o[0].addEventListener(o[1], e[o[2]], et[o[3]]);
});
}
function Xn(e, t) {
const n = `__q_${t}_evt`;
e[n] !== void 0 && (e[n].forEach((l) => {
l[0].removeEventListener(l[1], e[l[2]], et[l[3]]);
}), e[n] = void 0);
}
let sn = [], Gn = [];
function ai(e) {
Gn = Gn.filter((t) => t !== e);
}
function Ms(e) {
ai(e), Gn.push(e);
}
function Ea(e) {
ai(e), Gn.length === 0 && sn.length !== 0 && (sn[sn.length - 1](), sn = []);
}
function zl(e) {
Gn.length === 0 ? e() : sn.push(e);
}
function Ts(e) {
sn = sn.filter((t) => t !== e);
}
function el(e) {
return e != null && ("" + e).length !== 0;
}
const Ps = {
...ct,
..._s,
label: String,
stackLabel: Boolean,
hint: String,
hideHint: Boolean,
prefix: String,
suffix: String,
labelColor: String,
color: String,
bgColor: String,
filled: Boolean,
outlined: Boolean,
borderless: Boolean,
standout: [Boolean, String],
square: Boolean,
loading: Boolean,
labelSlot: Boolean,
bottomSlots: Boolean,
hideBottomSpace: Boolean,
rounded: Boolean,
dense: Boolean,
itemAligned: Boolean,
counter: Boolean,
clearable: Boolean,
clearIcon: String,
disable: Boolean,
readonly: Boolean,
autofocus: Boolean,
for: String
}, Il = {
...Ps,
maxlength: [Number, String]
}, Go = ["update:modelValue", "clear", "focus", "blur"];
function ea({ requiredForAttr: e = !0, tagProp: t, changeEvent: n = !1 } = {}) {
const { props: l, proxy: o } = ge(), a = dt(l, o.$q), r = ys({
required: e,
getValue: () => l.for
});
return {
requiredForAttr: e,
changeEvent: n,
tag: t === !0 ? d(() => l.tag) : { value: "label" },
isDark: a,
editable: d(
() => l.disable !== !0 && l.readonly !== !0
),
innerLoading: W(!1),
focused: W(!1),
hasPopupOpen: !1,
splitAttrs: ws(),
targetUid: r,
rootRef: W(null),
targetRef: W(null),
controlRef: W(null)
/**
* user supplied additionals:
* innerValue - computed
* floatingLabel - computed
* inputRef - computed
* fieldClass - computed
* hasShadow - computed
* controlEvents - Object with fn(e)
* getControl - fn
* getInnerAppend - fn
* getControlChild - fn
* getShadowControl - fn
* showPopup - fn
*/
};
}
function ta(e) {
const { props: t, emit: n, slots: l, attrs: o, proxy: a } = ge(), { $q: r } = a;
let i = null;
e.hasValue === void 0 && (e.hasValue = d(() => el(t.modelValue))), e.emitValue === void 0 && (e.emitValue = (N) => {
n("update:modelValue", N);
}), e.controlEvents === void 0 && (e.controlEvents = {
onFocusin: V,
onFocusout: A
}), Object.assign(e, {
clearValue: j,
onControlFocusin: V,
onControlFocusout: A,
focus: L
}), e.computedCounter === void 0 && (e.computedCounter = d(() => {
if (t.counter !== !1) {
const N = typeof t.modelValue == "string" || typeof t.modelValue == "number" ? ("" + t.modelValue).length : Array.isArray(t.modelValue) === !0 ? t.modelValue.length : 0, J = t.maxlength !== void 0 ? t.maxlength : t.maxValues;
return N + (J !== void 0 ? " / " + J : "");
}
}));
const {
isDirtyModel: c,
hasRules: s,
hasError: u,
errorMessage: v,
resetValidation: p
} = Cs(e.focused, e.innerLoading), b = e.floatingLabel !== void 0 ? d(() => t.stackLabel === !0 || e.focused.value === !0 || e.floatingLabel.value === !0) : d(() => t.stackLabel === !0 || e.focused.value === !0 || e.hasValue.value === !0), m = d(
() => t.bottomSlots === !0 || t.hint !== void 0 || s.value === !0 || t.counter === !0 || t.error !== null
), _ = d(() => t.filled === !0 ? "filled" : t.outlined === !0 ? "outlined" : t.borderless === !0 ? "borderless" : t.standout ? "standout" : "standard"), h = d(
() => `q-field row no-wrap items-start q-field--${_.value}` + (e.fieldClass !== void 0 ? ` ${e.fieldClass.value}` : "") + (t.rounded === !0 ? " q-field--rounded" : "") + (t.square === !0 ? " q-field--square" : "") + (b.value === !0 ? " q-field--float" : "") + (C.value === !0 ? " q-field--labeled" : "") + (t.dense === !0 ? " q-field--dense" : "") + (t.itemAligned === !0 ? " q-field--item-aligned q-item-type" : "") + (e.isDark.value === !0 ? " q-field--dark" : "") + (e.getControl === void 0 ? " q-field--auto-height" : "") + (e.focused.value === !0 ? " q-field--focused" : "") + (u.value === !0 ? " q-field--error" : "") + (u.value === !0 || e.focused.value === !0 ? " q-field--highlighted" : "") + (t.hideBottomSpace !== !0 && m.value === !0 ? " q-field--with-bottom" : "") + (t.disable === !0 ? " q-field--disabled" : t.readonly === !0 ? " q-field--readonly" : "")
), M = d(
() => "q-field__control relative-position row no-wrap" + (t.bgColor !== void 0 ? ` bg-${t.bgColor}` : "") + (u.value === !0 ? " text-negative" : typeof t.standout == "string" && t.standout.length !== 0 && e.focused.value === !0 ? ` ${t.standout}` : t.color !== void 0 ? ` text-${t.color}` : "")
), C = d(
() => t.labelSlot === !0 || t.label !== void 0
), q = d(
() => "q-field__label no-pointer-events absolute ellipsis" + (t.labelColor !== void 0 && u.value !== !0 ? ` text-${t.labelColor}` : "")
), w = d(() => ({
id: e.targetUid.value,
editable: e.editable.value,
focused: e.focused.value,
floatingLabel: b.value,
modelValue: t.modelValue,
emitValue: e.emitValue
})), y = d(() => {
const N = {};
return e.targetUid.value && (N.for = e.targetUid.value), t.disable === !0 && (N["aria-disabled"] = "true"), N;
});
function D() {
var ue;
const N = document.activeElement;
let J = (ue = e.targetRef) == null ? void 0 : ue.value;
J && (N === null || N.id !== e.targetUid.value) && (J.hasAttribute("tabindex") === !0 || (J = J.querySelector("[tabindex]")), J !== N && (J == null || J.focus({ preventScroll: !0 })));
}
function L() {
zl(D);
}
function I() {
Ts(D);
const N = document.activeElement;
N !== null && e.rootRef.value.contains(N) && N.blur();
}
function V(N) {
i !== null && (clearTimeout(i), i = null), e.editable.value === !0 && e.focused.value === !1 && (e.focused.value = !0, n("focus", N));
}
function A(N, J) {
i !== null && clearTimeout(i), i = setTimeout(() => {
i = null, !(document.hasFocus() === !0 && (e.hasPopupOpen === !0 || e.controlRef === void 0 || e.controlRef.value === null || e.controlRef.value.contains(document.activeElement) !== !1)) && (e.focused.value === !0 && (e.focused.value = !1, n("blur", N)), J == null || J());
});
}
function j(N) {
var J;
ze(N), r.platform.is.mobile !== !0 ? (((J = e.targetRef) == null ? void 0 : J.value) || e.rootRef.value).focus() : e.rootRef.value.contains(document.activeElement) === !0 && document.activeElement.blur(), t.type === "file" && (e.inputRef.value.value = null), n("update:modelValue", null), e.changeEvent === !0 && n("change", null), n("clear", t.modelValue), Me(() => {
const ue = c.value;
p(), c.value = ue;
});
}
function P(N) {
[13, 32].includes(N.keyCode) && j(N);
}
function F() {
const N = [];
return l.prepend !== void 0 && N.push(
f("div", {
class: "q-field__prepend q-field__marginal row no-wrap items-center",
key: "prepend",
onClick: st
}, l.prepend())
), N.push(
f("div", {
class: "q-field__control-container col relative-position row no-wrap q-anchor--skip"
}, k())
), u.value === !0 && t.noErrorIcon === !1 && N.push(
K("error", [
f(wt, { name: r.iconSet.field.error, color: "negative" })
])
), t.loading === !0 || e.innerLoading.value === !0 ? N.push(
K(
"inner-loading-append",
l.loading !== void 0 ? l.loading() : [f(ti, { color: t.color })]
)
) : t.clearable === !0 && e.hasValue.value === !0 && e.editable.value === !0 && N.push(
K("inner-clearable-append", [
f(wt, {
class: "q-field__focusable-action",
name: t.clearIcon || r.iconSet.field.clear,
tabindex: 0,
role: "button",
"aria-hidden": "false",
"aria-label": r.lang.label.clear,
onKeyup: P,
onClick: j
})
])
), l.append !== void 0 && N.push(
f("div", {
class: "q-field__append q-field__marginal row no-wrap items-center",
key: "append",
onClick: st
}, l.append())
), e.getInnerAppend !== void 0 && N.push(
K("inner-append", e.getInnerAppend())
), e.getControlChild !== void 0 && N.push(
e.getControlChild()
), N;
}
function k() {
const N = [];
return t.prefix !== void 0 && t.prefix !== null && N.push(
f("div", {
class: "q-field__prefix no-pointer-events row items-center"
}, t.prefix)
), e.getShadowControl !== void 0 && e.hasShadow.value === !0 && N.push(
e.getShadowControl()
), e.getControl !== void 0 ? N.push(e.getControl()) : l.rawControl !== void 0 ? N.push(l.rawControl()) : l.control !== void 0 && N.push(
f("div", {
ref: e.targetRef,
class: "q-field__native row",
tabindex: -1,
...e.splitAttrs.attributes.value,
"data-autofocus": t.autofocus === !0 || void 0
}, l.control(w.value))
), C.value === !0 && N.push(
f("div", {
class: q.value
}, ot(l.label, t.label))
), t.suffix !== void 0 && t.suffix !== null && N.push(
f("div", {
class: "q-field__suffix no-pointer-events row items-center"
}, t.suffix)
), N.concat(ot(l.default));
}
function z() {
let N, J;
u.value === !0 ? v.value !== null ? (N = [f("div", { role: "alert" }, v.value)], J = `q--slot-error-${v.value}`) : (N = ot(l.error), J = "q--slot-error") : (t.hideHint !== !0 || e.focused.value === !0) && (t.hint !== void 0 ? (N = [f("div", t.hint)], J = `q--slot-hint-${t.hint}`) : (N = ot(l.hint), J = "q--slot-hint"));
const ue = t.counter === !0 || l.counter !== void 0;
if (t.hideBottomSpace === !0 && ue === !1 && N === void 0) return;
const T = f("div", {
key: J,
class: "q-field__messages col"
}, N);
return f("div", {
class: "q-field__bottom row items-start q-field__bottom--" + (t.hideBottomSpace !== !0 ? "animated" : "stale"),
onClick: st
}, [
t.hideBottomSpace === !0 ? T : f(mt, { name: "q-transition--field-message" }, () => T),
ue === !0 ? f("div", {
class: "q-field__counter"
}, l.counter !== void 0 ? l.counter() : e.computedCounter.value) : null
]);
}
function K(N, J) {
return J === null ? null : f("div", {
key: N,
class: "q-field__append q-field__marginal row no-wrap items-center q-anchor--skip"
}, J);
}
let Q = !1;
return nn(() => {
Q = !0;
}), jl(() => {
Q === !0 && t.autofocus === !0 && a.focus();
}), t.autofocus === !0 && $t(() => {
a.focus();
}), Ye(() => {
i !== null && clearTimeout(i);
}), Object.assign(a, { focus: L, blur: I }), function() {
const J = e.getControl === void 0 && l.control === void 0 ? {
...e.splitAttrs.attributes.value,
"data-autofocus": t.autofocus === !0 || void 0,
...y.value
} : y.value;
return f(e.tag.value, {
ref: e.rootRef,
class: [
h.value,
o.class
],
style: o.style,
...J
}, [
l.before !== void 0 ? f("div", {
class: "q-field__before q-field__marginal row no-wrap items-center",
onClick: st
}, l.before()) : null,
f("div", {
class: "q-field__inner relative-position col self-stretch"
}, [
f("div", {
ref: e.controlRef,
class: M.value,
tabindex: -1,
...e.controlEvents
}, F()),
m.value === !0 ? z() : null
]),
l.after !== void 0 ? f("div", {
class: "q-field__after q-field__marginal row no-wrap items-center",
onClick: st
}, l.after()) : null
]);
};
}
function na(e) {
return e !== Object(e) || e.isComposing === !0 || e.qKeyEvent === !0;
}
function Qt(e, t) {
return na(e) === !0 ? !1 : [].concat(t).includes(e.keyCode);
}
const Ma = {
date: "####/##/##",
datetime: "####/##/## ##:##",
time: "##:##",
fulltime: "##:##:##",
phone: "(###) ### - ####",
card: "#### #### #### ####"
}, Ml = {
"#": { pattern: "[\\d]", negate: "[^\\d]" },
S: { pattern: "[a-zA-Z]", negate: "[^a-zA-Z]" },
N: { pattern: "[0-9a-zA-Z]", negate: "[^0-9a-zA-Z]" },
A: { pattern: "[a-zA-Z]", negate: "[^a-zA-Z]", transform: (e) => e.toLocaleUpperCase() },
a: { pattern: "[a-zA-Z]", negate: "[^a-zA-Z]", transform: (e) => e.toLocaleLowerCase() },
X: { pattern: "[0-9a-zA-Z]", negate: "[^0-9a-zA-Z]", transform: (e) => e.toLocaleUpperCase() },
x: { pattern: "[0-9a-zA-Z]", negate: "[^0-9a-zA-Z]", transform: (e) => e.toLocaleLowerCase() }
}, ri = Object.keys(Ml);
ri.forEach((e) => {
Ml[e].regex = new RegExp(Ml[e].pattern);
});
const Rs = new RegExp("\\\\([^.*+?^${}()|([\\]])|([.*+?^${}()|[\\]])|([" + ri.join("") + "])|(.)", "g"), Ta = /[.*+?^${}()|[\]\\]/g, We = "", Os = {
mask: String,
reverseFillMask: Boolean,
fillMask: [Boolean, String],
unmaskedValue: Boolean
};
function Ls(e, t, n, l) {
let o, a, r, i, c, s;
const u = W(null), v = W(b());
function p() {
return e.autogrow === !0 || ["textarea", "text", "search", "url", "tel", "password"].includes(e.type);
}
ce(() => e.type + e.autogrow, _), ce(() => e.mask, (V) => {
if (V !== void 0)
h(v.value, !0);
else {
const A = L(v.value);
_(), e.modelValue !== A && t("update:modelValue", A);
}
}), ce(() => e.fillMask + e.reverseFillMask, () => {
u.value === !0 && h(v.value, !0);
}), ce(() => e.unmaskedValue, () => {
u.value === !0 && h(v.value);
});
function b() {
if (_(), u.value === !0) {
const V = y(L(e.modelValue));
return e.fillMask !== !1 ? I(V) : V;
}
return e.modelValue;
}
function m(V) {
if (V < o.length)
return o.slice(-V);
let A = "", j = o;
const P = j.indexOf(We);
if (P !== -1) {
for (let F = V - j.length; F > 0; F--)
A += We;
j = j.slice(0, P) + A + j.slice(P);
}
return j;
}
function _() {
if (u.value = e.mask !== void 0 && e.mask.length !== 0 && p(), u.value === !1) {
i = void 0, o = "", a = "";
return;
}
const V = Ma[e.mask] === void 0 ? e.mask : Ma[e.mask], A = typeof e.fillMask == "string" && e.fillMask.length !== 0 ? e.fillMask.slice(0, 1) : "_", j = A.replace(Ta, "\\$&"), P = [], F = [], k = [];
let z = e.reverseFillMask === !0, K = "", Q = "";
V.replace(Rs, (T, E, G, H, Z) => {
if (H !== void 0) {
const te = Ml[H];
k.push(te), Q = te.negate, z === !0 && (F.push("(?:" + Q + "+)?(" + te.pattern + "+)?(?:" + Q + "+)?(" + te.pattern + "+)?"), z = !1), F.push("(?:" + Q + "+)?(" + te.pattern + ")?");
} else if (G !== void 0)
K = "\\" + (G === "\\" ? "" : G), k.push(G), P.push("([^" + K + "]+)?" + K + "?");
else {
const te = E !== void 0 ? E : Z;
K = te === "\\" ? "\\\\\\\\" : te.replace(Ta, "\\\\$&"), k.push(te), P.push("([^" + K + "]+)?" + K + "?");
}
});
const N = new RegExp(
"^" + P.join("") + "(" + (K === "" ? "." : "[^" + K + "]") + "+)?" + (K === "" ? "" : "[" + K + "]*") + "$"
), J = F.length - 1, ue = F.map((T, E) => E === 0 && e.reverseFillMask === !0 ? new RegExp("^" + j + "*" + T) : E === J ? new RegExp(
"^" + T + "(" + (Q === "" ? "." : Q) + "+)?" + (e.reverseFillMask === !0 ? "$" : j + "*")
) : new RegExp("^" + T));
r = k, i = (T) => {
const E = N.exec(e.reverseFillMask === !0 ? T : T.slice(0, k.length + 1));
E !== null && (T = E.slice(1).join(""));
const G = [], H = ue.length;
for (let Z = 0, te = T; Z < H; Z++) {
const oe = ue[Z].exec(te);
if (oe === null)
break;
te = te.slice(oe.shift().length), G.push(...oe);
}
return G.length !== 0 ? G.join("") : T;
}, o = k.map((T) => typeof T == "string" ? T : We).join(""), a = o.split(We).join(A);
}
function h(V, A, j) {
const P = l.value, F = P.selectionEnd, k = P.value.length - F, z = L(V);
A === !0 && _();
const K = y(z), Q = e.fillMask !== !1 ? I(K) : K, N = v.value !== Q;
P.value !== Q && (P.value = Q), N === !0 && (v.value = Q), document.activeElement === P && Me(() => {
if (Q === a) {
const ue = e.reverseFillMask === !0 ? a.length : 0;
P.setSelectionRange(ue, ue, "forward");
return;
}
if (j === "insertFromPaste" && e.reverseFillMask !== !0) {
const ue = P.selectionEnd;
let T = F - 1;
for (let E = c; E <= T && E < ue; E++)
o[E] !== We && T++;
C.right(P, T);
return;
}
if (["deleteContentBackward", "deleteContentForward"].indexOf(j) !== -1) {
const ue = e.reverseFillMask === !0 ? F === 0 ? Q.length > K.length ? 1 : 0 : Math.max(0, Q.length - (Q === a ? 0 : Math.min(K.length, k) + 1)) + 1 : F;
P.setSelectionRange(ue, ue, "forward");
return;
}
if (e.reverseFillMask === !0)
if (N === !0) {
const ue = Math.max(0, Q.length - (Q === a ? 0 : Math.min(K.length, k + 1)));
ue === 1 && F === 1 ? P.setSelectionRange(ue, ue, "forward") : C.rightReverse(P, ue);
} else {
const ue = Q.length - k;
P.setSelectionRange(ue, ue, "backward");
}
else if (N === !0) {
const ue = Math.max(0, o.indexOf(We), Math.min(K.length, F) - 1);
C.right(P, ue);
} else {
const ue = F - 1;
C.right(P, ue);
}
});
const J = e.unmaskedValue === !0 ? L(Q) : Q;
String(e.modelValue) !== J && (e.modelValue !== null || J !== "") && n(J, !0);
}
function M(V, A, j) {
const P = y(L(V.value));
A = Math.max(0, o.indexOf(We), Math.min(P.length, A)), c = A, V.setSelectionRange(A, j, "forward");
}
const C = {
left(V, A) {
const j = o.slice(A - 1).indexOf(We) === -1;
let P = Math.max(0, A - 1);
for (; P >= 0; P--)
if (o[P] === We) {
A = P, j === !0 && A++;
break;
}
if (P < 0 && o[A] !== void 0 && o[A] !== We)
return C.right(V, 0);
A >= 0 && V.setSelectionRange(A, A, "backward");
},
right(V, A) {
const j = V.value.length;
let P = Math.min(j, A + 1);
for (; P <= j; P++)
if (o[P] === We) {
A = P;
break;
} else o[P - 1] === We && (A = P);
if (P > j && o[A - 1] !== void 0 && o[A - 1] !== We)
return C.left(V, j);
V.setSelectionRange(A, A, "forward");
},
leftReverse(V, A) {
const j = m(V.value.length);
let P = Math.max(0, A - 1);
for (; P >= 0; P--)
if (j[P - 1] === We) {
A = P;
break;
} else if (j[P] === We && (A = P, P === 0))
break;
if (P < 0 && j[A] !== void 0 && j[A] !== We)
return C.rightReverse(V, 0);
A >= 0 && V.setSelectionRange(A, A, "backward");
},
rightReverse(V, A) {
const j = V.value.length, P = m(j), F = P.slice(0, A + 1).indexOf(We) === -1;
let k = Math.min(j, A + 1);
for (; k <= j; k++)
if (P[k - 1] === We) {
A = k, A > 0 && F === !0 && A--;
break;
}
if (k > j && P[A - 1] !== void 0 && P[A - 1] !== We)
return C.leftReverse(V, j);
V.setSelectionRange(A, A, "forward");
}
};
function q(V) {
t("click", V), s = void 0;
}
function w(V) {
if (t("keydown", V), na(V) === !0 || V.altKey === !0) return;
const A = l.value, j = A.selectionStart, P = A.selectionEnd;
if (V.shiftKey || (s = void 0), V.keyCode === 37 || V.keyCode === 39) {
V.shiftKey && s === void 0 && (s = A.selectionDirection === "forward" ? j : P);
const F = C[(V.keyCode === 39 ? "right" : "left") + (e.reverseFillMask === !0 ? "Reverse" : "")];
if (V.preventDefault(), F(A, s === j ? P : j), V.shiftKey) {
const k = A.selectionStart;
A.setSelectionRange(Math.min(s, k), Math.max(s, k), "forward");
}
} else V.keyCode === 8 && e.reverseFillMask !== !0 && j === P ? (C.left(A, j), A.setSelectionRange(A.selectionStart, P, "backward")) : V.keyCode === 46 && e.reverseFillMask === !0 && j === P && (C.rightReverse(A, P), A.setSelectionRange(j, A.selectionEnd, "forward"));
}
function y(V) {
if (V == null || V === "")
return "";
if (e.reverseFillMask === !0)
return D(V);
const A = r;
let j = 0, P = "";
for (let F = 0; F < A.length; F++) {
const k = V[j], z = A[F];
if (typeof z == "string")
P += z, k === z && j++;
else if (k !== void 0 && z.regex.test(k))
P += z.transform !== void 0 ? z.transform(k) : k, j++;
else
return P;
}
return P;
}
function D(V) {
const A = r, j = o.indexOf(We);
let P = V.length - 1, F = "";
for (let k = A.length - 1; k >= 0 && P !== -1; k--) {
const z = A[k];
let K = V[P];
if (typeof z == "string")
F = z + F, K === z && P--;
else if (K !== void 0 && z.regex.test(K))
do
F = (z.transform !== void 0 ? z.transform(K) : K) + F, P--, K = V[P];
while (j === k && K !== void 0 && z.regex.test(K));
else
return F;
}
return F;
}
function L(V) {
return typeof V != "string" || i === void 0 ? typeof V == "number" ? i("" + V) : V : i(V);
}
function I(V) {
return a.length - V.length <= 0 ? V : e.reverseFillMask === !0 && V.length !== 0 ? a.slice(0, -V.length) + V : V + a.slice(V.length);
}
return {
innerValue: v,
hasMask: u,
moveCursorForPaste: M,
updateMaskValue: h,
onMaskedKeydown: w,
onMaskedClick: q
};
}
const Vn = {
name: String
};
function ii(e) {
return d(() => ({
type: "hidden",
name: e.name,
value: e.modelValue
}));
}
function Nl(e = {}) {
return (t, n, l) => {
t[n](
f("input", {
class: "hidden" + (l || ""),
...e.value
})
);
};
}
function ui(e) {
return d(() => e.name || e.for);
}
function Bs(e, t) {
function n() {
const l = e.modelValue;
try {
const o = "DataTransfer" in window ? new DataTransfer() : "ClipboardEvent" in window ? new ClipboardEvent("").clipboardData : void 0;
return Object(l) === l && ("length" in l ? Array.from(l) : [l]).forEach((a) => {
o.items.add(a);
}), {
files: o.files
};
} catch {
return {
files: void 0
};
}
}
return d(() => {
if (e.type === "file")
return n();
});
}
const Vs = /[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/, As = /[\u4e00-\u9fff\u3400-\u4dbf\u{20000}-\u{2a6df}\u{2a700}-\u{2b73f}\u{2b740}-\u{2b81f}\u{2b820}-\u{2ceaf}\uf900-\ufaff\u3300-\u33ff\ufe30-\ufe4f\uf900-\ufaff\u{2f800}-\u{2fa1f}]/u, $s = /[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/, Ds = /[a-z0-9_ -]$/i;
function si(e) {
return function(n) {
if (n.type === "compositionend" || n.type === "change") {
if (n.target.qComposing !== !0) return;
n.target.qComposing = !1, e(n);
} else n.type === "compositionupdate" && n.target.qComposing !== !0 && typeof n.data == "string" && (tt.is.firefox === !0 ? Ds.test(n.data) === !1 : Vs.test(n.data) === !0 || As.test(n.data) === !0 || $s.test(n.data) === !0) === !0 && (n.target.qComposing = !0);
};
}
const rn = Te({
name: "QInput",
inheritAttrs: !1,
props: {
...Il,
...Os,
...Vn,
// override of useFieldProps > modelValue
modelValue: [String, Number, FileList],
shadowText: String,
type: {
type: String,
default: "text"
},
debounce: [String, Number],
autogrow: Boolean,
// makes a textarea
inputClass: [Array, String, Object],
inputStyle: [Array, String