UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,108 lines 425 kB
var Zr = Object.defineProperty; var ei = (n, t, e) => t in n ? Zr(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e; var z = (n, t, e) => ei(n, typeof t != "symbol" ? t + "" : t, e); import { ref as k, defineComponent as et, computed as U, watch as Pe, createVNode as D, Fragment as Ht, reactive as St, createApp as Kn, onUnmounted as tn, onMounted as Tt, Transition as Jn, mergeProps as Wt, createTextVNode as ot, onBeforeUnmount as Zn, withDirectives as ti, resolveDirective as ni, nextTick as vn, onBeforeMount as eo, Teleport as oi, shallowRef as ri, render as gn, h as ii, cloneVNode as ai, inject as Xe, provide as jt, triggerRef as si, isVNode as li } from "vue"; import { isPlainObject as Vn, cloneDeep as Ct, isUndefined as vt, throttle as ui, merge as on, findIndex as Rn } from "lodash-es"; import { useResizeObserver as to } from "@vueuse/core"; import { useIdentify as ci, useGroupData as di, useFilter as fi, useHierarchy as pi, useLoading as mi, useDataView as hi, useSelection as vi, useSelectHierarchyItem as gi, useDataViewContainerStyle as yi, useCommandColumn as bi, useColumn as wi, useSort as Ci, useGroupColumn as xi, useRow as _i, useEdit as Si, useVisualDataBound as Ti, useVisualDataCell as ki, useVisualDataRow as Fi, useVisualData as Ei, useCellPosition as Oi, useSidebar as Mi, useVirtualScroll as Ii, useFitColumn as Pi, useFilterHistory as Di, useColumnFilter as Ni, useDragColumn as Bi, getColumnHeader as Vi, getSidebar as Ri, getDisableMask as $i, getHorizontalScrollbar as Li, getVerticalScrollbar as Wi, getEmpty as ji } from "../data-view/index.esm.js"; import "../modal/index.esm.js"; import no from "../transfer/index.esm.js"; import oo from "../tabs/index.esm.js"; import ro from "../order/index.esm.js"; import "../condition/index.esm.js"; import { FCheckbox as Hi } from "../checkbox/index.esm.js"; import { useGuid as Ai, resolveField as ut, FormSchemaEntityFieldTypeName as $n, useCommonUtils as zi, useDateFormat as qi, useNumberFormat as Yi, setFieldValue as Cn, getCustomClass as yn, withInstall as Gi } from "../common/index.esm.js"; import io from "../filter-bar/index.esm.js"; import Ln from "../tooltip/index.esm.js"; import ao from "../pagination/index.esm.js"; import Ui from "../button/index.esm.js"; import so from "../search-box/index.esm.js"; import lo from "../tags/index.esm.js"; import uo, { FDynamicFormGroup as Xi, FDynamicFormInput as Qi } from "../dynamic-form/index.esm.js"; import { createPropsResolver as Ki } from "../dynamic-resolver/index.esm.js"; import "../designer-canvas/index.esm.js"; import "../property-panel/index.esm.js"; import co from "../accordion/index.esm.js"; import fo from "../avatar/index.esm.js"; import po from "../../designer/button-edit/index.esm.js"; import mo from "../button-group/index.esm.js"; import ho from "../calendar/index.esm.js"; import vo from "../capsule/index.esm.js"; import xn from "../../designer/checkbox/index.esm.js"; import un from "../../designer/checkbox-group/index.esm.js"; import cn from "../combo-list/index.esm.js"; import Ji from "../combo-tree/index.esm.js"; import go from "../component/index.esm.js"; import yo from "../color-picker/index.esm.js"; import bo from "../content-container/index.esm.js"; import wo from "../date-picker/index.esm.js"; import Co from "../../designer/data-grid/index.esm.js"; import xo from "../dropdown/index.esm.js"; import Zi from "../events-editor/index.esm.js"; import ea from "../field-selector/index.esm.js"; import ta, { FBindingSelectorContainer as na } from "../binding-selector/index.esm.js"; import _o from "../image-cropper/index.esm.js"; import So from "../../designer/input-group/index.esm.js"; import To from "../layout/index.esm.js"; import ko from "../list-nav/index.esm.js"; import Fo from "../list-view/index.esm.js"; import Eo from "../lookup/index.esm.js"; import oa from "../mapping-editor/index.esm.js"; import Oo from "../nav/index.esm.js"; import Mo from "../number-range/index.esm.js"; import Io from "../number-spinner/index.esm.js"; import Po from "../page-header/index.esm.js"; import Do from "../page-footer/index.esm.js"; import No from "../progress/index.esm.js"; import Bo from "../query-solution/index.esm.js"; import Vo from "../../designer/radio-group/index.esm.js"; import Ro from "../rate/index.esm.js"; import $o from "../response-toolbar/index.esm.js"; import Lo from "../response-layout/index.esm.js"; import Wo from "../response-layout-editor/index.esm.js"; import jo from "../section/index.esm.js"; import Ho from "../smoke-detector/index.esm.js"; import Ao from "../splitter/index.esm.js"; import zo from "../step/index.esm.js"; import qo from "../switch/index.esm.js"; import Yo from "../text/index.esm.js"; import Go from "../time-picker/index.esm.js"; import Uo from "../tree-view/index.esm.js"; import Xo from "../uploader/index.esm.js"; import Qo from "../verify-detail/index.esm.js"; import Ko from "../video/index.esm.js"; import Jo from "../textarea/index.esm.js"; import ra from "../schema-selector/index.esm.js"; import Zo from "../tree-grid/index.esm.js"; import ia from "../event-parameter/index.esm.js"; import aa from "../filter-condition-editor/index.esm.js"; import er from "../fieldset/index.esm.js"; import sa from "../sort-condition-editor/index.esm.js"; import la from "../menu-lookup/index.esm.js"; import tr from "../drawer/index.esm.js"; import ua from "../json-editor/index.esm.js"; import ca from "../property-editor/index.esm.js"; import da from "../expression-editor/index.esm.js"; import fa from "../code-editor/index.esm.js"; import nr from "../html-template/index.esm.js"; import pa from "../external-container/index.esm.js"; import { FNotifyService as ma } from "../notify/index.esm.js"; const ha = { /** * 组件值 */ modelValue: { type: Object, default: {} } }; function va() { const o = { aroundDirection: "none", left: 2, right: 2, top: 2, bottom: 2, x: 0, y: 0 }; function r() { const M = document.createElementNS("http://www.w3.org/2000/svg", "path"); return M.setAttribute("fill", "none"), M.setAttribute("stroke", "#4d53e8"), M.setAttribute("stroke-width", "2"), M.setAttribute("class", ""), M; } function i() { const M = document.createElementNS("http://www.w3.org/2000/svg", "path"); return M.setAttribute("fill", "none"), M.setAttribute("stroke", "#4d53e8"), M.setAttribute("stroke-width", "2"), M.setAttribute("stroke-linecap", "round"), M; } function a() { const M = document.createElementNS("http://www.w3.org/2000/svg", "path"); return M.setAttribute("fill", "none"), M.setAttribute("stroke", "#4d53e8"), M.setAttribute("stroke-width", "2"), M.setAttribute("stroke-linecap", "round"), M; } function s(M, T, P, B) { const R = (O) => { O.key === "Delete" && (M.indexOf("^"), document.removeEventListener("keydown", R), T.remove()); }; P.addEventListener("mouseenter", () => { P.setAttribute("stroke", "#37d0ff"), B.setAttribute("stroke", "#37d0ff"), P.setAttribute("stroke-width", "3"), document.addEventListener("keydown", R); }), P.addEventListener("mouseleave", () => { P.setAttribute("stroke", "#4d53e8"), P.setAttribute("stroke-width", "2"), B.setAttribute("stroke", "#4d53e8"), document.removeEventListener("keydown", R); }); } function l(M) { let T = document.getElementById(M); if (T == null) { const P = document.createElementNS("http://www.w3.org/2000/svg", "svg"), B = r(); P.appendChild(B); const R = i(); P.appendChild(R); const O = a(); P.appendChild(O); const N = a(); P.appendChild(N), T = document.createElement("div"), T.id = M, T.style.position = "absolute", T.appendChild(P), s(M, T, B, R); const A = document.getElementById("svg-container"); return A && A.appendChild(T), T; } return T; } function u(M, T, P, B, R) { const O = { x: 0, y: 0 }; return M === "west" && (T === "north_west" && (P === "north" && (O.x = 0, O.y = 0 - R / 2), P === "west" && (O.x = 0 - B / 2, O.y = 0)), T === "north_east" && (P === "north" && (O.x = -100, O.y = 0 - R / 2), P === "east" && (O.x = -100, O.y = 0 - R / 2)), T === "south_east" && (P === "south" && (O.x = -100, O.y = 0 + R / 2), P === "east" && (O.x = -100, O.y = 0 + R / 2)), T === "south_west" && (P === "south" && (O.x = 0, O.y = 0 + R / 2), P === "west" && (O.x = 0 - B / 2, O.y = 0))), M === "east" && (T === "north_west" && (P === "north" && (O.x = -100, O.y = 0 - R / 2), P === "west" && (O.x = 100, O.y = 0 - R / 2)), T === "north_east" && (P === "north" && (O.x = 0, O.y = 0 - R / 2), P === "east" && (O.x = 0 + B / 2, O.y = 0)), T === "south_east" && (P === "south" && (O.x = 0, O.y = 0 + R / 2), P === "east" && (O.x = 0 + B / 2, O.y = 0)), T === "south_west" && (P === "south" && (O.x = 100, O.y = 0 + R / 2), P === "west" && (O.x = 100, O.y = 0 + R / 2))), M === "north" && (T === "north_west" && (P === "north" && (O.x = 0, O.y = 0 - R / 2), P === "west" && (O.x = 0 - B / 2, O.y = 0)), T === "north_east" && (P === "north" && (O.x = 0, O.y = 0 - R / 2), P === "east" && (O.x = 0 + B / 2, O.y = 0)), T === "south_east" && (P === "south" && (O.x = 0 + B / 2, O.y = -100), P === "east" && (O.x = 0 + B / 2, O.y = -100)), T === "south_west" && (P === "south" && (O.x = 0 - B / 2, O.y = -100), P === "west" && (O.x = 0 - B / 2, O.y = -100))), M === "south" && (T === "north_west" && (P === "north" && (O.x = 0 - B / 2, O.y = 100), P === "west" && (O.x = 0 - B / 2, O.y = 100)), T === "north_east" && (P === "north" && (O.x = 0 + B / 2, O.y = 100), P === "east" && (O.x = 0 + B / 2, O.y = 100)), T === "south_east" && (P === "south" && (O.x = 0, O.y = 0 + R / 2), P === "east" && (O.x = 0 + B / 2, O.y = 0)), T === "south_west" && (P === "south" && (O.x = 0, O.y = R / 2), P === "west" && (O.x = 0 - B / 2, O.y = 0))), O; } function c(M, T, P, B) { const R = { x: 0, y: 0 }; return M === "south" && (T === "west" && (R.x = -100, R.y = 0 - B / 2), T === "east" && (R.x = 100, R.y = -100), T === "south" && (R.x = 0 - P / 2, R.y = 100), (T === "north" || T === "center") && (R.x = 0, R.y = 0 - B / 2)), M === "north" && (T === "west" && (R.x = -100, R.y = 100), T === "east" && (R.x = 100, R.y = 100), T === "north" && (R.x = 0 - P / 2, R.y = -100), (T === "south" || T === "center") && (R.x = 0, R.y = B / 2)), M === "east" && (T === "north" && (R.y = -100, R.x = -100), T === "south" && (R.y = 100, R.x = -100), T === "east" && (R.x = 100, R.y = 100), (T === "west" || T === "center") && (R.x = 0 - P / 2, R.y = 0)), M === "west" && (T === "north" && (R.y = -100, R.x = 100), T === "south" && (R.y = 100, R.x = 100), T === "west" && (R.x = -100, R.y = B / 2), (T === "east" || T === "center") && (R.x = P / 2, R.y = 0)), R; } function f(M, T, P, B, R, O, N) { const A = N === "south" || N === "east" ? "portrait" : "landscape", H = R, j = A === "landscape" ? "east" : "north", G = N === "center" ? A === "landscape" ? "west" : "south" : N, Z = u(H, O, j, M, T), { x: Q, y: K } = Z, le = c(j, G, M, T), { x: ae, y: fe } = le; fe < 0 && (T += Math.abs(fe)); const Ie = /* @__PURE__ */ new Map([["default", 0 + Q], ["portrait", 0 + Q], ["landscape", 0 + Q]]), _e = /* @__PURE__ */ new Map([["default", T + K], ["portrait", T + K], ["landscape", T + K]]); Q < 0 && (M += Math.abs(Q)), ae > 0 && (M += ae); const X = /* @__PURE__ */ new Map([["default", M + ae], ["portrait", M + ae], ["landscape", M + ae]]), oe = /* @__PURE__ */ new Map([["default", 0 + fe], ["portrait", 0 + fe], ["landscape", 0 + fe]]), Y = B.left > o.left, ee = B.bottom > o.bottom, Ce = Y ? 0 : ee ? M / 2 : Ie.get(A), Ee = ee ? T + B.bottom : Y ? T / 2 : _e.get(A), Me = X.get(A), je = oe.get(A); return [{ x: Ce, y: Ee }, { x: Me, y: je }, { x: ae, y: fe }]; } function p(M, T, P, B, R, O, N) { const A = N === "south" || N === "west" ? "portrait" : "landscape", H = R, j = A === "landscape" ? "west" : "north", G = N, Z = u(H, O, j, M, T), { x: Q, y: K } = Z, le = c(j, G, M, T), { x: ae, y: fe } = le; fe < 0 && (T += Math.abs(fe)), Q > 0 && (M += Q), ae < 0 && (M += Math.abs(ae)); const Ie = /* @__PURE__ */ new Map([["default", M + Q], ["portrait", M + Q], ["landscape", M + Q]]), _e = /* @__PURE__ */ new Map([["default", T + K], ["portrait", T + K], ["landscape", T + K]]), X = /* @__PURE__ */ new Map([["default", 0 + ae], ["portrait", 0 + ae], ["landscape", 0 + ae]]), oe = /* @__PURE__ */ new Map([["default", 0 + fe], ["portrait", 0 + fe], ["landscape", 0 + fe]]), Y = B.right > o.right, ee = B.bottom > o.bottom, Ce = Y ? M + B.right : ee ? M / 2 : Ie.get(A), Ee = ee ? T + B.bottom : Y ? T / 2 : _e.get(A), Me = X.get(A), je = oe.get(A); return [{ x: Ce, y: Ee }, { x: Me, y: je }, { x: ae, y: fe }]; } function v(M, T, P, B, R, O, N) { const A = N === "north" || N === "east" ? "portrait" : "landscape", H = R, j = A === "landscape" ? "east" : "south", G = N, Z = u(H, O, j, M, T), { x: Q, y: K } = Z, le = c(j, G, M, T), { x: ae, y: fe } = le, Ie = /* @__PURE__ */ new Map([["default", 0 + Q], ["portrait", 0 + Q], ["landscape", 0 + Q]]), _e = /* @__PURE__ */ new Map([["default", 0 + K], ["portrait", 0 + K], ["landscape", 0 + K]]); Q < 0 && (M += Math.abs(Q)), K < 0 && (T += Math.abs(K)), ae > 0 && (M += ae), fe > 0 && (T += fe); const X = /* @__PURE__ */ new Map([["default", M + ae], ["portrait", M + ae], ["landscape", M + ae]]), oe = /* @__PURE__ */ new Map([["default", T + fe], ["portrait", T + fe], ["landscape", T + fe]]), Y = B.left > o.left, ee = B.top > o.top, Ce = Y ? 0 : ee ? M / 2 : Ie.get(A), Ee = ee ? 0 : Y ? T / 2 : _e.get(A), Me = X.get(A), je = oe.get(A); return [{ x: Ce, y: Ee }, { x: Me, y: je }, { x: ae, y: fe }]; } function d(M, T, P, B, R, O, N) { const A = N === "north" || N === "west" ? "portrait" : "landscape", H = R, j = A === "landscape" ? "west" : "south", G = N, Z = u(H, O, j, M, T), { x: Q, y: K } = Z, le = c(j, G, M, T), { x: ae, y: fe } = le; ae < 0 && (M += Math.abs(ae)); const Ie = /* @__PURE__ */ new Map([["default", M + Q], ["portrait", M + Q], ["landscape", M + Q]]), _e = /* @__PURE__ */ new Map([["default", 0 + K], ["portrait", 0 + K], ["landscape", 0 + K]]); K < 0 && (T += Math.abs(K)), fe > 0 && (T += fe); const X = /* @__PURE__ */ new Map([["default", 0 + ae], ["portrait", 0 + ae], ["landscape", 0 + ae]]), oe = /* @__PURE__ */ new Map([["default", T + fe], ["portrait", T + fe], ["landscape", T + fe]]), Y = B.right > o.right, ee = B.top > o.top, Ce = Y ? M + B.right : ee ? M / 2 : Ie.get(A), Ee = ee ? 0 : Y ? T / 2 : _e.get(A), Me = X.get(A), je = oe.get(A); return [{ x: Ce, y: Ee }, { x: Me, y: je }, { x: ae, y: fe }]; } const F = /* @__PURE__ */ new Map([ ["north_east", f], ["north_west", p], ["south_east", v], ["south_west", d] ]), y = /* @__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 g(M, T) { return M === "north_west" ? { aroundDirection: "north_west", left: T.left, right: 100, top: T.top, bottom: T.top } : M === "south_west" ? { aroundDirection: "south_west", left: T.left, right: 100, top: T.top, bottom: T.bottom } : T; } function S(M, T) { return M === "north_east" ? { left: 100, right: T.right, top: T.top, bottom: T.top } : M === "south_east" ? { left: 100, right: T.right, top: T.top, bottom: T.bottom } : T; } function h(M, T) { return M === "south_west" ? { left: T.left, right: T.right, top: 100, bottom: T.top } : M === "south_east" ? { left: T.left, right: T.right, top: 100, bottom: T.bottom } : T; } function C(M, T) { return M === "north_west" ? { left: T.left, right: T.right, top: T.top, bottom: 100 } : M === "north_east" ? { left: T.left, right: T.right, top: T.top, bottom: 100 } : T; } function x(M, T) { return T; } const b = /* @__PURE__ */ new Map([ ["east", g], ["west", S], ["north", h], ["south", C], ["center", x] ]); function m(M, T, P, B) { const R = T.x - M.x, O = T.y - M.y, N = R >= 0 ? "east" : "west", A = O >= 0 ? "south" : "north", H = `${A}_${N}`, G = (y.get(P) || []).includes(H), Z = b.get(P), Q = G ? Z(H, o) : o, K = Math.abs(R), le = Math.abs(O), ae = F.get(`${A}_${N}`), [fe, Ie, _e] = ae( K, le, G, Q, P, H, B ), X = N === "west" ? _e.x < 0 ? Math.abs(_e.x) : 0 : _e.x > 0 ? _e.x : 0, oe = Q.left + Q.right + K + X, Y = A === "north" ? _e.y < 0 ? Math.abs(_e.y) : 0 : _e.y > 0 ? _e.y : 0, ee = Q.top + Q.bottom + le + Y, Ce = N === "east" ? M.x - Q.left : M.x + Q.right - oe, Ee = A === "south" ? M.y - Q.top : M.y + Q.bottom - ee, Me = N === "east" ? Q.left : oe - Q.right, je = A === "north" ? ee - Q.bottom : Q.top, ft = N === "west" ? _e.x < 0 ? Math.abs(_e.x) : 0 : _e.x < 0 ? oe : oe - _e.x, ct = A === "north" ? _e.y < 0 ? Math.abs(_e.y) : 0 : _e.y < 0 ? ee : ee - _e.y; return { width: oe, height: ee, left: Ce, top: Ee, startPoinInBoundray: { x: Me, y: je }, firstControlPoint: fe, secondControlPoint: Ie, endPoinInBoundray: { x: ft, y: ct } }; } function _(M, T, P, B, R) { M.style.position = "absolute", M.style.alignItems = "center", M.style.left = `${T}px`, M.style.top = `${P}px`, M.style.width = B + "px", M.style.height = R + "px"; } function E(M, T, P, B, R, O, N) { const A = M.childNodes[0]; A.setAttribute("width", String(T)), A.setAttribute("height", String(P)), M.appendChild(A); const H = A.childNodes[0], j = `${B.x} ${B.y}`, G = `${R.x} ${R.y}`, Z = `${O.x} ${O.y}`, Q = `${N.x} ${N.y}`, K = "M ".concat(j).concat(" C ").concat(G).concat("," + Z + ",").concat(Q); H.setAttribute("d", K), H.setAttribute("fill", "none"), H.setAttribute("stroke", "#4d53e8"), H.setAttribute("stroke-width", "2"), H.setAttribute("class", ""); } function I(M, T, P, B, R) { const { width: O, height: N, left: A, top: H, startPoinInBoundray: j, firstControlPoint: G, secondControlPoint: Z, endPoinInBoundray: Q } = m(T, P, B, R); _(M, A, H, O, N), E(M, O, N, j, G, Z, Q); } function w(M, T, P, B, R) { const O = l(M); I(O, T, P, B, R); } function L(M) { return Number(M.replace("px", "")); } function W(M) { if (M !== null) { const T = M.parentNode, P = L(T.style.left), B = L(T.style.top); return { x: P + M.offsetLeft + M.offsetWidth / 2, y: B + M.offsetTop + M.offsetHeight / 2 }; } return { x: 0, y: 0 }; } function V(M, T) { const P = document.getElementById(M), B = document.getElementById(T), R = W(P), O = W(B), N = R.x + 2, A = R.y, H = O.x - 2, j = O.y; return { startPoint: { x: N, y: A }, endPoint: { x: H, y: j } }; } function $(M, T, P, B) { const { startPoint: R, endPoint: O } = V(M, T); w(`${M}_${T}`, R, O, P, B); } return { connect: $, drawing: w }; } function ga(n) { const t = k(), e = k(0), o = k(0), r = k({ x: 0, y: 0 }), i = k(), { drawing: a } = n; function s(g) { return Number(g.replace("px", "")); } function l(g) { return (g && g.className && g.className.split ? g.className.split(" ") : []).includes("f-flow-ancher"); } function u(g) { switch ((g ? g.className.split(" ") : []).find((C) => C.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 c(g, S, h) { const C = h.getBoundingClientRect(); e.value = C.left, o.value = C.top, r.value = { x: g, y: S }, t.value = u(h); } function f(g) { var _; const S = g.clientX - e.value, h = g.clientY - o.value, C = r.value.x + S, x = r.value.y + h, b = g.target, m = b && typeof b.className == "string" && l(b) ? u(b) : "center"; a( `${(_ = i.value) == null ? void 0 : _.id}_curve_to`, { x: r.value.x, y: r.value.y }, { x: C, y: x }, t.value, m ); } function p(g) { const S = document.getElementById(g); S && S.remove(); } function v() { document.addEventListener("mousemove", f); } function d() { document.removeEventListener("mousemove", f); } function F(g) { i.value = void 0, d(); } function y(g, S) { i.value = document.getElementById(g); const h = i.value.offsetParent, C = i.value.getBoundingClientRect(), x = h.getBoundingClientRect(), b = s(h.style.left) + (C.left - x.left), m = s(h.style.top) + (C.top - x.top), _ = b + C.width / 2, E = m + C.height / 2; c(_, E, i.value), v(); } return { drawFrom: y, eraseDrawingLine: p, finishToDraw: F, getAncherPointPosition: u, isAncherPoint: l }; } const ya = { 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: [] } }, qt = k(0); function ba(n, t) { const e = t.getBoundingClientRect(), o = n.getBoundingClientRect(), r = o.top >= e.top, i = o.top <= e.bottom; return r && i; } function wa(n) { const t = n.querySelector(".component-btn-group"); if (!t) return; t.style.display = ""; const e = t.getBoundingClientRect(); if (!(e.top === 0 && e.left === 0)) { const o = t.querySelector("div"); if (o) { const r = o.getBoundingClientRect(); o.style.top = e.top + "px"; let i = e.left - r.width; const a = document.querySelector(".editorDiv"); if (a) { const s = a.getBoundingClientRect(); i < s.left && ({ left: i } = n.getBoundingClientRect()); } o.style.left = i + "px"; } } } function Ca(n) { if (!window.scrollContainerList) return; const t = Array.from(window.scrollContainerList); if (t.length && t.length === 1) { const e = t[0], o = document.querySelector(`[id=${e}]`); if (o && o.contains(n)) return o; } } function or(n) { if (!n) return; const t = n.getBoundingClientRect(); if (t.width === 0 && t.height === 0) return; const e = n.querySelector(".component-btn-group"); if (e) { let o = !0; const r = Ca(n); if (r && (o = ba(n, r)), !o) { e.style.display = "none"; return; } wa(n); } } function an(n) { if (!n) return; let t; n.className.includes("dgComponentSelected") ? t = n : t = n.querySelector(".dgComponentSelected"), t && or(t); } const xa = { /** * 组件值 */ modelValue: { type: Object, default: {} }, componentId: { type: String, default: "" } }; var Ot = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function _a(n) { return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n; } function rn(n) { throw new Error('Could not dynamically require "' + n + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var rr = { exports: {} }; (function(n, t) { (function(e) { n.exports = e(); })(function() { return (/* @__PURE__ */ function() { function e(o, r, i) { function a(u, c) { if (!r[u]) { if (!o[u]) { var f = typeof rn == "function" && rn; if (!c && f) return f(u, !0); if (s) return s(u, !0); var p = new Error("Cannot find module '" + u + "'"); throw p.code = "MODULE_NOT_FOUND", p; } var v = r[u] = { exports: {} }; o[u][0].call(v.exports, function(d) { var F = o[u][1][d]; return a(F || d); }, v, v.exports, e, o, r, i); } return r[u].exports; } for (var s = typeof rn == "function" && rn, l = 0; l < i.length; l++) a(i[l]); return a; } return e; }())({ 1: [function(e, o, r) { var i = {}, a = "(?:^|\\s)", s = "(?:\\s|$)"; function l(f) { var p = i[f]; return p ? p.lastIndex = 0 : i[f] = p = new RegExp(a + f + s, "g"), p; } function u(f, p) { var v = f.className; v.length ? l(p).test(v) || (f.className += " " + p) : f.className = p; } function c(f, p) { f.className = f.className.replace(l(p), " ").trim(); } o.exports = { add: u, rm: c }; }, {}], 2: [function(e, o, r) { (function(i) { var a = e("contra/emitter"), s = e("crossvent"), l = e("./classes"), u = document, c = u.documentElement; function f(w, L) { var W = arguments.length; W === 1 && Array.isArray(w) === !1 && (L = w, w = []); var V, $, M, T, P, B, R, O, N, A = null, H, j, G = !1, Z = 0, Q, K = L || {}; K.moves === void 0 && (K.moves = S), K.accepts === void 0 && (K.accepts = S), K.invalid === void 0 && (K.invalid = ft), K.containers === void 0 && (K.containers = w || []), K.isContainer === void 0 && (K.isContainer = g), 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 le = a({ containers: K.containers, start: Me, end: ct, cancel: We, remove: Ue, destroy: X, canMove: Ee, dragging: !1 }); return K.removeOnSpill === !0 && le.on("over", Ft).on("out", _t), fe(), le; function ae(q) { return le.containers.indexOf(q) !== -1 || K.isContainer(q); } function fe(q) { var ne = q ? "remove" : "add"; d(c, ne, "mousedown", Y), d(c, ne, "mouseup", Oe); } function Ie(q) { var ne = q ? "remove" : "add"; d(c, ne, "mousemove", ee); } function _e(q) { var ne = q ? "remove" : "add"; s[ne](c, "selectstart", oe), s[ne](c, "click", oe); } function X() { fe(!0), Oe({}); } function oe(q) { H && q.preventDefault(); } function Y(q) { T = q.clientX, P = q.clientY; var ne = F(q) !== 1 || q.metaKey || q.ctrlKey; if (!ne) { var ie = q.target, re = Ce(ie); re && (H = re, Ie(), q.type === "mousedown" && (b(ie) ? ie.focus() : q.preventDefault())); } } function ee(q) { if (H) { if (F(q) === 0) { Oe({}); return; } if (!(q.clientX !== void 0 && Math.abs(q.clientX - T) <= (K.slideFactorX || 0) && q.clientY !== void 0 && Math.abs(q.clientY - P) <= (K.slideFactorY || 0))) { if (K.ignoreInputTextSelection) { var ne = I("clientX", q) || 0, ie = I("clientY", q) || 0, re = u.elementFromPoint(ne, ie); if (b(re)) return; } var Te = H; Ie(!0), _e(), ct(), je(Te), l.add(O || M, "gu-transit"), Et(), Nt(), Z = 0, gt(q); } } } function Ce(q) { if (!(le.dragging && V) && !ae(q)) { for (var ne = q; x(q) && ae(x(q)) === !1; ) if (K.invalid(q, ne) || (q = x(q), !q)) return; var ie = x(q); if (ie && !K.invalid(q, ne)) { var re = K.moves(q, ie, ne, _(q)); if (re) return { item: q, source: ie }; } } } function Ee(q) { return !!Ce(q); } function Me(q) { var ne = Ce(q); ne && je(ne); } function je(q) { Be(q.item, q.source) && (O = q.item.cloneNode(!0), le.emit("cloned", O, q.item, "copy")), $ = q.source, M = q.item, B = R = _(q.item), le.dragging = !0, le.emit("drag", M, $); } function ft() { return !1; } function ct() { if (le.dragging) { var q = O || M; Re(q, x(q)); } } function te() { H = !1, Ie(!0), _e(!0); } function Oe(q) { if (te(), !!le.dragging) { var ne = O || M, ie = I("clientX", q) || 0, re = I("clientY", q) || 0, Te = y(V, ie, re), Se = kt(Te, ie, re); Se && (O && K.copySortSource || !O || Se !== $) ? Re(ne, Se) : K.removeOnSpill ? Ue() : We(); } } function Re(q, ne) { var ie = x(q); O && K.copySortSource && ne === $ && ie.removeChild(M), xt(ne) ? le.emit("cancel", q, $) : le.emit("drop", q, ne, $, R), pt(); } function Ue() { if (le.dragging) { var q = O || M, ne = x(q); ne && ne.removeChild(q), le.emit(O ? "cancel" : "remove", q, ne, $), pt(); } } function We(q) { if (le.dragging) { var ne = arguments.length > 0 ? q : K.revertOnSpill, ie = O || M, re = x(ie), Te = xt(re); Te === !1 && ne && (O ? re && re.removeChild(O) : $.insertBefore(ie, B)), Te || ne ? le.emit("cancel", ie, $, $) : le.emit("drop", ie, re, $, R), pt(); } } function pt() { var q = O || M; te(), se(), he(), q && l.rm(q, "gu-transit"), N && clearTimeout(N), le.dragging = !1, A && le.emit("out", q, A, $), le.emit("dragend", q, Z), $ = M = O = B = R = N = A = null; } function xt(q, ne) { var ie; return ne !== void 0 ? ie = ne : V ? ie = R : ie = _(O || M), q === $ && ie === B; } function kt(q, ne, ie) { for (var re = q; re && !Te(); ) re = x(re); return re; function Te() { var Se = ae(re); if (Se === !1) return !1; var Le = xe(re, q), De = ke(re, Le, ne, ie), He = xt(re, De); return He ? !0 : K.accepts(M, re, $, De); } } function gt(q) { if (!V) return; q.preventDefault(); var ne = I("clientX", q) || 0, ie = I("clientY", q) || 0; V.style.left = ne - 2 + "px", V.style.top = ie - 2 + "px"; var re = O || M, Te = y(V, ne, ie), Se = kt(Te, ne, ie), Le = Se !== null && Se !== A; (Le || Se === null) && (be(), A = Se, mt()), ve(Te, ie); var De = x(re); if (Se === $ && O && !K.copySortSource) { De && De.removeChild(re); return; } var He, dt = xe(Se, Te); if (G = $e(dt, Se), dt !== null) He = ke(Se, dt, ne, ie); else if (K.revertOnSpill === !0 && !O) He = B, Se = $; else { O && De && De.removeChild(re), O && j && (j.style.display = "none"); return; } j.style.display = "block", Dt(He, re, Le), He ? rt(dt, He) : J(Se); function Ze(Fe) { le.emit(Fe, re, A, $); } function mt() { Le && Ze("over"); } function be() { A && Ze("out"); } } function Dt(q, ne, ie) { (q === ne || q === _(ne)) && (R = _(ne)), (q === null && ie || q !== ne && q !== _(ne)) && (R = q); } function Ft(q) { l.rm(q, "gu-hide"); } function _t(q) { le.dragging && l.add(q, "gu-hide"); } function Nt() { V || (V = document.createElement("div"), V.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;", V.innerHTML = K.getMirrorText && K.getMirrorText(M) || "控件", l.add(V, "gu-mirror"), K.mirrorContainer.appendChild(V), d(c, "add", "mousemove", gt), l.add(K.mirrorContainer, "gu-unselectable"), le.emit("cloned", V, M, "mirror")); } function Et() { if (j = document.createElement("div"), l.add(j, "gu-insertion"), M) { var q = M.getBoundingClientRect(); j.style.left = q.left + "px", j.style.top = q.top + "px"; } G = !1, K.mirrorContainer.appendChild(j); } function se() { V && (l.rm(K.mirrorContainer, "gu-unselectable"), d(c, "remove", "mousemove", gt), x(V).removeChild(V), V = null); } function he() { j && (x(j).removeChild(j), j = null); } function xe(q, ne) { for (var ie = ne; ie !== q && x(ie) !== q; ) ie = x(ie); return ie === c ? null : ie; } function $e(q, ne) { if (!ne) return G; var ie = q || ne && ne.lastElementChild; if (!ie) return !0; var re = getComputedStyle(q), Te = /^inline/.test(re.getPropertyValue("display")) || /^(left|right)$/.test(re.getPropertyValue("float")); if (Te) return !0; if (ne) { var Se = getComputedStyle(ne), Le = Se.getPropertyValue("display"); if (/flex$/.test(Le)) { var De = Se.getPropertyValue("flex-direction") || "row"; if (De === "row" || De === "row-reverse") return !Qe(ne); } return !1; } return !0; } function Qe(q) { if (!q.children || !q.children.length) return !1; for (const ne of Array.from(q.children)) { const re = (ne.className && ne.className.split(" ") || []).filter((Te) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Te)); if (!re.length) return !1; for (const Te of re) { const Se = Te.slice(Te.lastIndexOf("-") + 1); if (parseInt(Se, 10) !== 12) return !1; } } return !0; } function rt(q, ne) { const ie = ne.getBoundingClientRect(); if (j.style.left = ie.left + "px", j.style.top = ie.top + "px", G) { if (j.style.height = ie.height + "px", j.style.width = "4px", q) { const re = q.getBoundingClientRect(); re.top !== ie.top && (j.style.left = re.right + "px", j.style.top = re.top + "px", j.style.height = re.height + "px"); } } else if (j.style.height = "4px", j.style.width = ie.width + "px", Q) { const re = Q.getBoundingClientRect(); ie.top < re.top && (j.style.display = "none"); } ne === M && M && (j.style.display = "none"); } function J(q) { R = null; var ne = q.lastElementChild; if (ne) { var ie = ne.getBoundingClientRect(); G ? (j.style.left = ie.right + "px", j.style.top = ie.top + "px", j.style.height = ie.height + "px", j.style.width = "4px") : (j.style.left = ie.left + "px", j.style.top = ie.bottom + "px", j.style.height = "4px", j.style.width = ie.width + "px"), ne === M && M && (j.style.display = "none"); } else j.style.display = "none"; } function ve(q, ne) { if (!K.mirrorContainer.contains(q) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (Q = p(q), !Q || !Q.contains(q))) return; const ie = document.querySelector(".dgComponentSelected"), re = Q.getBoundingClientRect(); if (ne - 30 < re.top && Q.scrollTop > 0) { let Te = Q.scrollTop < 10 ? Q.scrollTop : 10; Q.scrollBy(0, -1 * Te), ie && Q.contains(ie) && (Z = Z + -1 * Te); } if (ne + 30 > re.bottom && Q.scrollTop < Q.scrollHeight - Q.clientHeight) { const Te = Q.scrollHeight - Q.clientHeight - Q.scrollTop; let Se = Te < 10 ? Te : 10; Q.scrollBy(0, Se), ie && Q.contains(ie) && (Z = Z + Se); } } function ke(q, ne, ie, re) { var Te = K.direction === "horizontal", Se = K.direction === "mixed", Le = ne !== q ? He() : De(); return Le; function De() { var Ze = q.children.length, mt, be, Fe; for (mt = 0; mt < Ze; mt++) if (be = q.children[mt], Fe = be.getBoundingClientRect(), Te && Fe.left + Fe.width / 2 > ie || !Se && !Te && Fe.top + Fe.height / 2 > re || Se && Fe.left + Fe.width > ie && Fe.top + Fe.height > re) return be; return null; } function He() { var Ze = ne.getBoundingClientRect(); if (Se) { var mt = re - Ze.top, be = ie - Ze.left, Fe = Ze.bottom - re, it = Ze.right - ie, nt = Math.min(be, it, mt, Fe), at; return G ? at = it < be : at = Fe === nt || it === nt || be === nt, dt(at); } return dt(Te ? ie > Ze.left + h(Ze) / 2 : re > Ze.top + C(Ze) / 2); } function dt(Ze) { return Ze ? _(ne) : ne; } } function Be(q, ne) { return typeof K.copy == "boolean" ? K.copy : K.copy(q, ne); } } function p(w) { const L = Array.from(window.scrollContainerList); if (L.length === 1) { const V = Array.from(window.scrollContainerList)[0]; return document.getElementById(V); } const W = v(L); for (const V of W) if (V.contains(w)) return V; return null; } function v(w) { const L = []; return w.forEach((W) => { const V = document.getElementById(W); V && L.push(V); }), L.sort((W, V) => W.contains(V) ? 1 : V.contains(W) ? -1 : 0), L; } function d(w, L, W, V) { var $ = { mouseup: "touchend", mousedown: "touchstart", mousemove: "touchmove" }, M = { mouseup: "pointerup", mousedown: "pointerdown", mousemove: "pointermove" }, T = { mouseup: "MSPointerUp", mousedown: "MSPointerDown", mousemove: "MSPointerMove" }; i.navigator.pointerEnabled ? s[L](w, M[W], V) : i.navigator.msPointerEnabled ? s[L](w, T[W], V) : (s[L](w, $[W], V), s[L](w, W, V)); } function F(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 L = w.button; if (L !== void 0) return L & 1 ? 1 : L & 2 ? 3 : L & 4 ? 2 : 0; } function y(w, L, W) { w = w || {}; var V = w.className || "", $; return w.className += " gu-hide", $ = u.elementFromPoint(L, W), w.className = V, $; } function g() { return !1; } function S() { return !0; } function h(w) { return w.width || w.right - w.left; } function C(w) { return w.height || w.bottom - w.top; } function x(w) { return w.parentNode === u ? null : w.parentNode; } function b(w) { return w.tagName === "INPUT" || w.tagName === "TEXTAREA" || w.tagName === "SELECT" || m(w); } function m(w) { return !w || w.contentEditable === "false" ? !1 : w.contentEditable === "true" ? !0 : m(x(w)); } function _(w) { return w.nextElementSibling || L(); function L() { var W = w; do W = W.nextSibling; while (W && W.nodeType !== 1); return W; } } function E(w) { return w.targetTouches && w.targetTouches.length ? w.targetTouches[0] : w.changedTouches && w.changedTouches.length ? w.changedTouches[0] : w; } function I(w, L) { var W = E(L), V = { pageX: "clientX", // IE8 pageY: "clientY" // IE8 }; return w in V && !(w in W) && V[w] in W && (w = V[w]), W[w]; } o.exports = f; }).call(this, typeof Ot < "u" ? Ot : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }], 3: [function(e, o, r) { o.exports = function(a, s) { return Array.prototype.slice.call(a, s); }; }, {}], 4: [function(e, o, r) { var i = e("ticky"); o.exports = function(s, l, u) { s && i(function() { s.apply(u || null, l || []); }); }; }, { ticky: 10 }], 5: [function(e, o, r) { var i = e("atoa"), a = e("./debounce"); o.exports = function(l, u) { var c = u || {}, f = {}; return l === void 0 && (l = {}), l.on = function(p, v) { return f[p] ? f[p].push(v) : f[p] = [v], l; }, l.once = function(p, v) { return v._once = !0, l.on(p, v), l; }, l.off = function(p, v) { var d = arguments.length; if (d === 1) delete f[p]; else if (d === 0) f = {}; else { var F = f[p]; if (!F) return l; F.splice(F.indexOf(v), 1); } return l; }, l.emit = function() { var p = i(arguments); return l.emitterSnapshot(p.shift()).apply(this, p); }, l.emitterSnapshot = function(p) { var v = (f[p] || []).slice(0); return function() { var d = i(arguments), F = this || l; if (p === "error" && c.throws !== !1 && !v.length) throw d.length === 1 ? d[0] : d; return v.forEach(function(g) { c.async ? a(g, d, F) : g.apply(F, d), g._once && l.off(p, g); }), l; }; }, l; }; }, { "./debounce": 4, atoa: 3 }], 6: [function(e, o, r) { (function(i) { var a = e("custom-event"), s = e("./eventmap"), l = i.document, u = p, c = d, f = []; i.addEventListener || (u = v, c = F), o.exports = { add: u, remove: c, fabricate: y }; function p(x, b, m, _) { return x.addEventListener(b, m, _); } function v(x, b, m) { return x.attachEvent("on" + b, S(x, b, m)); } function d(x, b, m, _) { return x.removeEventListener(b, m, _); } function F(x, b, m) { var _ = h(x, b, m); if (_) return x.detachEvent("on" + b, _); } function y(x, b, m) { var _ = s.indexOf(b) === -1 ? I() : E(); x.dispatchEvent ? x.dispatchEvent(_) : x.fireEvent("on" + b, _); function E() { var w; return l.createEvent ? (w = l.createEvent("Event"), w.initEvent(b, !0, !0)) : l.createEventObject && (w = l.createEventObject()), w; } function I() { return new a(b, { detail: m }); } } function g(x, b, m) { return function(E) { var I = E || i.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, m.call(x, I); }; } function S(x, b, m) { var _ = h(x, b, m) || g(x, b, m); return f.push({ wrapper: _, element: x, type: b, fn: m }), _; } function h(x, b, m) { var _ = C(x, b, m); if (_) { var E = f[_].wrapper; return f.splice(_, 1), E; } } function C(x, b, m) { var _, E; for (_ = 0; _ < f.length; _++) if (E = f[_], E.element === x && E.type === b && E.fn === m) return _; } }).call(this, typeof Ot < "u" ? Ot : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./eventmap": 7, "custom-event": 8 }], 7: [function(e, o, r) { (function(i) { var a = [], s = "", l = /^on/; for (s in i) l.test(s) && a.push(s.slice(2)); o.exports = a; }).call(this, typeof Ot < "u" ? Ot : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 8: [function(e, o, r) { (function(i) { var a = i.CustomEvent; function s() { try { var l = new a("cat", { detail: { foo: "bar" } }); return l.type === "cat" && l.detail.foo === "bar"; } catch { } return !1; } o.exports = s() ? a : ( // IE >= 9 typeof document < "u" && typeof document.createEvent == "function" ? function(u, c) { var f = document.createEvent("CustomEvent"); return c ? f.initCustomEvent(u, c.bubbles, c.cancelable, c.detail) : f.initCustomEvent(u, !1, !1, void 0), f; } : ( // IE <= 8 function(u, c) { var f = document.createEventObject(); return f.type = u, c ? (f.bubbles = !!c.bubbles, f.cancelable = !!c.cancelable, f.detail = c.detail) : (f.bubbles = !1, f.cancelable = !1, f.detail = void 0), f; } ) ); }).call(this, typeof Ot < "u" ? Ot : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 9: [function(e, o, r) { var i = o.exports = {}, a, s; function l() { throw new Error("setTimeout has not been defined"); } function u() { throw new Error("clearTimeout has not been defined"); } (function() { try { typeof setTimeout == "function" ? a = setTimeout : a = l; } catch { a = l; } try { typeof clearTimeout == "function" ? s = clearTimeout : s = u; } catch { s = u; } })(); function c(C) { if (a === setTimeout) return setTimeout(C, 0); if ((a === l || !a) && setTimeout) return a = setTimeout, setTimeout(C, 0); try { return a(C, 0); } catch { try { return a.call(null, C, 0); } catch { return a.call(this, C, 0); } } } function f(C) { if (s === clearTimeout) return clearTimeout(C); if ((s === u || !s) && clearTimeout) return s = clearTimeout, clearTimeout(C); try { return s(C); } catch { try { return s.call(null, C); } catch { return s.call(this, C); } } } var p = [], v = !1, d, F = -1; function y() { !v || !d || (v = !1, d.length ? p = d.concat(p) : F = -1, p.length && g()); } function g() { if (!v) { var C = c(y); v = !0; for (var x = p.length; x; ) { for (d = p, p = []; ++F < x; )