UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,119 lines 340 kB
var tr = Object.defineProperty; var nr = (e, t, n) => t in e ? tr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var ie = (e, t, n) => nr(e, typeof t != "symbol" ? t + "" : t, n); import { ref as F, defineComponent as He, computed as z, watch as Oe, createVNode as B, Fragment as wt, reactive as ft, createApp as pn, onUnmounted as kt, onMounted as pt, Transition as mn, mergeProps as bt, createTextVNode as ze, onBeforeUnmount as vn, withDirectives as or, resolveDirective as rr, onBeforeMount as hn, Teleport as ir, shallowRef as ar, nextTick as Qt, render as zt, h as lr, cloneVNode as sr, inject as Le, provide as Ct, triggerRef as ur, isVNode as cr } from "vue"; import { isPlainObject as nn, cloneDeep as ct, isUndefined as on, merge as Mt, findIndex as rn } from "lodash-es"; import { useResizeObserver as gn } 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 xr, useEdit as Tr, useVisualDataBound as Fr, useVisualDataCell as Or, useVisualDataRow as Er, useVisualData as kr, useCellPosition as Ir, useSidebar as Mr, useVirtualScroll as Br, useFitColumn as Dr, useFilterHistory as Nr, useColumnFilter as Vr, useDragColumn as Pr, getColumnHeader as Rr, getSidebar as $r, getDisableMask as jr, getHorizontalScrollbar as Lr, getVerticalScrollbar as Ar, getEmpty as Wr } from "../data-view/index.esm.js"; import "../modal/index.esm.js"; import yn from "../transfer/index.esm.js"; import bn from "../tabs/index.esm.js"; import Cn from "../order/index.esm.js"; import "../condition/index.esm.js"; import wn, { FCheckbox as Hr } from "../checkbox/index.esm.js"; import Sn from "../filter-bar/index.esm.js"; import an from "../tooltip/index.esm.js"; import _n from "../pagination/index.esm.js"; import zr from "../button/index.esm.js"; import xn from "../search-box/index.esm.js"; import Tn from "../tags/index.esm.js"; import Fn, { 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 On from "../accordion/index.esm.js"; import En from "../avatar/index.esm.js"; import kn from "../button-edit/index.esm.js"; import In from "../button-group/index.esm.js"; import Mn from "../calendar/index.esm.js"; import Bn from "../capsule/index.esm.js"; import Dn from "../color-picker/index.esm.js"; import Pt from "../combo-list/index.esm.js"; import Nn from "../content-container/index.esm.js"; import Vn from "../data-grid/index.esm.js"; import Pn from "../date-picker/index.esm.js"; import Rn from "../dropdown/index.esm.js"; import Kr from "../external-container/index.esm.js"; import $n from "../events-editor/index.esm.js"; import jn from "../image-cropper/index.esm.js"; import Ln from "../input-group/index.esm.js"; import An from "../layout/index.esm.js"; import Wn from "../list-nav/index.esm.js"; import Hn from "../list-view/index.esm.js"; import zn from "../lookup/index.esm.js"; import Gn from "../nav/index.esm.js"; import qn from "../number-spinner/index.esm.js"; import Un from "../number-range/index.esm.js"; import Yn from "../page-header/index.esm.js"; import Xn from "../page-footer/index.esm.js"; import Kn from "../progress/index.esm.js"; import Qn from "../query-solution/index.esm.js"; import Jn from "../radio-group/index.esm.js"; import Zn from "../rate/index.esm.js"; import eo from "../response-toolbar/index.esm.js"; import to from "../response-layout/index.esm.js"; import no from "../response-layout-editor/index.esm.js"; import oo from "../section/index.esm.js"; import ro from "../smoke-detector/index.esm.js"; import io from "../splitter/index.esm.js"; import ao from "../step/index.esm.js"; import lo from "../switch/index.esm.js"; import so from "../text/index.esm.js"; import uo from "../time-picker/index.esm.js"; import co from "../tree-view/index.esm.js"; import fo from "../uploader/index.esm.js"; import po from "../verify-detail/index.esm.js"; import mo from "../component/index.esm.js"; import vo from "../video/index.esm.js"; import ho from "../textarea/index.esm.js"; import go from "../tree-grid/index.esm.js"; import yo from "../fieldset/index.esm.js"; import bo 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 ui = { /** * 组件值 */ modelValue: { type: Object, default: {} } }; function ci() { const o = { aroundDirection: "none", left: 2, right: 2, top: 2, bottom: 2, x: 0, y: 0 }; function r() { const C = document.createElementNS("http://www.w3.org/2000/svg", "path"); return C.setAttribute("fill", "none"), C.setAttribute("stroke", "#4d53e8"), C.setAttribute("stroke-width", "2"), C.setAttribute("class", ""), C; } function a() { const C = document.createElementNS("http://www.w3.org/2000/svg", "path"); return C.setAttribute("fill", "none"), C.setAttribute("stroke", "#4d53e8"), C.setAttribute("stroke-width", "2"), C.setAttribute("stroke-linecap", "round"), C; } function i() { const C = document.createElementNS("http://www.w3.org/2000/svg", "path"); return C.setAttribute("fill", "none"), C.setAttribute("stroke", "#4d53e8"), C.setAttribute("stroke-width", "2"), C.setAttribute("stroke-linecap", "round"), C; } function c(C, v, M, V) { const $ = (N) => { N.key === "Delete" && (C.indexOf("^"), document.removeEventListener("keydown", $), v.remove()); }; M.addEventListener("mouseenter", () => { M.setAttribute("stroke", "#37d0ff"), V.setAttribute("stroke", "#37d0ff"), M.setAttribute("stroke-width", "3"), document.addEventListener("keydown", $); }), M.addEventListener("mouseleave", () => { M.setAttribute("stroke", "#4d53e8"), M.setAttribute("stroke-width", "2"), V.setAttribute("stroke", "#4d53e8"), document.removeEventListener("keydown", $); }); } function u(C) { let v = document.getElementById(C); if (v == null) { const M = document.createElementNS("http://www.w3.org/2000/svg", "svg"), V = r(); M.appendChild(V); const $ = a(); M.appendChild($); const N = i(); M.appendChild(N); const G = i(); M.appendChild(G), v = document.createElement("div"), v.id = C, v.style.position = "absolute", v.appendChild(M), c(C, v, V, $); const K = document.getElementById("svg-container"); return K && K.appendChild(v), v; } return v; } function h(C, v, M, V, $) { const N = { x: 0, y: 0 }; return C === "west" && (v === "north_west" && (M === "north" && (N.x = 0, N.y = 0 - $ / 2), M === "west" && (N.x = 0 - V / 2, N.y = 0)), v === "north_east" && (M === "north" && (N.x = -100, N.y = 0 - $ / 2), M === "east" && (N.x = -100, N.y = 0 - $ / 2)), v === "south_east" && (M === "south" && (N.x = -100, N.y = 0 + $ / 2), M === "east" && (N.x = -100, N.y = 0 + $ / 2)), v === "south_west" && (M === "south" && (N.x = 0, N.y = 0 + $ / 2), M === "west" && (N.x = 0 - V / 2, N.y = 0))), C === "east" && (v === "north_west" && (M === "north" && (N.x = -100, N.y = 0 - $ / 2), M === "west" && (N.x = 100, N.y = 0 - $ / 2)), v === "north_east" && (M === "north" && (N.x = 0, N.y = 0 - $ / 2), M === "east" && (N.x = 0 + V / 2, N.y = 0)), v === "south_east" && (M === "south" && (N.x = 0, N.y = 0 + $ / 2), M === "east" && (N.x = 0 + V / 2, N.y = 0)), v === "south_west" && (M === "south" && (N.x = 100, N.y = 0 + $ / 2), M === "west" && (N.x = 100, N.y = 0 + $ / 2))), C === "north" && (v === "north_west" && (M === "north" && (N.x = 0, N.y = 0 - $ / 2), M === "west" && (N.x = 0 - V / 2, N.y = 0)), v === "north_east" && (M === "north" && (N.x = 0, N.y = 0 - $ / 2), M === "east" && (N.x = 0 + V / 2, N.y = 0)), v === "south_east" && (M === "south" && (N.x = 0 + V / 2, N.y = -100), M === "east" && (N.x = 0 + V / 2, N.y = -100)), v === "south_west" && (M === "south" && (N.x = 0 - V / 2, N.y = -100), M === "west" && (N.x = 0 - V / 2, N.y = -100))), C === "south" && (v === "north_west" && (M === "north" && (N.x = 0 - V / 2, N.y = 100), M === "west" && (N.x = 0 - V / 2, N.y = 100)), v === "north_east" && (M === "north" && (N.x = 0 + V / 2, N.y = 100), M === "east" && (N.x = 0 + V / 2, N.y = 100)), v === "south_east" && (M === "south" && (N.x = 0, N.y = 0 + $ / 2), M === "east" && (N.x = 0 + V / 2, N.y = 0)), v === "south_west" && (M === "south" && (N.x = 0, N.y = $ / 2), M === "west" && (N.x = 0 - V / 2, N.y = 0))), N; } function p(C, v, M, V) { const $ = { x: 0, y: 0 }; return C === "south" && (v === "west" && ($.x = -100, $.y = 0 - V / 2), v === "east" && ($.x = 100, $.y = -100), v === "south" && ($.x = 0 - M / 2, $.y = 100), (v === "north" || v === "center") && ($.x = 0, $.y = 0 - V / 2)), C === "north" && (v === "west" && ($.x = -100, $.y = 100), v === "east" && ($.x = 100, $.y = 100), v === "north" && ($.x = 0 - M / 2, $.y = -100), (v === "south" || v === "center") && ($.x = 0, $.y = V / 2)), C === "east" && (v === "north" && ($.y = -100, $.x = -100), v === "south" && ($.y = 100, $.x = -100), v === "east" && ($.x = 100, $.y = 100), (v === "west" || v === "center") && ($.x = 0 - M / 2, $.y = 0)), C === "west" && (v === "north" && ($.y = -100, $.x = 100), v === "south" && ($.y = 100, $.x = 100), v === "west" && ($.x = -100, $.y = V / 2), (v === "east" || v === "center") && ($.x = M / 2, $.y = 0)), $; } function f(C, v, M, V, $, N, G) { const K = G === "south" || G === "east" ? "portrait" : "landscape", L = $, W = K === "landscape" ? "east" : "north", Y = G === "center" ? K === "landscape" ? "west" : "south" : G, J = h(L, N, W, C, v), { x: U, y: X } = J, A = p(W, Y, C, v), { x: H, y: ee } = A; ee < 0 && (v += Math.abs(ee)); const te = /* @__PURE__ */ new Map([["default", 0 + U], ["portrait", 0 + U], ["landscape", 0 + U]]), Q = /* @__PURE__ */ new Map([["default", v + X], ["portrait", v + X], ["landscape", v + X]]); U < 0 && (C += Math.abs(U)), H > 0 && (C += H); const Fe = /* @__PURE__ */ new Map([["default", C + H], ["portrait", C + H], ["landscape", C + H]]), xe = /* @__PURE__ */ new Map([["default", 0 + ee], ["portrait", 0 + ee], ["landscape", 0 + ee]]), _e = V.left > o.left, Ee = V.bottom > o.bottom, Be = _e ? 0 : Ee ? C / 2 : te.get(K), Me = Ee ? v + V.bottom : _e ? v / 2 : Q.get(K), Ne = Fe.get(K), De = xe.get(K); return [{ x: Be, y: Me }, { x: Ne, y: De }, { x: H, y: ee }]; } function s(C, v, M, V, $, N, G) { const K = G === "south" || G === "west" ? "portrait" : "landscape", L = $, W = K === "landscape" ? "west" : "north", Y = G, J = h(L, N, W, C, v), { x: U, y: X } = J, A = p(W, Y, C, v), { x: H, y: ee } = A; ee < 0 && (v += Math.abs(ee)), U > 0 && (C += U), H < 0 && (C += Math.abs(H)); const te = /* @__PURE__ */ new Map([["default", C + U], ["portrait", C + U], ["landscape", C + U]]), Q = /* @__PURE__ */ new Map([["default", v + X], ["portrait", v + X], ["landscape", v + X]]), Fe = /* @__PURE__ */ new Map([["default", 0 + H], ["portrait", 0 + H], ["landscape", 0 + H]]), xe = /* @__PURE__ */ new Map([["default", 0 + ee], ["portrait", 0 + ee], ["landscape", 0 + ee]]), _e = V.right > o.right, Ee = V.bottom > o.bottom, Be = _e ? C + V.right : Ee ? C / 2 : te.get(K), Me = Ee ? v + V.bottom : _e ? v / 2 : Q.get(K), Ne = Fe.get(K), De = xe.get(K); return [{ x: Be, y: Me }, { x: Ne, y: De }, { x: H, y: ee }]; } function y(C, v, M, V, $, N, G) { const K = G === "north" || G === "east" ? "portrait" : "landscape", L = $, W = K === "landscape" ? "east" : "south", Y = G, J = h(L, N, W, C, v), { x: U, y: X } = J, A = p(W, Y, C, v), { x: H, y: ee } = A, te = /* @__PURE__ */ new Map([["default", 0 + U], ["portrait", 0 + U], ["landscape", 0 + U]]), Q = /* @__PURE__ */ new Map([["default", 0 + X], ["portrait", 0 + X], ["landscape", 0 + X]]); U < 0 && (C += Math.abs(U)), X < 0 && (v += Math.abs(X)), H > 0 && (C += H), ee > 0 && (v += ee); const Fe = /* @__PURE__ */ new Map([["default", C + H], ["portrait", C + H], ["landscape", C + H]]), xe = /* @__PURE__ */ new Map([["default", v + ee], ["portrait", v + ee], ["landscape", v + ee]]), _e = V.left > o.left, Ee = V.top > o.top, Be = _e ? 0 : Ee ? C / 2 : te.get(K), Me = Ee ? 0 : _e ? v / 2 : Q.get(K), Ne = Fe.get(K), De = xe.get(K); return [{ x: Be, y: Me }, { x: Ne, y: De }, { x: H, y: ee }]; } function g(C, v, M, V, $, N, G) { const K = G === "north" || G === "west" ? "portrait" : "landscape", L = $, W = K === "landscape" ? "west" : "south", Y = G, J = h(L, N, W, C, v), { x: U, y: X } = J, A = p(W, Y, C, v), { x: H, y: ee } = A; H < 0 && (C += Math.abs(H)); const te = /* @__PURE__ */ new Map([["default", C + U], ["portrait", C + U], ["landscape", C + U]]), Q = /* @__PURE__ */ new Map([["default", 0 + X], ["portrait", 0 + X], ["landscape", 0 + X]]); X < 0 && (v += Math.abs(X)), ee > 0 && (v += ee); const Fe = /* @__PURE__ */ new Map([["default", 0 + H], ["portrait", 0 + H], ["landscape", 0 + H]]), xe = /* @__PURE__ */ new Map([["default", v + ee], ["portrait", v + ee], ["landscape", v + ee]]), _e = V.right > o.right, Ee = V.top > o.top, Be = _e ? C + V.right : Ee ? C / 2 : te.get(K), Me = Ee ? 0 : _e ? v / 2 : Q.get(K), Ne = Fe.get(K), De = xe.get(K); return [{ x: Be, y: Me }, { x: Ne, y: De }, { x: H, y: ee }]; } const k = /* @__PURE__ */ new Map([ ["north_east", f], ["north_west", s], ["south_east", y], ["south_west", g] ]), _ = /* @__PURE__ */ new Map([ ["east", ["north_west", "south_west"]], ["west", ["north_east", "south_east"]], ["north", ["south_west", "south_east"]], ["south", ["north_west", "north_east"]], ["center", []] ]); function d(C, v) { return C === "north_west" ? { aroundDirection: "north_west", left: v.left, right: 100, top: v.top, bottom: v.top } : C === "south_west" ? { aroundDirection: "south_west", left: v.left, right: 100, top: v.top, bottom: v.bottom } : v; } function S(C, v) { return C === "north_east" ? { left: 100, right: v.right, top: v.top, bottom: v.top } : C === "south_east" ? { left: 100, right: v.right, top: v.top, bottom: v.bottom } : v; } function b(C, v) { return C === "south_west" ? { left: v.left, right: v.right, top: 100, bottom: v.top } : C === "south_east" ? { left: v.left, right: v.right, top: 100, bottom: v.bottom } : v; } function m(C, v) { return C === "north_west" ? { left: v.left, right: v.right, top: v.top, bottom: 100 } : C === "north_east" ? { left: v.left, right: v.right, top: v.top, bottom: 100 } : v; } function w(C, v) { return v; } const O = /* @__PURE__ */ new Map([ ["east", d], ["west", S], ["north", b], ["south", m], ["center", w] ]); function l(C, v, M, V) { const $ = v.x - C.x, N = v.y - C.y, G = $ >= 0 ? "east" : "west", K = N >= 0 ? "south" : "north", L = `${K}_${G}`, Y = (_.get(M) || []).includes(L), J = O.get(M), U = Y ? J(L, o) : o, X = Math.abs($), A = Math.abs(N), H = k.get(`${K}_${G}`), [ee, te, Q] = H( X, A, Y, U, M, L, V ), Fe = G === "west" ? Q.x < 0 ? Math.abs(Q.x) : 0 : Q.x > 0 ? Q.x : 0, xe = U.left + U.right + X + Fe, _e = K === "north" ? Q.y < 0 ? Math.abs(Q.y) : 0 : Q.y > 0 ? Q.y : 0, Ee = U.top + U.bottom + A + _e, Be = G === "east" ? C.x - U.left : C.x + U.right - xe, Me = K === "south" ? C.y - U.top : C.y + U.bottom - Ee, Ne = G === "east" ? U.left : xe - U.right, De = K === "north" ? Ee - U.bottom : U.top, et = G === "west" ? Q.x < 0 ? Math.abs(Q.x) : 0 : Q.x < 0 ? xe : xe - Q.x, re = K === "north" ? Q.y < 0 ? Math.abs(Q.y) : 0 : Q.y < 0 ? Ee : Ee - Q.y; return { width: xe, height: Ee, left: Be, top: Me, startPoinInBoundray: { x: Ne, y: De }, firstControlPoint: ee, secondControlPoint: te, endPoinInBoundray: { x: et, y: re } }; } function x(C, v, M, V, $) { C.style.position = "absolute", C.style.alignItems = "center", C.style.left = `${v}px`, C.style.top = `${M}px`, C.style.width = V + "px", C.style.height = $ + "px"; } function T(C, v, M, V, $, N, G) { const K = C.childNodes[0]; K.setAttribute("width", String(v)), K.setAttribute("height", String(M)), C.appendChild(K); const L = K.childNodes[0], W = `${V.x} ${V.y}`, Y = `${$.x} ${$.y}`, J = `${N.x} ${N.y}`, U = `${G.x} ${G.y}`, X = "M ".concat(W).concat(" C ").concat(Y).concat("," + J + ",").concat(U); L.setAttribute("d", X), L.setAttribute("fill", "none"), L.setAttribute("stroke", "#4d53e8"), L.setAttribute("stroke-width", "2"), L.setAttribute("class", ""); } function I(C, v, M, V, $) { const { width: N, height: G, left: K, top: L, startPoinInBoundray: W, firstControlPoint: Y, secondControlPoint: J, endPoinInBoundray: U } = l(v, M, V, $); x(C, K, L, N, G), T(C, N, G, W, Y, J, U); } function E(C, v, M, V, $) { const N = u(C); I(N, v, M, V, $); } function P(C) { return Number(C.replace("px", "")); } function R(C) { if (C !== null) { const v = C.parentNode, M = P(v.style.left), V = P(v.style.top); return { x: M + C.offsetLeft + C.offsetWidth / 2, y: V + C.offsetTop + C.offsetHeight / 2 }; } return { x: 0, y: 0 }; } function j(C, v) { const M = document.getElementById(C), V = document.getElementById(v), $ = R(M), N = R(V), G = $.x + 2, K = $.y, L = N.x - 2, W = N.y; return { startPoint: { x: G, y: K }, endPoint: { x: L, y: W } }; } function D(C, v, M, V) { const { startPoint: $, endPoint: N } = j(C, v); E(`${C}_${v}`, $, N, M, V); } return { connect: D, drawing: E }; } function di(e) { const t = F(), n = F(0), o = F(0), r = F({ x: 0, y: 0 }), a = F(), { drawing: i } = e; function c(d) { return Number(d.replace("px", "")); } function u(d) { return (d && d.className && d.className.split ? d.className.split(" ") : []).includes("f-flow-ancher"); } function h(d) { switch ((d ? d.className.split(" ") : []).find((m) => m.startsWith("circle-")) || "") { case "circle-left": return "west"; case "circle-right": return "east"; case "circle-top": return "north"; case "circle-bottom": return "south"; default: return "center"; } } function p(d, S, b) { const m = b.getBoundingClientRect(); n.value = m.left, o.value = m.top, r.value = { x: d, y: S }, t.value = h(b); } function f(d) { var x; const S = d.clientX - n.value, b = d.clientY - o.value, m = r.value.x + S, w = r.value.y + b, O = d.target, l = O && typeof O.className == "string" && u(O) ? h(O) : "center"; i( `${(x = a.value) == null ? void 0 : x.id}_curve_to`, { x: r.value.x, y: r.value.y }, { x: m, y: w }, t.value, l ); } function s(d) { const S = document.getElementById(d); S && S.remove(); } function y() { document.addEventListener("mousemove", f); } function g() { document.removeEventListener("mousemove", f); } function k(d) { a.value = void 0, g(); } function _(d, S) { a.value = document.getElementById(d); const b = a.value.offsetParent, m = a.value.getBoundingClientRect(), w = b.getBoundingClientRect(), O = c(b.style.left) + (m.left - w.left), l = c(b.style.top) + (m.top - w.top), x = O + m.width / 2, T = l + m.height / 2; p(x, T, a.value), y(); } return { drawFrom: _, eraseDrawingLine: s, finishToDraw: k, getAncherPointPosition: h, isAncherPoint: u }; } const fi = { id: { type: String, default: "" }, type: { type: String, default: "" }, /** * 组件值 */ modelValue: { type: Object }, x: { type: Number, default: 0 }, y: { type: Number, default: 0 }, connection: { type: Array, default: [] } }, xt = F(0); function pi(e, t) { const n = t.getBoundingClientRect(), o = e.getBoundingClientRect(), r = o.top >= n.top, a = o.top <= n.bottom; return r && a; } function mi(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 a = n.left - r.width; const i = document.querySelector(".editorDiv"); if (i) { const c = i.getBoundingClientRect(); a < c.left && ({ left: a } = e.getBoundingClientRect()); } o.style.left = a + "px"; } } } function vi(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 Co(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 = vi(e); if (r && (o = pi(e, r)), !o) { n.style.display = "none"; return; } mi(e); } } function Dt(e) { if (!e) return; let t; e.className.includes("dgComponentSelected") ? t = e : t = e.querySelector(".dgComponentSelected"), t && Co(t); } const hi = { /** * 组件值 */ modelValue: { type: Object, default: {} }, componentId: { type: String, default: "" } }; var ht = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function gi(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } function Bt(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 wo = { exports: {} }; (function(e, t) { (function(n) { e.exports = n(); })(function() { return (/* @__PURE__ */ function() { function n(o, r, a) { function i(h, p) { if (!r[h]) { if (!o[h]) { var f = typeof Bt == "function" && Bt; if (!p && f) return f(h, !0); if (c) return c(h, !0); var s = new Error("Cannot find module '" + h + "'"); throw s.code = "MODULE_NOT_FOUND", s; } var y = r[h] = { exports: {} }; o[h][0].call(y.exports, function(g) { var k = o[h][1][g]; return i(k || g); }, y, y.exports, n, o, r, a); } return r[h].exports; } for (var c = typeof Bt == "function" && Bt, 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(f) { var s = a[f]; return s ? s.lastIndex = 0 : a[f] = s = new RegExp(i + f + c, "g"), s; } function h(f, s) { var y = f.className; y.length ? u(s).test(y) || (f.className += " " + s) : f.className = s; } function p(f, s) { f.className = f.className.replace(u(s), " ").trim(); } o.exports = { add: h, rm: p }; }, {}], 2: [function(n, o, r) { (function(a) { var i = n("contra/emitter"), c = n("crossvent"), u = n("./classes"), h = document, p = h.documentElement; function f(E, P) { var R = arguments.length; R === 1 && Array.isArray(E) === !1 && (P = E, E = []); var j, D, C, v, M, V, $, N, G, K = null, L, W, Y = !1, J = 0, U, X = P || {}; X.moves === void 0 && (X.moves = S), X.accepts === void 0 && (X.accepts = S), X.invalid === void 0 && (X.invalid = et), X.containers === void 0 && (X.containers = E || []), X.isContainer === void 0 && (X.isContainer = d), X.copy === void 0 && (X.copy = !1), X.copySortSource === void 0 && (X.copySortSource = !1), X.revertOnSpill === void 0 && (X.revertOnSpill = !1), X.removeOnSpill === void 0 && (X.removeOnSpill = !1), X.direction === void 0 && (X.direction = "vertical"), X.ignoreInputTextSelection === void 0 && (X.ignoreInputTextSelection = !0), X.mirrorContainer === void 0 && (X.mirrorContainer = h.body); var A = i({ containers: X.containers, start: Ne, end: re, cancel: dt, remove: Pe, destroy: Fe, canMove: Me, dragging: !1 }); return X.removeOnSpill === !0 && A.on("over", me).on("out", be), ee(), A; function H(q) { return A.containers.indexOf(q) !== -1 || X.isContainer(q); } function ee(q) { var oe = q ? "remove" : "add"; g(p, oe, "mousedown", _e), g(p, oe, "mouseup", Ve); } function te(q) { var oe = q ? "remove" : "add"; g(p, oe, "mousemove", Ee); } function Q(q) { var oe = q ? "remove" : "add"; c[oe](p, "selectstart", xe), c[oe](p, "click", xe); } function Fe() { ee(!0), Ve({}); } function xe(q) { L && q.preventDefault(); } function _e(q) { v = q.clientX, M = q.clientY; var oe = k(q) !== 1 || q.metaKey || q.ctrlKey; if (!oe) { var ne = q.target, de = Be(ne); de && (L = de, te(), q.type === "mousedown" && (O(ne) ? ne.focus() : q.preventDefault())); } } function Ee(q) { if (L) { if (k(q) === 0) { Ve({}); return; } if (!(q.clientX !== void 0 && Math.abs(q.clientX - v) <= (X.slideFactorX || 0) && q.clientY !== void 0 && Math.abs(q.clientY - M) <= (X.slideFactorY || 0))) { if (X.ignoreInputTextSelection) { var oe = I("clientX", q) || 0, ne = I("clientY", q) || 0, de = h.elementFromPoint(oe, ne); if (O(de)) return; } var Ce = L; te(!0), Q(), re(), De(Ce), u.add(N || C, "gu-transit"), Re(), Ie(), J = 0, Qe(q); } } } function Be(q) { if (!(A.dragging && j) && !H(q)) { for (var oe = q; w(q) && H(w(q)) === !1; ) if (X.invalid(q, oe) || (q = w(q), !q)) return; var ne = w(q); if (ne && !X.invalid(q, oe)) { var de = X.moves(q, ne, oe, x(q)); if (de) return { item: q, source: ne }; } } } function Me(q) { return !!Be(q); } function Ne(q) { var oe = Be(q); oe && De(oe); } function De(q) { qe(q.item, q.source) && (N = q.item.cloneNode(!0), A.emit("cloned", N, q.item, "copy")), D = q.source, C = q.item, V = $ = x(q.item), A.dragging = !0, A.emit("drag", C, D); } function et() { return !1; } function re() { if (A.dragging) { var q = N || C; Ae(q, w(q)); } } function Se() { L = !1, te(!0), Q(!0); } function Ve(q) { if (Se(), !!A.dragging) { var oe = N || C, ne = I("clientX", q) || 0, de = I("clientY", q) || 0, Ce = _(j, ne, de), we = mt(Ce, ne, de); we && (N && X.copySortSource || !N || we !== D) ? Ae(oe, we) : X.removeOnSpill ? Pe() : dt(); } } function Ae(q, oe) { var ne = w(q); N && X.copySortSource && oe === D && ne.removeChild(C), at(oe) ? A.emit("cancel", q, D) : A.emit("drop", q, oe, D, $), it(); } function Pe() { if (A.dragging) { var q = N || C, oe = w(q); oe && oe.removeChild(q), A.emit(N ? "cancel" : "remove", q, oe, D), it(); } } function dt(q) { if (A.dragging) { var oe = arguments.length > 0 ? q : X.revertOnSpill, ne = N || C, de = w(ne), Ce = at(de); Ce === !1 && oe && (N ? de && de.removeChild(N) : D.insertBefore(ne, V)), Ce || oe ? A.emit("cancel", ne, D, D) : A.emit("drop", ne, de, D, $), it(); } } function it() { var q = N || C; Se(), Ge(), Ke(), q && u.rm(q, "gu-transit"), G && clearTimeout(G), A.dragging = !1, K && A.emit("out", q, K, D), A.emit("dragend", q, J), D = C = N = V = $ = G = K = null; } function at(q, oe) { var ne; return oe !== void 0 ? ne = oe : j ? ne = $ : ne = x(N || C), q === D && ne === V; } function mt(q, oe, ne) { for (var de = q; de && !Ce(); ) de = w(de); return de; function Ce() { var we = H(de); if (we === !1) return !1; var se = lt(de, q), ke = je(de, se, oe, ne), We = at(de, ke); return We ? !0 : X.accepts(C, de, D, ke); } } function Qe(q) { if (!j) return; q.preventDefault(); var oe = I("clientX", q) || 0, ne = I("clientY", q) || 0; j.style.left = oe - 2 + "px", j.style.top = ne - 2 + "px"; var de = N || C, Ce = _(j, oe, ne), we = mt(Ce, oe, ne), se = we !== null && we !== K; (se || we === null) && (nt(), K = we, vt()), Te(Ce, ne); var ke = w(de); if (we === D && N && !X.copySortSource) { ke && ke.removeChild(de); return; } var We, tt = lt(we, Ce); if (Y = st(tt, we), tt !== null) We = je(we, tt, oe, ne); else if (X.revertOnSpill === !0 && !N) We = V, we = D; else { N && ke && ke.removeChild(de), N && W && (W.style.display = "none"); return; } W.style.display = "block", ae(We, de, se), We ? Z(tt, We) : ye(we); function Ue(Xe) { A.emit(Xe, de, K, D); } function vt() { se && Ue("over"); } function nt() { K && Ue("out"); } } function ae(q, oe, ne) { (q === oe || q === x(oe)) && ($ = x(oe)), (q === null && ne || q !== oe && q !== x(oe)) && ($ = q); } function me(q) { u.rm(q, "gu-hide"); } function be(q) { A.dragging && u.add(q, "gu-hide"); } function Ie() { j || (j = document.createElement("div"), j.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;", j.innerHTML = X.getMirrorText && X.getMirrorText(C) || "控件", u.add(j, "gu-mirror"), X.mirrorContainer.appendChild(j), g(p, "add", "mousemove", Qe), u.add(X.mirrorContainer, "gu-unselectable"), A.emit("cloned", j, C, "mirror")); } function Re() { if (W = document.createElement("div"), u.add(W, "gu-insertion"), C) { var q = C.getBoundingClientRect(); W.style.left = q.left + "px", W.style.top = q.top + "px"; } Y = !1, X.mirrorContainer.appendChild(W); } function Ge() { j && (u.rm(X.mirrorContainer, "gu-unselectable"), g(p, "remove", "mousemove", Qe), w(j).removeChild(j), j = null); } function Ke() { W && (w(W).removeChild(W), W = null); } function lt(q, oe) { for (var ne = oe; ne !== q && w(ne) !== q; ) ne = w(ne); return ne === p ? null : ne; } function st(q, oe) { if (!oe) return Y; var ne = q || oe && oe.lastElementChild; if (!ne) return !0; var de = getComputedStyle(q), Ce = /^inline/.test(de.getPropertyValue("display")) || /^(left|right)$/.test(de.getPropertyValue("float")); if (Ce) return !0; if (oe) { var we = getComputedStyle(oe), se = we.getPropertyValue("display"); if (/flex$/.test(se)) { var ke = we.getPropertyValue("flex-direction") || "row"; if (ke === "row" || ke === "row-reverse") return !Je(oe); } return !1; } return !0; } function Je(q) { if (!q.children || !q.children.length) return !1; for (const oe of Array.from(q.children)) { const de = (oe.className && oe.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(q, oe) { const ne = oe.getBoundingClientRect(); if (W.style.left = ne.left + "px", W.style.top = ne.top + "px", Y) { if (W.style.height = ne.height + "px", W.style.width = "4px", q) { const de = q.getBoundingClientRect(); de.top !== ne.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 = ne.width + "px", U) { const de = U.getBoundingClientRect(); ne.top < de.top && (W.style.display = "none"); } oe === C && C && (W.style.display = "none"); } function ye(q) { $ = null; var oe = q.lastElementChild; if (oe) { var ne = oe.getBoundingClientRect(); Y ? (W.style.left = ne.right + "px", W.style.top = ne.top + "px", W.style.height = ne.height + "px", W.style.width = "4px") : (W.style.left = ne.left + "px", W.style.top = ne.bottom + "px", W.style.height = "4px", W.style.width = ne.width + "px"), oe === C && C && (W.style.display = "none"); } else W.style.display = "none"; } function Te(q, oe) { if (!X.mirrorContainer.contains(q) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (U = s(q), !U || !U.contains(q))) return; const ne = document.querySelector(".dgComponentSelected"), de = U.getBoundingClientRect(); if (oe - 30 < de.top && U.scrollTop > 0) { let Ce = U.scrollTop < 10 ? U.scrollTop : 10; U.scrollBy(0, -1 * Ce), ne && U.contains(ne) && (J = J + -1 * Ce); } if (oe + 30 > de.bottom && U.scrollTop < U.scrollHeight - U.clientHeight) { const Ce = U.scrollHeight - U.clientHeight - U.scrollTop; let we = Ce < 10 ? Ce : 10; U.scrollBy(0, we), ne && U.contains(ne) && (J = J + we); } } function je(q, oe, ne, de) { var Ce = X.direction === "horizontal", we = X.direction === "mixed", se = oe !== q ? We() : ke(); return se; function ke() { var Ue = q.children.length, vt, nt, Xe; for (vt = 0; vt < Ue; vt++) if (nt = q.children[vt], Xe = nt.getBoundingClientRect(), Ce && Xe.left + Xe.width / 2 > ne || !we && !Ce && Xe.top + Xe.height / 2 > de || we && Xe.left + Xe.width > ne && Xe.top + Xe.height > de) return nt; return null; } function We() { var Ue = oe.getBoundingClientRect(); if (we) { var vt = de - Ue.top, nt = ne - Ue.left, Xe = Ue.bottom - de, At = Ue.right - ne, Wt = Math.min(nt, At, vt, Xe), Ht; return Y ? Ht = At < nt : Ht = Xe === Wt || At === Wt || nt === Wt, tt(Ht); } return tt(Ce ? ne > Ue.left + b(Ue) / 2 : de > Ue.top + m(Ue) / 2); } function tt(Ue) { return Ue ? x(oe) : oe; } } function qe(q, oe) { return typeof X.copy == "boolean" ? X.copy : X.copy(q, oe); } } function s(E) { const P = Array.from(window.scrollContainerList); if (P.length === 1) { const j = Array.from(window.scrollContainerList)[0]; return document.getElementById(j); } const R = y(P); for (const j of R) if (j.contains(E)) return j; return null; } function y(E) { const P = []; return E.forEach((R) => { const j = document.getElementById(R); j && P.push(j); }), P.sort((R, j) => R.contains(j) ? 1 : j.contains(R) ? -1 : 0), P; } function g(E, P, R, j) { var D = { mouseup: "touchend", mousedown: "touchstart", mousemove: "touchmove" }, C = { mouseup: "pointerup", mousedown: "pointerdown", mousemove: "pointermove" }, v = { mouseup: "MSPointerUp", mousedown: "MSPointerDown", mousemove: "MSPointerMove" }; a.navigator.pointerEnabled ? c[P](E, C[R], j) : a.navigator.msPointerEnabled ? c[P](E, v[R], j) : (c[P](E, D[R], j), c[P](E, R, j)); } function k(E) { if (E.touches !== void 0) return E.touches.length; if (E.which !== void 0 && E.which !== 0) return E.which; if (E.buttons !== void 0) return E.buttons; var P = E.button; if (P !== void 0) return P & 1 ? 1 : P & 2 ? 3 : P & 4 ? 2 : 0; } function _(E, P, R) { E = E || {}; var j = E.className || "", D; return E.className += " gu-hide", D = h.elementFromPoint(P, R), E.className = j, D; } function d() { return !1; } function S() { return !0; } function b(E) { return E.width || E.right - E.left; } function m(E) { return E.height || E.bottom - E.top; } function w(E) { return E.parentNode === h ? null : E.parentNode; } function O(E) { return E.tagName === "INPUT" || E.tagName === "TEXTAREA" || E.tagName === "SELECT" || l(E); } function l(E) { return !E || E.contentEditable === "false" ? !1 : E.contentEditable === "true" ? !0 : l(w(E)); } function x(E) { return E.nextElementSibling || P(); function P() { var R = E; do R = R.nextSibling; while (R && R.nodeType !== 1); return R; } } function T(E) { return E.targetTouches && E.targetTouches.length ? E.targetTouches[0] : E.changedTouches && E.changedTouches.length ? E.changedTouches[0] : E; } function I(E, P) { var R = T(P), j = { pageX: "clientX", // IE8 pageY: "clientY" // IE8 }; return E in j && !(E in R) && j[E] in R && (E = j[E]), R[E]; } o.exports = f; }).call(this, typeof ht < "u" ? ht : 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, h) { c && a(function() { c.apply(h || null, u || []); }); }; }, { ticky: 10 }], 5: [function(n, o, r) { var a = n("atoa"), i = n("./debounce"); o.exports = function(u, h) { var p = h || {}, f = {}; return u === void 0 && (u = {}), u.on = function(s, y) { return f[s] ? f[s].push(y) : f[s] = [y], u; }, u.once = function(s, y) { return y._once = !0, u.on(s, y), u; }, u.off = function(s, y) { var g = arguments.length; if (g === 1) delete f[s]; else if (g === 0) f = {}; else { var k = f[s]; if (!k) return u; k.splice(k.indexOf(y), 1); } return u; }, u.emit = function() { var s = a(arguments); return u.emitterSnapshot(s.shift()).apply(this, s); }, u.emitterSnapshot = function(s) { var y = (f[s] || []).slice(0); return function() { var g = a(arguments), k = this || u; if (s === "error" && p.throws !== !1 && !y.length) throw g.length === 1 ? g[0] : g; return y.forEach(function(d) { p.async ? i(d, g, k) : d.apply(k, g), d._once && u.off(s, d); }), u; }; }, u; }; }, { "./debounce": 4, atoa: 3 }], 6: [function(n, o, r) { (function(a) { var i = n("custom-event"), c = n("./eventmap"), u = a.document, h = s, p = g, f = []; a.addEventListener || (h = y, p = k), o.exports = { add: h, remove: p, fabricate: _ }; function s(w, O, l, x) { return w.addEventListener(O, l, x); } function y(w, O, l) { return w.attachEvent("on" + O, S(w, O, l)); } function g(w, O, l, x) { return w.removeEventListener(O, l, x); } function k(w, O, l) { var x = b(w, O, l); if (x) return w.detachEvent("on" + O, x); } function _(w, O, l) { var x = c.indexOf(O) === -1 ? I() : T(); w.dispatchEvent ? w.dispatchEvent(x) : w.fireEvent("on" + O, x); function T() { var E; return u.createEvent ? (E = u.createEvent("Event"), E.initEvent(O, !0, !0)) : u.createEventObject && (E = u.createEventObject()), E; } function I() { return new i(O, { detail: l }); } } function d(w, O, l) { return function(T) { var I = T || a.event; I.target = I.target || I.srcElement, I.preventDefault = I.preventDefault || function() { I.returnValue = !1; }, I.stopPropagation = I.stopPropagation || function() { I.cancelBubble = !0; }, I.which = I.which || I.keyCode, l.call(w, I); }; } function S(w, O, l) { var x = b(w, O, l) || d(w, O, l); return f.push({ wrapper: x, element: w, type: O, fn: l }), x; } function b(w, O, l) { var x = m(w, O, l); if (x) { var T = f[x].wrapper; return f.splice(x, 1), T; } } function m(w, O, l) { var x, T; for (x = 0; x < f.length; x++) if (T = f[x], T.element === w && T.type === O && T.fn === l) return x; } }).call(this, typeof ht < "u" ? ht : 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 ht < "u" ? ht : 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(h, p) { var f = document.createEvent("CustomEvent"); return p ? f.initCustomEvent(h, p.bubbles, p.cancelable, p.detail) : f.initCustomEvent(h, !1, !1, void 0), f; } : ( // IE <= 8 function(h, p) { var f = document.createEventObject(); return f.type = h, p ? (f.bubbles = !!p.bubbles, f.cancelable = !!p.cancelable, f.detail = p.detail) : (f.bubbles = !1, f.cancelable = !1, f.detail = void 0), f; } ) ); }).call(this, typeof ht < "u" ? ht : 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 h() { 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 = h; } catch { c = h; } })(); function p(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 f(m) { if (c === clearTimeout) return clearTimeout(m); if ((c === h || !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 = [], y = !1, g, k = -1; function _() { !y || !g || (y = !1, g.length ? s = g.concat(s) : k = -1, s.length && d()); } function d() { if (!y) { var m = p(_); y = !0; for (var w = s.length; w; ) { for (g = s, s = []; ++k < w; ) g && g[k].run(); k = -1, w = s.length; } g = null, y = !1, f(m); } } a.nextTick = function(m) { var w = new Array(arguments.length - 1); if (arguments.length > 1) for (var O = 1; O < arguments.length; O++) w[O - 1] = arguments[O]; s.push(new S(m, w)), s.length === 1 && !y && p(d); }; function S(m, w) { this.fun = m, this.array = w; } S.prototype.run = function() { this.fun.apply(null, this.array); },