UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,104 lines 225 kB
var nr = Object.defineProperty; var or = (e, t, n) => t in e ? nr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var Le = (e, t, n) => or(e, typeof t != "symbol" ? t + "" : t, n); import { ref as b, defineComponent as je, computed as U, watch as xe, createVNode as C, Fragment as ut, reactive as et, createApp as gn, onUnmounted as wt, onMounted as Qe, Transition as yn, mergeProps as at, nextTick as Jt, createTextVNode as He, inject as Ce, onBeforeMount as hn, Teleport as rr, shallowRef as ir, render as Wt, h as ar, cloneVNode as sr, provide as st, triggerRef as lr, onBeforeUnmount as cr, isVNode as ur } from "vue"; import { isUndefined as Ze, cloneDeep as Ct, isPlainObject as sn, merge as Ft, findIndex as ln } from "lodash-es"; import { useI18n as Zt } from "vue-i18n"; import { LocaleService as Dt } from "../locale/index.esm.js"; import { getCustomClass as pt, withInstall as dr, FormSchemaEntityField$Type as cn, FormSchemaEntityFieldTypeName as un } from "../common/index.esm.js"; import { useResizeObserver as fr } from "@vueuse/core"; import { getHierarchyRow as pr, useIdentify as mr, useGroupData as vr, useFilter as gr, useHierarchy as yr, useLoading as hr, useDataView as br, useSelection as Cr, useSelectHierarchyItem as wr, usePagination as Sr, useDataViewContainerStyle as xr, useCommandColumn as Fr, useSettingColumn as Tr, useColumn as Br, useSort as Mr, useGroupColumn as kr, useRow as Or, useEdit as Er, useVisualDataBound as Pr, useVisualDataCell as Dr, useVisualDataRow as Ir, useVisualData as Nr, useCellPosition as Rr, useSidebar as jr, useVirtualScroll as $r, useFitColumn as Lr, useFilterHistory as Ar, useColumnFilter as Vr, useDragColumn as zr, getColumnHeader as Hr, getSidebar as _r, getDisableMask as qr, getHorizontalScrollbar as Ur, getVerticalScrollbar as Wr, getEmpty as Gr, getPagination as Yr, getSummary as Xr } from "../data-view/index.esm.js"; import { getSchemaByTypeForDesigner as Qr, schemaMapForDesigner as Jr, propertyConfigSchemaMapForDesigner as Zr, propertyEffectMapForDesigner as Kr, schemaResolverMapForDesigner as ei, createPropsResolver as bn, resolveAppearance as ti } from "../dynamic-resolver/index.esm.js"; import "../designer-canvas/index.esm.js"; import "../property-panel/index.esm.js"; import Cn from "../accordion/index.esm.js"; import wn from "../avatar/index.esm.js"; import Sn from "../../designer/button-edit/index.esm.js"; import xn from "../button-group/index.esm.js"; import Fn from "../calendar/index.esm.js"; import Tn from "../capsule/index.esm.js"; import Gt from "../../designer/checkbox/index.esm.js"; import Ot from "../../designer/checkbox-group/index.esm.js"; import Bn from "../combo-list/index.esm.js"; import ni from "../combo-tree/index.esm.js"; import Mn from "../component/index.esm.js"; import kn from "../color-picker/index.esm.js"; import On from "../content-container/index.esm.js"; import En from "../date-picker/index.esm.js"; import Pn from "../../designer/data-grid/index.esm.js"; import Dn from "../dropdown/index.esm.js"; import In from "../dynamic-form/index.esm.js"; import oi from "../events-editor/index.esm.js"; import Nn from "../filter-bar/index.esm.js"; import ri from "../field-selector/index.esm.js"; import ii, { FBindingSelectorContainer as ai } from "../binding-selector/index.esm.js"; import Rn from "../image-cropper/index.esm.js"; import jn from "../../designer/input-group/index.esm.js"; import $n from "../layout/index.esm.js"; import Ln from "../list-nav/index.esm.js"; import An from "../../designer/list-view/index.esm.js"; import Vn from "../lookup/index.esm.js"; import si from "../mapping-editor/index.esm.js"; import zn from "../nav/index.esm.js"; import Hn from "../number-range/index.esm.js"; import _n from "../number-spinner/index.esm.js"; import qn from "../order/index.esm.js"; import Un from "../page-header/index.esm.js"; import Wn from "../page-footer/index.esm.js"; import Gn from "../pagination/index.esm.js"; import Yn from "../progress/index.esm.js"; import Xn from "../query-solution/index.esm.js"; import Qn from "../../designer/radio-group/index.esm.js"; import Jn from "../rate/index.esm.js"; import Zn from "../response-toolbar/index.esm.js"; import Kn from "../response-layout/index.esm.js"; import eo from "../response-layout-editor/index.esm.js"; import to from "../search-box/index.esm.js"; import no from "../section/index.esm.js"; import oo from "../smoke-detector/index.esm.js"; import ro from "../splitter/index.esm.js"; import io from "../step/index.esm.js"; import ao from "../switch/index.esm.js"; import so from "../tabs/index.esm.js"; import lo from "../tags/index.esm.js"; import co from "../text/index.esm.js"; import uo from "../time-picker/index.esm.js"; import fo from "../transfer/index.esm.js"; import po from "../tree-view/index.esm.js"; import mo from "../uploader/index.esm.js"; import vo from "../verify-detail/index.esm.js"; import go from "../video/index.esm.js"; import yo from "../textarea/index.esm.js"; import li from "../schema-selector/index.esm.js"; import ho from "../../designer/tree-grid/index.esm.js"; import ci from "../event-parameter/index.esm.js"; import ui from "../filter-condition-editor/index.esm.js"; import bo from "../fieldset/index.esm.js"; import di from "../sort-condition-editor/index.esm.js"; import fi from "../menu-lookup/index.esm.js"; import Co from "../../designer/drawer/index.esm.js"; import pi from "../json-editor/index.esm.js"; import mi from "../property-editor/index.esm.js"; import vi from "../expression-editor/index.esm.js"; import gi from "../code-editor/index.esm.js"; import wo from "../html-template/index.esm.js"; import yi from "../collection-property-editor/index.esm.js"; import hi from "../modal/index.esm.js"; import So from "../external-container/index.esm.js"; import xo from "../language-textbox/index.esm.js"; import { FNotifyService as bi } from "../notify/index.esm.js"; const Ci = { /** * 组件值 */ modelValue: { type: Object, default: {} } }; function wi() { const o = { aroundDirection: "none", left: 2, right: 2, top: 2, bottom: 2, x: 0, y: 0 }; function r() { const S = document.createElementNS("http://www.w3.org/2000/svg", "path"); return S.setAttribute("fill", "none"), S.setAttribute("stroke", "#4d53e8"), S.setAttribute("stroke-width", "2"), S.setAttribute("class", ""), S; } function l() { const S = document.createElementNS("http://www.w3.org/2000/svg", "path"); return S.setAttribute("fill", "none"), S.setAttribute("stroke", "#4d53e8"), S.setAttribute("stroke-width", "2"), S.setAttribute("stroke-linecap", "round"), S; } function i() { const S = document.createElementNS("http://www.w3.org/2000/svg", "path"); return S.setAttribute("fill", "none"), S.setAttribute("stroke", "#4d53e8"), S.setAttribute("stroke-width", "2"), S.setAttribute("stroke-linecap", "round"), S; } function p(S, T, M, P) { const y = (v) => { v.key === "Delete" && (S.indexOf("^"), document.removeEventListener("keydown", y), T.remove()); }; M.addEventListener("mouseenter", () => { M.setAttribute("stroke", "#37d0ff"), P.setAttribute("stroke", "#37d0ff"), M.setAttribute("stroke-width", "3"), document.addEventListener("keydown", y); }), M.addEventListener("mouseleave", () => { M.setAttribute("stroke", "#4d53e8"), M.setAttribute("stroke-width", "2"), P.setAttribute("stroke", "#4d53e8"), document.removeEventListener("keydown", y); }); } function g(S) { let T = document.getElementById(S); if (T == null) { const M = document.createElementNS("http://www.w3.org/2000/svg", "svg"), P = r(); M.appendChild(P); const y = l(); M.appendChild(y); const v = i(); M.appendChild(v); const j = i(); M.appendChild(j), T = document.createElement("div"), T.id = S, T.style.position = "absolute", T.appendChild(M), p(S, T, P, y); const A = document.getElementById("svg-container"); return A && A.appendChild(T), T; } return T; } function d(S, T, M, P, y) { const v = { x: 0, y: 0 }; return S === "west" && (T === "north_west" && (M === "north" && (v.x = 0, v.y = 0 - y / 2), M === "west" && (v.x = 0 - P / 2, v.y = 0)), T === "north_east" && (M === "north" && (v.x = -100, v.y = 0 - y / 2), M === "east" && (v.x = -100, v.y = 0 - y / 2)), T === "south_east" && (M === "south" && (v.x = -100, v.y = 0 + y / 2), M === "east" && (v.x = -100, v.y = 0 + y / 2)), T === "south_west" && (M === "south" && (v.x = 0, v.y = 0 + y / 2), M === "west" && (v.x = 0 - P / 2, v.y = 0))), S === "east" && (T === "north_west" && (M === "north" && (v.x = -100, v.y = 0 - y / 2), M === "west" && (v.x = 100, v.y = 0 - y / 2)), T === "north_east" && (M === "north" && (v.x = 0, v.y = 0 - y / 2), M === "east" && (v.x = 0 + P / 2, v.y = 0)), T === "south_east" && (M === "south" && (v.x = 0, v.y = 0 + y / 2), M === "east" && (v.x = 0 + P / 2, v.y = 0)), T === "south_west" && (M === "south" && (v.x = 100, v.y = 0 + y / 2), M === "west" && (v.x = 100, v.y = 0 + y / 2))), S === "north" && (T === "north_west" && (M === "north" && (v.x = 0, v.y = 0 - y / 2), M === "west" && (v.x = 0 - P / 2, v.y = 0)), T === "north_east" && (M === "north" && (v.x = 0, v.y = 0 - y / 2), M === "east" && (v.x = 0 + P / 2, v.y = 0)), T === "south_east" && (M === "south" && (v.x = 0 + P / 2, v.y = -100), M === "east" && (v.x = 0 + P / 2, v.y = -100)), T === "south_west" && (M === "south" && (v.x = 0 - P / 2, v.y = -100), M === "west" && (v.x = 0 - P / 2, v.y = -100))), S === "south" && (T === "north_west" && (M === "north" && (v.x = 0 - P / 2, v.y = 100), M === "west" && (v.x = 0 - P / 2, v.y = 100)), T === "north_east" && (M === "north" && (v.x = 0 + P / 2, v.y = 100), M === "east" && (v.x = 0 + P / 2, v.y = 100)), T === "south_east" && (M === "south" && (v.x = 0, v.y = 0 + y / 2), M === "east" && (v.x = 0 + P / 2, v.y = 0)), T === "south_west" && (M === "south" && (v.x = 0, v.y = y / 2), M === "west" && (v.x = 0 - P / 2, v.y = 0))), v; } function w(S, T, M, P) { const y = { x: 0, y: 0 }; return S === "south" && (T === "west" && (y.x = -100, y.y = 0 - P / 2), T === "east" && (y.x = 100, y.y = -100), T === "south" && (y.x = 0 - M / 2, y.y = 100), (T === "north" || T === "center") && (y.x = 0, y.y = 0 - P / 2)), S === "north" && (T === "west" && (y.x = -100, y.y = 100), T === "east" && (y.x = 100, y.y = 100), T === "north" && (y.x = 0 - M / 2, y.y = -100), (T === "south" || T === "center") && (y.x = 0, y.y = P / 2)), S === "east" && (T === "north" && (y.y = -100, y.x = -100), T === "south" && (y.y = 100, y.x = -100), T === "east" && (y.x = 100, y.y = 100), (T === "west" || T === "center") && (y.x = 0 - M / 2, y.y = 0)), S === "west" && (T === "north" && (y.y = -100, y.x = 100), T === "south" && (y.y = 100, y.x = 100), T === "west" && (y.x = -100, y.y = P / 2), (T === "east" || T === "center") && (y.x = M / 2, y.y = 0)), y; } function f(S, T, M, P, y, v, j) { const A = j === "south" || j === "east" ? "portrait" : "landscape", ie = y, _ = A === "landscape" ? "east" : "north", le = j === "center" ? A === "landscape" ? "west" : "south" : j, se = d(ie, v, _, S, T), { x: K, y: q } = se, ue = w(_, le, S, T), { x: fe, y: de } = ue; de < 0 && (T += Math.abs(de)); const we = /* @__PURE__ */ new Map([["default", 0 + K], ["portrait", 0 + K], ["landscape", 0 + K]]), me = /* @__PURE__ */ new Map([["default", T + q], ["portrait", T + q], ["landscape", T + q]]); K < 0 && (S += Math.abs(K)), fe > 0 && (S += fe); const Ee = /* @__PURE__ */ new Map([["default", S + fe], ["portrait", S + fe], ["landscape", S + fe]]), be = /* @__PURE__ */ new Map([["default", 0 + de], ["portrait", 0 + de], ["landscape", 0 + de]]), ve = P.left > o.left, he = P.bottom > o.bottom, Se = ve ? 0 : he ? S / 2 : we.get(A), Te = he ? T + P.bottom : ve ? T / 2 : me.get(A), Be = Ee.get(A), Me = be.get(A); return [{ x: Se, y: Te }, { x: Be, y: Me }, { x: fe, y: de }]; } function x(S, T, M, P, y, v, j) { const A = j === "south" || j === "west" ? "portrait" : "landscape", ie = y, _ = A === "landscape" ? "west" : "north", le = j, se = d(ie, v, _, S, T), { x: K, y: q } = se, ue = w(_, le, S, T), { x: fe, y: de } = ue; de < 0 && (T += Math.abs(de)), K > 0 && (S += K), fe < 0 && (S += Math.abs(fe)); const we = /* @__PURE__ */ new Map([["default", S + K], ["portrait", S + K], ["landscape", S + K]]), me = /* @__PURE__ */ new Map([["default", T + q], ["portrait", T + q], ["landscape", T + q]]), Ee = /* @__PURE__ */ new Map([["default", 0 + fe], ["portrait", 0 + fe], ["landscape", 0 + fe]]), be = /* @__PURE__ */ new Map([["default", 0 + de], ["portrait", 0 + de], ["landscape", 0 + de]]), ve = P.right > o.right, he = P.bottom > o.bottom, Se = ve ? S + P.right : he ? S / 2 : we.get(A), Te = he ? T + P.bottom : ve ? T / 2 : me.get(A), Be = Ee.get(A), Me = be.get(A); return [{ x: Se, y: Te }, { x: Be, y: Me }, { x: fe, y: de }]; } function a(S, T, M, P, y, v, j) { const A = j === "north" || j === "east" ? "portrait" : "landscape", ie = y, _ = A === "landscape" ? "east" : "south", le = j, se = d(ie, v, _, S, T), { x: K, y: q } = se, ue = w(_, le, S, T), { x: fe, y: de } = ue, we = /* @__PURE__ */ new Map([["default", 0 + K], ["portrait", 0 + K], ["landscape", 0 + K]]), me = /* @__PURE__ */ new Map([["default", 0 + q], ["portrait", 0 + q], ["landscape", 0 + q]]); K < 0 && (S += Math.abs(K)), q < 0 && (T += Math.abs(q)), fe > 0 && (S += fe), de > 0 && (T += de); const Ee = /* @__PURE__ */ new Map([["default", S + fe], ["portrait", S + fe], ["landscape", S + fe]]), be = /* @__PURE__ */ new Map([["default", T + de], ["portrait", T + de], ["landscape", T + de]]), ve = P.left > o.left, he = P.top > o.top, Se = ve ? 0 : he ? S / 2 : we.get(A), Te = he ? 0 : ve ? T / 2 : me.get(A), Be = Ee.get(A), Me = be.get(A); return [{ x: Se, y: Te }, { x: Be, y: Me }, { x: fe, y: de }]; } function s(S, T, M, P, y, v, j) { const A = j === "north" || j === "west" ? "portrait" : "landscape", ie = y, _ = A === "landscape" ? "west" : "south", le = j, se = d(ie, v, _, S, T), { x: K, y: q } = se, ue = w(_, le, S, T), { x: fe, y: de } = ue; fe < 0 && (S += Math.abs(fe)); const we = /* @__PURE__ */ new Map([["default", S + K], ["portrait", S + K], ["landscape", S + K]]), me = /* @__PURE__ */ new Map([["default", 0 + q], ["portrait", 0 + q], ["landscape", 0 + q]]); q < 0 && (T += Math.abs(q)), de > 0 && (T += de); const Ee = /* @__PURE__ */ new Map([["default", 0 + fe], ["portrait", 0 + fe], ["landscape", 0 + fe]]), be = /* @__PURE__ */ new Map([["default", T + de], ["portrait", T + de], ["landscape", T + de]]), ve = P.right > o.right, he = P.top > o.top, Se = ve ? S + P.right : he ? S / 2 : we.get(A), Te = he ? 0 : ve ? T / 2 : me.get(A), Be = Ee.get(A), Me = be.get(A); return [{ x: Se, y: Te }, { x: Be, y: Me }, { x: fe, y: de }]; } const c = /* @__PURE__ */ new Map([ ["north_east", f], ["north_west", x], ["south_east", a], ["south_west", s] ]), B = /* @__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 F(S, T) { return S === "north_west" ? { aroundDirection: "north_west", left: T.left, right: 100, top: T.top, bottom: T.top } : S === "south_west" ? { aroundDirection: "south_west", left: T.left, right: 100, top: T.top, bottom: T.bottom } : T; } function I(S, T) { return S === "north_east" ? { left: 100, right: T.right, top: T.top, bottom: T.top } : S === "south_east" ? { left: 100, right: T.right, top: T.top, bottom: T.bottom } : T; } function L(S, T) { return S === "south_west" ? { left: T.left, right: T.right, top: 100, bottom: T.top } : S === "south_east" ? { left: T.left, right: T.right, top: 100, bottom: T.bottom } : T; } function h(S, T) { return S === "north_west" ? { left: T.left, right: T.right, top: T.top, bottom: 100 } : S === "north_east" ? { left: T.left, right: T.right, top: T.top, bottom: 100 } : T; } function u(S, T) { return T; } const m = /* @__PURE__ */ new Map([ ["east", F], ["west", I], ["north", L], ["south", h], ["center", u] ]); function D(S, T, M, P) { const y = T.x - S.x, v = T.y - S.y, j = y >= 0 ? "east" : "west", A = v >= 0 ? "south" : "north", ie = `${A}_${j}`, le = (B.get(M) || []).includes(ie), se = m.get(M), K = le ? se(ie, o) : o, q = Math.abs(y), ue = Math.abs(v), fe = c.get(`${A}_${j}`), [de, we, me] = fe( q, ue, le, K, M, ie, P ), Ee = j === "west" ? me.x < 0 ? Math.abs(me.x) : 0 : me.x > 0 ? me.x : 0, be = K.left + K.right + q + Ee, ve = A === "north" ? me.y < 0 ? Math.abs(me.y) : 0 : me.y > 0 ? me.y : 0, he = K.top + K.bottom + ue + ve, Se = j === "east" ? S.x - K.left : S.x + K.right - be, Te = A === "south" ? S.y - K.top : S.y + K.bottom - he, Be = j === "east" ? K.left : be - K.right, Me = A === "north" ? he - K.bottom : K.top, tt = j === "west" ? me.x < 0 ? Math.abs(me.x) : 0 : me.x < 0 ? be : be - me.x, Ye = A === "north" ? me.y < 0 ? Math.abs(me.y) : 0 : me.y < 0 ? he : he - me.y; return { width: be, height: he, left: Se, top: Te, startPoinInBoundray: { x: Be, y: Me }, firstControlPoint: de, secondControlPoint: we, endPoinInBoundray: { x: tt, y: Ye } }; } function k(S, T, M, P, y) { S.style.position = "absolute", S.style.alignItems = "center", S.style.left = `${T}px`, S.style.top = `${M}px`, S.style.width = P + "px", S.style.height = y + "px"; } function O(S, T, M, P, y, v, j) { const A = S.childNodes[0]; A.setAttribute("width", String(T)), A.setAttribute("height", String(M)), S.appendChild(A); const ie = A.childNodes[0], _ = `${P.x} ${P.y}`, le = `${y.x} ${y.y}`, se = `${v.x} ${v.y}`, K = `${j.x} ${j.y}`, q = "M ".concat(_).concat(" C ").concat(le).concat("," + se + ",").concat(K); ie.setAttribute("d", q), ie.setAttribute("fill", "none"), ie.setAttribute("stroke", "#4d53e8"), ie.setAttribute("stroke-width", "2"), ie.setAttribute("class", ""); } function N(S, T, M, P, y) { const { width: v, height: j, left: A, top: ie, startPoinInBoundray: _, firstControlPoint: le, secondControlPoint: se, endPoinInBoundray: K } = D(T, M, P, y); k(S, A, ie, v, j), O(S, v, j, _, le, se, K); } function E(S, T, M, P, y) { const v = g(S); N(v, T, M, P, y); } function $(S) { return Number(S.replace("px", "")); } function V(S) { if (S !== null) { const T = S.parentNode, M = $(T.style.left), P = $(T.style.top); return { x: M + S.offsetLeft + S.offsetWidth / 2, y: P + S.offsetTop + S.offsetHeight / 2 }; } return { x: 0, y: 0 }; } function z(S, T) { const M = document.getElementById(S), P = document.getElementById(T), y = V(M), v = V(P), j = y.x + 2, A = y.y, ie = v.x - 2, _ = v.y; return { startPoint: { x: j, y: A }, endPoint: { x: ie, y: _ } }; } function W(S, T, M, P) { const { startPoint: y, endPoint: v } = z(S, T); E(`${S}_${T}`, y, v, M, P); } return { connect: W, drawing: E }; } function Si(e) { const t = b(), n = b(0), o = b(0), r = b({ x: 0, y: 0 }), l = b(), { drawing: i } = e; function p(F) { return Number(F.replace("px", "")); } function g(F) { return (F && F.className && F.className.split ? F.className.split(" ") : []).includes("f-flow-ancher"); } function d(F) { switch ((F ? F.className.split(" ") : []).find((h) => h.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 w(F, I, L) { const h = L.getBoundingClientRect(); n.value = h.left, o.value = h.top, r.value = { x: F, y: I }, t.value = d(L); } function f(F) { var k; const I = F.clientX - n.value, L = F.clientY - o.value, h = r.value.x + I, u = r.value.y + L, m = F.target, D = m && typeof m.className == "string" && g(m) ? d(m) : "center"; i( `${(k = l.value) == null ? void 0 : k.id}_curve_to`, { x: r.value.x, y: r.value.y }, { x: h, y: u }, t.value, D ); } function x(F) { const I = document.getElementById(F); I && I.remove(); } function a() { document.addEventListener("mousemove", f); } function s() { document.removeEventListener("mousemove", f); } function c(F) { l.value = void 0, s(); } function B(F, I) { l.value = document.getElementById(F); const L = l.value.offsetParent, h = l.value.getBoundingClientRect(), u = L.getBoundingClientRect(), m = p(L.style.left) + (h.left - u.left), D = p(L.style.top) + (h.top - u.top), k = m + h.width / 2, O = D + h.height / 2; w(k, O, l.value), a(); } return { drawFrom: B, eraseDrawingLine: x, finishToDraw: c, getAncherPointPosition: d, isAncherPoint: g }; } const xi = { 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: [] } }, mt = b(0); function Fi() { mt.value++; } function Ti(e, t) { const n = t.getBoundingClientRect(), o = e.getBoundingClientRect(), r = o.top >= n.top, l = o.top <= n.bottom; return r && l; } function Bi(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 i = document.querySelector(".editorDiv"); if (i) { const p = i.getBoundingClientRect(); l < p.left && ({ left: l } = e.getBoundingClientRect()); } o.style.left = l + "px"; } } } function Mi(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 Fo(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 = Mi(e); if (r && (o = Ti(e, r)), !o) { n.style.display = "none"; return; } Bi(e); } } function Bt(e) { if (!e) return; let t; e.className.includes("dgComponentSelected") ? t = e : t = e.querySelector(".dgComponentSelected"), t && Fo(t); } const ki = { /** * 组件值 */ modelValue: { type: Object, default: {} }, componentId: { type: String, default: "" }, components: { type: Array }, canvasMode: { type: String, default: "PC" } }; var Ke = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Oi(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } function Tt(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 To = { exports: {} }; (function(e, t) { (function(n) { e.exports = n(); })(function() { return (/* @__PURE__ */ function() { function n(o, r, l) { function i(d, w) { if (!r[d]) { if (!o[d]) { var f = typeof Tt == "function" && Tt; if (!w && f) return f(d, !0); if (p) return p(d, !0); var x = new Error("Cannot find module '" + d + "'"); throw x.code = "MODULE_NOT_FOUND", x; } var a = r[d] = { exports: {} }; o[d][0].call(a.exports, function(s) { var c = o[d][1][s]; return i(c || s); }, a, a.exports, n, o, r, l); } return r[d].exports; } for (var p = typeof Tt == "function" && Tt, g = 0; g < l.length; g++) i(l[g]); return i; } return n; }())({ 1: [function(n, o, r) { var l = {}, i = "(?:^|\\s)", p = "(?:\\s|$)"; function g(f) { var x = l[f]; return x ? x.lastIndex = 0 : l[f] = x = new RegExp(i + f + p, "g"), x; } function d(f, x) { var a = f.className; a.length ? g(x).test(a) || (f.className += " " + x) : f.className = x; } function w(f, x) { f.className = f.className.replace(g(x), " ").trim(); } o.exports = { add: d, rm: w }; }, {}], 2: [function(n, o, r) { (function(l) { var i = n("contra/emitter"), p = n("crossvent"), g = n("./classes"), d = document, w = d.documentElement; function f(E, $) { var V = arguments.length; V === 1 && Array.isArray(E) === !1 && ($ = E, E = []); var z, W, S, T, M, P, y, v, j, A = null, ie, _, le = !1, se = 0, K, q = $ || {}; q.moves === void 0 && (q.moves = I), q.accepts === void 0 && (q.accepts = I), q.invalid === void 0 && (q.invalid = tt), q.containers === void 0 && (q.containers = E || []), q.isContainer === void 0 && (q.isContainer = F), q.copy === void 0 && (q.copy = !1), q.copySortSource === void 0 && (q.copySortSource = !1), q.revertOnSpill === void 0 && (q.revertOnSpill = !1), q.removeOnSpill === void 0 && (q.removeOnSpill = !1), q.direction === void 0 && (q.direction = "vertical"), q.ignoreInputTextSelection === void 0 && (q.ignoreInputTextSelection = !0), q.mirrorContainer === void 0 && (q.mirrorContainer = d.body); var ue = i({ containers: q.containers, start: Be, end: Ye, cancel: pe, remove: H, destroy: Ee, canMove: Te, dragging: !1 }); return q.removeOnSpill === !0 && ue.on("over", Rt).on("out", jt), de(), ue; function fe(R) { return ue.containers.indexOf(R) !== -1 || q.isContainer(R); } function de(R) { var G = R ? "remove" : "add"; s(w, G, "mousedown", ve), s(w, G, "mouseup", Xe); } function we(R) { var G = R ? "remove" : "add"; s(w, G, "mousemove", he); } function me(R) { var G = R ? "remove" : "add"; p[G](w, "selectstart", be), p[G](w, "click", be); } function Ee() { de(!0), Xe({}); } function be(R) { ie && R.preventDefault(); } function ve(R) { T = R.clientX, M = R.clientY; var G = c(R) !== 1 || R.metaKey || R.ctrlKey; if (!G) { var ee = R.target, ae = Se(ee); ae && (ie = ae, we(), R.type === "mousedown" && (m(ee) ? ee.focus() : R.preventDefault())); } } function he(R) { if (ie) { if (c(R) === 0) { Xe({}); return; } if (!(R.clientX !== void 0 && Math.abs(R.clientX - T) <= (q.slideFactorX || 0) && R.clientY !== void 0 && Math.abs(R.clientY - M) <= (q.slideFactorY || 0))) { if (q.ignoreInputTextSelection) { var G = N("clientX", R) || 0, ee = N("clientY", R) || 0, ae = d.elementFromPoint(G, ee); if (m(ae)) return; } var ge = ie; we(!0), me(), Ye(), Me(ge), g.add(v || S, "gu-transit"), Lt(), $t(), se = 0, vt(R); } } } function Se(R) { if (!(ue.dragging && z) && !fe(R)) { for (var G = R; u(R) && fe(u(R)) === !1; ) if (q.invalid(R, G) || (R = u(R), !R)) return; var ee = u(R); if (ee && !q.invalid(R, G)) { var ae = q.moves(R, ee, G, k(R)); if (ae) return { item: R, source: ee }; } } } function Te(R) { return !!Se(R); } function Be(R) { var G = Se(R); G && Me(G); } function Me(R) { Ut(R.item, R.source) && (v = R.item.cloneNode(!0), ue.emit("cloned", v, R.item, "copy")), W = R.source, S = R.item, P = y = k(R.item), ue.dragging = !0, ue.emit("drag", S, W); } function tt() { return !1; } function Ye() { if (ue.dragging) { var R = v || S; dt(R, u(R)); } } function qe() { ie = !1, we(!0), me(!0); } function Xe(R) { if (qe(), !!ue.dragging) { var G = v || S, ee = N("clientX", R) || 0, ae = N("clientY", R) || 0, ge = B(z, ee, ae), ye = Je(ge, ee, ae); ye && (v && q.copySortSource || !v || ye !== W) ? dt(G, ye) : q.removeOnSpill ? H() : pe(); } } function dt(R, G) { var ee = u(R); v && q.copySortSource && G === W && ee.removeChild(S), Oe(G) ? ue.emit("cancel", R, W) : ue.emit("drop", R, G, W, y), ke(); } function H() { if (ue.dragging) { var R = v || S, G = u(R); G && G.removeChild(R), ue.emit(v ? "cancel" : "remove", R, G, W), ke(); } } function pe(R) { if (ue.dragging) { var G = arguments.length > 0 ? R : q.revertOnSpill, ee = v || S, ae = u(ee), ge = Oe(ae); ge === !1 && G && (v ? ae && ae.removeChild(v) : W.insertBefore(ee, P)), ge || G ? ue.emit("cancel", ee, W, W) : ue.emit("drop", ee, ae, W, y), ke(); } } function ke() { var R = v || S; qe(), At(), Vt(), R && g.rm(R, "gu-transit"), j && clearTimeout(j), ue.dragging = !1, A && ue.emit("out", R, A, W), ue.emit("dragend", R, se), W = S = v = P = y = j = A = null; } function Oe(R, G) { var ee; return G !== void 0 ? ee = G : z ? ee = y : ee = k(v || S), R === W && ee === P; } function Je(R, G, ee) { for (var ae = R; ae && !ge(); ) ae = u(ae); return ae; function ge() { var ye = fe(ae); if (ye === !1) return !1; var _e = St(ae, R), $e = xt(ae, _e, G, ee), Ae = Oe(ae, $e); return Ae ? !0 : q.accepts(S, ae, W, $e); } } function vt(R) { if (!z) return; R.preventDefault(); var G = N("clientX", R) || 0, ee = N("clientY", R) || 0; z.style.left = G - 2 + "px", z.style.top = ee - 2 + "px"; var ae = v || S, ge = B(z, G, ee), ye = Je(ge, G, ee), _e = ye !== null && ye !== A; (_e || ye === null) && (Ve(), A = ye, We()), qt(ge, ee); var $e = u(ae); if (ye === W && v && !q.copySortSource) { $e && $e.removeChild(ae); return; } var Ae, Ue = St(ye, ge); if (le = gt(Ue, ye), Ue !== null) Ae = xt(ye, Ue, G, ee); else if (q.revertOnSpill === !0 && !v) Ae = P, ye = W; else { v && $e && $e.removeChild(ae), v && _ && (_.style.display = "none"); return; } _.style.display = "block", Nt(Ae, ae, _e), Ae ? Ht(Ue, Ae) : _t(ye); function Pe(Ne) { ue.emit(Ne, ae, A, W); } function We() { _e && Pe("over"); } function Ve() { A && Pe("out"); } } function Nt(R, G, ee) { (R === G || R === k(G)) && (y = k(G)), (R === null && ee || R !== G && R !== k(G)) && (y = R); } function Rt(R) { g.rm(R, "gu-hide"); } function jt(R) { ue.dragging && g.add(R, "gu-hide"); } function $t() { z || (z = document.createElement("div"), z.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;", z.innerHTML = q.getMirrorText && q.getMirrorText(S) || "控件", g.add(z, "gu-mirror"), q.mirrorContainer.appendChild(z), s(w, "add", "mousemove", vt), g.add(q.mirrorContainer, "gu-unselectable"), ue.emit("cloned", z, S, "mirror")); } function Lt() { if (_ = document.createElement("div"), g.add(_, "gu-insertion"), S) { var R = S.getBoundingClientRect(); _.style.left = R.left + "px", _.style.top = R.top + "px"; } le = !1, q.mirrorContainer.appendChild(_); } function At() { z && (g.rm(q.mirrorContainer, "gu-unselectable"), s(w, "remove", "mousemove", vt), u(z).removeChild(z), z = null); } function Vt() { _ && (u(_).removeChild(_), _ = null); } function St(R, G) { for (var ee = G; ee !== R && u(ee) !== R; ) ee = u(ee); return ee === w ? null : ee; } function gt(R, G) { if (!G) return le; var ee = R || G && G.lastElementChild; if (!ee) return !0; var ae = getComputedStyle(R), ge = /^inline/.test(ae.getPropertyValue("display")) || /^(left|right)$/.test(ae.getPropertyValue("float")); if (ge) return !0; if (G) { var ye = getComputedStyle(G), _e = ye.getPropertyValue("display"); if (/flex$/.test(_e)) { var $e = ye.getPropertyValue("flex-direction") || "row"; if ($e === "row" || $e === "row-reverse") return !zt(G); } return !1; } return !0; } function zt(R) { if (!R.children || !R.children.length) return !1; for (const G of Array.from(R.children)) { const ae = (G.className && G.className.split(" ") || []).filter((ge) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(ge)); if (!ae.length) return !1; for (const ge of ae) { const ye = ge.slice(ge.lastIndexOf("-") + 1); if (parseInt(ye, 10) !== 12) return !1; } } return !0; } function Ht(R, G) { const ee = G.getBoundingClientRect(); if (_.style.left = ee.left + "px", _.style.top = ee.top + "px", le) { if (_.style.height = ee.height + "px", _.style.width = "4px", R) { const ae = R.getBoundingClientRect(); ae.top !== ee.top && (_.style.left = ae.right + "px", _.style.top = ae.top + "px", _.style.height = ae.height + "px"); } } else if (_.style.height = "4px", _.style.width = ee.width + "px", K) { const ae = K.getBoundingClientRect(); ee.top < ae.top && (_.style.display = "none"); } G === S && S && (_.style.display = "none"); } function _t(R) { y = null; var G = R.lastElementChild; if (G) { var ee = G.getBoundingClientRect(); le ? (_.style.left = ee.right + "px", _.style.top = ee.top + "px", _.style.height = ee.height + "px", _.style.width = "4px") : (_.style.left = ee.left + "px", _.style.top = ee.bottom + "px", _.style.height = "4px", _.style.width = ee.width + "px"), G === S && S && (_.style.display = "none"); } else _.style.display = "none"; } function qt(R, G) { if (!q.mirrorContainer.contains(R) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (K = x(R), !K || !K.contains(R))) return; const ee = document.querySelector(".dgComponentSelected"), ae = K.getBoundingClientRect(); if (G - 30 < ae.top && K.scrollTop > 0) { let ge = K.scrollTop < 10 ? K.scrollTop : 10; K.scrollBy(0, -1 * ge), ee && K.contains(ee) && (se = se + -1 * ge); } if (G + 30 > ae.bottom && K.scrollTop < K.scrollHeight - K.clientHeight) { const ge = K.scrollHeight - K.clientHeight - K.scrollTop; let ye = ge < 10 ? ge : 10; K.scrollBy(0, ye), ee && K.contains(ee) && (se = se + ye); } } function xt(R, G, ee, ae) { var ge = q.direction === "horizontal", ye = q.direction === "mixed", _e = G !== R ? Ae() : $e(); return _e; function $e() { var Pe = R.children.length, We, Ve, Ne; for (We = 0; We < Pe; We++) if (Ve = R.children[We], Ne = Ve.getBoundingClientRect(), ge && Ne.left + Ne.width / 2 > ee || !ye && !ge && Ne.top + Ne.height / 2 > ae || ye && Ne.left + Ne.width > ee && Ne.top + Ne.height > ae) return Ve; return null; } function Ae() { var Pe = G.getBoundingClientRect(); if (ye) { var We = ae - Pe.top, Ve = ee - Pe.left, Ne = Pe.bottom - ae, yt = Pe.right - ee, ht = Math.min(Ve, yt, We, Ne), bt; return le ? bt = yt < Ve : bt = Ne === ht || yt === ht || Ve === ht, Ue(bt); } return Ue(ge ? ee > Pe.left + L(Pe) / 2 : ae > Pe.top + h(Pe) / 2); } function Ue(Pe) { return Pe ? k(G) : G; } } function Ut(R, G) { return typeof q.copy == "boolean" ? q.copy : q.copy(R, G); } } function x(E) { const $ = Array.from(window.scrollContainerList); if ($.length === 1) { const z = Array.from(window.scrollContainerList)[0]; return document.getElementById(z); } const V = a($); for (const z of V) if (z.contains(E)) return z; return null; } function a(E) { const $ = []; return E.forEach((V) => { const z = document.getElementById(V); z && $.push(z); }), $.sort((V, z) => V.contains(z) ? 1 : z.contains(V) ? -1 : 0), $; } function s(E, $, V, z) { var W = { mouseup: "touchend", mousedown: "touchstart", mousemove: "touchmove" }, S = { mouseup: "pointerup", mousedown: "pointerdown", mousemove: "pointermove" }, T = { mouseup: "MSPointerUp", mousedown: "MSPointerDown", mousemove: "MSPointerMove" }; l.navigator.pointerEnabled ? p[$](E, S[V], z) : l.navigator.msPointerEnabled ? p[$](E, T[V], z) : (p[$](E, W[V], z), p[$](E, V, z)); } function c(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 $ = E.button; if ($ !== void 0) return $ & 1 ? 1 : $ & 2 ? 3 : $ & 4 ? 2 : 0; } function B(E, $, V) { E = E || {}; var z = E.className || "", W; return E.className += " gu-hide", W = d.elementFromPoint($, V), E.className = z, W; } function F() { return !1; } function I() { return !0; } function L(E) { return E.width || E.right - E.left; } function h(E) { return E.height || E.bottom - E.top; } function u(E) { return E.parentNode === d ? null : E.parentNode; } function m(E) { return E.tagName === "INPUT" || E.tagName === "TEXTAREA" || E.tagName === "SELECT" || D(E); } function D(E) { return !E || E.contentEditable === "false" ? !1 : E.contentEditable === "true" ? !0 : D(u(E)); } function k(E) { return E.nextElementSibling || $(); function $() { var V = E; do V = V.nextSibling; while (V && V.nodeType !== 1); return V; } } function O(E) { return E.targetTouches && E.targetTouches.length ? E.targetTouches[0] : E.changedTouches && E.changedTouches.length ? E.changedTouches[0] : E; } function N(E, $) { var V = O($), z = { pageX: "clientX", // IE8 pageY: "clientY" // IE8 }; return E in z && !(E in V) && z[E] in V && (E = z[E]), V[E]; } o.exports = f; }).call(this, typeof Ke < "u" ? Ke : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }], 3: [function(n, o, r) { o.exports = function(i, p) { return Array.prototype.slice.call(i, p); }; }, {}], 4: [function(n, o, r) { var l = n("ticky"); o.exports = function(p, g, d) { p && l(function() { p.apply(d || null, g || []); }); }; }, { ticky: 10 }], 5: [function(n, o, r) { var l = n("atoa"), i = n("./debounce"); o.exports = function(g, d) { var w = d || {}, f = {}; return g === void 0 && (g = {}), g.on = function(x, a) { return f[x] ? f[x].push(a) : f[x] = [a], g; }, g.once = function(x, a) { return a._once = !0, g.on(x, a), g; }, g.off = function(x, a) { var s = arguments.length; if (s === 1) delete f[x]; else if (s === 0) f = {}; else { var c = f[x]; if (!c) return g; c.splice(c.indexOf(a), 1); } return g; }, g.emit = function() { var x = l(arguments); return g.emitterSnapshot(x.shift()).apply(this, x); }, g.emitterSnapshot = function(x) { var a = (f[x] || []).slice(0); return function() { var s = l(arguments), c = this || g; if (x === "error" && w.throws !== !1 && !a.length) throw s.length === 1 ? s[0] : s; return a.forEach(function(F) { w.async ? i(F, s, c) : F.apply(c, s), F._once && g.off(x, F); }), g; }; }, g; }; }, { "./debounce": 4, atoa: 3 }], 6: [function(n, o, r) { (function(l) { var i = n("custom-event"), p = n("./eventmap"), g = l.document, d = x, w = s, f = []; l.addEventListener || (d = a, w = c), o.exports = { add: d, remove: w, fabricate: B }; function x(u, m, D, k) { return u.addEventListener(m, D, k); } function a(u, m, D) { return u.attachEvent("on" + m, I(u, m, D)); } function s(u, m, D, k) { return u.removeEventListener(m, D, k); } function c(u, m, D) { var k = L(u, m, D); if (k) return u.detachEvent("on" + m, k); } function B(u, m, D) { var k = p.indexOf(m) === -1 ? N() : O(); u.dispatchEvent ? u.dispatchEvent(k) : u.fireEvent("on" + m, k); function O() { var E; return g.createEvent ? (E = g.createEvent("Event"), E.initEvent(m, !0, !0)) : g.createEventObject && (E = g.createEventObject()), E; } function N() { return new i(m, { detail: D }); } } function F(u, m, D) { return function(O) { var N = O || l.event; N.target = N.target || N.srcElement, N.preventDefault = N.preventDefault || function() { N.returnValue = !1; }, N.stopPropagation = N.stopPropagation || function() { N.cancelBubble = !0; }, N.which = N.which || N.keyCode, D.call(u, N); }; } function I(u, m, D) { var k = L(u, m, D) || F(u, m, D); return f.push({ wrapper: k, element: u, type: m, fn: D }), k; } function L(u, m, D) { var k = h(u, m, D); if (k) { var O = f[k].wrapper; return f.splice(k, 1), O; } } function h(u, m, D) { var k, O; for (k = 0; k < f.length; k++) if (O = f[k], O.element === u && O.type === m && O.fn === D) return k; } }).call(this, typeof Ke < "u" ? Ke : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./eventmap": 7, "custom-event": 8 }], 7: [function(n, o, r) { (function(l) { var i = [], p = "", g = /^on/; for (p in l) g.test(p) && i.push(p.slice(2)); o.exports = i; }).call(this, typeof Ke < "u" ? Ke : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 8: [function(n, o, r) { (function(l) { var i = l.CustomEvent; function p() { try { var g = new i("cat", { detail: { foo: "bar" } }); return g.type === "cat" && g.detail.foo === "bar"; } catch { } return !1; } o.exports = p() ? i : ( // IE >= 9 typeof document < "u" && typeof document.createEvent == "function" ? function(d, w) { var f = document.createEvent("CustomEvent"); return w ? f.initCustomEvent(d, w.bubbles, w.cancelable, w.detail) : f.initCustomEvent(d, !1, !1, void 0), f; } : ( // IE <= 8 function(d, w) { var f = document.createEventObject(); return f.type = d, w ? (f.bubbles = !!w.bubbles, f.cancelable = !!w.cancelable, f.detail = w.detail) : (f.bubbles = !1, f.cancelable = !1, f.detail = void 0), f; } ) ); }).call(this, typeof Ke < "u" ? Ke : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 9: [function(n, o, r) { var l = o.exports = {}, i, p; function g() { throw new Error("setTimeout has not been defined"); } function d() { throw new Error("clearTimeout has not been defined"); } (function() { try { typeof setTimeout == "function" ? i = setTimeout : i = g; } catch { i = g; } try { typeof clearTimeout == "function" ? p = clearTimeout : p = d; } catch { p = d; } })(); function w(h) { if (i === setTimeout) return setTimeout(h, 0); if ((i === g || !i) && setTimeout) return i = setTimeout, setTimeout(h, 0); try { return i(h, 0); } catch { try { return i.call(null, h, 0); } catch { return i.call(this, h, 0); } } } function f(h) { if (p === clearTimeout) return clearTimeout(h); if ((p === d || !p) && clearTimeout) return p = clearTimeout, clearTimeout(h); try { return p(h); } catch { try { return p.call(null, h); } catch { return p.call(this, h); } } } var x =