@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,420 lines • 324 kB
JavaScript
var qn = Object.defineProperty;
var Un = (e, t, n) => t in e ? qn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var q = (e, t, n) => Un(e, typeof t != "symbol" ? t + "" : t, n);
import { computed as P, ref as x, createVNode as E, onMounted as st, nextTick as xt, defineComponent as He, watch as we, Fragment as Tt, reactive as lt, createApp as an, onUnmounted as Rt, Transition as ln, mergeProps as vt, createTextVNode as gt, onBeforeUnmount as sn, withDirectives as Yn, resolveDirective as Xn, onBeforeMount as Kn, Teleport as Zn, shallowRef as Qn, render as Lt, h as Jn, cloneVNode as eo, inject as yt, provide as to, triggerRef as no, isVNode as oo } from "vue";
import { isPlainObject as Qt, cloneDeep as pt, isUndefined as Jt } from "lodash-es";
import Ge from "bignumber.js";
import { useDateFormat as io, useNumberFormat as ro, resolveField as Xe, setFieldValue as At, getCustomClass as Wt, withInstall as un, FormSchemaEntityField$Type as en, FormSchemaEntityFieldType$Type as ao } from "../common/index.esm.js";
import { DgControl as tn } from "../designer-canvas/index.esm.js";
import { useResizeObserver as cn } from "@vueuse/core";
import { useIdentify as lo, useGroupData as so, useFilter as uo, useHierarchy as co, useLoading as fo, useDataView as po, useSelection as mo, useSelectHierarchyItem as ho, useDataViewContainerStyle as vo, useCommandColumn as go, useColumn as yo, useSort as bo, useGroupColumn as Co, useRow as wo, useEdit as So, useVisualDataBound as _o, useVisualDataCell as xo, useVisualDataRow as To, useVisualData as Fo, useCellPosition as Io, useSidebar as Eo, useVirtualScroll as ko, useFitColumn as Mo, useFilterHistory as Oo, useColumnFilter as Bo, useDragColumn as Vo, getColumnHeader as No, getSidebar as Do, getDisableMask as Ro, getHorizontalScrollbar as $o, getVerticalScrollbar as Po, getEmpty as jo } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import Lo from "../transfer/index.esm.js";
import Wo from "../tabs/index.esm.js";
import Ho from "../order/index.esm.js";
import "../condition/index.esm.js";
import Ao, { FCheckbox as zo } from "../checkbox/index.esm.js";
import Go from "../filter-bar/index.esm.js";
import nn from "../tooltip/index.esm.js";
import qo from "../pagination/index.esm.js";
import Uo from "../button/index.esm.js";
import Yo from "../search-box/index.esm.js";
import Xo from "../tags/index.esm.js";
import Ko, { FDynamicFormGroup as Zo, FDynamicFormInput as Qo } from "../dynamic-form/index.esm.js";
import Jo from "../binding-selector/index.esm.js";
import "../notify/index.esm.js";
import ei from "../accordion/index.esm.js";
import ti from "../avatar/index.esm.js";
import ni from "../button-edit/index.esm.js";
import oi from "../button-group/index.esm.js";
import ii from "../calendar/index.esm.js";
import ri from "../capsule/index.esm.js";
import ai from "../color-picker/index.esm.js";
import zt from "../combo-list/index.esm.js";
import li from "../content-container/index.esm.js";
import si from "../data-grid/index.esm.js";
import ui from "../date-picker/index.esm.js";
import ci from "../dropdown/index.esm.js";
import "../external-container/index.esm.js";
import di from "../events-editor/index.esm.js";
import fi from "../image-cropper/index.esm.js";
import pi from "../input-group/index.esm.js";
import mi from "../layout/index.esm.js";
import hi from "../list-nav/index.esm.js";
import vi from "../list-view/index.esm.js";
import gi from "../lookup/index.esm.js";
import yi from "../nav/index.esm.js";
import bi from "../number-spinner/index.esm.js";
import Ci from "../number-range/index.esm.js";
import wi from "../page-header/index.esm.js";
import Si from "../page-footer/index.esm.js";
import _i from "../progress/index.esm.js";
import xi from "../query-solution/index.esm.js";
import Ti from "../radio-group/index.esm.js";
import Fi from "../rate/index.esm.js";
import Ii from "../response-toolbar/index.esm.js";
import Ei from "../response-layout/index.esm.js";
import ki from "../response-layout-editor/index.esm.js";
import Mi from "../section/index.esm.js";
import Oi from "../smoke-detector/index.esm.js";
import Bi from "../splitter/index.esm.js";
import Vi from "../step/index.esm.js";
import Ni from "../switch/index.esm.js";
import Di from "../text/index.esm.js";
import Ri from "../time-picker/index.esm.js";
import $i from "../tree-view/index.esm.js";
import Pi from "../uploader/index.esm.js";
import ji from "../verify-detail/index.esm.js";
import Li from "../component/index.esm.js";
import Wi from "../video/index.esm.js";
import Hi from "../textarea/index.esm.js";
import Ai from "../tree-grid/index.esm.js";
import zi from "../fieldset/index.esm.js";
import Gi from "../drawer/index.esm.js";
import qi from "../combo-tree/index.esm.js";
import Ui from "../field-selector/index.esm.js";
import Yi from "../mapping-editor/index.esm.js";
import Xi from "../schema-selector/index.esm.js";
import Ki from "../event-parameter/index.esm.js";
import Zi from "../filter-condition-editor/index.esm.js";
import Qi from "../sort-condition-editor/index.esm.js";
import Ji from "../menu-lookup/index.esm.js";
import { createPropsResolver as er } from "../dynamic-resolver/index.esm.js";
const dn = {}, fn = {};
function Ut(e) {
const { properties: t, title: n, ignore: o } = e, i = o && Array.isArray(o), a = Object.keys(t).reduce((r, s) => ((!i || !o.find((u) => u === s)) && (r[s] = t[s].type === "object" && t[s].properties ? Ut(t[s]) : pt(t[s].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 tr(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 ? Ut(t[r]) : pt(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 pn(e, t = {}, n) {
const o = dn[e];
if (o) {
let i = tr(o);
const a = fn[e];
return i = a ? a({ getSchemaByType: pn }, i, t, n) : i, i;
}
return null;
}
function nr(e, t) {
const n = Ut(t);
return Object.keys(n).reduce((o, i) => (Object.prototype.hasOwnProperty.call(e, i) && (o[i] && Qt(o[i]) && Qt(e[i] || !e[i]) ? Object.assign(o[i], e[i] || {}) : o[i] = e[i]), o), n), n;
}
function mn(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 or(e, t, n = /* @__PURE__ */ new Map()) {
const o = nr(e, t);
return mn(o, n);
}
function ir(e = {}) {
function t(f, c, l, d) {
if (typeof l == "number")
return d[f].length === l;
if (typeof l == "object") {
const v = Object.keys(l)[0], g = l[v];
if (v === "not")
return Number(d[f].length) !== Number(g);
if (v === "moreThan")
return Number(d[f].length) >= Number(g);
if (v === "lessThan")
return Number(d[f].length) <= Number(g);
}
return !1;
}
function n(f, c, l, d) {
return d[f] && d[f].propertyValue && String(d[f].propertyValue.value) === String(l);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", n]
]);
Object.keys(e).reduce((f, c) => (f.set(c, e[c]), f), o);
function i(f, c) {
const l = f;
return typeof c == "number" ? [{ target: l, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: l, operator: "getProperty", param: f, value: !!c }] : typeof c == "object" ? Object.keys(c).map((d) => {
if (d === "length")
return { target: l, operator: "length", param: null, value: c[d] };
const v = d, g = c[d];
return { target: l, operator: "getProperty", param: v, value: g };
}) : [];
}
function a(f) {
return Object.keys(f).reduce((l, d) => {
const v = i(d, f[d]);
return l.push(...v), l;
}, []);
}
function r(f, c) {
if (o.has(f.operator)) {
const l = o.get(f.operator);
return l && l(f.target, f.param, f.value, c) || !1;
}
return !1;
}
function s(f, c) {
return a(f).reduce((v, g) => v && r(g, c), !0);
}
function u(f, c) {
const l = Object.keys(f), d = l.includes("allOf"), v = l.includes("anyOf"), g = d || v, h = (g ? f[g ? d ? "allOf" : "anyOf" : "allOf"] : [f]).map((T) => s(T, c));
return d ? !h.includes(!1) : h.includes(!0);
}
return { parseValueSchema: u };
}
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: "抽屉" }
}, rr = {}, ar = {};
ir();
function mt(e, t, n = /* @__PURE__ */ new Map(), o = (r, s, u, f) => s, i = {}, a = (r) => r) {
return dn[t.title] = t, fn[t.title] = o, rr[t.title] = i, ar[t.title] = a, (r = {}, s = !0) => {
if (!s)
return mn(r, n);
const u = or(r, t, n), f = Object.keys(e).reduce((c, l) => (c[l] = e[l].default, c), {});
return Object.assign(f, u);
};
}
function Ft(e, t) {
return { customClass: t.class, customStyle: t.style };
}
function lr() {
function e(t, n) {
const { dataSource: o } = t || {};
return o === void 0 ? {} : {};
}
return {
resolve: e
};
}
function sr() {
function e(t, n) {
return t.selectItemById(n);
}
return {
selectItemById: e
};
}
function ur() {
function e(t, n) {
const { columns: o } = n;
return t.updateColumns(o);
}
return {
updateColumns: e
};
}
const cr = /* @__PURE__ */ new Map([
["appearance", Ft]
]), dr = "https://json-schema.org/draft/2020-12/schema", fr = "https://farris-design.gitee.io/number-spinner.schema.json", pr = "number-spinner", mr = "A Farris Input Component", hr = "object", vr = {
id: {
description: "The unique identifier for a number spinner",
type: "string"
},
type: {
description: "The type string of number spinner component",
type: "string",
default: "number-spinner"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
editable: {
description: "",
type: "boolean",
default: !0
},
placeholder: {
description: "",
type: "string",
default: "请输入数字"
},
readonly: {
description: "",
type: "boolean",
default: !1
},
disabled: {
description: "",
type: "boolean",
default: !1
},
required: {
description: "",
type: "boolean",
default: !1
},
precision: {
description: "",
type: "number",
default: 0
},
min: {
description: "",
type: "number"
},
step: {
description: "",
type: "number",
default: 1
},
tabindex: {
description: "",
type: "number",
default: -1
},
textAlign: {
description: "",
type: "string",
enum: [
"left",
"middle",
"right"
],
default: "left"
},
nullable: {
description: "",
type: "boolean",
default: !1
},
max: {
description: "",
type: "number"
},
onBlur: {
description: "",
type: "string",
default: ""
},
onClickLinkLabel: {
description: "",
type: "sting",
default: ""
},
showZero: {
description: "",
type: "boolean",
default: !0
}
}, gr = [
"type"
], yr = [
"id",
"appearance",
"binding",
"visible"
], br = {
$schema: dr,
$id: fr,
title: pr,
description: mr,
type: hr,
properties: vr,
required: gr,
ignore: yr
};
function Cr(e, t, n) {
return t;
}
const Yt = {
/**
* 组件标识
*/
id: String,
/**
* 是否禁用
*/
disabled: { type: Boolean, default: !1 },
/**
* 是否只读
*/
readonly: { type: Boolean, default: !1 },
/**
* 是否可编辑
*/
editable: { type: Boolean, default: !0 },
/**
* 格式化 formatter 和 parser 必须同时存在
* formatter: (val: number) => string;
* parser: (val: string | number) => number;
*/
formatter: { type: Function },
parser: { type: Function },
/**
* 空白提示文本
*/
placeholder: { type: String, default: "请输入数字" },
/**
* up or down 步长
*/
step: { type: Number, default: 1 },
/**
* 最大值
*/
max: { type: [Number, String] },
/**
* 最小值
*/
min: { type: [Number, String] },
/**
* 是否显示加减按钮
*/
showButton: { type: Boolean, default: !0 },
/**
* 是否使用千分值
*/
useThousands: { type: Boolean, default: !0 },
/**
* 文本方向
*/
textAlign: { type: String, default: "left" },
/**
* 自动补全小数---未实现
*/
autoDecimal: { type: Boolean, default: !0 },
/**
* 允许为空
*/
nullable: { type: Boolean, default: !1 },
/**
* 精度
*/
precision: { type: Number, default: 0 },
/**
* 前缀
*/
prefix: { type: String, default: "" },
/**
* 后缀
*/
suffix: { type: String, default: "" },
/**
* 小数点符号
*/
decimalSeparator: { type: String, default: "." },
/**
* 千分位符号
*/
groupSeparator: { type: String, default: "," },
/**
* 使用千分位时,每组显示的字符数
*/
groupSize: { type: Number, default: 3 },
/**
* 值
*/
value: { type: [Number, String], default: "" },
/**
* 显示0值
*/
showZero: { type: Boolean, default: !0 },
/**
* 组件值
*/
modelValue: { type: [Number, String], default: "" },
/**
* 作为内嵌编辑器被创建后默认获得焦点
*/
focusOnCreated: { type: Boolean, default: !1 },
/**
* 作为内嵌编辑器被创建后默认选中文本
*/
selectOnCreated: { type: Boolean, default: !1 }
}, wr = Object.assign({}, Yt, {
readonly: {}
}), hn = mt(Yt, br, cr, Cr);
function Sr(e, t, n, o) {
const { format: i } = n, { displayValue: a, getRealValue: r, modelValue: s, onNumberValueChanged: u } = o;
function f() {
const b = new Ge(s.value || 0);
return !((e.max || e.max === 0) && !new Ge(e.max).isNaN() && b.gte(new Ge(e.max)) && (s.value || s.value === 0));
}
function c() {
const b = new Ge(s.value || 0);
return !((e.min || e.min === 0) && !new Ge(e.min).isNaN() && b.lte(new Ge(e.min)) && (s.value || s.value === 0));
}
function l(b) {
if (e.readonly || e.disabled)
return;
const h = b === "up" ? f : c, y = b === "up" ? "plus" : "minus";
if (h()) {
const m = new Ge(s.value || 0)[y](Number(e.step)), S = m.toFixed();
a.value = i(S), u(r(m));
}
}
function d() {
l("up");
}
function v() {
l("down");
}
function g(b) {
d(), b.stopPropagation();
}
function I(b) {
v(), b.stopPropagation();
}
return { canDownward: c, canUpward: f, downward: v, onClickDownButton: I, onClickUpButton: g, upward: d };
}
function vn(e, t, n) {
const o = P(() => ({
prefix: e.prefix,
suffix: e.suffix,
decimalSeparator: e.decimalSeparator,
groupSeparator: e.useThousands ? e.groupSeparator : "",
groupSize: e.groupSize
})), { getValidNumberObject: i, precision: a } = n;
function r(f) {
return f = f == null || f === "" ? "" : String(f), f = f.replace(new RegExp(e.prefix, "g"), "").replace(new RegExp(e.suffix, "g"), "").replace(/,/g, ""), e.groupSeparator && e.groupSeparator !== "," && (f = f.replace(new RegExp(`\\${e.groupSeparator}`, "g"), "")), e.decimalSeparator && e.decimalSeparator !== "." && (f = f.replace(new RegExp(`\\${e.decimalSeparator}`, "g"), ".")), f;
}
function s(f, c) {
return e.precision !== null && e.precision !== void 0 ? f.toFormat(a.value, c) : f.toFormat(c);
}
function u(f, c = !0) {
const l = r(f), d = new Ge(l, 10);
let v = d;
return c && (v = i(d)), v.valueOf() === "0" && !e.showZero || v.isNaN() ? "" : e.formatter ? e.formatter(v.toNumber()) : s(v, o.value);
}
return { cleanFormat: r, format: u };
}
function gn(e, t) {
const n = x(""), o = x(e.modelValue), i = P(() => Number(e.precision) || 0);
function a(c) {
return c.toFixed(i.value);
}
function r(c) {
return isNaN(c) || c === null || c === void 0 || c === "";
}
function s(c) {
const l = r(e.max) ? null : new Ge(String(e.max), 10), d = r(e.min) ? null : new Ge(String(e.min), 10);
return l && c.gt(l) ? l : d && c.lt(d) ? d : c;
}
function u(c, l = !0) {
if (e.parser)
return isNaN(Number(c)) ? e.parser(c) : c;
let d = new Ge(c, 10);
if (l && (d = s(d)), d.isNaN()) {
if (e.nullable)
return null;
const g = new Ge("" + e.min, 10), I = new Ge("" + e.max, 10);
if (!g.isNaN())
d = g;
else if (!I.isNaN())
d = I;
else
return 0;
}
return a(d);
}
function f(c) {
let l = Number(c);
e.nullable && c === null && (l = null), t.emit("update:modelValue", l), t.emit("valueChange", l), t.emit("change", l);
}
return { displayValue: n, getRealValue: u, modelValue: o, isEmpty: r, onNumberValueChanged: f, precision: i, getValidNumberObject: s };
}
function _r(e, t, n, o, i) {
const { cleanFormat: a, format: r } = n, { displayValue: s, getRealValue: u, modelValue: f, isEmpty: c, onNumberValueChanged: l } = o, { downward: d, upward: v } = i, g = x(!1), I = P(() => s.value);
function b(m) {
var p;
if (m.stopPropagation(), g.value = !1, e.readonly || e.disabled)
return;
let S = (p = m.target) == null ? void 0 : p.value;
e.nullable || (S = S || 0);
const M = a(S);
s.value = r(u(M)), l(u(M)), t.emit("blur", { event: m, formatted: s.value, value: f.value });
}
function h(m) {
m.stopPropagation(), g.value = !0, !(e.readonly || e.disabled) && (s.value = c(f.value) || !e.showZero && f.value === "0" ? "" : String(f.value), t.emit("focus", { event: m, formatted: s.value, value: f.value }));
}
function y(m) {
var p;
m.stopPropagation();
let S = (p = m.target) == null ? void 0 : p.value;
e.nullable || (S = S || 0);
const M = a(S);
s.value = M, l(u(M));
}
function T(m) {
m.shiftKey && m.key === "ArrowDown" && (m.preventDefault(), d()), m.shiftKey && m.key === "ArrowUp" && (m.preventDefault(), v()), m.stopPropagation();
}
return { textBoxValue: I, onBlurTextBox: b, onFocusTextBox: h, onInput: y, onKeyDown: T, isFocus: g };
}
function xr(e, t, n) {
const {
canDownward: o,
canUpward: i,
onClickDownButton: a,
onClickUpButton: r
} = n, s = P(() => ({
"input-group-append": !0,
"btn-group": !0,
"btn-group-number": !0
})), u = P(() => ({
btn: !0,
"btn-secondary": !0,
"btn-number-flag": !0
})), f = P(() => ({
cursor: i() ? "pointer" : "not-allowed",
"margin-left": 0
})), c = P(() => ({
cursor: o() ? "pointer" : "not-allowed",
"margin-left": 0
}));
return () => E("div", {
class: s.value
}, [E("button", {
class: u.value,
style: f.value,
onClick: r,
disabled: !i()
}, [E("span", {
class: "f-icon f-icon-arrow-chevron-up number-arrow-chevron",
style: "cursor: inherit"
}, null)]), E("button", {
class: u.value,
style: c.value,
onClick: a,
disabled: !o()
}, [E("span", {
class: "f-icon f-icon-arrow-chevron-down number-arrow-chevron",
style: "cursor: inherit"
}, null)])]);
}
function Tr(e, t, n) {
const o = x(), {
onBlurTextBox: i,
onFocusTextBox: a,
onInput: r,
onKeyDown: s,
textBoxValue: u
} = n, f = P(() => e.disabled || e.readonly || !e.editable ? "" : e.placeholder), c = P(() => ({
"form-control": !0,
"f-utils-fill": !0
})), l = P(() => ({
"text-align": e.textAlign
}));
function d(I) {
I.stopPropagation();
}
function v() {
var I, b;
e.selectOnCreated && ((I = o.value) == null || I.select()), e.focusOnCreated && ((b = o.value) == null || b.focus());
}
async function g(I) {
a(I), await xt, v();
}
return st(async () => {
await xt, v();
}), () => E("input", {
ref: o,
class: c.value,
style: l.value,
type: "text",
value: u.value,
disabled: e.disabled,
readonly: e.readonly || !e.editable,
placeholder: f.value,
onBlur: i,
onChange: d,
onFocus: g,
onInput: r,
onKeydown: s
}, null);
}
const Mt = /* @__PURE__ */ He({
name: "FNumberSpinner",
props: Yt,
emits: ["update:modelValue", "valueChange", "change", "blur", "focus", "click", "input"],
setup(e, t) {
const n = gn(e, t), o = vn(e, t, n), i = Sr(e, t, o, n), a = _r(e, t, o, n, i), r = xr(e, t, i), {
displayValue: s,
modelValue: u,
getRealValue: f
} = n, c = Tr(e, t, a), {
format: l
} = o, {
isFocus: d
} = a, v = P(() => !e.disabled && !e.readonly && e.showButton), g = P(() => ({
"input-group": !0,
"flex-row": !0,
"f-cmp-number-spinner": !0,
"f-state-disabled": e.disable,
"f-state-readonly": e.readonly && !e.disable,
"f-state-focus": d.value
}));
return st(() => {
const I = f(e.modelValue, !1);
s.value = l(I, !1);
}), we(() => [e.value], ([I]) => {
const b = f(I, !1);
u.value = b, s.value = l(b, !1);
}), we(() => [e.modelValue], ([I]) => {
I !== u.value && (u.value = I, !d.value && (s.value = l(f(I, !1), !1)));
}), we(() => [e.precision, e.useThousands, e.prefix, e.suffix, e.showZero], () => {
s.value = l(u.value, !1);
}), () => E("div", {
class: g.value
}, [c(), v.value && r()]);
}
});
function Fr() {
const e = P(() => ({
"input-group-append": !0,
"btn-group": !0,
"btn-group-number": !0
})), t = P(() => ({
btn: !0,
"btn-secondary": !0,
"btn-number-flag": !0
})), n = P(() => ({
cursor: "pointer",
"margin-left": 0
})), o = P(() => ({
cursor: "pointer",
"margin-left": 0
}));
return () => E("div", {
class: e.value
}, [E("button", {
title: "upButton",
class: t.value,
style: n.value
}, [E("span", {
class: "f-icon f-icon-arrow-chevron-up number-arrow-chevron"
}, null)]), E("button", {
title: "downButton",
class: t.value,
style: o.value
}, [E("span", {
class: "f-icon f-icon-arrow-chevron-down number-arrow-chevron"
}, null)])]);
}
function yn(e, t, n) {
var M;
const o = n && n.getStyles && n.getStyles() || "", i = n && n.getDesignerClass && n.getDesignerClass() || "", a = x();
function r() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0;
}
function s() {
return !1;
}
function u() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanDeleteComponent ? n.checkCanDeleteComponent() : !0;
}
function f() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : n && n.hideNestedPaddingInDesginerView ? n.hideNestedPaddingInDesginerView() : !1;
}
function c(p) {
if (!p || !p.value)
return null;
if (p.value.schema && p.value.schema.type === "component")
return p.value;
const C = x(p == null ? void 0 : p.value.parent), w = c(C);
return w || null;
}
function l(p = t) {
var _;
if (n != null && n.getDraggableDesignItemElement)
return n.getDraggableDesignItemElement(p);
const { componentInstance: C, designerItemElementRef: w } = p;
if (!C || !C.value)
return null;
const { getCustomButtons: F } = C.value;
return C.value.canMove || F && ((_ = F()) != null && _.length) ? w : l(p.parent);
}
function d(p) {
return !!n && n.canAccepts(p);
}
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 g() {
}
function I(p, C) {
var w;
!p || !C || (n != null && n.onAcceptMovedChildElement && n.onAcceptMovedChildElement(p, C), (w = t == null ? void 0 : t.setupContext) == null || w.emit("dragEnd"));
}
function b(p, C) {
const { componentType: w } = p;
let F = pn(w, p, C);
n && n.onResolveNewComponentSchema && (F = n.onResolveNewComponentSchema(p, F));
const _ = w.toLowerCase().replace(/-/g, "_");
return F && !F.id && F.type === w && (F.id = `${_}_${Math.random().toString().slice(2, 6)}`), F;
}
function h(p) {
p && n != null && n.onChildElementMovedOut && n.onChildElementMovedOut(p);
}
function y(...p) {
if (n && n.getPropsConfig)
return n.getPropsConfig(...p);
}
function T() {
n && n.onRemoveComponent && n.onRemoveComponent(), t != null && t.schema.contents && t.schema.contents.map((p) => {
let C = p.id;
p.type === "component-ref" && (C = p.component);
const w = e.value.querySelectorAll(`#${C}-design-item`);
w != null && w.length && Array.from(w).map((F) => {
var _;
(_ = F == null ? void 0 : F.componentInstance) != null && _.value.onRemoveComponent && F.componentInstance.value.onRemoveComponent();
});
});
}
function m() {
if (n && n.getCustomButtons)
return n.getCustomButtons();
}
function S(p) {
if (n && n.onPropertyChanged)
return n.onPropertyChanged(p);
}
return a.value = {
canMove: r(),
canSelectParent: s(),
canDelete: u(),
canNested: !f(),
contents: t == null ? void 0 : t.schema.contents,
elementRef: e,
parent: (M = t == null ? void 0 : t.parent) == null ? void 0 : M.componentInstance,
schema: t == null ? void 0 : t.schema,
styles: o,
designerClass: i,
canAccepts: d,
getBelongedComponentInstance: c,
getDraggableDesignItemElement: l,
getDraggingDisplayText: v,
getPropConfig: y,
getDragScopeElement: g,
onAcceptMovedChildElement: I,
onChildElementMovedOut: h,
addNewChildComponentSchema: b,
triggerBelongedComponentToMoveWhenMoved: !!n && n.triggerBelongedComponentToMoveWhenMoved || x(!1),
triggerBelongedComponentToDeleteWhenDeleted: !!n && n.triggerBelongedComponentToDeleteWhenDeleted || x(!1),
onRemoveComponent: T,
getCustomButtons: m,
onPropertyChanged: S
}, a;
}
const Ir = ["moz", "ms", "webkit"];
function Er() {
let e = 0;
return (t) => {
const n = (/* @__PURE__ */ new Date()).getTime(), o = Math.max(0, 16 - (n - e)), i = setTimeout(() => {
t(n + o);
}, o);
return e = n + o, i;
};
}
function kr() {
if (typeof window > "u")
return () => 0;
if (window.requestAnimationFrame)
return window.requestAnimationFrame.bind(window);
const e = Ir.filter((t) => `${t}RequestAnimationFrame` in window)[0];
return e ? window[`${e}RequestAnimationFrame`] : Er();
}
kr();
var Ot = /* @__PURE__ */ ((e) => (e.String = "String", e.DateTime = "DateTime", e.Date = "Date", e.Enum = "Enum", e.Boolean = "Boolean", e.Number = "Number", e.Text = "Text", e.BigNumber = "BigNumber", e))(Ot || {});
const Mr = x(0);
function Or() {
Mr.value++;
}
const bt = x(0);
function Br(e, t) {
const n = t.getBoundingClientRect(), o = e.getBoundingClientRect(), i = o.top >= n.top, a = o.top <= n.bottom;
return i && a;
}
function Vr(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 s = r.getBoundingClientRect();
a < s.left && ({ left: a } = e.getBoundingClientRect());
}
o.style.left = a + "px";
}
}
}
function Nr(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 bn(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 = Nr(e);
if (i && (o = Br(e, i)), !o) {
n.style.display = "none";
return;
}
Vr(e);
}
}
function Dr(e) {
if (!e)
return;
let t;
e.className.includes("dgComponentSelected") ? t = e : t = e.querySelector(".dgComponentSelected"), t && bn(t);
}
class Cn {
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": {
bt.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 = pt(o.contents[i]);
o.contents.splice(i, 1), o.contents.splice(i, 0, a), Or();
}
}
const Ct = class Ct {
/**
* 根据绑定字段类型获取可用的输入类控件
*/
static getEditorTypesByMDataType(t, n = "") {
let o = Ct.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 Ct.fieldControlTypeMapping)
Ct.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(Ct, "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 Bt = Ct;
class Rr {
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 $r(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 g = v.find((y) => /^col-([1-9]|10|11|12)$/.test(y)), I = v.find((y) => /^col-md-([1-9]|10|11|12)$/.test(y)), b = v.find((y) => /^col-xl-([1-9]|10|11|12)$/.test(y)), h = v.find((y) => /^col-el-([1-9]|10|11|12)$/.test(y));
g = g || "col-12", l.columnInSM = parseInt(g.replace("col-", ""), 10), l.displayWidthInSM = l.columnInSM / 12, l.displayWidthInSM !== 1 && (l.isSupportedClass = !1), I = I || "col-md-" + l.columnInSM, l.columnInMD = parseInt(I.replace("col-md-", ""), 10), l.displayWidthInMD = l.columnInMD / 6, [1, 2].includes(l.displayWidthInMD) || (l.isSupportedClass = !1), b = b || "col-xl-" + l.columnInMD, l.columnInLG = parseInt(b.replace("col-xl-", ""), 10), l.displayWidthInLG = l.columnInLG / 3, [1, 2, 3, 4].includes(l.displayWidthInLG) || (l.isSupportedClass = !1), h = h || "col-el-" + l.columnInLG, l.columnInEL = parseInt(h.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, d, v = !1) {
let g = !1;
c.contents.forEach((I) => {
if (I.type === "fieldset") {
d += 1, r(I, l, d, !0), g = !0;
return;
}
g && (d += 1, g = !1);
const b = I.appearance && I.appearance.class, h = new Rr();
b ? a(b, h) : h.isSupportedClass = !1, h.label = I.label || I.id, h.id = I.id, h.group = d, v && (h.fieldSetId = c.id), n === I.id && (t = d), o.set(I.id, I), l.push(h);
});
}
function s(c) {
const l = e.getComponentById(c);
if (!l || !l.componentType || !l.componentType.startsWith("form"))
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
const d = e.selectNode(l, (v) => v.type === tn["response-form"].type);
return !d || !d.contents || d.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: d };
}
function u(c, l) {
l = l || c.id;
const { result: d, message: v, formNode: g } = s(l);
if (!d)
return { result: d, message: v };
n = c.id, i = [], o.clear();
const I = g.contents[0].type === tn.fieldset.type ? 0 : 1;
r(g, i, I);
const b = i.find((y) => !y.isSupportedClass);
return {
defaultState: {
defaultGroupNumber: t || 1,
model: b ? "customize" : "standard"
},
importData: i
};
}
function f(c, l) {
l = l;
const { result: d, formNode: v } = s(l);
if (!d)
return "";
const g = [];
return c.forEach((I) => {
var y;
const b = o.get(I.id), h = b.appearance && b.appearance.class;
if (h) {
const m = h.split(" ").filter((F) => !F.startsWith("col-")), S = "col-" + I.columnInSM, M = "col-md-" + I.columnInMD, p = "col-xl-" + I.columnInLG, C = "col-el-" + I.columnInEL, w = [S, M, p, C].concat(m);
b.appearance.class = w.join(" ");
}
if (I.fieldSetId) {
const T = v.contents.find((S) => S.id === I.fieldSetId), m = g.find((S) => S.id === I.fieldSetId);
m ? (y = m.contents) == null || y.push(b) : (g.push(T), T.contents = [b]);
} else
g.push(b);
}), v.contents = g, v.id;
}
return {
checkCanFindFormNode: s,
checkCanOpenLayoutEditor: u,
changeFormControlsByResponseLayoutConfig: f,
getResonseFormLayoutConfig: r
};
}
var dt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function It(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 Pr = { exports: {} };
(function(e, t) {
(function(n) {
e.exports = n();
})(function() {
return (/* @__PURE__ */ function() {
function n(o, i, a) {
function r(f, c) {
if (!i[f]) {
if (!o[f]) {
var l = typeof It == "function" && It;
if (!c && l) return l(f, !0);
if (s) return s(f, !0);
var d = new Error("Cannot find module '" + f + "'");
throw d.code = "MODULE_NOT_FOUND", d;
}
var v = i[f] = { exports: {} };
o[f][0].call(v.exports, function(g) {
var I = o[f][1][g];
return r(I || g);
}, v, v.exports, n, o, i, a);
}
return i[f].exports;
}
for (var s = typeof It == "function" && It, u = 0; u < a.length; u++) r(a[u]);
return r;
}
return n;
}())({
1: [function(n, o, i) {
var a = {}, r = "(?:^|\\s)", s = "(?:\\s|$)";
function u(l) {
var d = a[l];
return d ? d.lastIndex = 0 : a[l] = d = new RegExp(r + l + s, "g"), d;
}
function f(l, d) {
var v = l.className;
v.length ? u(d).test(v) || (l.className += " " + d) : l.className = d;
}
function c(l, d) {
l.className = l.className.replace(u(d), " ").trim();
}
o.exports = {
add: f,
rm: c
};
}, {}],
2: [function(n, o, i) {
(function(a) {
var r = n("contra/emitter"), s = n("crossvent"), u = n("./classes"), f = document, c = f.documentElement;
function l(_, D) {
var V = arguments.length;
V === 1 && Array.isArray(_) === !1 && (D = _, _ = []);
var N, k, B, O, R, H, K, oe, te, pe = null, W, L, A = !1, Y = 0, Q, X = D || {};
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 = _ || []), X.isContainer === void 0 && (X.isContainer = h), 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 = f.body);
var $ = r({
containers: X.containers,
start: qe,
end: ne,
cancel: at,
remove: Ie,
destroy: xe,
canMove: Me,
dragging: !1
});
return X.removeOnSpill === !0 && $.on("over", me).on("out", ve), re(), $;
function G(j) {
return $.containers.indexOf(j) !== -1 || X.isContainer(j);
}
function re(j) {
var Z = j ? "remove" : "add";
g(c, Z, "mousedown", Te), g(c, Z, "mouseup", Ee);
}
function J(j) {
var Z = j ? "remove" : "add";
g(c, Z, "mousemove", Le);
}
function ee(j) {
var Z = j ? "remove" : "add";
s[Z](c, "selectstart", Fe), s[Z](c, "click", Fe);
}
function xe() {
re(!0), Ee({});
}
function Fe(j) {
W && j.preventDefault();
}
function Te(j) {
O = j.clientX, R = j.clientY;
var Z = I(j) !== 1 || j.metaKey || j.ctrlKey;
if (!Z) {
var U = j.target, ce = De(U);
ce && (W = ce, J(), j.type === "mousedown" && (M(U) ? U.focus() : j.preventDefault()));
}
}
function Le(j) {
if (W) {
if (I(j) === 0) {
Ee({});
return;
}
if (!(j.clientX !== void 0 && Math.abs(j.clientX - O) <= (X.slideFactorX || 0) && j.clientY !== void 0 && Math.abs(j.clientY - R) <= (X.slideFactorY || 0))) {
if (X.ignoreInputTextSelection) {
var Z = F("clientX", j) || 0, U = F("clientY", j) || 0, ce = f.elementFromPoint(Z, U);
if (M(ce))
return;
}
var ge = W;
J(!0), ee(), ne(), Ae(ge), u.add(oe || B, "gu-transit"), ke(), _e(), Y = 0, Ue(j);
}
}
}
function De(j) {
if (!($.dragging && N) && !G(j)) {
for (var Z = j; S(j) && G(S(j)) === !1; )
if (X.invalid(j, Z) || (j = S(j), !j))
return;
var U = S(j);
if (U && !X.invalid(j, Z)) {
var ce = X.moves(j, U, Z, C(j));
if (ce)
return {
item: j,
source: U
};
}
}
}
function Me(j) {
return !!De(j);
}
function qe(j) {
var Z = De(j);
Z && Ae(Z);
}
function Ae(j) {
$e(j.item, j.source) && (oe = j.item.cloneNode(!0), $.emit("cloned", oe, j.item, "copy")), k = j.source, B = j.item, H = K = C(j.item), $.dragging = !0, $.emit("drag", B, k);
}
function rt() {
return !1;
}
function ne() {
if ($.dragging) {
var j = oe || B;
Ve(j, S(j));
}
}
function be() {
W = !1, J(!0), ee(!0);
}
function Ee(j) {
if (be(), !!$.dragging) {
var Z = oe || B, U = F("clientX", j) || 0, ce = F("clientY", j) || 0, ge = b(N, U, ce), ye = ut(ge, U, ce);
ye && (oe && X.copySortSource || !oe || ye !== k) ? Ve(Z, ye) : X.removeOnSpill ? Ie() : at();
}
}
function Ve(j, Z) {
var U = S(j);
oe && X.copySortSource && Z === k && U.removeChild(B), tt(Z) ? $.emit("cancel", j, k) : $.emit("drop", j, Z, k, K), et();
}
func