UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,431 lines 2.05 MB
var Qh = Object.defineProperty; var Zh = (e, t, n) => t in e ? Qh(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var W = (e, t, n) => Zh(e, typeof t != "symbol" ? t + "" : t, n); import { ref as g, computed as E, defineComponent as Z, provide as dt, createVNode as s, inject as oe, onMounted as ve, watch as K, Fragment as Ye, reactive as gt, createApp as xa, onUnmounted as Tt, Transition as ma, mergeProps as Pt, resolveComponent as pt, createTextVNode as J, isVNode as Xn, nextTick as Je, onBeforeMount as wn, Teleport as na, shallowRef as ua, render as ts, h as Jh, cloneVNode as ey, withModifiers as at, withDirectives as ct, vModelText as Un, getCurrentInstance as pf, onBeforeUnmount as bl, vShow as kn, resolveDirective as uo, Comment as ty, watchEffect as ny, toRaw as oy, vModelCheckbox as mf, toRefs as fi, triggerRef as ay, onUpdated as vf } from "vue"; import { cloneDeep as we, isPlainObject as Wc, isUndefined as Hs, isNaN as iy, flatten as ly, throttle as sy, isEmpty as ry, merge as _n, findIndex as qc, mergeWith as uy } from "lodash-es"; import { useResizeObserver as Ta } from "@vueuse/core"; import et from "bignumber.js"; const _i = {}, gf = {}; function Cr(e) { const { properties: t, title: n, ignore: o } = e, a = o && Array.isArray(o), i = Object.keys(t).reduce((l, u) => ((!a || !o.find((c) => c === u)) && (l[u] = t[u].type === "object" && t[u].properties ? Cr(t[u]) : we(t[u].default)), l), {}); if (n && (!a || !o.find((l) => l === "id"))) { const l = n.toLowerCase().replace(/-/g, "_"); i.id = `${l}_${Math.random().toString().slice(2, 6)}`; } return i; } function cy(e) { const { properties: t, title: n, required: o } = e; if (o && Array.isArray(o)) { const a = o.reduce((i, l) => (i[l] = t[l].type === "object" && t[l].properties ? Cr(t[l]) : we(t[l].default), i), {}); if (n && o.find((i) => i === "id")) { const i = n.toLowerCase().replace(/-/g, "_"); a.id = `${i}_${Math.random().toString().slice(2, 6)}`; } return a; } return { type: n }; } function Cn(e, t = {}, n) { const o = _i[e]; if (o) { let a = cy(o); const i = gf[e]; return a = i ? i({ getSchemaByType: Cn }, a, t, n) : a, a; } return null; } function _s(e, t) { const n = Cr(t); return Object.keys(n).reduce((o, a) => (Object.prototype.hasOwnProperty.call(e, a) && (o[a] && Wc(o[a]) && Wc(e[a] || !e[a]) ? Object.assign(o[a], e[a] || {}) : o[a] = e[a]), o), n), n; } function hf(e, t) { return Object.keys(e).filter((o) => e[o] != null).reduce((o, a) => { if (t.has(a)) { const i = t.get(a); if (typeof i == "string") o[i] = e[a]; else { const l = i(a, e[a], e); Object.assign(o, l); } } else o[a] = e[a]; return o; }, {}); } function dy(e, t, n = /* @__PURE__ */ new Map()) { const o = _s(e, t); return hf(o, n); } function yf(e) { var n; const t = e.type; if (t) { const o = _i[t]; if (!o) return e; const a = _s(e, o), i = ((n = e.editor) == null ? void 0 : n.type) || ""; if (i) { const l = _i[i], u = _s(e.editor, l); a.editor = u; } return a; } return e; } function fy(e = {}) { function t(d, p, r, f) { if (typeof r == "number") return f[d].length === r; if (typeof r == "object") { const m = Object.keys(r)[0], v = r[m]; if (m === "not") return Number(f[d].length) !== Number(v); if (m === "moreThan") return Number(f[d].length) >= Number(v); if (m === "lessThan") return Number(f[d].length) <= Number(v); } return !1; } function n(d, p, r, f) { return f[d] && f[d].propertyValue && String(f[d].propertyValue.value) === String(r); } const o = /* @__PURE__ */ new Map([ ["length", t], ["getProperty", n] ]); Object.keys(e).reduce((d, p) => (d.set(p, e[p]), d), o); function a(d, p) { const r = d; return typeof p == "number" ? [{ target: r, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: r, operator: "getProperty", param: d, value: !!p }] : typeof p == "object" ? Object.keys(p).map((f) => { if (f === "length") return { target: r, operator: "length", param: null, value: p[f] }; const m = f, v = p[f]; return { target: r, operator: "getProperty", param: m, value: v }; }) : []; } function i(d) { return Object.keys(d).reduce((r, f) => { const m = a(f, d[f]); return r.push(...m), r; }, []); } function l(d, p) { if (o.has(d.operator)) { const r = o.get(d.operator); return r && r(d.target, d.param, d.value, p) || !1; } return !1; } function u(d, p) { return i(d).reduce((m, v) => m && l(v, p), !0); } function c(d, p) { const r = Object.keys(d), f = r.includes("allOf"), m = r.includes("anyOf"), v = f || m, b = (v ? d[v ? f ? "allOf" : "anyOf" : "allOf"] : [d]).map((w) => u(w, p)); return f ? !b.includes(!1) : b.includes(!0); } return { parseValueSchema: c }; } const py = { convertTo: (e, t, n, o) => { e.appearance || (e.appearance = {}), e.appearance[t] = n; }, convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t] }, my = { convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无" }, vy = { convertTo: (e, t, n, o) => { e.editor && (e.editor[t] = n); }, convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t] }, Te = { 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: "抽屉" } }, gy = { convertFrom: (e, t, n) => { var a; const o = e.editor && e.editor[t] ? e.editor[t] : e[t]; return ((a = Te[o]) == null ? void 0 : a.name) || o; } }, hy = { convertTo: (e, t, n, o) => { e[t] = e[t]; }, convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : "" }, yy = { convertFrom: (e, t) => e.binding ? e.binding.path : "", convertTo: (e, t, n) => { if (n && n.length > 0) { const o = n[0]; e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = o.bindingField, e.binding.field = o.id, e.binding.fullPath = o.path, e.path = o.bindingPath; } } }, by = { convertTo: (e, t, n, o) => { e.pagination || (e.pagination = {}), e.pagination[t] = n; }, convertFrom: (e, t, n) => e.pagination ? e.pagination[t] : e[t] }, Cy = { convertTo: (e, t, n, o) => { e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n; }, convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t] }, wy = { convertTo: (e, t, n, o) => { e.selection || (e.selection = {}), e.selection[t] = n; }, convertFrom: (e, t, n) => e.selection ? e.selection[t] : e[t] }, Sy = { convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : "" }, xy = { convertFrom: (e, t) => e[t] || "", convertTo: (e, t, n) => { e[t] = n; } }, Cl = {}, zs = /* @__PURE__ */ new Map([ ["/converter/appearance.converter", py], ["/converter/buttons.converter", my], ["/converter/property-editor.converter", vy], ["/converter/items-count.converter", Sy], ["/converter/type.converter", gy], ["/converter/change-editor.converter", hy], ["/converter/form-group-label.converter", xy], ["/converter/field-selector.converter", yy], ["/converter/pagination.converter", by], ["/converter/row-number.converter", Cy], ["/converter/grid-selection.converter", wy] ]), Ty = {}, ky = /* @__PURE__ */ new Map([ ["string", { type: "input-group", enableClear: !1 }], ["boolean", { type: "combo-list", textField: "name", valueField: "value", idField: "value", enableClear: !1, editable: !1, maxHeight: 64, data: [ { value: !0, name: "是" }, { value: !1, name: "否" } ] }], ["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }], ["array", { type: "button-edit" }], ["number", { type: "number-spinner", placeholder: "" }], ["events-editor", { type: "events-editor", hide: !0 }] ]), Fy = fy(); function bf(e, t) { return () => Fy.parseValueSchema(e, t); } function Iy(e, t, n) { return e.includes("visible") && t.visible !== void 0 ? typeof t.visible == "boolean" ? () => !!t.visible : t.visible === void 0 ? !0 : bf(t.visible, n) : () => !0; } function My(e, t, n) { return e.includes("readonly") && t.readonly !== void 0 ? typeof t.readonly == "boolean" ? () => !!t.readonly : bf(t.readonly, n) : () => !1; } function Py(e, t) { const n = e.$converter || t; return typeof n == "string" && n && zs.has(n) ? zs.get(n) || null : n || null; } function wr(e, t, n, o, a, i = "", l = "") { return Object.keys(e).map((c) => { const d = g(1), p = c, r = e[c], f = Object.keys(r), m = r.title, v = r.type, h = ky.get(v) || { type: "input-group", enableClear: !1 }, y = r.editor ? Object.assign({}, h, r.editor) : Object.assign({}, h), b = Iy(f, r, t), C = My(f, r, t); y.readonly = y.readonly === void 0 ? C() : y.readonly; const w = r.type === "cascade" ? wr(r.properties, t, n, o, a, i, l) : [], T = !0; let k = Py(r, l); const x = E({ get() { if (d.value) { if (["class", "style"].find(($) => $ === p) && !k && (k = zs.get("/converter/appearance.converter") || null), k && k.convertFrom) return k.convertFrom(n, c, a, i); const D = n[c]; return typeof D == "string" && D === "" ? r.defaultValue || "" : D; } return null; }, set(D) { d.value += 1, k && k.convertTo ? (k.convertTo(o, c, D, a, i), k.convertTo(n, c, D, a, i)) : (o[c] = D, n[c] = D); } }), { refreshPanelAfterChanged: S, description: F, isExpand: I } = r, P = { propertyID: p, propertyName: m, propertyType: v, propertyValue: x, editor: y, visible: b, readonly: C, cascadeConfig: w, hideCascadeTitle: T, refreshPanelAfterChanged: S, description: F, isExpand: I }; return t[p] = P, P; }); } function Ey(e, t, n, o, a = "") { const i = t.$ref.schema, l = t.$ref.converter, u = n[i], c = u.type, d = yf(u), p = {}, r = Cl[c]; if (r && r.categories) { const f = r.categories[e], m = f == null ? void 0 : f.title; l && Object.keys(f.properties).forEach((y) => { f.properties[y].$converter = l; }); const v = (f == null ? void 0 : f.properties) || {}, h = wr(v, p, d, u, o, a); return { categoryId: e, categoryName: m, properties: h }; } return { categoryId: e, categoryName: "", properties: [] }; } function ns(e, t, n, o, a) { const i = e.type, l = yf(e), u = {}; let c = a || Cl[i]; if (c && Object.keys(c).length === 0 && n && n.getPropConfig && (c = n.getPropConfig(o)), c && c.categories) { const d = []; return Object.keys(c.categories).map((p) => { const r = c.categories[p]; if (r.$ref) { d.push(Ey(p, r, e, t, o)); return; } const f = r == null ? void 0 : r.title, m = r == null ? void 0 : r.tabId, v = r == null ? void 0 : r.tabName, h = r == null ? void 0 : r.hide, y = r == null ? void 0 : r.hideTitle, b = wr(r.properties || {}, u, l, e, t, o, r.$converter), { setPropertyRelates: C } = r; d.push({ categoryId: p, categoryName: f, tabId: m, tabName: v, hide: h, properties: b, hideTitle: y, setPropertyRelates: C }); }), d; } return []; } function Ie(e, t, n = /* @__PURE__ */ new Map(), o = (l, u, c, d) => u, a = {}, i = (l) => l) { return _i[t.title] = t, gf[t.title] = o, Cl[t.title] = a, Ty[t.title] = i, (l = {}, u = !0) => { if (!u) return hf(l, n); const c = dy(l, t, n), d = Object.keys(e).reduce((p, r) => (p[r] = e[r].default, p), {}); return Object.assign(d, c); }; } function Ve(e, t) { return { customClass: t.class, customStyle: t.style }; } function Oy(e, t) { const n = []; return t == null || t.buttons.map((o) => { const a = {}; Object.keys(o).map((i) => { var l; i === "appearance" ? a.class = ((l = o[i]) == null ? void 0 : l.class) || "" : a[i] = o[i]; }), n.push(a); }), { buttons: n }; } function Dy() { function e(t, n) { const { id: o } = t || {}, { field: a } = t.binding || {}; return { modelValue: n.getValue(o), "onUpdate:modelValue": (i) => { n.setValue(o, a, i); } }; } return { resolve: e }; } function By() { function e(t, n) { const { id: o } = t || {}, { dataSource: a } = t || {}; return a === void 0 ? {} : { data: n.getValue(o), "onUpdate:data": (...i) => { } }; } return { resolve: e }; } function Ay() { function e(t, n) { const { dataSource: o } = t || {}; return o === void 0 ? {} : {}; } return { resolve: e }; } function y8() { function e(t, n) { const { path: o } = t.binding || {}; return o ? { "onUpdate:dataMapping": (...a) => { } } : {}; } return { resolve: e }; } function Ry() { return (e, t, n) => { const o = t.id, { type: a } = t, i = e.emits; return i ? i.filter((l) => l !== "update:modelValue").reduce((l, u) => { const c = `on${u.charAt(0).toUpperCase()}${u.slice(1)}`; return l[c] = (...d) => { n.dispatch(o, u, a, d); }, l; }, {}) : {}; }; } function $y() { function e(t, n) { return t.selectItemById(n); } return { selectItemById: e }; } function Vy() { function e(t, n) { return t.selectItemById(n); } return { selectItemById: e }; } function Ly() { function e(t) { return t.editor; } return { resolve: e }; } function b8() { function e(t) { return Object.prototype.hasOwnProperty.call(t, "visible") ? t.visible : null; } return { resolve: e }; } function C8() { function e(t, n) { const { name: o } = n; return t[`on${o.charAt(0).toUpperCase()}${o.slice(1)}`] || t[o]; } return { resolve: e }; } function Ny() { function e(t, n) { var u; const o = (u = t.toolbar) == null ? void 0 : u.buttons; if (!o || o.length < 1) return null; const [a, i] = n.payloads, l = o.find((c) => c.id === i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function jy() { function e(t, n) { const o = t.contents; if (!o || o.length < 1) return null; const a = o.reduce((c, d) => { const p = d.toolbar && d.toolbar.buttons || []; return c.push(...p), c; }, []); if (!a || a.length < 1) return; const [i, l] = n.payloads, u = a.find((c) => c.id === l); return u ? u.onClick || u.click : null; } return { resolve: e }; } function Hy() { function e(t, n) { const o = t.buttons; if (!o || o.length < 1) return null; const [a, i] = n.payloads, l = o.find((u) => u.id === i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function _y() { function e(t, n) { var u; const o = (u = t.toolbar) == null ? void 0 : u.buttons; if (!o || o.length < 1) return null; const [a, i] = n.payloads, l = o.find((c) => c.id === i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function Cf() { function e(t, n) { const { columns: o } = n; return t.updateColumns(o); } return { updateColumns: e }; } const wf = /* @__PURE__ */ new Map([ ["appearance", Ve], ["size", (e, t) => { const n = {}; return t.width && (n.width = Number(t.width)), t.height && (n.height = Number(t.height)), n; }] ]), zy = "https://json-schema.org/draft/2020-12/schema", Wy = "https://farris-design.gitee.io/accordion.schema.json", qy = "accordion", Uy = "A Farris Container Component", Gy = "object", Yy = { id: { description: "The unique identifier for a Accordion", type: "string" }, type: { description: "The type string of Accordion component", type: "string", default: "accordion" }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} }, contents: { description: "", type: "array", default: [] }, customClass: { description: "", type: "string", default: "" }, size: { description: "", type: "object", properties: { width: { type: "number" }, height: { type: "number" } }, default: null }, enableFold: { description: "", type: "boolean", default: !0 }, expanded: { description: "", type: "boolean", default: !1 } }, Xy = [ "id", "type", "contents" ], Ky = { $schema: zy, $id: Wy, title: qy, description: Uy, type: Gy, properties: Yy, required: Xy }; function Qy(e, t, n) { return t; } const Zy = "accordion", Jy = "A Farris Component", eb = "object", tb = { basic: { description: "Basic Infomation", title: "基本信息", properties: { id: { description: "组件标识", title: "标识", type: "string", readonly: !0 }, type: { description: "组件类型", title: "控件类型", type: "select", editor: { type: "waiting for modification", enum: [] } } } } }, nb = { title: Zy, description: Jy, type: eb, categories: tb }, Sr = { customClass: { type: String, default: "" }, height: { type: Number }, width: { type: Number }, enableFold: { type: Boolean, default: !0 }, expanded: { type: Boolean, default: !1 } }, Sf = Ie(Sr, Ky, wf, Qy, nb), to = /* @__PURE__ */ Z({ name: "FAccordion", props: Sr, emits: [], setup(e, t) { const n = E(() => ({ height: e.height ? `${e.height}px` : "", width: e.width ? `${e.width}px` : "" })); dt("accordionContext", { parentProps: e }); const o = E(() => { const a = e.customClass.split(" "), i = { "farris-panel": !0, accordion: !0 }; return a.reduce((l, u) => (l[u] = !0, l), i), i; }); return () => s("div", { class: o.value, style: n.value }, [t.slots.default && t.slots.default()]); } }), ob = "https://json-schema.org/draft/2020-12/schema", ab = "https://farris-design.gitee.io/accordion-item.schema.json", ib = "AccordionItem", lb = "A Farris Container Component", sb = "object", rb = { id: { description: "The unique identifier for a Accordion Item", type: "string" }, type: { description: "The type string of Accordion Item component", type: "string" }, contents: { description: "", type: "array", default: [] }, size: { description: "", type: "object", properties: { width: { type: "number" }, height: { type: "number" } }, default: null }, title: { description: "", type: "string", default: "" }, disable: { description: "", type: "boolean", default: !1 } }, ub = [ "id", "type", "contents" ], cb = { $schema: ob, $id: ab, title: ib, description: lb, type: sb, properties: rb, required: ub }, xr = { width: { type: Number }, height: { type: Number, default: 100 }, maxHeight: { type: Number }, title: { type: String, default: "" }, disabled: { type: Boolean, default: !1 }, active: { type: Boolean, default: !1 } }, xf = Ie(xr, cb, wf), Ws = /* @__PURE__ */ Z({ name: "FAccordionItem", props: xr, emits: [], setup(e, t) { const n = oe("accordionContext"), o = g(e.title), a = g(e.active); function i() { var r; e.disabled || !((r = n == null ? void 0 : n.parentProps) != null && r.enableFold) || (a.value = !a.value); } function l(r) { i(); } const u = E(() => ({ "f-state-disabled": e.disabled, card: !0, "farris-panel-item": !0, "f-state-selected": a.value })), c = E(() => !0), d = E(() => ({ "f-icon": !0, "f-accordion-collapse": !a.value, "f-accordion-expand": a.value })), p = E(() => { const r = e.maxHeight ? { transition: "maxHeight 0.36s ease 0s", "max-height": a.value ? `${e.maxHeight}px` : 0 } : { transition: "height 0.36s ease 0s", height: a.value ? `${e.height}px` : 0 }; return a.value || (r.overflow = "hidden"), r; }); return ve(() => { var r; (r = n == null ? void 0 : n.parentProps) != null && r.expanded && (a.value = !0); }), () => s("div", { class: u.value }, [s("div", { class: "card-header", onClick: l }, [s("div", { class: "panel-item-title" }, [c.value && s("span", null, [o.value]), t.slots.head && t.slots.head(), s("span", { class: d.value }, null)]), s("div", { class: "panel-item-tool" }, [t.slots.toolbar && t.slots.toolbar()]), s("div", { class: "panel-item-clear" }, null)]), s("div", { style: p.value }, [s("div", { class: "card-body" }, [t.slots.default && t.slots.default()])])]); } }), nn = g(0); function db(e, t) { const n = t.getBoundingClientRect(), o = e.getBoundingClientRect(), a = o.top >= n.top, i = o.top <= n.bottom; return a && i; } function zi(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 a = o.getBoundingClientRect(); o.style.top = n.top + "px"; let i = n.left - a.width; const l = document.querySelector(".editorDiv"); if (l) { const u = l.getBoundingClientRect(); i < u.left && ({ left: i } = e.getBoundingClientRect()); } o.style.left = i + "px"; } } } function fb(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 Tr(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 a = fb(e); if (a && (o = db(e, a)), !o) { n.style.display = "none"; return; } zi(e); } } function qa(e) { if (!e) return; let t; e.className.includes("dgComponentSelected") ? t = e : t = e.querySelector(".dgComponentSelected"), t && Tr(t); } function pb(e) { const t = document.querySelector(".dgComponentSelected"); if (!t) return; const n = t.getBoundingClientRect(), o = e.getBoundingClientRect(), a = t.querySelector(".component-btn-group"); if (a) { const i = a.getBoundingClientRect(), l = o.top < n.top; i.top !== 0 && l && zi(t); } } const mb = { /** * 组件值 */ modelValue: { type: Object, default: {} }, componentId: { type: String, default: "" } }; var po = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function vb(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } function Ei(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 Tf = { exports: {} }; (function(e, t) { (function(n) { e.exports = n(); })(function() { return (/* @__PURE__ */ function() { function n(o, a, i) { function l(d, p) { if (!a[d]) { if (!o[d]) { var r = typeof Ei == "function" && Ei; if (!p && r) return r(d, !0); if (u) return u(d, !0); var f = new Error("Cannot find module '" + d + "'"); throw f.code = "MODULE_NOT_FOUND", f; } var m = a[d] = { exports: {} }; o[d][0].call(m.exports, function(v) { var h = o[d][1][v]; return l(h || v); }, m, m.exports, n, o, a, i); } return a[d].exports; } for (var u = typeof Ei == "function" && Ei, c = 0; c < i.length; c++) l(i[c]); return l; } return n; }())({ 1: [function(n, o, a) { var i = {}, l = "(?:^|\\s)", u = "(?:\\s|$)"; function c(r) { var f = i[r]; return f ? f.lastIndex = 0 : i[r] = f = new RegExp(l + r + u, "g"), f; } function d(r, f) { var m = r.className; m.length ? c(f).test(m) || (r.className += " " + f) : r.className = f; } function p(r, f) { r.className = r.className.replace(c(f), " ").trim(); } o.exports = { add: d, rm: p }; }, {}], 2: [function(n, o, a) { (function(i) { var l = n("contra/emitter"), u = n("crossvent"), c = n("./classes"), d = document, p = d.documentElement; function r(D, $) { var A = arguments.length; A === 1 && Array.isArray(D) === !1 && ($ = D, D = []); var O, R, M, B, L, V, N, j, z, H = null, _, Y, Q = !1, G = 0, q, U = $ || {}; U.moves === void 0 && (U.moves = C), U.accepts === void 0 && (U.accepts = C), U.invalid === void 0 && (U.invalid = Me), U.containers === void 0 && (U.containers = D || []), U.isContainer === void 0 && (U.isContainer = b), U.copy === void 0 && (U.copy = !1), U.copySortSource === void 0 && (U.copySortSource = !1), U.revertOnSpill === void 0 && (U.revertOnSpill = !1), U.removeOnSpill === void 0 && (U.removeOnSpill = !1), U.direction === void 0 && (U.direction = "vertical"), U.ignoreInputTextSelection === void 0 && (U.ignoreInputTextSelection = !0), U.mirrorContainer === void 0 && (U.mirrorContainer = d.body); var X = l({ containers: U.containers, start: ye, end: ae, cancel: lt, remove: Ke, destroy: ue, canMove: pe, dragging: !1 }); return U.removeOnSpill === !0 && X.on("over", je).on("out", Qe), ce(), X; function ee(te) { return X.containers.indexOf(te) !== -1 || U.isContainer(te); } function ce(te) { var ge = te ? "remove" : "add"; v(p, ge, "mousedown", re), v(p, ge, "mouseup", Oe); } function ie(te) { var ge = te ? "remove" : "add"; v(p, ge, "mousemove", ne); } function le(te) { var ge = te ? "remove" : "add"; u[ge](p, "selectstart", Fe), u[ge](p, "click", Fe); } function ue() { ce(!0), Oe({}); } function Fe(te) { _ && te.preventDefault(); } function re(te) { B = te.clientX, L = te.clientY; var ge = h(te) !== 1 || te.metaKey || te.ctrlKey; if (!ge) { var xe = te.target, Pe = se(xe); Pe && (_ = Pe, ie(), te.type === "mousedown" && (x(xe) ? xe.focus() : te.preventDefault())); } } function ne(te) { if (_) { if (h(te) === 0) { Oe({}); return; } if (!(te.clientX !== void 0 && Math.abs(te.clientX - B) <= (U.slideFactorX || 0) && te.clientY !== void 0 && Math.abs(te.clientY - L) <= (U.slideFactorY || 0))) { if (U.ignoreInputTextSelection) { var ge = P("clientX", te) || 0, xe = P("clientY", te) || 0, Pe = d.elementFromPoint(ge, xe); if (x(Pe)) return; } var qe = _; ie(!0), le(), ae(), fe(qe), c.add(j || M, "gu-transit"), mt(), it(), G = 0, _t(te); } } } function se(te) { if (!(X.dragging && O) && !ee(te)) { for (var ge = te; k(te) && ee(k(te)) === !1; ) if (U.invalid(te, ge) || (te = k(te), !te)) return; var xe = k(te); if (xe && !U.invalid(te, ge)) { var Pe = U.moves(te, xe, ge, F(te)); if (Pe) return { item: te, source: xe }; } } } function pe(te) { return !!se(te); } function ye(te) { var ge = se(te); ge && fe(ge); } function fe(te) { he(te.item, te.source) && (j = te.item.cloneNode(!0), X.emit("cloned", j, te.item, "copy")), R = te.source, M = te.item, V = N = F(te.item), X.dragging = !0, X.emit("drag", M, R); } function Me() { return !1; } function ae() { if (X.dragging) { var te = j || M; De(te, k(te)); } } function Ce() { _ = !1, ie(!0), le(!0); } function Oe(te) { if (Ce(), !!X.dragging) { var ge = j || M, xe = P("clientX", te) || 0, Pe = P("clientY", te) || 0, qe = y(O, xe, Pe), Ge = Zt(qe, xe, Pe); Ge && (j && U.copySortSource || !j || Ge !== R) ? De(ge, Ge) : U.removeOnSpill ? Ke() : lt(); } } function De(te, ge) { var xe = k(te); j && U.copySortSource && ge === R && xe.removeChild(M), Yt(ge) ? X.emit("cancel", te, R) : X.emit("drop", te, ge, R, N), st(); } function Ke() { if (X.dragging) { var te = j || M, ge = k(te); ge && ge.removeChild(te), X.emit(j ? "cancel" : "remove", te, ge, R), st(); } } function lt(te) { if (X.dragging) { var ge = arguments.length > 0 ? te : U.revertOnSpill, xe = j || M, Pe = k(xe), qe = Yt(Pe); qe === !1 && ge && (j ? Pe && Pe.removeChild(j) : R.insertBefore(xe, V)), qe || ge ? X.emit("cancel", xe, R, R) : X.emit("drop", xe, Pe, R, N), st(); } } function st() { var te = j || M; Ce(), At(), Rt(), te && c.rm(te, "gu-transit"), z && clearTimeout(z), X.dragging = !1, H && X.emit("out", te, H, R), X.emit("dragend", te, G), R = M = j = V = N = z = H = null; } function Yt(te, ge) { var xe; return ge !== void 0 ? xe = ge : O ? xe = N : xe = F(j || M), te === R && xe === V; } function Zt(te, ge, xe) { for (var Pe = te; Pe && !qe(); ) Pe = k(Pe); return Pe; function qe() { var Ge = ee(Pe); if (Ge === !1) return !1; var Ee = Xt(Pe, te), nt = wt(Pe, Ee, ge, xe), kt = Yt(Pe, nt); return kt ? !0 : U.accepts(M, Pe, R, nt); } } function _t(te) { if (!O) return; te.preventDefault(); var ge = P("clientX", te) || 0, xe = P("clientY", te) || 0; O.style.left = ge - 2 + "px", O.style.top = xe - 2 + "px"; var Pe = j || M, qe = y(O, ge, xe), Ge = Zt(qe, ge, xe), Ee = Ge !== null && Ge !== H; (Ee || Ge === null) && (fn(), H = Ge, An()), Ze(qe, xe); var nt = k(Pe); if (Ge === R && j && !U.copySortSource) { nt && nt.removeChild(Pe); return; } var kt, Jt = Xt(Ge, qe); if (Q = ln(Jt, Ge), Jt !== null) kt = wt(Ge, Jt, ge, xe); else if (U.revertOnSpill === !0 && !j) kt = V, Ge = R; else { j && nt && nt.removeChild(Pe), j && Y && (Y.style.display = "none"); return; } Y.style.display = "block", Be(kt, Pe, Ee), kt ? ke(Jt, kt) : He(Ge); function Nt(zt) { X.emit(zt, Pe, H, R); } function An() { Ee && Nt("over"); } function fn() { H && Nt("out"); } } function Be(te, ge, xe) { (te === ge || te === F(ge)) && (N = F(ge)), (te === null && xe || te !== ge && te !== F(ge)) && (N = te); } function je(te) { c.rm(te, "gu-hide"); } function Qe(te) { X.dragging && c.add(te, "gu-hide"); } function it() { O || (O = document.createElement("div"), O.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;", O.innerHTML = U.getMirrorText && U.getMirrorText(M) || "控件", c.add(O, "gu-mirror"), U.mirrorContainer.appendChild(O), v(p, "add", "mousemove", _t), c.add(U.mirrorContainer, "gu-unselectable"), X.emit("cloned", O, M, "mirror")); } function mt() { if (Y = document.createElement("div"), c.add(Y, "gu-insertion"), M) { var te = M.getBoundingClientRect(); Y.style.left = te.left + "px", Y.style.top = te.top + "px"; } Q = !1, U.mirrorContainer.appendChild(Y); } function At() { O && (c.rm(U.mirrorContainer, "gu-unselectable"), v(p, "remove", "mousemove", _t), k(O).removeChild(O), O = null); } function Rt() { Y && (k(Y).removeChild(Y), Y = null); } function Xt(te, ge) { for (var xe = ge; xe !== te && k(xe) !== te; ) xe = k(xe); return xe === p ? null : xe; } function ln(te, ge) { if (!ge) return Q; var xe = te || ge && ge.lastElementChild; if (!xe) return !0; var Pe = getComputedStyle(te), qe = /^inline/.test(Pe.getPropertyValue("display")) || /^(left|right)$/.test(Pe.getPropertyValue("float")); if (qe) return !0; if (ge) { var Ge = getComputedStyle(ge), Ee = Ge.getPropertyValue("display"); if (/flex$/.test(Ee)) { var nt = Ge.getPropertyValue("flex-direction") || "row"; if (nt === "row" || nt === "row-reverse") return !Lt(ge); } return !1; } return !0; } function Lt(te) { if (!te.children || !te.children.length) return !1; for (const ge of Array.from(te.children)) { const Pe = (ge.className && ge.className.split(" ") || []).filter((qe) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(qe)); if (!Pe.length) return !1; for (const qe of Pe) { const Ge = qe.slice(qe.lastIndexOf("-") + 1); if (parseInt(Ge, 10) !== 12) return !1; } } return !0; } function ke(te, ge) { const xe = ge.getBoundingClientRect(); if (Y.style.left = xe.left + "px", Y.style.top = xe.top + "px", Q) { if (Y.style.height = xe.height + "px", Y.style.width = "4px", te) { const Pe = te.getBoundingClientRect(); Pe.top !== xe.top && (Y.style.left = Pe.right + "px", Y.style.top = Pe.top + "px", Y.style.height = Pe.height + "px"); } } else if (Y.style.height = "4px", Y.style.width = xe.width + "px", q) { const Pe = q.getBoundingClientRect(); xe.top < Pe.top && (Y.style.display = "none"); } ge === M && M && (Y.style.display = "none"); } function He(te) { N = null; var ge = te.lastElementChild; if (ge) { var xe = ge.getBoundingClientRect(); Q ? (Y.style.left = xe.right + "px", Y.style.top = xe.top + "px", Y.style.height = xe.height + "px", Y.style.width = "4px") : (Y.style.left = xe.left + "px", Y.style.top = xe.bottom + "px", Y.style.height = "4px", Y.style.width = xe.width + "px"), ge === M && M && (Y.style.display = "none"); } else Y.style.display = "none"; } function Ze(te, ge) { if (!U.mirrorContainer.contains(te) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (q = f(te), !q || !q.contains(te))) return; const xe = document.querySelector(".dgComponentSelected"), Pe = q.getBoundingClientRect(); if (ge - 30 < Pe.top && q.scrollTop > 0) { let qe = q.scrollTop < 10 ? q.scrollTop : 10; q.scrollBy(0, -1 * qe), xe && q.contains(xe) && (G = G + -1 * qe); } if (ge + 30 > Pe.bottom && q.scrollTop < q.scrollHeight - q.clientHeight) { const qe = q.scrollHeight - q.clientHeight - q.scrollTop; let Ge = qe < 10 ? qe : 10; q.scrollBy(0, Ge), xe && q.contains(xe) && (G = G + Ge); } } function wt(te, ge, xe, Pe) { var qe = U.direction === "horizontal", Ge = U.direction === "mixed", Ee = ge !== te ? kt() : nt(); return Ee; function nt() { var Nt = te.children.length, An, fn, zt; for (An = 0; An < Nt; An++) if (fn = te.children[An], zt = fn.getBoundingClientRect(), qe && zt.left + zt.width / 2 > xe || !Ge && !qe && zt.top + zt.height / 2 > Pe || Ge && zt.left + zt.width > xe && zt.top + zt.height > Pe) return fn; return null; } function kt() { var Nt = ge.getBoundingClientRect(); if (Ge) { var An = Pe - Nt.top, fn = xe - Nt.left, zt = Nt.bottom - Pe, No = Nt.right - xe, jo = Math.min(fn, No, An, zt), Ho; return Q ? Ho = No < fn : Ho = zt === jo || No === jo || fn === jo, Jt(Ho); } return Jt(qe ? xe > Nt.left + w(Nt) / 2 : Pe > Nt.top + T(Nt) / 2); } function Jt(Nt) { return Nt ? F(ge) : ge; } } function he(te, ge) { return typeof U.copy == "boolean" ? U.copy : U.copy(te, ge); } } function f(D) { const $ = Array.from(window.scrollContainerList); if ($.length === 1) { const O = Array.from(window.scrollContainerList)[0]; return document.getElementById(O); } const A = m($); for (const O of A) if (O.contains(D)) return O; return null; } function m(D) { const $ = []; return D.forEach((A) => { const O = document.getElementById(A); O && $.push(O); }), $.sort((A, O) => A.contains(O) ? 1 : O.contains(A) ? -1 : 0), $; } function v(D, $, A, O) { var R = { mouseup: "touchend", mousedown: "touchstart", mousemove: "touchmove" }, M = { mouseup: "pointerup", mousedown: "pointerdown", mousemove: "pointermove" }, B = { mouseup: "MSPointerUp", mousedown: "MSPointerDown", mousemove: "MSPointerMove" }; i.navigator.pointerEnabled ? u[$](D, M[A], O) : i.navigator.msPointerEnabled ? u[$](D, B[A], O) : (u[$](D, R[A], O), u[$](D, A, O)); } function h(D) { if (D.touches !== void 0) return D.touches.length; if (D.which !== void 0 && D.which !== 0) return D.which; if (D.buttons !== void 0) return D.buttons; var $ = D.button; if ($ !== void 0) return $ & 1 ? 1 : $ & 2 ? 3 : $ & 4 ? 2 : 0; } function y(D, $, A) { D = D || {}; var O = D.className || "", R; return D.className += " gu-hide", R = d.elementFromPoint($, A), D.className = O, R; } function b() { return !1; } function C() { return !0; } function w(D) { return D.width || D.right - D.left; } function T(D) { return D.height || D.bottom - D.top; } function k(D) { return D.parentNode === d ? null : D.parentNode; } function x(D) { return D.tagName === "INPUT" || D.tagName === "TEXTAREA" || D.tagName === "SELECT" || S(D); } function S(D) { return !D || D.contentEditable === "false" ? !1 : D.contentEditable === "true" ? !0 : S(k(D)); } function F(D) { return D.nextElementSibling || $(); function $() { var A = D; do A = A.nextSibling; while (A && A.nodeType !== 1); return A; } } function I(D) { return D.targetTouches && D.targetTouches.length ? D.targetTouches[0] : D.changedTouches && D.changedTouches.length ? D.changedTouches[0] : D; } function P(D, $) { var A = I($), O = { pageX: "clientX", // IE8 pageY: "clientY" // IE8 }; return D in O && !(D in A) && O[D] in A && (D = O[D]), A[D]; } o.exports = r; }).call(this, typeof po < "u" ? po : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }], 3: [function(n, o, a) { o.exports = function(l, u) { return Array.prototype.slice.call(l, u); }; }, {}], 4: [function(n, o, a) { var i = n("ticky"); o.exports = function(u, c, d) { u && i(function() { u.apply(d || null, c || []); }); }; }, { ticky: 10 }], 5: [function(n, o, a) { var i = n("atoa"), l = n("./debounce"); o.exports = function(c, d) { var p = d || {}, r = {}; return c === void 0 && (c = {}), c.on = function(f, m) { return r[f] ? r[f].push(m) : r[f] = [m], c; }, c.once = function(f, m) { return m._once = !0, c.on(f, m), c; }, c.off = function(f, m) { var v = arguments.length; if (v === 1) delete r[f]; else if (v === 0) r = {}; else { var h = r[f]; if (!h) return c; h.splice(h.indexOf(m), 1); } return c; }, c.emit = function() { var f = i(arguments); return c.emitterSnapshot(f.shift()).apply(this, f); }, c.emitterSnapshot = function(f) { var m = (r[f] || []).slice(0); return function() { var v = i(arguments), h = this || c; if (f === "error" && p.throws !== !1 && !m.length) throw v.length === 1 ? v[0] : v; return m.forEach(function(b) { p.async ? l(b, v, h) : b.apply(h, v), b._once && c.off(f, b); }), c; }; }, c; }; }, { "./debounce": 4, atoa: 3 }], 6: [function(n, o, a) { (function(i) { var l = n("custom-event"), u = n("./eventmap"), c = i.document, d = f, p = v, r = []; i.addEventListener || (d = m, p = h), o.exports = { add: d, remove: p, fabricate: y }; function f(k, x, S, F) { return k.addEventListener(x, S, F); } function m(k, x, S) { return k.attachEvent("on" + x, C(k, x, S)); } function v(k, x, S, F) { return k.removeEventListener(x, S, F); } function h(k, x, S) { var F = w(k, x, S); if (F) return k.detachEvent("on" + x, F); } function y(k, x, S) { var F = u.indexOf(x) === -1 ? P() : I(); k.dispatchEvent ? k.dispatchEvent(F) : k.fireEvent("on" + x, F); function I() { var D; return c.createEvent ? (D = c.createEvent("Event"), D.initEvent(x, !0, !0)) : c.createEventObject && (D = c.createEventObject()), D; } function P() { return new l(x, { detail: S }); } } function b(k, x, S) { return function(I) { var P = I || i.event; P.target = P.target || P.srcElement, P.preventDefault = P.preventDefault || function() { P.returnValue = !1; }, P.stopPropagation = P.stopPropagation || function() { P.cancelBubble = !0; }, P.which = P.which || P.keyCode, S.call(k, P); }; } function C(k, x, S) { var F = w(k, x, S) || b(k, x, S); return r.push({ wrapper: F, element: k, type: x, fn: S }), F; } function w(k, x, S) { var F = T(k, x, S); if (F) { var I = r[F].wrapper; return r.splice(F, 1), I; } } function T(k, x, S) { var F, I; for (F = 0; F < r.length; F++) if (I = r[F], I.element === k && I.type === x && I.fn === S) return F; } }).call(this, typeof po < "u" ? po : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, { "./eventmap": 7, "custom-event": 8 }], 7: [function(n, o, a) { (function(i) { var l = [], u = "", c = /^on/; for (u in i) c.test(u) && l.push(u.slice(2)); o.exports = l; }).call(this, typeof po < "u" ? po : typeof self < "u" ? self : typeof window < "u" ? window : {}); }, {}], 8: [function(n, o, a) { (function(i) { var l = i.CustomEvent; function u() { try { var c = new l("cat", { detail: { foo: "bar" } }); return c.type === "cat" && c.detail.foo === "bar"; } catch { } return !1; } o.exports = u() ? l : ( // IE >= 9 typeof document < "u" && typeof document.createEvent == "function" ? fu