@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,265 lines (1,264 loc) • 383 kB
JavaScript
var $o = Object.defineProperty;
var Ho = (n, t, e) => t in n ? $o(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
var B = (n, t, e) => Ho(n, typeof t != "symbol" ? t + "" : t, e);
import { defineComponent as tt, createVNode as O, ref as S, computed as q, watch as Ee, Fragment as Ut, reactive as yt, createApp as jn, onUnmounted as an, onMounted as Bt, Transition as An, mergeProps as Vt, createTextVNode as Rt, onBeforeUnmount as qn, withDirectives as jo, resolveDirective as Ao, nextTick as sn, onBeforeMount as qo, Teleport as Go, shallowRef as zo, render as un, h as Yo, cloneVNode as Uo, inject as Tt, provide as Xo, triggerRef as Qo, isVNode as Ko } from "vue";
import { isPlainObject as Mn, cloneDeep as kt, isUndefined as ut, throttle as Jo } from "lodash-es";
import { useResizeObserver as Gn } from "@vueuse/core";
import { useIdentify as Zo, useGroupData as er, useFilter as tr, useHierarchy as nr, useLoading as or, useDataView as rr, useSelection as ar, useSelectHierarchyItem as ir, useDataViewContainerStyle as sr, useCommandColumn as lr, useColumn as ur, useSort as cr, useGroupColumn as dr, useRow as fr, useEdit as pr, useVisualDataBound as mr, useVisualDataCell as hr, useVisualDataRow as vr, useVisualData as gr, useCellPosition as yr, useSidebar as br, useVirtualScroll as wr, useFitColumn as Cr, useFilterHistory as _r, useColumnFilter as xr, useDragColumn as Sr, getColumnHeader as Tr, getSidebar as kr, getDisableMask as Er, getHorizontalScrollbar as Mr, getVerticalScrollbar as Fr, getEmpty as Or } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import Dr from "../transfer/index.esm.js";
import Ir from "../tabs/index.esm.js";
import Pr from "../order/index.esm.js";
import "../condition/index.esm.js";
import { FCheckbox as Nr } from "../checkbox/index.esm.js";
import { useGuid as Vr, resolveField as rt, FormSchemaEntityFieldTypeName as Fn, useCommonUtils as Rr, useDateFormat as Br, useNumberFormat as Lr, setFieldValue as pn, getCustomClass as Qt, withInstall as Wr } from "../common/index.esm.js";
import $r from "../filter-bar/index.esm.js";
import On from "../tooltip/index.esm.js";
import Hr from "../pagination/index.esm.js";
import jr from "../button/index.esm.js";
import Ar from "../search-box/index.esm.js";
import qr from "../tags/index.esm.js";
import Gr, { FDynamicFormGroup as zr, FDynamicFormInput as Yr } from "../dynamic-form/index.esm.js";
import { createPropsResolver as Ur } from "../dynamic-resolver/index.esm.js";
import "../designer-canvas/index.esm.js";
import "../property-panel/index.esm.js";
import Xr from "../accordion/index.esm.js";
import Qr from "../avatar/index.esm.js";
import Kr from "../../designer/button-edit/index.esm.js";
import Jr from "../button-group/index.esm.js";
import Zr from "../calendar/index.esm.js";
import ea from "../capsule/index.esm.js";
import Dn from "../../designer/checkbox/index.esm.js";
import In from "../../designer/checkbox-group/index.esm.js";
import mn from "../combo-list/index.esm.js";
import ta from "../combo-tree/index.esm.js";
import na from "../component/index.esm.js";
import oa from "../color-picker/index.esm.js";
import ra from "../content-container/index.esm.js";
import aa from "../date-picker/index.esm.js";
import ia from "../../designer/data-grid/index.esm.js";
import sa from "../dropdown/index.esm.js";
import la from "../events-editor/index.esm.js";
import ua from "../field-selector/index.esm.js";
import ca from "../binding-selector/index.esm.js";
import da from "../image-cropper/index.esm.js";
import fa from "../../designer/input-group/index.esm.js";
import pa from "../layout/index.esm.js";
import ma from "../list-nav/index.esm.js";
import ha from "../list-view/index.esm.js";
import va from "../lookup/index.esm.js";
import ga from "../mapping-editor/index.esm.js";
import ya from "../nav/index.esm.js";
import ba from "../number-range/index.esm.js";
import wa from "../number-spinner/index.esm.js";
import Ca from "../page-header/index.esm.js";
import _a from "../page-footer/index.esm.js";
import xa from "../progress/index.esm.js";
import Sa from "../query-solution/index.esm.js";
import Ta from "../../designer/radio-group/index.esm.js";
import ka from "../rate/index.esm.js";
import Ea from "../response-toolbar/index.esm.js";
import Ma from "../response-layout/index.esm.js";
import Fa from "../response-layout-editor/index.esm.js";
import Oa from "../section/index.esm.js";
import Da from "../smoke-detector/index.esm.js";
import Ia from "../splitter/index.esm.js";
import Pa from "../step/index.esm.js";
import Na from "../switch/index.esm.js";
import Va from "../text/index.esm.js";
import Ra from "../time-picker/index.esm.js";
import Ba from "../tree-view/index.esm.js";
import La from "../uploader/index.esm.js";
import Wa from "../verify-detail/index.esm.js";
import $a from "../video/index.esm.js";
import Ha from "../textarea/index.esm.js";
import ja from "../schema-selector/index.esm.js";
import Aa from "../tree-grid/index.esm.js";
import qa from "../event-parameter/index.esm.js";
import Ga from "../filter-condition-editor/index.esm.js";
import za from "../fieldset/index.esm.js";
import Ya from "../sort-condition-editor/index.esm.js";
import Ua from "../menu-lookup/index.esm.js";
import Xa from "../drawer/index.esm.js";
import Qa from "../json-editor/index.esm.js";
import Ka from "../property-editor/index.esm.js";
import Ja from "../expression-editor/index.esm.js";
import Za from "../code-editor/index.esm.js";
import ei from "../html-template/index.esm.js";
import "../external-container/index.esm.js";
import "../notify/index.esm.js";
const zn = {}, Yn = {};
function bn(n) {
const { properties: t, title: e, ignore: o } = n, r = o && Array.isArray(o), a = Object.keys(t).reduce((i, s) => ((!r || !o.find((l) => l === s)) && (i[s] = t[s].type === "object" && t[s].properties ? bn(t[s]) : kt(t[s].default)), i), {});
if (e && (!r || !o.find((i) => i === "id"))) {
const i = e.toLowerCase().replace(/-/g, "_");
a.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return a;
}
function ti(n) {
const { properties: t, title: e, required: o } = n;
if (o && Array.isArray(o)) {
const r = o.reduce((a, i) => (a[i] = t[i].type === "object" && t[i].properties ? bn(t[i]) : kt(t[i].default), a), {});
if (e && o.find((a) => a === "id")) {
const a = e.toLowerCase().replace(/-/g, "_");
r.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return r;
}
return {
type: e
};
}
function Un(n, t = {}, e) {
const o = zn[n];
if (o) {
let r = ti(o);
const a = Yn[n];
return r = a ? a({ getSchemaByType: Un }, r, t, e) : r, r;
}
return null;
}
function ni(n, t) {
const e = bn(t);
return Object.keys(e).reduce((o, r) => (Object.prototype.hasOwnProperty.call(n, r) && (o[r] && Mn(o[r]) && Mn(n[r] || !n[r]) ? Object.assign(o[r], n[r] || {}) : o[r] = n[r]), o), e), e;
}
function Xn(n, t) {
return Object.keys(n).filter((o) => n[o] != null).reduce((o, r) => {
if (t.has(r)) {
const a = t.get(r);
if (typeof a == "string")
o[a] = n[r];
else {
const i = a(r, n[r], n);
Object.assign(o, i);
}
} else
o[r] = n[r];
return o;
}, {});
}
function oi(n, t, e = /* @__PURE__ */ new Map()) {
const o = ni(n, t);
return Xn(o, e);
}
function ri(n = {}) {
function t(u, c, d, p) {
if (typeof d == "number")
return p[u].length === d;
if (typeof d == "object") {
const f = Object.keys(d)[0], m = d[f];
if (f === "not")
return Number(p[u].length) !== Number(m);
if (f === "moreThan")
return Number(p[u].length) >= Number(m);
if (f === "lessThan")
return Number(p[u].length) <= Number(m);
}
return !1;
}
function e(u, c, d, p) {
return p[u] && p[u].propertyValue && String(p[u].propertyValue.value) === String(d);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", e]
]);
Object.keys(n).reduce((u, c) => (u.set(c, n[c]), u), o);
function r(u, c) {
const d = u;
return typeof c == "number" ? [{ target: d, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: d, operator: "getProperty", param: u, value: !!c }] : typeof c == "object" ? Object.keys(c).map((p) => {
if (p === "length")
return { target: d, operator: "length", param: null, value: c[p] };
const f = p, m = c[p];
return { target: d, operator: "getProperty", param: f, value: m };
}) : [];
}
function a(u) {
return Object.keys(u).reduce((d, p) => {
const f = r(p, u[p]);
return d.push(...f), d;
}, []);
}
function i(u, c) {
if (o.has(u.operator)) {
const d = o.get(u.operator);
return d && d(u.target, u.param, u.value, c) || !1;
}
return !1;
}
function s(u, c) {
return a(u).reduce((f, m) => f && i(m, c), !0);
}
function l(u, c) {
const d = Object.keys(u), p = d.includes("allOf"), f = d.includes("anyOf"), m = p || f, v = (m ? u[m ? p ? "allOf" : "anyOf" : "allOf"] : [u]).map((g) => s(g, c));
return p ? !v.includes(!1) : v.includes(!0);
}
return { parseValueSchema: l };
}
const ae = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
"input-group": { type: "input-group", name: "文本" },
textarea: { type: "textarea", name: "多行文本" },
lookup: { type: "lookup", name: "帮助" },
"number-spinner": { type: "number-spinner", name: "数值" },
"date-picker": { type: "date-picker", name: "日期" },
switch: { type: "switch", name: "开关" },
"radio-group": { type: "radio-group", name: "单选组" },
"check-box": { type: "check-box", name: "复选框" },
"check-group": { type: "check-group", name: "复选框组" },
"combo-list": { type: "combo-list", name: "下拉列表" },
"response-form": { type: "response-form", name: "卡片面板" },
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
"tree-grid": { type: "tree-grid", name: "树表格" },
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
"data-grid": { type: "data-grid", name: "表格" },
"data-grid-column": { type: "data-grid-column", name: "表格列" },
module: { type: "Module", name: "模块" },
component: { type: "component", name: "组件" },
tabs: { type: "tabs", name: "标签页" },
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
"html-template": { type: "html-template", name: "模板容器" },
"time-picker": { type: "time-picker", name: "时间选择" },
section: { type: "section", name: "分组面板" },
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
splitter: { type: "splitter", name: "分栏面板" },
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
"component-ref": { type: "component-ref", name: "组件引用节点" },
uploader: { type: "uploader", name: "附件上传" },
"page-header": { type: "page-header", name: "页头" },
"page-footer": { type: "page-footer", name: "页脚" },
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
fieldset: { type: "fieldset", name: "分组" },
"query-solution": { type: "query-solution", name: "筛选方案" },
drawer: { type: "drawer", name: "抽屉" },
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
"list-nav": { type: "list-nav", name: "列表导航" },
"filter-bar": { type: "filter-bar", name: "筛选条" }
}, ai = {}, ii = {};
ri();
function Lt(n, t, e = /* @__PURE__ */ new Map(), o = (i, s, l, u) => s, r = {}, a = (i) => i) {
return zn[t.title] = t, Yn[t.title] = o, ai[t.title] = r, ii[t.title] = a, (i = {}, s = !0) => {
if (!s)
return Xn(i, e);
const l = oi(i, t, e), u = Object.keys(n).reduce((c, d) => (c[d] = n[d].default, c), {});
return Object.assign(u, l);
};
}
function ln(n, t) {
return { customClass: t.class, customStyle: t.style };
}
function si() {
function n(t, e) {
const { dataSource: o } = t || {};
return o === void 0 ? {} : {};
}
return {
resolve: n
};
}
function li() {
function n(t, e) {
return t.selectItemById(e);
}
return {
selectItemById: n
};
}
function ui() {
function n(t, e) {
const { columns: o } = e;
return t.updateColumns(o);
}
return {
updateColumns: n
};
}
const ci = /* @__PURE__ */ new Map([
["appearance", ln]
]), di = "https://json-schema.org/draft/2020-12/schema", fi = "https://farris-design.gitee.io/content-container.schema.json", pi = "content-container", mi = "A Farris Container Component", hi = "object", vi = {
id: {
description: "The unique identifier for a Section",
type: "string"
},
type: {
description: "The type string of Section component",
type: "string",
default: "content-container"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
contents: {
description: "",
type: "array",
default: []
},
size: {
description: "",
type: "object",
properties: {
width: {
type: "number"
},
height: {
type: "number"
}
},
default: null
},
visible: {
description: "",
type: "boolean",
default: !0
}
}, gi = [
"id",
"type",
"contents"
], yi = {
$schema: di,
$id: fi,
title: pi,
description: mi,
type: hi,
properties: vi,
required: gi
};
function bi(n, t, e) {
return t;
}
const wn = {
customClass: { type: String, default: "" },
customStyle: { type: String, default: "" },
/** 控制是否可见 */
visible: { type: Boolean, default: !0 }
}, Pn = Lt(wn, yi, ci, bi), cn = /* @__PURE__ */ tt({
name: "FContentContainer",
props: wn,
emits: [],
setup(n, t) {
return () => n.visible && O("div", {
class: n.customClass,
style: n.customStyle
}, [t.slots.default && t.slots.default()]);
}
});
function wi() {
function n(t, e) {
var i;
if (!t)
return !1;
const o = ((i = t.targetContainer) == null ? void 0 : i.componentInstance) && t.targetContainer.componentInstance.value;
if (!o)
return !1;
const r = o.schema.type, a = e == null ? void 0 : e.formSchemaUtils.getComponentById(o.belongedComponentId);
return !((t.componentCategory === "input" || t.componentType === "form-group") && ![ae["response-layout-item"].type, ae["response-form"].type, ae.fieldset.type].includes(r) || (t.componentType === ae.tabs.type || t.componentType === ae.section.type) && ((a == null ? void 0 : a.componentType) !== "frame" || ![ae["content-container"].type, ae["splitter-pane"].type, ae["response-layout-item"].type].includes(r)) || t.componentType === ae["query-solution"].type || t.componentType === ae.fieldset.type && r !== ae["response-form"].type);
}
return {
basalDragulaRuleForContainer: n
};
}
class Ci {
getTemplateRule(t, e) {
const o = e == null ? void 0 : e.formSchemaUtils, r = o == null ? void 0 : o.getFormTemplateRule(), a = { canAccept: !0, canDelete: !0, canMove: !0 };
if (!r)
return a;
const i = this.getComponentContext(t), { componentClassList: s } = i;
return s.forEach((l) => {
if (!l || !r[l])
return;
const { canMove: u, canDelete: c, canAccept: d } = r[l];
a.canMove = a.canMove && this.resolveRuleValue(u, i), a.canDelete = a.canDelete && this.resolveRuleValue(c, i), a.canAccept = a.canAccept && this.resolveRuleValue(d, i);
}), a;
}
resolveRuleValue(t, e) {
return typeof t == "boolean" ? t : this.parseRuleValueSchema(t, e);
}
parseRuleValueSchema(t, e) {
const o = t.invalidContext || [];
let r = !0;
for (const a of o) {
if (a.firstLevelChild) {
if (a.firstLevelChild.class) {
const { firstLevelChildClassList: i } = e;
if (i && !i.includes(a.firstLevelChild.class)) {
r = !1;
continue;
}
}
if (a.firstLevelChild.type) {
const { firstLevelChildSchema: i } = e;
if (!i || i.type !== a.firstLevelChild.type) {
r = !1;
continue;
}
}
}
if (a.secondLevelChild) {
if (a.secondLevelChild.class) {
const { secondLevelChildClassList: i } = e;
if (i && !i.includes(a.secondLevelChild.class)) {
r = !1;
continue;
}
}
if (a.secondLevelChild.type) {
const { secondLevelChildSchema: i } = e;
if (!i || i.type !== a.secondLevelChild.type) {
r = !1;
continue;
}
}
}
if (a.parent) {
if (a.parent.class) {
const { parentClassList: i } = e;
if (i && !i.includes(a.parent.class)) {
r = !1;
continue;
}
}
if (a.parent.type) {
const { parentSchema: i } = e;
if (i && i.type !== a.parent.type) {
r = !1;
continue;
}
}
}
r = !0;
break;
}
return !r;
}
getComponentContext(t) {
var F, w, v, b;
const e = t.schema, o = e.appearance && e.appearance.class || "", r = o.split(" ") || [], a = e.contents || [], i = a.length ? a[0] : null, s = i && i.appearance ? i.appearance.class : "", l = s ? s.split(" ") : [], u = (F = i == null ? void 0 : i.contents) != null && F.length ? i == null ? void 0 : i.contents[0] : null, c = u && u.appearance ? u.appearance.class : "", d = c ? c.split(" ") : [], p = e.type === "component" ? (v = (w = t.parent) == null ? void 0 : w.parent) == null ? void 0 : v.schema : (b = t.parent) == null ? void 0 : b.schema, f = p && p.appearance && p.appearance.class || "", m = f ? f.split(" ") : [];
return {
componentClass: o,
componentClassList: r,
childContents: a,
firstLevelChildSchema: i,
firstLevelChildClass: s,
firstLevelChildClassList: l,
secondLevelChildSchema: u,
secondLevelChildClass: c,
secondLevelChildClassList: d,
parentSchema: p,
parentClass: f,
parentClassList: m
};
}
}
const Kt = S(0);
function _i(n, t) {
const e = t.getBoundingClientRect(), o = n.getBoundingClientRect(), r = o.top >= e.top, a = o.top <= e.bottom;
return r && a;
}
function xi(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 a = e.left - r.width;
const i = document.querySelector(".editorDiv");
if (i) {
const s = i.getBoundingClientRect();
a < s.left && ({ left: a } = n.getBoundingClientRect());
}
o.style.left = a + "px";
}
}
}
function Si(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 Qn(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 = Si(n);
if (r && (o = _i(n, r)), !o) {
e.style.display = "none";
return;
}
xi(n);
}
}
function Ti(n) {
if (!n)
return;
let t;
n.className.includes("dgComponentSelected") ? t = n : t = n.querySelector(".dgComponentSelected"), t && Qn(t);
}
var _t = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Xt(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 ki = { exports: {} };
(function(n, t) {
(function(e) {
n.exports = e();
})(function() {
return (/* @__PURE__ */ function() {
function e(o, r, a) {
function i(u, c) {
if (!r[u]) {
if (!o[u]) {
var d = typeof Xt == "function" && Xt;
if (!c && d) return d(u, !0);
if (s) return s(u, !0);
var p = new Error("Cannot find module '" + u + "'");
throw p.code = "MODULE_NOT_FOUND", p;
}
var f = r[u] = { exports: {} };
o[u][0].call(f.exports, function(m) {
var F = o[u][1][m];
return i(F || m);
}, f, f.exports, e, o, r, a);
}
return r[u].exports;
}
for (var s = typeof Xt == "function" && Xt, l = 0; l < a.length; l++) i(a[l]);
return i;
}
return e;
}())({
1: [function(e, o, r) {
var a = {}, i = "(?:^|\\s)", s = "(?:\\s|$)";
function l(d) {
var p = a[d];
return p ? p.lastIndex = 0 : a[d] = p = new RegExp(i + d + s, "g"), p;
}
function u(d, p) {
var f = d.className;
f.length ? l(p).test(f) || (d.className += " " + p) : d.className = p;
}
function c(d, p) {
d.className = d.className.replace(l(p), " ").trim();
}
o.exports = {
add: u,
rm: c
};
}, {}],
2: [function(e, o, r) {
(function(a) {
var i = e("contra/emitter"), s = e("crossvent"), l = e("./classes"), u = document, c = u.documentElement;
function d(y, I) {
var P = arguments.length;
P === 1 && Array.isArray(y) === !1 && (I = y, y = []);
var M, D, G, H, R, $, Q, V, N, X = null, j, W, z = !1, K = 0, ie, Z = I || {};
Z.moves === void 0 && (Z.moves = b), Z.accepts === void 0 && (Z.accepts = b), Z.invalid === void 0 && (Z.invalid = ht), Z.containers === void 0 && (Z.containers = y || []), Z.isContainer === void 0 && (Z.isContainer = v), Z.copy === void 0 && (Z.copy = !1), Z.copySortSource === void 0 && (Z.copySortSource = !1), Z.revertOnSpill === void 0 && (Z.revertOnSpill = !1), Z.removeOnSpill === void 0 && (Z.removeOnSpill = !1), Z.direction === void 0 && (Z.direction = "vertical"), Z.ignoreInputTextSelection === void 0 && (Z.ignoreInputTextSelection = !0), Z.mirrorContainer === void 0 && (Z.mirrorContainer = u.body);
var fe = i({
containers: Z.containers,
start: Ie,
end: ct,
cancel: Re,
remove: qe,
destroy: Y,
canMove: ke,
dragging: !1
});
return Z.removeOnSpill === !0 && fe.on("over", wt).on("out", gt), xe(), fe;
function ve(L) {
return fe.containers.indexOf(L) !== -1 || Z.isContainer(L);
}
function xe(L) {
var ee = L ? "remove" : "add";
m(c, ee, "mousedown", A), m(c, ee, "mouseup", Se);
}
function Pe(L) {
var ee = L ? "remove" : "add";
m(c, ee, "mousemove", te);
}
function Be(L) {
var ee = L ? "remove" : "add";
s[ee](c, "selectstart", de), s[ee](c, "click", de);
}
function Y() {
xe(!0), Se({});
}
function de(L) {
j && L.preventDefault();
}
function A(L) {
H = L.clientX, R = L.clientY;
var ee = F(L) !== 1 || L.metaKey || L.ctrlKey;
if (!ee) {
var oe = L.target, ne = be(oe);
ne && (j = ne, Pe(), L.type === "mousedown" && (k(oe) ? oe.focus() : L.preventDefault()));
}
}
function te(L) {
if (j) {
if (F(L) === 0) {
Se({});
return;
}
if (!(L.clientX !== void 0 && Math.abs(L.clientX - H) <= (Z.slideFactorX || 0) && L.clientY !== void 0 && Math.abs(L.clientY - R) <= (Z.slideFactorY || 0))) {
if (Z.ignoreInputTextSelection) {
var ee = E("clientX", L) || 0, oe = E("clientY", L) || 0, ne = u.elementFromPoint(ee, oe);
if (k(ne))
return;
}
var we = j;
Pe(!0), Be(), ct(), ot(we), l.add(V || G, "gu-transit"), Ct(), Ft(), K = 0, dt(L);
}
}
}
function be(L) {
if (!(fe.dragging && M) && !ve(L)) {
for (var ee = L; T(L) && ve(T(L)) === !1; )
if (Z.invalid(L, ee) || (L = T(L), !L))
return;
var oe = T(L);
if (oe && !Z.invalid(L, ee)) {
var ne = Z.moves(L, oe, ee, x(L));
if (ne)
return {
item: L,
source: oe
};
}
}
}
function ke(L) {
return !!be(L);
}
function Ie(L) {
var ee = be(L);
ee && ot(ee);
}
function ot(L) {
Fe(L.item, L.source) && (V = L.item.cloneNode(!0), fe.emit("cloned", V, L.item, "copy")), D = L.source, G = L.item, $ = Q = x(L.item), fe.dragging = !0, fe.emit("drag", G, D);
}
function ht() {
return !1;
}
function ct() {
if (fe.dragging) {
var L = V || G;
De(L, T(L));
}
}
function J() {
j = !1, Pe(!0), Be(!0);
}
function Se(L) {
if (J(), !!fe.dragging) {
var ee = V || G, oe = E("clientX", L) || 0, ne = E("clientY", L) || 0, we = w(M, oe, ne), ye = bt(we, oe, ne);
ye && (V && Z.copySortSource || !V || ye !== D) ? De(ee, ye) : Z.removeOnSpill ? qe() : Re();
}
}
function De(L, ee) {
var oe = T(L);
V && Z.copySortSource && ee === D && oe.removeChild(G), vt(ee) ? fe.emit("cancel", L, D) : fe.emit("drop", L, ee, D, Q), it();
}
function qe() {
if (fe.dragging) {
var L = V || G, ee = T(L);
ee && ee.removeChild(L), fe.emit(V ? "cancel" : "remove", L, ee, D), it();
}
}
function Re(L) {
if (fe.dragging) {
var ee = arguments.length > 0 ? L : Z.revertOnSpill, oe = V || G, ne = T(oe), we = vt(ne);
we === !1 && ee && (V ? ne && ne.removeChild(V) : D.insertBefore(oe, $)), we || ee ? fe.emit("cancel", oe, D, D) : fe.emit("drop", oe, ne, D, Q), it();
}
}
function it() {
var L = V || G;
J(), re(), pe(), L && l.rm(L, "gu-transit"), N && clearTimeout(N), fe.dragging = !1, X && fe.emit("out", L, X, D), fe.emit("dragend", L, K), D = G = V = $ = Q = N = X = null;
}
function vt(L, ee) {
var oe;
return ee !== void 0 ? oe = ee : M ? oe = Q : oe = x(V || G), L === D && oe === $;
}
function bt(L, ee, oe) {
for (var ne = L; ne && !we(); )
ne = T(ne);
return ne;
function we() {
var ye = ve(ne);
if (ye === !1)
return !1;
var Ve = ge(ne, L), Te = Ce(ne, Ve, ee, oe), Le = vt(ne, Te);
return Le ? !0 : Z.accepts(G, ne, D, Te);
}
}
function dt(L) {
if (!M)
return;
L.preventDefault();
var ee = E("clientX", L) || 0, oe = E("clientY", L) || 0;
M.style.left = ee - 2 + "px", M.style.top = oe - 2 + "px";
var ne = V || G, we = w(M, ee, oe), ye = bt(we, ee, oe), Ve = ye !== null && ye !== X;
(Ve || ye === null) && (he(), X = ye, st()), me(we, oe);
var Te = T(ne);
if (ye === D && V && !Z.copySortSource) {
Te && Te.removeChild(ne);
return;
}
var Le, at = ge(ye, we);
if (z = Ne(at, ye), at !== null)
Le = Ce(ye, at, ee, oe);
else if (Z.revertOnSpill === !0 && !V)
Le = $, ye = D;
else {
V && Te && Te.removeChild(ne), V && W && (W.style.display = "none");
return;
}
W.style.display = "block", Mt(Le, ne, Ve), Le ? Ke(at, Le) : U(ye);
function Ue(_e) {
fe.emit(_e, ne, X, D);
}
function st() {
Ve && Ue("over");
}
function he() {
X && Ue("out");
}
}
function Mt(L, ee, oe) {
(L === ee || L === x(ee)) && (Q = x(ee)), (L === null && oe || L !== ee && L !== x(ee)) && (Q = L);
}
function wt(L) {
l.rm(L, "gu-hide");
}
function gt(L) {
fe.dragging && l.add(L, "gu-hide");
}
function Ft() {
M || (M = document.createElement("div"), M.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;", M.innerHTML = Z.getMirrorText && Z.getMirrorText(G) || "控件", l.add(M, "gu-mirror"), Z.mirrorContainer.appendChild(M), m(c, "add", "mousemove", dt), l.add(Z.mirrorContainer, "gu-unselectable"), fe.emit("cloned", M, G, "mirror"));
}
function Ct() {
if (W = document.createElement("div"), l.add(W, "gu-insertion"), G) {
var L = G.getBoundingClientRect();
W.style.left = L.left + "px", W.style.top = L.top + "px";
}
z = !1, Z.mirrorContainer.appendChild(W);
}
function re() {
M && (l.rm(Z.mirrorContainer, "gu-unselectable"), m(c, "remove", "mousemove", dt), T(M).removeChild(M), M = null);
}
function pe() {
W && (T(W).removeChild(W), W = null);
}
function ge(L, ee) {
for (var oe = ee; oe !== L && T(oe) !== L; )
oe = T(oe);
return oe === c ? null : oe;
}
function Ne(L, ee) {
if (!ee)
return z;
var oe = L || ee && ee.lastElementChild;
if (!oe)
return !0;
var ne = getComputedStyle(L), we = /^inline/.test(ne.getPropertyValue("display")) || /^(left|right)$/.test(ne.getPropertyValue("float"));
if (we)
return !0;
if (ee) {
var ye = getComputedStyle(ee), Ve = ye.getPropertyValue("display");
if (/flex$/.test(Ve)) {
var Te = ye.getPropertyValue("flex-direction") || "row";
if (Te === "row" || Te === "row-reverse")
return !Ge(ee);
}
return !1;
}
return !0;
}
function Ge(L) {
if (!L.children || !L.children.length)
return !1;
for (const ee of Array.from(L.children)) {
const ne = (ee.className && ee.className.split(" ") || []).filter((we) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(we));
if (!ne.length)
return !1;
for (const we of ne) {
const ye = we.slice(we.lastIndexOf("-") + 1);
if (parseInt(ye, 10) !== 12)
return !1;
}
}
return !0;
}
function Ke(L, ee) {
const oe = ee.getBoundingClientRect();
if (W.style.left = oe.left + "px", W.style.top = oe.top + "px", z) {
if (W.style.height = oe.height + "px", W.style.width = "4px", L) {
const ne = L.getBoundingClientRect();
ne.top !== oe.top && (W.style.left = ne.right + "px", W.style.top = ne.top + "px", W.style.height = ne.height + "px");
}
} else if (W.style.height = "4px", W.style.width = oe.width + "px", ie) {
const ne = ie.getBoundingClientRect();
oe.top < ne.top && (W.style.display = "none");
}
ee === G && G && (W.style.display = "none");
}
function U(L) {
Q = null;
var ee = L.lastElementChild;
if (ee) {
var oe = ee.getBoundingClientRect();
z ? (W.style.left = oe.right + "px", W.style.top = oe.top + "px", W.style.height = oe.height + "px", W.style.width = "4px") : (W.style.left = oe.left + "px", W.style.top = oe.bottom + "px", W.style.height = "4px", W.style.width = oe.width + "px"), ee === G && G && (W.style.display = "none");
} else
W.style.display = "none";
}
function me(L, ee) {
if (!Z.mirrorContainer.contains(L) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (ie = p(L), !ie || !ie.contains(L)))
return;
const oe = document.querySelector(".dgComponentSelected"), ne = ie.getBoundingClientRect();
if (ee - 30 < ne.top && ie.scrollTop > 0) {
let we = ie.scrollTop < 10 ? ie.scrollTop : 10;
ie.scrollBy(0, -1 * we), oe && ie.contains(oe) && (K = K + -1 * we);
}
if (ee + 30 > ne.bottom && ie.scrollTop < ie.scrollHeight - ie.clientHeight) {
const we = ie.scrollHeight - ie.clientHeight - ie.scrollTop;
let ye = we < 10 ? we : 10;
ie.scrollBy(0, ye), oe && ie.contains(oe) && (K = K + ye);
}
}
function Ce(L, ee, oe, ne) {
var we = Z.direction === "horizontal", ye = Z.direction === "mixed", Ve = ee !== L ? Le() : Te();
return Ve;
function Te() {
var Ue = L.children.length, st, he, _e;
for (st = 0; st < Ue; st++)
if (he = L.children[st], _e = he.getBoundingClientRect(), we && _e.left + _e.width / 2 > oe || !ye && !we && _e.top + _e.height / 2 > ne || ye && _e.left + _e.width > oe && _e.top + _e.height > ne)
return he;
return null;
}
function Le() {
var Ue = ee.getBoundingClientRect();
if (ye) {
var st = ne - Ue.top, he = oe - Ue.left, _e = Ue.bottom - ne, Je = Ue.right - oe, Qe = Math.min(he, Je, st, _e), Ze;
return z ? Ze = Je < he : Ze = _e === Qe || Je === Qe || he === Qe, at(Ze);
}
return at(we ? oe > Ue.left + g(Ue) / 2 : ne > Ue.top + _(Ue) / 2);
}
function at(Ue) {
return Ue ? x(ee) : ee;
}
}
function Fe(L, ee) {
return typeof Z.copy == "boolean" ? Z.copy : Z.copy(L, ee);
}
}
function p(y) {
const I = Array.from(window.scrollContainerList);
if (I.length === 1) {
const M = Array.from(window.scrollContainerList)[0];
return document.getElementById(M);
}
const P = f(I);
for (const M of P)
if (M.contains(y))
return M;
return null;
}
function f(y) {
const I = [];
return y.forEach((P) => {
const M = document.getElementById(P);
M && I.push(M);
}), I.sort((P, M) => P.contains(M) ? 1 : M.contains(P) ? -1 : 0), I;
}
function m(y, I, P, M) {
var D = {
mouseup: "touchend",
mousedown: "touchstart",
mousemove: "touchmove"
}, G = {
mouseup: "pointerup",
mousedown: "pointerdown",
mousemove: "pointermove"
}, H = {
mouseup: "MSPointerUp",
mousedown: "MSPointerDown",
mousemove: "MSPointerMove"
};
a.navigator.pointerEnabled ? s[I](y, G[P], M) : a.navigator.msPointerEnabled ? s[I](y, H[P], M) : (s[I](y, D[P], M), s[I](y, P, M));
}
function F(y) {
if (y.touches !== void 0)
return y.touches.length;
if (y.which !== void 0 && y.which !== 0)
return y.which;
if (y.buttons !== void 0)
return y.buttons;
var I = y.button;
if (I !== void 0)
return I & 1 ? 1 : I & 2 ? 3 : I & 4 ? 2 : 0;
}
function w(y, I, P) {
y = y || {};
var M = y.className || "", D;
return y.className += " gu-hide", D = u.elementFromPoint(I, P), y.className = M, D;
}
function v() {
return !1;
}
function b() {
return !0;
}
function g(y) {
return y.width || y.right - y.left;
}
function _(y) {
return y.height || y.bottom - y.top;
}
function T(y) {
return y.parentNode === u ? null : y.parentNode;
}
function k(y) {
return y.tagName === "INPUT" || y.tagName === "TEXTAREA" || y.tagName === "SELECT" || h(y);
}
function h(y) {
return !y || y.contentEditable === "false" ? !1 : y.contentEditable === "true" ? !0 : h(T(y));
}
function x(y) {
return y.nextElementSibling || I();
function I() {
var P = y;
do
P = P.nextSibling;
while (P && P.nodeType !== 1);
return P;
}
}
function C(y) {
return y.targetTouches && y.targetTouches.length ? y.targetTouches[0] : y.changedTouches && y.changedTouches.length ? y.changedTouches[0] : y;
}
function E(y, I) {
var P = C(I), M = {
pageX: "clientX",
// IE8
pageY: "clientY"
// IE8
};
return y in M && !(y in P) && M[y] in P && (y = M[y]), P[y];
}
o.exports = d;
}).call(this, typeof _t < "u" ? _t : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }],
3: [function(e, o, r) {
o.exports = function(i, s) {
return Array.prototype.slice.call(i, s);
};
}, {}],
4: [function(e, o, r) {
var a = e("ticky");
o.exports = function(s, l, u) {
s && a(function() {
s.apply(u || null, l || []);
});
};
}, { ticky: 10 }],
5: [function(e, o, r) {
var a = e("atoa"), i = e("./debounce");
o.exports = function(l, u) {
var c = u || {}, d = {};
return l === void 0 && (l = {}), l.on = function(p, f) {
return d[p] ? d[p].push(f) : d[p] = [f], l;
}, l.once = function(p, f) {
return f._once = !0, l.on(p, f), l;
}, l.off = function(p, f) {
var m = arguments.length;
if (m === 1)
delete d[p];
else if (m === 0)
d = {};
else {
var F = d[p];
if (!F)
return l;
F.splice(F.indexOf(f), 1);
}
return l;
}, l.emit = function() {
var p = a(arguments);
return l.emitterSnapshot(p.shift()).apply(this, p);
}, l.emitterSnapshot = function(p) {
var f = (d[p] || []).slice(0);
return function() {
var m = a(arguments), F = this || l;
if (p === "error" && c.throws !== !1 && !f.length)
throw m.length === 1 ? m[0] : m;
return f.forEach(function(v) {
c.async ? i(v, m, F) : v.apply(F, m), v._once && l.off(p, v);
}), l;
};
}, l;
};
}, { "./debounce": 4, atoa: 3 }],
6: [function(e, o, r) {
(function(a) {
var i = e("custom-event"), s = e("./eventmap"), l = a.document, u = p, c = m, d = [];
a.addEventListener || (u = f, c = F), o.exports = {
add: u,
remove: c,
fabricate: w
};
function p(T, k, h, x) {
return T.addEventListener(k, h, x);
}
function f(T, k, h) {
return T.attachEvent("on" + k, b(T, k, h));
}
function m(T, k, h, x) {
return T.removeEventListener(k, h, x);
}
function F(T, k, h) {
var x = g(T, k, h);
if (x)
return T.detachEvent("on" + k, x);
}
function w(T, k, h) {
var x = s.indexOf(k) === -1 ? E() : C();
T.dispatchEvent ? T.dispatchEvent(x) : T.fireEvent("on" + k, x);
function C() {
var y;
return l.createEvent ? (y = l.createEvent("Event"), y.initEvent(k, !0, !0)) : l.createEventObject && (y = l.createEventObject()), y;
}
function E() {
return new i(k, { detail: h });
}
}
function v(T, k, h) {
return function(C) {
var E = C || a.event;
E.target = E.target || E.srcElement, E.preventDefault = E.preventDefault || function() {
E.returnValue = !1;
}, E.stopPropagation = E.stopPropagation || function() {
E.cancelBubble = !0;
}, E.which = E.which || E.keyCode, h.call(T, E);
};
}
function b(T, k, h) {
var x = g(T, k, h) || v(T, k, h);
return d.push({
wrapper: x,
element: T,
type: k,
fn: h
}), x;
}
function g(T, k, h) {
var x = _(T, k, h);
if (x) {
var C = d[x].wrapper;
return d.splice(x, 1), C;
}
}
function _(T, k, h) {
var x, C;
for (x = 0; x < d.length; x++)
if (C = d[x], C.element === T && C.type === k && C.fn === h)
return x;
}
}).call(this, typeof _t < "u" ? _t : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, { "./eventmap": 7, "custom-event": 8 }],
7: [function(e, o, r) {
(function(a) {
var i = [], s = "", l = /^on/;
for (s in a)
l.test(s) && i.push(s.slice(2));
o.exports = i;
}).call(this, typeof _t < "u" ? _t : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, {}],
8: [function(e, o, r) {
(function(a) {
var i = a.CustomEvent;
function s() {
try {
var l = new i("cat", { detail: { foo: "bar" } });
return l.type === "cat" && l.detail.foo === "bar";
} catch {
}
return !1;
}
o.exports = s() ? i : (
// IE >= 9
typeof document < "u" && typeof document.createEvent == "function" ? function(u, c) {
var d = document.createEvent("CustomEvent");
return c ? d.initCustomEvent(u, c.bubbles, c.cancelable, c.detail) : d.initCustomEvent(u, !1, !1, void 0), d;
} : (
// IE <= 8
function(u, c) {
var d = document.createEventObject();
return d.type = u, c ? (d.bubbles = !!c.bubbles, d.cancelable = !!c.cancelable, d.detail = c.detail) : (d.bubbles = !1, d.cancelable = !1, d.detail = void 0), d;
}
)
);
}).call(this, typeof _t < "u" ? _t : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, {}],
9: [function(e, o, r) {
var a = o.exports = {}, i, 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" ? i = setTimeout : i = l;
} catch {
i = l;
}
try {
typeof clearTimeout == "function" ? s = clearTimeout : s = u;
} catch {
s = u;
}
})();
function c(_) {
if (i === setTimeout)
return setTimeout(_, 0);
if ((i === l || !i) && setTimeout)
return i = setTimeout, setTimeout(_, 0);
try {
return i(_, 0);
} catch {
try {
return i.call(null, _, 0);
} catch {
return i.call(this, _, 0);
}
}
}
function d(_) {
if (s === clearTimeout)
return clearTimeout(_);
if ((s === u || !s) && clearTimeout)
return s = clearTimeout, clearTimeout(_);
try {
return s(_);
} catch {
try {
return s.call(null, _);
} catch {
return s.call(this, _);
}
}
}
var p = [], f = !1, m, F = -1;
function w() {
!f || !m || (f = !1, m.length ? p = m.concat(p) : F = -1, p.length && v());
}
function v() {
if (!f) {
var _ = c(w);
f = !0;
for (var T = p.length; T; ) {
for (m = p, p = []; ++F < T; )
m && m[F].run();
F = -1, T = p.length;
}
m = null, f = !1, d(_);
}
}
a.nextTick = function(_) {
var T = new Array(arguments.length - 1);
if (arguments.length > 1)
for (var k = 1; k < arguments.length; k++)
T[k - 1] = arguments[k];
p.push(new b(_, T)), p.length === 1 && !f && c(v);
};
function b(_, T) {
this.fun = _, this.array = T;
}
b.prototype.run = function() {
this.fun.apply(null, this.array);
}, a.title = "browser", a.browser = !0, a.env = {}, a.argv = [], a.version = "", a.versions = {};
function g() {
}
a.on = g, a.addListener = g, a.once = g, a.off = g, a.removeListener = g, a.removeAllListeners = g, a.emit = g, a.prependListener = g, a.prependOnceListener = g, a.listeners = function(_) {
return [];
}, a.binding = function(_) {
throw new Error("process.binding is not supported");
}, a.cwd = function() {
return "/";
}, a.chdir = function(_) {
throw new Error("process.chdir is not supported");
}, a.umask = function() {
return 0;
};
}, {}],
10: [function(e, o, r) {
(function(a) {
var i = typeof a == "function", s;
i ? s = function(l) {
a(l);
} : s = function(l) {
setTimeout(l, 0);
}, o.exports = s;
}).call(this, e("timers").setImmediate);
}, { timers: 11 }],
11: [function(e, o, r) {
(function(a, i) {
var s = e("process/browser.js").nextTick, l = Function.prototype.apply, u = Array.prototype.slice, c = {}, d = 0;
r.setTimeout = function() {
return new p(l.call(setTimeout, window, arguments), clearTimeout);
}, r.setInterval = function() {
return new p(l.call(setInterval, window, arguments), clearInterval);
}, r.clearTimeout = r.clearInterval = function(f) {
f.close();
};
function p(f, m) {
this._id = f, this._clearFn = m;
}
p.prototype.unref = p.prototype.ref = function() {
}, p.prototype.close = function() {
this._clearFn.call(window, this._id);
}, r.enroll = function(f, m) {
clearTimeout(f._idleTimeoutId), f._idleTimeout = m;
}, r.unenroll = function(f) {
clearTimeout(f._idleTimeoutId), f._idleTimeout = -1;
}, r._unrefActive = r.active = function(f) {
clearTimeout(f._idleTimeoutId);
var m = f._idleTimeout;
m >= 0 && (f._idleTimeoutId = setTimeout(function() {
f._onTimeout && f._onTimeout();
}, m));
}, r.setImmediate = typeof a == "function" ? a : function(f) {
var m = d++, F = arguments.length < 2 ? !1 : u.call(arguments, 1);
return c[m] = !0, s(function() {