UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,184 lines 317 kB
var Wn = Object.defineProperty; var Gn = (e, t, n) => t in e ? Wn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var q = (e, t, n) => Gn(e, typeof t != "symbol" ? t + "" : t, n); import { ref as x, computed as $, defineComponent as He, createVNode as E, watch as _e, Fragment as _t, reactive as at, createApp as rn, onUnmounted as Ot, onMounted as yt, Transition as an, mergeProps as mt, createTextVNode as ht, onBeforeUnmount as ln, withDirectives as zn, resolveDirective as qn, onBeforeMount as Un, Teleport as Yn, shallowRef as Xn, nextTick as zt, render as Rt, h as Qn, cloneVNode as Kn, inject as vt, provide as Zn, triggerRef as Jn, isVNode as eo } from "vue"; import { isPlainObject as Kt, cloneDeep as dt, isUndefined as Zt } from "lodash-es"; import { resolveAppearance as to, createPropsResolver as no } from "../dynamic-resolver/index.esm.js"; import { DgControl as Jt, useDesignerComponent as oo } from "../designer-canvas/index.esm.js"; import { useDateFormat as ro, useNumberFormat as io, resolveField as Ye, setFieldValue as Lt, getCustomClass as Pt, withInstall as sn, FormSchemaEntityField$Type as en, FormSchemaEntityFieldType$Type as ao } from "../common/index.esm.js"; import { useResizeObserver as un } from "@vueuse/core"; import { useIdentify as lo, useGroupData as so, useFilter as uo, useHierarchy as co, useLoading as fo, useDataView as po, useSelection as mo, useSelectHierarchyItem as ho, useDataViewContainerStyle as vo, useCommandColumn as go, useColumn as yo, useSort as bo, useGroupColumn as Co, useRow as wo, useEdit as So, useVisualDataBound as _o, useVisualDataCell as xo, useVisualDataRow as To, useVisualData as Fo, useCellPosition as Ao, useSidebar as Eo, useVirtualScroll as Io, useFitColumn as ko, useFilterHistory as Mo, useColumnFilter as Oo, useDragColumn as Bo, getColumnHeader as Vo, getSidebar as Do, getDisableMask as No, getHorizontalScrollbar as Ro, getVerticalScrollbar as Po, getEmpty as $o } from "../data-view/index.esm.js"; import "../modal/index.esm.js"; import Lo from "../transfer/index.esm.js"; import jo from "../tabs/index.esm.js"; import Ho from "../order/index.esm.js"; import "../condition/index.esm.js"; import Wo, { FCheckbox as Go } from "../checkbox/index.esm.js"; import zo from "../filter-bar/index.esm.js"; import tn from "../tooltip/index.esm.js"; import qo from "../pagination/index.esm.js"; import Uo from "../button/index.esm.js"; import Yo from "../search-box/index.esm.js"; import Xo from "../tags/index.esm.js"; import Qo, { FDynamicFormGroup as Ko, FDynamicFormInput as Zo } from "../dynamic-form/index.esm.js"; import Jo from "../binding-selector/index.esm.js"; import "../notify/index.esm.js"; import er from "../accordion/index.esm.js"; import tr from "../avatar/index.esm.js"; import nr from "../button-edit/index.esm.js"; import or from "../button-group/index.esm.js"; import rr from "../calendar/index.esm.js"; import ir from "../capsule/index.esm.js"; import ar from "../color-picker/index.esm.js"; import jt from "../combo-list/index.esm.js"; import lr from "../content-container/index.esm.js"; import sr from "../data-grid/index.esm.js"; import ur from "../date-picker/index.esm.js"; import cr from "../dropdown/index.esm.js"; import "../external-container/index.esm.js"; import dr from "../events-editor/index.esm.js"; import fr from "../image-cropper/index.esm.js"; import pr from "../input-group/index.esm.js"; import mr from "../layout/index.esm.js"; import hr from "../list-nav/index.esm.js"; import vr from "../list-view/index.esm.js"; import gr from "../lookup/index.esm.js"; import yr from "../nav/index.esm.js"; import br from "../number-spinner/index.esm.js"; import Cr from "../number-range/index.esm.js"; import wr from "../page-header/index.esm.js"; import Sr from "../page-footer/index.esm.js"; import _r from "../progress/index.esm.js"; import xr from "../query-solution/index.esm.js"; import Tr from "../radio-group/index.esm.js"; import Fr from "../rate/index.esm.js"; import Ar from "../response-toolbar/index.esm.js"; import Er from "../response-layout/index.esm.js"; import Ir from "../response-layout-editor/index.esm.js"; import kr from "../section/index.esm.js"; import Mr from "../smoke-detector/index.esm.js"; import Or from "../splitter/index.esm.js"; import Br from "../step/index.esm.js"; import Vr from "../switch/index.esm.js"; import Dr from "../text/index.esm.js"; import Nr from "../time-picker/index.esm.js"; import Rr from "../tree-view/index.esm.js"; import Pr from "../uploader/index.esm.js"; import $r from "../verify-detail/index.esm.js"; import Lr from "../component/index.esm.js"; import jr from "../video/index.esm.js"; import Hr from "../textarea/index.esm.js"; import Wr from "../tree-grid/index.esm.js"; import Gr from "../fieldset/index.esm.js"; import zr from "../drawer/index.esm.js"; import qr from "../combo-tree/index.esm.js"; import Ur from "../field-selector/index.esm.js"; import Yr from "../mapping-editor/index.esm.js"; import Xr from "../schema-selector/index.esm.js"; import Qr from "../event-parameter/index.esm.js"; import Kr from "../filter-condition-editor/index.esm.js"; import Zr from "../sort-condition-editor/index.esm.js"; import Jr from "../menu-lookup/index.esm.js"; const cn = {}, dn = {}; function qt(e) { const { properties: t, title: n, ignore: o } = e, r = o && Array.isArray(o), a = Object.keys(t).reduce((i, u) => ((!r || !o.find((s) => s === u)) && (i[u] = t[u].type === "object" && t[u].properties ? qt(t[u]) : dt(t[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(e) { const { properties: t, title: n, required: o } = e; if (o && Array.isArray(o)) { const r = o.reduce((a, i) => (a[i] = t[i].type === "object" && t[i].properties ? qt(t[i]) : dt(t[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 fn(e, t = {}, n) { const o = cn[e]; if (o) { let r = ei(o); const a = dn[e]; return r = a ? a({ getSchemaByType: fn }, r, t, n) : r, r; } return null; } function ti(e, t) { const n = qt(t); return Object.keys(n).reduce((o, r) => (Object.prototype.hasOwnProperty.call(e, r) && (o[r] && Kt(o[r]) && Kt(e[r] || !e[r]) ? Object.assign(o[r], e[r] || {}) : o[r] = e[r]), o), n), n; } function pn(e, t) { return Object.keys(e).filter((o) => e[o] != null).reduce((o, r) => { if (t.has(r)) { const a = t.get(r); if (typeof a == "string") o[a] = e[r]; else { const i = a(r, e[r], e); Object.assign(o, i); } } else o[r] = e[r]; return o; }, {}); } function ni(e, t, n = /* @__PURE__ */ new Map()) { const o = ti(e, t); return pn(o, n); } function oi(e = {}) { function t(p, c, l, f) { if (typeof l == "number") return f[p].length === l; if (typeof l == "object") { const h = Object.keys(l)[0], g = l[h]; if (h === "not") return Number(f[p].length) !== Number(g); if (h === "moreThan") return Number(f[p].length) >= Number(g); if (h === "lessThan") return Number(f[p].length) <= Number(g); } return !1; } function n(p, c, l, f) { return f[p] && f[p].propertyValue && String(f[p].propertyValue.value) === String(l); } const o = /* @__PURE__ */ new Map([ ["length", t], ["getProperty", n] ]); Object.keys(e).reduce((p, c) => (p.set(c, e[c]), p), o); function 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 h = f, g = c[f]; return { target: l, operator: "getProperty", param: h, value: g }; }) : []; } function a(p) { return Object.keys(p).reduce((l, f) => { const h = r(f, p[f]); return l.push(...h), 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((h, g) => h && i(g, c), !0); } function s(p, c) { const l = Object.keys(p), f = l.includes("allOf"), h = l.includes("anyOf"), g = f || h, m = (g ? p[g ? f ? "allOf" : "anyOf" : "allOf"] : [p]).map((T) => u(T, c)); return f ? !m.includes(!1) : m.includes(!0); } return { parseValueSchema: s }; } const le = { button: { type: "button", name: "按钮" }, "response-toolbar": { type: "response-toolbar", name: "工具栏" }, "response-toolbar-item": { type: "response-toolbar-item", name: "按钮" }, "content-container": { type: "content-container", name: "容器" }, "input-group": { type: "input-group", name: "文本" }, textarea: { type: "textarea", name: "多行文本" }, lookup: { type: "lookup", name: "帮助" }, "number-spinner": { type: "number-spinner", name: "数值" }, "date-picker": { type: "date-picker", name: "日期" }, switch: { type: "switch", name: "开关" }, "radio-group": { type: "radio-group", name: "单选组" }, "check-box": { type: "check-box", name: "复选框" }, "check-group": { type: "check-group", name: "复选框组" }, "combo-list": { type: "combo-list", name: "下拉列表" }, "response-form": { type: "response-form", name: "卡片面板" }, "response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" }, "response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" }, "tree-grid": { type: "tree-grid", name: "树表格" }, "tree-grid-column": { type: "tree-grid-column", name: "树表格列" }, "data-grid": { type: "data-grid", name: "表格" }, "data-grid-column": { type: "data-grid-column", name: "表格列" }, module: { type: "Module", name: "模块" }, component: { type: "component", name: "组件" }, tabs: { type: "tabs", name: "标签页" }, "tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" }, "tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" }, "time-picker": { type: "time-picker", name: "时间选择" }, section: { type: "section", name: "分组面板" }, "section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" }, "section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" }, splitter: { type: "splitter", name: "分栏面板" }, "splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" }, "component-ref": { type: "component-ref", name: "组件引用节点" }, uploader: { type: "uploader", name: "附件上传" }, "page-header": { type: "page-header", name: "页头" }, "page-footer": { type: "page-footer", name: "页脚" }, "tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" }, fieldset: { type: "fieldset", name: "分组" }, "query-solution": { type: "query-solution", name: "筛选方案" }, drawer: { type: "drawer", name: "抽屉" } }, ri = {}, ii = {}; oi(); function ft(e, t, n = /* @__PURE__ */ new Map(), o = (i, u, s, p) => u, r = {}, a = (i) => i) { return cn[t.title] = t, dn[t.title] = o, ri[t.title] = r, ii[t.title] = a, (i = {}, u = !0) => { if (!u) return pn(i, n); const s = ni(i, t, n), p = Object.keys(e).reduce((c, l) => (c[l] = e[l].default, c), {}); return Object.assign(p, s); }; } function ai(e, t, n) { return t; } const li = /* @__PURE__ */ new Map([ ["appearance", to] ]), si = "https://json-schema.org/draft/2020-12/schema", ui = "https://farris-design.gitee.io/avatar.schema.json", ci = "avatar", di = "A Farris Component", fi = "object", pi = { id: { description: "The unique identifier for avatar", type: "string" }, type: { description: "The type string of avatar", type: "string", default: "avatar" }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} }, binding: { description: "", type: "object", default: {} }, disabled: { type: "boolean", default: !1 }, avatarWidth: { description: "", type: "number", default: 100 }, avatarHeight: { description: "", type: "number", default: 100 }, readonly: { description: "", type: "boolean", default: !1 }, cover: { description: "", type: "string", default: "" }, tabindex: { description: "", type: "number", default: -1 }, visible: { description: "", type: "boolean", default: !0 } }, mi = [ "id", "type" ], hi = [ "id", "appearance", "binding", "visible" ], vi = { $schema: si, $id: ui, title: ci, description: di, type: fi, properties: pi, required: mi, ignore: hi }, Ut = { /** * 头像宽度 */ avatarWidth: { type: Number, default: 100 }, /** * 头像高度 */ avatarHeight: { type: Number, default: 100 }, /** * 组件标识 */ cover: { type: String }, /** * 只读 */ readonly: { type: Boolean, default: !1 }, /** * 头像形状 */ shape: { type: String, default: "circle" }, /** * 头像最大尺寸, 单位MB */ maxSize: { type: Number, default: 1 }, /** * 组件值 */ modelValue: { type: String, default: "" }, /** * 头像标题 */ title: { type: String, default: "" }, /** * 支持的头像类型 */ imageType: { type: Array, default: ["jpeg"] } }, mn = ft(Ut, vi, li, ai); function hn(e, t, n, o) { const r = "data:image/jpeg;base64,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", a = x(e.readonly); function i(h) { return h.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/) != null; } function u(h) { return h.indexOf("data:image/") > -1; } function s(h) { return h ? "data:image/jpeg;base64," + h : ""; } const p = $(() => { var g; if (!e.imageType || !e.imageType.length) return ""; const h = (g = e.imageType) == null ? void 0 : g.map((M) => (M === "jpg" && (M = "jpeg"), `image/${M}`)); return !h || !h.length ? "image/*" : h.join(","); }), c = $(() => { const h = o.value || e.cover || r; return i(h) || u(h) ? h : s(h); }), l = $(() => a.value ? "" : e.title); function f() { a.value || n && n.value && n.value.click(); } return { acceptTypes: p, imageSource: c, imageTitle: l, onClickImage: f }; } const At = /* @__PURE__ */ He({ name: "FAvatar", props: Ut, emits: ["change", "update:modelValue"], setup(e, t) { const n = $(() => ({ "f-avatar": !0, "f-avatar-readonly": e.readonly, "f-avatar-circle": e.shape === "circle", "f-avatar-square": e.shape === "square" })), o = x(e.modelValue), r = $(() => ({ width: e.avatarWidth + "px", height: e.avatarHeight + "px" })), a = !1; function i() { return ""; } function u() { } const s = x(null), { acceptTypes: p, imageSource: c, onClickImage: l } = hn(e, t, s, o); return () => E("div", { class: n.value, style: r.value, onClick: l }, [a, E("img", { title: e.title, class: "f-avatar-image", src: c.value, onError: i }, null), !e.readonly && E("div", { class: "f-avatar-icon" }, [E("span", { class: "f-icon f-icon-camera" }, null)]), E("input", { ref: "file", name: "file-input", type: "file", class: "f-avatar-upload", accept: p.value, onChange: u, style: "display: none;" }, null)]); } }), gi = x(0); function yi() { gi.value++; } const gt = x(0); function bi(e, t) { const n = t.getBoundingClientRect(), o = e.getBoundingClientRect(), r = o.top >= n.top, a = o.top <= n.bottom; return r && a; } function Ci(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 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 } = e.getBoundingClientRect()); } o.style.left = a + "px"; } } } function wi(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 vn(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 r = wi(e); if (r && (o = bi(e, r)), !o) { n.style.display = "none"; return; } Ci(e); } } function Si(e) { if (!e) return; let t; e.className.includes("dgComponentSelected") ? t = e : t = e.querySelector(".dgComponentSelected"), t && vn(t); } class gn { constructor(t, n) { q(this, "componentId"); q(this, "viewModelId"); q(this, "eventsEditorUtils"); q(this, "formSchemaUtils"); q(this, "formMetadataConverter"); q(this, "designViewModelUtils"); q(this, "designViewModelField"); q(this, "controlCreatorUtils"); q(this, "designerHostService"); q(this, "schemaService", null); q(this, "metadataService", null); q(this, "propertyConfig", { type: "object", categories: {} }); var o; this.componentId = t, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((o = this.formSchemaUtils) == null ? void 0 : o.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = n.designViewModelUtils, this.controlCreatorUtils = n.controlCreatorUtils, this.metadataService = n.metadataService, this.schemaService = n.schemaService; } getTableInfo() { var t; return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId); } setDesignViewModelField(t) { var o; const n = t.binding && t.binding.type === "Form" && t.binding.field; if (n) { if (!this.designViewModelField) { const r = this.designViewModelUtils.getDgViewModel(this.viewModelId); this.designViewModelField = r.fields.find((a) => a.id === n); } t.updateOn = (o = this.designViewModelField) == null ? void 0 : o.updateOn; } } getBasicPropConfig(t) { return { description: "Basic Information", title: "基本信息", properties: { id: { description: "组件标识", title: "标识", type: "string", readonly: !0 }, type: { description: "组件类型", title: "控件类型", type: "select", editor: { type: "combo-list", textField: "name", valueField: "value", editable: !1, data: [{ value: t.type, name: le[t.type].name }] } } } }; } getAppearanceConfig(t = null) { return { title: "外观", description: "Appearance", properties: { class: { title: "class样式", type: "string", description: "组件的CSS样式", $converter: "/converter/appearance.converter" }, style: { title: "style样式", type: "string", description: "组件的样式", $converter: "/converter/appearance.converter" } }, setPropertyRelates(n, o) { if (n) switch (n && n.propertyID) { case "class": case "style": { gt.value++; break; } } } }; } /** * * @param propertyId * @param componentInstance * @returns */ updateElementByParentContainer(t, n) { const o = n && n.parent && n.parent.schema; if (!o) return; const r = o.contents.findIndex((i) => i.id === t), a = dt(o.contents[r]); o.contents.splice(r, 1), o.contents.splice(r, 0, a), yi(); } } const bt = class bt { /** * 根据绑定字段类型获取可用的输入类控件 */ static getEditorTypesByMDataType(t, n = "") { let o = bt.fieldControlTypeMapping[t]; if (n === "data-grid-column" && (o != null && o.length)) { const r = [le["check-group"].type, le["radio-group"].type]; o = o.filter((a) => !r.includes(a.key)); } return o; } /** * 获取所有输入类控件 */ static getAllInputTypes() { const t = []; for (const n in bt.fieldControlTypeMapping) bt.fieldControlTypeMapping[n].forEach((o) => { t.find((r) => r.key === o.key && r.value === o.value) || t.push({ key: o.key, value: o.value }); }); return t; } /** * 提供schema字段基础属性和DOM控件属性的映射 * @param control 控件元数据 */ static mappingDomPropAndSchemaProp(t) { var r; const n = (r = t.editor) == null ? void 0 : r.type, o = []; return (t.type === le["data-grid-column"].type || t.type === le["tree-grid-column"].type) && o.push({ domField: "title", schemaField: "name" }), o.push({ domField: "label", schemaField: "name" }), o.push({ domField: "editor.required", schemaField: "require" }), o.push({ domField: "editor.readonly", schemaField: "readonly" }), (n === le["input-group"].type || n === le.textarea.type || n === le["number-spinner"].type) && o.push({ domField: "editor.maxLength", schemaField: "type.length" }), n === le["number-spinner"].type && o.push({ domField: "editor.precision", schemaField: "type.precision" }), (t.type === le["data-grid-column"].type || t.type === le["tree-grid-column"].type) && o.push({ domField: "formatter.precision", schemaField: "type.precision" }), (n === le["combo-list"].type || n === le["radio-group"].type) && o.push({ domField: "editor.data", schemaField: "type.enumValues" }), (t.type === le["data-grid-column"].type || t.type === le["tree-grid-column"].type) && o.push({ domField: "formatter.data", schemaField: "type.enumValues" }), n === le["date-picker"].type && (o.push({ domField: "editor.displayFormat", schemaField: "editor.format" }), o.push({ domField: "editor.fieldType", schemaField: "type.name" })), n === le["number-spinner"].type && (o.push({ domField: "editor.max", schemaField: "editor.maxValue" }), o.push({ domField: "editor.min", schemaField: "editor.minValue" })), n === le.lookup.type && (o.push({ domField: "editor.dataSource", schemaField: "editor.dataSource" }), o.push({ domField: "editor.valueField", schemaField: "editor.valueField" }), o.push({ domField: "editor.textField", schemaField: "editor.textField" }), o.push({ domField: "editor.displayType", schemaField: "editor.displayType" }), o.push({ domField: "editor.mapFields", schemaField: "editor.mapFields" }), o.push({ domField: "editor.helpId", schemaField: "editor.helpId" })), o.push({ domField: "path", schemaField: "bindingPath" }), o.push({ domField: "binding.path", schemaField: "bindingField" }), o.push({ domField: "binding.fullPath", schemaField: "path" }), (t.type === le["data-grid-column"].type || t.type === le["tree-grid-column"].type) && o.push({ domField: "field", schemaField: "bindingPath" }), o; } }; /** * <字段类型,可配置的控件类型列表>的映射 */ q(bt, "fieldControlTypeMapping", { String: [ { key: le["input-group"].type, value: le["input-group"].name }, { key: le.lookup.type, value: le.lookup.name }, { key: le["date-picker"].type, value: le["date-picker"].name }, { key: le["check-group"].type, value: le["check-group"].name }, { key: le["radio-group"].type, value: le["radio-group"].name }, { key: le["combo-list"].type, value: le["combo-list"].name }, { key: le.textarea.type, value: le.textarea.name }, { key: le["time-picker"].type, value: le["time-picker"].name } ], Text: [ { key: le.textarea.type, value: le.textarea.name }, { key: le.lookup.type, value: le.lookup.name } ], Decimal: [ { key: le["number-spinner"].type, value: le["number-spinner"].name } ], Integer: [ { key: le["number-spinner"].type, value: le["number-spinner"].name } ], Number: [ { key: le["number-spinner"].type, value: le["number-spinner"].name } ], BigNumber: [ { key: le["number-spinner"].type, value: le["number-spinner"].name } ], Date: [ { key: le["date-picker"].type, value: le["date-picker"].name } ], DateTime: [ { key: le["date-picker"].type, value: le["date-picker"].name } ], Boolean: [ { key: le.switch.type, value: le.switch.name }, { key: le["check-box"].type, value: le["check-box"].name } ], Enum: [ { key: le["combo-list"].type, value: le["combo-list"].name }, { key: le["radio-group"].type, value: le["radio-group"].name } ], Object: [ { key: le.lookup.type, value: le.lookup.name }, { key: le["combo-list"].type, value: le["combo-list"].name }, { key: le["radio-group"].type, value: le["radio-group"].name } ] }); let Et = bt; class _i { constructor() { /** 控件标题 */ q(this, "label", ""); /** 控件id */ q(this, "id", ""); /** 每个控件占用的栅格数 */ q(this, "columnInSM", 12); q(this, "columnInMD", 6); q(this, "columnInLG", 3); q(this, "columnInEL", 2); /** 每个控件占用的列数 */ q(this, "displayWidthInSM", 1); q(this, "displayWidthInMD", 1); q(this, "displayWidthInLG", 1); q(this, "displayWidthInEL", 1); /** 编辑器内部默认显示的屏幕大小-----可以去掉 */ q(this, "displayColumnCountAtBreakPoint", "md"); /** 控件所在行,传0即可-----编辑器内部使用 */ q(this, "tagRow", 0); /** 控件是否显示上方空白:传0即可-----编辑器内部使用 */ q(this, "showTopBorder", 0); /** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */ q(this, "group", 1); /** 控件是否符合标准的class配置(设计器用的) */ q(this, "isSupportedClass", !0); /** 控件所在分组id(设计器用的) */ q(this, "fieldSetId", ""); } } function xi(e) { let t, n; const o = /* @__PURE__ */ new Map(); let r = []; function a(c, l) { const h = c.split(" ").filter((y) => y.startsWith("col-")); if (h.length === 0) { l.isSupportedClass = !1; return; } let g = h.find((y) => /^col-([1-9]|10|11|12)$/.test(y)), M = h.find((y) => /^col-md-([1-9]|10|11|12)$/.test(y)), _ = h.find((y) => /^col-xl-([1-9]|10|11|12)$/.test(y)), m = h.find((y) => /^col-el-([1-9]|10|11|12)$/.test(y)); g = g || "col-12", l.columnInSM = parseInt(g.replace("col-", ""), 10), l.displayWidthInSM = l.columnInSM / 12, l.displayWidthInSM !== 1 && (l.isSupportedClass = !1), M = M || "col-md-" + l.columnInSM, l.columnInMD = parseInt(M.replace("col-md-", ""), 10), l.displayWidthInMD = l.columnInMD / 6, [1, 2].includes(l.displayWidthInMD) || (l.isSupportedClass = !1), _ = _ || "col-xl-" + l.columnInMD, l.columnInLG = parseInt(_.replace("col-xl-", ""), 10), l.displayWidthInLG = l.columnInLG / 3, [1, 2, 3, 4].includes(l.displayWidthInLG) || (l.isSupportedClass = !1), m = m || "col-el-" + l.columnInLG, l.columnInEL = parseInt(m.replace("col-el-", ""), 10), l.displayWidthInEL = l.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(l.displayWidthInEL) || (l.isSupportedClass = !1); } function i(c, l, f, h = !1) { let g = !1; c.contents.forEach((M) => { if (M.type === "fieldset") { f += 1, i(M, l, f, !0), g = !0; return; } g && (f += 1, g = !1); const _ = M.appearance && M.appearance.class, m = new _i(); _ ? a(_, m) : m.isSupportedClass = !1, m.label = M.label || M.id, m.id = M.id, m.group = f, h && (m.fieldSetId = c.id), n === M.id && (t = f), o.set(M.id, M), l.push(m); }); } function u(c) { const l = e.getComponentById(c); if (!l || !l.componentType || !l.componentType.startsWith("form")) return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" }; const f = e.selectNode(l, (h) => h.type === Jt["response-form"].type); return !f || !f.contents || f.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: f }; } function s(c, l) { l = l || c.id; const { result: f, message: h, formNode: g } = u(l); if (!f) return { result: f, message: h }; n = c.id, r = [], o.clear(); const M = g.contents[0].type === Jt.fieldset.type ? 0 : 1; i(g, r, M); const _ = r.find((y) => !y.isSupportedClass); return { defaultState: { defaultGroupNumber: t || 1, model: _ ? "customize" : "standard" }, importData: r }; } function p(c, l) { l = l; const { result: f, formNode: h } = u(l); if (!f) return ""; const g = []; return c.forEach((M) => { var y; const _ = o.get(M.id), m = _.appearance && _.appearance.class; if (m) { const v = m.split(" ").filter((F) => !F.startsWith("col-")), S = "col-" + M.columnInSM, k = "col-md-" + M.columnInMD, d = "col-xl-" + M.columnInLG, b = "col-el-" + M.columnInEL, C = [S, k, d, b].concat(v); _.appearance.class = C.join(" "); } if (M.fieldSetId) { const T = h.contents.find((S) => S.id === M.fieldSetId), v = g.find((S) => S.id === M.fieldSetId); v ? (y = v.contents) == null || y.push(_) : (g.push(T), T.contents = [_]); } else g.push(_); }), h.contents = g, h.id; } return { checkCanFindFormNode: u, checkCanOpenLayoutEditor: s, changeFormControlsByResponseLayoutConfig: p, getResonseFormLayoutConfig: i }; } var ut = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function xt(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 Ti = { exports: {} }; (function(e, t) { (function(n) { e.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 h = r[p] = { exports: {} }; o[p][0].call(h.exports, function(g) { var M = o[p][1][g]; return i(M || g); }, h, h.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 h = l.className; h.length ? s(f).test(h) || (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(w, D) { var B = arguments.length; B === 1 && Array.isArray(w) === !1 && (D = w, w = []); var V, A, O, I, N, H, Q, oe, te, pe = null, j, L, W = !1, Y = 0, Z, X = D || {}; X.moves === void 0 && (X.moves = y), X.accepts === void 0 && (X.accepts = y), X.invalid === void 0 && (X.invalid = rt), X.containers === void 0 && (X.containers = w || []), X.isContainer === void 0 && (X.isContainer = m), X.copy === void 0 && (X.copy = !1), X.copySortSource === void 0 && (X.copySortSource = !1), X.revertOnSpill === void 0 && (X.revertOnSpill = !1), X.removeOnSpill === void 0 && (X.removeOnSpill = !1), X.direction === void 0 && (X.direction = "vertical"), X.ignoreInputTextSelection === void 0 && (X.ignoreInputTextSelection = !0), X.mirrorContainer === void 0 && (X.mirrorContainer = p.body); var R = i({ containers: X.containers, start: ze, end: ne, cancel: it, remove: Ae, destroy: xe, canMove: ke, dragging: !1 }); return X.removeOnSpill === !0 && R.on("over", me).on("out", ve), ie(), R; function z(P) { return R.containers.indexOf(P) !== -1 || X.isContainer(P); } function ie(P) { var K = P ? "remove" : "add"; g(c, K, "mousedown", Te), g(c, K, "mouseup", Ee); } function J(P) { var K = P ? "remove" : "add"; g(c, K, "mousemove", Le); } function ee(P) { var K = P ? "remove" : "add"; u[K](c, "selectstart", Fe), u[K](c, "click", Fe); } function xe() { ie(!0), Ee({}); } function Fe(P) { j && P.preventDefault(); } function Te(P) { I = P.clientX, N = P.clientY; var K = M(P) !== 1 || P.metaKey || P.ctrlKey; if (!K) { var U = P.target, ce = De(U); ce && (j = ce, J(), P.type === "mousedown" && (k(U) ? U.focus() : P.preventDefault())); } } function Le(P) { if (j) { if (M(P) === 0) { Ee({}); return; } if (!(P.clientX !== void 0 && Math.abs(P.clientX - I) <= (X.slideFactorX || 0) && P.clientY !== void 0 && Math.abs(P.clientY - N) <= (X.slideFactorY || 0))) { if (X.ignoreInputTextSelection) { var K = F("clientX", P) || 0, U = F("clientY", P) || 0, ce = p.elementFromPoint(K, U); if (k(ce)) return; } var ge = j; J(!0), ee(), ne(), We(ge), s.add(oe || O, "gu-transit"), Ie(), Se(), Y = 0, qe(P); } } } function De(P) { if (!(R.dragging && V) && !z(P)) { for (var K = P; S(P) && z(S(P)) === !1; ) if (X.invalid(P, K) || (P = S(P), !P)) return; var U = S(P); if (U && !X.invalid(P, K)) { var ce = X.moves(P, U, K, b(P)); if (ce) return { item: P, source: U }; } } } function ke(P) { return !!De(P); } function ze(P) { var K = De(P); K && We(K); } function We(P) { Re(P.item, P.source) && (oe = P.item.cloneNode(!0), R.emit("cloned", oe, P.item, "copy")), A = P.source, O = P.item, H = Q = b(P.item), R.dragging = !0, R.emit("drag", O, A); } function rt() { return !1; } function ne() { if (R.dragging) { var P = oe || O; Be(P, S(P)); } } function be() { j = !1, J(!0), ee(!0); } function Ee(P) { if (be(), !!R.dragging) { var K = oe || O, U = F("clientX", P) || 0, ce = F("clientY", P) || 0, ge = _(V, U, ce), ye = lt(ge, U, ce); ye && (oe && X.copySortSource || !oe || ye !== A) ? Be(K, ye) : X.removeOnSpill ? Ae() : it(); } } function Be(P, K) { var U = S(P); oe && X.copySortSource && K === A && U.removeChild(O), et(K) ? R.emit("cancel", P, A) : R.emit("drop", P, K, A, Q), Je(); } function Ae() { if (R.dragging) { var P = oe || O, K = S(P); K && K.removeChild(P), R.emit(oe ? "cancel" : "remove", P, K, A), Je(); } } function it(P) { if (R.dragging) { var K = arguments.length > 0 ? P : X.revertOnSpill, U = oe || O, ce = S(U), ge = et(ce); ge === !1 && K && (oe ? ce && ce.removeChild(oe) : A.insertBefore(U, H)), ge || K ? R.emit("cancel", U, A, A) : R.emit("drop", U, ce, A, Q), Je(); } } function Je() { var P = oe || O; be(), Ne(), Ge(), P && s.rm(P, "gu-transit"), te && clearTimeout(te), R.dragging = !1, pe && R.emit("out", P, pe, A), R.emit("dragend", P, Y), A = O = oe = H = Q = te = pe = null; } function et(P, K) { var U; return K !== void 0 ? U = K : V ? U = Q : U = b(oe || O), P === A && U === H; } function lt(P, K, U) { for (var ce = P; ce && !ge(); ) ce = S(ce); return ce; function ge() { var ye = z(ce); if (ye === !1) return !1; var ae = tt(ce, P), we = Oe(ce, ae, K, U), Ve = et(ce, we); return Ve ? !0 : X.accepts(O, ce, A, we); } } function qe(P) { if (!V) return; P.preventDefault(); var K = F("clientX", P) || 0, U = F("clientY", P) || 0; V.style.left = K - 2 + "px", V.style.top = U - 2 + "px"; var ce = oe || O, ge = _(V, K, U), ye = lt(ge, K, U), ae = ye !== null && ye !== pe; (ae || ye === null) && (Qe(), pe = ye, st()), Ce(ge, U); var we = S(ce); if (ye === A && oe && !X.copySortSource) { we && we.removeChild(ce); return; } var Ve, Xe = tt(ye, ge); if (W = nt(Xe, ye), Xe !== null) Ve = Oe(ye, Xe, K, U); else if (X.revertOnSpill === !0 && !oe) Ve = H, ye = A; else { oe && we && we.removeChild(ce), oe && L && (L.style.display = "none"); return; } L.style.display = "block", re(Ve, ce, ae), Ve ? G(Xe, Ve) : he(ye); function Pe(je) { R.emit(je, ce, pe, A); } function st() { ae && Pe("over"); } function Qe() { pe && Pe("out"); } } function re(P, K, U) { (P === K || P === b(K)) && (Q = b(K)), (P === null && U || P !== K && P !== b(K)) && (Q = P); } function me(P) { s.rm(P, "gu-hide"); } function ve(P) { R.dragging && s.add(P, "gu-hide"); } function Se() { V || (V = document.createElement("div"), V.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;", V.innerHTML = X.getMirrorText && X.getMirrorText(O) || "控件", s.add(V, "gu-mirror"), X.mirrorContainer.appendChild(V), g(c, "add", "mousemove", qe), s.add(X.mirrorContainer, "gu-unselectable"), R.emit("cloned", V, O, "mirror")); } function Ie() { if (L = document.createElement("div"), s.add(L, "gu-insertion"), O) { var P = O.getBoundingClientRect(); L.style.left = P.left + "px", L.style.top = P.top + "px"; } W = !1, X.mirrorContainer.appendChild(L); } function Ne() { V && (s.rm(X.mirrorContainer, "gu-unselectable"), g(c, "remove", "mousemove", qe), S(V).removeChild(V), V = null); } function Ge() { L && (S(L).removeChild(L), L = null); } function tt(P, K) { for (var U = K; U !== P && S(U) !== P; ) U = S(U); return U === c ? null : U; } function nt(P, K) { if (!K) return W; var U = P || K && K.lastElementChild; if (!U) 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), ae = ye.getPropertyValue("display"); if (/flex$/.test(ae)) { 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 G(P, K) { const U = K.getBoundingClientRect(); if (L.style.left = U.left + "px", L.style.top = U.top + "px", W) { if (L.style.height = U.height + "px", L.style.width = "4px", P) { const ce = P.getBoundingClientRect(); ce.top !== U.top && (L.style.left = ce.right + "px", L.style.top = ce.top + "px", L.style.height = ce.height + "px"); } } else if (L.style.height = "4px", L.style.width = U.width + "px", Z) { const ce = Z.getBoundingClientRect(); U.top < ce.top && (L.style.display = "none"); } K === O && O && (L.style.display = "none"); } function he(P) { Q = null; var K = P.lastElementChild; if (K) { var U = K.getBoundingClientRect(); W ? (L.style.left = U.right + "px", L.style.top = U.top + "px", L.style.height = U.height + "px", L.style.width = "4px") : (L.style.left = U.left + "px", L.style.top = U.bottom + "px", L.style.height = "4px", L.style.width = U.width + "px"), K === O && O && (L.style.display = "none"); } else L.style.display = "none"; } function Ce(P, K) { if (!X.mirrorContainer.contains(P) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (Z = f(P), !Z || !Z.contains(P))) return; const U = document.querySelector(".dgComponentSelected"), ce = Z.getBoundingClientRect(); if (K - 30 < ce.top && Z.scrollTop > 0) { let ge = Z.scrollTop < 10 ? Z.scrollTop : 10; Z.scrollBy(0, -1 * ge), U && Z.contains(U) && (Y = Y + -1 * ge); } if (K + 30 > ce.bottom && Z.scrollTop < Z.scrollHeight - Z.clientHeight) { const ge = Z.scrollHeight - Z.clientHeight - Z.scrollTop; let ye = ge < 10 ? ge : 10; Z.scrollBy(0, ye), U && Z.contains(U) && (Y = Y + ye); } } function Oe(P, K, U, ce) { var ge = X.direction === "horizontal", ye = X.direction === "mixed", ae = K !== P ? Ve() : we(); return ae; function we() { var Pe = P.children.length, st, Qe, je; for (st = 0; st < Pe; st++) if (Qe = P.children[st], je = Qe.getBoundingClientRect(), ge && je.left + je.width / 2 > U || !ye && !ge && je.top + je.height / 2 > ce || ye && je.left + je.width > U && je.top + je.height > ce) return Qe; return null; } function Ve() { var Pe = K.getBoundingClientRect(); if (ye) { var st = ce - Pe.top, Qe = U - Pe.left, je = Pe.bottom - ce, Vt = Pe.right - U, Dt = Math.min(Qe, Vt, st, je), Nt; return W ? Nt = Vt < Qe : Nt = je === Dt || Vt === Dt || Qe === Dt, Xe(Nt); } return Xe(ge ? U > Pe.left + T(Pe) / 2 : ce > Pe.top + v(Pe) / 2); } function Xe(Pe) { return Pe ? b(K) : K; } } function Re(P, K) { return typeof X.copy == "boolean" ? X.copy : X.copy(P, K); } } function f(w) { const D = Array.from(window.scrollContainerList); if (D.length === 1) { const V = Array.from(window.scrollContainerList)[0]; return document.getElementById(V); } const B = h(D); for (const V of B) if (V.contains(w)) return V; return null; } function h(w) { const D = []; return w.forEach((B) => { const V = document.getElementById(B); V && D.push(V); }), D.sort((B, V) => B.contains(V) ? 1 : V.contains(B) ? -1 : 0), D; } function g(w, D, B, V) { var A = { mouseup: "touchend", mousedown: "touchstart", mousemove: "touchmove" }, O = { mouseup: "pointerup", mousedown: "pointerdown", mousemove: "pointermove" }, I = { mouseup: "MSPointerUp", mousedown: "MSPointerDown", mousemove: "MSPointerMove" }; a.navigato