UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,312 lines 221 kB
var rr = Object.defineProperty; var ar = (e, t, n) => t in e ? rr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var Be = (e, t, n) => ar(e, typeof t != "symbol" ? t + "" : t, n); import { ref as g, defineComponent as xe, computed as _, watch as ve, createVNode as h, Fragment as lt, reactive as Ye, createApp as hn, onUnmounted as St, onMounted as Re, Transition as yn, mergeProps as rt, nextTick as Qt, createTextVNode as Ie, inject as me, onBeforeMount as bn, Teleport as ir, shallowRef as lr, render as Gt, h as sr, cloneVNode as cr, provide as bt, triggerRef as ur, onBeforeUnmount as Cn, isVNode as dr, withModifiers as fr } from "vue"; import { isUndefined as Ge, cloneDeep as wt, isPlainObject as sn, merge as xt, findIndex as cn } from "lodash-es"; import { useI18n as Zt } from "vue-i18n"; import { LocaleService as Ot } from "../locale/index.esm.js"; import { getCustomClass as dt, withInstall as pr, FormSchemaEntityField$Type as un, FormSchemaEntityFieldTypeName as dn } from "../common/index.esm.js"; import { useResizeObserver as mr } from "@vueuse/core"; import { getHierarchyRow as vr, useIdentify as gr, useGroupData as hr, useFilter as yr, useHierarchy as br, useLoading as Cr, useDataView as wr, useSelection as Sr, useSelectHierarchyItem as Tr, usePagination as Fr, useDataViewContainerStyle as xr, useCommandColumn as Dr, useSettingColumn as Br, useColumn as kr, useSort as Mr, useGroupColumn as Er, useRow as Ir, useEdit as Or, useVisualDataBound as Nr, useVisualDataCell as Pr, useVisualDataRow as jr, useVisualData as Lr, useCellPosition as Vr, useSidebar as $r, useVirtualScroll as Rr, useFitColumn as Ar, useFilterHistory as zr, useColumnFilter as Hr, useDragColumn as _r, getColumnHeader as qr, getSidebar as Ur, getDisableMask as Gr, getHorizontalScrollbar as Wr, getVerticalScrollbar as Yr, getEmpty as Xr, getPagination as Jr, getSummary as Qr } from "../data-view/index.esm.js"; import { getSchemaByTypeForDesigner as wn, schemaMapForDesigner as Zr, propertyConfigSchemaMapForDesigner as Kr, propertyEffectMapForDesigner as ea, schemaResolverMapForDesigner as ta, createPropsResolver as Sn, resolveAppearance as na } from "../dynamic-resolver/index.esm.js"; import "../designer-canvas/index.esm.js"; import "../property-panel/index.esm.js"; import Tn from "../accordion/index.esm.js"; import Fn from "../avatar/index.esm.js"; import xn from "../../designer/button-edit/index.esm.js"; import Dn from "../button-group/index.esm.js"; import Bn from "../calendar/index.esm.js"; import kn from "../capsule/index.esm.js"; import Wt from "../../designer/checkbox/index.esm.js"; import Mt from "../../designer/checkbox-group/index.esm.js"; import Mn from "../combo-list/index.esm.js"; import oa from "../combo-tree/index.esm.js"; import En from "../component/index.esm.js"; import In from "../color-picker/index.esm.js"; import On from "../content-container/index.esm.js"; import Nn from "../date-picker/index.esm.js"; import Pn from "../../designer/data-grid/index.esm.js"; import jn from "../dropdown/index.esm.js"; import Ln from "../dynamic-form/index.esm.js"; import ra from "../events-editor/index.esm.js"; import Vn from "../filter-bar/index.esm.js"; import aa from "../field-selector/index.esm.js"; import ia, { FBindingSelectorContainer as la } from "../binding-selector/index.esm.js"; import $n from "../image-cropper/index.esm.js"; import Rn from "../../designer/input-group/index.esm.js"; import An from "../layout/index.esm.js"; import zn from "../list-nav/index.esm.js"; import Hn from "../../designer/list-view/index.esm.js"; import _n from "../lookup/index.esm.js"; import sa from "../mapping-editor/index.esm.js"; import qn from "../nav/index.esm.js"; import Un from "../number-range/index.esm.js"; import Gn from "../number-spinner/index.esm.js"; import Wn from "../order/index.esm.js"; import Yn from "../page-header/index.esm.js"; import Xn from "../page-footer/index.esm.js"; import Jn from "../pagination/index.esm.js"; import Qn from "../progress/index.esm.js"; import Zn from "../query-solution/index.esm.js"; import Kn from "../../designer/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 "../search-box/index.esm.js"; import ao from "../section/index.esm.js"; import io from "../smoke-detector/index.esm.js"; import lo from "../splitter/index.esm.js"; import so from "../step/index.esm.js"; import co from "../switch/index.esm.js"; import uo from "../tabs/index.esm.js"; import fo from "../tags/index.esm.js"; import po from "../text/index.esm.js"; import mo from "../time-picker/index.esm.js"; import vo from "../transfer/index.esm.js"; import go from "../tree-view/index.esm.js"; import ho from "../uploader/index.esm.js"; import yo from "../verify-detail/index.esm.js"; import bo from "../video/index.esm.js"; import Co from "../textarea/index.esm.js"; import ca from "../schema-selector/index.esm.js"; import wo from "../../designer/tree-grid/index.esm.js"; import ua from "../event-parameter/index.esm.js"; import da from "../filter-condition-editor/index.esm.js"; import So from "../fieldset/index.esm.js"; import fa from "../sort-condition-editor/index.esm.js"; import pa from "../menu-lookup/index.esm.js"; import To from "../../designer/drawer/index.esm.js"; import ma from "../json-editor/index.esm.js"; import va from "../property-editor/index.esm.js"; import ga from "../expression-editor/index.esm.js"; import ha from "../code-editor/index.esm.js"; import Fo from "../html-template/index.esm.js"; import ya from "../collection-property-editor/index.esm.js"; import ba from "../modal/index.esm.js"; import xo from "../external-container/index.esm.js"; import Do from "../language-textbox/index.esm.js"; import { FNotifyService as Ca } from "../notify/index.esm.js"; const Xe = g(0); function wa() { Xe.value++; } function Sa(e, t) { const n = t.getBoundingClientRect(), o = e.getBoundingClientRect(), r = o.top >= n.top, l = o.top <= n.bottom; return r && l; } function Ta(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 r = o.getBoundingClientRect(); o.style.top = n.top + "px"; let l = n.left - r.width; const a = document.querySelector(".editorDiv"); if (a) { const f = a.getBoundingClientRect(); l < f.left && ({ left: l } = e.getBoundingClientRect()); } o.style.left = l + "px"; } } } function Fa(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 Kt(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 r = Fa(e); if (r && (o = Sa(e, r)), !o) { n.style.display = "none"; return; } Ta(e); } } function Ct(e) { if (!e) return; let t; e.className.includes("dgComponentSelected") ? t = e : t = e.querySelector(".dgComponentSelected"), t && Kt(t); } const xa = { /** * 组件值 */ modelValue: { type: Object, default: {} }, componentId: { type: String, default: "" }, components: { type: Array }, canvasMode: { type: String, default: "PC" } }; var We = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Da(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } function Dt(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 Bo = { exports: {} }; (function(e, t) { (function(n) { e.exports = n(); })(function() { return (/* @__PURE__ */ function() { function n(o, r, l) { function a(u, v) { if (!r[u]) { if (!o[u]) { var c = typeof Dt == "function" && Dt; if (!v && c) return c(u, !0); if (f) return f(u, !0); var C = new Error("Cannot find module '" + u + "'"); throw C.code = "MODULE_NOT_FOUND", C; } var i = r[u] = { exports: {} }; o[u][0].call(i.exports, function(s) { var d = o[u][1][s]; return a(d || s); }, i, i.exports, n, o, r, l); } return r[u].exports; } for (var f = typeof Dt == "function" && Dt, m = 0; m < l.length; m++) a(l[m]); return a; } return n; }())({ 1: [function(n, o, r) { var l = {}, a = "(?:^|\\s)", f = "(?:\\s|$)"; function m(c) { var C = l[c]; return C ? C.lastIndex = 0 : l[c] = C = new RegExp(a + c + f, "g"), C; } function u(c, C) { var i = c.className; i.length ? m(C).test(i) || (c.className += " " + C) : c.className = C; } function v(c, C) { c.className = c.className.replace(m(C), " ").trim(); } o.exports = { add: u, rm: v }; }, {}], 2: [function(n, o, r) { (function(l) { var a = n("contra/emitter"), f = n("crossvent"), m = n("./classes"), u = document, v = u.documentElement; function c(w, k) { var O = arguments.length; O === 1 && Array.isArray(w) === !1 && (k = w, w = []); var L, H, $, J, P, j, I, N, z, oe = null, le, X, pe = !1, ce = 0, se, K = k || {}; K.moves === void 0 && (K.moves = M), K.accepts === void 0 && (K.accepts = M), K.invalid === void 0 && (K.invalid = pt), K.containers === void 0 && (K.containers = w || []), K.isContainer === void 0 && (K.isContainer = T), 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 = u.body); var fe = a({ containers: K.containers, start: He, end: Ke, cancel: ie, remove: R, destroy: Qe, canMove: ze, dragging: !1 }); return K.removeOnSpill === !0 && fe.on("over", jt).on("out", Lt), Ae(), fe; function Je(E) { return fe.containers.indexOf(E) !== -1 || K.isContainer(E); } function Ae(E) { var q = E ? "remove" : "add"; s(v, q, "mousedown", be), s(v, q, "mouseup", qe); } function Ne(E) { var q = E ? "remove" : "add"; s(v, q, "mousemove", ft); } function st(E) { var q = E ? "remove" : "add"; f[q](v, "selectstart", Ze), f[q](v, "click", Ze); } function Qe() { Ae(!0), qe({}); } function Ze(E) { le && E.preventDefault(); } function be(E) { J = E.clientX, P = E.clientY; var q = d(E) !== 1 || E.metaKey || E.ctrlKey; if (!q) { var Q = E.target, re = Pe(Q); re && (le = re, Ne(), E.type === "mousedown" && (y(Q) ? Q.focus() : E.preventDefault())); } } function ft(E) { if (le) { if (d(E) === 0) { qe({}); return; } if (!(E.clientX !== void 0 && Math.abs(E.clientX - J) <= (K.slideFactorX || 0) && E.clientY !== void 0 && Math.abs(E.clientY - P) <= (K.slideFactorY || 0))) { if (K.ignoreInputTextSelection) { var q = F("clientX", E) || 0, Q = F("clientY", E) || 0, re = u.elementFromPoint(q, Q); if (y(re)) return; } var ue = le; Ne(!0), st(), Ke(), _e(ue), m.add(N || $, "gu-transit"), $t(), Vt(), ce = 0, mt(E); } } } function Pe(E) { if (!(fe.dragging && L) && !Je(E)) { for (var q = E; p(E) && Je(p(E)) === !1; ) if (K.invalid(E, q) || (E = p(E), !E)) return; var Q = p(E); if (Q && !K.invalid(E, q)) { var re = K.moves(E, Q, q, D(E)); if (re) return { item: E, source: Q }; } } } function ze(E) { return !!Pe(E); } function He(E) { var q = Pe(E); q && _e(q); } function _e(E) { Ut(E.item, E.source) && (N = E.item.cloneNode(!0), fe.emit("cloned", N, E.item, "copy")), H = E.source, $ = E.item, j = I = D(E.item), fe.dragging = !0, fe.emit("drag", $, H); } function pt() { return !1; } function Ke() { if (fe.dragging) { var E = N || $; ct(E, p(E)); } } function $e() { le = !1, Ne(!0), st(!0); } function qe(E) { if ($e(), !!fe.dragging) { var q = N || $, Q = F("clientX", E) || 0, re = F("clientY", E) || 0, ue = S(L, Q, re), de = Ue(ue, Q, re); de && (N && K.copySortSource || !N || de !== H) ? ct(q, de) : K.removeOnSpill ? R() : ie(); } } function ct(E, q) { var Q = p(E); N && K.copySortSource && q === H && Q.removeChild($), ye(q) ? fe.emit("cancel", E, H) : fe.emit("drop", E, q, H, I), he(); } function R() { if (fe.dragging) { var E = N || $, q = p(E); q && q.removeChild(E), fe.emit(N ? "cancel" : "remove", E, q, H), he(); } } function ie(E) { if (fe.dragging) { var q = arguments.length > 0 ? E : K.revertOnSpill, Q = N || $, re = p(Q), ue = ye(re); ue === !1 && q && (N ? re && re.removeChild(N) : H.insertBefore(Q, j)), ue || q ? fe.emit("cancel", Q, H, H) : fe.emit("drop", Q, re, H, I), he(); } } function he() { var E = N || $; $e(), Rt(), At(), E && m.rm(E, "gu-transit"), z && clearTimeout(z), fe.dragging = !1, oe && fe.emit("out", E, oe, H), fe.emit("dragend", E, ce), H = $ = N = j = I = z = oe = null; } function ye(E, q) { var Q; return q !== void 0 ? Q = q : L ? Q = I : Q = D(N || $), E === H && Q === j; } function Ue(E, q, Q) { for (var re = E; re && !ue(); ) re = p(re); return re; function ue() { var de = Je(re); if (de === !1) return !1; var Oe = Tt(re, E), De = Ft(re, Oe, q, Q), ke = ye(re, De); return ke ? !0 : K.accepts($, re, H, De); } } function mt(E) { if (!L) return; E.preventDefault(); var q = F("clientX", E) || 0, Q = F("clientY", E) || 0; L.style.left = q - 2 + "px", L.style.top = Q - 2 + "px"; var re = N || $, ue = S(L, q, Q), de = Ue(ue, q, Q), Oe = de !== null && de !== oe; (Oe || de === null) && (Me(), oe = de, Le()), qt(ue, Q); var De = p(re); if (de === H && N && !K.copySortSource) { De && De.removeChild(re); return; } var ke, je = Tt(de, ue); if (pe = vt(je, de), je !== null) ke = Ft(de, je, q, Q); else if (K.revertOnSpill === !0 && !N) ke = j, de = H; else { N && De && De.removeChild(re), N && X && (X.style.display = "none"); return; } X.style.display = "block", Pt(ke, re, Oe), ke ? Ht(je, ke) : _t(de); function Ce(Te) { fe.emit(Te, re, oe, H); } function Le() { Oe && Ce("over"); } function Me() { oe && Ce("out"); } } function Pt(E, q, Q) { (E === q || E === D(q)) && (I = D(q)), (E === null && Q || E !== q && E !== D(q)) && (I = E); } function jt(E) { m.rm(E, "gu-hide"); } function Lt(E) { fe.dragging && m.add(E, "gu-hide"); } function Vt() { L || (L = document.createElement("div"), L.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;", L.innerHTML = K.getMirrorText && K.getMirrorText($) || "控件", m.add(L, "gu-mirror"), K.mirrorContainer.appendChild(L), s(v, "add", "mousemove", mt), m.add(K.mirrorContainer, "gu-unselectable"), fe.emit("cloned", L, $, "mirror")); } function $t() { if (X = document.createElement("div"), m.add(X, "gu-insertion"), $) { var E = $.getBoundingClientRect(); X.style.left = E.left + "px", X.style.top = E.top + "px"; } pe = !1, K.mirrorContainer.appendChild(X); } function Rt() { L && (m.rm(K.mirrorContainer, "gu-unselectable"), s(v, "remove", "mousemove", mt), p(L).removeChild(L), L = null); } function At() { X && (p(X).removeChild(X), X = null); } function Tt(E, q) { for (var Q = q; Q !== E && p(Q) !== E; ) Q = p(Q); return Q === v ? null : Q; } function vt(E, q) { if (!q) return pe; var Q = E || q && q.lastElementChild; if (!Q) return !0; var re = getComputedStyle(E), ue = /^inline/.test(re.getPropertyValue("display")) || /^(left|right)$/.test(re.getPropertyValue("float")); if (ue) return !0; if (q) { var de = getComputedStyle(q), Oe = de.getPropertyValue("display"); if (/flex$/.test(Oe)) { var De = de.getPropertyValue("flex-direction") || "row"; if (De === "row" || De === "row-reverse") return !zt(q); } return !1; } return !0; } function zt(E) { if (!E.children || !E.children.length) return !1; for (const q of Array.from(E.children)) { const re = (q.className && q.className.split(" ") || []).filter((ue) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(ue)); if (!re.length) return !1; for (const ue of re) { const de = ue.slice(ue.lastIndexOf("-") + 1); if (parseInt(de, 10) !== 12) return !1; } } return !0; } function Ht(E, q) { const Q = q.getBoundingClientRect(); if (X.style.left = Q.left + "px", X.style.top = Q.top + "px", pe) { if (X.style.height = Q.height + "px", X.style.width = "4px", E) { const re = E.getBoundingClientRect(); re.top !== Q.top && (X.style.left = re.right + "px", X.style.top = re.top + "px", X.style.height = re.height + "px"); } } else if (X.style.height = "4px", X.style.width = Q.width + "px", se) { const re = se.getBoundingClientRect(); Q.top < re.top && (X.style.display = "none"); } q === $ && $ && (X.style.display = "none"); } function _t(E) { I = null; var q = E.lastElementChild; if (q) { var Q = q.getBoundingClientRect(); pe ? (X.style.left = Q.right + "px", X.style.top = Q.top + "px", X.style.height = Q.height + "px", X.style.width = "4px") : (X.style.left = Q.left + "px", X.style.top = Q.bottom + "px", X.style.height = "4px", X.style.width = Q.width + "px"), q === $ && $ && (X.style.display = "none"); } else X.style.display = "none"; } function qt(E, q) { if (!K.mirrorContainer.contains(E) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (se = C(E), !se || !se.contains(E))) return; const Q = document.querySelector(".dgComponentSelected"), re = se.getBoundingClientRect(); if (q - 30 < re.top && se.scrollTop > 0) { let ue = se.scrollTop < 10 ? se.scrollTop : 10; se.scrollBy(0, -1 * ue), Q && se.contains(Q) && (ce = ce + -1 * ue); } if (q + 30 > re.bottom && se.scrollTop < se.scrollHeight - se.clientHeight) { const ue = se.scrollHeight - se.clientHeight - se.scrollTop; let de = ue < 10 ? ue : 10; se.scrollBy(0, de), Q && se.contains(Q) && (ce = ce + de); } } function Ft(E, q, Q, re) { var ue = K.direction === "horizontal", de = K.direction === "mixed", Oe = q !== E ? ke() : De(); return Oe; function De() { var Ce = E.children.length, Le, Me, Te; for (Le = 0; Le < Ce; Le++) if (Me = E.children[Le], Te = Me.getBoundingClientRect(), ue && Te.left + Te.width / 2 > Q || !de && !ue && Te.top + Te.height / 2 > re || de && Te.left + Te.width > Q && Te.top + Te.height > re) return Me; return null; } function ke() { var Ce = q.getBoundingClientRect(); if (de) { var Le = re - Ce.top, Me = Q - Ce.left, Te = Ce.bottom - re, gt = Ce.right - Q, ht = Math.min(Me, gt, Le, Te), yt; return pe ? yt = gt < Me : yt = Te === ht || gt === ht || Me === ht, je(yt); } return je(ue ? Q > Ce.left + V(Ce) / 2 : re > Ce.top + b(Ce) / 2); } function je(Ce) { return Ce ? D(q) : q; } } function Ut(E, q) { return typeof K.copy == "boolean" ? K.copy : K.copy(E, q); } } function C(w) { const k = Array.from(window.scrollContainerList); if (k.length === 1) { const L = Array.from(window.scrollContainerList)[0]; return document.getElementById(L); } const O = i(k); for (const L of O) if (L.contains(w)) return L; return null; } function i(w) { const k = []; return w.forEach((O) => { const L = document.getElementById(O); L && k.push(L); }), k.sort((O, L) => O.contains(L) ? 1 : L.contains(O) ? -1 : 0), k; } function s(w, k, O, L) { var H = { mouseup: "touchend", mousedown: "touchstart", mousemove: "touchmove" }, $ = { mouseup: "pointerup", mousedown: "pointerdown", mousemove: "pointermove" }, J = { mouseup: "MSPointerUp", mousedown: "MSPointerDown", mousemove: "MSPointerMove" }; l.navigator.pointerEnabled ? f[k](w, $[O], L) : l.navigator.msPointerEnabled ? f[k](w, J[O], L) : (f[k](w, H[O], L), f[k](w, O, L)); } function d(w) { if (w.touches !== void 0) return w.touches.length; if (w.which !== void 0 && w.which !== 0) return w.which; if (w.buttons !== void 0) return w.buttons; var k = w.button; if (k !== void 0) return k & 1 ? 1 : k & 2 ? 3 : k & 4 ? 2 : 0; } function S(w, k, O) { w = w || {}; var L = w.className || "", H; return w.className += " gu-hide", H = u.elementFromPoint(k, O), w.className = L, H; } function T() { return !1; } function M() { return !0; } function V(w) { return w.width || w.right - w.left; } function b(w) { return w.height || w.bottom - w.top; } function p(w) { return w.parentNode === u ? null : w.parentNode; } function y(w) { return w.tagName === "INPUT" || w.tagName === "TEXTAREA" || w.tagName === "SELECT" || B(w); } function B(w) { return !w || w.contentEditable === "false" ? !1 : w.contentEditable === "true" ? !0 : B(p(w)); } function D(w) { return w.nextElementSibling || k(); function k() { var O = w; do O = O.nextSibling; while (O && O.nodeType !== 1); return O; } } function x(w) { return w.targetTouches && w.targetTouches.length ? w.targetTouches[0] : w.changedTouches && w.changedTouches.length ? w.changedTouches[0] : w; } function F(w, k) { var O = x(k), L = { pageX: "clientX", // IE8 pageY: "clientY" // IE8 }; return w in L && !(w in O) && L[w] in O && (w = L[w]), O[w]; } o.exports = c; }).call(this, typeof We < "u" ? We : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }], 3: [function(n, o, r) { o.exports = function(a, f) { return Array.prototype.slice.call(a, f); }; }, {}], 4: [function(n, o, r) { var l = n("ticky"); o.exports = function(f, m, u) { f && l(function() { f.apply(u || null, m || []); }); }; }, { ticky: 10 }], 5: [function(n, o, r) { var l = n("atoa"), a = n("./debounce"); o.exports = function(m, u) { var v = u || {}, c = {}; return m === void 0 && (m = {}), m.on = function(C, i) { return c[C] ? c[C].push(i) : c[C] = [i], m; }, m.once = function(C, i) { return i._once = !0, m.on(C, i), m; }, m.off = function(C, i) { var s = arguments.length; if (s === 1) delete c[C]; else if (s === 0) c = {}; else { var d = c[C]; if (!d) return m; d.splice(d.indexOf(i), 1); } return m; }, m.emit = function() { var C = l(arguments); return m.emitterSnapshot(C.shift()).apply(this, C); }, m.emitterSnapshot = function(C) { var i = (c[C] || []).slice(0); return function() { var s = l(arguments), d = this || m; if (C === "error" && v.throws !== !1 && !i.length) throw s.length === 1 ? s[0] : s; return i.forEach(function(T) { v.async ? a(T, s, d) : T.apply(d, s), T._once && m.off(C, T); }), m; }; }, m; }; }, { "./debounce": 4, atoa: 3 }], 6: [function(n, o, r) { (function(l) { var a = n("custom-event"), f = n("./eventmap"), m = l.document, u = C, v = s, c = []; l.addEventListener || (u = i, v = d), o.exports = { add: u, remove: v, fabricate: S }; function C(p, y, B, D) { return p.addEventListener(y, B, D); } function i(p, y, B) { return p.attachEvent("on" + y, M(p, y, B)); } function s(p, y, B, D) { return p.removeEventListener(y, B, D); } function d(p, y, B) { var D = V(p, y, B); if (D) return p.detachEvent("on" + y, D); } function S(p, y, B) { var D = f.indexOf(y) === -1 ? F() : x(); p.dispatchEvent ? p.dispatchEvent(D) : p.fireEvent("on" + y, D); function x() { var w; return m.createEvent ? (w = m.createEvent("Event"), w.initEvent(y, !0, !0)) : m.createEventObject && (w = m.createEventObject()), w; } function F() { return new a(y, { detail: B }); } } function T(p, y, B) { return function(x) { var F = x || l.event; F.target = F.target || F.srcElement, F.preventDefault = F.preventDefault || function() { F.returnValue = !1; }, F.stopPropagation = F.stopPropagation || function() { F.cancelBubble = !0; }, F.which = F.which || F.keyCode, B.call(p, F); }; } function M(p, y, B) { var D = V(p, y, B) || T(p, y, B); return c.push({ wrapper: D, element: p, type: y, fn: B }), D; } function V(p, y, B) { var D = b(p, y, B); if (D) { var x = c[D].wrapper; return c.splice(D, 1), x; } } function b(p, y, B) { var D, x; for (D = 0; D < c.length; D++) if (x = c[D], x.element === p && x.type === y && x.fn === B) return D; } }).call(this, typeof We < "u" ? We : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./eventmap": 7, "custom-event": 8 }], 7: [function(n, o, r) { (function(l) { var a = [], f = "", m = /^on/; for (f in l) m.test(f) && a.push(f.slice(2)); o.exports = a; }).call(this, typeof We < "u" ? We : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 8: [function(n, o, r) { (function(l) { var a = l.CustomEvent; function f() { try { var m = new a("cat", { detail: { foo: "bar" } }); return m.type === "cat" && m.detail.foo === "bar"; } catch { } return !1; } o.exports = f() ? a : ( // IE >= 9 typeof document < "u" && typeof document.createEvent == "function" ? function(u, v) { var c = document.createEvent("CustomEvent"); return v ? c.initCustomEvent(u, v.bubbles, v.cancelable, v.detail) : c.initCustomEvent(u, !1, !1, void 0), c; } : ( // IE <= 8 function(u, v) { var c = document.createEventObject(); return c.type = u, v ? (c.bubbles = !!v.bubbles, c.cancelable = !!v.cancelable, c.detail = v.detail) : (c.bubbles = !1, c.cancelable = !1, c.detail = void 0), c; } ) ); }).call(this, typeof We < "u" ? We : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 9: [function(n, o, r) { var l = o.exports = {}, a, f; function m() { 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 = m; } catch { a = m; } try { typeof clearTimeout == "function" ? f = clearTimeout : f = u; } catch { f = u; } })(); function v(b) { if (a === setTimeout) return setTimeout(b, 0); if ((a === m || !a) && setTimeout) return a = setTimeout, setTimeout(b, 0); try { return a(b, 0); } catch { try { return a.call(null, b, 0); } catch { return a.call(this, b, 0); } } } function c(b) { if (f === clearTimeout) return clearTimeout(b); if ((f === u || !f) && clearTimeout) return f = clearTimeout, clearTimeout(b); try { return f(b); } catch { try { return f.call(null, b); } catch { return f.call(this, b); } } } var C = [], i = !1, s, d = -1; function S() { !i || !s || (i = !1, s.length ? C = s.concat(C) : d = -1, C.length && T()); } function T() { if (!i) { var b = v(S); i = !0; for (var p = C.length; p; ) { for (s = C, C = []; ++d < p; ) s && s[d].run(); d = -1, p = C.length; } s = null, i = !1, c(b); } } l.nextTick = function(b) { var p = new Array(arguments.length - 1); if (arguments.length > 1) for (var y = 1; y < arguments.length; y++) p[y - 1] = arguments[y]; C.push(new M(b, p)), C.length === 1 && !i && v(T); }; function M(b, p) { this.fun = b, this.array = p; } M.prototype.run = function() { this.fun.apply(null, this.array); }, l.title = "browser", l.browser = !0, l.env = {}, l.argv = [], l.version = "", l.versions = {}; function V() { } l.on = V, l.addListener = V, l.once = V, l.off = V, l.removeListener = V, l.removeAllListeners = V, l.emit = V, l.prependListener = V, l.prependOnceListener = V, l.listeners = function(b) { return []; }, l.binding = function(b) { throw new Error("process.binding is not supported"); }, l.cwd = function() { return "/"; }, l.chdir = function(b) { throw new Error("process.chdir is not supported"); }, l.umask = function() { return 0; }; }, {}], 10: [function(n, o, r) { (function(l) { var a = typeof l == "function", f; a ? f = function(m) { l(m); } : f = function(m) { setTimeout(m, 0); }, o.exports = f; }).call(this, n("timers").setImmediate); }, { timers: 11 }], 11: [function(n, o, r) { (function(l, a) { var f = n("process/browser.js").nextTick, m = Function.prototype.apply, u = Array.prototype.slice, v = {}, c = 0; r.setTimeout = function() { return new C(m.call(setTimeout, window, arguments), clearTimeout); }, r.setInterval = function() { return new C(m.call(setInterval, window, arguments), clearInterval); }, r.clearTimeout = r.clearInterval = function(i) { i.close(); }; function C(i, s) { this._id = i, this._clearFn = s; } C.prototype.unref = C.prototype.ref = function() { }, C.prototype.close = function() { this._clearFn.call(window, this._id); }, r.enroll = function(i, s) { clearTimeout(i._idleTimeoutId), i._idleTimeout = s; }, r.unenroll = function(i) { clearTimeout(i._idleTimeoutId), i._idleTimeout = -1; }, r._unrefActive = r.active = function(i) { clearTimeout(i._idleTimeoutId); var s = i._idleTimeout; s >= 0 && (i._idleTimeoutId = setTimeout(function() { i._onTimeout && i._onTimeout(); }, s)); }, r.setImmediate = typeof l == "function" ? l : function(i) { var s = c++, d = arguments.length < 2 ? !1 : u.call(arguments, 1); return v[s] = !0, f(function() { v[s] && (d ? i.apply(null, d) : i.call(null), r.clearImmediate(s)); }), s; }, r.clearImmediate = typeof a == "function" ? a : function(i) { delete v[i]; }; }).call(this, n("timers").setImmediate, n("timers").clearImmediate); }, { "process/browser.js": 9, timers: 11 }] }, {}, [2])(2); }); })(Bo); var Ba = Bo.exports; const fn = /* @__PURE__ */ Da(Ba), ka = { 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 } }, Ma = { showCloseButton: { type: Boolean, default: !0 }, animate: { type: String, default: "fadeIn" }, options: { type: Object } }, Yt = /* @__PURE__ */ xe({ name: "Toast", props: Ma, emits: ["close", "click"], setup: (e, t) => { const { locale: n, t: o } = Zt(), r = g(e.animate), l = "fadeOut", a = _(() => e.options), f = g(!1), m = _(() => a.value.title && a.value.message), u = _(() => !a.value.title && a.value.message), v = _(() => { const b = { animated: f.value, toast: !0, "toast--only-content": u.value }; return b[e.animate] = !1, b[l] = f.value, b["toasty-type-" + a.value.type] = !0, a.value.theme && (b[a.value.theme] = !0), b; }), c = _(() => { const y = `f-icon-${a.value && a.value.type ? a.value.type.replace("toasty-type-", "") : "default"}`, B = { "f-icon": !0 }; return B[y] = !0, B; }), C = _(() => a.value.title || a.value.message), i = _(() => e.showCloseButton), s = _(() => !!a.value.buttons || !!t.slots.default), d = _(() => n.value === "en" ? { wordBreak: "keep-all", overflowWrap: "break-word" } : {}); function S(b) { b.stopPropagation(), b.preventDefault(), f.value = !1, setTimeout(() => { t.emit("close", a.value); }, 200); } function T(b, p) { } function M(b) { return `f-preten-link ${b.customClass ? b.customClass : ""}`; } ve(r, () => { r.value; }); const V = () => { var b; return h(lt, null, [h("div", { class: "after-toast-msg text-right" }, [!t.slots.default && ((b = a.value.buttons) == null ? void 0 : b.map((p) => h("span", { class: M(p), onClick: (y) => void 0 }, [p.text]))), t.slots.default && t.slots.default()])]); }; return () => h("div", { class: v.value, style: "min-height:44px" }, [i.value && h("button", { title: o("messageBox.close"), class: "toast-close f-btn-icon f-bare", onClick: S }, [h("span", { class: "f-icon modal_close" }, null)]), C.value && h("section", { class: "modal-tips" }, [h("div", { class: "float-left modal-tips-iconwrap" }, [h("span", { class: c.value }, null)]), h("div", { class: "modal-tips-content" }, [m.value && h(lt, null, [h("h5", { class: "toast-title modal-tips-title", innerHTML: a.value.title }, null), h("p", { class: "toast-msg", innerHTML: a.value.message, style: d.value }, null), s.value && V()]), u.value && (a.value.buttons ? h("div", { class: "toast-title-btns-wrapper d-flex" }, [h("h5", { class: "toast-title modal-tips-title only-toast-msg", style: d.value, innerHTML: a.value.message }, null), h("div", { class: "after-toast-title text-right ml-auto" }, [V()])]) : h("h5", { class: "toast-title modal-tips-title only-toast-msg", style: d.value, innerHTML: a.value.message }, null))])])]); } }), Bt = /* @__PURE__ */ xe({ name: "Notify", props: ka, emits: ["close", "empty"], setup(e, t) { const n = _(() => ({ "farris-notify": !0 })), o = { left: 12, right: 12, top: 20, bottom: 12 }, r = g(), l = g(e.options), a = g(e.showCloseButton), f = _(() => e.position || "bottom-right"), m = _(() => e.timeout != null ? e.timeout : 3e3), u = _(() => { const C = e.bottom ? e.bottom : o.bottom, i = e.top ? e.top : o.top, s = { transition: "all 0.2s ease", left: f.value.indexOf("left") > -1 ? `${e.left ? e.left : o.left}px` : "", right: f.value.indexOf("right") > -1 ? `${e.right ? e.right : o.right}px` : "", top: f.value.indexOf("top") > -1 ? `${i}px` : "", bottom: f.value.indexOf("bottom") > -1 ? `${C}px` : "" }; return f.value.indexOf("center") > -1 && (s.left = "50%", s.marginLeft = "calc(-24rem / 2)", f.value === "center-center" && (s.top = "50%", s.transform = "translate(-50%, -50%)")), s; }); function v(C) { t.emit("close"); } m.value && setTimeout(() => { v(); }, m.value), t.expose({ closeToast: v, container: r, notifyPosition: f }); function c(C, i) { v(); } return () => h("div", { class: n.value, style: u.value, ref: r }, [h(Yt, { options: l.value, showCloseButton: a.value, animate: e.animate, onClose: (C) => c(C, l.value) }, null)]); } }); class en { constructor() { Be(this, "notifyRefs", []); Be(this, "globalConfig", Ye({})); } 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, "&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g, ""); } createNotifyInstance(t) { const n = this, r = Object.assign({ timeout: 3e3, position: "bottom-right", showCloseButton: !0, safeHtml: !0 }, this.globalConfig, { ...t }), l = document.createElement("div"); l.style.display = "contents"; const a = hn({ setup() { var u; const f = g(); function m() { f.value.container.style.transform = "scale(0)", setTimeout(() => { n.updateNotifyPositionForClose(r, f), a.unmount(); }, 220); } if (r.position.indexOf("top") > -1) { const v = n.getNotifyInstances(r.position), c = v[v.length - 1]; if (c) { const C = c.value.container.getBoundingClientRect(); r.top = C.bottom; } } return r.safeHtml && ((u = r.options) != null && u.message) && (r.options.message = n.escapeAllHtml(r.options.message)), St(() => { document.body.removeChild(l); }), Re(() => { n.updateNotifyPositionForCreate(r, f); }), () => h(yn, { mode: "out-in", name: "fade", appear: !0 }, { default: () => [h(Bt, rt({ ref: f }, r, { onClose: m }), null)] }); } }); return a.provide("NotifyService", this), document.body.appendChild(l), a.use(Ot.i18n), a.mount(l), a; } 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((r) => { const l = r.value.container.getBoundingClientRect(); r.value.container.style.bottom = l.height + o - l.bottom + "px"; }); } this.notifyRefs = [...this.notifyRefs, n]; } updateNotifyPositionForClose(t, n) { const o = this.notifyRefs.indexOf(n); if (t.position.indexOf("top") > -1) { const r = this.getNotifyInstances(t.position), l = r.indexOf(n); r.slice(l + 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, n) { let o = "", r = "", l, a, f; typeof n == "string" ? o = n : n && (o = n.message || "", r = n.title || "", a = n.position || null, f = n.showCloseButton != null ? n.showCloseButton : null, l = n.timeout != null ? n.timeout : null); const u = { options: { type: t, message: o, title: r } }; return a != null && (u.position = a), f != null && (u.showCloseButton = f), l != null && (u.timeout = l), u; } 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 Ea = Symbol("NOTIFY_SERVICE_TOKEN"); Bt.install = (e) => { e.component(Bt.name, Bt), e.component(Yt.name, Yt); const t = new en(); e.provide(Ea, t), e.provide("FNotifyService", t); }; const Ia = { designerHostService: { type: Object, default: {} }, /** 预设的控件类型 */ componentType: { type: String, default: "" }, /** 预设绑定的实体id */ bindingEntityId: { type: String, default: "" }, /** 绑定步骤 */ steps: { type: Array, default: ["selectEntity", "selectFields"] } }; `${Ot.getLocaleValue("datagrid.loadingMessage")}`; const Oa = { /** 自定义样式 */ customClass: { type: String, default: "" }, /** 排序配置 */ sort: { type: Object }, /** 筛选配置 */ filter: { type: Object }, /** 自动勾选子节点 */ autoCheckChildren: { type: Boolean, default: !1 }, /** 列集合 */ columns: { type: Array, default: [] }, /** 列配置 */ columnOption: { type: Object }, /** 命令列配置选项 */ commandOption: { type: Object, default: { enable: !1, commands: [] } }, /** 被绑定数据 */ data: { type: Array, default: [] }, /** 禁用组件 */ disabled: { type: Boolean, default: !1 }, /** 用于控制节点禁用状态的字段 */ disabledField: { type: String, default: "disabled" }, /** 用于显示信息的字段 */ displayField: { type: String, default: "name" }, /** 允许编辑 */ editable: { type: Boolean, default: !1 }, /** 编辑配置 */ editOption: { type: Object, default: { selectOnEditing: !1, editMode: "cell" } }, /** 适配父组件尺寸 */ fit: { type: Boolean, default: !1 }, /** 列标题配置 */ header: { type: Object }, /** 高度 */ height: { type: Number, default: -1 }, /** 层级关系配置对象 */ hierarchy: { type: Object, default: { cascadeOption: { autoCancelParent: !0, autoCheckChildren: !1, autoCheckParent: !1, selectionRange: "All" }, parentIdField: "parent" } }, /** DataGrid组件唯一标识 */ id: { type: String, default: "" }, /** 被绑定数据的标识字段 */ idField: { type: String, default: "id", require: !0 }, /** async loading data */ loadData: { type: Function }, // 是否展示 loading loading: { type: Boolean, default: !1 }, /** 最小高度 */ minHeight: { type: Number, default: 300 }, /** 最小宽度 */ minWidth: { type: Number, default: 400 }, /** 新建数据 */ newDataItem: { type: Function, default: () => { } }, /** 分页配置 */ pagination: { type: Object, default: { enable: !1, size: -1 } }, /** 行号配置 */ rowNumber: { type: Object, default: { enable: !0, width: 32, heading: Ot.getLocaleValue("datagrid.lineNumberTitle") } }, /** 行配置 */ rowOption: { type: Object, default: { wrapContent: !1 } }, /** 选择配置 */ selection: { type: Object, default: { enableSelectRow: !0, multiSelect: !1, multiSelectMode: "DependOnCheck", showCheckbox: !1, showSelectAll: !1, showSelection: !1 } }, /** 已选数据标识 */ selectionValues: { type: Array, default: [] }, /** 显示边框 */ showBorder: { type: Boolean, default: !1 }, /** 显示列头 */ showHeader: { type: Boolean, default: !0 }, /** 显示横向行分割线 */ showHorizontalLines: { type: Boolean, default: !0 }, /** 显示节点连接线 */ showLines: { type: Boo