UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,273 lines 411 kB
var Zr = Object.defineProperty; var ei = (n, t, e) => t in n ? Zr(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e; var R = (n, t, e) => ei(n, typeof t != "symbol" ? t + "" : t, e); import { ref as T, defineComponent as nt, computed as A, watch as Me, createVNode as M, Fragment as Ht, reactive as St, createApp as Jn, onUnmounted as en, onMounted as It, Transition as Zn, mergeProps as jt, createTextVNode as tt, onBeforeUnmount as eo, withDirectives as ti, resolveDirective as ni, nextTick as vn, onBeforeMount as to, Teleport as oi, shallowRef as ri, render as gn, h as ii, cloneVNode as ai, inject as Je, provide as rn, triggerRef as si, isVNode as li } from "vue"; import { isPlainObject as Rn, cloneDeep as wt, isUndefined as mt, throttle as ui, merge as nn, findIndex as Ln } from "lodash-es"; import { useResizeObserver as no } from "@vueuse/core"; import { useIdentify as ci, useGroupData as di, useFilter as fi, useHierarchy as pi, useLoading as mi, useDataView as hi, useSelection as vi, useSelectHierarchyItem as gi, useDataViewContainerStyle as yi, useCommandColumn as bi, useColumn as wi, useSort as Ci, useGroupColumn as xi, useRow as _i, useEdit as Si, useVisualDataBound as Ti, useVisualDataCell as ki, useVisualDataRow as Fi, useVisualData as Ei, useCellPosition as Mi, useSidebar as Oi, useVirtualScroll as Di, useFitColumn as Ii, useFilterHistory as Pi, useColumnFilter as Ni, useDragColumn as Bi, getColumnHeader as Vi, getSidebar as Ri, getDisableMask as Li, getHorizontalScrollbar as Wi, getVerticalScrollbar as ji, getEmpty as Hi } from "../data-view/index.esm.js"; import "../modal/index.esm.js"; import oo from "../transfer/index.esm.js"; import ro from "../tabs/index.esm.js"; import io from "../order/index.esm.js"; import "../condition/index.esm.js"; import { FCheckbox as $i } from "../checkbox/index.esm.js"; import { useGuid as Ai, resolveField as ut, FormSchemaEntityFieldTypeName as Wn, useCommonUtils as qi, useDateFormat as zi, useNumberFormat as Gi, setFieldValue as Cn, getCustomClass as yn, withInstall as Yi } from "../common/index.esm.js"; import ao from "../filter-bar/index.esm.js"; import jn from "../tooltip/index.esm.js"; import so from "../pagination/index.esm.js"; import Ui from "../button/index.esm.js"; import lo from "../search-box/index.esm.js"; import uo from "../tags/index.esm.js"; import co, { FDynamicFormGroup as Xi, FDynamicFormInput as Qi } from "../dynamic-form/index.esm.js"; import { createPropsResolver as Ki } from "../dynamic-resolver/index.esm.js"; import "../designer-canvas/index.esm.js"; import "../property-panel/index.esm.js"; import fo from "../accordion/index.esm.js"; import po from "../avatar/index.esm.js"; import mo from "../../designer/button-edit/index.esm.js"; import ho from "../button-group/index.esm.js"; import vo from "../calendar/index.esm.js"; import go from "../capsule/index.esm.js"; import xn from "../../designer/checkbox/index.esm.js"; import un from "../../designer/checkbox-group/index.esm.js"; import cn from "../combo-list/index.esm.js"; import Ji from "../combo-tree/index.esm.js"; import yo from "../component/index.esm.js"; import bo from "../color-picker/index.esm.js"; import wo from "../content-container/index.esm.js"; import Co from "../date-picker/index.esm.js"; import xo from "../../designer/data-grid/index.esm.js"; import _o from "../dropdown/index.esm.js"; import Zi from "../events-editor/index.esm.js"; import ea from "../field-selector/index.esm.js"; import ta, { FBindingSelectorContainer as na } from "../binding-selector/index.esm.js"; import So from "../image-cropper/index.esm.js"; import To from "../../designer/input-group/index.esm.js"; import ko from "../layout/index.esm.js"; import Fo from "../list-nav/index.esm.js"; import Eo from "../list-view/index.esm.js"; import Mo from "../lookup/index.esm.js"; import oa from "../mapping-editor/index.esm.js"; import Oo from "../nav/index.esm.js"; import Do from "../number-range/index.esm.js"; import Io from "../number-spinner/index.esm.js"; import Po from "../page-header/index.esm.js"; import No from "../page-footer/index.esm.js"; import Bo from "../progress/index.esm.js"; import Vo from "../query-solution/index.esm.js"; import Ro from "../../designer/radio-group/index.esm.js"; import Lo from "../rate/index.esm.js"; import Wo from "../response-toolbar/index.esm.js"; import jo from "../response-layout/index.esm.js"; import Ho from "../response-layout-editor/index.esm.js"; import $o from "../section/index.esm.js"; import Ao from "../smoke-detector/index.esm.js"; import qo from "../splitter/index.esm.js"; import zo from "../step/index.esm.js"; import Go from "../switch/index.esm.js"; import Yo from "../text/index.esm.js"; import Uo from "../time-picker/index.esm.js"; import Xo from "../tree-view/index.esm.js"; import Qo from "../uploader/index.esm.js"; import Ko from "../verify-detail/index.esm.js"; import Jo from "../video/index.esm.js"; import Zo from "../textarea/index.esm.js"; import ra from "../schema-selector/index.esm.js"; import er from "../tree-grid/index.esm.js"; import ia from "../event-parameter/index.esm.js"; import aa from "../filter-condition-editor/index.esm.js"; import tr from "../fieldset/index.esm.js"; import sa from "../sort-condition-editor/index.esm.js"; import la from "../menu-lookup/index.esm.js"; import nr from "../drawer/index.esm.js"; import ua from "../json-editor/index.esm.js"; import ca from "../property-editor/index.esm.js"; import da from "../expression-editor/index.esm.js"; import fa from "../code-editor/index.esm.js"; import or from "../html-template/index.esm.js"; import pa from "../external-container/index.esm.js"; import { FNotifyService as ma } from "../notify/index.esm.js"; const qt = T(0); function ha(n, t) { const e = t.getBoundingClientRect(), o = n.getBoundingClientRect(), r = o.top >= e.top, i = o.top <= e.bottom; return r && i; } function va(n) { const t = n.querySelector(".component-btn-group"); if (!t) return; t.style.display = ""; const e = t.getBoundingClientRect(); if (!(e.top === 0 && e.left === 0)) { const o = t.querySelector("div"); if (o) { const r = o.getBoundingClientRect(); o.style.top = e.top + "px"; let i = e.left - r.width; const a = document.querySelector(".editorDiv"); if (a) { const s = a.getBoundingClientRect(); i < s.left && ({ left: i } = n.getBoundingClientRect()); } o.style.left = i + "px"; } } } function ga(n) { if (!window.scrollContainerList) return; const t = Array.from(window.scrollContainerList); if (t.length && t.length === 1) { const e = t[0], o = document.querySelector(`[id=${e}]`); if (o && o.contains(n)) return o; } } function rr(n) { if (!n) return; const t = n.getBoundingClientRect(); if (t.width === 0 && t.height === 0) return; const e = n.querySelector(".component-btn-group"); if (e) { let o = !0; const r = ga(n); if (r && (o = ha(n, r)), !o) { e.style.display = "none"; return; } va(n); } } function an(n) { if (!n) return; let t; n.className.includes("dgComponentSelected") ? t = n : t = n.querySelector(".dgComponentSelected"), t && rr(t); } const ya = { /** * 组件值 */ modelValue: { type: Object, default: {} }, componentId: { type: String, default: "" } }; var Et = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function ba(n) { return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n; } function on(n) { throw new Error('Could not dynamically require "' + n + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var ir = { exports: {} }; (function(n, t) { (function(e) { n.exports = e(); })(function() { return (/* @__PURE__ */ function() { function e(o, r, i) { function a(u, d) { if (!r[u]) { if (!o[u]) { var m = typeof on == "function" && on; if (!d && m) return m(u, !0); if (s) return s(u, !0); var p = new Error("Cannot find module '" + u + "'"); throw p.code = "MODULE_NOT_FOUND", p; } var h = r[u] = { exports: {} }; o[u][0].call(h.exports, function(f) { var F = o[u][1][f]; return a(F || f); }, h, h.exports, e, o, r, i); } return r[u].exports; } for (var s = typeof on == "function" && on, l = 0; l < i.length; l++) a(i[l]); return a; } return e; }())({ 1: [function(e, o, r) { var i = {}, a = "(?:^|\\s)", s = "(?:\\s|$)"; function l(m) { var p = i[m]; return p ? p.lastIndex = 0 : i[m] = p = new RegExp(a + m + s, "g"), p; } function u(m, p) { var h = m.className; h.length ? l(p).test(h) || (m.className += " " + p) : m.className = p; } function d(m, p) { m.className = m.className.replace(l(p), " ").trim(); } o.exports = { add: u, rm: d }; }, {}], 2: [function(e, o, r) { (function(i) { var a = e("contra/emitter"), s = e("crossvent"), l = e("./classes"), u = document, d = u.documentElement; function m(b, P) { var N = arguments.length; N === 1 && Array.isArray(b) === !1 && (P = b, b = []); var O, I, z, $, V, j, Q, B, D, Y = null, H, L, G = !1, K = 0, ae, Z = P || {}; Z.moves === void 0 && (Z.moves = _), Z.accepts === void 0 && (Z.accepts = _), Z.invalid === void 0 && (Z.invalid = Ct), Z.containers === void 0 && (Z.containers = b || []), Z.isContainer === void 0 && (Z.isContainer = g), Z.copy === void 0 && (Z.copy = !1), Z.copySortSource === void 0 && (Z.copySortSource = !1), Z.revertOnSpill === void 0 && (Z.revertOnSpill = !1), Z.removeOnSpill === void 0 && (Z.removeOnSpill = !1), Z.direction === void 0 && (Z.direction = "vertical"), Z.ignoreInputTextSelection === void 0 && (Z.ignoreInputTextSelection = !0), Z.mirrorContainer === void 0 && (Z.mirrorContainer = u.body); var fe = a({ containers: Z.containers, start: Be, end: ht, cancel: We, remove: Ye, destroy: U, canMove: Oe, dragging: !1 }); return Z.removeOnSpill === !0 && fe.on("over", kt).on("out", _t), ke(), fe; function be(W) { return fe.containers.indexOf(W) !== -1 || Z.isContainer(W); } function ke(W) { var ee = W ? "remove" : "add"; f(d, ee, "mousedown", q), f(d, ee, "mouseup", Fe); } function Ve(W) { var ee = W ? "remove" : "add"; f(d, ee, "mousemove", te); } function je(W) { var ee = W ? "remove" : "add"; s[ee](d, "selectstart", de), s[ee](d, "click", de); } function U() { ke(!0), Fe({}); } function de(W) { H && W.preventDefault(); } function q(W) { $ = W.clientX, V = W.clientY; var ee = F(W) !== 1 || W.metaKey || W.ctrlKey; if (!ee) { var oe = W.target, ne = xe(oe); ne && (H = ne, Ve(), W.type === "mousedown" && (C(oe) ? oe.focus() : W.preventDefault())); } } function te(W) { if (H) { if (F(W) === 0) { Fe({}); return; } if (!(W.clientX !== void 0 && Math.abs(W.clientX - $) <= (Z.slideFactorX || 0) && W.clientY !== void 0 && Math.abs(W.clientY - V) <= (Z.slideFactorY || 0))) { if (Z.ignoreInputTextSelection) { var ee = E("clientX", W) || 0, oe = E("clientY", W) || 0, ne = u.elementFromPoint(ee, oe); if (C(ne)) return; } var _e = H; Ve(!0), je(), ht(), lt(_e), l.add(B || z, "gu-transit"), Ft(), Nt(), K = 0, vt(W); } } } function xe(W) { if (!(fe.dragging && O) && !be(W)) { for (var ee = W; k(W) && be(k(W)) === !1; ) if (Z.invalid(W, ee) || (W = k(W), !W)) return; var oe = k(W); if (oe && !Z.invalid(W, ee)) { var ne = Z.moves(W, oe, ee, w(W)); if (ne) return { item: W, source: oe }; } } } function Oe(W) { return !!xe(W); } function Be(W) { var ee = xe(W); ee && lt(ee); } function lt(W) { Ie(W.item, W.source) && (B = W.item.cloneNode(!0), fe.emit("cloned", B, W.item, "copy")), I = W.source, z = W.item, j = Q = w(W.item), fe.dragging = !0, fe.emit("drag", z, I); } function Ct() { return !1; } function ht() { if (fe.dragging) { var W = B || z; Ne(W, k(W)); } } function J() { H = !1, Ve(!0), je(!0); } function Fe(W) { if (J(), !!fe.dragging) { var ee = B || z, oe = E("clientX", W) || 0, ne = E("clientY", W) || 0, _e = y(O, oe, ne), Ce = Tt(_e, oe, ne); Ce && (B && Z.copySortSource || !B || Ce !== I) ? Ne(ee, Ce) : Z.removeOnSpill ? Ye() : We(); } } function Ne(W, ee) { var oe = k(W); B && Z.copySortSource && ee === I && oe.removeChild(z), xt(ee) ? fe.emit("cancel", W, I) : fe.emit("drop", W, ee, I, Q), dt(); } function Ye() { if (fe.dragging) { var W = B || z, ee = k(W); ee && ee.removeChild(W), fe.emit(B ? "cancel" : "remove", W, ee, I), dt(); } } function We(W) { if (fe.dragging) { var ee = arguments.length > 0 ? W : Z.revertOnSpill, oe = B || z, ne = k(oe), _e = xt(ne); _e === !1 && ee && (B ? ne && ne.removeChild(B) : I.insertBefore(oe, j)), _e || ee ? fe.emit("cancel", oe, I, I) : fe.emit("drop", oe, ne, I, Q), dt(); } } function dt() { var W = B || z; J(), re(), pe(), W && l.rm(W, "gu-transit"), D && clearTimeout(D), fe.dragging = !1, Y && fe.emit("out", W, Y, I), fe.emit("dragend", W, K), I = z = B = j = Q = D = Y = null; } function xt(W, ee) { var oe; return ee !== void 0 ? oe = ee : O ? oe = Q : oe = w(B || z), W === I && oe === j; } function Tt(W, ee, oe) { for (var ne = W; ne && !_e(); ) ne = k(ne); return ne; function _e() { var Ce = be(ne); if (Ce === !1) return !1; var Le = we(ne, W), Ee = Se(ne, Le, ee, oe), He = xt(ne, Ee); return He ? !0 : Z.accepts(z, ne, I, Ee); } } function vt(W) { if (!O) return; W.preventDefault(); var ee = E("clientX", W) || 0, oe = E("clientY", W) || 0; O.style.left = ee - 2 + "px", O.style.top = oe - 2 + "px"; var ne = B || z, _e = y(O, ee, oe), Ce = Tt(_e, ee, oe), Le = Ce !== null && Ce !== Y; (Le || Ce === null) && (ge(), Y = Ce, ft()), me(_e, oe); var Ee = k(ne); if (Ce === I && B && !Z.copySortSource) { Ee && Ee.removeChild(ne); return; } var He, ct = we(Ce, _e); if (G = Re(ct, Ce), ct !== null) He = Se(Ce, ct, ee, oe); else if (Z.revertOnSpill === !0 && !B) He = j, Ce = I; else { B && Ee && Ee.removeChild(ne), B && L && (L.style.display = "none"); return; } L.style.display = "block", Pt(He, ne, Le), He ? ot(ct, He) : X(Ce); function Ke(Te) { fe.emit(Te, ne, Y, I); } function ft() { Le && Ke("over"); } function ge() { Y && Ke("out"); } } function Pt(W, ee, oe) { (W === ee || W === w(ee)) && (Q = w(ee)), (W === null && oe || W !== ee && W !== w(ee)) && (Q = W); } function kt(W) { l.rm(W, "gu-hide"); } function _t(W) { fe.dragging && l.add(W, "gu-hide"); } function Nt() { O || (O = document.createElement("div"), O.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;", O.innerHTML = Z.getMirrorText && Z.getMirrorText(z) || "控件", l.add(O, "gu-mirror"), Z.mirrorContainer.appendChild(O), f(d, "add", "mousemove", vt), l.add(Z.mirrorContainer, "gu-unselectable"), fe.emit("cloned", O, z, "mirror")); } function Ft() { if (L = document.createElement("div"), l.add(L, "gu-insertion"), z) { var W = z.getBoundingClientRect(); L.style.left = W.left + "px", L.style.top = W.top + "px"; } G = !1, Z.mirrorContainer.appendChild(L); } function re() { O && (l.rm(Z.mirrorContainer, "gu-unselectable"), f(d, "remove", "mousemove", vt), k(O).removeChild(O), O = null); } function pe() { L && (k(L).removeChild(L), L = null); } function we(W, ee) { for (var oe = ee; oe !== W && k(oe) !== W; ) oe = k(oe); return oe === d ? null : oe; } function Re(W, ee) { if (!ee) return G; var oe = W || ee && ee.lastElementChild; if (!oe) return !0; var ne = getComputedStyle(W), _e = /^inline/.test(ne.getPropertyValue("display")) || /^(left|right)$/.test(ne.getPropertyValue("float")); if (_e) return !0; if (ee) { var Ce = getComputedStyle(ee), Le = Ce.getPropertyValue("display"); if (/flex$/.test(Le)) { var Ee = Ce.getPropertyValue("flex-direction") || "row"; if (Ee === "row" || Ee === "row-reverse") return !Ue(ee); } return !1; } return !0; } function Ue(W) { if (!W.children || !W.children.length) return !1; for (const ee of Array.from(W.children)) { const ne = (ee.className && ee.className.split(" ") || []).filter((_e) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(_e)); if (!ne.length) return !1; for (const _e of ne) { const Ce = _e.slice(_e.lastIndexOf("-") + 1); if (parseInt(Ce, 10) !== 12) return !1; } } return !0; } function ot(W, ee) { const oe = ee.getBoundingClientRect(); if (L.style.left = oe.left + "px", L.style.top = oe.top + "px", G) { if (L.style.height = oe.height + "px", L.style.width = "4px", W) { const ne = W.getBoundingClientRect(); ne.top !== oe.top && (L.style.left = ne.right + "px", L.style.top = ne.top + "px", L.style.height = ne.height + "px"); } } else if (L.style.height = "4px", L.style.width = oe.width + "px", ae) { const ne = ae.getBoundingClientRect(); oe.top < ne.top && (L.style.display = "none"); } ee === z && z && (L.style.display = "none"); } function X(W) { Q = null; var ee = W.lastElementChild; if (ee) { var oe = ee.getBoundingClientRect(); G ? (L.style.left = oe.right + "px", L.style.top = oe.top + "px", L.style.height = oe.height + "px", L.style.width = "4px") : (L.style.left = oe.left + "px", L.style.top = oe.bottom + "px", L.style.height = "4px", L.style.width = oe.width + "px"), ee === z && z && (L.style.display = "none"); } else L.style.display = "none"; } function me(W, ee) { if (!Z.mirrorContainer.contains(W) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (ae = p(W), !ae || !ae.contains(W))) return; const oe = document.querySelector(".dgComponentSelected"), ne = ae.getBoundingClientRect(); if (ee - 30 < ne.top && ae.scrollTop > 0) { let _e = ae.scrollTop < 10 ? ae.scrollTop : 10; ae.scrollBy(0, -1 * _e), oe && ae.contains(oe) && (K = K + -1 * _e); } if (ee + 30 > ne.bottom && ae.scrollTop < ae.scrollHeight - ae.clientHeight) { const _e = ae.scrollHeight - ae.clientHeight - ae.scrollTop; let Ce = _e < 10 ? _e : 10; ae.scrollBy(0, Ce), oe && ae.contains(oe) && (K = K + Ce); } } function Se(W, ee, oe, ne) { var _e = Z.direction === "horizontal", Ce = Z.direction === "mixed", Le = ee !== W ? He() : Ee(); return Le; function Ee() { var Ke = W.children.length, ft, ge, Te; for (ft = 0; ft < Ke; ft++) if (ge = W.children[ft], Te = ge.getBoundingClientRect(), _e && Te.left + Te.width / 2 > oe || !Ce && !_e && Te.top + Te.height / 2 > ne || Ce && Te.left + Te.width > oe && Te.top + Te.height > ne) return ge; return null; } function He() { var Ke = ee.getBoundingClientRect(); if (Ce) { var ft = ne - Ke.top, ge = oe - Ke.left, Te = Ke.bottom - ne, rt = Ke.right - oe, et = Math.min(ge, rt, ft, Te), it; return G ? it = rt < ge : it = Te === et || rt === et || ge === et, ct(it); } return ct(_e ? oe > Ke.left + v(Ke) / 2 : ne > Ke.top + x(Ke) / 2); } function ct(Ke) { return Ke ? w(ee) : ee; } } function Ie(W, ee) { return typeof Z.copy == "boolean" ? Z.copy : Z.copy(W, ee); } } function p(b) { const P = Array.from(window.scrollContainerList); if (P.length === 1) { const O = Array.from(window.scrollContainerList)[0]; return document.getElementById(O); } const N = h(P); for (const O of N) if (O.contains(b)) return O; return null; } function h(b) { const P = []; return b.forEach((N) => { const O = document.getElementById(N); O && P.push(O); }), P.sort((N, O) => N.contains(O) ? 1 : O.contains(N) ? -1 : 0), P; } function f(b, P, N, O) { var I = { mouseup: "touchend", mousedown: "touchstart", mousemove: "touchmove" }, z = { mouseup: "pointerup", mousedown: "pointerdown", mousemove: "pointermove" }, $ = { mouseup: "MSPointerUp", mousedown: "MSPointerDown", mousemove: "MSPointerMove" }; i.navigator.pointerEnabled ? s[P](b, z[N], O) : i.navigator.msPointerEnabled ? s[P](b, $[N], O) : (s[P](b, I[N], O), s[P](b, N, O)); } function F(b) { if (b.touches !== void 0) return b.touches.length; if (b.which !== void 0 && b.which !== 0) return b.which; if (b.buttons !== void 0) return b.buttons; var P = b.button; if (P !== void 0) return P & 1 ? 1 : P & 2 ? 3 : P & 4 ? 2 : 0; } function y(b, P, N) { b = b || {}; var O = b.className || "", I; return b.className += " gu-hide", I = u.elementFromPoint(P, N), b.className = O, I; } function g() { return !1; } function _() { return !0; } function v(b) { return b.width || b.right - b.left; } function x(b) { return b.height || b.bottom - b.top; } function k(b) { return b.parentNode === u ? null : b.parentNode; } function C(b) { return b.tagName === "INPUT" || b.tagName === "TEXTAREA" || b.tagName === "SELECT" || c(b); } function c(b) { return !b || b.contentEditable === "false" ? !1 : b.contentEditable === "true" ? !0 : c(k(b)); } function w(b) { return b.nextElementSibling || P(); function P() { var N = b; do N = N.nextSibling; while (N && N.nodeType !== 1); return N; } } function S(b) { return b.targetTouches && b.targetTouches.length ? b.targetTouches[0] : b.changedTouches && b.changedTouches.length ? b.changedTouches[0] : b; } function E(b, P) { var N = S(P), O = { pageX: "clientX", // IE8 pageY: "clientY" // IE8 }; return b in O && !(b in N) && O[b] in N && (b = O[b]), N[b]; } o.exports = m; }).call(this, typeof Et < "u" ? Et : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }], 3: [function(e, o, r) { o.exports = function(a, s) { return Array.prototype.slice.call(a, s); }; }, {}], 4: [function(e, o, r) { var i = e("ticky"); o.exports = function(s, l, u) { s && i(function() { s.apply(u || null, l || []); }); }; }, { ticky: 10 }], 5: [function(e, o, r) { var i = e("atoa"), a = e("./debounce"); o.exports = function(l, u) { var d = u || {}, m = {}; return l === void 0 && (l = {}), l.on = function(p, h) { return m[p] ? m[p].push(h) : m[p] = [h], l; }, l.once = function(p, h) { return h._once = !0, l.on(p, h), l; }, l.off = function(p, h) { var f = arguments.length; if (f === 1) delete m[p]; else if (f === 0) m = {}; else { var F = m[p]; if (!F) return l; F.splice(F.indexOf(h), 1); } return l; }, l.emit = function() { var p = i(arguments); return l.emitterSnapshot(p.shift()).apply(this, p); }, l.emitterSnapshot = function(p) { var h = (m[p] || []).slice(0); return function() { var f = i(arguments), F = this || l; if (p === "error" && d.throws !== !1 && !h.length) throw f.length === 1 ? f[0] : f; return h.forEach(function(g) { d.async ? a(g, f, F) : g.apply(F, f), g._once && l.off(p, g); }), l; }; }, l; }; }, { "./debounce": 4, atoa: 3 }], 6: [function(e, o, r) { (function(i) { var a = e("custom-event"), s = e("./eventmap"), l = i.document, u = p, d = f, m = []; i.addEventListener || (u = h, d = F), o.exports = { add: u, remove: d, fabricate: y }; function p(k, C, c, w) { return k.addEventListener(C, c, w); } function h(k, C, c) { return k.attachEvent("on" + C, _(k, C, c)); } function f(k, C, c, w) { return k.removeEventListener(C, c, w); } function F(k, C, c) { var w = v(k, C, c); if (w) return k.detachEvent("on" + C, w); } function y(k, C, c) { var w = s.indexOf(C) === -1 ? E() : S(); k.dispatchEvent ? k.dispatchEvent(w) : k.fireEvent("on" + C, w); function S() { var b; return l.createEvent ? (b = l.createEvent("Event"), b.initEvent(C, !0, !0)) : l.createEventObject && (b = l.createEventObject()), b; } function E() { return new a(C, { detail: c }); } } function g(k, C, c) { return function(S) { var E = S || i.event; E.target = E.target || E.srcElement, E.preventDefault = E.preventDefault || function() { E.returnValue = !1; }, E.stopPropagation = E.stopPropagation || function() { E.cancelBubble = !0; }, E.which = E.which || E.keyCode, c.call(k, E); }; } function _(k, C, c) { var w = v(k, C, c) || g(k, C, c); return m.push({ wrapper: w, element: k, type: C, fn: c }), w; } function v(k, C, c) { var w = x(k, C, c); if (w) { var S = m[w].wrapper; return m.splice(w, 1), S; } } function x(k, C, c) { var w, S; for (w = 0; w < m.length; w++) if (S = m[w], S.element === k && S.type === C && S.fn === c) return w; } }).call(this, typeof Et < "u" ? Et : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./eventmap": 7, "custom-event": 8 }], 7: [function(e, o, r) { (function(i) { var a = [], s = "", l = /^on/; for (s in i) l.test(s) && a.push(s.slice(2)); o.exports = a; }).call(this, typeof Et < "u" ? Et : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 8: [function(e, o, r) { (function(i) { var a = i.CustomEvent; function s() { try { var l = new a("cat", { detail: { foo: "bar" } }); return l.type === "cat" && l.detail.foo === "bar"; } catch { } return !1; } o.exports = s() ? a : ( // IE >= 9 typeof document < "u" && typeof document.createEvent == "function" ? function(u, d) { var m = document.createEvent("CustomEvent"); return d ? m.initCustomEvent(u, d.bubbles, d.cancelable, d.detail) : m.initCustomEvent(u, !1, !1, void 0), m; } : ( // IE <= 8 function(u, d) { var m = document.createEventObject(); return m.type = u, d ? (m.bubbles = !!d.bubbles, m.cancelable = !!d.cancelable, m.detail = d.detail) : (m.bubbles = !1, m.cancelable = !1, m.detail = void 0), m; } ) ); }).call(this, typeof Et < "u" ? Et : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 9: [function(e, o, r) { var i = o.exports = {}, a, s; function l() { throw new Error("setTimeout has not been defined"); } function u() { throw new Error("clearTimeout has not been defined"); } (function() { try { typeof setTimeout == "function" ? a = setTimeout : a = l; } catch { a = l; } try { typeof clearTimeout == "function" ? s = clearTimeout : s = u; } catch { s = u; } })(); function d(x) { if (a === setTimeout) return setTimeout(x, 0); if ((a === l || !a) && setTimeout) return a = setTimeout, setTimeout(x, 0); try { return a(x, 0); } catch { try { return a.call(null, x, 0); } catch { return a.call(this, x, 0); } } } function m(x) { if (s === clearTimeout) return clearTimeout(x); if ((s === u || !s) && clearTimeout) return s = clearTimeout, clearTimeout(x); try { return s(x); } catch { try { return s.call(null, x); } catch { return s.call(this, x); } } } var p = [], h = !1, f, F = -1; function y() { !h || !f || (h = !1, f.length ? p = f.concat(p) : F = -1, p.length && g()); } function g() { if (!h) { var x = d(y); h = !0; for (var k = p.length; k; ) { for (f = p, p = []; ++F < k; ) f && f[F].run(); F = -1, k = p.length; } f = null, h = !1, m(x); } } i.nextTick = function(x) { var k = new Array(arguments.length - 1); if (arguments.length > 1) for (var C = 1; C < arguments.length; C++) k[C - 1] = arguments[C]; p.push(new _(x, k)), p.length === 1 && !h && d(g); }; function _(x, k) { this.fun = x, this.array = k; } _.prototype.run = function() { this.fun.apply(null, this.array); }, i.title = "browser", i.browser = !0, i.env = {}, i.argv = [], i.version = "", i.versions = {}; function v() { } i.on = v, i.addListener = v, i.once = v, i.off = v, i.removeListener = v, i.removeAllListeners = v, i.emit = v, i.prependListener = v, i.prependOnceListener = v, i.listeners = function(x) { return []; }, i.binding = function(x) { throw new Error("process.binding is not supported"); }, i.cwd = function() { return "/"; }, i.chdir = function(x) { throw new Error("process.chdir is not supported"); }, i.umask = function() { return 0; }; }, {}], 10: [function(e, o, r) { (function(i) { var a = typeof i == "function", s; a ? s = function(l) { i(l); } : s = function(l) { setTimeout(l, 0); }, o.exports = s; }).call(this, e("timers").setImmediate); }, { timers: 11 }], 11: [function(e, o, r) { (function(i, a) { var s = e("process/browser.js").nextTick, l = Function.prototype.apply, u = Array.prototype.slice, d = {}, m = 0; r.setTimeout = function() { return new p(l.call(setTimeout, window, arguments), clearTimeout); }, r.setInterval = function() { return new p(l.call(setInterval, window, arguments), clearInterval); }, r.clearTimeout = r.clearInterval = function(h) { h.close(); }; function p(h, f) { this._id = h, this._clearFn = f; } p.prototype.unref = p.prototype.ref = function() { }, p.prototype.close = function() { this._clearFn.call(window, this._id); }, r.enroll = function(h, f) { clearTimeout(h._idleTimeoutId), h._idleTimeout = f; }, r.unenroll = function(h) { clearTimeout(h._idleTimeoutId), h._idleTimeout = -1; }, r._unrefActive = r.active = function(h) { clearTimeout(h._idleTimeoutId); var f = h._idleTimeout; f >= 0 && (h._idleTimeoutId = setTimeout(function() { h._onTimeout && h._onTimeout(); }, f)); }, r.setImmediate = typeof i == "function" ? i : function(h) { var f = m++, F = arguments.length < 2 ? !1 : u.call(arguments, 1); return d[f] = !0, s(function() { d[f] && (F ? h.apply(null, F) : h.call(null), r.clearImmediate(f)); }), f; }, r.clearImmediate = typeof a == "function" ? a : function(h) { delete d[h]; }; }).call(this, e("timers").setImmediate, e("timers").clearImmediate); }, { "process/browser.js": 9, timers: 11 }] }, {}, [2])(2); }); })(ir); var wa = ir.exports; const Hn = /* @__PURE__ */ ba(wa), Ca = { 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 } }, xa = { showCloseButton: { type: Boolean, default: !0 }, animate: { type: String, default: "fadeIn" }, options: { type: Object } }, _n = /* @__PURE__ */ nt({ name: "Toast", props: xa, emits: ["close", "click"], setup: (n, t) => { const e = T(n.animate), o = "fadeOut", r = A(() => n.options), i = T(!1), a = A(() => { const g = { animated: i.value, toast: !0 }; return g[n.animate] = !1, g[o] = i.value, g[r.value.type] = !0, r.value.theme && (g[r.value.theme] = !0), g; }), s = A(() => { const v = `f-icon-${r.value && r.value.type ? r.value.type.replace("toasty-type-", "") : "default"}`, x = { "f-icon": !0 }; return x[v] = !0, x; }), l = A(() => r.value.title || r.value.message), u = A(() => r.value.title && r.value.message), d = A(() => !r.value.title && r.value.message), m = A(() => n.showCloseButton), p = A(() => !!r.value.buttons || !!t.slots.default); function h(g) { g.stopPropagation(), g.preventDefault(), i.value = !1, setTimeout(() => { t.emit("close", r.value); }, 200); } function f(g, _) { } function F(g) { return `f-preten-link ${g.customClass ? g.customClass : ""}`; } Me(e, () => { e.value; }); const y = () => { var g; return M(Ht, null, [M("div", { class: "after-toast-msg text-right" }, [!t.slots.default && ((g = r.value.buttons) == null ? void 0 : g.map((_) => M("span", { class: F(_), onClick: (v) => void 0 }, [_.text]))), t.slots.default && t.slots.default()])]); }; return () => M("div", { class: a.value, style: "min-height:44px" }, [m.value && M("button", { title: "关闭", class: "toast-close f-btn-icon f-bare", onClick: h }, [M("span", { class: "f-icon modal_close" }, null)]), l.value && M("section", { class: "modal-tips" }, [M("div", { class: "float-left modal-tips-iconwrap" }, [M("span", { class: s.value }, null)]), M("div", { class: "modal-tips-content" }, [u.value && M(Ht, null, [M("h5", { class: "toast-title modal-tips-title", innerHTML: r.value.title }, null), M("p", { class: "toast-msg", innerHTML: r.value.message }, null), p.value && y()]), d.value && (r.value.buttons ? M("div", { class: "toast-title-btns-wrapper d-flex" }, [M("h5", { class: "toast-title modal-tips-title only-toast-msg", innerHTML: r.value.message }, null), M("div", { class: "after-toast-title text-right ml-auto" }, [y()])]) : M("h5", { class: "toast-title modal-tips-title only-toast-msg", innerHTML: r.value.message }, null))])])]); } }), sn = /* @__PURE__ */ nt({ name: "Notify", props: Ca, emits: ["close", "empty"], setup(n, t) { const e = A(() => ({ "farris-notify": !0 })), o = { left: 12, right: 12, top: 20, bottom: 12 }, r = T(), i = T(n.options), a = T(n.showCloseButton), s = A(() => n.position || "bottom-right"), l = A(() => n.timeout != null ? n.timeout : 3e3), u = A(() => { const p = n.bottom ? n.bottom : o.bottom, h = n.top ? n.top : o.top, f = { transition: "all 0.2s ease", left: s.value.indexOf("left") > -1 ? `${n.left ? n.left : o.left}px` : "", right: s.value.indexOf("right") > -1 ? `${n.right ? n.right : o.right}px` : "", top: s.value.indexOf("top") > -1 ? `${h}px` : "", bottom: s.value.indexOf("bottom") > -1 ? `${p}px` : "" }; return s.value.indexOf("center") > -1 && (f.left = "50%", f.marginLeft = "calc(-24rem / 2)", s.value === "center-center" && (f.top = "50%", f.transform = "translate(-50%, -50%)")), f; }); function d(p) { t.emit("close"); } l.value && setTimeout(() => { d(); }, l.value), t.expose({ closeToast: d, container: r, notifyPosition: s }); function m(p, h) { d(); } return () => M("div", { class: e.value, style: u.value, ref: r }, [M(_n, { options: i.value, showCloseButton: a.value, animate: n.animate, onClose: (p) => m(p, i.value) }, null)]); } }); class tn { constructor() { R(this, "notifyRefs", []); R(this, "globalConfig", St({})); } escapeAllHtml(t) { if (typeof t != "string" || !t) return ""; const e = document.createElement("div"); return e.textContent = t || "", e.innerHTML.replace(/ /g, "&nbsp;").replace(/\\n/g, "<br>").replace(/\\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g, ""); } createNotifyInstance(t) { const e = this, r = Object.assign({ timeout: 3e3, position: "bottom-right", showCloseButton: !0, safeHtml: !0 }, this.globalConfig, { ...t }), i = document.createElement("div"); i.style.display = "contents"; const a = Jn({ setup() { var u; const s = T(); function l() { s.value.container.style.transform = "scale(0)", setTimeout(() => { e.updateNotifyPositionForClose(r, s), a.unmount(); }, 220); } if (r.position.indexOf("top") > -1) { const d = e.getNotifyInstances(r.position), m = d[d.length - 1]; if (m) { const p = m.value.container.getBoundingClientRect(); r.top = p.bottom; } } return r.safeHtml && ((u = r.options) != null && u.message) && (r.options.message = e.escapeAllHtml(r.options.message)), en(() => { document.body.removeChild(i); }), It(() => { e.updateNotifyPositionForCreate(r, s); }), () => M(Zn, { mode: "out-in", name: "fade", appear: !0 }, { default: () => [M(sn, jt({ ref: s }, r, { onClose: l }), null)] }); } }); return a.provide("NotifyService", this), document.body.appendChild(i), a.mount(i), a; } getNotifyInstances(t) { return this.notifyRefs.filter((e) => e.value.notifyPosition === t); } updateNotifyPositionForCreate(t, e) { if (this.notifyRefs && this.notifyRefs.length) { const o = window.innerHeight; t.position.indexOf("bottom") > -1 && this.getNotifyInstances(t.position).forEach((r) => { const i = r.value.container.getBoundingClientRect(); r.value.container.style.bottom = i.height + o - i.bottom + "px"; }); } this.notifyRefs = [...this.notifyRefs, e]; } updateNotifyPositionForClose(t, e) { const o = this.notifyRefs.indexOf(e); if (t.position.indexOf("top") > -1) { const r = this.getNotifyInstances(t.position), i = r.indexOf(e); r.slice(i + 1).forEach((a) => { a.value.container.style.top = a.value.container.offsetTop - a.value.container.offsetHeight + "px"; }); } o > -1 && this.notifyRefs.splice(o, 1); } show(t) { return this.createNotifyInstance(t); } buildNotifyProps(t, e) { let o = "", r = "", i, a, s; typeof e == "string" ? o = e : e && (o = e.message || "", r = e.title || "", a = e.position || null, s = e.showCloseButton != null ? e.showCloseButton : null, i = e.timeout != null ? e.timeout : null); const u = { options: { type: t, message: o, title: r } }; return a != null && (u.position = a), s != null && (u.showCloseButton = s), i != null && (u.timeout = i), u; } info(t) { const e = this.buildNotifyProps("info", t); return this.show(e); } success(t) { const e = this.buildNotifyProps("success", t); return this.show(e); } warning(t) { const e = this.buildNotifyProps("warning", t); return this.show(e); } error(t) { const e = this.buildNotifyProps("error", t); return this.show(e); } close(t) { t && t.unmount(); } closeAll() { this.notifyRefs.forEach((t) => { t == null || t.value.closeToast(); }), this.notifyRefs.length = 0; } } const _a = Symbol("NOTIFY_SERVICE_TOKEN"); sn.install = (n) => { n.component(sn.name, sn), n.component(_n.name, _n); const t = new tn(); n.provide(_a, t), n.provide("FNotifyService", t); }; const Sa = { designerHostService: { type: Object, default: {} }, /** 预设的控件类型 */ componentType: { type: String, default: "" }, /** 预设绑定的实体id */ bindingEntityId: { type: String, default: "" }, /** 绑定步骤 */ steps: { type: Array, default: ["selectEntity", "selectFields"] } }, ar = {}, sr = {}; function Fn(n) { const { properties: t, title: e, ignore: o } = n, r = o && Array.isArray(o), i = Object.keys(t).reduce((a, s) => ((!r || !o.find((l) => l === s)) && (a[s] = t[s].type === "object" && t[s].properties ? Fn(t[s]) : wt(t[s].default)), a), {}); if (e && (!r || !o.find((a) => a === "id"))) { const a = e.toLowerCase().replace(/-/g, "_"); i.id = `${a}_${Math.random().toString().slice(2, 6)}`; } return i; } function Ta(n) { const { properties: t, title: e, required: o } = n; if (o && Array.isArray(o)) { const r = o.reduce((i, a) => (i[a] = t[a].type === "object" && t[a].properties ? Fn(t[a]) : wt(t[a].default), i), {}); if (e && o.find((i) => i === "id")) { const i = e.toLowerCase().replace(/-/g, "_"); r.id = `${i}_${Math.random().toString().slice(2, 6)}`; } return r; } return { type: e }; } function En(n, t = {}, e) { const o = ar[n]; if (o) { let r = Ta(o); const i = sr[n]; return r = i ? i({ getSchemaByType: En }, r, t, e) : r, r; } return null; } function ka(n, t) { const e = Fn(t); return Object.keys(e).reduce((o, r) => (Object.prototype.hasOwnProperty.call(n, r) && (o[r] && Rn(o[r]) && Rn(n[r] || !n[r]) ? Object.assign(o[r], n[r] || {}) : o[r] = n[r]), o), e), e; } function lr(n, t) { return Object.keys(n).filter((o) => n[o] != null).reduce((o, r) => { if (t.has(r)) { const i = t.get(r); if (typeof i == "string") o[i] = n[r]; else { const a = i(r, n[r], n); Object.assign(o, a); } } else o[r] = n[r]; return o; }, {}); } function Fa(n, t, e = /* @__PURE__ */ new Map()) { const o = ka(n, t); return lr(o, e); } function Ea(n = {}) { function t(u, d, m, p) { if (typeof m == "number") return p[u].length === m; if (typeof m == "object") { const h = Object.keys(m)[0], f = m[h]; if (h === "not") return Number(p[u].length) !== Number(f); if (h === "moreThan") return Number(p[u].length) >= Number(f); if (h === "lessThan") return Number(p[u].length) <= Number(f); } return !1; } function e(u, d, m, p) { return p[u] && p[u].propertyValue && String(p[u].propertyValue.value) === String(m); } const o = /* @__PURE__ */ new Map([ ["length", t], ["getProperty", e] ]); Object.keys(n).reduce((u, d) => (u.set(d, n[d]), u), o); function r(u, d) { const m = u; return typeof d == "number" ? [{ target: m, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: m, operator: "getProperty", param: u, value: !!d }] : typeof d == "object" ? Object.keys(d).map((p) => { if (p === "length") return { target: m, operator: "length", param: null, value: d[p] }; const h = p, f = d[p]; return { target: m, operator: "getProperty", param: h, value: f }; }) : []; } function i(u) { return Object.keys(u).reduce((m, p) => { const h = r(p, u[p]); return m.push(...h), m; }, []); } function a(u, d) { if (o.has(u.operator)) { const m = o.get(u.operator); return m && m(u.target, u.param