@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,217 lines (1,216 loc) • 698 kB
JavaScript
var kr = Object.defineProperty;
var Br = (e, t, n) => t in e ? kr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var Oe = (e, t, n) => Br(e, typeof t != "symbol" ? t + "" : t, n);
import { ref as y, defineComponent as Ie, computed as j, watch as Q, createVNode as p, Fragment as We, reactive as Xe, createApp as _n, onUnmounted as ut, onMounted as Le, Transition as La, mergeProps as wt, nextTick as $e, createTextVNode as Ne, inject as ce, withDirectives as Bt, resolveDirective as xo, onBeforeMount as Fo, vModelText as Io, Teleport as Va, shallowRef as on, render as fo, h as Er, cloneVNode as Dr, provide as Ue, triggerRef as Mr, onBeforeUnmount as Po, isVNode as Qt, withModifiers as Na, toRaw as Or, vModelCheckbox as Ra, resolveComponent as Lr, watchEffect as Vr, vShow as Nr, onUpdated as Rr, Comment as $r } from "vue";
import "bignumber.js";
import { isUndefined as Mt, cloneDeep as ct, isPlainObject as ba, debounce as Un, merge as kn, findIndex as Ca, flatten as Ar, isNaN as jr, throttle as zr, get as Ut, isEmpty as Hr } from "lodash-es";
import { useI18n as vt } from "vue-i18n";
import { LocaleService as Jt } from "../components/locale/index.esm.js";
import { getCustomClass as Ze, withInstall as Wn, FormSchemaEntityField$Type as mo, FormSchemaEntityFieldTypeName as wa, resolveField as En, encrypt as _r, useCommonUtils as $a, getCustomStyle as Sa, useGuid as Ur } from "../components/common/index.esm.js";
import { useResizeObserver as Aa } from "@vueuse/core";
import { getHierarchyRow as Wr, useIdentify as ko, useGroupData as Bo, useFilter as Eo, useHierarchy as Do, useLoading as ja, useDataView as Mo, useSelection as Oo, useSelectHierarchyItem as qr, usePagination as Lo, useDataViewContainerStyle as za, useCommandColumn as Ha, useSettingColumn as _a, useColumn as Vo, useSort as Ua, useGroupColumn as Wa, useRow as No, useEdit as Ro, useVisualDataBound as $o, useVisualDataCell as Ao, useVisualDataRow as jo, useVisualData as zo, useCellPosition as qa, useSidebar as Ho, useVirtualScroll as _o, useFitColumn as Ga, useFilterHistory as Xa, useColumnFilter as Ya, useDragColumn as Ja, getColumnHeader as Qa, getSidebar as Za, getDisableMask as Ka, getHorizontalScrollbar as ei, getVerticalScrollbar as ti, getEmpty as ni, getPagination as Uo, getSummary as oi, useVisualGroupRow as ai, useVisualSummaryRow as ii, CellMode as Gr, useCellContentStyle as Xr, getFilterPanel as Yr, getGroupPanel as Jr, useNavigation as Qr } from "../components/data-view/index.esm.js";
import { getSchemaByTypeForDesigner as li, schemaMapForDesigner as Zr, propertyConfigSchemaMapForDesigner as Kr, propertyEffectMapForDesigner as es, schemaResolverMapForDesigner as ts, createPropsResolver as sn, resolveAppearance as ri } from "../components/dynamic-resolver/index.esm.js";
import { useDesignerComponent as si, useDesignerInnerComponent as ns } from "../components/designer-canvas/index.esm.js";
import { InputBaseProperty as os, ExpressionProperty as Ta } from "../components/property-panel/index.esm.js";
import ci from "../components/accordion/index.esm.js";
import ui from "../components/avatar/index.esm.js";
import Wo from "./button-edit/index.esm.js";
import di from "../components/button-group/index.esm.js";
import fi from "../components/calendar/index.esm.js";
import qo from "../components/capsule/index.esm.js";
import vo from "./checkbox/index.esm.js";
import Rn from "./checkbox-group/index.esm.js";
import pi, { FComboList as mi } from "../components/combo-list/index.esm.js";
import as from "../components/combo-tree/index.esm.js";
import vi from "../components/component/index.esm.js";
import gi from "../components/color-picker/index.esm.js";
import hi from "../components/content-container/index.esm.js";
import yi from "../components/date-picker/index.esm.js";
import bi from "./data-grid/index.esm.js";
import Ci from "../components/dropdown/index.esm.js";
import wi, { FDynamicFormGroup as is } from "../components/dynamic-form/index.esm.js";
import ls from "../components/events-editor/index.esm.js";
import Si from "../components/filter-bar/index.esm.js";
import rs, { FieldSelectorRepositoryToken as Dn } from "../components/field-selector/index.esm.js";
import ss, { FBindingSelectorContainer as cs } from "../components/binding-selector/index.esm.js";
import Ti from "../components/image-cropper/index.esm.js";
import xi from "./input-group/index.esm.js";
import Go, { FLayout as us, FLayoutPane as $n } from "../components/layout/index.esm.js";
import Fi from "../components/list-nav/index.esm.js";
import Ii from "./list-view/index.esm.js";
import Pi from "../components/lookup/index.esm.js";
import ds from "../components/mapping-editor/index.esm.js";
import ki from "../components/nav/index.esm.js";
import Bi from "../components/number-range/index.esm.js";
import Ei from "../components/number-spinner/index.esm.js";
import Di from "../components/order/index.esm.js";
import Mi from "../components/page-header/index.esm.js";
import Oi from "../components/page-footer/index.esm.js";
import Li from "../components/pagination/index.esm.js";
import Vi from "../components/progress/index.esm.js";
import Ni from "../components/query-solution/index.esm.js";
import Ri from "./radio-group/index.esm.js";
import $i from "../components/rate/index.esm.js";
import qn from "../components/response-toolbar/index.esm.js";
import Ai from "../components/response-layout/index.esm.js";
import ji from "../components/response-layout-editor/index.esm.js";
import zi from "../components/search-box/index.esm.js";
import Xo from "../components/section/index.esm.js";
import Hi from "../components/smoke-detector/index.esm.js";
import _i from "../components/splitter/index.esm.js";
import Ui from "../components/step/index.esm.js";
import Wi from "../components/switch/index.esm.js";
import Yo, { FTabPage as fs } from "../components/tabs/index.esm.js";
import Jo from "../components/tags/index.esm.js";
import qi from "../components/text/index.esm.js";
import Gi from "../components/time-picker/index.esm.js";
import Xi from "../components/transfer/index.esm.js";
import hn, { FTreeView as ps } from "../components/tree-view/index.esm.js";
import Yi from "../components/uploader/index.esm.js";
import Ji from "../components/verify-detail/index.esm.js";
import Qi from "../components/video/index.esm.js";
import Qo from "../components/textarea/index.esm.js";
import ms from "../components/schema-selector/index.esm.js";
import Zi from "./tree-grid/index.esm.js";
import vs from "../components/event-parameter/index.esm.js";
import gs from "../components/filter-condition-editor/index.esm.js";
import Ki from "../components/fieldset/index.esm.js";
import hs from "../components/sort-condition-editor/index.esm.js";
import ys from "../components/menu-lookup/index.esm.js";
import el from "./drawer/index.esm.js";
import bs from "../components/json-editor/index.esm.js";
import Cs from "../components/property-editor/index.esm.js";
import ws from "../components/expression-editor/index.esm.js";
import Ss from "../components/code-editor/index.esm.js";
import tl from "../components/html-template/index.esm.js";
import Ts from "../components/collection-property-editor/index.esm.js";
import xs, { F_MODAL_SERVICE_TOKEN as nl } from "../components/modal/index.esm.js";
import ol from "../components/external-container/index.esm.js";
import al from "../components/language-textbox/index.esm.js";
import { FNotifyService as il, F_NOTIFY_SERVICE_TOKEN as Zo } from "../components/notify/index.esm.js";
import ll, { FButtonEdit as rl } from "../components/button-edit/index.esm.js";
import { FDataGrid as Gn } from "../components/data-grid/index.esm.js";
import { FTreeGrid as Xn } from "../components/tree-grid/index.esm.js";
import sl from "../components/popover/index.esm.js";
import Fs from "../components/list-view/index.esm.js";
import Is from "../components/loading/index.esm.js";
import { FCheckbox as Ko } from "../components/checkbox/index.esm.js";
const Ps = ["moz", "ms", "webkit"];
function ks() {
let e = 0;
return (t) => {
const n = (/* @__PURE__ */ new Date()).getTime(), o = Math.max(0, 16 - (n - e)), a = setTimeout(() => {
t(n + o);
}, o);
return e = n + o, a;
};
}
function Bs() {
if (typeof window > "u")
return () => 0;
if (window.requestAnimationFrame)
return window.requestAnimationFrame.bind(window);
const e = Ps.filter((t) => `${t}RequestAnimationFrame` in window)[0];
return e ? window[`${e}RequestAnimationFrame`] : ks();
}
Bs();
const Sy = Symbol("controller schema repository inject token"), Ty = Symbol("form schema repository inject token"), mt = y(0);
function Es() {
mt.value++;
}
function Ds(e, t) {
const n = t.getBoundingClientRect(), o = e.getBoundingClientRect(), a = o.top >= n.top, i = o.top <= n.bottom;
return a && i;
}
function ea(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 a = o.getBoundingClientRect();
o.style.top = n.top + "px";
let i = n.left - a.width;
const l = document.querySelector(".editorDiv");
if (l) {
const r = l.getBoundingClientRect();
i < r.left && ({ left: i } = e.getBoundingClientRect());
}
o.style.left = i + "px";
}
}
}
function Ms(e) {
if (!window.scrollContainerList)
return;
const t = Array.from(window.scrollContainerList);
if (t.length && t.length === 1) {
const n = t[0], o = document.querySelector(`[id=${n}]`);
if (o && o.contains(e))
return o;
}
}
function Yn(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 a = Ms(e);
if (a && (o = Ds(e, a)), !o) {
n.style.display = "none";
return;
}
ea(e);
}
}
function yn(e) {
if (!e)
return;
let t;
e.className.includes("dgComponentSelected") ? t = e : t = e.querySelector(".dgComponentSelected"), t && Yn(t);
}
const Os = {
/**
* 组件值
*/
modelValue: { type: Object, default: {} },
componentId: { type: String, default: "" },
components: { type: Array },
canvasMode: { type: String, default: "PC" }
};
var Ot = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Ls(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function Bn(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 cl = { exports: {} };
(function(e, t) {
(function(n) {
e.exports = n();
})(function() {
return (/* @__PURE__ */ function() {
function n(o, a, i) {
function l(s, d) {
if (!a[s]) {
if (!o[s]) {
var u = typeof Bn == "function" && Bn;
if (!d && u) return u(s, !0);
if (r) return r(s, !0);
var g = new Error("Cannot find module '" + s + "'");
throw g.code = "MODULE_NOT_FOUND", g;
}
var f = a[s] = { exports: {} };
o[s][0].call(f.exports, function(v) {
var m = o[s][1][v];
return l(m || v);
}, f, f.exports, n, o, a, i);
}
return a[s].exports;
}
for (var r = typeof Bn == "function" && Bn, c = 0; c < i.length; c++) l(i[c]);
return l;
}
return n;
}())({
1: [function(n, o, a) {
var i = {}, l = "(?:^|\\s)", r = "(?:\\s|$)";
function c(u) {
var g = i[u];
return g ? g.lastIndex = 0 : i[u] = g = new RegExp(l + u + r, "g"), g;
}
function s(u, g) {
var f = u.className;
f.length ? c(g).test(f) || (u.className += " " + g) : u.className = g;
}
function d(u, g) {
u.className = u.className.replace(c(g), " ").trim();
}
o.exports = {
add: s,
rm: d
};
}, {}],
2: [function(n, o, a) {
(function(i) {
var l = n("contra/emitter"), r = n("crossvent"), c = n("./classes"), s = document, d = s.documentElement;
function u(P, N) {
var R = arguments.length;
R === 1 && Array.isArray(P) === !1 && (N = P, P = []);
var $, A, B, I, M, D, O, V, H, W = null, Y, q, oe = !1, te = 0, J, U = N || {};
U.moves === void 0 && (U.moves = w), U.accepts === void 0 && (U.accepts = w), U.invalid === void 0 && (U.invalid = ye), U.containers === void 0 && (U.containers = P || []), U.isContainer === void 0 && (U.isContainer = b), U.copy === void 0 && (U.copy = !1), U.copySortSource === void 0 && (U.copySortSource = !1), U.revertOnSpill === void 0 && (U.revertOnSpill = !1), U.removeOnSpill === void 0 && (U.removeOnSpill = !1), U.direction === void 0 && (U.direction = "vertical"), U.ignoreInputTextSelection === void 0 && (U.ignoreInputTextSelection = !0), U.mirrorContainer === void 0 && (U.mirrorContainer = s.body);
var X = l({
containers: U.containers,
start: de,
end: ie,
cancel: De,
remove: le,
destroy: ne,
canMove: Ve,
dragging: !1
});
return U.removeOnSpill === !0 && X.on("over", Ee).on("out", ze), _(), X;
function z(Z) {
return X.containers.indexOf(Z) !== -1 || U.isContainer(Z);
}
function _(Z) {
var ue = Z ? "remove" : "add";
v(d, ue, "mousedown", he), v(d, ue, "mouseup", qe);
}
function G(Z) {
var ue = Z ? "remove" : "add";
v(d, ue, "mousemove", xe);
}
function ee(Z) {
var ue = Z ? "remove" : "add";
r[ue](d, "selectstart", re), r[ue](d, "click", re);
}
function ne() {
_(!0), qe({});
}
function re(Z) {
Y && Z.preventDefault();
}
function he(Z) {
I = Z.clientX, M = Z.clientY;
var ue = m(Z) !== 1 || Z.metaKey || Z.ctrlKey;
if (!ue) {
var be = Z.target, ke = se(be);
ke && (Y = ke, G(), Z.type === "mousedown" && (S(be) ? be.focus() : Z.preventDefault()));
}
}
function xe(Z) {
if (Y) {
if (m(Z) === 0) {
qe({});
return;
}
if (!(Z.clientX !== void 0 && Math.abs(Z.clientX - I) <= (U.slideFactorX || 0) && Z.clientY !== void 0 && Math.abs(Z.clientY - M) <= (U.slideFactorY || 0))) {
if (U.ignoreInputTextSelection) {
var ue = L("clientX", Z) || 0, be = L("clientY", Z) || 0, ke = s.elementFromPoint(ue, be);
if (S(ke))
return;
}
var Ae = Y;
G(!0), ee(), ie(), fe(Ae), c.add(V || B, "gu-transit"), Ge(), Pe(), te = 0, Pt(Z);
}
}
}
function se(Z) {
if (!(X.dragging && $) && !z(Z)) {
for (var ue = Z; x(Z) && z(x(Z)) === !1; )
if (U.invalid(Z, ue) || (Z = x(Z), !Z))
return;
var be = x(Z);
if (be && !U.invalid(Z, ue)) {
var ke = U.moves(Z, be, ue, T(Z));
if (ke)
return {
item: Z,
source: be
};
}
}
}
function Ve(Z) {
return !!se(Z);
}
function de(Z) {
var ue = se(Z);
ue && fe(ue);
}
function fe(Z) {
vn(Z.item, Z.source) && (V = Z.item.cloneNode(!0), X.emit("cloned", V, Z.item, "copy")), A = Z.source, B = Z.item, D = O = T(Z.item), X.dragging = !0, X.emit("drag", B, A);
}
function ye() {
return !1;
}
function ie() {
if (X.dragging) {
var Z = V || B;
Ye(Z, x(Z));
}
}
function Be() {
Y = !1, G(!0), ee(!0);
}
function qe(Z) {
if (Be(), !!X.dragging) {
var ue = V || B, be = L("clientX", Z) || 0, ke = L("clientY", Z) || 0, Ae = h($, be, ke), Re = yt(Ae, be, ke);
Re && (V && U.copySortSource || !V || Re !== A) ? Ye(ue, Re) : U.removeOnSpill ? le() : De();
}
}
function Ye(Z, ue) {
var be = x(Z);
V && U.copySortSource && ue === A && be.removeChild(B), Je(ue) ? X.emit("cancel", Z, A) : X.emit("drop", Z, ue, A, O), _e();
}
function le() {
if (X.dragging) {
var Z = V || B, ue = x(Z);
ue && ue.removeChild(Z), X.emit(V ? "cancel" : "remove", Z, ue, A), _e();
}
}
function De(Z) {
if (X.dragging) {
var ue = arguments.length > 0 ? Z : U.revertOnSpill, be = V || B, ke = x(be), Ae = Je(ke);
Ae === !1 && ue && (V ? ke && ke.removeChild(V) : A.insertBefore(be, D)), Ae || ue ? X.emit("cancel", be, A, A) : X.emit("drop", be, ke, A, O), _e();
}
}
function _e() {
var Z = V || B;
Be(), Tt(), Dt(), Z && c.rm(Z, "gu-transit"), H && clearTimeout(H), X.dragging = !1, W && X.emit("out", Z, W, A), X.emit("dragend", Z, te), A = B = V = D = O = H = W = null;
}
function Je(Z, ue) {
var be;
return ue !== void 0 ? be = ue : $ ? be = O : be = T(V || B), Z === A && be === D;
}
function yt(Z, ue, be) {
for (var ke = Z; ke && !Ae(); )
ke = x(ke);
return ke;
function Ae() {
var Re = z(ke);
if (Re === !1)
return !1;
var pt = xt(ke, Z), it = en(ke, pt, ue, be), dt = Je(ke, it);
return dt ? !0 : U.accepts(B, ke, A, it);
}
}
function Pt(Z) {
if (!$)
return;
Z.preventDefault();
var ue = L("clientX", Z) || 0, be = L("clientY", Z) || 0;
$.style.left = ue - 2 + "px", $.style.top = be - 2 + "px";
var ke = V || B, Ae = h($, ue, be), Re = yt(Ae, ue, be), pt = Re !== null && Re !== W;
(pt || Re === null) && (ft(), W = Re, Ct()), mn(Ae, be);
var it = x(ke);
if (Re === A && V && !U.copySortSource) {
it && it.removeChild(ke);
return;
}
var dt, bt = xt(Re, Ae);
if (oe = $t(bt, Re), bt !== null)
dt = en(Re, bt, ue, be);
else if (U.revertOnSpill === !0 && !V)
dt = D, Re = A;
else {
V && it && it.removeChild(ke), V && q && (q.style.display = "none");
return;
}
q.style.display = "block", K(dt, ke, pt), dt ? fn(bt, dt) : pn(Re);
function Ke(nt) {
X.emit(nt, ke, W, A);
}
function Ct() {
pt && Ke("over");
}
function ft() {
W && Ke("out");
}
}
function K(Z, ue, be) {
(Z === ue || Z === T(ue)) && (O = T(ue)), (Z === null && be || Z !== ue && Z !== T(ue)) && (O = Z);
}
function Ee(Z) {
c.rm(Z, "gu-hide");
}
function ze(Z) {
X.dragging && c.add(Z, "gu-hide");
}
function Pe() {
$ || ($ = document.createElement("div"), $.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;", $.innerHTML = U.getMirrorText && U.getMirrorText(B) || "控件", c.add($, "gu-mirror"), U.mirrorContainer.appendChild($), v(d, "add", "mousemove", Pt), c.add(U.mirrorContainer, "gu-unselectable"), X.emit("cloned", $, B, "mirror"));
}
function Ge() {
if (q = document.createElement("div"), c.add(q, "gu-insertion"), B) {
var Z = B.getBoundingClientRect();
q.style.left = Z.left + "px", q.style.top = Z.top + "px";
}
oe = !1, U.mirrorContainer.appendChild(q);
}
function Tt() {
$ && (c.rm(U.mirrorContainer, "gu-unselectable"), v(d, "remove", "mousemove", Pt), x($).removeChild($), $ = null);
}
function Dt() {
q && (x(q).removeChild(q), q = null);
}
function xt(Z, ue) {
for (var be = ue; be !== Z && x(be) !== Z; )
be = x(be);
return be === d ? null : be;
}
function $t(Z, ue) {
if (!ue)
return oe;
var be = Z || ue && ue.lastElementChild;
if (!be)
return !0;
var ke = getComputedStyle(Z), Ae = /^inline/.test(ke.getPropertyValue("display")) || /^(left|right)$/.test(ke.getPropertyValue("float"));
if (Ae)
return !0;
if (ue) {
var Re = getComputedStyle(ue), pt = Re.getPropertyValue("display");
if (/flex$/.test(pt)) {
var it = Re.getPropertyValue("flex-direction") || "row";
if (it === "row" || it === "row-reverse")
return !dn(ue);
}
return !1;
}
return !0;
}
function dn(Z) {
if (!Z.children || !Z.children.length)
return !1;
for (const ue of Array.from(Z.children)) {
const ke = (ue.className && ue.className.split(" ") || []).filter((Ae) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Ae));
if (!ke.length)
return !1;
for (const Ae of ke) {
const Re = Ae.slice(Ae.lastIndexOf("-") + 1);
if (parseInt(Re, 10) !== 12)
return !1;
}
}
return !0;
}
function fn(Z, ue) {
const be = ue.getBoundingClientRect();
if (q.style.left = be.left + "px", q.style.top = be.top + "px", oe) {
if (q.style.height = be.height + "px", q.style.width = "4px", Z) {
const ke = Z.getBoundingClientRect();
ke.top !== be.top && (q.style.left = ke.right + "px", q.style.top = ke.top + "px", q.style.height = ke.height + "px");
}
} else if (q.style.height = "4px", q.style.width = be.width + "px", J) {
const ke = J.getBoundingClientRect();
be.top < ke.top && (q.style.display = "none");
}
ue === B && B && (q.style.display = "none");
}
function pn(Z) {
O = null;
var ue = Z.lastElementChild;
if (ue) {
var be = ue.getBoundingClientRect();
oe ? (q.style.left = be.right + "px", q.style.top = be.top + "px", q.style.height = be.height + "px", q.style.width = "4px") : (q.style.left = be.left + "px", q.style.top = be.bottom + "px", q.style.height = "4px", q.style.width = be.width + "px"), ue === B && B && (q.style.display = "none");
} else
q.style.display = "none";
}
function mn(Z, ue) {
if (!U.mirrorContainer.contains(Z) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (J = g(Z), !J || !J.contains(Z)))
return;
const be = document.querySelector(".dgComponentSelected"), ke = J.getBoundingClientRect();
if (ue - 30 < ke.top && J.scrollTop > 0) {
let Ae = J.scrollTop < 10 ? J.scrollTop : 10;
J.scrollBy(0, -1 * Ae), be && J.contains(be) && (te = te + -1 * Ae);
}
if (ue + 30 > ke.bottom && J.scrollTop < J.scrollHeight - J.clientHeight) {
const Ae = J.scrollHeight - J.clientHeight - J.scrollTop;
let Re = Ae < 10 ? Ae : 10;
J.scrollBy(0, Re), be && J.contains(be) && (te = te + Re);
}
}
function en(Z, ue, be, ke) {
var Ae = U.direction === "horizontal", Re = U.direction === "mixed", pt = ue !== Z ? dt() : it();
return pt;
function it() {
var Ke = Z.children.length, Ct, ft, nt;
for (Ct = 0; Ct < Ke; Ct++)
if (ft = Z.children[Ct], nt = ft.getBoundingClientRect(), Ae && nt.left + nt.width / 2 > be || !Re && !Ae && nt.top + nt.height / 2 > ke || Re && nt.left + nt.width > be && nt.top + nt.height > ke)
return ft;
return null;
}
function dt() {
var Ke = ue.getBoundingClientRect();
if (Re) {
var Ct = ke - Ke.top, ft = be - Ke.left, nt = Ke.bottom - ke, At = Ke.right - be, jt = Math.min(ft, At, Ct, nt), zt;
return oe ? zt = At < ft : zt = nt === jt || At === jt || ft === jt, bt(zt);
}
return bt(Ae ? be > Ke.left + E(Ke) / 2 : ke > Ke.top + C(Ke) / 2);
}
function bt(Ke) {
return Ke ? T(ue) : ue;
}
}
function vn(Z, ue) {
return typeof U.copy == "boolean" ? U.copy : U.copy(Z, ue);
}
}
function g(P) {
const N = Array.from(window.scrollContainerList);
if (N.length === 1) {
const $ = Array.from(window.scrollContainerList)[0];
return document.getElementById($);
}
const R = f(N);
for (const $ of R)
if ($.contains(P))
return $;
return null;
}
function f(P) {
const N = [];
return P.forEach((R) => {
const $ = document.getElementById(R);
$ && N.push($);
}), N.sort((R, $) => R.contains($) ? 1 : $.contains(R) ? -1 : 0), N;
}
function v(P, N, R, $) {
var A = {
mouseup: "touchend",
mousedown: "touchstart",
mousemove: "touchmove"
}, B = {
mouseup: "pointerup",
mousedown: "pointerdown",
mousemove: "pointermove"
}, I = {
mouseup: "MSPointerUp",
mousedown: "MSPointerDown",
mousemove: "MSPointerMove"
};
i.navigator.pointerEnabled ? r[N](P, B[R], $) : i.navigator.msPointerEnabled ? r[N](P, I[R], $) : (r[N](P, A[R], $), r[N](P, R, $));
}
function m(P) {
if (P.touches !== void 0)
return P.touches.length;
if (P.which !== void 0 && P.which !== 0)
return P.which;
if (P.buttons !== void 0)
return P.buttons;
var N = P.button;
if (N !== void 0)
return N & 1 ? 1 : N & 2 ? 3 : N & 4 ? 2 : 0;
}
function h(P, N, R) {
P = P || {};
var $ = P.className || "", A;
return P.className += " gu-hide", A = s.elementFromPoint(N, R), P.className = $, A;
}
function b() {
return !1;
}
function w() {
return !0;
}
function E(P) {
return P.width || P.right - P.left;
}
function C(P) {
return P.height || P.bottom - P.top;
}
function x(P) {
return P.parentNode === s ? null : P.parentNode;
}
function S(P) {
return P.tagName === "INPUT" || P.tagName === "TEXTAREA" || P.tagName === "SELECT" || F(P);
}
function F(P) {
return !P || P.contentEditable === "false" ? !1 : P.contentEditable === "true" ? !0 : F(x(P));
}
function T(P) {
return P.nextElementSibling || N();
function N() {
var R = P;
do
R = R.nextSibling;
while (R && R.nodeType !== 1);
return R;
}
}
function k(P) {
return P.targetTouches && P.targetTouches.length ? P.targetTouches[0] : P.changedTouches && P.changedTouches.length ? P.changedTouches[0] : P;
}
function L(P, N) {
var R = k(N), $ = {
pageX: "clientX",
// IE8
pageY: "clientY"
// IE8
};
return P in $ && !(P in R) && $[P] in R && (P = $[P]), R[P];
}
o.exports = u;
}).call(this, typeof Ot < "u" ? Ot : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }],
3: [function(n, o, a) {
o.exports = function(l, r) {
return Array.prototype.slice.call(l, r);
};
}, {}],
4: [function(n, o, a) {
var i = n("ticky");
o.exports = function(r, c, s) {
r && i(function() {
r.apply(s || null, c || []);
});
};
}, { ticky: 10 }],
5: [function(n, o, a) {
var i = n("atoa"), l = n("./debounce");
o.exports = function(c, s) {
var d = s || {}, u = {};
return c === void 0 && (c = {}), c.on = function(g, f) {
return u[g] ? u[g].push(f) : u[g] = [f], c;
}, c.once = function(g, f) {
return f._once = !0, c.on(g, f), c;
}, c.off = function(g, f) {
var v = arguments.length;
if (v === 1)
delete u[g];
else if (v === 0)
u = {};
else {
var m = u[g];
if (!m)
return c;
m.splice(m.indexOf(f), 1);
}
return c;
}, c.emit = function() {
var g = i(arguments);
return c.emitterSnapshot(g.shift()).apply(this, g);
}, c.emitterSnapshot = function(g) {
var f = (u[g] || []).slice(0);
return function() {
var v = i(arguments), m = this || c;
if (g === "error" && d.throws !== !1 && !f.length)
throw v.length === 1 ? v[0] : v;
return f.forEach(function(b) {
d.async ? l(b, v, m) : b.apply(m, v), b._once && c.off(g, b);
}), c;
};
}, c;
};
}, { "./debounce": 4, atoa: 3 }],
6: [function(n, o, a) {
(function(i) {
var l = n("custom-event"), r = n("./eventmap"), c = i.document, s = g, d = v, u = [];
i.addEventListener || (s = f, d = m), o.exports = {
add: s,
remove: d,
fabricate: h
};
function g(x, S, F, T) {
return x.addEventListener(S, F, T);
}
function f(x, S, F) {
return x.attachEvent("on" + S, w(x, S, F));
}
function v(x, S, F, T) {
return x.removeEventListener(S, F, T);
}
function m(x, S, F) {
var T = E(x, S, F);
if (T)
return x.detachEvent("on" + S, T);
}
function h(x, S, F) {
var T = r.indexOf(S) === -1 ? L() : k();
x.dispatchEvent ? x.dispatchEvent(T) : x.fireEvent("on" + S, T);
function k() {
var P;
return c.createEvent ? (P = c.createEvent("Event"), P.initEvent(S, !0, !0)) : c.createEventObject && (P = c.createEventObject()), P;
}
function L() {
return new l(S, { detail: F });
}
}
function b(x, S, F) {
return function(k) {
var L = k || i.event;
L.target = L.target || L.srcElement, L.preventDefault = L.preventDefault || function() {
L.returnValue = !1;
}, L.stopPropagation = L.stopPropagation || function() {
L.cancelBubble = !0;
}, L.which = L.which || L.keyCode, F.call(x, L);
};
}
function w(x, S, F) {
var T = E(x, S, F) || b(x, S, F);
return u.push({
wrapper: T,
element: x,
type: S,
fn: F
}), T;
}
function E(x, S, F) {
var T = C(x, S, F);
if (T) {
var k = u[T].wrapper;
return u.splice(T, 1), k;
}
}
function C(x, S, F) {
var T, k;
for (T = 0; T < u.length; T++)
if (k = u[T], k.element === x && k.type === S && k.fn === F)
return T;
}
}).call(this, typeof Ot < "u" ? Ot : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, { "./eventmap": 7, "custom-event": 8 }],
7: [function(n, o, a) {
(function(i) {
var l = [], r = "", c = /^on/;
for (r in i)
c.test(r) && l.push(r.slice(2));
o.exports = l;
}).call(this, typeof Ot < "u" ? Ot : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, {}],
8: [function(n, o, a) {
(function(i) {
var l = i.CustomEvent;
function r() {
try {
var c = new l("cat", { detail: { foo: "bar" } });
return c.type === "cat" && c.detail.foo === "bar";
} catch {
}
return !1;
}
o.exports = r() ? l : (
// IE >= 9
typeof document < "u" && typeof document.createEvent == "function" ? function(s, d) {
var u = document.createEvent("CustomEvent");
return d ? u.initCustomEvent(s, d.bubbles, d.cancelable, d.detail) : u.initCustomEvent(s, !1, !1, void 0), u;
} : (
// IE <= 8
function(s, d) {
var u = document.createEventObject();
return u.type = s, d ? (u.bubbles = !!d.bubbles, u.cancelable = !!d.cancelable, u.detail = d.detail) : (u.bubbles = !1, u.cancelable = !1, u.detail = void 0), u;
}
)
);
}).call(this, typeof Ot < "u" ? Ot : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, {}],
9: [function(n, o, a) {
var i = o.exports = {}, l, r;
function c() {
throw new Error("setTimeout has not been defined");
}
function s() {
throw new Error("clearTimeout has not been defined");
}
(function() {
try {
typeof setTimeout == "function" ? l = setTimeout : l = c;
} catch {
l = c;
}
try {
typeof clearTimeout == "function" ? r = clearTimeout : r = s;
} catch {
r = s;
}
})();
function d(C) {
if (l === setTimeout)
return setTimeout(C, 0);
if ((l === c || !l) && setTimeout)
return l = setTimeout, setTimeout(C, 0);
try {
return l(C, 0);
} catch {
try {
return l.call(null, C, 0);
} catch {
return l.call(this, C, 0);
}
}
}
function u(C) {
if (r === clearTimeout)
return clearTimeout(C);
if ((r === s || !r) && clearTimeout)
return r = clearTimeout, clearTimeout(C);
try {
return r(C);
} catch {
try {
return r.call(null, C);
} catch {
return r.call(this, C);
}
}
}
var g = [], f = !1, v, m = -1;
function h() {
!f || !v || (f = !1, v.length ? g = v.concat(g) : m = -1, g.length && b());
}
function b() {
if (!f) {
var C = d(h);
f = !0;
for (var x = g.length; x; ) {
for (v = g, g = []; ++m < x; )
v && v[m].run();
m = -1, x = g.length;
}
v = null, f = !1, u(C);
}
}
i.nextTick = function(C) {
var x = new Array(arguments.length - 1);
if (arguments.length > 1)
for (var S = 1; S < arguments.length; S++)
x[S - 1] = arguments[S];
g.push(new w(C, x)), g.length === 1 && !f && d(b);
};
function w(C, x) {
this.fun = C, this.array = x;
}
w.prototype.run = function() {
this.fun.apply(null, this.array);
}, i.title = "browser", i.browser = !0, i.env = {}, i.argv = [], i.version = "", i.versions = {};
function E() {
}
i.on = E, i.addListener = E, i.once = E, i.off = E, i.removeListener = E, i.removeAllListeners = E, i.emit = E, i.prependListener = E, i.prependOnceListener = E, i.listeners = function(C) {
return [];
}, i.binding = function(C) {
throw new Error("process.binding is not supported");
}, i.cwd = function() {
return "/";
}, i.chdir = function(C) {
throw new Error("process.chdir is not supported");
}, i.umask = function() {
return 0;
};
}, {}],
10: [function(n, o, a) {
(function(i) {
var l = typeof i == "function", r;
l ? r = function(c) {
i(c);
} : r = function(c) {
setTimeout(c, 0);
}, o.exports = r;
}).call(this, n("timers").setImmediate);
}, { timers: 11 }],
11: [function(n, o, a) {
(function(i, l) {
var r = n("process/browser.js").nextTick, c = Function.prototype.apply, s = Array.prototype.slice, d = {}, u = 0;
a.setTimeout = function() {
return new g(c.call(setTimeout, window, arguments), clearTimeout);
}, a.setInterval = function() {
return new g(c.call(setInterval, window, arguments), clearInterval);
}, a.clearTimeout = a.clearInterval = function(f) {
f.close();
};
function g(f, v) {
this._id = f, this._clearFn = v;
}
g.prototype.unref = g.prototype.ref = function() {
}, g.prototype.close = function() {
this._clearFn.call(window, this._id);
}, a.enroll = function(f, v) {
clearTimeout(f._idleTimeoutId), f._idleTimeout = v;
}, a.unenroll = function(f) {
clearTimeout(f._idleTimeoutId), f._idleTimeout = -1;
}, a._unrefActive = a.active = function(f) {
clearTimeout(f._idleTimeoutId);
var v = f._idleTimeout;
v >= 0 && (f._idleTimeoutId = setTimeout(function() {
f._onTimeout && f._onTimeout();
}, v));
}, a.setImmediate = typeof i == "function" ? i : function(f) {
var v = u++, m = arguments.length < 2 ? !1 : s.call(arguments, 1);
return d[v] = !0, r(function() {
d[v] && (m ? f.apply(null, m) : f.call(null), a.clearImmediate(v));
}), v;
}, a.clearImmediate = typeof l == "function" ? l : function(f) {
delete d[f];
};
}).call(this, n("timers").setImmediate, n("timers").clearImmediate);
}, { "process/browser.js": 9, timers: 11 }]
}, {}, [2])(2);
});
})(cl);
var Vs = cl.exports;
const ln = /* @__PURE__ */ Ls(Vs), Ns = {
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 }
}, Rs = {
showCloseButton: { type: Boolean, default: !0 },
animate: { type: String, default: "fadeIn" },
options: { type: Object }
}, go = /* @__PURE__ */ Ie({
name: "Toast",
props: Rs,
emits: ["close", "click"],
setup: (e, t) => {
const {
locale: n,
t: o
} = vt(), a = y(e.animate), i = "fadeOut", l = j(() => e.options), r = y(!1), c = j(() => l.value.title && l.value.message), s = j(() => !l.value.title && l.value.message), d = j(() => {
const C = {
animated: r.value,
toast: !0,
"toast--only-content": s.value
};
return C[e.animate] = !1, C[i] = r.value, C["toasty-type-" + l.value.type] = !0, l.value.theme && (C[l.value.theme] = !0), C;
}), u = j(() => {
const S = `f-icon-${l.value && l.value.type ? l.value.type.replace("toasty-type-", "") : "default"}`, F = {
"f-icon": !0
};
return F[S] = !0, F;
}), g = j(() => l.value.title || l.value.message), f = j(() => e.showCloseButton), v = j(() => !!l.value.buttons || !!t.slots.default), m = j(() => n.value === "en" ? {
wordBreak: "keep-all",
overflowWrap: "break-word"
} : {});
function h(C) {
C.stopPropagation(), C.preventDefault(), r.value = !1, setTimeout(() => {
t.emit("close", l.value);
}, 200);
}
function b(C, x) {
}
function w(C) {
return `f-preten-link ${C.customClass ? C.customClass : ""}`;
}
Q(a, () => {
a.value;
});
const E = () => {
var C;
return p(We, null, [p("div", {
class: "after-toast-msg text-right"
}, [!t.slots.default && ((C = l.value.buttons) == null ? void 0 : C.map((x) => p("span", {
class: w(x),
onClick: (S) => void 0
}, [x.text]))), t.slots.default && t.slots.default()])]);
};
return () => p("div", {
class: d.value,
style: "min-height:44px"
}, [f.value && p("button", {
title: o("messageBox.close"),
class: "toast-close f-btn-icon f-bare",
onClick: h
}, [p("span", {
class: "f-icon modal_close"
}, null)]), g.value && p("section", {
class: "modal-tips"
}, [p("div", {
class: "float-left modal-tips-iconwrap"
}, [p("span", {
class: u.value
}, null)]), p("div", {
class: "modal-tips-content"
}, [c.value && p(We, null, [p("h5", {
class: "toast-title modal-tips-title",
innerHTML: l.value.title
}, null), p("p", {
class: "toast-msg",
innerHTML: l.value.message,
style: m.value
}, null), v.value && E()]), s.value && (l.value.buttons ? p("div", {
class: "toast-title-btns-wrapper d-flex"
}, [p("h5", {
class: "toast-title modal-tips-title only-toast-msg",
style: m.value,
innerHTML: l.value.message
}, null), p("div", {
class: "after-toast-title text-right ml-auto"
}, [E()])]) : p("h5", {
class: "toast-title modal-tips-title only-toast-msg",
style: m.value,
innerHTML: l.value.message
}, null))])])]);
}
}), Mn = /* @__PURE__ */ Ie({
name: "Notify",
props: Ns,
emits: ["close", "empty"],
setup(e, t) {
const n = j(() => ({
"farris-notify": !0
})), o = {
left: 12,
right: 12,
top: 20,
bottom: 12
}, a = y(), i = y(e.options), l = y(e.showCloseButton), r = j(() => e.position || "bottom-right"), c = j(() => e.timeout != null ? e.timeout : 3e3), s = j(() => {
const g = e.bottom ? e.bottom : o.bottom, f = e.top ? e.top : o.top, v = {
transition: "all 0.2s ease",
left: r.value.indexOf("left") > -1 ? `${e.left ? e.left : o.left}px` : "",
right: r.value.indexOf("right") > -1 ? `${e.right ? e.right : o.right}px` : "",
top: r.value.indexOf("top") > -1 ? `${f}px` : "",
bottom: r.value.indexOf("bottom") > -1 ? `${g}px` : ""
};
return r.value.indexOf("center") > -1 && (v.left = "50%", v.marginLeft = "calc(-24rem / 2)", r.value === "center-center" && (v.top = "50%", v.transform = "translate(-50%, -50%)")), v;
});
function d(g) {
t.emit("close");
}
c.value && setTimeout(() => {
d();
}, c.value), t.expose({
closeToast: d,
container: a,
notifyPosition: r
});
function u(g, f) {
d();
}
return () => p("div", {
class: n.value,
style: s.value,
ref: a
}, [p(go, {
options: i.value,
showCloseButton: l.value,
animate: e.animate,
onClose: (g) => u(g, i.value)
}, null)]);
}
});
class Jn {
constructor() {
Oe(this, "notifyRefs", []);
Oe(this, "globalConfig", Xe({}));
}
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, a = Object.assign({
timeout: 3e3,
position: "bottom-right",
showCloseButton: !0,
safeHtml: !0
}, this.globalConfig, {
...t
}), i = document.createElement("div");
i.style.display = "contents";
const l = _n({
setup() {
var s;
const r = y();
function c() {
r.value.container.style.transform = "scale(0)", setTimeout(() => {
n.updateNotifyPositionForClose(a, r), l.unmount();
}, 220);
}
if (a.position.indexOf("top") > -1) {
const d = n.getNotifyInstances(a.position), u = d[d.length - 1];
if (u) {
const g = u.value.container.getBoundingClientRect();
a.top = g.bottom;
}
}
return a.safeHtml && ((s = a.options) != null && s.message) && (a.options.message = n.escapeAllHtml(a.options.message)), ut(() => {
document.body.removeChild(i);
}), Le(() => {
n.updateNotifyPositionForCreate(a, r);
}), () => p(La, {
mode: "out-in",
name: "fade",
appear: !0
}, {
default: () => [p(Mn, wt({
ref: r
}, a, {
onClose: c
}), null)]
});
}
});
return l.provide("NotifyService", this), document.body.appendChild(i), l.use(Jt.i18n), l.mount(i), l;
}
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((a) => {
const i = a.value.container.getBoundingClientRect();
a.value.container.style.bottom = i.height + o - i.bottom + "px";
});
}
this.notifyRefs = [...this.notifyRefs, n];
}
updateNotifyPositionForClose(t, n) {
const o = this.notifyRefs.indexOf(n);
if (t.position.indexOf("top") > -1) {
const a = this.getNotifyInstances(t.position), i = a.indexOf(n);
a.slice(i + 1).forEach((l) => {
l.value.container.style.top = l.value.container.offsetTop - l.value.container.offsetHeight + "px";
});
}
o > -1 && this.notifyRefs.splice(o, 1);
}
show(t) {
return this.createNotifyInstance(t);
}
buildNotifyProps(t, n) {
let o = "", a = "", i, l, r;
typeof n == "string" ? o = n : n && (o = n.message || "", a = n.title || "", l = n.position || null, r = n.showCloseButton != null ? n.showCloseButton : null, i = n.timeout != null ? n.timeout : null);
const s = {
options: {
type: t,
message: o,
title: a
}
};
return l != null && (s.position = l), r != null && (s.showCloseButton = r), i != null && (s.timeout = i), s;
}
info(t) {
const n = this.buildNotifyProps("info", t);
return this.show(n);
}
success(t) {
const n = this.buildNotifyProps("success", t);
return this.show(n);
}
warning(t) {
const n = this.buildNotifyProps("warning", t);
return this.show(n);
}
error(t) {
const n = this.buildNotifyProps("error", t);
return this.show(n);
}
close(t) {
t && t.unmount();
}
closeAll() {
this.notifyRefs.forEach((t) => {
t == null || t.value.closeToast();
}), this.notifyRefs.length = 0;
}
}
const ta = Symbol("NOTIFY_SERVICE_TOKEN");
Mn.install = (e) => {
e.component(Mn.name, Mn), e.component(go.name, go);
const t = new Jn();
e.provide(ta, t), e.provide("FNotifyService", t);
};
const $s = {
designerHostService: { type: Object, default: {} },
/** 预设的控件类型 */
componentType: { type: String, default: "" },
/** 预设绑定的实体id */
bindingEntityId: { type: String, default: "" },