UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

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