@joker.front/ui
Version:
Joker-UI | Official native UI component library for Joker Framework. Minimalist design with full-scene components, responsive layout & dynamic interactions. Access dev docs, API references & real-world case studies on official site.
1,312 lines • 490 kB
JavaScript
var xn = Object.defineProperty;
var Tn = (t, r, e) => r in t ? xn(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
var n = (t, r, e) => Tn(t, typeof r != "symbol" ? r + "" : r, e);
var Dn = Object.defineProperty, $n = Object.getOwnPropertyNames, In = (t, r, e) => r in t ? Dn(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e, Be = (t, r) => function() {
return r || (0, t[$n(t)[0]])((r = { exports: {} }).exports, r), r.exports;
}, $e = (t, r, e) => In(t, typeof r != "symbol" ? r + "" : r, e);
function ce(t) {
return t !== null && typeof t == "object";
}
function Jt(t) {
return Object.prototype.toString.call(t) === "[object Object]";
}
function Xi(t) {
if (t === null || typeof t != "object") return t;
let r;
r = Array.isArray(t) ? [] : {};
let e = Object.keys(t);
for (let s of e) {
let o = t[s];
r[s] = typeof o == "object" ? Xi(o) : o;
}
return r;
}
function Ce(t, r = "") {
let e, s = r.split("."), o = t, i = s.length;
for (let a = 0; a < i; a++) {
let l = s[a];
if (!o) break;
if (a === i - 1) {
e = o[l];
break;
}
o = o[l];
}
return e;
}
function Kt(t, r, e) {
return Array.isArray(t) && Array.isArray(r) ? Ln(t, r) : qi(t, r);
}
function qi(t, r, e) {
if (t === r) return !0;
let s = ce(t), o = ce(r);
return s && o ? Jt(t) && Jt(r) ? Object.keys(t).length !== Object.keys(r).length ? !1 : JSON.stringify(t) === JSON.stringify(r) : t === r : !s && !o && String(t) === String(r);
}
function ie(t, r) {
let e = t.indexOf(r);
return e > -1 && t.splice(e, 1), t;
}
function nt(t, r) {
let e = t.findIndex((s) => r(s));
return e > -1 && t.splice(e, 1), t;
}
function Ln(t, r, e) {
if (t.length !== r.length) return !1;
for (let s = 0; s < t.length; s++) if (qi(t[s], r[s]) === !1) return !1;
return !0;
}
function Gi(t) {
return Array.apply(null, { length: t }).map((r, e) => e);
}
function Ue(t = 32) {
let r = [], e = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
for (let s = 0; s < t; s++) {
let o = Math.round(Math.random() * (e.length - 1));
r.push(e[o]);
}
return r.join("");
}
function An(t, r = "-") {
return (t = t || "").split(/(?=[A-Z])/).map((e) => e.toLowerCase()).join(r);
}
function Nn(t = "") {
return t.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
}
function Pn() {
let t = [];
return { add: function(r) {
return t.push(r), () => {
ie(t, r);
};
}, callbacks: t, reset: function() {
t = [];
}, remove: function(r) {
ie(t, r);
} };
}
var Zi = "warn", Ht = ["silent", "error", "warn", "info"];
function Vt() {
let t = /* @__PURE__ */ new Date();
function r(e, s = 2) {
return e.toString().padStart(s, "0");
}
return r(t.getHours()) + ":" + r(t.getMinutes()) + ":" + r(t.getSeconds()) + ":" + r(t.getMilliseconds(), 3);
}
function ut(t, r, e, s) {
Ht.indexOf(t) <= Ht.indexOf(Zi) && (s === void 0 ? console[t](`${Vt()} [${r}]:`, e) : console[t](`${Vt()} [${r}]:`, e, s));
}
var j = { info: function(t, r, e) {
ut("info", t, r, e);
}, warn: function(t, r, e) {
ut("warn", t, r, e);
}, error: function(t, r, e) {
ut("error", t, r, e);
}, setLoggerLeve: function(t) {
Zi = t;
} }, Fn = class {
constructor(t = "hex") {
$e(this, "format"), $e(this, "h", 0), $e(this, "s", 100), $e(this, "v", 100), $e(this, "a", 100), $e(this, "value", ""), this.format = t;
}
setVal(t, r) {
this[t] = r, this.doOnChange();
}
toRgb() {
return xt(this.h, this.s, this.v);
}
setFormat(t) {
this.format = t, this.doOnChange();
}
fromString(t) {
if (!t) return this.h = 0, this.s = 100, this.v = 100, void this.doOnChange();
let r = (e, s, o) => {
this.h = Math.max(0, Math.min(360, e)), this.s = Math.max(0, Math.min(100, s)), this.v = Math.max(0, Math.min(100, o)), this.doOnChange();
};
if (t.indexOf("rgb") !== -1) {
let e = t.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((s) => s !== "").map((s, o) => o > 2 ? parseFloat(s) : parseInt(s, 10));
if (e.length === 4 ? this.a = Math.floor(100 * e[3]) : e.length === 3 && (this.a = 100), e.length >= 3) {
let { h: s, s: o, v: i } = jt(e[0], e[1], e[2]);
r(s, o, i);
}
} else if (t.indexOf("#") !== -1) {
let e = t.replace("#", "").trim();
if (!/^(?:[0-9a-fA-F]{3}){1,2}|[0-9a-fA-F]{8}$/.test(e)) return;
let s = 0, o = 0, i = 0;
e.length === 3 ? (s = we(e[0] + e[0]), o = we(e[1] + e[1]), i = we(e[2] + e[2])) : e.length !== 6 && e.length !== 8 || (s = we(e.substring(0, 2)), o = we(e.substring(2, 4)), i = we(e.substring(4, 6))), e.length === 8 ? this.a = Math.floor(we(e.substring(6)) / 255 * 100) : e.length !== 3 && e.length !== 6 || (this.a = 100);
let { h: a, s: l, v: d } = jt(s, o, i);
r(a, l, d);
}
}
compare(t) {
return Math.abs(t.h - this.h) < 2 && Math.abs(t.s - this.s) < 1 && Math.abs(t.v - this.v) < 1 && Math.abs(t.a - this.a) < 1;
}
doOnChange() {
let { h: t, s: r, v: e, a: s, format: o } = this;
if (o === "rgba") {
let { r: i, g: a, b: l } = xt(t, r, e);
this.value = `rgba(${i}, ${a}, ${l}, ${s / 100})`;
} else this.value = Mn(t, r, e, s / 100);
}
}, Ae = function(t, r) {
var e;
typeof (e = t) == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1 && (t = "100%");
let s = function(o) {
return typeof o == "string" && o.indexOf("%") !== -1;
}(t);
return t = Math.min(r, Math.max(0, parseFloat(t))), s && (t = parseInt(t * r, 10) / 100), Math.abs(t - r) < 1e-6 ? 1 : t % r / parseFloat(r);
}, mt = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 }, we = function(t) {
return t.length === 2 ? 16 * (mt[t[0].toUpperCase()] || +t[0]) + (mt[t[1].toUpperCase()] || +t[1]) : mt[t[1].toUpperCase()] || +t[1];
};
function jt(t, r, e) {
t = Ae(t, 255), r = Ae(r, 255), e = Ae(e, 255);
let s = Math.max(t, r, e), o = Math.min(t, r, e), i = 0, a = 0, l = s, d = s - o;
if (a = s === 0 ? 0 : d / s, s === o) i = 0;
else {
switch (s) {
case t:
i = (r - e) / d + (r < e ? 6 : 0);
break;
case r:
i = (e - t) / d + 2;
break;
case e:
i = (t - r) / d + 4;
}
i /= 6;
}
return { h: 360 * i, s: 100 * a, v: 100 * l };
}
function xt(t, r, e) {
t = 6 * Ae(t, 360), r = Ae(r, 100), e = Ae(e, 100);
let s = Math.floor(t), o = t - s, i = e * (1 - r), a = e * (1 - o * r), l = e * (1 - (1 - o) * r), d = s % 6, p = [e, a, i, i, l, e][d], c = [l, e, e, a, i, i][d], m = [i, i, l, e, e, a][d];
return { r: Math.round(255 * p), g: Math.round(255 * c), b: Math.round(255 * m) };
}
var Mn = function(t, r, e, s) {
let o = xt(t, r, e), i = Math.floor(s * o.r + 255 * (1 - s)), a = Math.floor(s * o.g + 255 * (1 - s)), l = Math.floor(s * o.b + 255 * (1 - s));
return "#" + ("0" + i.toString(16)).slice(-2) + ("0" + a.toString(16)).slice(-2) + ("0" + l.toString(16)).slice(-2);
};
function Ke(t, r, e = {}) {
let s, o = !1, i = 0, a = () => {
s && clearTimeout(s);
};
function l(...d) {
let p = Date.now() - i;
if (o) return;
let c = () => {
i = Date.now(), r.apply(l, d);
};
function m() {
s = void 0;
}
e.noLeading || !e.debounceMode || s || c(), a(), e.debounceMode === void 0 && p > t ? e.noLeading ? (i = Date.now(), e.noTrailing || (s = setTimeout(e.debounceMode ? m : c, t))) : c() : e.noTrailing !== !0 && (s = setTimeout(e.debounceMode ? m : c, e.debounceMode === void 0 ? t - p : t));
}
return l.cancel = (d) => {
a(), o = !d;
}, l;
}
function le(t, r, e = !1) {
return Ke(t, r, { debounceMode: e !== !1 });
}
const Jn = /([\:\-\_]+(.))/g, Kn = /^moz([A-Z])/;
function u(t) {
return `__joker_${t}_name__`;
}
function Qi() {
return !isNaN(Number(document.documentMode));
}
function en() {
return navigator.userAgent.indexOf("Edge") > -1;
}
function He(t, r) {
if (t === r)
return !0;
if (!(t instanceof Array) || !(r instanceof Array) || t.length !== r.length)
return !1;
for (let e = 0; e !== t.length; ++e)
if (t[e] !== r[e])
return !1;
return !0;
}
function Hn(t) {
let r = [];
const e = ["transform", "transition", "animation"], s = ["ms-", "webkit-"];
return e.forEach((o) => {
const i = t[o];
o && i && s.forEach((a) => {
r.push(a + o + ":" + i);
});
}), r.join(";");
}
function ht(t) {
if (t !== void 0)
return t = (t != null ? t : "").toString(), isNaN(parseFloat(t)) ? t : t + "px";
}
function zt(t) {
let r = !1;
return function(...e) {
r || (r = !0, window.requestAnimationFrame((s) => {
t.apply(this, e), r = !1;
}));
};
}
function Vn() {
return !!window.navigator.userAgent.match(/firefox/i);
}
function jn(t) {
return t && t.nodeType === Node.ELEMENT_NODE;
}
const tt = (t, r) => {
let e = t;
for (; e; ) {
if ([window, document, document.documentElement].includes(e))
return document.documentElement;
if (zn(e))
return e;
e = e.parentNode;
}
return e;
}, zn = (t, r) => {
const e = tn(t, "overflow");
return e == null ? void 0 : e.match(/(scroll|auto|overlay)/);
}, tn = function(t, r) {
if (!t || !r)
return null;
r = Bn(r), r === "float" && (r = "cssFloat");
try {
var e = document.defaultView && document.defaultView.getComputedStyle(t, "");
return t.style[r] || e && e[r] || null;
} catch {
return t.style[r];
}
}, Bn = function(t) {
return t.replace(Jn, function(r, e, s, o) {
return o ? s.toUpperCase() : s;
}).replace(Kn, "Moz$1");
}, Un = (t, r) => {
if (!t || !r)
return !1;
const e = t.getBoundingClientRect();
let s;
return [window, document, document.documentElement, null, void 0].includes(r) ? s = {
top: 0,
right: window.innerWidth,
bottom: window.innerHeight,
left: 0
} : s = r.getBoundingClientRect(), e.top < s.bottom && e.bottom > s.top && e.right > s.left && e.left < s.right;
};
let Bt = () => document.documentElement.style.objectFit !== void 0;
class Yn extends window[Symbol.for("JOKER")].Component {
constructor() {
super(...arguments);
n(this, "propsOption", {
type: "default",
nativeType: "button"
});
n(this, "name", u("button"));
n(this, "model", {
loading: !1
});
}
created() {
this.$syncProp("loading");
}
handleClick(e) {
this.$trigger("click", void 0, e);
}
handleMouseEnter(e) {
this.$trigger("mouseenter", void 0, e);
}
handleMouseLeave(e) {
this.$trigger("mouseleave", void 0, e);
}
}
let Wn = { render: function(t) {
return [t.createElement("button", { disabled: "@(props.disabled || model.loading)", autofocus: "@props.autofocus", type: "@props.nativeType", "@click": "handleClick", "@mouseenter": "handleMouseEnter", "@mouseleave": "handleMouseLeave", class: "@([ 'jk-button', props.type || '', props.size || '', { 'is-link': props.link, 'is-disabled': props.disabled, 'is-loading': model.loading, 'is-plain': props.plain, 'is-round': props.round, 'is-circle': props.circle, 'is-fullwidth': props.fullWidth }, props.class ])" }, [t.createCommand("if", "model.loading", [t.createElement("i", { class: "jk-icon-loading" }, [])]), t.createCommand("if", "props.icon && !model.loading", [t.createElement("i", { class: "@props.icon" }, [])]), t.createCommand("if", "$sections && $sections.default && !props.circle", [t.createElement("span", {}, [t.createCommand("RenderSection", "")])])])];
} }, Xn = {
component: Yn
};
var is, ns;
let Te = class extends (ns = Xn.component, is = window[Symbol.for("JOKER")].SCOPE_ID, ns) {
constructor() {
super(...arguments);
n(this, is, "d62bf0ee");
n(this, "template", Wn.render);
}
}, qn = { render: function(t) {
return [t.createElement("div", { class: "@(['jk-button-group', props.fullWidth && 'is-fullwidth', props.class])" }, [t.createCommand("RenderSection", "")])];
} }, Gn = class extends window[Symbol.for("JOKER")].Component {
}, Zn = {
component: Gn
};
var as, ls;
let Qn = class extends (ls = Zn.component, as = window[Symbol.for("JOKER")].SCOPE_ID, ls) {
constructor() {
super(...arguments);
n(this, as, "84e3c7ed");
n(this, "template", qn.render);
}
};
class ea extends window[Symbol.for("JOKER")].Component {
}
let ta = { render: function(t) {
return [t.createElement("i", { class: "jk-icon-@props.name @(props.class||'')" }, [])];
} }, sa = {
component: ea
}, oa = class extends sa.component {
constructor() {
super(...arguments);
n(this, "template", ta.render);
}
};
class ra extends window[Symbol.for("JOKER")].Component {
constructor() {
super(...arguments);
n(this, "propsOption", {
span: { type: Number, default: 24 },
tag: "div",
offset: Number,
pull: Number,
push: Number
});
}
mounted() {
this.$render([
window[Symbol.for("JOKER")].createElement(
this.props.tag,
{
class: "jk-col @classVal",
style: "@styleVal"
},
[window[Symbol.for("JOKER")].createCommand("RenderSection")]
)
]);
}
get classVal() {
let e = [];
return this.setClassColItem("span", e), this.setClassColItem("offset", e), this.setClassColItem("pull", e), this.setClassColItem("push", e), this.setClassSizeItem("xs", e), this.setClassSizeItem("sm", e), this.setClassSizeItem("md", e), this.setClassSizeItem("lg", e), this.setClassSizeItem("xl", e), e.join(" ");
}
get styleVal() {
let e = "";
if (this.gutter) {
let s = this.gutter / 2 + "px";
e += `padding-left:${s};`, e += `padding-right:${s};`;
}
return e;
}
get gutter() {
var s;
let e = (s = this.$rootVNode) == null ? void 0 : s.closest((o) => o instanceof window[Symbol.for("JOKER")].VNode.Component && o.component && o.component.name === u("layout_row"));
return e ? e.component.props.gutter : 0;
}
setClassColItem(e, s) {
let o = this.props[e];
(o || o === 0) && s.push(e === "span" ? `col-${o}` : `col-${e}-${o}`);
}
setClassSizeItem(e, s) {
let o = this.props[e];
if (typeof o == "object")
for (let i in o)
s.push(i === "span" ? `col-${e}-${o}` : `col-${e}-${i}-${o}`);
else o !== void 0 && s.push(`col-${e}-${o}`);
}
}
let ia = {
component: ra
};
var ds, ps;
let na = class extends (ps = ia.component, ds = window[Symbol.for("JOKER")].SCOPE_ID, ps) {
constructor() {
super(...arguments);
n(this, ds, "5ad70566");
}
};
class aa extends window[Symbol.for("JOKER")].Component {
constructor() {
super(...arguments);
n(this, "name", u("layout_row"));
n(this, "propsOption", {
tag: "div",
justify: "start",
gutter: Number
});
n(this, "template", () => [
window[Symbol.for("JOKER")].createElement(
this.props.tag,
{
class: "jk-row @classVal",
style: "@styleVal"
},
[window[Symbol.for("JOKER")].createCommand("RenderSection")]
)
]);
}
get classVal() {
let e = [];
return this.props.justify !== "start" && e.push("is-justify-" + this.props.justify), this.props.align && e.push("is-align-" + this.props.align), this.props.type === "flex" && e.push("is-flex"), e.join(" ");
}
get styleVal() {
let e = "";
if (this.props.gutter) {
let s = this.props.gutter / 2;
e += `margin-left:-${s}px;`, e += `margin-right:-${s}px;`;
}
return e;
}
}
let la = {
component: aa
};
var cs, us;
let da = class extends (us = la.component, cs = window[Symbol.for("JOKER")].SCOPE_ID, us) {
constructor() {
super(...arguments);
n(this, cs, "30bf975d");
}
};
class pa extends window[Symbol.for("JOKER")].Component {
constructor() {
super(...arguments);
n(this, "propsOption", {
href: "javascript:void(0)",
underline: !0
});
}
handleClick(e) {
this.$trigger("click", void 0, e);
}
}
let ca = { render: function(t) {
return [t.createElement("a", { class: "@([ 'jk-link', props.type || 'default', { 'is-disabled': props.disabled, 'is-underline': props.underline && !props.disabled }, props.class, props.size ])", href: "@props.href", target: "@props.target", "@click": "handleClick" }, [t.createCommand("if", "props.icon", [t.createElement("i", { class: "@props.icon" }, [])]), t.createCommand("if", "$sections && $sections.default", [t.createElement("span", {}, [t.createCommand("RenderSection", "")])])])];
} }, ua = {
component: pa
};
var ms, hs;
let Lt = class extends (hs = ua.component, ms = window[Symbol.for("JOKER")].SCOPE_ID, hs) {
constructor() {
super(...arguments);
n(this, ms, "5698f682");
n(this, "template", ca.render);
}
};
class K extends window[Symbol.for("JOKER")].Component {
constructor(...e) {
super(...e);
n(this, "formItemOption");
this.$on("created", () => {
var s, o;
(o = (s = this.model).value) != null || (s.value = void 0), this.$syncProp("value"), this.formItemOption = ma(this);
});
}
get isError() {
var e;
return this.props.error || ((e = this.formItemOption) == null ? void 0 : e.ctrl.validateState.value) === "error";
}
get form() {
var e, s;
return (s = (e = this.$root) == null ? void 0 : e.closest((o) => o instanceof window[Symbol.for("JOKER")].VNode.Component && o.component.name === u("form"))) == null ? void 0 : s.component;
}
get sizeClass() {
var e;
return this.props.size || ((e = this.form) == null ? void 0 : e.props.size);
}
triggerValidate() {
this.$trigger("validate");
}
get value() {
return this.model.value;
}
set value(e) {
this.model.value = e;
}
}
function ma(t) {
var e, s, o, i;
if (!t.props.name)
return;
if (!("value" in t.model)) {
j.warn("formCtrl", "The registered control does not conform to the rules of the Form form control. The [model.value] property is missing.", t);
return;
}
let r = t.props.name;
if (t.$root && t.$root instanceof window[Symbol.for("JOKER")].VNode.Node) {
let a = (s = (e = t.$root) == null ? void 0 : e.closest((d) => d instanceof window[Symbol.for("JOKER")].VNode.Component && d.component.name === u("form"))) == null ? void 0 : s.component;
if (!a)
return;
let l = (i = (o = t.$root) == null ? void 0 : o.closest((d) => d instanceof window[Symbol.for("JOKER")].VNode.Component && d.component.name === u("form-item"))) == null ? void 0 : i.component;
return a.registerFormCtrl(r, { ctrl: t, formItem: l }), t.$on("validate", () => {
a == null || a.validate(r).catch((d) => {
});
}), t.$on("beforeDestroy", () => {
a.unRegisterFormCtrl(r, t);
}), {
form: a,
formItem: l,
ctrl: a.ctrls[r],
unRegisterFormCtrl: () => {
a.unRegisterFormCtrl(r, t);
}
};
}
}
class ha extends K {
constructor() {
super(...arguments);
n(this, "model", {
value: void 0,
focus: !1
});
}
mounted() {
this.$watch(
() => this.checked,
(e) => {
this.$getRef("radio").output.checked = e;
}
), this.$getRef("radio").output.checked = this.checked;
}
get checked() {
return this.group ? this.value === this.props.value : this.props.value;
}
get group() {
var e;
return (e = this.$rootVNode) == null ? void 0 : e.closest((s) => {
var o;
return s instanceof window[Symbol.for("JOKER")].VNode.Component && ((o = s.component) == null ? void 0 : o.name) === u("radio_group");
});
}
get value() {
return this.group ? this.group.component.model.value : this.model.value;
}
set value(e) {
this.group ? this.group.component.checked(e) : this.model.value = e, this.$getRef("radio").output.checked = this.model.value === this.props.value;
}
get isDisabled() {
var e, s, o;
return (o = (s = (e = this.group) == null ? void 0 : e.component) == null ? void 0 : s.props.disabled) != null ? o : this.props.disabled;
}
get tabIndex() {
return this.isDisabled || this.group && this.value !== this.props.value ? -1 : 0;
}
get size() {
var e;
return ((e = this.group) == null ? void 0 : e.component.props.size) || this.props.size;
}
handleKeydown(e) {
this.isDisabled || (this.value = this.props.value);
}
handleFocus(e) {
this.model.focus = !0;
}
handleBlur(e) {
this.model.focus = !1;
}
handleChange(e) {
var s, o;
(s = e.target) != null && s.output.checked && (this.value = this.props.value, (o = this.group) == null || o.component.handleChange(e, this.value)), this.$trigger("change", this.value), this.triggerValidate();
}
handleClick(e) {
this.$trigger("click", void 0, e);
}
}
let fa = { render: function(t) {
return [t.createElement("label", { class: "@([ 'jk-radio', props.border && size && size, props.class, isDisabled && 'is-disabled', model.focus && 'is-focus', props.border && 'is-border', checked && 'is-checked' ])", role: "radio", "aria-checked": "@(checked)", "aria-disabled": "@isDisabled", tabindex: "@tabIndex", "@click": "handleClick", "@keydown.space.stop.prevent": "handleKeydown" }, [t.createElement("span", { class: "input @(isDisabled?'is-disabled':'') @(checked?'is-checked':'')" }, [t.createElement("span", { class: "target" }, []), t.createElement("input", { ref: "radio", type: "radio", value: "@props.label", name: "@props.name", disabled: "@isDisabled", tabindex: "-1", autocomplete: "off", "@focus": "handleFocus", "@blur": "handleBlur", "@change": "handleChange" }, [])]), t.createCommand("if", "$sections.default || props.label", [t.createElement("span", { class: "label", "@keydown.stop": "__UNDEFINED_BUFFER__" }, [t.createCommand("if", "$sections.default", [t.createCommand("RenderSection", "")]), t.createCommand("else", "", [t.createCodeFunction("props.label")])])])])];
} }, ga = {
component: ha
};
var fs, gs;
let sn = class extends (gs = ga.component, fs = window[Symbol.for("JOKER")].SCOPE_ID, gs) {
constructor() {
super(...arguments);
n(this, fs, "7ed2efce");
n(this, "template", fa.render);
}
};
class Ea extends K {
constructor() {
super(...arguments);
n(this, "name", u("radio_group"));
n(this, "model", {
value: void 0
});
}
handleKeydown(e) {
let s = e.event, o = e.event.target, i = this.$getRef("group").output, a = o.tagName === "INPUT" ? "[type=radio]" : "[role=radio]", l = i.querySelectorAll(a);
if (l && l.length) {
let d = Array.from(l).indexOf(o), p = l.length, c = i.querySelectorAll("[role=radio]");
switch (s.key) {
case "ArrowLeft":
case "ArrowUp":
s.stopPropagation(), s.preventDefault(), d === 0 ? (c[p - 1].click(), c[p - 1].focus()) : (c[d - 1].click(), c[d - 1].focus());
break;
case "ArrowRight":
case "ArrowDown":
s.stopPropagation(), s.preventDefault(), d === l.length - 1 ? (c[0].click(), c[0].focus()) : (c[d + 1].click(), c[d + 1].focus());
break;
}
}
}
checked(e) {
this.model.value = e;
}
handleChange(e, s) {
this.$trigger("change", s, e), this.triggerValidate();
}
}
let Ca = { render: function(t) {
return [t.createElement("div", { class: "@(['jk-radio-group', props.class])", ref: "group", "@keydown": "handleKeydown" }, [t.createCommand("RenderSection", "")])];
} }, _a = {
component: Ea
}, ba = class extends _a.component {
constructor() {
super(...arguments);
n(this, "template", Ca.render);
}
};
class va extends K {
constructor() {
super(...arguments);
n(this, "model", {
value: void 0,
focus: !1
});
}
mounted() {
this.$watch(
() => this.value === this.props.value,
(e) => {
this.$getRef("radio").output.checked = e;
}
), this.$getRef("radio").output.checked = this.value === this.props.value;
}
get group() {
var e;
return (e = this.$rootVNode) == null ? void 0 : e.closest((s) => {
var o;
return s instanceof window[Symbol.for("JOKER")].VNode.Component && ((o = s.component) == null ? void 0 : o.name) === u("radio_group");
});
}
get value() {
return this.group ? this.group.component.model.value : this.model.value;
}
set value(e) {
this.group ? this.group.component.checked(e) : this.model.value = e, this.$getRef("radio").output.checked = this.model.value === this.props.value;
}
get isDisabled() {
var e, s, o;
return (o = (s = (e = this.group) == null ? void 0 : e.component) == null ? void 0 : s.props.disabled) != null ? o : this.props.disabled;
}
get tabIndex() {
return this.isDisabled || this.group && this.value !== this.props.value ? -1 : 0;
}
get size() {
var e;
return ((e = this.group) == null ? void 0 : e.component.props.size) || this.sizeClass;
}
handleKeydown(e) {
this.isDisabled || (this.value = this.props.value);
}
handleFocus(e) {
this.model.focus = !0;
}
handleBlur(e) {
this.model.focus = !1;
}
handleChange(e) {
var s, o;
(s = e.target) != null && s.output.checked && (this.value = this.props.value, (o = this.group) == null || o.component.handleChange(e, this.value)), this.$trigger("change", this.value), this.triggerValidate();
}
}
let wa = { render: function(t) {
return [t.createElement("label", { class: "@([ 'jk-radio-button', size, props.class, isDisabled && 'is-disabled', model.focus && 'is-focus', value === props.value && 'is-checked' ])", role: "radio", "aria-checked": "@(value === props.label)", "aria-disabled": "@isDisabled", tabindex: "@tabIndex", "@keydown.space.stop.prevent": "handleKeydown" }, [t.createElement("input", { ref: "radio", type: "radio", value: "@props.label", name: "@props.name", disabled: "@isDisabled", tabindex: "-1", autocomplete: "off", "@focus": "handleFocus", "@blur": "handleBlur", "@change": "handleChange" }, []), t.createElement("span", { class: "target", "@keydown.stop": "__UNDEFINED_BUFFER__" }, [t.createCommand("if", "$sections.default", [t.createCommand("RenderSection", "")]), t.createCommand("else", "", [t.createCodeFunction("props.label")])])])];
} }, ya = {
component: va
};
var Es, Cs;
let Ra = class extends (Cs = ya.component, Es = window[Symbol.for("JOKER")].SCOPE_ID, Cs) {
constructor() {
super(...arguments);
n(this, Es, "a5e94cf9");
n(this, "template", wa.render);
}
};
class Sa extends K {
constructor() {
super(...arguments);
n(this, "model", {
value: void 0,
focus: !1,
disabled: !1
});
n(this, "propsOption", {
value: {
default: !1
}
});
}
mounted() {
this.$syncProp("disabled"), this.$watch(
() => this.value === this.props.label,
(e) => {
this.$getRef("checkbox").output.checked = e;
}
), this.$getRef("checkbox").output.checked = !!this.value;
}
get group() {
var e;
return (e = this.$rootVNode) == null ? void 0 : e.closest((s) => {
var o;
return s instanceof window[Symbol.for("JOKER")].VNode.Component && ((o = s.component) == null ? void 0 : o.name) === u("checkbox-group");
});
}
get value() {
return this.group ? this.group.component.model.value.indexOf(this.props.value) > -1 : this.model.value;
}
set value(e) {
this.group ? this.group.component.checked(this.props.value, e) : this.model.value = e, this.$getRef("checkbox").output.checked = !!this.model.value;
}
get isLimitDisabled() {
if (this.group) {
let { max: e, min: s } = this.group.component.props, o = this.group.component.model.value;
return !!(e || s) && o.length >= e && !this.value || o.length <= s && this.value;
}
return !1;
}
get isDisabled() {
var e, s, o;
return (o = (s = (e = this.group) == null ? void 0 : e.component) == null ? void 0 : s.props.disabled) != null ? o : this.model.disabled || this.isLimitDisabled;
}
get tabIndex() {
return this.isDisabled || this.group && this.value !== this.props.label ? -1 : 0;
}
get size() {
var e, s;
return ((e = this.group) == null ? void 0 : e.component.props.size) || this.props.size || ((s = this.formItemOption) == null ? void 0 : s.form.props.size);
}
handleKeydown(e) {
this.isDisabled || (this.value = !this.value);
}
handleFocus(e) {
this.model.focus = !0;
}
handleBlur(e) {
this.model.focus = !1;
}
handleChange(e) {
var s;
this.group ? (this.value = !this.value, (s = this.group) == null || s.component.handleChange(e)) : this.value = !this.value, this.$trigger("change", this.value), this.triggerValidate();
}
}
let ka = { render: function(t) {
return [t.createElement("label", { class: "@([ 'jk-checkbox', size, isDisabled && 'is-disabled', model.focus && 'is-focus', props.border && 'is-border', value && 'is-checked', props.indeterminate && 'is-indeterminate', props.class ])", role: "checkbox", "aria-checked": "@value", "aria-disabled": "@isDisabled", tabindex: "@tabIndex", "@keydown.space.stop.prevent": "handleKeydown" }, [t.createElement("span", { class: "input @(isDisabled?'is-disabled':'') @(value?'is-checked':'')" }, [t.createElement("span", { class: "target" }, []), t.createElement("input", { ref: "checkbox", type: "checkbox", value: "@(props.label)", checked: "@value", name: "@props.name", disabled: "@isDisabled", tabindex: "-1", autocomplete: "off", "@focus": "handleFocus", "@blur": "handleBlur", "@change": "handleChange" }, [])]), t.createCommand("if", "$sections.default || props.label", [t.createElement("span", { class: "label", "@keydown.stop": "__UNDEFINED_BUFFER__" }, [t.createCommand("if", "$sections.default", [t.createCommand("RenderSection", "")]), t.createCommand("else", "", [t.createCodeFunction("props.label")])])])])];
} }, Oa = {
component: Sa
};
var _s, bs;
let Ye = class extends (bs = Oa.component, _s = window[Symbol.for("JOKER")].SCOPE_ID, bs) {
constructor() {
super(...arguments);
n(this, _s, "c36190e5");
n(this, "template", ka.render);
}
};
class xa extends K {
constructor() {
super(...arguments);
n(this, "propsOption", {
min: Number,
max: Number,
value: []
});
n(this, "name", u("checkbox-group"));
n(this, "model", {
value: []
});
}
created() {
this.$syncProp("value");
}
handleKeydown(e) {
let s = e.event, o = e.event.target, i = this.$getRef("group").output, a = o.tagName === "INPUT" ? "[type=checkbox]" : "[role=checkbox]", l = i.querySelectorAll(a);
if (l && l.length) {
let d = Array.from(l).indexOf(o), p = l.length, c = i.querySelectorAll("[role=checkbox]");
switch (s.key) {
case "ArrowLeft":
case "ArrowUp":
s.stopPropagation(), s.preventDefault(), d === 0 ? c[p - 1].focus() : c[d - 1].focus();
break;
case "ArrowRight":
case "ArrowDown":
s.stopPropagation(), s.preventDefault(), d === l.length - 1 ? c[0].focus() : c[d + 1].focus();
break;
case " ":
case "Enter":
s.stopPropagation(), s.preventDefault(), c[d].click();
}
}
}
checked(e, s) {
if (s)
this.model.value.push(e);
else {
let o = this.model.value.indexOf(e);
this.model.value.splice(o, 1);
}
}
handleChange(e) {
this.$trigger("change", this.model.value, e), this.triggerValidate();
}
}
let Ta = { render: function(t) {
return [t.createElement("div", { class: "jk-checkbox-group", ref: "group", "@keydown": "handleKeydown" }, [t.createCommand("RenderSection", "")])];
} }, Da = {
component: xa
}, $a = class extends Da.component {
constructor() {
super(...arguments);
n(this, "template", Ta.render);
}
};
class Ia extends K {
constructor() {
super(...arguments);
n(this, "model", {
value: void 0,
focus: !1,
disabled: !1
});
}
mounted() {
this.$syncProp("disabled"), this.$watch(
() => this.value === this.props.label,
(e) => {
this.$getRef("checkbox").output.checked = e;
}
), this.$getRef("checkbox").output.checked = !!this.value;
}
get group() {
var e;
return (e = this.$rootVNode) == null ? void 0 : e.closest((s) => {
var o;
return s instanceof window[Symbol.for("JOKER")].VNode.Component && ((o = s.component) == null ? void 0 : o.name) === u("checkbox-group");
});
}
get value() {
return this.group ? this.group.component.model.value.indexOf(this.props.value) > -1 : this.model.value;
}
set value(e) {
this.group ? this.group.component.checked(this.props.value, e) : this.model.value = e, this.$getRef("checkbox").output.checked = !!this.model.value;
}
get isLimitDisabled() {
if (this.group) {
const { max: e, min: s } = this.group.component.props, o = this.group.component.model.value;
return !!(e || s) && o.length >= e && !this.value || o.length <= s && this.value;
}
return !1;
}
get isDisabled() {
var e, s, o;
return (o = (s = (e = this.group) == null ? void 0 : e.component) == null ? void 0 : s.props.disabled) != null ? o : this.model.disabled || this.isLimitDisabled;
}
get tabIndex() {
return this.isDisabled || this.group && this.value !== this.props.label ? -1 : 0;
}
get size() {
var e;
return ((e = this.group) == null ? void 0 : e.component.props.size) || this.sizeClass;
}
handleKeydown(e) {
this.isDisabled || (this.value = !this.value);
}
handleFocus(e) {
this.model.focus = !0;
}
handleBlur(e) {
this.model.focus = !1;
}
handleChange(e) {
var s;
this.group ? (this.value = !this.value, (s = this.group) == null || s.component.handleChange(e)) : this.value = !this.value, this.$trigger("change", this.value), this.triggerValidate();
}
}
let La = { render: function(t) {
return [t.createElement("label", { class: "@(['jk-checkbox-button', size, { 'is-disabled': isDisabled, 'is-focus': model.focus, 'is-checked': value }])", role: "checkbox", "aria-checked": "@value", "aria-disabled": "@isDisabled", tabindex: "@tabIndex", "@keydown.space.stop.prevent": "handleKeydown" }, [t.createElement("input", { ref: "checkbox", type: "checkbox", checked: "@value", name: "@props.name", disabled: "@isDisabled", tabindex: "-1", autocomplete: "off", "@focus": "handleFocus", "@blur": "handleBlur", "@change": "handleChange" }, []), t.createElement("span", { class: "target", "@keydown.stop": "__UNDEFINED_BUFFER__" }, [t.createCommand("RenderSection", ""), t.createCommand("if", "!($sections && $sections.default)", [t.createCodeFunction("props.label")])])])];
} }, Aa = {
component: Ia
};
var vs, ws;
let Na = class extends (ws = Aa.component, vs = window[Symbol.for("JOKER")].SCOPE_ID, ws) {
constructor() {
super(...arguments);
n(this, vs, "1be98116");
n(this, "template", La.render);
}
};
class Pa extends K {
constructor() {
super(...arguments);
n(this, "model", {
hovering: !1,
focused: !1,
isComposing: !1
});
n(this, "propsOption", {
type: "text",
autocomplete: "off",
maxlength: Number,
minlength: Number
});
}
mounted() {
this.setNativeInputValue(), this.$watch(
() => this.model.value,
() => {
this.setNativeInputValue();
}
), this.$watch(
() => this.props.value,
() => {
this.triggerValidate();
}
), this.$watch(
() => this.props.type,
() => {
this.setNativeInputValue();
}
), this.props.autofocus && setTimeout(() => {
var e;
if (this.$root) {
let s = (e = this.$getRef("input")) == null ? void 0 : e.output;
s == null || s.focus();
}
});
}
get isWordLimitVisible() {
return this.props.showWordLimit && this.props.maxlength && this.props.type === "text" && !this.props.disabled && !this.props.readonly;
}
get validateIcon() {
let e = this.formItemOption.ctrl.validateState.value;
return e && {
validating: "jk-icon-loading",
success: "jk-icon-circle-check",
error: "jk-icon-circle-close"
}[e];
}
get textLength() {
return typeof this.value == "number" ? String(this.value).length : (this.value || "").length;
}
get inputExceed() {
return this.isWordLimitVisible && this.textLength > this.props.maxlength;
}
get nativeInputValue() {
return this.value === null || this.value === void 0 ? "" : String(this.value);
}
get showClear() {
return (this.props.forceShowClearable || this.props.clearable && !this.props.disabled && !this.props.readonly) && this.nativeInputValue && (this.model.focused || this.model.hovering);
}
get suffixVisable() {
var e;
return this.$sections.suffix || this.props.suffixIcon || this.showClear || this.isWordLimitVisible || ((e = this.formItemOption) == null ? void 0 : e.ctrl.validateState.value) && this.props.statusIcon;
}
clear() {
this.value = "", this.setNativeInputValue(), this.$trigger("input", this.value), this.$trigger("change", this.value), this.$trigger("clear"), this.$trigger("validate");
}
focus() {
var e;
(e = this.$getRef("input")) == null || e.output.focus();
}
blur() {
var e;
(e = this.$getRef("input")) == null || e.output.blur();
}
select() {
var e;
(e = this.$getRef("input")) == null || e.output.select();
}
//#region 事件
handleHover(e, s) {
this.model.hovering = s;
}
handleFocus(e) {
this.model.focused = !0, this.$trigger("focus", this.value, e);
}
handleBlur(e) {
this.model.focused = !1, this.$trigger("blur", this.value, e), this.triggerValidate();
}
handleChange(e) {
this.$trigger("change", e.event.target.value);
}
handleInput(e) {
this.model.isComposing || e.event.target.value !== this.value && (this.$trigger("input", e.event.target.value, e), this.value = e.event.target.value);
}
handleCompositionStart(e) {
this.$trigger("compositionstart", void 0, e), this.model.isComposing = !0;
}
handleCompositionUpdate(e) {
this.$trigger("compositionupdate", void 0, e);
}
handleCompositionEnd(e) {
this.$trigger("compositionend", void 0, e), this.model.isComposing && (this.model.isComposing = !1, this.handleInput(e));
}
handleKeydown(e) {
this.model.isComposing || this.$trigger("keydown", this.value, e);
}
handleKeyup(e) {
this.$trigger("keyup", this.value, e);
}
handleSuffixClick(e) {
this.$trigger("suffix-click", this.value, e);
}
//#endregion
setNativeInputValue() {
var s;
let e = (s = this.$getRef("input")) == null ? void 0 : s.output;
e && e.value !== this.nativeInputValue && (e.value = this.nativeInputValue);
}
}
let Fa = { render: function(t) {
return [t.createElement("div", { ref: "container", class: "@([ 'jk-input', props.class, sizeClass, { 'is-disabled': props.disabled, 'is-exceed': inputExceed, 'is-error': isError, group: $sections.prepend || $sections.append, 'group-append': $sections.append, 'group-prepend': $sections.prepend, prefix: $sections.prefix || props.prefixIcon, suffix: $sections.suffix || props.suffixIcon || props.clearable } ])", "@mouseenter": "handleHover(true)", "@mouseleave": "handleHover(false)" }, [t.createCommand("if", "$sections.prefix || props.prefixIcon", [t.createElement("span", { class: "prefix" }, [t.createCommand("RenderSection", '"prefix"'), t.createCommand("if", "props.prefixIcon", [t.createElement("i", { class: "@props.prefixIcon" }, [])])])]), t.createCommand("if", "$sections.prepend", [t.createElement("div", { class: "prepend" }, [t.createCommand("RenderSection", '"prepend"')])]), t.createElement("input", { ref: "input", tabindex: "@props.tabindex", disabled: "@props.disabled", readonly: "@props.readonly", autocomplete: "@props.autocomplete", autofocus: "@props.autofocus", "aria-label": "@props.label", placeholder: "@props.placeholder", maxlength: "@props.maxlength", minlength: "@props.minlength", "@input": "handleInput", "@focus": "handleFocus", "@blur": "handleBlur", "@change": "handleChange", "@keydown": "handleKeydown", "@keyup": "handleKeyup", "@compositionstart": "handleCompositionStart", "@compositionupdate": "handleCompositionUpdate", "@compositionend": "handleCompositionEnd", type: "@props.type" }, []), t.createCommand("if", "suffixVisable", [t.createElement("span", { class: "suffix" }, [t.createCommand("if", "!showClear || !isWordLimitVisible", [t.createCommand("RenderSection", '"suffix"'), t.createCommand("if", "props.suffixIcon", [t.createElement("i", { class: "@props.suffixIcon", "@click": "handleSuffixClick" }, [])])]), t.createCommand("if", "showClear", [t.createElement("i", { class: "clear jk-icon-circle-close", "@mousedown.stop": "__UNDEFINED_BUFFER__", "@click.stop": "clear" }, [])]), t.createCommand("elseif", "isWordLimitVisible", [t.createElement("span", { class: "count" }, [t.createElement("span", { class: "inner" }, [t.createCodeFunction("textLength"), t.createText("/"), t.createCodeFunction("props.maxlength")])])]), t.createCommand("elseif", "formItemOption && formItemOption.ctrl.validateState.value", [t.createElement("i", { class: "validate @validateIcon" }, [])])])]), t.createCommand("if", "$sections.append", [t.createElement("div", { class: "append" }, [t.createCommand("RenderSection", '"append"')])])])];
} }, Ma = {
component: Pa
};
var ys, Rs;
let be = class extends (Rs = Ma.component, ys = window[Symbol.for("JOKER")].SCOPE_ID, Rs) {
constructor() {
super(...arguments);
n(this, ys, "116fc5be");
n(this, "template", Fa.render);
}
}, se;
const Ja = `
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`, Ka = [
"letter-spacing",
"line-height",
"padding-top",
"padding-bottom",
"font-family",
"font-weight",
"font-size",
"text-rendering",
"text-transform",
"width",
"text-indent",
"padding-left",
"padding-right",
"border-width",
"box-sizing"
];
function Ha(t) {
const r = window.getComputedStyle(t), e = r.getPropertyValue("box-sizing"), s = parseFloat(r.getPropertyValue("padding-bottom")) + parseFloat(r.getPropertyValue("padding-top")), o = parseFloat(r.getPropertyValue("border-bottom-width")) + parseFloat(r.getPropertyValue("border-top-width"));
return { contextStyle: Ka.map((a) => `${a}:${r.getPropertyValue(a)}`).join(";"), paddingSize: s, borderSize: o, boxSizing: e };
}
function Ut(t, r = 1, e) {
se || (se = document.createElement("textarea"), document.body.appendChild(se));
let { paddingSize: s, borderSize: o, boxSizing: i, contextStyle: a } = Ha(t);
se.setAttribute("style", `${a};${Ja}`), se.value = t.value || t.placeholder || "";
let l = se.scrollHeight;
const d = {
height: "",
minHeight: ""
};
i === "border-box" ? l = l + o : i === "content-box" && (l = l - s), se.value = "";
let p = se.scrollHeight - s;
if (r !== void 0) {
let c = p * r;
i === "border-box" && (c = c + s + o), l = Math.max(c, l), d.minHeight = `${c}px`;
}
if (e !== void 0) {
let c = p * e;
i === "border-box" && (c = c + s + o), l = Math.min(c, l);
}
return d.height = `${l}px`, se.parentNode && se.parentNode.removeChild(se), se = void 0, d;
}
class Va extends K {
constructor() {
super(...arguments);
n(this, "model", {
hovering: !1,
focused: !1,
textareaStyle: {},
isComposing: !1
});
n(this, "propsOption", {
autocomplete: "off",
maxlength: Number,
minlength: Number,
rows: Number
});
}
mounted() {
this.setNativeInputValue(), this.$watch(
() => this.props.value,
() => {
this.setNativeInputValue();
}
), this.$watch(
() => this.value,
() => {
this.resize();
}
), this.resize(), this.props.autofocus && setTimeout(() => {
var e;
if (this.$root) {
let s = (e = this.$getRef("input")) == null ? void 0 : e.output;
s == null || s.focus();
}
});
}
get isWordLimitVisible() {
return this.props.showWordLimit && this.props.maxlength && !this.props.disabled && !this.props.readonly;
}
get textLength() {
return typeof this.value == "number" ? String(this.value).length : (this.value || "").length;
}
get inputExceed() {
return this.isWordLimitVisible && this.textLength > this.props.maxlength;
}
get nativeInputValue() {
return this.value === null || this.value === void 0 ? "" : String(this.value);
}
get style() {
let e = [];
return this.props.resize && e.push(`resize:${this.props.resize}`), this.model.textareaStyle.height && !this.props.rows && e.push(`height:${this.model.textareaStyle.height}`), this.model.textareaStyle["min-height"] && e.push(`min-height:${this.model.textareaStyle["min-height"]}`), e.join(";");
}
clear() {
this.$getRef("input") && (this.value = "", this.$getRef("input").output.value = "");
}
focus() {
var e;
(e = this.$getRef("input")) == null || e.output.focus();
}
blur() {
var e;
(e = this.$getRef("input")) == null || e.output.blur();
}
select() {
var e;
(e = this.$getRef("input")) == null || e.output.select();
}
resize() {
var e, s;
if (this.props.autosize) {
let o = Ut(
(e = this.$getRef("input")) == null ? void 0 : e.output,
this.props.autosize.minRows,
this.props.autosize.maxRows
);
this.model.textareaStyle = {
"min-height": o.minHeight,
height: o.height
};
} else {
let o = Ut((s = this.$getRef("input")) == null ? void 0 : s.output).minHeight;
this.model.textareaStyle = {
height: o,
"min-height": o
};
}
}
//#region 事件
handleHover(e, s) {
this.model.hovering = s;
}
handleFocus(e) {
this.model.focused = !0, this.$trigger("focus", this.value, e);
}
handleBlur(e) {
this.model.focused = !1, this.$trigger("blur", this.value, e), this.triggerValidate();
}
handleChange(e) {
this.$trigger("change", e.event.target.value);
}
handleInput(e) {
this.model.isComposing || e.event.target.value !== this.value && (this.$trigger("input", e.event.target.value, e), this.value = e.event.target.value);
}
handleCompositionStart(e) {
this.$trigger("compositionstart", void 0, e), this.model.isComposing = !0;
}
handleCompositionUpdate(e) {
this.$trigger("compositionupdate", void 0, e);
}
handleCompositionEnd(e) {
this.$trigger("compositionend", void 0, e), this.model.isComposing && (this.model.isComposing = !1, this.handleInput(e));
}
handleKeyDown(e) {
this.model.isComposing || this.$trigger("keydown", this.value, e);
}
//#endregion
setNativeInputValue() {
var s;
let e = (s = this.$getRef("input")) == null ? void 0 : s.output;
e && e.value !== this.nativeInputValue && (e.value = this.nativeInputValue);
}
}
let ja = { render: function(t) {
return [t.createElement("div", { class: "@(['jk-textarea', props.class, { 'is-error': isError, 'is-disabled': props.disabled, 'is-exceed': inputExceed }])", "@mouseenter": "handleHover(true)", "@mouseleave": "handleHover(false)" }, [t.createElement("textarea", { ref: "input", tabindex: "@props.tabindex", disabled: "@props.disabled", readonly: "@props.readonly", autocomplete: "@props.autocomplete", autofocus: "@props.autofocus", "aria-label": "@props.label", placeholder: "@props.placeholder", maxlength: "@props.maxlength", minlength: "@props.minlength", rows: "@props.rows", style: "@style", "@input": "handleInput", "@focus": "handleFocus", "@blur": "handleBlur", "@change": "handleChange", "@keydown": "handleKeyDown", "@compositionstart": "handleCompositionStart", "@compositionupdate": "handleCompositionUpdate", "@compositionend": "handleCompositionEnd" }, [t.createText("")]), t.createCommand("if", "isWordLimitVisible", [t.createElement("span", { class: "count" }, [t.createCodeFunction("textLength"), t.createText("/"), t.createCodeFunction("this.props.maxlength")])])])];
} }, za = {
component: Va
};
var Ss, ks;
let Ba = class extends (ks = za.component, Ss = window[Symbol.for("JOKER")].SCOPE_ID, ks) {
constructor() {
super(...arguments);
n(this, Ss, "bbfcd841");
n(this, "template", ja.render);
}
};
const B = "JOKERUI";
class Ua extends K {
constructor() {
super(...arguments);
n(this, "components", {
JokerInput: be
});
n(this, "propsOption", {
step: {
type: Number,
default: 1
},
max: {
type: Number,
default: 1 / 0
},
min: {
type: Number,
default: -1 / 0
},
precision: Number
});
n(this, "model", {
userInput: null
});
}
mounted() {
this.$watch(
() => this.value,
(e) => {
let s = e === void 0 ? e : Number(e);
if (e !== void 0) {
if (isNaN(e)) return;
if (this.props.stepStrictly) {
let o = this.getPrecision(this.props.step), i = Math.pow(10, o);
s = Math.round(s / this.props.step) * i * this.props.step / i, this.props.precision !== void 0 && (s = this.toPrecision(s, this.props.precision));
}
if (s >= this.props.max && (s = this.props.max), s <= this.props.min && (s = this.props.min), this.value === s) return;
this.value = Number(s), this.value = isNaN(this.value) ? void 0 : this.value, this.model.userInput = null, this.$trigger("input", s);
}
}
), this.value = this.value === void 0 ? void 0 : Number(this.value), this.value = isNaN(this.value) ? void 0 : this.value;
}
get controlsAtRight() {
return !this.props.hiddenControls && this.props.controlsPosition === "right";
}
get minDisabled() {
return this.props.disabled ? !0 : this.decrease(this.value) < this.props.min;
}
get maxDisabled() {
return this.props.disabled ? !0 : this.increase(this.value) > this.props