@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,240 lines (1,239 loc) • 249 kB
JavaScript
var xi = Object.defineProperty;
var Mi = (e, t, n) => t in e ? xi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var Se = (e, t, n) => Mi(e, typeof t != "symbol" ? t + "" : t, n);
import { ref as y, defineComponent as je, computed as te, watch as Ee, createVNode as v, Fragment as pt, reactive as Jt, createApp as Fn, onUnmounted as Bt, onMounted as Ze, Transition as En, mergeProps as dt, nextTick as yt, createTextVNode as He, inject as Fe, withDirectives as Zt, resolveDirective as en, onBeforeMount as xn, provide as Et, triggerRef as Bi, onBeforeUnmount as Mn, isVNode as Di, watchEffect as Ii, Teleport as ki, shallowRef as Pi, render as Kt, h as Vi, cloneVNode as Oi, withModifiers as Ni } from "vue";
import { isUndefined as Qe, cloneDeep as At, mergeWith as Li, merge as Tt, findIndex as vn } from "lodash-es";
import { LocaleService as Je } from "../locale/index.esm.js";
import "bignumber.js";
import { getCustomClass as ft, withInstall as Ri, EVENT_PROPERTY_TAB_IDS as Ai, FormSchemaEntityField$Type as gn, FormSchemaEntityFieldTypeName as hn, useThirdComponent as Bn, isMobilePhone as tn, getMaxZIndex as yn } from "../common/index.esm.js";
import { useResizeObserver as ji } from "@vueuse/core";
import { getHierarchyRow as $i, useIdentify as zi, useGroupData as Ui, useFilter as _i, useHierarchy as Hi, useLoading as qi, useDataView as Wi, useSelection as Gi, useSelectHierarchyItem as Ki, usePagination as Yi, useDataViewContainerStyle as Xi, useCommandColumn as Qi, useSettingColumn as Ji, useColumn as Zi, useSort as ea, useGroupColumn as ta, useRow as na, useEdit as oa, useVisualDataBound as ia, useVisualDataCell as aa, useVisualDataRow as ra, useVisualData as la, useCellPosition as sa, useSidebar as ca, useVirtualScroll as ua, useFitColumn as da, useFilterHistory as fa, useColumnFilter as ma, useDragColumn as pa, getColumnHeader as va, getSidebar as ga, getDisableMask as ha, getHorizontalScrollbar as ya, getVerticalScrollbar as Ca, getEmpty as ba, getPagination as wa, getSummary as Sa, ColumnSettingSolution as Ta, COMMAND_COLUMN_DATA_TYPE as Yt, SETTING_COLUMN_DATA_TYPE as Xt } from "../data-view/index.esm.js";
import Fa from "../input-group/index.esm.js";
import ln from "../button/index.esm.js";
import { resolveAppearance as Dn, createPropsResolver as Dt, schemaResolverMap as Ea, propertyEffectMap as xa, propertyConfigSchemaMap as Ma, schemaMap as Ba, schemaResolverMapForDesigner as In, propertyEffectMapForDesigner as kn, propertyConfigSchemaMapForDesigner as Pn, schemaMapForDesigner as Vn, getSchemaByTypeForDesigner as On } from "../dynamic-resolver/index.esm.js";
import { DgControl as Cn, canvasChanged as Da, refreshCanvas as Ia, useDesignerComponent as ka } from "../designer-canvas/index.esm.js";
import { loadRegister as Pa, useComponentManager as Va, useEntityState as Oa, useDynamicViewUtils as Na, componentMap as Qt, resolverMap as La, componentPropsConverter as Ra } from "../dynamic-view/index.esm.js";
import Aa from "../section/index.esm.js";
import Nn from "../accordion/index.esm.js";
import Ln from "../../designer/avatar/index.esm.js";
import Rn from "../../designer/approval-logs/index.esm.js";
import An from "../../designer/button-edit/index.esm.js";
import jn from "../button-group/index.esm.js";
import $n from "../calendar/index.esm.js";
import zn from "../../designer/capsule/index.esm.js";
import nn from "../../designer/checkbox/index.esm.js";
import Nt from "../../designer/checkbox-group/index.esm.js";
import Un from "../combo-list/index.esm.js";
import ja from "../combo-tree/index.esm.js";
import _n from "../component/index.esm.js";
import Hn from "../color-picker/index.esm.js";
import qn from "../content-container/index.esm.js";
import Wn from "../../designer/date-picker/index.esm.js";
import Gn from "../../designer/data-grid/index.esm.js";
import Kn from "../dropdown/index.esm.js";
import Yn from "../../designer/dynamic-form/index.esm.js";
import $a from "../events-editor/index.esm.js";
import Xn from "../filter-bar/index.esm.js";
import za from "../field-selector/index.esm.js";
import Ua, { FBindingSelectorContainer as _a } from "../binding-selector/index.esm.js";
import Qn from "../image-cropper/index.esm.js";
import Jn from "../../designer/input-group/index.esm.js";
import Zn from "../layout/index.esm.js";
import eo from "../list-nav/index.esm.js";
import to from "../../designer/list-view/index.esm.js";
import no from "../lookup/index.esm.js";
import Ha from "../mapping-editor/index.esm.js";
import oo from "../../designer/nav/index.esm.js";
import io from "../number-range/index.esm.js";
import ao from "../../designer/number-spinner/index.esm.js";
import ro from "../order/index.esm.js";
import lo from "../page-header/index.esm.js";
import so from "../page-footer/index.esm.js";
import co from "../pagination/index.esm.js";
import uo from "../progress/index.esm.js";
import fo from "../query-solution/index.esm.js";
import mo from "../../designer/radio-group/index.esm.js";
import po from "../../designer/rate/index.esm.js";
import vo from "../../designer/response-toolbar/index.esm.js";
import go from "../response-layout/index.esm.js";
import ho from "../../designer/response-layout-editor/index.esm.js";
import yo from "../search-box/index.esm.js";
import Co from "../../designer/section/index.esm.js";
import bo from "../smoke-detector/index.esm.js";
import wo from "../splitter/index.esm.js";
import So from "../step/index.esm.js";
import To from "../../designer/switch/index.esm.js";
import Fo from "../../designer/tabs/index.esm.js";
import Eo from "../../designer/tags/index.esm.js";
import xo from "../text/index.esm.js";
import Mo from "../../designer/time-picker/index.esm.js";
import Bo from "../transfer/index.esm.js";
import Do from "../tree-view/index.esm.js";
import Io from "../uploader/index.esm.js";
import ko from "../verify-detail/index.esm.js";
import Po from "../video/index.esm.js";
import Vo from "../../designer/textarea/index.esm.js";
import qa from "../schema-selector/index.esm.js";
import Oo from "../../designer/tree-grid/index.esm.js";
import Wa from "../event-parameter/index.esm.js";
import Ga from "../filter-condition-editor/index.esm.js";
import No from "../fieldset/index.esm.js";
import Ka from "../sort-condition-editor/index.esm.js";
import Ya from "../menu-lookup/index.esm.js";
import Lo from "../../designer/drawer/index.esm.js";
import Xa from "../json-editor/index.esm.js";
import Qa from "../property-editor/index.esm.js";
import Ja from "../expression-editor/index.esm.js";
import Za from "../code-editor/index.esm.js";
import Ro from "../html-template/index.esm.js";
import er from "../collection-property-editor/index.esm.js";
import tr from "../../designer/modal/index.esm.js";
import Ao from "../external-container/index.esm.js";
import jo from "../language-textbox/index.esm.js";
import $o from "../image/index.esm.js";
import zo from "../comment/index.esm.js";
import Uo from "../../designer/wizard/index.esm.js";
import nr from "../tooltip/index.esm.js";
import "../property-panel/index.esm.js";
import { FNotifyService as or } from "../notify/index.esm.js";
import "../collection-property-editor/index.esm.js/src/use-button-items.designer";
const at = y(0);
function ir() {
at.value++;
}
function ar(e, t) {
const n = t.getBoundingClientRect(), o = e.getBoundingClientRect(), i = o.top >= n.top, a = o.top <= n.bottom;
return i && a;
}
function _o(e) {
const t = e.querySelector(".component-btn-group");
if (!t)
return;
t.style.display = "";
const n = t.getBoundingClientRect();
if (!(n.top === 0 && n.left === 0)) {
const o = t.querySelector("div");
if (o) {
const i = o.getBoundingClientRect();
o.style.top = n.top + "px";
let a = n.left - i.width;
const r = document.querySelector(".editorDiv");
if (r) {
const s = r.getBoundingClientRect();
a < s.left && ({ left: a } = e.getBoundingClientRect());
}
o.style.left = a + "px";
}
}
}
function Ho(e) {
var n, o, i, a, r;
if (!window.scrollContainerList)
return;
const t = Array.from(window.scrollContainerList);
if (t.length)
if (t.length === 1) {
const s = t[0], c = document.querySelector(`[id=${s}]`);
if (c && c.contains(e))
return c;
} else {
const { componentInstance: s } = e;
if (((n = s == null ? void 0 : s.value) == null ? void 0 : n.scrollElementId) === ((o = s == null ? void 0 : s.value.schema) == null ? void 0 : o.id))
return e;
if (((i = s == null ? void 0 : s.value) == null ? void 0 : i.scrollElementId) === `${(a = s == null ? void 0 : s.value.schema) == null ? void 0 : a.id}-design-item`)
return e.parentElement;
if ((r = s.value.parent) != null && r.elementRef)
return Ho(s.value.parent.elementRef);
}
}
function sn(e) {
if (!e)
return;
const t = e.getBoundingClientRect();
if (t.width === 0 && t.height === 0)
return;
const n = e.querySelector(".component-btn-group");
if (n) {
let o = !0;
const i = Ho(e);
if (i && (o = ar(e, i)), !o) {
n.style.display = "none";
return;
}
_o(e);
}
}
function xt(e) {
if (!e)
return;
let t;
e.className.includes("dgComponentSelected") ? t = e : t = e.querySelector(".dgComponentSelected"), t && sn(t);
}
function Tc() {
const e = document.querySelector(".dgComponentSelected");
if (!e)
return;
const t = e.querySelector(".component-btn-group");
t && t.getBoundingClientRect().top !== 0 && _o(e);
}
const rr = {
/**
* 组件值
*/
modelValue: { type: Object, default: {} },
componentId: { type: String, default: "" },
components: { type: Array },
canvasMode: { type: String, default: "PC" }
};
var it = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function lr(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function Pt(e) {
throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var qo = { exports: {} };
(function(e, t) {
(function(n) {
e.exports = n();
})(function() {
return (/* @__PURE__ */ function() {
function n(o, i, a) {
function r(u, p) {
if (!i[u]) {
if (!o[u]) {
var f = typeof Pt == "function" && Pt;
if (!p && f) return f(u, !0);
if (s) return s(u, !0);
var b = new Error("Cannot find module '" + u + "'");
throw b.code = "MODULE_NOT_FOUND", b;
}
var l = i[u] = { exports: {} };
o[u][0].call(l.exports, function(d) {
var T = o[u][1][d];
return r(T || d);
}, l, l.exports, n, o, i, a);
}
return i[u].exports;
}
for (var s = typeof Pt == "function" && Pt, c = 0; c < a.length; c++) r(a[c]);
return r;
}
return n;
}())({
1: [function(n, o, i) {
var a = {}, r = "(?:^|\\s)", s = "(?:\\s|$)";
function c(f) {
var b = a[f];
return b ? b.lastIndex = 0 : a[f] = b = new RegExp(r + f + s, "g"), b;
}
function u(f, b) {
var l = f.className;
l.length ? c(b).test(l) || (f.className += " " + b) : f.className = b;
}
function p(f, b) {
f.className = f.className.replace(c(b), " ").trim();
}
o.exports = {
add: u,
rm: p
};
}, {}],
2: [function(n, o, i) {
(function(a) {
var r = n("contra/emitter"), s = n("crossvent"), c = n("./classes"), u = document, p = u.documentElement;
function f(I, j) {
var E = arguments.length;
E === 1 && Array.isArray(I) === !1 && (j = I, I = []);
var N, $, L, _, V, z, oe, B, A, ie = null, ae, Q, fe = !1, Ce = 0, de, Y = j || {};
Y.moves === void 0 && (Y.moves = h), Y.accepts === void 0 && (Y.accepts = h), Y.invalid === void 0 && (Y.invalid = rt), Y.containers === void 0 && (Y.containers = I || []), Y.isContainer === void 0 && (Y.isContainer = M), Y.copy === void 0 && (Y.copy = !1), Y.copySortSource === void 0 && (Y.copySortSource = !1), Y.revertOnSpill === void 0 && (Y.revertOnSpill = !1), Y.removeOnSpill === void 0 && (Y.removeOnSpill = !1), Y.direction === void 0 && (Y.direction = "vertical"), Y.ignoreInputTextSelection === void 0 && (Y.ignoreInputTextSelection = !0), Y.mirrorContainer === void 0 && (Y.mirrorContainer = u.body);
var F = r({
containers: Y.containers,
start: Oe,
end: vt,
cancel: et,
remove: st,
destroy: De,
canMove: Ve,
dragging: !1
});
return Y.removeOnSpill === !0 && F.on("over", Me).on("out", Ke), le(), F;
function re(P) {
return F.containers.indexOf(P) !== -1 || Y.isContainer(P);
}
function le(P) {
var K = P ? "remove" : "add";
d(p, K, "mousedown", Le), d(p, K, "mouseup", ot);
}
function ue(P) {
var K = P ? "remove" : "add";
d(p, K, "mousemove", xe);
}
function ge(P) {
var K = P ? "remove" : "add";
s[K](p, "selectstart", ke), s[K](p, "click", ke);
}
function De() {
le(!0), ot({});
}
function ke(P) {
ae && P.preventDefault();
}
function Le(P) {
_ = P.clientX, V = P.clientY;
var K = T(P) !== 1 || P.metaKey || P.ctrlKey;
if (!K) {
var X = P.target, se = Pe(X);
se && (ae = se, ue(), P.type === "mousedown" && (C(X) ? X.focus() : P.preventDefault()));
}
}
function xe(P) {
if (ae) {
if (T(P) === 0) {
ot({});
return;
}
if (!(P.clientX !== void 0 && Math.abs(P.clientX - _) <= (Y.slideFactorX || 0) && P.clientY !== void 0 && Math.abs(P.clientY - V) <= (Y.slideFactorY || 0))) {
if (Y.ignoreInputTextSelection) {
var K = x("clientX", P) || 0, X = x("clientY", P) || 0, se = u.elementFromPoint(K, X);
if (C(se))
return;
}
var ye = ae;
ue(!0), ge(), vt(), Re(ye), c.add(B || L, "gu-transit"), gt(), Ct(), Ce = 0, ce(P);
}
}
}
function Pe(P) {
if (!(F.dragging && N) && !re(P)) {
for (var K = P; k(P) && re(k(P)) === !1; )
if (Y.invalid(P, K) || (P = k(P), !P))
return;
var X = k(P);
if (X && !Y.invalid(P, K)) {
var se = Y.moves(P, X, K, m(P));
if (se)
return {
item: P,
source: X
};
}
}
}
function Ve(P) {
return !!Pe(P);
}
function Oe(P) {
var K = Pe(P);
K && Re(K);
}
function Re(P) {
Gt(P.item, P.source) && (B = P.item.cloneNode(!0), F.emit("cloned", B, P.item, "copy")), $ = P.source, L = P.item, z = oe = m(P.item), F.dragging = !0, F.emit("drag", L, $);
}
function rt() {
return !1;
}
function vt() {
if (F.dragging) {
var P = B || L;
lt(P, k(P));
}
}
function Ie() {
ae = !1, ue(!0), ge(!0);
}
function ot(P) {
if (Ie(), !!F.dragging) {
var K = B || L, X = x("clientX", P) || 0, se = x("clientY", P) || 0, ye = D(N, X, se), be = R(ye, X, se);
be && (B && Y.copySortSource || !B || be !== $) ? lt(K, be) : Y.removeOnSpill ? st() : et();
}
}
function lt(P, K) {
var X = k(P);
B && Y.copySortSource && K === $ && X.removeChild(L), ct(K) ? F.emit("cancel", P, $) : F.emit("drop", P, K, $, oe), tt();
}
function st() {
if (F.dragging) {
var P = B || L, K = k(P);
K && K.removeChild(P), F.emit(B ? "cancel" : "remove", P, K, $), tt();
}
}
function et(P) {
if (F.dragging) {
var K = arguments.length > 0 ? P : Y.revertOnSpill, X = B || L, se = k(X), ye = ct(se);
ye === !1 && K && (B ? se && se.removeChild(B) : $.insertBefore(X, z)), ye || K ? F.emit("cancel", X, $, $) : F.emit("drop", X, se, $, oe), tt();
}
}
function tt() {
var P = B || L;
Ie(), $t(), zt(), P && c.rm(P, "gu-transit"), A && clearTimeout(A), F.dragging = !1, ie && F.emit("out", P, ie, $), F.emit("dragend", P, Ce), $ = L = B = z = oe = A = ie = null;
}
function ct(P, K) {
var X;
return K !== void 0 ? X = K : N ? X = oe : X = m(B || L), P === $ && X === z;
}
function R(P, K, X) {
for (var se = P; se && !ye(); )
se = k(se);
return se;
function ye() {
var be = re(se);
if (be === !1)
return !1;
var Ye = It(se, P), ze = kt(se, Ye, K, X), qe = ct(se, ze);
return qe ? !0 : Y.accepts(L, se, $, ze);
}
}
function ce(P) {
if (!N)
return;
P.preventDefault();
var K = x("clientX", P) || 0, X = x("clientY", P) || 0;
N.style.left = K - 2 + "px", N.style.top = X - 2 + "px";
var se = B || L, ye = D(N, K, X), be = R(ye, K, X), Ye = be !== null && be !== ie;
(Ye || be === null) && (_e(), ie = be, We()), Wt(ye, X);
var ze = k(se);
if (be === $ && B && !Y.copySortSource) {
ze && ze.removeChild(se);
return;
}
var qe, Ue = It(be, ye);
if (fe = Ut(Ue, be), Ue !== null)
qe = kt(be, Ue, K, X);
else if (Y.revertOnSpill === !0 && !B)
qe = z, be = $;
else {
B && ze && ze.removeChild(se), B && Q && (Q.style.display = "none");
return;
}
Q.style.display = "block", Te(qe, se, Ye), qe ? Ht(Ue, qe) : qt(be);
function Ae($e) {
F.emit($e, se, ie, $);
}
function We() {
Ye && Ae("over");
}
function _e() {
ie && Ae("out");
}
}
function Te(P, K, X) {
(P === K || P === m(K)) && (oe = m(K)), (P === null && X || P !== K && P !== m(K)) && (oe = P);
}
function Me(P) {
c.rm(P, "gu-hide");
}
function Ke(P) {
F.dragging && c.add(P, "gu-hide");
}
function Ct() {
N || (N = document.createElement("div"), N.style = "background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;", N.innerHTML = Y.getMirrorText && Y.getMirrorText(L) || "控件", c.add(N, "gu-mirror"), Y.mirrorContainer.appendChild(N), d(p, "add", "mousemove", ce), c.add(Y.mirrorContainer, "gu-unselectable"), F.emit("cloned", N, L, "mirror"));
}
function gt() {
if (Q = document.createElement("div"), c.add(Q, "gu-insertion"), L) {
var P = L.getBoundingClientRect();
Q.style.left = P.left + "px", Q.style.top = P.top + "px";
}
fe = !1, Y.mirrorContainer.appendChild(Q);
}
function $t() {
N && (c.rm(Y.mirrorContainer, "gu-unselectable"), d(p, "remove", "mousemove", ce), k(N).removeChild(N), N = null);
}
function zt() {
Q && (k(Q).removeChild(Q), Q = null);
}
function It(P, K) {
for (var X = K; X !== P && k(X) !== P; )
X = k(X);
return X === p ? null : X;
}
function Ut(P, K) {
if (!K)
return fe;
var X = P || K && K.lastElementChild;
if (!X)
return !0;
var se = getComputedStyle(P), ye = /^inline/.test(se.getPropertyValue("display")) || /^(left|right)$/.test(se.getPropertyValue("float"));
if (ye)
return !0;
if (K) {
var be = getComputedStyle(K), Ye = be.getPropertyValue("display");
if (/flex$/.test(Ye)) {
var ze = be.getPropertyValue("flex-direction") || "row";
if (ze === "row" || ze === "row-reverse")
return !_t(K);
}
return !1;
}
return !0;
}
function _t(P) {
if (!P.children || !P.children.length)
return !1;
for (const K of Array.from(P.children)) {
const se = (K.className && K.className.split(" ") || []).filter((ye) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(ye));
if (!se.length)
return !1;
for (const ye of se) {
const be = ye.slice(ye.lastIndexOf("-") + 1);
if (parseInt(be, 10) !== 12)
return !1;
}
}
return !0;
}
function Ht(P, K) {
const X = K.getBoundingClientRect();
if (Q.style.left = X.left + "px", Q.style.top = X.top + "px", fe) {
if (Q.style.height = X.height + "px", Q.style.width = "4px", P) {
const se = P.getBoundingClientRect();
se.top !== X.top && (Q.style.left = se.right + "px", Q.style.top = se.top + "px", Q.style.height = se.height + "px");
}
} else if (Q.style.height = "4px", Q.style.width = X.width + "px", de) {
const se = de.getBoundingClientRect();
X.top < se.top && (Q.style.display = "none");
}
K === L && L && (Q.style.display = "none");
}
function qt(P) {
oe = null;
var K = P.lastElementChild;
if (K) {
var X = K.getBoundingClientRect();
fe ? (Q.style.left = X.right + "px", Q.style.top = X.top + "px", Q.style.height = X.height + "px", Q.style.width = "4px") : (Q.style.left = X.left + "px", Q.style.top = X.bottom + "px", Q.style.height = "4px", Q.style.width = X.width + "px"), K === L && L && (Q.style.display = "none");
} else
Q.style.display = "none";
}
function Wt(P, K) {
if (!Y.mirrorContainer.contains(P) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (de = b(P), !de || !de.contains(P)))
return;
const X = document.querySelector(".dgComponentSelected"), se = de.getBoundingClientRect();
if (K - 30 < se.top && de.scrollTop > 0) {
let ye = de.scrollTop < 10 ? de.scrollTop : 10;
de.scrollBy(0, -1 * ye), X && de.contains(X) && (Ce = Ce + -1 * ye);
}
if (K + 30 > se.bottom && de.scrollTop < de.scrollHeight - de.clientHeight) {
const ye = de.scrollHeight - de.clientHeight - de.scrollTop;
let be = ye < 10 ? ye : 10;
de.scrollBy(0, be), X && de.contains(X) && (Ce = Ce + be);
}
}
function kt(P, K, X, se) {
var ye = Y.direction === "horizontal", be = Y.direction === "mixed", Ye = K !== P ? qe() : ze();
return Ye;
function ze() {
var Ae = P.children.length, We, _e, $e;
for (We = 0; We < Ae; We++)
if (_e = P.children[We], $e = _e.getBoundingClientRect(), ye && $e.left + $e.width / 2 > X || !be && !ye && $e.top + $e.height / 2 > se || be && $e.left + $e.width > X && $e.top + $e.height > se)
return _e;
return null;
}
function qe() {
var Ae = K.getBoundingClientRect();
if (be) {
var We = se - Ae.top, _e = X - Ae.left, $e = Ae.bottom - se, bt = Ae.right - X, wt = Math.min(_e, bt, We, $e), ht;
return fe ? ht = bt < _e : ht = $e === wt || bt === wt || _e === wt, Ue(ht);
}
return Ue(ye ? X > Ae.left + S(Ae) / 2 : se > Ae.top + O(Ae) / 2);
}
function Ue(Ae) {
return Ae ? m(K) : K;
}
}
function Gt(P, K) {
return typeof Y.copy == "boolean" ? Y.copy : Y.copy(P, K);
}
}
function b(I) {
const j = Array.from(window.scrollContainerList);
if (j.length === 1) {
const N = Array.from(window.scrollContainerList)[0];
return document.getElementById(N);
}
const E = l(j);
for (const N of E)
if (N.contains(I))
return N;
return null;
}
function l(I) {
const j = [];
return I.forEach((E) => {
const N = document.getElementById(E);
N && j.push(N);
}), j.sort((E, N) => E.contains(N) ? 1 : N.contains(E) ? -1 : 0), j;
}
function d(I, j, E, N) {
var $ = {
mouseup: "touchend",
mousedown: "touchstart",
mousemove: "touchmove"
}, L = {
mouseup: "pointerup",
mousedown: "pointerdown",
mousemove: "pointermove"
}, _ = {
mouseup: "MSPointerUp",
mousedown: "MSPointerDown",
mousemove: "MSPointerMove"
};
a.navigator.pointerEnabled ? s[j](I, L[E], N) : a.navigator.msPointerEnabled ? s[j](I, _[E], N) : (s[j](I, $[E], N), s[j](I, E, N));
}
function T(I) {
if (I.touches !== void 0)
return I.touches.length;
if (I.which !== void 0 && I.which !== 0)
return I.which;
if (I.buttons !== void 0)
return I.buttons;
var j = I.button;
if (j !== void 0)
return j & 1 ? 1 : j & 2 ? 3 : j & 4 ? 2 : 0;
}
function D(I, j, E) {
I = I || {};
var N = I.className || "", $;
return I.className += " gu-hide", $ = u.elementFromPoint(j, E), I.className = N, $;
}
function M() {
return !1;
}
function h() {
return !0;
}
function S(I) {
return I.width || I.right - I.left;
}
function O(I) {
return I.height || I.bottom - I.top;
}
function k(I) {
return I.parentNode === u ? null : I.parentNode;
}
function C(I) {
return I.tagName === "INPUT" || I.tagName === "TEXTAREA" || I.tagName === "SELECT" || g(I);
}
function g(I) {
return !I || I.contentEditable === "false" ? !1 : I.contentEditable === "true" ? !0 : g(k(I));
}
function m(I) {
return I.nextElementSibling || j();
function j() {
var E = I;
do
E = E.nextSibling;
while (E && E.nodeType !== 1);
return E;
}
}
function w(I) {
return I.targetTouches && I.targetTouches.length ? I.targetTouches[0] : I.changedTouches && I.changedTouches.length ? I.changedTouches[0] : I;
}
function x(I, j) {
var E = w(j), N = {
pageX: "clientX",
// IE8
pageY: "clientY"
// IE8
};
return I in N && !(I in E) && N[I] in E && (I = N[I]), E[I];
}
o.exports = f;
}).call(this, typeof it < "u" ? it : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }],
3: [function(n, o, i) {
o.exports = function(r, s) {
return Array.prototype.slice.call(r, s);
};
}, {}],
4: [function(n, o, i) {
var a = n("ticky");
o.exports = function(s, c, u) {
s && a(function() {
s.apply(u || null, c || []);
});
};
}, { ticky: 10 }],
5: [function(n, o, i) {
var a = n("atoa"), r = n("./debounce");
o.exports = function(c, u) {
var p = u || {}, f = {};
return c === void 0 && (c = {}), c.on = function(b, l) {
return f[b] ? f[b].push(l) : f[b] = [l], c;
}, c.once = function(b, l) {
return l._once = !0, c.on(b, l), c;
}, c.off = function(b, l) {
var d = arguments.length;
if (d === 1)
delete f[b];
else if (d === 0)
f = {};
else {
var T = f[b];
if (!T)
return c;
T.splice(T.indexOf(l), 1);
}
return c;
}, c.emit = function() {
var b = a(arguments);
return c.emitterSnapshot(b.shift()).apply(this, b);
}, c.emitterSnapshot = function(b) {
var l = (f[b] || []).slice(0);
return function() {
var d = a(arguments), T = this || c;
if (b === "error" && p.throws !== !1 && !l.length)
throw d.length === 1 ? d[0] : d;
return l.forEach(function(M) {
p.async ? r(M, d, T) : M.apply(T, d), M._once && c.off(b, M);
}), c;
};
}, c;
};
}, { "./debounce": 4, atoa: 3 }],
6: [function(n, o, i) {
(function(a) {
var r = n("custom-event"), s = n("./eventmap"), c = a.document, u = b, p = d, f = [];
a.addEventListener || (u = l, p = T), o.exports = {
add: u,
remove: p,
fabricate: D
};
function b(k, C, g, m) {
return k.addEventListener(C, g, m);
}
function l(k, C, g) {
return k.attachEvent("on" + C, h(k, C, g));
}
function d(k, C, g, m) {
return k.removeEventListener(C, g, m);
}
function T(k, C, g) {
var m = S(k, C, g);
if (m)
return k.detachEvent("on" + C, m);
}
function D(k, C, g) {
var m = s.indexOf(C) === -1 ? x() : w();
k.dispatchEvent ? k.dispatchEvent(m) : k.fireEvent("on" + C, m);
function w() {
var I;
return c.createEvent ? (I = c.createEvent("Event"), I.initEvent(C, !0, !0)) : c.createEventObject && (I = c.createEventObject()), I;
}
function x() {
return new r(C, { detail: g });
}
}
function M(k, C, g) {
return function(w) {
var x = w || a.event;
x.target = x.target || x.srcElement, x.preventDefault = x.preventDefault || function() {
x.returnValue = !1;
}, x.stopPropagation = x.stopPropagation || function() {
x.cancelBubble = !0;
}, x.which = x.which || x.keyCode, g.call(k, x);
};
}
function h(k, C, g) {
var m = S(k, C, g) || M(k, C, g);
return f.push({
wrapper: m,
element: k,
type: C,
fn: g
}), m;
}
function S(k, C, g) {
var m = O(k, C, g);
if (m) {
var w = f[m].wrapper;
return f.splice(m, 1), w;
}
}
function O(k, C, g) {
var m, w;
for (m = 0; m < f.length; m++)
if (w = f[m], w.element === k && w.type === C && w.fn === g)
return m;
}
}).call(this, typeof it < "u" ? it : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, { "./eventmap": 7, "custom-event": 8 }],
7: [function(n, o, i) {
(function(a) {
var r = [], s = "", c = /^on/;
for (s in a)
c.test(s) && r.push(s.slice(2));
o.exports = r;
}).call(this, typeof it < "u" ? it : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, {}],
8: [function(n, o, i) {
(function(a) {
var r = a.CustomEvent;
function s() {
try {
var c = new r("cat", { detail: { foo: "bar" } });
return c.type === "cat" && c.detail.foo === "bar";
} catch {
}
return !1;
}
o.exports = s() ? r : (
// IE >= 9
typeof document < "u" && typeof document.createEvent == "function" ? function(u, p) {
var f = document.createEvent("CustomEvent");
return p ? f.initCustomEvent(u, p.bubbles, p.cancelable, p.detail) : f.initCustomEvent(u, !1, !1, void 0), f;
} : (
// IE <= 8
function(u, p) {
var f = document.createEventObject();
return f.type = u, p ? (f.bubbles = !!p.bubbles, f.cancelable = !!p.cancelable, f.detail = p.detail) : (f.bubbles = !1, f.cancelable = !1, f.detail = void 0), f;
}
)
);
}).call(this, typeof it < "u" ? it : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, {}],
9: [function(n, o, i) {
var a = o.exports = {}, r, s;
function c() {
throw new Error("setTimeout has not been defined");
}
function u() {
throw new Error("clearTimeout has not been defined");
}
(function() {
try {
typeof setTimeout == "function" ? r = setTimeout : r = c;
} catch {
r = c;
}
try {
typeof clearTimeout == "function" ? s = clearTimeout : s = u;
} catch {
s = u;
}
})();
function p(O) {
if (r === setTimeout)
return setTimeout(O, 0);
if ((r === c || !r) && setTimeout)
return r = setTimeout, setTimeout(O, 0);
try {
return r(O, 0);
} catch {
try {
return r.call(null, O, 0);
} catch {
return r.call(this, O, 0);
}
}
}
function f(O) {
if (s === clearTimeout)
return clearTimeout(O);
if ((s === u || !s) && clearTimeout)
return s = clearTimeout, clearTimeout(O);
try {
return s(O);
} catch {
try {
return s.call(null, O);
} catch {
return s.call(this, O);
}
}
}
var b = [], l = !1, d, T = -1;
function D() {
!l || !d || (l = !1, d.length ? b = d.concat(b) : T = -1, b.length && M());
}
function M() {
if (!l) {
var O = p(D);
l = !0;
for (var k = b.length; k; ) {
for (d = b, b = []; ++T < k; )
d && d[T].run();
T = -1, k = b.length;
}
d = null, l = !1, f(O);
}
}
a.nextTick = function(O) {
var k = new Array(arguments.length - 1);
if (arguments.length > 1)
for (var C = 1; C < arguments.length; C++)
k[C - 1] = arguments[C];
b.push(new h(O, k)), b.length === 1 && !l && p(M);
};
function h(O, k) {
this.fun = O, this.array = k;
}
h.prototype.run = function() {
this.fun.apply(null, this.array);
}, a.title = "browser", a.browser = !0, a.env = {}, a.argv = [], a.version = "", a.versions = {};
function S() {
}
a.on = S, a.addListener = S, a.once = S, a.off = S, a.removeListener = S, a.removeAllListeners = S, a.emit = S, a.prependListener = S, a.prependOnceListener = S, a.listeners = function(O) {
return [];
}, a.binding = function(O) {
throw new Error("process.binding is not supported");
}, a.cwd = function() {
return "/";
}, a.chdir = function(O) {
throw new Error("process.chdir is not supported");
}, a.umask = function() {
return 0;
};
}, {}],
10: [function(n, o, i) {
(function(a) {
var r = typeof a == "function", s;
r ? s = function(c) {
a(c);
} : s = function(c) {
setTimeout(c, 0);
}, o.exports = s;
}).call(this, n("timers").setImmediate);
}, { timers: 11 }],
11: [function(n, o, i) {
(function(a, r) {
var s = n("process/browser.js").nextTick, c = Function.prototype.apply, u = Array.prototype.slice, p = {}, f = 0;
i.setTimeout = function() {
return new b(c.call(setTimeout, window, arguments), clearTimeout);
}, i.setInterval = function() {
return new b(c.call(setInterval, window, arguments), clearInterval);
}, i.clearTimeout = i.clearInterval = function(l) {
l.close();
};
function b(l, d) {
this._id = l, this._clearFn = d;
}
b.prototype.unref = b.prototype.ref = function() {
}, b.prototype.close = function() {
this._clearFn.call(window, this._id);
}, i.enroll = function(l, d) {
clearTimeout(l._idleTimeoutId), l._idleTimeout = d;
}, i.unenroll = function(l) {
clearTimeout(l._idleTimeoutId), l._idleTimeout = -1;
}, i._unrefActive = i.active = function(l) {
clearTimeout(l._idleTimeoutId);
var d = l._idleTimeout;
d >= 0 && (l._idleTimeoutId = setTimeout(function() {
l._onTimeout && l._onTimeout();
}, d));
}, i.setImmediate = typeof a == "function" ? a : function(l) {
var d = f++, T = arguments.length < 2 ? !1 : u.call(arguments, 1);
return p[d] = !0, s(function() {
p[d] && (T ? l.apply(null, T) : l.call(null), i.clearImmediate(d));
}), d;
}, i.clearImmediate = typeof r == "function" ? r : function(l) {
delete p[l];
};
}).call(this, n("timers").setImmediate, n("timers").clearImmediate);
}, { "process/browser.js": 9, timers: 11 }]
}, {}, [2])(2);
});
})(qo);
var sr = qo.exports;
const bn = /* @__PURE__ */ lr(sr), cr = {
showCloseButton: { type: Boolean, default: !0 },
position: { type: String, default: "top-center" },
timeout: { type: Number, default: 3e3 },
theme: { type: String, default: "bootstrap" },
left: { type: Number },
right: { type: Number },
top: { type: Number },
bottom: { type: Number },
id: { type: String },
animate: { type: String, default: "fadeIn" },
options: { type: Object },
safeHtml: { type: Boolean, default: !0 }
}, ur = {
showCloseButton: { type: Boolean, default: !0 },
animate: { type: String, default: "fadeIn" },
options: { type: Object }
}, on = /* @__PURE__ */ je({
name: "Toast",
props: ur,
emits: ["close", "click"],
setup: (e, t) => {
const n = y(e.animate), o = "fadeOut", i = te(() => e.options), a = y(!1), r = te(() => i.value.title && i.value.message), s = te(() => !i.value.title && i.value.message), c = te(() => {
const h = {
animated: a.value,
toast: !0,
"toast--only-content": !r.value
};
return h[e.animate] = !1, h[o] = a.value, h["toasty-type-" + i.value.type] = !0, i.value.theme && (h[i.value.theme] = !0), h;
}), u = te(() => {
const O = `f-icon-${i.value && i.value.type ? i.value.type.replace("toasty-type-", "") : "default"}`, k = {
"f-icon": !0
};
return k[O] = !0, k;
}), p = te(() => i.value.title || i.value.message), f = te(() => e.showCloseButton), b = te(() => !!i.value.buttons || !!t.slots.default), l = te(() => Je.getLocale() === "en" ? {
wordBreak: "keep-all",
overflowWrap: "break-word"
} : {});
function d(h) {
h.stopPropagation(), h.preventDefault(), a.value = !1, setTimeout(() => {
t.emit("close", i.value);
}, 200);
}
function T(h, S) {
}
function D(h) {
return `f-preten-link ${h.customClass ? h.customClass : ""}`;
}
Ee(n, () => {
n.value;
});
const M = () => {
var h;
return v(pt, null, [v("div", {
class: "after-toast-msg text-right"
}, [!t.slots.default && ((h = i.value.buttons) == null ? void 0 : h.map((S) => v("span", {
class: D(S),
onClick: (O) => void 0
}, [S.text]))), t.slots.default && t.slots.default()])]);
};
return () => v("div", {
class: c.value,
style: "min-height:44px"
}, [f.value && v("button", {
title: Je.getLocaleValue("messageBox.close"),
class: "toast-close f-btn-icon f-bare",
onClick: d
}, [v("span", {
class: "f-icon modal_close"
}, null)]), p.value && v("section", {
class: "modal-tips"
}, [!r.value && v("div", {
class: "float-left modal-tips-iconwrap"
}, [v("span", {
class: u.value
}, null)]), v("div", {
class: "modal-tips-content"
}, [r.value && v(pt, null, [v("h5", {
class: "toast-title modal-tips-title",
innerHTML: i.value.title
}, null), v("p", {
class: "toast-msg",
innerHTML: i.value.message,
style: l.value
}, null), b.value && M()]), s.value && (i.value.buttons ? v("div", {
class: "toast-title-btns-wrapper d-flex"
}, [v("h5", {
class: "toast-title modal-tips-title only-toast-msg",
style: l.value,
innerHTML: i.value.message
}, null), v("div", {
class: "after-toast-title text-right ml-auto"
}, [M()])]) : v("h5", {
class: "toast-title modal-tips-title only-toast-msg",
style: l.value,
innerHTML: i.value.message
}, null))])])]);
}
}), dr = ["moz", "ms", "webkit"];
function fr() {
let e = 0;
return (t) => {
const n = (/* @__PURE__ */ new Date()).getTime(), o = Math.max(0, 16 - (n - e)), i = setTimeout(() => {
t(n + o);
}, o);
return e = n + o, i;
};
}
function mr() {
if (typeof window > "u")
return () => 0;
if (window.requestAnimationFrame)
return window.requestAnimationFrame.bind(window);
const e = dr.filter((t) => `${t}RequestAnimationFrame` in window)[0];
return e ? window[`${e}RequestAnimationFrame`] : fr();
}
mr();
y("");
function pr() {
const e = navigator.userAgent || navigator.vendor || window.opera, t = [
/iPhone/i,
/iPod/i,
/Android.*Mobile/i,
// Android 手机通常包含 "Mobile" 字样,而平板不包含
/webOS/i,
/BlackBerry/i,
/IEMobile/i,
/Opera Mini/i,
/Harmony/i
], n = [
/iPad/i,
/Android(?!.*Mobile)/i,
// Android 平板通常不含 "Mobile"
/Tablet/i,
/PlayBook/i,
/Kindle/i,
/Silk/i
];
for (const s of n)
if (s.test(e))
return !1;
for (const s of t)
if (s.test(e))
return !0;
const o = "ontouchstart" in window || navigator.maxTouchPoints > 0, i = screen.width, a = screen.height, r = Math.min(i, a);
return !!(o && r <= 768);
}
const Vt = /* @__PURE__ */ je({
name: "Notify",
props: cr,
emits: ["close", "empty"],
setup(e, t) {
var T;
const n = pr(), i = `farris-notify-${(T = e.options) != null && T.type ? e.options.type : "info"}}`, a = te(() => ({
"farris-notify": !0,
[i]: n
})), r = {
left: 12,
right: 12,
top: 20,
bottom: 12
}, s = y(), c = y(e.options), u = y(e.showCloseButton), p = te(() => e.position || "bottom-right"), f = te(() => e.timeout != null ? e.timeout : 3e3), b = te(() => {
const D = e.bottom ? e.bottom : r.bottom, M = e.top ? e.top : r.top, h = {
transition: "all 0.2s ease",
left: p.value.indexOf("left") > -1 ? `${e.left ? e.left : r.left}px` : "",
right: p.value.indexOf("right") > -1 ? `${e.right ? e.right : r.right}px` : "",
top: p.value.indexOf("top") > -1 ? `${M}px` : "",
bottom: p.value.indexOf("bottom") > -1 ? `${D}px` : ""
};
return p.value.indexOf("center") > -1 && (h.left = "50%", h.marginLeft = "calc(-24rem / 2)", p.value === "center-center" && (h.top = "50%", h.transform = "translate(-50%, -50%)")), h;
});
function l(D) {
t.emit("close");
}
f.value && setTimeout(() => {
l();
}, f.value), t.expose({
closeToast: l,
container: s,
notifyPosition: p
});
function d(D, M) {
l();
}
return () => {
var D;
return n ? v("div", {
class: a.value,
ref: s
}, [(D = e.options) == null ? void 0 : D.message]) : v("div", {
class: a.value,
style: b.value,
ref: s
}, [v(on, {
options: c.value,
showCloseButton: u.value,
animate: e.animate,
onClose: (M) => d(M, c.value)
}, null)]);
};
}
});
class cn {
constructor() {
Se(this, "notifyRefs", []);
Se(this, "globalConfig", Jt({}));
}
escapeAllHtml(t) {
if (typeof t != "string" || !t)
return "";
const n = document.createElement("div");
return n.textContent = t || "", n.innerHTML.replace(/\\n/g, "<br>").replace(/\\t/g, " ").replace(/\\r/g, "");
}
createNotifyInstance(t) {
const n = this, i = Object.assign({
timeout: 3e3,
position: "bottom-right",
showCloseButton: !0,
safeHtml: !0
}, this.globalConfig, {
...t
}), a = document.createElement("div");
a.style.display = "contents";
const r = Fn({
setup() {
var u;
const s = y();
function c() {
s.value.container.style.transform = "scale(0)", setTimeout(() => {
n.updateNotifyPositionForClose(i, s), r.unmount();
}, 220);
}
if (i.position.indexOf("top") > -1) {
const p = n.getNotifyInstances(i.position), f = p[p.length - 1];
if (f) {
const b = f.value.container.getBoundingClientRect();
i.top = b.bottom;
}
}
return i.safeHtml && ((u = i.options) != null && u.message) && (i.options.message = n.escapeAllHtml(i.options.message)), Bt(() => {
document.body.removeChild(a);
}), Ze(() => {
n.updateNotifyPositionForCreate(i, s);
}), () => v(En, {
mode: "out-in",
name: "fade",
appear: !0
}, {
default: () => [v(Vt, dt({
ref: s
}, i, {
onClose: c
}), null)]
});
}
});
return r.provide("NotifyService", this), document.body.appendChild(a), r.use(Je.i18n), r.mount(a), r;
}
getNotifyInstances(t) {
return this.notifyRefs.filter((n) => n.value.notifyPosition === t);
}
updateNotifyPositionForCreate(t, n) {
if (this.notifyRefs && this.notifyRefs.length) {
const o = window.innerHeight;
t.position.indexOf("bottom") > -1 && this.getNotifyInstances(t.position).forEach((i) => {
const a = i.value.container.getBoundingClientRect();
i.value.container.style.bottom = a.height + o - a.bottom + "px";
});
}
this.notifyRefs = [...this.notifyRefs, n];
}
updateNotifyPositionForClose(t, n) {
const o = this.notifyRefs.indexOf(n);
if (t.position.indexOf("top") > -1) {
const i = this.getNotifyInstances(t.position), a = i.indexOf(n);
i.slice(a + 1).forEach((r) => {
r.value.container.style.top = r.value.container.offsetTop - r.value.container.offsetHeight + "px";
});
}
o > -1 && this.notifyRefs.splice(o, 1);
}
show(t) {
return this.createNotifyInstance(t);
}
buildNotifyProps(t, n) {
let o = "", i = "", a, r, s;
typeof n == "string" ? o = n : n && (o = n.message || "", i = n.title || "", r = n.position || null, s = n.showCloseButton != null ? n.showCloseButton : null, a = n.timeout != null ? n.timeout : null);
const u = {
options: {
type: t,
message: o,
title: i
}
};
return r != null && (u.position = r), s != null && (u.showCloseButton = s), a != null && (u.timeout = a), u;
}
info(t) {
const n = this.buildNotifyProps("info", t);
return this.show(n);
}
success(t) {
const n = this.buildNotifyProps("success", t);