@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,424 lines • 322 kB
JavaScript
var Zn = Object.defineProperty;
var eo = (e, t, n) => t in e ? Zn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var q = (e, t, n) => eo(e, typeof t != "symbol" ? t + "" : t, n);
import { defineComponent as Ne, inject as Ze, createVNode as k, ref as _, onMounted as st, Fragment as wt, mergeProps as pt, computed as L, watch as we, provide as un, reactive as lt, createApp as cn, onUnmounted as Bt, Transition as dn, createTextVNode as gt, onBeforeUnmount as fn, withDirectives as to, resolveDirective as no, onBeforeMount as oo, Teleport as io, shallowRef as ro, nextTick as Ut, render as Pt, h as ao, cloneVNode as lo, triggerRef as so, isVNode as uo } from "vue";
import { CHECKBOX_CONTEXT as Yt, useCheck as pn, useGuid as co, useDateFormat as fo, useNumberFormat as po, resolveField as Ye, setFieldValue as Wt, getCustomClass as Lt, withInstall as mo, FormSchemaEntityField$Type as tn, FormSchemaEntityFieldType$Type as ho } from "../common/index.esm.js";
import { createPropsResolver as mn } from "../dynamic-resolver/index.esm.js";
import { isPlainObject as nn, cloneDeep as mt, isUndefined as on } from "lodash-es";
import { DgControl as rn } from "../designer-canvas/index.esm.js";
import { useResizeObserver as hn } from "@vueuse/core";
import { useIdentify as vo, useGroupData as go, useFilter as yo, useHierarchy as bo, useLoading as Co, useDataView as wo, useSelection as _o, useSelectHierarchyItem as So, useDataViewContainerStyle as xo, useCommandColumn as To, useColumn as Fo, useSort as ko, useGroupColumn as Io, useRow as Eo, useEdit as Mo, useVisualDataBound as Oo, useVisualDataCell as Vo, useVisualDataRow as Bo, useVisualData as Do, useCellPosition as No, useSidebar as $o, useVirtualScroll as Ro, useFitColumn as Po, useFilterHistory as Lo, useColumnFilter as jo, useDragColumn as Wo, getColumnHeader as Ho, getSidebar as Ao, getDisableMask as zo, getHorizontalScrollbar as Go, getVerticalScrollbar as qo, getEmpty as Uo } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import Yo from "../transfer/index.esm.js";
import Xo from "../tabs/index.esm.js";
import Ko from "../order/index.esm.js";
import "../condition/index.esm.js";
import Qo, { FCheckbox as Jo } from "../checkbox/index.esm.js";
import Zo from "../filter-bar/index.esm.js";
import an from "../tooltip/index.esm.js";
import ei from "../pagination/index.esm.js";
import ti from "../button/index.esm.js";
import ni from "../search-box/index.esm.js";
import oi from "../tags/index.esm.js";
import ii, { FDynamicFormGroup as ri, FDynamicFormInput as ai } from "../dynamic-form/index.esm.js";
import li from "../binding-selector/index.esm.js";
import "../notify/index.esm.js";
import si from "../accordion/index.esm.js";
import ui from "../avatar/index.esm.js";
import ci from "../button-edit/index.esm.js";
import di from "../button-group/index.esm.js";
import fi from "../calendar/index.esm.js";
import pi from "../capsule/index.esm.js";
import mi from "../color-picker/index.esm.js";
import Ht from "../combo-list/index.esm.js";
import hi from "../content-container/index.esm.js";
import vi from "../data-grid/index.esm.js";
import gi from "../date-picker/index.esm.js";
import yi from "../dropdown/index.esm.js";
import "../external-container/index.esm.js";
import bi from "../events-editor/index.esm.js";
import Ci from "../image-cropper/index.esm.js";
import wi from "../input-group/index.esm.js";
import _i from "../layout/index.esm.js";
import Si from "../list-nav/index.esm.js";
import xi from "../list-view/index.esm.js";
import Ti from "../lookup/index.esm.js";
import Fi from "../nav/index.esm.js";
import ki from "../number-spinner/index.esm.js";
import Ii from "../number-range/index.esm.js";
import Ei from "../page-header/index.esm.js";
import Mi from "../page-footer/index.esm.js";
import Oi from "../progress/index.esm.js";
import Vi from "../query-solution/index.esm.js";
import Bi from "../radio-group/index.esm.js";
import Di from "../rate/index.esm.js";
import Ni from "../response-toolbar/index.esm.js";
import $i from "../response-layout/index.esm.js";
import Ri from "../response-layout-editor/index.esm.js";
import Pi from "../section/index.esm.js";
import Li from "../smoke-detector/index.esm.js";
import ji from "../splitter/index.esm.js";
import Wi from "../step/index.esm.js";
import Hi from "../switch/index.esm.js";
import Ai from "../text/index.esm.js";
import zi from "../time-picker/index.esm.js";
import Gi from "../tree-view/index.esm.js";
import qi from "../uploader/index.esm.js";
import Ui from "../verify-detail/index.esm.js";
import Yi from "../component/index.esm.js";
import Xi from "../video/index.esm.js";
import Ki from "../textarea/index.esm.js";
import Qi from "../tree-grid/index.esm.js";
import Ji from "../fieldset/index.esm.js";
import Zi from "../drawer/index.esm.js";
import er from "../combo-tree/index.esm.js";
import tr from "../field-selector/index.esm.js";
import nr from "../mapping-editor/index.esm.js";
import or from "../schema-selector/index.esm.js";
import ir from "../event-parameter/index.esm.js";
import rr from "../filter-condition-editor/index.esm.js";
import ar from "../sort-condition-editor/index.esm.js";
import lr from "../menu-lookup/index.esm.js";
const sr = "https://json-schema.org/draft/2020-12/schema", ur = "https://farris-design.gitee.io/check-box.schema.json", cr = "check-box", dr = "A Farris Input Component", fr = "object", pr = {
id: {
description: "The unique identifier for a check box",
type: "string"
},
type: {
description: "The type string of check box component",
type: "string",
default: "check-box"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
disabled: {
type: "string",
default: !1
},
editable: {
description: "",
type: "boolean",
default: !0
},
placeholder: {
description: "",
type: "string",
default: ""
},
text: {
description: "",
type: "string",
default: ""
},
value: {
description: "",
type: "string",
default: ""
},
readonly: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
visible: {
description: "",
type: "boolean",
default: !0
},
required: {
description: "",
type: "boolean",
default: !1
}
}, mr = [
"type"
], hr = [
"id",
"appearance",
"binding",
"visible"
], vr = {
$schema: sr,
$id: ur,
title: cr,
description: dr,
type: fr,
properties: pr,
required: mr,
ignore: hr
}, vn = {}, gn = {};
function Xt(e) {
const { properties: t, title: n, ignore: o } = e, i = o && Array.isArray(o), a = Object.keys(t).reduce((r, u) => ((!i || !o.find((s) => s === u)) && (r[u] = t[u].type === "object" && t[u].properties ? Xt(t[u]) : mt(t[u].default)), r), {});
if (n && (!i || !o.find((r) => r === "id"))) {
const r = n.toLowerCase().replace(/-/g, "_");
a.id = `${r}_${Math.random().toString().slice(2, 6)}`;
}
return a;
}
function gr(e) {
const { properties: t, title: n, required: o } = e;
if (o && Array.isArray(o)) {
const i = o.reduce((a, r) => (a[r] = t[r].type === "object" && t[r].properties ? Xt(t[r]) : mt(t[r].default), a), {});
if (n && o.find((a) => a === "id")) {
const a = n.toLowerCase().replace(/-/g, "_");
i.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return i;
}
return {
type: n
};
}
function yn(e, t = {}, n) {
const o = vn[e];
if (o) {
let i = gr(o);
const a = gn[e];
return i = a ? a({ getSchemaByType: yn }, i, t, n) : i, i;
}
return null;
}
function yr(e, t) {
const n = Xt(t);
return Object.keys(n).reduce((o, i) => (Object.prototype.hasOwnProperty.call(e, i) && (o[i] && nn(o[i]) && nn(e[i] || !e[i]) ? Object.assign(o[i], e[i] || {}) : o[i] = e[i]), o), n), n;
}
function bn(e, t) {
return Object.keys(e).filter((o) => e[o] != null).reduce((o, i) => {
if (t.has(i)) {
const a = t.get(i);
if (typeof a == "string")
o[a] = e[i];
else {
const r = a(i, e[i], e);
Object.assign(o, r);
}
} else
o[i] = e[i];
return o;
}, {});
}
function br(e, t, n = /* @__PURE__ */ new Map()) {
const o = yr(e, t);
return bn(o, n);
}
function Cr(e = {}) {
function t(p, c, l, f) {
if (typeof l == "number")
return f[p].length === l;
if (typeof l == "object") {
const v = Object.keys(l)[0], h = l[v];
if (v === "not")
return Number(f[p].length) !== Number(h);
if (v === "moreThan")
return Number(f[p].length) >= Number(h);
if (v === "lessThan")
return Number(f[p].length) <= Number(h);
}
return !1;
}
function n(p, c, l, f) {
return f[p] && f[p].propertyValue && String(f[p].propertyValue.value) === String(l);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", n]
]);
Object.keys(e).reduce((p, c) => (p.set(c, e[c]), p), o);
function i(p, c) {
const l = p;
return typeof c == "number" ? [{ target: l, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: l, operator: "getProperty", param: p, value: !!c }] : typeof c == "object" ? Object.keys(c).map((f) => {
if (f === "length")
return { target: l, operator: "length", param: null, value: c[f] };
const v = f, h = c[f];
return { target: l, operator: "getProperty", param: v, value: h };
}) : [];
}
function a(p) {
return Object.keys(p).reduce((l, f) => {
const v = i(f, p[f]);
return l.push(...v), l;
}, []);
}
function r(p, c) {
if (o.has(p.operator)) {
const l = o.get(p.operator);
return l && l(p.target, p.param, p.value, c) || !1;
}
return !1;
}
function u(p, c) {
return a(p).reduce((v, h) => v && r(h, c), !0);
}
function s(p, c) {
const l = Object.keys(p), f = l.includes("allOf"), v = l.includes("anyOf"), h = f || v, m = (h ? p[h ? f ? "allOf" : "anyOf" : "allOf"] : [p]).map((x) => u(x, c));
return f ? !m.includes(!1) : m.includes(!0);
}
return { parseValueSchema: s };
}
const le = {
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: "标签页工具栏按钮" },
"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: "抽屉" }
}, wr = {}, _r = {};
Cr();
function ht(e, t, n = /* @__PURE__ */ new Map(), o = (r, u, s, p) => u, i = {}, a = (r) => r) {
return vn[t.title] = t, gn[t.title] = o, wr[t.title] = i, _r[t.title] = a, (r = {}, u = !0) => {
if (!u)
return bn(r, n);
const s = br(r, t, n), p = Object.keys(e).reduce((c, l) => (c[l] = e[l].default, c), {});
return Object.assign(p, s);
};
}
function Tt(e, t) {
return { customClass: t.class, customStyle: t.style };
}
function Sr() {
function e(t, n) {
const { dataSource: o } = t || {};
return o === void 0 ? {} : {};
}
return {
resolve: e
};
}
function xr() {
function e(t, n) {
return t.selectItemById(n);
}
return {
selectItemById: e
};
}
function Tr() {
function e(t, n) {
const { columns: o } = n;
return t.updateColumns(o);
}
return {
updateColumns: e
};
}
const Cn = /* @__PURE__ */ new Map([
["appearance", Tt]
]);
function wn(e, t, n) {
return t;
}
const Dt = {
/** 组件唯一标识 */
id: { Type: String, default: "" },
/** 自定义样式 */
customClass: { Type: String, default: "" },
/** 禁用状态 */
disabled: { Type: Boolean, default: !1 },
/**
* 功能同disabled
*/
readonly: { type: Boolean, default: !1 },
/** 中间状态 */
indeterminate: { Type: Boolean, default: !1 },
/** 选择状态 */
modelValue: { Type: Boolean, default: !1 },
/**
* 作为内嵌编辑器被创建后默认获得焦点
*/
focusOnCreated: { type: Boolean, default: !1 },
/** 选中的值 value与modelValue重合 TODO*/
value: { type: String, default: "" },
/** name值 */
name: { type: String, default: "" },
/** 标识是否被选中 */
checked: { type: Boolean, default: !1 }
}, _n = mn(Dt, vr, Cn, wn), Fr = /* @__PURE__ */ Ne({
name: "FCheckboxButton",
props: Dt,
emits: ["change", "changeValue", "update:modelValue", "update:checked", "click"],
setup(e, t) {
const n = Ze(Yt, null), {
buttonClass: o
} = pn(e, t, n == null ? void 0 : n.parentProps, n == null ? void 0 : n.parentContext), i = (a) => {
a.stopPropagation(), t.emit("click", a);
};
return () => {
var a, r;
return k("div", {
class: o.value,
style: "border-radius:0;border: 1px solid #E8EBF2;",
onClick: i
}, [(r = (a = t.slots).default) == null ? void 0 : r.call(a)]);
};
}
}), At = /* @__PURE__ */ Ne({
name: "FCheckbox",
props: Dt,
emits: ["change", "changeValue", "update:modelValue", "update:checked"],
setup(e, t) {
const n = Ze(Yt, null), {
checked: o,
disabled: i,
indeterminate: a,
name: r,
onClickCheckBox: u,
shouldRenderButton: s,
shouldRenderNative: p
} = pn(e, t, n == null ? void 0 : n.parentProps, n == null ? void 0 : n.parentContext), c = _(e.id);
return st(() => {
}), () => {
var l, f;
return k(wt, null, [
s.value && k(Fr, pt(e, {
onClick: u
}), {
default: () => {
var v, h;
return [(h = (v = t.slots).default) == null ? void 0 : h.call(v)];
}
}),
p.value && k("div", {
class: "custom-control custom-checkbox",
onClick: u
}, [k("input", {
id: c,
title: "checkbox-input",
type: "checkbox",
class: "custom-control-input",
checked: o.value,
disabled: i.value,
indeterminate: a.value,
name: r.value,
value: e.value
}, null), k("div", {
class: "custom-control-label"
}, [(f = (l = t.slots).default) == null ? void 0 : f.call(l)])])
]);
};
}
}), kr = "https://json-schema.org/draft/2020-12/schema", Ir = "https://farris-design.gitee.io/check-box.schema.json", Er = "check-group", Mr = "A Farris Input Component", Or = "object", Vr = {
id: {
description: "The unique identifier for a check box",
type: "string"
},
type: {
description: "The type string of check box component",
type: "string",
default: "check-group"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
disabled: {
description: "",
type: "boolean",
default: !1
},
textField: {
description: "",
type: "string",
default: "name"
},
valueField: {
description: "",
type: "string",
default: "value"
},
data: {
description: "",
type: "array"
},
readonly: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
separator: {
description: "",
type: "string",
default: ","
},
name: {
description: "",
type: "string",
default: ""
},
required: {
description: "",
type: "boolean",
default: !1
},
direction: {
description: "",
type: "string",
default: "horizontal"
}
}, Br = [
"type"
], Dr = [
"id",
"appearance",
"binding",
"visible"
], Nr = {
$schema: kr,
$id: Ir,
title: Er,
description: Mr,
type: Or,
properties: Vr,
required: Br,
ignore: Dr
}, $r = {
/**
* 是否被选中
*/
checked: { type: Boolean, default: !1 },
/**
* 展示方向 水平或者垂直
*/
direction: { type: String, default: "horizontal" },
/**
* 单选组类型
*/
// mode: { type: String as PropType<'default' | 'button' | 'tag'>, default: 'default' },
/**
* type为button或者tag时的颜色
*/
type: { type: String, default: "default" },
/**
* type为button或者tag时的尺寸
* 应该要弃用
*/
size: { type: String, default: "middle" },
/**
* 选项列表
*/
options: { type: Object, default: [] }
}, Kt = {
...$r,
/**
* 组件标识
*/
id: String,
/**
* 禁用组件,不允许切换单选值
*/
disabled: { type: Boolean, default: !1 },
/**
* 同disabled
*/
readonly: { type: Boolean, default: !1 },
/**
* 单选组枚举数组---废弃
*/
enumData: {
type: Array,
default: []
},
/**
* 单选组枚举数组
*/
data: {
type: Array,
default: []
},
/**
* 值类型是否为字符串
*/
isStringValue: { type: Boolean, default: !0 },
/**
* 异步获取枚举数组方法
*/
// loadData: () => Observable < { data: Array<Checkbox> } >
loadData: { type: Function },
/**
* 组件值,字符串或者数组
*/
modelValue: [String, Array],
/**
* 组件名称
*/
name: { type: String, default: "" },
/**
* 分隔符,默认逗号
*/
separator: { type: String, default: "," },
/**
* 输入框Tab键索引
*/
tabIndex: { type: Number, default: 0 },
/**
* 枚举数组中展示文本的key值。
*/
textField: { type: String, default: "name" },
/**
* 枚举数组中枚举值的key值。
*/
valueField: { type: String, default: "value" }
}, Sn = ht(Kt, Nr, Cn, wn);
function xn(e, t, n) {
const o = L(() => !(e.readonly && e.disabled)), i = _(e.data || e.enumData || e.options);
function a(l) {
return l[e.valueField];
}
function r(l) {
return l[e.textField];
}
function u(l) {
return l ? e.isStringValue ? l.split(e.separator) : l : [];
}
function s(l) {
const v = i.value.map((h) => a(h)).filter((h) => l.some((M) => M === String(h)));
return e.isStringValue ? v.join(e.separator) : v;
}
function p(l) {
const f = String(a(l));
return u(n.value).some((h) => h === f);
}
function c(l, f) {
if (o.value) {
let v = u(n.value) || [];
const h = String(a(l));
!v || !v.length ? v.push(h) : v.some((M) => M === h) ? v = v.filter((M) => M !== h) : v.push(h), n.value = s(v), t.emit("changeValue", n.value), t.emit("update:modelValue", n.value);
}
f.stopPropagation();
}
return we(() => e.data, () => {
i.value = e.data;
}), we(() => e.enumData, () => {
i.value = e.enumData;
}), {
enumData: i,
getValue: a,
getText: r,
checked: p,
onClickCheckbox: c
};
}
const Ct = /* @__PURE__ */ Ne({
name: "FCheckboxGroup",
props: Kt,
emits: ["changeValue", "update:modelValue"],
setup(e, t) {
const {
guid: n
} = co(), o = `checkbox_${n().slice(0, 8)}`, i = _(e.modelValue), a = _(e.tabIndex), r = _(e.name || o), {
enumData: u,
onClickCheckbox: s,
getValue: p,
getText: c,
checked: l
} = xn(e, t, i), f = L(() => ({
"farris-checkradio-hor": e.direction === "horizontal"
}));
we(() => e.modelValue, (h) => {
i.value = h;
});
const v = _([]);
return un(Yt, {
values: v,
parentProps: e,
parentContext: t
}), () => k("div", {
class: ["farris-input-wrap", "f-checkbox-group", f.value]
}, [t.slots.default ? t.slots.default() : u.value.map((h, M) => {
const S = "checkbox_" + r.value + M;
return k("div", {
class: "custom-control custom-checkbox"
}, [k("input", {
type: "checkbox",
class: "custom-control-input",
name: r.value,
id: S,
value: p(h),
checked: l(h),
disabled: e.readonly || e.disabled,
tabindex: a.value,
onClick: (m) => s(h, m)
}, null), k("label", {
class: "custom-control-label",
for: S,
title: c(h)
}, [c(h)])]);
})]);
}
});
function Qt(e, t, n) {
var O;
const o = n && n.getStyles && n.getStyles() || "", i = n && n.getDesignerClass && n.getDesignerClass() || "", a = _();
function r() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0;
}
function u() {
return !1;
}
function s() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanDeleteComponent ? n.checkCanDeleteComponent() : !0;
}
function p() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : n && n.hideNestedPaddingInDesginerView ? n.hideNestedPaddingInDesginerView() : !1;
}
function c(d) {
if (!d || !d.value)
return null;
if (d.value.schema && d.value.schema.type === "component")
return d.value;
const b = _(d == null ? void 0 : d.value.parent), C = c(b);
return C || null;
}
function l(d = t) {
var w;
if (n != null && n.getDraggableDesignItemElement)
return n.getDraggableDesignItemElement(d);
const { componentInstance: b, designerItemElementRef: C } = d;
if (!b || !b.value)
return null;
const { getCustomButtons: F } = b.value;
return b.value.canMove || F && ((w = F()) != null && w.length) ? C : l(d.parent);
}
function f(d) {
return !!n && n.canAccepts(d);
}
function v() {
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
}
function h() {
}
function M(d, b) {
var C;
!d || !b || (n != null && n.onAcceptMovedChildElement && n.onAcceptMovedChildElement(d, b), (C = t == null ? void 0 : t.setupContext) == null || C.emit("dragEnd"));
}
function S(d, b) {
const { componentType: C } = d;
let F = yn(C, d, b);
n && n.onResolveNewComponentSchema && (F = n.onResolveNewComponentSchema(d, F));
const w = C.toLowerCase().replace(/-/g, "_");
return F && !F.id && F.type === C && (F.id = `${w}_${Math.random().toString().slice(2, 6)}`), F;
}
function m(d) {
d && n != null && n.onChildElementMovedOut && n.onChildElementMovedOut(d);
}
function y(...d) {
if (n && n.getPropsConfig)
return n.getPropsConfig(...d);
}
function x() {
n && n.onRemoveComponent && n.onRemoveComponent(), t != null && t.schema.contents && t.schema.contents.map((d) => {
let b = d.id;
d.type === "component-ref" && (b = d.component);
const C = e.value.querySelectorAll(`#${b}-design-item`);
C != null && C.length && Array.from(C).map((F) => {
var w;
(w = F == null ? void 0 : F.componentInstance) != null && w.value.onRemoveComponent && F.componentInstance.value.onRemoveComponent();
});
});
}
function g() {
if (n && n.getCustomButtons)
return n.getCustomButtons();
}
function T(d) {
if (n && n.onPropertyChanged)
return n.onPropertyChanged(d);
}
return a.value = {
canMove: r(),
canSelectParent: u(),
canDelete: s(),
canNested: !p(),
contents: t == null ? void 0 : t.schema.contents,
elementRef: e,
parent: (O = t == null ? void 0 : t.parent) == null ? void 0 : O.componentInstance,
schema: t == null ? void 0 : t.schema,
styles: o,
designerClass: i,
canAccepts: f,
getBelongedComponentInstance: c,
getDraggableDesignItemElement: l,
getDraggingDisplayText: v,
getPropConfig: y,
getDragScopeElement: h,
onAcceptMovedChildElement: M,
onChildElementMovedOut: m,
addNewChildComponentSchema: S,
triggerBelongedComponentToMoveWhenMoved: !!n && n.triggerBelongedComponentToMoveWhenMoved || _(!1),
triggerBelongedComponentToDeleteWhenDeleted: !!n && n.triggerBelongedComponentToDeleteWhenDeleted || _(!1),
onRemoveComponent: x,
getCustomButtons: g,
onPropertyChanged: T
}, a;
}
const Rr = _(0);
function Pr() {
Rr.value++;
}
const yt = _(0);
function Lr(e, t) {
const n = t.getBoundingClientRect(), o = e.getBoundingClientRect(), i = o.top >= n.top, a = o.top <= n.bottom;
return i && a;
}
function jr(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 i = o.getBoundingClientRect();
o.style.top = n.top + "px";
let a = n.left - i.width;
const r = document.querySelector(".editorDiv");
if (r) {
const u = r.getBoundingClientRect();
a < u.left && ({ left: a } = e.getBoundingClientRect());
}
o.style.left = a + "px";
}
}
}
function Wr(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 Tn(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 i = Wr(e);
if (i && (o = Lr(e, i)), !o) {
n.style.display = "none";
return;
}
jr(e);
}
}
function Hr(e) {
if (!e)
return;
let t;
e.className.includes("dgComponentSelected") ? t = e : t = e.querySelector(".dgComponentSelected"), t && Tn(t);
}
class Fn {
constructor(t, n) {
q(this, "componentId");
q(this, "viewModelId");
q(this, "eventsEditorUtils");
q(this, "formSchemaUtils");
q(this, "formMetadataConverter");
q(this, "designViewModelUtils");
q(this, "designViewModelField");
q(this, "controlCreatorUtils");
q(this, "designerHostService");
q(this, "schemaService", null);
q(this, "metadataService", null);
q(this, "propertyConfig", {
type: "object",
categories: {}
});
var o;
this.componentId = t, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((o = this.formSchemaUtils) == null ? void 0 : o.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = n.designViewModelUtils, this.controlCreatorUtils = n.controlCreatorUtils, this.metadataService = n.metadataService, this.schemaService = n.schemaService;
}
getTableInfo() {
var t;
return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
}
setDesignViewModelField(t) {
var o;
const n = t.binding && t.binding.type === "Form" && t.binding.field;
if (n) {
if (!this.designViewModelField) {
const i = this.designViewModelUtils.getDgViewModel(this.viewModelId);
this.designViewModelField = i.fields.find((a) => a.id === n);
}
t.updateOn = (o = this.designViewModelField) == null ? void 0 : o.updateOn;
}
}
getBasicPropConfig(t) {
return {
description: "Basic Information",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "combo-list",
textField: "name",
valueField: "value",
editable: !1,
data: [{ value: t.type, name: le[t.type].name }]
}
}
}
};
}
getAppearanceConfig(t = null) {
return {
title: "外观",
description: "Appearance",
properties: {
class: {
title: "class样式",
type: "string",
description: "组件的CSS样式",
$converter: "/converter/appearance.converter"
},
style: {
title: "style样式",
type: "string",
description: "组件的样式",
$converter: "/converter/appearance.converter"
}
},
setPropertyRelates(n, o) {
if (n)
switch (n && n.propertyID) {
case "class":
case "style": {
yt.value++;
break;
}
}
}
};
}
/**
*
* @param propertyId
* @param componentInstance
* @returns
*/
updateElementByParentContainer(t, n) {
const o = n && n.parent && n.parent.schema;
if (!o)
return;
const i = o.contents.findIndex((r) => r.id === t), a = mt(o.contents[i]);
o.contents.splice(i, 1), o.contents.splice(i, 0, a), Pr();
}
}
const bt = class bt {
/**
* 根据绑定字段类型获取可用的输入类控件
*/
static getEditorTypesByMDataType(t, n = "") {
let o = bt.fieldControlTypeMapping[t];
if (n === "data-grid-column" && (o != null && o.length)) {
const i = [le["check-group"].type, le["radio-group"].type];
o = o.filter((a) => !i.includes(a.key));
}
return o;
}
/**
* 获取所有输入类控件
*/
static getAllInputTypes() {
const t = [];
for (const n in bt.fieldControlTypeMapping)
bt.fieldControlTypeMapping[n].forEach((o) => {
t.find((i) => i.key === o.key && i.value === o.value) || t.push({ key: o.key, value: o.value });
});
return t;
}
/**
* 提供schema字段基础属性和DOM控件属性的映射
* @param control 控件元数据
*/
static mappingDomPropAndSchemaProp(t) {
var i;
const n = (i = t.editor) == null ? void 0 : i.type, o = [];
return (t.type === le["data-grid-column"].type || t.type === le["tree-grid-column"].type) && o.push({ domField: "title", schemaField: "name" }), o.push({ domField: "label", schemaField: "name" }), o.push({ domField: "editor.required", schemaField: "require" }), o.push({ domField: "editor.readonly", schemaField: "readonly" }), (n === le["input-group"].type || n === le.textarea.type || n === le["number-spinner"].type) && o.push({ domField: "editor.maxLength", schemaField: "type.length" }), n === le["number-spinner"].type && o.push({ domField: "editor.precision", schemaField: "type.precision" }), (t.type === le["data-grid-column"].type || t.type === le["tree-grid-column"].type) && o.push({ domField: "formatter.precision", schemaField: "type.precision" }), (n === le["combo-list"].type || n === le["radio-group"].type) && o.push({ domField: "editor.data", schemaField: "type.enumValues" }), (t.type === le["data-grid-column"].type || t.type === le["tree-grid-column"].type) && o.push({ domField: "formatter.data", schemaField: "type.enumValues" }), n === le["date-picker"].type && (o.push({ domField: "editor.displayFormat", schemaField: "editor.format" }), o.push({ domField: "editor.fieldType", schemaField: "type.name" })), n === le["number-spinner"].type && (o.push({ domField: "editor.max", schemaField: "editor.maxValue" }), o.push({ domField: "editor.min", schemaField: "editor.minValue" })), n === le.lookup.type && (o.push({ domField: "editor.dataSource", schemaField: "editor.dataSource" }), o.push({ domField: "editor.valueField", schemaField: "editor.valueField" }), o.push({ domField: "editor.textField", schemaField: "editor.textField" }), o.push({ domField: "editor.displayType", schemaField: "editor.displayType" }), o.push({ domField: "editor.mapFields", schemaField: "editor.mapFields" }), o.push({ domField: "editor.helpId", schemaField: "editor.helpId" })), o.push({ domField: "path", schemaField: "bindingPath" }), o.push({ domField: "binding.path", schemaField: "bindingField" }), o.push({ domField: "binding.fullPath", schemaField: "path" }), (t.type === le["data-grid-column"].type || t.type === le["tree-grid-column"].type) && o.push({ domField: "field", schemaField: "bindingPath" }), o;
}
};
/**
* <字段类型,可配置的控件类型列表>的映射
*/
q(bt, "fieldControlTypeMapping", {
String: [
{ key: le["input-group"].type, value: le["input-group"].name },
{ key: le.lookup.type, value: le.lookup.name },
{ key: le["date-picker"].type, value: le["date-picker"].name },
{ key: le["check-group"].type, value: le["check-group"].name },
{ key: le["radio-group"].type, value: le["radio-group"].name },
{ key: le["combo-list"].type, value: le["combo-list"].name },
{ key: le.textarea.type, value: le.textarea.name },
{ key: le["time-picker"].type, value: le["time-picker"].name }
],
Text: [
{ key: le.textarea.type, value: le.textarea.name },
{ key: le.lookup.type, value: le.lookup.name }
],
Decimal: [
{ key: le["number-spinner"].type, value: le["number-spinner"].name }
],
Integer: [
{ key: le["number-spinner"].type, value: le["number-spinner"].name }
],
Number: [
{ key: le["number-spinner"].type, value: le["number-spinner"].name }
],
BigNumber: [
{ key: le["number-spinner"].type, value: le["number-spinner"].name }
],
Date: [
{ key: le["date-picker"].type, value: le["date-picker"].name }
],
DateTime: [
{ key: le["date-picker"].type, value: le["date-picker"].name }
],
Boolean: [
{ key: le.switch.type, value: le.switch.name },
{ key: le["check-box"].type, value: le["check-box"].name }
],
Enum: [
{ key: le["combo-list"].type, value: le["combo-list"].name },
{ key: le["radio-group"].type, value: le["radio-group"].name }
],
Object: [
{ key: le.lookup.type, value: le.lookup.name },
{ key: le["combo-list"].type, value: le["combo-list"].name },
{ key: le["radio-group"].type, value: le["radio-group"].name }
]
});
let Et = bt;
class Ar {
constructor() {
/** 控件标题 */
q(this, "label", "");
/** 控件id */
q(this, "id", "");
/** 每个控件占用的栅格数 */
q(this, "columnInSM", 12);
q(this, "columnInMD", 6);
q(this, "columnInLG", 3);
q(this, "columnInEL", 2);
/** 每个控件占用的列数 */
q(this, "displayWidthInSM", 1);
q(this, "displayWidthInMD", 1);
q(this, "displayWidthInLG", 1);
q(this, "displayWidthInEL", 1);
/** 编辑器内部默认显示的屏幕大小-----可以去掉 */
q(this, "displayColumnCountAtBreakPoint", "md");
/** 控件所在行,传0即可-----编辑器内部使用 */
q(this, "tagRow", 0);
/** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
q(this, "showTopBorder", 0);
/** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
q(this, "group", 1);
/** 控件是否符合标准的class配置(设计器用的) */
q(this, "isSupportedClass", !0);
/** 控件所在分组id(设计器用的) */
q(this, "fieldSetId", "");
}
}
function zr(e) {
let t, n;
const o = /* @__PURE__ */ new Map();
let i = [];
function a(c, l) {
const v = c.split(" ").filter((y) => y.startsWith("col-"));
if (v.length === 0) {
l.isSupportedClass = !1;
return;
}
let h = v.find((y) => /^col-([1-9]|10|11|12)$/.test(y)), M = v.find((y) => /^col-md-([1-9]|10|11|12)$/.test(y)), S = v.find((y) => /^col-xl-([1-9]|10|11|12)$/.test(y)), m = v.find((y) => /^col-el-([1-9]|10|11|12)$/.test(y));
h = h || "col-12", l.columnInSM = parseInt(h.replace("col-", ""), 10), l.displayWidthInSM = l.columnInSM / 12, l.displayWidthInSM !== 1 && (l.isSupportedClass = !1), M = M || "col-md-" + l.columnInSM, l.columnInMD = parseInt(M.replace("col-md-", ""), 10), l.displayWidthInMD = l.columnInMD / 6, [1, 2].includes(l.displayWidthInMD) || (l.isSupportedClass = !1), S = S || "col-xl-" + l.columnInMD, l.columnInLG = parseInt(S.replace("col-xl-", ""), 10), l.displayWidthInLG = l.columnInLG / 3, [1, 2, 3, 4].includes(l.displayWidthInLG) || (l.isSupportedClass = !1), m = m || "col-el-" + l.columnInLG, l.columnInEL = parseInt(m.replace("col-el-", ""), 10), l.displayWidthInEL = l.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(l.displayWidthInEL) || (l.isSupportedClass = !1);
}
function r(c, l, f, v = !1) {
let h = !1;
c.contents.forEach((M) => {
if (M.type === "fieldset") {
f += 1, r(M, l, f, !0), h = !0;
return;
}
h && (f += 1, h = !1);
const S = M.appearance && M.appearance.class, m = new Ar();
S ? a(S, m) : m.isSupportedClass = !1, m.label = M.label || M.id, m.id = M.id, m.group = f, v && (m.fieldSetId = c.id), n === M.id && (t = f), o.set(M.id, M), l.push(m);
});
}
function u(c) {
const l = e.getComponentById(c);
if (!l || !l.componentType || !l.componentType.startsWith("form"))
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
const f = e.selectNode(l, (v) => v.type === rn["response-form"].type);
return !f || !f.contents || f.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: f };
}
function s(c, l) {
l = l || c.id;
const { result: f, message: v, formNode: h } = u(l);
if (!f)
return { result: f, message: v };
n = c.id, i = [], o.clear();
const M = h.contents[0].type === rn.fieldset.type ? 0 : 1;
r(h, i, M);
const S = i.find((y) => !y.isSupportedClass);
return {
defaultState: {
defaultGroupNumber: t || 1,
model: S ? "customize" : "standard"
},
importData: i
};
}
function p(c, l) {
l = l;
const { result: f, formNode: v } = u(l);
if (!f)
return "";
const h = [];
return c.forEach((M) => {
var y;
const S = o.get(M.id), m = S.appearance && S.appearance.class;
if (m) {
const g = m.split(" ").filter((F) => !F.startsWith("col-")), T = "col-" + M.columnInSM, O = "col-md-" + M.columnInMD, d = "col-xl-" + M.columnInLG, b = "col-el-" + M.columnInEL, C = [T, O, d, b].concat(g);
S.appearance.class = C.join(" ");
}
if (M.fieldSetId) {
const x = v.contents.find((T) => T.id === M.fieldSetId), g = h.find((T) => T.id === M.fieldSetId);
g ? (y = g.contents) == null || y.push(S) : (h.push(x), x.contents = [S]);
} else
h.push(S);
}), v.contents = h, v.id;
}
return {
checkCanFindFormNode: u,
checkCanOpenLayoutEditor: s,
changeFormControlsByResponseLayoutConfig: p,
getResonseFormLayoutConfig: r
};
}
var dt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Ft(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 Gr = { exports: {} };
(function(e, t) {
(function(n) {
e.exports = n();
})(function() {
return (/* @__PURE__ */ function() {
function n(o, i, a) {
function r(p, c) {
if (!i[p]) {
if (!o[p]) {
var l = typeof Ft == "function" && Ft;
if (!c && l) return l(p, !0);
if (u) return u(p, !0);
var f = new Error("Cannot find module '" + p + "'");
throw f.code = "MODULE_NOT_FOUND", f;
}
var v = i[p] = { exports: {} };
o[p][0].call(v.exports, function(h) {
var M = o[p][1][h];
return r(M || h);
}, v, v.exports, n, o, i, a);
}
return i[p].exports;
}
for (var u = typeof Ft == "function" && Ft, s = 0; s < a.length; s++) r(a[s]);
return r;
}
return n;
}())({
1: [function(n, o, i) {
var a = {}, r = "(?:^|\\s)", u = "(?:\\s|$)";
function s(l) {
var f = a[l];
return f ? f.lastIndex = 0 : a[l] = f = new RegExp(r + l + u, "g"), f;
}
function p(l, f) {
var v = l.className;
v.length ? s(f).test(v) || (l.className += " " + f) : l.className = f;
}
function c(l, f) {
l.className = l.className.replace(s(f), " ").trim();
}
o.exports = {
add: p,
rm: c
};
}, {}],
2: [function(n, o, i) {
(function(a) {
var r = n("contra/emitter"), u = n("crossvent"), s = n("./classes"), p = document, c = p.documentElement;
function l(w, N) {
var B = arguments.length;
B === 1 && Array.isArray(w) === !1 && (N = w, w = []);
var D, I, V, E, $, H, K, oe, te, pe = null, W, j, A = !1, Y = 0, J, X = N || {};
X.moves === void 0 && (X.moves = y), X.accepts === void 0 && (X.accepts = y), X.invalid === void 0 && (X.invalid = rt), X.containers === void 0 && (X.containers = w || []), X.isContainer === void 0 && (X.isContainer = m), X.copy === void 0 && (X.copy = !1), X.copySortSource === void 0 && (X.copySortSource = !1), X.revertOnSpill === void 0 && (X.revertOnSpill = !1), X.removeOnSpill === void 0 && (X.removeOnSpill = !1), X.direction === void 0 && (X.direction = "vertical"), X.ignoreInputTextSelection === void 0 && (X.ignoreInputTextSelection = !0), X.mirrorContainer === void 0 && (X.mirrorContainer = p.body);
var R = r({
containers: X.containers,
start: Ge,
end: ne,
cancel: at,
remove: ke,
destroy: xe,
canMove: Me,
dragging: !1
});
return X.removeOnSpill === !0 && R.on("over", me).on("out", ve), re(), R;
function G(P) {
return R.containers.indexOf(P) !== -1 || X.isContainer(P);
}
function re(P) {
var Q = P ? "remove" : "add";
h(c, Q, "mousedown", Te), h(c, Q, "mouseup", Ie);
}
function Z(P) {
var Q = P ? "remove" : "add";
h(c, Q, "mousemove", We);
}
function ee(P) {
var Q = P ? "remove" : "add";
u[Q](c, "selectstart", Fe), u[Q](c, "click", Fe);
}
function xe() {
re(!0), Ie({});
}
function Fe(P) {
W && P.preventDefault();
}
function Te(P) {
E = P.clientX, $ = P.clientY;
var Q = M(P) !== 1 || P.metaKey || P.ctrlKey;
if (!Q) {
var U = P.target, ce = $e(U);
ce && (W = ce, Z(), P.type === "mousedown" && (O(U) ? U.focus() : P.preventDefault()));
}
}
function We(P) {
if (W) {
if (M(P) === 0) {
Ie({});
return;
}
if (!(P.clientX !== void 0 && Math.abs(P.clientX - E) <= (X.slideFactorX || 0) && P.clientY !== void 0 && Math.abs(P.clientY - $) <= (X.slideFactorY || 0))) {
if (X.ignoreInputTextSelection) {
var Q = F("clientX", P) || 0, U = F("clientY", P) || 0, ce = p.elementFromPoint(Q, U);
if (O(ce))
return;
}
var ge = W;
Z(!0), ee(), ne(), Ae(ge), s.add(oe || V, "gu-transit"), Ee(), Se(), Y = 0, qe(P);
}
}
}
function $e(P) {
if (!(R.dragging && D) && !G(P)) {
for (var Q = P; T(P) && G(T(P)) === !1; )
if (X.invalid(P, Q) || (P = T(P), !P))
return;
var U = T(P);
if (U && !X.invalid(P, Q)) {
var ce = X.moves(P, U, Q, b(P));
if (ce)
return {
item: P,
source: U
};
}
}
}
function Me(P) {
return !!$e(P);
}
function Ge(P) {
var Q = $e(P);
Q && Ae(Q);
}
function Ae(P) {
Pe(P.item, P.source) && (oe = P.item.cloneNode(!0), R.emit("cloned", oe, P.item, "copy")), I = P.source, V = P.item, H = K = b(P.item), R.dragging = !0, R.emit("drag", V, I);
}
function rt() {
return !1;
}
function ne() {
if (R.dragging) {
var P = oe || V;
Be(P, T(P));
}
}
function be() {
W = !1, Z(!0), ee(!0);
}
function Ie(P) {
if (be(), !!R.dragging) {
var Q = oe || V, U = F("clientX", P) || 0, ce = F("clientY", P) || 0, ge = S(D, U, ce), ye = ut(ge, U, ce);
ye && (oe && X.copySortSource || !oe || ye !== I) ? Be(Q, ye) : X.removeOnSpill ? ke() : at();
}
}
function Be(P, Q) {
var U = T(P);
oe && X.copySortSource && Q === I && U.removeChild(V), tt(Q) ? R.emit("cancel", P, I) : R.emit("drop", P, Q, I, K), et();
}
function ke() {
if (R.dragging) {
var P = oe || V, Q = T(P);
Q && Q.removeChild(P), R.emit(oe ? "cancel" : "remove", P, Q, I), et();
}
}
function at(P) {
if (R.dragging) {
var Q = arguments.length > 0 ? P : X.revertOnSpill, U = oe || V, ce = T(U), ge = tt(ce);
ge === !1 && Q && (oe ? ce && ce.removeChild(oe) : I.insertBefore(U, H)), ge || Q ? R.emit("cancel", U, I, I) : R.emit("drop", U, ce, I, K), et();
}
}
function et() {
var P = oe || V;
be(), Re(), ze(), P && s.rm(P, "gu-transit"), te && clearTimeout(te), R.dragging = !1, pe && R.emit("out", P, pe, I), R.emit("dragend", P, Y), I = V = oe = H = K = te = pe = null;
}
function tt(P, Q) {
var U;
return Q !== void 0 ? U = Q : D ? U = K : U = b(oe || V), P === I && U === H;
}
function ut(P, Q, U) {
for (var ce = P; ce && !ge(); )
ce = T(ce);
return ce;
function ge() {
var ye = G(ce);
if (ye === !1)
return !1;
var ae = nt(ce, P), _e = Ve(ce, ae, Q, U), De = tt(ce, _e);
return De ? !0 : X.accepts(V, ce, I, _e);
}
}
function qe(P) {
if (!D)
return;
P.preventDefault();
var Q = F("clientX", P) || 0, U = F("clientY", P) || 0;
D.style.left = Q - 2 + "px", D.style.top = U - 2 + "px";
var ce = oe || V, ge = S(D, Q, U), ye = ut(ge, Q, U), ae = ye !== null && ye !== pe;
(ae || ye === null) && (Ke(), pe = ye, ct()), Ce(ge, U);
var _e = T(ce);
if (ye === I && oe && !X.copySortSource) {
_e && _e.removeChild(ce);
return;
}
var De, Xe = nt(ye, ge);
if (A = ot(Xe, ye), Xe !== null)
De = Ve(ye, Xe, Q, U);
else if (X.revertOnSpill === !0 && !oe)
De = H, ye = I;
else {
oe && _e && _e.removeChild(ce), oe && j && (j.style.display = "none");
return;
}
j.style.display = "block", ie(De, ce, ae), De ? z(Xe, De) : he(ye);
function Le(He) {
R.emit(He, ce, pe, I);
}
function ct() {
ae && Le("over");
}
function Ke() {
pe && Le("out");
}
}
function ie(P, Q, U) {
(P === Q || P === b(Q)) && (K = b(Q)), (P === null && U || P !== Q && P !== b(Q)) && (K = P);
}
function me(P) {
s.rm(P, "gu-hide");
}
function ve(P) {
R.dragging && s.add(P, "gu-hide");
}
function Se() {
D || (D = document.createElement("div"), D.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;", D.innerHTML = X.getMirrorText && X.getMirrorText(V) || "控件", s.add(D, "gu-mirror"), X.mirrorContainer.appendChild(D), h(c, "add", "mousemove", qe), s.a