@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,290 lines • 320 kB
JavaScript
var Hn = Object.defineProperty;
var qn = (t, e, n) => e in t ? Hn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
var Y = (t, e, n) => qn(t, typeof e != "symbol" ? e + "" : e, n);
import { defineComponent as Ae, ref as I, computed as j, createVNode as D, watch as Se, Fragment as St, reactive as at, createApp as un, onUnmounted as Bt, onMounted as yt, Transition as cn, mergeProps as ht, createTextVNode as vt, onBeforeUnmount as dn, withDirectives as Un, resolveDirective as Yn, onBeforeMount as Xn, Teleport as Kn, shallowRef as Qn, nextTick as Ut, render as $t, h as Jn, cloneVNode as Zn, inject as gt, provide as eo, triggerRef as to, isVNode as no } from "vue";
import { isPlainObject as en, cloneDeep as ft, isUndefined as tn } from "lodash-es";
import { useResizeObserver as fn } from "@vueuse/core";
import { useIdentify as oo, useGroupData as ro, useFilter as io, useHierarchy as ao, useLoading as lo, useDataView as so, useSelection as uo, useSelectHierarchyItem as co, useDataViewContainerStyle as fo, useCommandColumn as po, useColumn as mo, useSort as ho, useGroupColumn as vo, useRow as go, useEdit as yo, useVisualDataBound as bo, useVisualDataCell as Co, useVisualDataRow as wo, useVisualData as _o, useCellPosition as So, useSidebar as To, useVirtualScroll as xo, useFitColumn as Io, useFilterHistory as Fo, useColumnFilter as Mo, useDragColumn as ko, getColumnHeader as Eo, getSidebar as Oo, getDisableMask as Bo, getHorizontalScrollbar as Vo, getVerticalScrollbar as Do, getEmpty as No } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import Ro from "../transfer/index.esm.js";
import $o from "../tabs/index.esm.js";
import Po from "../order/index.esm.js";
import "../condition/index.esm.js";
import Lo, { FCheckbox as jo } from "../checkbox/index.esm.js";
import Wo from "../filter-bar/index.esm.js";
import nn from "../tooltip/index.esm.js";
import Ao from "../pagination/index.esm.js";
import Go from "../button/index.esm.js";
import zo from "../search-box/index.esm.js";
import Ho from "../tags/index.esm.js";
import qo, { FDynamicFormGroup as Uo, FDynamicFormInput as Yo } from "../dynamic-form/index.esm.js";
import { DgControl as Wt } from "../designer-canvas/index.esm.js";
import Xo from "../binding-selector/index.esm.js";
import "../notify/index.esm.js";
import Ko from "../accordion/index.esm.js";
import Qo from "../avatar/index.esm.js";
import Jo from "../button-edit/index.esm.js";
import Zo from "../button-group/index.esm.js";
import er from "../calendar/index.esm.js";
import tr from "../capsule/index.esm.js";
import nr from "../color-picker/index.esm.js";
import At from "../combo-list/index.esm.js";
import or from "../content-container/index.esm.js";
import rr from "../data-grid/index.esm.js";
import ir from "../date-picker/index.esm.js";
import ar from "../dropdown/index.esm.js";
import "../external-container/index.esm.js";
import lr from "../events-editor/index.esm.js";
import sr from "../image-cropper/index.esm.js";
import ur from "../input-group/index.esm.js";
import cr from "../layout/index.esm.js";
import dr from "../list-nav/index.esm.js";
import fr from "../list-view/index.esm.js";
import pr from "../lookup/index.esm.js";
import mr from "../nav/index.esm.js";
import hr from "../number-spinner/index.esm.js";
import vr from "../number-range/index.esm.js";
import gr from "../page-header/index.esm.js";
import yr from "../page-footer/index.esm.js";
import br from "../progress/index.esm.js";
import Cr from "../query-solution/index.esm.js";
import wr from "../radio-group/index.esm.js";
import _r from "../rate/index.esm.js";
import Sr from "../response-toolbar/index.esm.js";
import Tr from "../response-layout/index.esm.js";
import xr from "../response-layout-editor/index.esm.js";
import Ir from "../section/index.esm.js";
import Fr from "../smoke-detector/index.esm.js";
import Mr from "../splitter/index.esm.js";
import kr from "../step/index.esm.js";
import Er from "../switch/index.esm.js";
import Or from "../text/index.esm.js";
import Br from "../time-picker/index.esm.js";
import Vr from "../tree-view/index.esm.js";
import Dr from "../uploader/index.esm.js";
import Nr from "../verify-detail/index.esm.js";
import Rr from "../component/index.esm.js";
import $r from "../video/index.esm.js";
import Pr from "../textarea/index.esm.js";
import Lr from "../tree-grid/index.esm.js";
import jr from "../fieldset/index.esm.js";
import Wr from "../drawer/index.esm.js";
import { useDateFormat as Ar, useNumberFormat as Gr, resolveField as Ye, setFieldValue as Gt, getCustomClass as Pt, withInstall as zr } from "../common/index.esm.js";
import Hr from "../combo-tree/index.esm.js";
import qr from "../field-selector/index.esm.js";
import Ur from "../mapping-editor/index.esm.js";
import Yr from "../schema-selector/index.esm.js";
import Xr from "../event-parameter/index.esm.js";
import Kr from "../filter-condition-editor/index.esm.js";
import Qr from "../sort-condition-editor/index.esm.js";
import Jr from "../menu-lookup/index.esm.js";
import { createPropsResolver as Zr } from "../dynamic-resolver/index.esm.js";
const pn = {}, mn = {};
function Yt(t) {
const { properties: e, title: n, ignore: o } = t, r = o && Array.isArray(o), a = Object.keys(e).reduce((i, u) => ((!r || !o.find((s) => s === u)) && (i[u] = e[u].type === "object" && e[u].properties ? Yt(e[u]) : ft(e[u].default)), i), {});
if (n && (!r || !o.find((i) => i === "id"))) {
const i = n.toLowerCase().replace(/-/g, "_");
a.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return a;
}
function ei(t) {
const { properties: e, title: n, required: o } = t;
if (o && Array.isArray(o)) {
const r = o.reduce((a, i) => (a[i] = e[i].type === "object" && e[i].properties ? Yt(e[i]) : ft(e[i].default), a), {});
if (n && o.find((a) => a === "id")) {
const a = n.toLowerCase().replace(/-/g, "_");
r.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return r;
}
return {
type: n
};
}
function Vt(t, e = {}, n) {
const o = pn[t];
if (o) {
let r = ei(o);
const a = mn[t];
return r = a ? a({ getSchemaByType: Vt }, r, e, n) : r, r;
}
return null;
}
function ti(t, e) {
const n = Yt(e);
return Object.keys(n).reduce((o, r) => (Object.prototype.hasOwnProperty.call(t, r) && (o[r] && en(o[r]) && en(t[r] || !t[r]) ? Object.assign(o[r], t[r] || {}) : o[r] = t[r]), o), n), n;
}
function hn(t, e) {
return Object.keys(t).filter((o) => t[o] != null).reduce((o, r) => {
if (e.has(r)) {
const a = e.get(r);
if (typeof a == "string")
o[a] = t[r];
else {
const i = a(r, t[r], t);
Object.assign(o, i);
}
} else
o[r] = t[r];
return o;
}, {});
}
function ni(t, e, n = /* @__PURE__ */ new Map()) {
const o = ti(t, e);
return hn(o, n);
}
function oi(t = {}) {
function e(p, c, l, f) {
if (typeof l == "number")
return f[p].length === l;
if (typeof l == "object") {
const g = Object.keys(l)[0], b = l[g];
if (g === "not")
return Number(f[p].length) !== Number(b);
if (g === "moreThan")
return Number(f[p].length) >= Number(b);
if (g === "lessThan")
return Number(f[p].length) <= Number(b);
}
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", e],
["getProperty", n]
]);
Object.keys(t).reduce((p, c) => (p.set(c, t[c]), p), o);
function r(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 g = f, b = c[f];
return { target: l, operator: "getProperty", param: g, value: b };
}) : [];
}
function a(p) {
return Object.keys(p).reduce((l, f) => {
const g = r(f, p[f]);
return l.push(...g), l;
}, []);
}
function i(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((g, b) => g && i(b, c), !0);
}
function s(p, c) {
const l = Object.keys(p), f = l.includes("allOf"), g = l.includes("anyOf"), b = f || g, m = (b ? p[b ? f ? "allOf" : "anyOf" : "allOf"] : [p]).map((_) => u(_, c));
return f ? !m.includes(!1) : m.includes(!0);
}
return { parseValueSchema: s };
}
const re = {
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: "抽屉" }
}, ri = {}, ii = {};
oi();
function pt(t, e, n = /* @__PURE__ */ new Map(), o = (i, u, s, p) => u, r = {}, a = (i) => i) {
return pn[e.title] = e, mn[e.title] = o, ri[e.title] = r, ii[e.title] = a, (i = {}, u = !0) => {
if (!u)
return hn(i, n);
const s = ni(i, e, n), p = Object.keys(t).reduce((c, l) => (c[l] = t[l].default, c), {});
return Object.assign(p, s);
};
}
function Tt(t, e) {
return { customClass: e.class, customStyle: e.style };
}
function ai() {
function t(e, n) {
const { dataSource: o } = e || {};
return o === void 0 ? {} : {};
}
return {
resolve: t
};
}
function li() {
function t(e, n) {
return e.selectItemById(n);
}
return {
selectItemById: t
};
}
function si() {
function t(e, n) {
const { columns: o } = n;
return e.updateColumns(o);
}
return {
updateColumns: t
};
}
const ui = /* @__PURE__ */ new Map([
["appearance", Tt]
]), ci = "https://json-schema.org/draft/2020-12/schema", di = "https://farris-design.gitee.io/fieldset.schema.json", fi = "fieldset", pi = "A Farris Container Component", mi = "object", hi = {
id: {
description: "The unique identifier for a fieldset",
type: "string"
},
type: {
description: "The type string of fieldset component",
type: "string",
default: "fieldset"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
title: {
description: "The title for a fieldset",
type: "string"
},
contents: {
description: "",
type: "array",
default: []
}
}, vi = [
"id",
"type",
"contents"
], gi = {
$schema: ci,
$id: di,
title: fi,
description: pi,
type: mi,
properties: hi,
required: vi
};
function yi(t, e, n) {
return Object.assign(e, {
appearance: {
class: "col-12"
},
title: "分组标题"
}), e;
}
const Xt = {
/** 组件自定义样式 */
customClass: { type: String, default: "" },
/** 标题 */
title: { type: String, default: "" }
}, bi = Object.assign({}, Xt, {
componentId: { type: String, default: "" }
}), on = pt(Xt, gi, ui, yi), Lt = /* @__PURE__ */ Ae({
name: "FFieldset",
props: Xt,
emits: [],
setup(t, e) {
const n = I(!0);
function o(u, s) {
u && s && s.split(" ").reduce((c, l) => (c[l] = !0, c), u);
}
const r = j(() => {
const u = {
"f-section-formgroup": !0,
"f-state-collapse": !n.value
};
return o(u, t.customClass), u;
}), a = j(() => ({
btn: !0,
"f-btn-mx": !0,
"f-btn-collapse-expand": !0,
"f-state-expand": n.value
}));
function i() {
n.value = !n.value;
}
return () => D("fieldset", {
class: r.value
}, [D("legend", {
class: "f-section-formgroup-legend"
}, [D("div", {
class: "f-header"
}, [D("div", {
class: "f-title",
onClick: i
}, [t.title]), D("div", {
class: "f-toolbar",
onClick: i
}, [D("button", {
class: a.value
}, null)])])]), D("div", {
class: "f-section-formgroup-inputs"
}, [e.slots.default && e.slots.default()])]);
}
});
function vn(t, e, n) {
var V;
const o = n && n.getStyles && n.getStyles() || "", r = n && n.getDesignerClass && n.getDesignerClass() || "", a = I();
function i() {
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0;
}
function u() {
return !1;
}
function s() {
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : n && n.checkCanDeleteComponent ? n.checkCanDeleteComponent() : !0;
}
function p() {
return (e == null ? void 0 : e.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 w = I(d == null ? void 0 : d.value.parent), S = c(w);
return S || null;
}
function l(d = e) {
var T;
if (n != null && n.getDraggableDesignItemElement)
return n.getDraggableDesignItemElement(d);
const { componentInstance: w, designerItemElementRef: S } = d;
if (!w || !w.value)
return null;
const { getCustomButtons: M } = w.value;
return w.value.canMove || M && ((T = M()) != null && T.length) ? S : l(d.parent);
}
function f(d) {
return !!n && n.canAccepts(d);
}
function g() {
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
}
function b() {
}
function N(d, w) {
var S;
!d || !w || (n != null && n.onAcceptMovedChildElement && n.onAcceptMovedChildElement(d, w), (S = e == null ? void 0 : e.setupContext) == null || S.emit("dragEnd"));
}
function y(d, w) {
const { componentType: S } = d;
let M = Vt(S, d, w);
n && n.onResolveNewComponentSchema && (M = n.onResolveNewComponentSchema(d, M));
const T = S.toLowerCase().replace(/-/g, "_");
return M && !M.id && M.type === S && (M.id = `${T}_${Math.random().toString().slice(2, 6)}`), M;
}
function m(d) {
d && n != null && n.onChildElementMovedOut && n.onChildElementMovedOut(d);
}
function v(...d) {
if (n && n.getPropsConfig)
return n.getPropsConfig(...d);
}
function _() {
n && n.onRemoveComponent && n.onRemoveComponent(), e != null && e.schema.contents && e.schema.contents.map((d) => {
let w = d.id;
d.type === "component-ref" && (w = d.component);
const S = t.value.querySelectorAll(`#${w}-design-item`);
S != null && S.length && Array.from(S).map((M) => {
var T;
(T = M == null ? void 0 : M.componentInstance) != null && T.value.onRemoveComponent && M.componentInstance.value.onRemoveComponent();
});
});
}
function h() {
if (n && n.getCustomButtons)
return n.getCustomButtons();
}
function C(d) {
if (n && n.onPropertyChanged)
return n.onPropertyChanged(d);
}
return a.value = {
canMove: i(),
canSelectParent: u(),
canDelete: s(),
canNested: !p(),
contents: e == null ? void 0 : e.schema.contents,
elementRef: t,
parent: (V = e == null ? void 0 : e.parent) == null ? void 0 : V.componentInstance,
schema: e == null ? void 0 : e.schema,
styles: o,
designerClass: r,
canAccepts: f,
getBelongedComponentInstance: c,
getDraggableDesignItemElement: l,
getDraggingDisplayText: g,
getPropConfig: v,
getDragScopeElement: b,
onAcceptMovedChildElement: N,
onChildElementMovedOut: m,
addNewChildComponentSchema: y,
triggerBelongedComponentToMoveWhenMoved: !!n && n.triggerBelongedComponentToMoveWhenMoved || I(!1),
triggerBelongedComponentToDeleteWhenDeleted: !!n && n.triggerBelongedComponentToDeleteWhenDeleted || I(!1),
onRemoveComponent: _,
getCustomButtons: h,
onPropertyChanged: C
}, a;
}
const It = I(0);
function Ci(t, e) {
const n = e.getBoundingClientRect(), o = t.getBoundingClientRect(), r = o.top >= n.top, a = o.top <= n.bottom;
return r && a;
}
function wi(t) {
const e = t.querySelector(".component-btn-group");
if (!e)
return;
e.style.display = "";
const n = e.getBoundingClientRect();
if (!(n.top === 0 && n.left === 0)) {
const o = e.querySelector("div");
if (o) {
const r = o.getBoundingClientRect();
o.style.top = n.top + "px";
let a = n.left - r.width;
const i = document.querySelector(".editorDiv");
if (i) {
const u = i.getBoundingClientRect();
a < u.left && ({ left: a } = t.getBoundingClientRect());
}
o.style.left = a + "px";
}
}
}
function _i(t) {
if (!window.scrollContainerList)
return;
const e = Array.from(window.scrollContainerList);
if (e.length && e.length === 1) {
const n = e[0], o = document.querySelector(`[id=${n}]`);
if (o && o.contains(t))
return o;
}
}
function gn(t) {
if (!t)
return;
const e = t.getBoundingClientRect();
if (e.width === 0 && e.height === 0)
return;
const n = t.querySelector(".component-btn-group");
if (n) {
let o = !0;
const r = _i(t);
if (r && (o = Ci(t, r)), !o) {
n.style.display = "none";
return;
}
wi(t);
}
}
function Si(t) {
if (!t)
return;
let e;
t.className.includes("dgComponentSelected") ? e = t : e = t.querySelector(".dgComponentSelected"), e && gn(e);
}
var ct = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function xt(t) {
throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var Ti = { exports: {} };
(function(t, e) {
(function(n) {
t.exports = n();
})(function() {
return (/* @__PURE__ */ function() {
function n(o, r, a) {
function i(p, c) {
if (!r[p]) {
if (!o[p]) {
var l = typeof xt == "function" && xt;
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 g = r[p] = { exports: {} };
o[p][0].call(g.exports, function(b) {
var N = o[p][1][b];
return i(N || b);
}, g, g.exports, n, o, r, a);
}
return r[p].exports;
}
for (var u = typeof xt == "function" && xt, s = 0; s < a.length; s++) i(a[s]);
return i;
}
return n;
}())({
1: [function(n, o, r) {
var a = {}, i = "(?:^|\\s)", u = "(?:\\s|$)";
function s(l) {
var f = a[l];
return f ? f.lastIndex = 0 : a[l] = f = new RegExp(i + l + u, "g"), f;
}
function p(l, f) {
var g = l.className;
g.length ? s(f).test(g) || (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, r) {
(function(a) {
var i = n("contra/emitter"), u = n("crossvent"), s = n("./classes"), p = document, c = p.documentElement;
function l(T, x) {
var F = arguments.length;
F === 1 && Array.isArray(T) === !1 && (x = T, T = []);
var E, k, O, B, R, $, G, q, X, pe = null, A, W, z = !1, Q = 0, ee, J = x || {};
J.moves === void 0 && (J.moves = v), J.accepts === void 0 && (J.accepts = v), J.invalid === void 0 && (J.invalid = rt), J.containers === void 0 && (J.containers = T || []), J.isContainer === void 0 && (J.isContainer = m), J.copy === void 0 && (J.copy = !1), J.copySortSource === void 0 && (J.copySortSource = !1), J.revertOnSpill === void 0 && (J.revertOnSpill = !1), J.removeOnSpill === void 0 && (J.removeOnSpill = !1), J.direction === void 0 && (J.direction = "vertical"), J.ignoreInputTextSelection === void 0 && (J.ignoreInputTextSelection = !0), J.mirrorContainer === void 0 && (J.mirrorContainer = p.body);
var P = i({
containers: J.containers,
start: He,
end: oe,
cancel: it,
remove: Fe,
destroy: Te,
canMove: Ee,
dragging: !1
});
return J.removeOnSpill === !0 && P.on("over", me).on("out", ve), ae(), P;
function U(L) {
return P.containers.indexOf(L) !== -1 || J.isContainer(L);
}
function ae(L) {
var Z = L ? "remove" : "add";
b(c, Z, "mousedown", xe), b(c, Z, "mouseup", Me);
}
function te(L) {
var Z = L ? "remove" : "add";
b(c, Z, "mousemove", je);
}
function ne(L) {
var Z = L ? "remove" : "add";
u[Z](c, "selectstart", Ie), u[Z](c, "click", Ie);
}
function Te() {
ae(!0), Me({});
}
function Ie(L) {
A && L.preventDefault();
}
function xe(L) {
B = L.clientX, R = L.clientY;
var Z = N(L) !== 1 || L.metaKey || L.ctrlKey;
if (!Z) {
var K = L.target, ce = Ne(K);
ce && (A = ce, te(), L.type === "mousedown" && (V(K) ? K.focus() : L.preventDefault()));
}
}
function je(L) {
if (A) {
if (N(L) === 0) {
Me({});
return;
}
if (!(L.clientX !== void 0 && Math.abs(L.clientX - B) <= (J.slideFactorX || 0) && L.clientY !== void 0 && Math.abs(L.clientY - R) <= (J.slideFactorY || 0))) {
if (J.ignoreInputTextSelection) {
var Z = M("clientX", L) || 0, K = M("clientY", L) || 0, ce = p.elementFromPoint(Z, K);
if (V(ce))
return;
}
var ge = A;
te(!0), ne(), oe(), Ge(ge), s.add(q || O, "gu-transit"), ke(), _e(), Q = 0, qe(L);
}
}
}
function Ne(L) {
if (!(P.dragging && E) && !U(L)) {
for (var Z = L; C(L) && U(C(L)) === !1; )
if (J.invalid(L, Z) || (L = C(L), !L))
return;
var K = C(L);
if (K && !J.invalid(L, Z)) {
var ce = J.moves(L, K, Z, w(L));
if (ce)
return {
item: L,
source: K
};
}
}
}
function Ee(L) {
return !!Ne(L);
}
function He(L) {
var Z = Ne(L);
Z && Ge(Z);
}
function Ge(L) {
$e(L.item, L.source) && (q = L.item.cloneNode(!0), P.emit("cloned", q, L.item, "copy")), k = L.source, O = L.item, $ = G = w(L.item), P.dragging = !0, P.emit("drag", O, k);
}
function rt() {
return !1;
}
function oe() {
if (P.dragging) {
var L = q || O;
Ve(L, C(L));
}
}
function be() {
A = !1, te(!0), ne(!0);
}
function Me(L) {
if (be(), !!P.dragging) {
var Z = q || O, K = M("clientX", L) || 0, ce = M("clientY", L) || 0, ge = y(E, K, ce), ye = st(ge, K, ce);
ye && (q && J.copySortSource || !q || ye !== k) ? Ve(Z, ye) : J.removeOnSpill ? Fe() : it();
}
}
function Ve(L, Z) {
var K = C(L);
q && J.copySortSource && Z === k && K.removeChild(O), et(Z) ? P.emit("cancel", L, k) : P.emit("drop", L, Z, k, G), Ze();
}
function Fe() {
if (P.dragging) {
var L = q || O, Z = C(L);
Z && Z.removeChild(L), P.emit(q ? "cancel" : "remove", L, Z, k), Ze();
}
}
function it(L) {
if (P.dragging) {
var Z = arguments.length > 0 ? L : J.revertOnSpill, K = q || O, ce = C(K), ge = et(ce);
ge === !1 && Z && (q ? ce && ce.removeChild(q) : k.insertBefore(K, $)), ge || Z ? P.emit("cancel", K, k, k) : P.emit("drop", K, ce, k, G), Ze();
}
}
function Ze() {
var L = q || O;
be(), Re(), ze(), L && s.rm(L, "gu-transit"), X && clearTimeout(X), P.dragging = !1, pe && P.emit("out", L, pe, k), P.emit("dragend", L, Q), k = O = q = $ = G = X = pe = null;
}
function et(L, Z) {
var K;
return Z !== void 0 ? K = Z : E ? K = G : K = w(q || O), L === k && K === $;
}
function st(L, Z, K) {
for (var ce = L; ce && !ge(); )
ce = C(ce);
return ce;
function ge() {
var ye = U(ce);
if (ye === !1)
return !1;
var le = tt(ce, L), we = Be(ce, le, Z, K), De = et(ce, we);
return De ? !0 : J.accepts(O, ce, k, we);
}
}
function qe(L) {
if (!E)
return;
L.preventDefault();
var Z = M("clientX", L) || 0, K = M("clientY", L) || 0;
E.style.left = Z - 2 + "px", E.style.top = K - 2 + "px";
var ce = q || O, ge = y(E, Z, K), ye = st(ge, Z, K), le = ye !== null && ye !== pe;
(le || ye === null) && (Ke(), pe = ye, ut()), Ce(ge, K);
var we = C(ce);
if (ye === k && q && !J.copySortSource) {
we && we.removeChild(ce);
return;
}
var De, Xe = tt(ye, ge);
if (z = nt(Xe, ye), Xe !== null)
De = Be(ye, Xe, Z, K);
else if (J.revertOnSpill === !0 && !q)
De = $, ye = k;
else {
q && we && we.removeChild(ce), q && W && (W.style.display = "none");
return;
}
W.style.display = "block", ie(De, ce, le), De ? H(Xe, De) : he(ye);
function Pe(We) {
P.emit(We, ce, pe, k);
}
function ut() {
le && Pe("over");
}
function Ke() {
pe && Pe("out");
}
}
function ie(L, Z, K) {
(L === Z || L === w(Z)) && (G = w(Z)), (L === null && K || L !== Z && L !== w(Z)) && (G = L);
}
function me(L) {
s.rm(L, "gu-hide");
}
function ve(L) {
P.dragging && s.add(L, "gu-hide");
}
function _e() {
E || (E = document.createElement("div"), E.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;", E.innerHTML = J.getMirrorText && J.getMirrorText(O) || "控件", s.add(E, "gu-mirror"), J.mirrorContainer.appendChild(E), b(c, "add", "mousemove", qe), s.add(J.mirrorContainer, "gu-unselectable"), P.emit("cloned", E, O, "mirror"));
}
function ke() {
if (W = document.createElement("div"), s.add(W, "gu-insertion"), O) {
var L = O.getBoundingClientRect();
W.style.left = L.left + "px", W.style.top = L.top + "px";
}
z = !1, J.mirrorContainer.appendChild(W);
}
function Re() {
E && (s.rm(J.mirrorContainer, "gu-unselectable"), b(c, "remove", "mousemove", qe), C(E).removeChild(E), E = null);
}
function ze() {
W && (C(W).removeChild(W), W = null);
}
function tt(L, Z) {
for (var K = Z; K !== L && C(K) !== L; )
K = C(K);
return K === c ? null : K;
}
function nt(L, Z) {
if (!Z)
return z;
var K = L || Z && Z.lastElementChild;
if (!K)
return !0;
var ce = getComputedStyle(L), ge = /^inline/.test(ce.getPropertyValue("display")) || /^(left|right)$/.test(ce.getPropertyValue("float"));
if (ge)
return !0;
if (Z) {
var ye = getComputedStyle(Z), le = ye.getPropertyValue("display");
if (/flex$/.test(le)) {
var we = ye.getPropertyValue("flex-direction") || "row";
if (we === "row" || we === "row-reverse")
return !Ue(Z);
}
return !1;
}
return !0;
}
function Ue(L) {
if (!L.children || !L.children.length)
return !1;
for (const Z of Array.from(L.children)) {
const ce = (Z.className && Z.className.split(" ") || []).filter((ge) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(ge));
if (!ce.length)
return !1;
for (const ge of ce) {
const ye = ge.slice(ge.lastIndexOf("-") + 1);
if (parseInt(ye, 10) !== 12)
return !1;
}
}
return !0;
}
function H(L, Z) {
const K = Z.getBoundingClientRect();
if (W.style.left = K.left + "px", W.style.top = K.top + "px", z) {
if (W.style.height = K.height + "px", W.style.width = "4px", L) {
const ce = L.getBoundingClientRect();
ce.top !== K.top && (W.style.left = ce.right + "px", W.style.top = ce.top + "px", W.style.height = ce.height + "px");
}
} else if (W.style.height = "4px", W.style.width = K.width + "px", ee) {
const ce = ee.getBoundingClientRect();
K.top < ce.top && (W.style.display = "none");
}
Z === O && O && (W.style.display = "none");
}
function he(L) {
G = null;
var Z = L.lastElementChild;
if (Z) {
var K = Z.getBoundingClientRect();
z ? (W.style.left = K.right + "px", W.style.top = K.top + "px", W.style.height = K.height + "px", W.style.width = "4px") : (W.style.left = K.left + "px", W.style.top = K.bottom + "px", W.style.height = "4px", W.style.width = K.width + "px"), Z === O && O && (W.style.display = "none");
} else
W.style.display = "none";
}
function Ce(L, Z) {
if (!J.mirrorContainer.contains(L) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (ee = f(L), !ee || !ee.contains(L)))
return;
const K = document.querySelector(".dgComponentSelected"), ce = ee.getBoundingClientRect();
if (Z - 30 < ce.top && ee.scrollTop > 0) {
let ge = ee.scrollTop < 10 ? ee.scrollTop : 10;
ee.scrollBy(0, -1 * ge), K && ee.contains(K) && (Q = Q + -1 * ge);
}
if (Z + 30 > ce.bottom && ee.scrollTop < ee.scrollHeight - ee.clientHeight) {
const ge = ee.scrollHeight - ee.clientHeight - ee.scrollTop;
let ye = ge < 10 ? ge : 10;
ee.scrollBy(0, ye), K && ee.contains(K) && (Q = Q + ye);
}
}
function Be(L, Z, K, ce) {
var ge = J.direction === "horizontal", ye = J.direction === "mixed", le = Z !== L ? De() : we();
return le;
function we() {
var Pe = L.children.length, ut, Ke, We;
for (ut = 0; ut < Pe; ut++)
if (Ke = L.children[ut], We = Ke.getBoundingClientRect(), ge && We.left + We.width / 2 > K || !ye && !ge && We.top + We.height / 2 > ce || ye && We.left + We.width > K && We.top + We.height > ce)
return Ke;
return null;
}
function De() {
var Pe = Z.getBoundingClientRect();
if (ye) {
var ut = ce - Pe.top, Ke = K - Pe.left, We = Pe.bottom - ce, Dt = Pe.right - K, Nt = Math.min(Ke, Dt, ut, We), Rt;
return z ? Rt = Dt < Ke : Rt = We === Nt || Dt === Nt || Ke === Nt, Xe(Rt);
}
return Xe(ge ? K > Pe.left + _(Pe) / 2 : ce > Pe.top + h(Pe) / 2);
}
function Xe(Pe) {
return Pe ? w(Z) : Z;
}
}
function $e(L, Z) {
return typeof J.copy == "boolean" ? J.copy : J.copy(L, Z);
}
}
function f(T) {
const x = Array.from(window.scrollContainerList);
if (x.length === 1) {
const E = Array.from(window.scrollContainerList)[0];
return document.getElementById(E);
}
const F = g(x);
for (const E of F)
if (E.contains(T))
return E;
return null;
}
function g(T) {
const x = [];
return T.forEach((F) => {
const E = document.getElementById(F);
E && x.push(E);
}), x.sort((F, E) => F.contains(E) ? 1 : E.contains(F) ? -1 : 0), x;
}
function b(T, x, F, E) {
var k = {
mouseup: "touchend",
mousedown: "touchstart",
mousemove: "touchmove"
}, O = {
mouseup: "pointerup",
mousedown: "pointerdown",
mousemove: "pointermove"
}, B = {
mouseup: "MSPointerUp",
mousedown: "MSPointerDown",
mousemove: "MSPointerMove"
};
a.navigator.pointerEnabled ? u[x](T, O[F], E) : a.navigator.msPointerEnabled ? u[x](T, B[F], E) : (u[x](T, k[F], E), u[x](T, F, E));
}
function N(T) {
if (T.touches !== void 0)
return T.touches.length;
if (T.which !== void 0 && T.which !== 0)
return T.which;
if (T.buttons !== void 0)
return T.buttons;
var x = T.button;
if (x !== void 0)
return x & 1 ? 1 : x & 2 ? 3 : x & 4 ? 2 : 0;
}
function y(T, x, F) {
T = T || {};
var E = T.className || "", k;
return T.className += " gu-hide", k = p.elementFromPoint(x, F), T.className = E, k;
}
function m() {
return !1;
}
function v() {
return !0;
}
function _(T) {
return T.width || T.right - T.left;
}
function h(T) {
return T.height || T.bottom - T.top;
}
function C(T) {
return T.parentNode === p ? null : T.parentNode;
}
function V(T) {
return T.tagName === "INPUT" || T.tagName === "TEXTAREA" || T.tagName === "SELECT" || d(T);
}
function d(T) {
return !T || T.contentEditable === "false" ? !1 : T.contentEditable === "true" ? !0 : d(C(T));
}
function w(T) {
return T.nextElementSibling || x();
function x() {
var F = T;
do
F = F.nextSibling;
while (F && F.nodeType !== 1);
return F;
}
}
function S(T) {
return T.targetTouches && T.targetTouches.length ? T.targetTouches[0] : T.changedTouches && T.changedTouches.length ? T.changedTouches[0] : T;
}
function M(T, x) {
var F = S(x), E = {
pageX: "clientX",
// IE8
pageY: "clientY"
// IE8
};
return T in E && !(T in F) && E[T] in F && (T = E[T]), F[T];
}
o.exports = l;
}).call(this, typeof ct < "u" ? ct : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }],
3: [function(n, o, r) {
o.exports = function(i, u) {
return Array.prototype.slice.call(i, u);
};
}, {}],
4: [function(n, o, r) {
var a = n("ticky");
o.exports = function(u, s, p) {
u && a(function() {
u.apply(p || null, s || []);
});
};
}, { ticky: 10 }],
5: [function(n, o, r) {
var a = n("atoa"), i = n("./debounce");
o.exports = function(s, p) {
var c = p || {}, l = {};
return s === void 0 && (s = {}), s.on = function(f, g) {
return l[f] ? l[f].push(g) : l[f] = [g], s;
}, s.once = function(f, g) {
return g._once = !0, s.on(f, g), s;
}, s.off = function(f, g) {
var b = arguments.length;
if (b === 1)
delete l[f];
else if (b === 0)
l = {};
else {
var N = l[f];
if (!N)
return s;
N.splice(N.indexOf(g), 1);
}
return s;
}, s.emit = function() {
var f = a(arguments);
return s.emitterSnapshot(f.shift()).apply(this, f);
}, s.emitterSnapshot = function(f) {
var g = (l[f] || []).slice(0);
return function() {
var b = a(arguments), N = this || s;
if (f === "error" && c.throws !== !1 && !g.length)
throw b.length === 1 ? b[0] : b;
return g.forEach(function(m) {
c.async ? i(m, b, N) : m.apply(N, b), m._once && s.off(f, m);
}), s;
};
}, s;
};
}, { "./debounce": 4, atoa: 3 }],
6: [function(n, o, r) {
(function(a) {
var i = n("custom-event"), u = n("./eventmap"), s = a.document, p = f, c = b, l = [];
a.addEventListener || (p = g, c = N), o.exports = {
add: p,
remove: c,
fabricate: y
};
function f(C, V, d, w) {
return C.addEventListener(V, d, w);
}
function g(C, V, d) {
return C.attachEvent("on" + V, v(C, V, d));
}
function b(C, V, d, w) {
return C.removeEventListener(V, d, w);
}
function N(C, V, d) {
var w = _(C, V, d);
if (w)
return C.detachEvent("on" + V, w);
}
function y(C, V, d) {
var w = u.indexOf(V) === -1 ? M() : S();
C.dispatchEvent ? C.dispatchEvent(w) : C.fireEvent("on" + V, w);
function S() {
var T;
return s.createEvent ? (T = s.createEvent("Event"), T.initEvent(V, !0, !0)) : s.createEventObject && (T = s.createEventObject()), T;
}
function M() {
return new i(V, { detail: d });
}
}
function m(C, V, d) {
return function(S) {
var M = S || a.event;
M.target = M.target || M.srcElement, M.preventDefault = M.preventDefault || function() {
M.returnValue = !1;
}, M.stopPropagation = M.stopPropagation || function() {
M.cancelBubble = !0;
}, M.which = M.which || M.keyCode, d.call(C, M);
};
}
function v(C, V, d) {
var w = _(C, V, d) || m(C, V, d);
return l.push({
wrapper: w,
element: C,
type: V,
fn: d
}), w;
}
function _(C, V, d) {
var w = h(C, V, d);
if (w) {
var S = l[w].wrapper;
return l.splice(w, 1), S;
}
}
function h(C, V, d) {
var w, S;
for (w = 0; w < l.length; w++)
if (S = l[w], S.element === C && S.type === V && S.fn === d)
return w;
}
}).call(this, typeof ct < "u" ? ct : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, { "./eventmap": 7, "custom-event": 8 }],
7: [function(n, o, r) {
(function(a) {
var i = [], u = "", s = /^on/;
for (u in a)
s.test(u) && i.push(u.slice(2));
o.exports = i;
}).call(this, typeof ct < "u" ? ct : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, {}],
8: [function(n, o, r) {
(function(a) {
var i = a.CustomEvent;
function u() {
try {
var s = new i("cat", { detail: { foo: "bar" } });
return s.type === "cat" && s.detail.foo === "bar";
} catch {
}
return !1;
}
o.exports = u() ? i : (
// IE >= 9
typeof document < "u" && typeof document.createEvent == "function" ? function(p, c) {
var l = document.createEvent("CustomEvent");
return c ? l.initCustomEvent(p, c.bubbles, c.cancelable, c.detail) : l.initCustomEvent(p, !1, !1, void 0), l;
} : (
// IE <= 8
function(p, c) {
var l = document.createEventObject();
return l.type = p, c ? (l.bubbles = !!c.bubbles, l.cancelable = !!c.cancelable, l.detail = c.detail) : (l.bubbles = !1, l.cancelable = !1, l.detail = void 0), l;
}
)
);
}).call(this, typeof ct < "u" ? ct : typeof self < "u" ? self : typeof window < "u" ? window : {});
}, {}],
9: [function(n, o, r) {
var a = o.exports = {}, i, u;
function s() {
throw new Error("setTimeout has not been defined");
}
function p() {
throw new Error("clearTimeout has not been defined");
}
(function() {
try {
typeof setTimeout == "function" ? i = setTimeout : i = s;
} catch {
i = s;
}
try {
typeof clearTimeout == "function" ? u = clearTimeout : u = p;
} catch {
u = p;
}
})();
function c(h) {
if (i === setTimeout)
return setTimeout(h, 0);
if ((i === s || !i) && setTimeout)
return i = setTimeout, setTimeout(h, 0);
try {
return i(h, 0);
} catch {
try {
return i.call(null, h, 0);
} catch {
return i.call(this, h, 0);
}
}
}
function l(h) {
if (u === clearTimeout)
return clearTimeout(h);
if ((u === p || !u) && clearTimeout)
return u = clearTimeout, clearTimeout(h);
try {
return u(h);
} catch {
try {
return u.call(null, h);
} catch {
return u.call(this, h);
}
}
}
var f = [], g = !1, b, N = -1;
function y() {
!g || !b || (g = !1, b.length ? f = b.concat(f) : N = -1, f.length && m());
}
function m() {
if (!g) {
var h = c(y);
g = !0;
for (var C = f.length; C; ) {
for (b = f, f = []; ++N < C; )
b && b[N].run();
N = -1, C = f.length;
}
b = null, g = !1, l(h);
}
}
a.nextTick = function(h) {
var C = new Array(arguments.length - 1);
if (arguments.length > 1)
for (var V = 1; V < arguments.length; V++)
C[V - 1] = arguments[V];
f.push(new v(h, C)), f.length === 1 && !g && c(m);
};
function v(h, C) {
this.fun = h, this.array = C;
}
v.prototype.run = function() {
this.fun.apply(null, this.array);
}, a.title = "browser", a.browser = !0, a.env = {}, a.argv = [], a.version = "", a.versions = {};
function _() {
}
a.on = _, a.addListener = _, a.once = _, a.off = _, a.removeListener = _, a.removeAllListeners = _, a.emit = _, a.prependListener = _, a.prependOnceListener = _, a.listeners = function(h) {
return [];
}, a.binding = function(h) {
throw new Error("process.binding is not supported");
}, a.cwd = function() {
return "/";
}, a.chdir = function(h) {
throw new Error("process.chdir is not supported");
}, a.umask = function() {
return 0;
};
}, {}],
10: [function(n, o, r) {
(function(a) {
var i = typeof a == "function", u;
i ? u = function(s) {
a(s);
} : u = function(s) {
setTimeout(s, 0);
}, o.exports = u;
}).call(this, n("timers").setImmediate);
}, { timers: 11 }],
11: [function(n, o, r) {
(function(a, i) {
var u = n("process/browser.js").nextTick, s = Function.prototype.apply, p = Array.prototype.slice, c = {}, l = 0;
r.setTimeout = function() {
return new f(s.call(setTimeout, window, arguments), clearTimeout);
}, r.setInterval = function() {
return new f(s.call(setInterval, window, arguments), clearInterval);
}, r.clearTimeout = r.clearInterval = function(g) {
g.close();
};
function f(g, b) {
this._id = g, this._clearFn = b;
}
f.prototype.unref = f.prototype.ref = function() {
}, f.prototype.close = function() {
this._clearFn.call(window, this._id);
}, r.enroll = function(g, b) {
clearTimeout(g._idleTimeoutId), g._idleTimeout = b;
}, r.unenroll = function(g) {
clearTimeout(g._idleTimeoutId), g._idleTimeout = -1;
}, r._unrefActive = r.active = function(g) {
clearTimeout(g._idleTimeoutId);
var b = g._idleTimeout;
b >= 0 && (g._idleTimeoutId = setTimeout(function() {
g._onTimeout && g._onTimeout();
}, b));
}, r.setImmediate = typeof a == "function" ? a : function(g) {
var b = l++, N = arguments.length < 2 ? !1 : p.call(arguments, 1);
return c[b] = !0, u(function() {
c[b] && (N ? g.apply(null, N) : g.call(null), r.clearImmediate(b));
}), b;
}, r.clearImmediate = typeof i == "function" ? i : function(g) {
delete c[g];
};
}).call(this, n("timers").setImmediate, n("timers").clearImmediate);
}, { "process/browser.js": 9, timers: 11 }]
}, {}, [2])(2);
});
})(Ti);
const xi = {
showCloseButton: { type: Boolean, default: !0 },
position: { type: String, default: "top-center" },
timeout: { type: Number, default: 3e3 },
theme: { type: String, default: "bootstrap"