@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,284 lines • 323 kB
JavaScript
var tr = Object.defineProperty;
var nr = (t, e, n) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
var ne = (t, e, n) => nr(t, typeof e != "symbol" ? e + "" : e, n);
import { ref as x, defineComponent as Ge, computed as L, watch as Te, createVNode as I, Fragment as Ct, reactive as ft, createApp as mn, onUnmounted as Et, onMounted as gt, Transition as vn, mergeProps as bt, createTextVNode as Le, onBeforeUnmount as hn, withDirectives as or, resolveDirective as rr, onBeforeMount as gn, Teleport as ir, shallowRef as ar, nextTick as Qt, render as zt, h as lr, cloneVNode as sr, inject as $e, provide as Mt, triggerRef as ur, isVNode as cr } from "vue";
import { isPlainObject as on, cloneDeep as ut, isUndefined as rn, merge as Ot, findIndex as an } from "lodash-es";
import { useResizeObserver as yn } from "@vueuse/core";
import { useIdentify as dr, useGroupData as fr, useFilter as pr, useHierarchy as mr, useLoading as vr, useDataView as hr, useSelection as gr, useSelectHierarchyItem as yr, useDataViewContainerStyle as br, useCommandColumn as Cr, useColumn as wr, useSort as Sr, useGroupColumn as _r, useRow as Tr, useEdit as xr, useVisualDataBound as Fr, useVisualDataCell as kr, useVisualDataRow as Er, useVisualData as Ir, useCellPosition as Or, useSidebar as Dr, useVirtualScroll as Mr, useFitColumn as Br, useFilterHistory as Vr, useColumnFilter as Nr, useDragColumn as Rr, getColumnHeader as jr, getSidebar as Pr, getDisableMask as $r, getHorizontalScrollbar as Lr, getVerticalScrollbar as Wr, getEmpty as Hr } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import bn from "../transfer/index.esm.js";
import Cn from "../tabs/index.esm.js";
import wn from "../order/index.esm.js";
import "../condition/index.esm.js";
import Sn, { FCheckbox as Ar } from "../checkbox/index.esm.js";
import _n from "../filter-bar/index.esm.js";
import ln from "../tooltip/index.esm.js";
import Tn from "../pagination/index.esm.js";
import zr from "../button/index.esm.js";
import xn from "../search-box/index.esm.js";
import Fn from "../tags/index.esm.js";
import kn, { FDynamicFormGroup as Gr, FDynamicFormInput as qr } from "../dynamic-form/index.esm.js";
import "../designer-canvas/index.esm.js";
import Ur, { FBindingSelectorContainer as Yr } from "../binding-selector/index.esm.js";
import { FNotifyService as Xr } from "../notify/index.esm.js";
import En from "../accordion/index.esm.js";
import In from "../avatar/index.esm.js";
import On from "../button-edit/index.esm.js";
import Dn from "../button-group/index.esm.js";
import Mn from "../calendar/index.esm.js";
import Bn from "../capsule/index.esm.js";
import Vn from "../color-picker/index.esm.js";
import Rt from "../combo-list/index.esm.js";
import Nn from "../content-container/index.esm.js";
import Rn from "../data-grid/index.esm.js";
import jn from "../date-picker/index.esm.js";
import Pn from "../dropdown/index.esm.js";
import Kr from "../external-container/index.esm.js";
import $n from "../events-editor/index.esm.js";
import Ln from "../image-cropper/index.esm.js";
import Wn from "../input-group/index.esm.js";
import Hn from "../layout/index.esm.js";
import An from "../list-nav/index.esm.js";
import zn from "../list-view/index.esm.js";
import Gn from "../lookup/index.esm.js";
import qn from "../nav/index.esm.js";
import Un from "../number-spinner/index.esm.js";
import Yn from "../number-range/index.esm.js";
import Xn from "../page-header/index.esm.js";
import Kn from "../page-footer/index.esm.js";
import Qn from "../progress/index.esm.js";
import Jn from "../query-solution/index.esm.js";
import Zn from "../radio-group/index.esm.js";
import eo from "../rate/index.esm.js";
import to from "../response-toolbar/index.esm.js";
import no from "../response-layout/index.esm.js";
import oo from "../response-layout-editor/index.esm.js";
import ro from "../section/index.esm.js";
import io from "../smoke-detector/index.esm.js";
import ao from "../splitter/index.esm.js";
import lo from "../step/index.esm.js";
import so from "../switch/index.esm.js";
import uo from "../text/index.esm.js";
import co from "../time-picker/index.esm.js";
import fo from "../tree-view/index.esm.js";
import po from "../uploader/index.esm.js";
import mo from "../verify-detail/index.esm.js";
import vo from "../component/index.esm.js";
import ho from "../video/index.esm.js";
import go from "../textarea/index.esm.js";
import yo from "../tree-grid/index.esm.js";
import bo from "../fieldset/index.esm.js";
import Co from "../drawer/index.esm.js";
import { useDateFormat as Qr, useNumberFormat as Jr, resolveField as Ze, setFieldValue as Ut, getCustomClass as Gt, withInstall as Zr } from "../common/index.esm.js";
import ei from "../combo-tree/index.esm.js";
import ti from "../field-selector/index.esm.js";
import ni from "../mapping-editor/index.esm.js";
import oi from "../schema-selector/index.esm.js";
import ri from "../event-parameter/index.esm.js";
import ii from "../filter-condition-editor/index.esm.js";
import ai from "../sort-condition-editor/index.esm.js";
import li from "../menu-lookup/index.esm.js";
import { createPropsResolver as si } from "../dynamic-resolver/index.esm.js";
const _t = x(0);
function ui(t, e) {
const n = e.getBoundingClientRect(), o = t.getBoundingClientRect(), r = o.top >= n.top, a = o.top <= n.bottom;
return r && a;
}
function ci(t) {
const e = t.querySelector(".component-btn-group");
if (!e)
return;
e.style.display = "";
const n = e.getBoundingClientRect();
if (!(n.top === 0 && n.left === 0)) {
const o = e.querySelector("div");
if (o) {
const r = o.getBoundingClientRect();
o.style.top = n.top + "px";
let a = n.left - r.width;
const i = document.querySelector(".editorDiv");
if (i) {
const c = i.getBoundingClientRect();
a < c.left && ({ left: a } = t.getBoundingClientRect());
}
o.style.left = a + "px";
}
}
}
function di(t) {
if (!window.scrollContainerList)
return;
const e = Array.from(window.scrollContainerList);
if (e.length && e.length === 1) {
const n = e[0], o = document.querySelector(`[id=${n}]`);
if (o && o.contains(t))
return o;
}
}
function wo(t) {
if (!t)
return;
const e = t.getBoundingClientRect();
if (e.width === 0 && e.height === 0)
return;
const n = t.querySelector(".component-btn-group");
if (n) {
let o = !0;
const r = di(t);
if (r && (o = ui(t, r)), !o) {
n.style.display = "none";
return;
}
ci(t);
}
}
function Bt(t) {
if (!t)
return;
let e;
t.className.includes("dgComponentSelected") ? e = t : e = t.querySelector(".dgComponentSelected"), e && wo(e);
}
const fi = {
/**
* 组件值
*/
modelValue: { type: Object, default: {} },
componentId: { type: String, default: "" }
};
var vt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function pi(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function Dt(t) {
throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var So = { exports: {} };
(function(t, e) {
(function(n) {
t.exports = n();
})(function() {
return (/* @__PURE__ */ function() {
function n(o, r, a) {
function i(g, f) {
if (!r[g]) {
if (!o[g]) {
var d = typeof Dt == "function" && Dt;
if (!f && d) return d(g, !0);
if (c) return c(g, !0);
var s = new Error("Cannot find module '" + g + "'");
throw s.code = "MODULE_NOT_FOUND", s;
}
var h = r[g] = { exports: {} };
o[g][0].call(h.exports, function(v) {
var E = o[g][1][v];
return i(E || v);
}, h, h.exports, n, o, r, a);
}
return r[g].exports;
}
for (var c = typeof Dt == "function" && Dt, u = 0; u < a.length; u++) i(a[u]);
return i;
}
return n;
}())({
1: [function(n, o, r) {
var a = {}, i = "(?:^|\\s)", c = "(?:\\s|$)";
function u(d) {
var s = a[d];
return s ? s.lastIndex = 0 : a[d] = s = new RegExp(i + d + c, "g"), s;
}
function g(d, s) {
var h = d.className;
h.length ? u(s).test(h) || (d.className += " " + s) : d.className = s;
}
function f(d, s) {
d.className = d.className.replace(u(s), " ").trim();
}
o.exports = {
add: g,
rm: f
};
}, {}],
2: [function(n, o, r) {
(function(a) {
var i = n("contra/emitter"), c = n("crossvent"), u = n("./classes"), g = document, f = g.documentElement;
function d(F, V) {
var B = arguments.length;
B === 1 && Array.isArray(F) === !1 && (V = F, F = []);
var N, O, M, D, R, H, Q, U, q, se = null, P, W, A = !1, X = 0, Z, K = V || {};
K.moves === void 0 && (K.moves = C), K.accepts === void 0 && (K.accepts = C), K.invalid === void 0 && (K.invalid = ct), K.containers === void 0 && (K.containers = F || []), K.isContainer === void 0 && (K.isContainer = p), K.copy === void 0 && (K.copy = !1), K.copySortSource === void 0 && (K.copySortSource = !1), K.revertOnSpill === void 0 && (K.revertOnSpill = !1), K.removeOnSpill === void 0 && (K.removeOnSpill = !1), K.direction === void 0 && (K.direction = "vertical"), K.ignoreInputTextSelection === void 0 && (K.ignoreInputTextSelection = !0), K.mirrorContainer === void 0 && (K.mirrorContainer = g.body);
var j = i({
containers: K.containers,
start: Ke,
end: oe,
cancel: dt,
remove: Oe,
destroy: ke,
canMove: Be,
dragging: !1
});
return K.removeOnSpill === !0 && j.on("over", me).on("out", be), ie(), j;
function G($) {
return j.containers.indexOf($) !== -1 || K.isContainer($);
}
function ie($) {
var J = $ ? "remove" : "add";
v(f, J, "mousedown", Ee), v(f, J, "mouseup", De);
}
function ee($) {
var J = $ ? "remove" : "add";
v(f, J, "mousemove", qe);
}
function te($) {
var J = $ ? "remove" : "add";
c[J](f, "selectstart", Ie), c[J](f, "click", Ie);
}
function ke() {
ie(!0), De({});
}
function Ie($) {
P && $.preventDefault();
}
function Ee($) {
D = $.clientX, R = $.clientY;
var J = E($) !== 1 || $.metaKey || $.ctrlKey;
if (!J) {
var Y = $.target, de = Pe(Y);
de && (P = de, ee(), $.type === "mousedown" && (T(Y) ? Y.focus() : $.preventDefault()));
}
}
function qe($) {
if (P) {
if (E($) === 0) {
De({});
return;
}
if (!($.clientX !== void 0 && Math.abs($.clientX - D) <= (K.slideFactorX || 0) && $.clientY !== void 0 && Math.abs($.clientY - R) <= (K.slideFactorY || 0))) {
if (K.ignoreInputTextSelection) {
var J = k("clientX", $) || 0, Y = k("clientY", $) || 0, de = g.elementFromPoint(J, Y);
if (T(de))
return;
}
var Ce = P;
ee(!0), te(), oe(), Ye(Ce), u.add(U || M, "gu-transit"), Me(), Fe(), X = 0, Qe($);
}
}
}
function Pe($) {
if (!(j.dragging && N) && !G($)) {
for (var J = $; _($) && G(_($)) === !1; )
if (K.invalid($, J) || ($ = _($), !$))
return;
var Y = _($);
if (Y && !K.invalid($, J)) {
var de = K.moves($, Y, J, b($));
if (de)
return {
item: $,
source: Y
};
}
}
}
function Be($) {
return !!Pe($);
}
function Ke($) {
var J = Pe($);
J && Ye(J);
}
function Ye($) {
He($.item, $.source) && (U = $.item.cloneNode(!0), j.emit("cloned", U, $.item, "copy")), O = $.source, M = $.item, H = Q = b($.item), j.dragging = !0, j.emit("drag", M, O);
}
function ct() {
return !1;
}
function oe() {
if (j.dragging) {
var $ = U || M;
Re($, _($));
}
}
function Se() {
P = !1, ee(!0), te(!0);
}
function De($) {
if (Se(), !!j.dragging) {
var J = U || M, Y = k("clientX", $) || 0, de = k("clientY", $) || 0, Ce = w(N, Y, de), we = pt(Ce, Y, de);
we && (U && K.copySortSource || !U || we !== O) ? Re(J, we) : K.removeOnSpill ? Oe() : dt();
}
}
function Re($, J) {
var Y = _($);
U && K.copySortSource && J === O && Y.removeChild(M), it(J) ? j.emit("cancel", $, O) : j.emit("drop", $, J, O, Q), rt();
}
function Oe() {
if (j.dragging) {
var $ = U || M, J = _($);
J && J.removeChild($), j.emit(U ? "cancel" : "remove", $, J, O), rt();
}
}
function dt($) {
if (j.dragging) {
var J = arguments.length > 0 ? $ : K.revertOnSpill, Y = U || M, de = _(Y), Ce = it(de);
Ce === !1 && J && (U ? de && de.removeChild(U) : O.insertBefore(Y, H)), Ce || J ? j.emit("cancel", Y, O, O) : j.emit("drop", Y, de, O, Q), rt();
}
}
function rt() {
var $ = U || M;
Se(), We(), Xe(), $ && u.rm($, "gu-transit"), q && clearTimeout(q), j.dragging = !1, se && j.emit("out", $, se, O), j.emit("dragend", $, X), O = M = U = H = Q = q = se = null;
}
function it($, J) {
var Y;
return J !== void 0 ? Y = J : N ? Y = Q : Y = b(U || M), $ === O && Y === H;
}
function pt($, J, Y) {
for (var de = $; de && !Ce(); )
de = _(de);
return de;
function Ce() {
var we = G(de);
if (we === !1)
return !1;
var le = at(de, $), xe = Ne(de, le, J, Y), je = it(de, xe);
return je ? !0 : K.accepts(M, de, O, xe);
}
}
function Qe($) {
if (!N)
return;
$.preventDefault();
var J = k("clientX", $) || 0, Y = k("clientY", $) || 0;
N.style.left = J - 2 + "px", N.style.top = Y - 2 + "px";
var de = U || M, Ce = w(N, J, Y), we = pt(Ce, J, Y), le = we !== null && we !== se;
(le || we === null) && (tt(), se = we, mt()), _e(Ce, Y);
var xe = _(de);
if (we === O && U && !K.copySortSource) {
xe && xe.removeChild(de);
return;
}
var je, et = at(we, Ce);
if (A = lt(et, we), et !== null)
je = Ne(we, et, J, Y);
else if (K.revertOnSpill === !0 && !U)
je = H, we = O;
else {
U && xe && xe.removeChild(de), U && W && (W.style.display = "none");
return;
}
W.style.display = "block", re(je, de, le), je ? z(et, je) : ye(we);
function Ae(Ue) {
j.emit(Ue, de, se, O);
}
function mt() {
le && Ae("over");
}
function tt() {
se && Ae("out");
}
}
function re($, J, Y) {
($ === J || $ === b(J)) && (Q = b(J)), ($ === null && Y || $ !== J && $ !== b(J)) && (Q = $);
}
function me($) {
u.rm($, "gu-hide");
}
function be($) {
j.dragging && u.add($, "gu-hide");
}
function Fe() {
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 = K.getMirrorText && K.getMirrorText(M) || "控件", u.add(N, "gu-mirror"), K.mirrorContainer.appendChild(N), v(f, "add", "mousemove", Qe), u.add(K.mirrorContainer, "gu-unselectable"), j.emit("cloned", N, M, "mirror"));
}
function Me() {
if (W = document.createElement("div"), u.add(W, "gu-insertion"), M) {
var $ = M.getBoundingClientRect();
W.style.left = $.left + "px", W.style.top = $.top + "px";
}
A = !1, K.mirrorContainer.appendChild(W);
}
function We() {
N && (u.rm(K.mirrorContainer, "gu-unselectable"), v(f, "remove", "mousemove", Qe), _(N).removeChild(N), N = null);
}
function Xe() {
W && (_(W).removeChild(W), W = null);
}
function at($, J) {
for (var Y = J; Y !== $ && _(Y) !== $; )
Y = _(Y);
return Y === f ? null : Y;
}
function lt($, J) {
if (!J)
return A;
var Y = $ || J && J.lastElementChild;
if (!Y)
return !0;
var de = getComputedStyle($), Ce = /^inline/.test(de.getPropertyValue("display")) || /^(left|right)$/.test(de.getPropertyValue("float"));
if (Ce)
return !0;
if (J) {
var we = getComputedStyle(J), le = we.getPropertyValue("display");
if (/flex$/.test(le)) {
var xe = we.getPropertyValue("flex-direction") || "row";
if (xe === "row" || xe === "row-reverse")
return !Je(J);
}
return !1;
}
return !0;
}
function Je($) {
if (!$.children || !$.children.length)
return !1;
for (const J of Array.from($.children)) {
const de = (J.className && J.className.split(" ") || []).filter((Ce) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Ce));
if (!de.length)
return !1;
for (const Ce of de) {
const we = Ce.slice(Ce.lastIndexOf("-") + 1);
if (parseInt(we, 10) !== 12)
return !1;
}
}
return !0;
}
function z($, J) {
const Y = J.getBoundingClientRect();
if (W.style.left = Y.left + "px", W.style.top = Y.top + "px", A) {
if (W.style.height = Y.height + "px", W.style.width = "4px", $) {
const de = $.getBoundingClientRect();
de.top !== Y.top && (W.style.left = de.right + "px", W.style.top = de.top + "px", W.style.height = de.height + "px");
}
} else if (W.style.height = "4px", W.style.width = Y.width + "px", Z) {
const de = Z.getBoundingClientRect();
Y.top < de.top && (W.style.display = "none");
}
J === M && M && (W.style.display = "none");
}
function ye($) {
Q = null;
var J = $.lastElementChild;
if (J) {
var Y = J.getBoundingClientRect();
A ? (W.style.left = Y.right + "px", W.style.top = Y.top + "px", W.style.height = Y.height + "px", W.style.width = "4px") : (W.style.left = Y.left + "px", W.style.top = Y.bottom + "px", W.style.height = "4px", W.style.width = Y.width + "px"), J === M && M && (W.style.display = "none");
} else
W.style.display = "none";
}
function _e($, J) {
if (!K.mirrorContainer.contains($) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (Z = s($), !Z || !Z.contains($)))
return;
const Y = document.querySelector(".dgComponentSelected"), de = Z.getBoundingClientRect();
if (J - 30 < de.top && Z.scrollTop > 0) {
let Ce = Z.scrollTop < 10 ? Z.scrollTop : 10;
Z.scrollBy(0, -1 * Ce), Y && Z.contains(Y) && (X = X + -1 * Ce);
}
if (J + 30 > de.bottom && Z.scrollTop < Z.scrollHeight - Z.clientHeight) {
const Ce = Z.scrollHeight - Z.clientHeight - Z.scrollTop;
let we = Ce < 10 ? Ce : 10;
Z.scrollBy(0, we), Y && Z.contains(Y) && (X = X + we);
}
}
function Ne($, J, Y, de) {
var Ce = K.direction === "horizontal", we = K.direction === "mixed", le = J !== $ ? je() : xe();
return le;
function xe() {
var Ae = $.children.length, mt, tt, Ue;
for (mt = 0; mt < Ae; mt++)
if (tt = $.children[mt], Ue = tt.getBoundingClientRect(), Ce && Ue.left + Ue.width / 2 > Y || !we && !Ce && Ue.top + Ue.height / 2 > de || we && Ue.left + Ue.width > Y && Ue.top + Ue.height > de)
return tt;
return null;
}
function je() {
var Ae = J.getBoundingClientRect();
if (we) {
var mt = de - Ae.top, tt = Y - Ae.left, Ue = Ae.bottom - de, Wt = Ae.right - Y, Ht = Math.min(tt, Wt, mt, Ue), At;
return A ? At = Wt < tt : At = Ue === Ht || Wt === Ht || tt === Ht, et(At);
}
return et(Ce ? Y > Ae.left + y(Ae) / 2 : de > Ae.top + m(Ae) / 2);
}
function et(Ae) {
return Ae ? b(J) : J;
}
}
function He($, J) {
return typeof K.copy == "boolean" ? K.copy : K.copy($, J);
}
}
function s(F) {
const V = Array.from(window.scrollContainerList);
if (V.length === 1) {
const N = Array.from(window.scrollContainerList)[0];
return document.getElementById(N);
}
const B = h(V);
for (const N of B)
if (N.contains(F))
return N;
return null;
}
function h(F) {
const V = [];
return F.forEach((B) => {
const N = document.getElementById(B);
N && V.push(N);
}), V.sort((B, N) => B.contains(N) ? 1 : N.contains(B) ? -1 : 0), V;
}
function v(F, V, B, N) {
var O = {
mouseup: "touchend",
mousedown: "touchstart",
mousemove: "touchmove"
}, M = {
mouseup: "pointerup",
mousedown: "pointerdown",
mousemove: "pointermove"
}, D = {
mouseup: "MSPointerUp",
mousedown: "MSPointerDown",
mousemove: "MSPointerMove"
};
a.navigator.pointerEnabled ? c[V](F, M[B], N) : a.navigator.msPointerEnabled ? c[V](F, D[B], N) : (c[V](F, O[B], N), c[V](F, B, N));
}
function E(F) {
if (F.touches !== void 0)
return F.touches.length;
if (F.which !== void 0 && F.which !== 0)
return F.which;
if (F.buttons !== void 0)
return F.buttons;
var V = F.button;
if (V !== void 0)
return V & 1 ? 1 : V & 2 ? 3 : V & 4 ? 2 : 0;
}
function w(F, V, B) {
F = F || {};
var N = F.className || "", O;
return F.className += " gu-hide", O = g.elementFromPoint(V, B), F.className = N, O;
}
function p() {
return !1;
}
function C() {
return !0;
}
function y(F) {
return F.width || F.right - F.left;
}
function m(F) {
return F.height || F.bottom - F.top;
}
function _(F) {
return F.parentNode === g ? null : F.parentNode;
}
function T(F) {
return F.tagName === "INPUT" || F.tagName === "TEXTAREA" || F.tagName === "SELECT" || l(F);
}
function l(F) {
return !F || F.contentEditable === "false" ? !1 : F.contentEditable === "true" ? !0 : l(_(F));
}
function b(F) {
return F.nextElementSibling || V();
function V() {
var B = F;
do
B = B.nextSibling;
while (B && B.nodeType !== 1);
return B;
}
}
function S(F) {
return F.targetTouches && F.targetTouches.length ? F.targetTouches[0] : F.changedTouches && F.changedTouches.length ? F.changedTouches[0] : F;
}
function k(F, V) {
var B = S(V), N = {
pageX: "clientX",
// IE8
pageY: "clientY"
// IE8
};
return F in N && !(F in B) && N[F] in B && (F = N[F]), B[F];
}
o.exports = d;
}).call(this, typeof vt < "u" ? vt : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }],
3: [function(n, o, r) {
o.exports = function(i, c) {
return Array.prototype.slice.call(i, c);
};
}, {}],
4: [function(n, o, r) {
var a = n("ticky");
o.exports = function(c, u, g) {
c && a(function() {
c.apply(g || null, u || []);
});
};
}, { ticky: 10 }],
5: [function(n, o, r) {
var a = n("atoa"), i = n("./debounce");
o.exports = function(u, g) {
var f = g || {}, d = {};
return u === void 0 && (u = {}), u.on = function(s, h) {
return d[s] ? d[s].push(h) : d[s] = [h], u;
}, u.once = function(s, h) {
return h._once = !0, u.on(s, h), u;
}, u.off = function(s, h) {
var v = arguments.length;
if (v === 1)
delete d[s];
else if (v === 0)
d = {};
else {
var E = d[s];
if (!E)
return u;
E.splice(E.indexOf(h), 1);
}
return u;
}, u.emit = function() {
var s = a(arguments);
return u.emitterSnapshot(s.shift()).apply(this, s);
}, u.emitterSnapshot = function(s) {
var h = (d[s] || []).slice(0);
return function() {
var v = a(arguments), E = this || u;
if (s === "error" && f.throws !== !1 && !h.length)
throw v.length === 1 ? v[0] : v;
return h.forEach(function(p) {
f.async ? i(p, v, E) : p.apply(E, v), p._once && u.off(s, p);
}), u;
};
}, u;
};
}, { "./debounce": 4, atoa: 3 }],
6: [function(n, o, r) {
(function(a) {
var i = n("custom-event"), c = n("./eventmap"), u = a.document, g = s, f = v, d = [];
a.addEventListener || (g = h, f = E), o.exports = {
add: g,
remove: f,
fabricate: w
};
function s(_, T, l, b) {
return _.addEventListener(T, l, b);
}
function h(_, T, l) {
return _.attachEvent("on" + T, C(_, T, l));
}
function v(_, T, l, b) {
return _.removeEventListener(T, l, b);
}
function E(_, T, l) {
var b = y(_, T, l);
if (b)
return _.detachEvent("on" + T, b);
}
function w(_, T, l) {
var b = c.indexOf(T) === -1 ? k() : S();
_.dispatchEvent ? _.dispatchEvent(b) : _.fireEvent("on" + T, b);
function S() {
var F;
return u.createEvent ? (F = u.createEvent("Event"), F.initEvent(T, !0, !0)) : u.createEventObject && (F = u.createEventObject()), F;
}
function k() {
return new i(T, { detail: l });
}
}
function p(_, T, l) {
return function(S) {
var k = S || a.event;
k.target = k.target || k.srcElement, k.preventDefault = k.preventDefault || function() {
k.returnValue = !1;
}, k.stopPropagation = k.stopPropagation || function() {
k.cancelBubble = !0;
}, k.which = k.which || k.keyCode, l.call(_, k);
};
}
function C(_, T, l) {
var b = y(_, T, l) || p(_, T, l);
return d.push({
wrapper: b,
element: _,
type: T,
fn: l
}), b;
}
function y(_, T, l) {
var b = m(_, T, l);
if (b) {
var S = d[b].wrapper;
return d.splice(b, 1), S;
}
}
function m(_, T, l) {
var b, S;
for (b = 0; b < d.length; b++)
if (S = d[b], S.element === _ && S.type === T && S.fn === l)
return b;
}
}).call(this, typeof vt < "u" ? vt : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, { "./eventmap": 7, "custom-event": 8 }],
7: [function(n, o, r) {
(function(a) {
var i = [], c = "", u = /^on/;
for (c in a)
u.test(c) && i.push(c.slice(2));
o.exports = i;
}).call(this, typeof vt < "u" ? vt : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, {}],
8: [function(n, o, r) {
(function(a) {
var i = a.CustomEvent;
function c() {
try {
var u = new i("cat", { detail: { foo: "bar" } });
return u.type === "cat" && u.detail.foo === "bar";
} catch {
}
return !1;
}
o.exports = c() ? i : (
// IE >= 9
typeof document < "u" && typeof document.createEvent == "function" ? function(g, f) {
var d = document.createEvent("CustomEvent");
return f ? d.initCustomEvent(g, f.bubbles, f.cancelable, f.detail) : d.initCustomEvent(g, !1, !1, void 0), d;
} : (
// IE <= 8
function(g, f) {
var d = document.createEventObject();
return d.type = g, f ? (d.bubbles = !!f.bubbles, d.cancelable = !!f.cancelable, d.detail = f.detail) : (d.bubbles = !1, d.cancelable = !1, d.detail = void 0), d;
}
)
);
}).call(this, typeof vt < "u" ? vt : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, {}],
9: [function(n, o, r) {
var a = o.exports = {}, i, c;
function u() {
throw new Error("setTimeout has not been defined");
}
function g() {
throw new Error("clearTimeout has not been defined");
}
(function() {
try {
typeof setTimeout == "function" ? i = setTimeout : i = u;
} catch {
i = u;
}
try {
typeof clearTimeout == "function" ? c = clearTimeout : c = g;
} catch {
c = g;
}
})();
function f(m) {
if (i === setTimeout)
return setTimeout(m, 0);
if ((i === u || !i) && setTimeout)
return i = setTimeout, setTimeout(m, 0);
try {
return i(m, 0);
} catch {
try {
return i.call(null, m, 0);
} catch {
return i.call(this, m, 0);
}
}
}
function d(m) {
if (c === clearTimeout)
return clearTimeout(m);
if ((c === g || !c) && clearTimeout)
return c = clearTimeout, clearTimeout(m);
try {
return c(m);
} catch {
try {
return c.call(null, m);
} catch {
return c.call(this, m);
}
}
}
var s = [], h = !1, v, E = -1;
function w() {
!h || !v || (h = !1, v.length ? s = v.concat(s) : E = -1, s.length && p());
}
function p() {
if (!h) {
var m = f(w);
h = !0;
for (var _ = s.length; _; ) {
for (v = s, s = []; ++E < _; )
v && v[E].run();
E = -1, _ = s.length;
}
v = null, h = !1, d(m);
}
}
a.nextTick = function(m) {
var _ = new Array(arguments.length - 1);
if (arguments.length > 1)
for (var T = 1; T < arguments.length; T++)
_[T - 1] = arguments[T];
s.push(new C(m, _)), s.length === 1 && !h && f(p);
};
function C(m, _) {
this.fun = m, this.array = _;
}
C.prototype.run = function() {
this.fun.apply(null, this.array);
}, a.title = "browser", a.browser = !0, a.env = {}, a.argv = [], a.version = "", a.versions = {};
function y() {
}
a.on = y, a.addListener = y, a.once = y, a.off = y, a.removeListener = y, a.removeAllListeners = y, a.emit = y, a.prependListener = y, a.prependOnceListener = y, a.listeners = function(m) {
return [];
}, a.binding = function(m) {
throw new Error("process.binding is not supported");
}, a.cwd = function() {
return "/";
}, a.chdir = function(m) {
throw new Error("process.chdir is not supported");
}, a.umask = function() {
return 0;
};
}, {}],
10: [function(n, o, r) {
(function(a) {
var i = typeof a == "function", c;
i ? c = function(u) {
a(u);
} : c = function(u) {
setTimeout(u, 0);
}, o.exports = c;
}).call(this, n("timers").setImmediate);
}, { timers: 11 }],
11: [function(n, o, r) {
(function(a, i) {
var c = n("process/browser.js").nextTick, u = Function.prototype.apply, g = Array.prototype.slice, f = {}, d = 0;
r.setTimeout = function() {
return new s(u.call(setTimeout, window, arguments), clearTimeout);
}, r.setInterval = function() {
return new s(u.call(setInterval, window, arguments), clearInterval);
}, r.clearTimeout = r.clearInterval = function(h) {
h.close();
};
function s(h, v) {
this._id = h, this._clearFn = v;
}
s.prototype.unref = s.prototype.ref = function() {
}, s.prototype.close = function() {
this._clearFn.call(window, this._id);
}, r.enroll = function(h, v) {
clearTimeout(h._idleTimeoutId), h._idleTimeout = v;
}, r.unenroll = function(h) {
clearTimeout(h._idleTimeoutId), h._idleTimeout = -1;
}, r._unrefActive = r.active = function(h) {
clearTimeout(h._idleTimeoutId);
var v = h._idleTimeout;
v >= 0 && (h._idleTimeoutId = setTimeout(function() {
h._onTimeout && h._onTimeout();
}, v));
}, r.setImmediate = typeof a == "function" ? a : function(h) {
var v = d++, E = arguments.length < 2 ? !1 : g.call(arguments, 1);
return f[v] = !0, c(function() {
f[v] && (E ? h.apply(null, E) : h.call(null), r.clearImmediate(v));
}), v;
}, r.clearImmediate = typeof i == "function" ? i : function(h) {
delete f[h];
};
}).call(this, n("timers").setImmediate, n("timers").clearImmediate);
}, { "process/browser.js": 9, timers: 11 }]
}, {}, [2])(2);
});
})(So);
var mi = So.exports;
const sn = /* @__PURE__ */ pi(mi), vi = {
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 }
}, hi = {
showCloseButton: { type: Boolean, default: !0 },
animate: { type: String, default: "fadeIn" },
options: { type: Object }
}, Yt = /* @__PURE__ */ Ge({
name: "Toast",
props: hi,
emits: ["close", "click"],
setup: (t, e) => {
const n = x(t.animate), o = "fadeOut", r = L(() => t.options), a = x(!1), i = L(() => {
const p = {
animated: a.value,
toast: !0
};
return p[t.animate] = !1, p[o] = a.value, p[r.value.type] = !0, r.value.theme && (p[r.value.theme] = !0), p;
}), c = L(() => {
const y = `f-icon-${r.value && r.value.type ? r.value.type.replace("toasty-type-", "") : "default"}`, m = {
"f-icon": !0
};
return m[y] = !0, m;
}), u = L(() => r.value.title || r.value.message), g = L(() => r.value.title && r.value.message), f = L(() => !r.value.title && r.value.message), d = L(() => t.showCloseButton), s = L(() => !!r.value.buttons || !!e.slots.default);
function h(p) {
p.stopPropagation(), p.preventDefault(), a.value = !1, setTimeout(() => {
e.emit("close", r.value);
}, 200);
}
function v(p, C) {
}
function E(p) {
return `f-preten-link ${p.customClass ? p.customClass : ""}`;
}
Te(n, () => {
n.value;
});
const w = () => {
var p;
return I(Ct, null, [I("div", {
class: "after-toast-msg text-right"
}, [!e.slots.default && ((p = r.value.buttons) == null ? void 0 : p.map((C) => I("span", {
class: E(C),
onClick: (y) => void 0
}, [C.text]))), e.slots.default && e.slots.default()])]);
};
return () => I("div", {
class: i.value,
style: "min-height:44px"
}, [d.value && I("button", {
title: "关闭",
class: "toast-close f-btn-icon f-bare",
onClick: h
}, [I("span", {
class: "f-icon modal_close"
}, null)]), u.value && I("section", {
class: "modal-tips"
}, [I("div", {
class: "float-left modal-tips-iconwrap"
}, [I("span", {
class: c.value
}, null)]), I("div", {
class: "modal-tips-content"
}, [g.value && I(Ct, null, [I("h5", {
class: "toast-title modal-tips-title",
innerHTML: r.value.title
}, null), I("p", {
class: "toast-msg",
innerHTML: r.value.message
}, null), s.value && w()]), f.value && (r.value.buttons ? I("div", {
class: "toast-title-btns-wrapper d-flex"
}, [I("h5", {
class: "toast-title modal-tips-title only-toast-msg",
innerHTML: r.value.message
}, null), I("div", {
class: "after-toast-title text-right ml-auto"
}, [w()])]) : I("h5", {
class: "toast-title modal-tips-title only-toast-msg",
innerHTML: r.value.message
}, null))])])]);
}
}), Vt = /* @__PURE__ */ Ge({
name: "Notify",
props: vi,
emits: ["close", "empty"],
setup(t, e) {
const n = L(() => ({
"farris-notify": !0
})), o = {
left: 12,
right: 12,
top: 20,
bottom: 12
}, r = x(), a = x(t.options), i = x(t.showCloseButton), c = L(() => t.position || "bottom-right"), u = L(() => t.timeout != null ? t.timeout : 3e3), g = L(() => {
const s = t.bottom ? t.bottom : o.bottom, h = t.top ? t.top : o.top, v = {
transition: "all 0.2s ease",
left: c.value.indexOf("left") > -1 ? `${t.left ? t.left : o.left}px` : "",
right: c.value.indexOf("right") > -1 ? `${t.right ? t.right : o.right}px` : "",
top: c.value.indexOf("top") > -1 ? `${h}px` : "",
bottom: c.value.indexOf("bottom") > -1 ? `${s}px` : ""
};
return c.value.indexOf("center") > -1 && (v.left = "50%", v.marginLeft = "calc(-24rem / 2)", c.value === "center-center" && (v.top = "50%", v.transform = "translate(-50%, -50%)")), v;
});
function f(s) {
e.emit("close");
}
u.value && setTimeout(() => {
f();
}, u.value), e.expose({
closeToast: f,
container: r,
notifyPosition: c
});
function d(s, h) {
f();
}
return () => I("div", {
class: n.value,
style: g.value,
ref: r
}, [I(Yt, {
options: a.value,
showCloseButton: i.value,
animate: t.animate,
onClose: (s) => d(s, a.value)
}, null)]);
}
});
class It {
constructor() {
ne(this, "notifyRefs", []);
ne(this, "globalConfig", ft({}));
}
createNotifyInstance(e) {
const n = this, r = Object.assign({
timeout: 3e3,
position: "bottom-right",
showCloseButton: !0
}, this.globalConfig, {
...e
}), a = document.createElement("div");
a.style.display = "contents";
const i = mn({
setup() {
const c = x();
function u() {
c.value.container.style.transform = "scale(0)", setTimeout(() => {
n.updateNotifyPositionForClose(r, c), i.unmount();
}, 220);
}
if (r.position.indexOf("top") > -1) {
const g = n.getNotifyInstances(r.position), f = g[g.length - 1];
if (f) {
const d = f.value.container.getBoundingClientRect();
r.top = d.bottom;
}
}
return Et(() => {
document.body.removeChild(a);
}), gt(() => {
n.updateNotifyPositionForCreate(r, c);
}), () => I(vn, {
mode: "out-in",
name: "fade",
appear: !0
}, {
default: () => [I(Vt, bt({
ref: c
}, r, {
onClose: u
}), null)]
});
}
});
return i.provide("NotifyService", this), document.body.appendChild(a), i.mount(a), i;
}
getNotifyInstances(e) {
return this.notifyRefs.filter((n) => n.value.notifyPosition === e);
}
updateNotifyPositionForCreate(e, n) {
if (this.notifyRefs && this.notifyRefs.length) {
const o = window.innerHeight;
e.position.indexOf("bottom") > -1 && this.getNotifyInstances(e.position).forEach((r) => {
const a = r.value.container.getBoundingClientRect();
r.value.container.style.bottom = a.height + o - a.bottom + "px";
});
}
this.notifyRefs = [...this.notifyRefs, n];
}
updateNotifyPositionForClose(e, n) {
const o = this.notifyRefs.indexOf(n);
if (e.position.indexOf("top") > -1) {
const r = this.getNotifyInstances(e.position), a = r.indexOf(n);
r.slice(a + 1).forEach((i) => {
i.value.container.style.top = i.value.container.offsetTop - i.value.container.offsetHeight + "px";
});
}
o > -1 && this.notifyRefs.splice(o, 1);
}
show(e) {
return this.createNotifyInstance(e);
}
buildNotifyProps(e, n) {
let o = "", r = "", a, i, c;
typeof n == "string" ? o = n : n && (o = n.message || "", r = n.title || "", i = n.position || null, c = n.showCloseButton != null ? n.showCloseButton : null, a = n.timeout != null ? n.timeout : null);
const g = {
options: {
type: e,
message: o,
title: r
}
};
return i != null && (g.position = i), c != null && (g.showCloseButton = c), a != null && (g.timeout = a), g;
}
info(e) {
const n = this.buildNotifyProps("info", e);
return this.show(n);
}
success(e) {
const n = this.buildNotifyProps("success", e);
return this.show(n);
}
warning(e) {
const n = this.buildNotifyProps("warning", e);
return this.show(n);
}
error(e) {
const n = this.buildNotifyProps("error", e);
return this.show(n);
}
close(e) {
e && e.unmount();
}
closeAll() {
this.notifyRefs.forEach((e) => {
e == null || e.value.closeToast();
}), this.notifyRefs.length = 0;
}
}
const gi = Symbol("NOTIFY_SERVICE_TOKEN");
Vt.install = (t) => {
t.component(Vt.name, Vt), t.component(Yt.name, Yt);
const e = new It();
t.provide(gi, e), t.provide("FNotifyService", e);
};
const yi = {
designerHostService: { type: Object, default: {} },
/** 预设的控件类型 */
componentType: { type: String, default: "" },
/** 预设绑定的实体id */
bindingEntityId: { type: String, default: "" },
/** 绑定步骤 */
steps: { type: Array, default: ["selectEntity", "selectFields"] }
}, _o = {}, To = {};
function Jt(t) {
const { properties: e, title: n, ignore: o } = t, r = o && Array.isArray(o), a = Object.keys(e).reduce((i, c) => ((!r || !o.find((u) => u === c)) && (i[c] = e[c].type === "object" && e[c].properties ? Jt(e[c]) : ut(e[c].default)), i), {});
if (n && (!r || !o.find((i) => i === "id"))) {
const i = n.toLowerCase().replace(/-/g, "_");
a.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return a;
}
function bi(t) {
const { properties: e, title: n, required: o } = t;
if (o && Array.isArray(o)) {
const r = o.reduce((a, i) => (a[i] = e[i].type === "object" && e[i].properties ? Jt(e[i]) : ut(e[i].default), a), {});
if (n && o.find((a) => a === "id")) {
const a = n.toLowerCase().replace(/-/g, "_");
r.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return r;
}
return {
type: n
};
}
function Zt(t, e = {}, n) {
const o = _o[t];
if (o) {
let r = bi(o);
const a = To[t];
return r = a ? a({ getSchemaByType: Zt }, r, e, n) : r, r;
}
return null;
}
function Ci(t, e) {
const n = Jt(e);
return Object.keys(n).reduce((o, r) => (Object.prototype.hasOwnProperty.call(t, r) && (o[r] && on(o[r]) && on(t[r] || !t[r]) ? Object.assign(o[r], t[r] || {}) : o[r] = t[r]), o), n), n;
}
function xo(t, e) {
return Object.keys(t).filter((o) => t[o] != null).reduce((o, r) => {
if (e.has(r)) {
const a = e.get(r);
if (typeof a == "string")
o[a] = t[r];
else {
const i = a(r, t[r], t);
Object.assign(o, i);
}
} else
o[r] = t[r];
return o;
}, {});
}
function wi(t, e, n = /* @__PURE__ */ new Map()) {
const o = Ci(t, e);
return xo(o, n);
}
function Si(t = {}) {
function e(g, f, d, s) {
if (typeof d == "number")
return s[g].length === d;
if (typeof d == "object") {
const h = Object.keys(d)[0], v = d[h];
if (h === "not")
return Number(s[g].length) !== Number(v);
if (h === "moreThan")
return Number(s[g].length) >= Number(v);
if (h === "lessThan")
return Number(s[g].length) <= Number(v);
}
return !1;
}
function n(g, f, d, s) {
return s[g] && s[g].propertyValue && String(s[g].propertyValue.value) === String(d);
}
const o = /* @__PURE__ */ new Map([
["length", e],
["getProperty", n]
]);
Object.keys(t).reduce((g, f) => (g.set(f, t[f]), g), o);
function r(g, f) {
const d = g;
return typeof f == "number" ? [{ target: d, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: d, operator: "getProperty", param: g, value: !!f }] : typeof f == "object" ? Object.keys(f).map((s) => {
if (s === "length")
return { target: d, operator: "length", param: null, value: f[s] };
const h = s, v = f[s];
return { target: d, operator: "getProperty", param: h, value: v };
}) : [];
}
function a(g) {
return Object.keys(g).reduce((d, s) => {
const h = r(s, g[s]);
return d.push(...h), d;
}, []);
}
function i(g, f) {
if (o.has(g.operator)) {
const d = o.get(g.operator);
return d && d(g.target, g.param, g.value, f) || !1;
}
return !1;
}
function c(g, f) {
return a(g).reduce((h, v) => h && i(v, f), !0);
}
function u(g, f) {
const d = Object.keys(g), s = d.includes("allOf"), h = d.includes("anyOf"), v = s || h, p = (v ? g[v ? s ? "allOf" : "anyOf" : "allOf"] : [g]).map((y) => c(y, f));
return s ? !p.includes(!1) : p.includes(!0);
}
return { parseValueSchema: u };
}
const ae = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
"input-group": { type: "input-group", name: "文本" },
textarea: { type: "textarea", name: "多行文本" },
lookup: { type: "lookup", name: "帮助" },
"number-spinner": { type: "number-spinner", name: "数值" },
"date-picker": { type: "date-picker", name: "日期" },
switch: { type: "switch", name: "开关" },
"radio-group": { type: "radio-group", name: "单选组" },
"check-box": { type: "check-box", name: "复选框" },
"check-group": { type: "check-group", name: "复选框组" },
"combo-list": { type: "combo-list", name: "下拉列表" },
"respo