UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,248 lines (1,247 loc) 182 kB
var En = Object.defineProperty; var kn = (n, e, t) => e in n ? En(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t; var K = (n, e, t) => kn(n, typeof e != "symbol" ? e + "" : e, t); import { ref as C, computed as U, defineComponent as Be, createVNode as S, watch as Se, Fragment as at, reactive as $e, createApp as Qt, onUnmounted as ht, onMounted as Ze, Transition as Jt, mergeProps as Dt, nextTick as Rt, createTextVNode as Fn, inject as Pt, onBeforeMount as Bn, Teleport as On, shallowRef as In, render as Ot, h as Pn, cloneVNode as Nn } from "vue"; import { cloneDeep as pt, isPlainObject as qt, isUndefined as je } from "lodash-es"; import { useI18n as jt } from "vue-i18n"; import { LocaleService as gt } from "../locale/index.esm.js"; import { getCustomClass as mt, withInstall as Dn, FormSchemaEntityField$Type as Wt, FormSchemaEntityFieldTypeName as Gt } from "../common/index.esm.js"; import { useResizeObserver as Rn } from "@vueuse/core"; import { getHierarchyRow as jn, useIdentify as Vn, useGroupData as $n, useFilter as Ln, useHierarchy as zn, useLoading as Hn, useDataView as An, useSelection as Un, useSelectHierarchyItem as _n, usePagination as qn, useDataViewContainerStyle as Wn, useCommandColumn as Gn, useSettingColumn as Yn, useColumn as Xn, useSort as Qn, useGroupColumn as Jn, useRow as Zn, useEdit as Kn, useVisualDataBound as eo, useVisualDataCell as to, useVisualDataRow as no, useVisualData as oo, useCellPosition as ro, useSidebar as io, useVirtualScroll as ao, useFitColumn as so, useFilterHistory as lo, useColumnFilter as co, useDragColumn as uo, getColumnHeader as fo, getSidebar as po, getDisableMask as mo, getHorizontalScrollbar as vo, getVerticalScrollbar as ho, getEmpty as go, getPagination as yo, getSummary as bo } from "../data-view/index.esm.js"; import { getSchemaByTypeForDesigner as wo, createPropsResolver as Zt, resolveAppearance as Co } from "../dynamic-resolver/index.esm.js"; import "../designer-canvas/index.esm.js"; import "../property-panel/index.esm.js"; import "../accordion/index.esm.js"; import "../avatar/index.esm.js"; import "../../designer/button-edit/index.esm.js"; import "../button-group/index.esm.js"; import "../calendar/index.esm.js"; import "../capsule/index.esm.js"; import "../../designer/checkbox/index.esm.js"; import "../../designer/checkbox-group/index.esm.js"; import "../combo-list/index.esm.js"; import "../combo-tree/index.esm.js"; import "../component/index.esm.js"; import "../color-picker/index.esm.js"; import "../content-container/index.esm.js"; import "../date-picker/index.esm.js"; import "../../designer/data-grid/index.esm.js"; import "../dropdown/index.esm.js"; import "../dynamic-form/index.esm.js"; import "../events-editor/index.esm.js"; import "../filter-bar/index.esm.js"; import "../field-selector/index.esm.js"; import "../binding-selector/index.esm.js"; import "../image-cropper/index.esm.js"; import "../../designer/input-group/index.esm.js"; import "../layout/index.esm.js"; import "../list-nav/index.esm.js"; import "../../designer/list-view/index.esm.js"; import "../lookup/index.esm.js"; import "../mapping-editor/index.esm.js"; import "../nav/index.esm.js"; import "../number-range/index.esm.js"; import "../number-spinner/index.esm.js"; import "../order/index.esm.js"; import "../page-header/index.esm.js"; import "../page-footer/index.esm.js"; import "../pagination/index.esm.js"; import "../progress/index.esm.js"; import "../query-solution/index.esm.js"; import "../../designer/radio-group/index.esm.js"; import "../rate/index.esm.js"; import "../response-toolbar/index.esm.js"; import "../response-layout/index.esm.js"; import "../response-layout-editor/index.esm.js"; import "../search-box/index.esm.js"; import "../section/index.esm.js"; import "../smoke-detector/index.esm.js"; import "../splitter/index.esm.js"; import "../step/index.esm.js"; import "../switch/index.esm.js"; import "../tabs/index.esm.js"; import "../tags/index.esm.js"; import "../text/index.esm.js"; import "../time-picker/index.esm.js"; import "../transfer/index.esm.js"; import "../tree-view/index.esm.js"; import "../uploader/index.esm.js"; import "../verify-detail/index.esm.js"; import "../video/index.esm.js"; import "../textarea/index.esm.js"; import "../schema-selector/index.esm.js"; import "../../designer/tree-grid/index.esm.js"; import "../event-parameter/index.esm.js"; import "../filter-condition-editor/index.esm.js"; import "../fieldset/index.esm.js"; import "../sort-condition-editor/index.esm.js"; import "../menu-lookup/index.esm.js"; import "../../designer/drawer/index.esm.js"; import "../json-editor/index.esm.js"; import "../property-editor/index.esm.js"; import "../expression-editor/index.esm.js"; import "../code-editor/index.esm.js"; import "../html-template/index.esm.js"; import "../collection-property-editor/index.esm.js"; import "../modal/index.esm.js"; import "../external-container/index.esm.js"; import "../language-textbox/index.esm.js"; import "../notify/index.esm.js"; function Kt(n, e) { let t; function o(u) { const { properties: m, title: p, ignore: d } = u, v = d && Array.isArray(d), w = Object.keys(m).reduce((M, O) => ((!v || !d.find((z) => z === O)) && (M[O] = m[O].type === "object" && m[O].properties ? o(m[O]) : pt(m[O].default)), M), {}); if (p && (!v || !d.find((M) => M === "id"))) { const M = p.toLowerCase().replace(/-/g, "_"); w.id = `${M}_${Math.random().toString().slice(2, 6)}`; } return w; } function r(u) { const { properties: m, title: p, required: d } = u; if (d && Array.isArray(d)) { const v = d.reduce((w, M) => (w[M] = m[M].type === "object" && m[M].properties ? o(m[M]) : pt(m[M].default), w), {}); if (p && d.find((w) => w === "id")) { const w = p.toLowerCase().replace(/-/g, "_"); v.id = `${w}_${Math.random().toString().slice(2, 6)}`; } return v; } return { type: p }; } function a(u, m = {}, p) { const d = n[u]; if (d) { let v = r(d); const w = e[u]; return v = w ? w({ getSchemaByType: a }, v, m, p) : v, t != null && t.appendIdentifyForNewControl && t.appendIdentifyForNewControl(v), v; } return null; } function i(u, m) { const p = o(m); return Object.keys(p).reduce((d, v) => (Object.prototype.hasOwnProperty.call(u, v) && (d[v] && qt(d[v]) && qt(u[v] || !u[v]) ? Object.assign(d[v], u[v] || {}) : d[v] = u[v]), d), p), p; } function c(u, m) { return Object.keys(u).filter((d) => u[d] != null).reduce((d, v) => { if (m.has(v)) { const w = m.get(v); if (typeof w == "string") d[w] = u[v]; else { const M = w(v, u[v], u); Object.assign(d, M); } } else d[v] = u[v]; return d; }, {}); } function s(u, m, p = /* @__PURE__ */ new Map()) { const d = i(u, m); return c(d, p); } function l(u) { var p; const m = u.type; if (m) { const d = n[m]; if (!d) return u; const v = i(u, d), w = ((p = u.editor) == null ? void 0 : p.type) || ""; if (w) { const M = n[w], O = i(u.editor, M); v.editor = O; } return v; } return u; } function f(u) { t = u; } return { getSchemaByType: a, resolveSchemaWithDefaultValue: l, resolveSchemaToProps: s, mappingSchemaToProps: c, setDesignerContext: f }; } const en = {}, tn = {}, { getSchemaByType: Is, resolveSchemaWithDefaultValue: So, resolveSchemaToProps: xo, mappingSchemaToProps: To, setDesignerContext: Ps } = Kt(en, tn); function Mo(n = {}) { function e(l, f, u, m) { if (typeof u == "number") return m[l].length === u; if (typeof u == "object") { const p = Object.keys(u)[0], d = u[p]; if (p === "not") return Number(m[l].length) !== Number(d); if (p === "moreThan") return Number(m[l].length) >= Number(d); if (p === "lessThan") return Number(m[l].length) <= Number(d); } return !1; } function t(l, f, u, m) { return m[l] && m[l].propertyValue && String(m[l].propertyValue.value) === String(u); } const o = /* @__PURE__ */ new Map([ ["length", e], ["getProperty", t] ]); Object.keys(n).reduce((l, f) => (l.set(f, n[f]), l), o); function r(l, f) { const u = l; return typeof f == "number" ? [{ target: u, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: u, operator: "getProperty", param: l, value: !!f }] : typeof f == "object" ? Object.keys(f).map((m) => { if (m === "length") return { target: u, operator: "length", param: null, value: f[m] }; const p = m, d = f[m]; return { target: u, operator: "getProperty", param: p, value: d }; }) : []; } function a(l) { return Object.keys(l).reduce((u, m) => { const p = r(m, l[m]); return u.push(...p), u; }, []); } function i(l, f) { if (o.has(l.operator)) { const u = o.get(l.operator); return u && u(l.target, l.param, l.value, f) || !1; } return !1; } function c(l, f) { return a(l).reduce((p, d) => p && i(d, f), !0); } function s(l, f) { const u = Object.keys(l), m = u.includes("allOf"), p = u.includes("anyOf"), d = m || p, M = (d ? l[d ? m ? "allOf" : "anyOf" : "allOf"] : [l]).map((z) => c(z, f)); return m ? !M.includes(!1) : M.includes(!0); } return { parseValueSchema: s }; } const Eo = { convertTo: (n, e, t, o) => { n.appearance || (n.appearance = {}), n.appearance[e] = t; }, convertFrom: (n, e, t) => n.appearance ? n.appearance[e] : n[e] }, ko = { convertFrom: (n, e, t) => n.buttons && n.buttons.length ? `共 ${n.buttons.length} 项` : "无" }, Fo = { convertTo: (n, e, t, o) => { n.editor && (n.editor[e] = t); }, convertFrom: (n, e, t) => n.editor && Object.prototype.hasOwnProperty.call(n.editor, e) ? n.editor[e] : n[e] }, B = { 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: "标签页工具栏按钮" }, "html-template": { type: "html-template", 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: "抽屉" }, "external-container": { type: "external-container", name: "外部容器", icon: "content-container" }, "list-nav": { type: "list-nav", name: "列表导航" }, "list-view": { type: "list-view", name: "列表" }, "filter-bar": { type: "filter-bar", name: "筛选条" }, "language-textbox": { type: "language-textbox", name: "多语输入框" } }, Bo = { convertFrom: (n, e, t) => { var r; const o = n.editor && n.editor[e] ? n.editor[e] : n[e]; return ((r = B[o]) == null ? void 0 : r.name) || o; } }, Oo = { convertTo: (n, e, t, o) => { n[e] = n[e]; }, convertFrom: (n, e, t) => n.editor ? t.getRealEditorType(n.editor.type) : "" }, Io = { convertTo: (n, e, t, o) => { (n.type === "data-grid-column" || n.type === "tree-grid-column") && (n.formatter ? n.formatter[e] = t : n.formatter = { [e]: t }); }, convertFrom: (n, e, t) => { if (n.formatter) { if (e === "trueText") return n.formatter.trueText; if (e === "falseText") return n.formatter.falseText; if (e === "prefix") return n.formatter.prefix; if (e === "suffix") return n.formatter.suffix; if (e === "precision") return n.formatter.precision; if (e === "decimal") return n.formatter.decimal; if (e === "thousand") return n.formatter.thousand; if (e === "tempDateFormat") return n.formatter.dateFormat === "yyyy年MM月dd日" ? "yearMonthDay" : n.formatter.dateFormat === "yyyy-MM-dd HH:mm:ss" ? "yyyy-MM-ddTHH:mm:ss" : n.formatter.dateFormat === "yyyy/MM/dd HH:mm:ss" ? "yyyy/MM/ddTHH:mm:ss" : n.formatter.dateFormat === "yyyy年MM月dd日 HH时mm分ss秒" ? "yearMonthDayHourMinuteSecond" : n.formatter.tempDateFormat || n.formatter.dateFormat || "yyyy-MM-dd"; if (e === "customFormat") return n.formatter.customFormat; if (e === "type") return n.formatter.type || "none"; } return "none"; } }, Po = { convertTo: (n, e, t, o) => { n.command ? n.command[e] = t : n.command = { [e]: t }, e === "enable" && t && (n.command.commands || (n.command.commands = [ { text: "编辑", type: "primary", command: "edit" }, { text: "删除", type: "danger", command: "remove" } ])); }, convertFrom: (n, e, t) => n.command && e === "enable" ? n.command.enable : "" }, No = { convertTo: (n, e, t, o) => { n.column ? n.column[e] = t : n.column = { [e]: t }, e === "fitColumns" && t && (n.column.fitMode || (n.column.fitMode = "average")); }, convertFrom: (n, e, t) => { if (n.column) { if (e === "fitColumns") return n.column.fitColumns; if (e === "fitMode") return n.column.fitMode; } return ""; } }, Do = { convertTo: (n, e, t, o) => { n.summary ? n.summary[e] = t : n.summary = { [e]: t }, e === "enable" && t && (n.summary ? n.summary.groupFields || (n.summary.groupFields = []) : n.summary = { enable: t, groupFields: [] }); }, convertFrom: (n, e, t) => n.summary && e === "enable" ? n.summary.enable : n.type === "data-grid-column" ? n.enableSummary === void 0 ? !1 : n.enableSummary : "" }, Ro = { convertTo: (n, e, t, o) => { n.group ? n.group[e] = t : n.group = { [e]: t }, e === "enable" && t && (n.group ? n.group.groupFields || (n.group.groupFields = []) : n.group = { enable: t, groupFields: [], showSummary: !1 }); }, convertFrom: (n, e, t) => { if (n.group) { if (e === "enable") return n.group.enable; if (e === "showSummary") return n.group.showSummary; } } }, jo = { convertFrom: (n, e) => n.binding ? n.binding.path : "", convertTo: (n, e, t) => { if (t && t.length > 0) { const o = t[0]; n.binding || (n.binding = {}), n.binding.type = "Form", n.binding.path = o.bindingField, n.binding.field = o.id, n.binding.fullPath = o.path, n.path = o.bindingPath; } } }, Vo = { convertTo: (n, e, t, o) => { n.pagination || (n.pagination = {}), n.pagination[e] = t; }, convertFrom: (n, e, t) => n.pagination ? n.pagination[e] : n[e] }, $o = { convertTo: (n, e, t, o) => { n.rowNumber || (n.rowNumber = {}), n.rowNumber[e] = t; }, convertFrom: (n, e, t) => n.rowNumber ? n.rowNumber[e] : n[e] }, Lo = { convertTo: (n, e, t, o) => { n.selection || (n.selection = {}), n.selection[e] = t; }, convertFrom: (n, e, t) => n.selection ? n.selection[e] : n[e] }, zo = { convertFrom: (n, e, t) => n[e] && n[e].length ? `共 ${n[e].length} 项` : "" }, Ho = { convertFrom: (n, e) => n[e] || "", convertTo: (n, e, t) => { n[e] = t; } }, Ao = { convertTo: (n, e, t, o) => { n.size || (n.size = {}), n.size[e] = t; }, convertFrom: (n, e, t) => n.size ? n.size[e] : n[e] }, Uo = { convertFrom: (n, e, t) => { var o, r; return (o = n.formatter) != null && o.data && e === "formatterEnumData" && !n.formatterEnumData ? (r = n.formatter) == null ? void 0 : r.data : n.formatterEnumData; } }, _o = { convertTo: (n, e, t, o) => { n.sort || (n.sort = {}), n.sort[e] = t; }, convertFrom: (n, e, t) => { var o, r; if (e === "mode") return ((o = n.sort) == null ? void 0 : o.mode) || "client"; if (e === "multiSort") return !!((r = n.sort) != null && r.multiSort); } }, qo = { convertTo: (n, e, t, o) => { n.filter || (n.filter = {}), n.filter[e] = t; }, convertFrom: (n, e, t) => { var o; if (e === "mode") return ((o = n.filter) == null ? void 0 : o.mode) || "client"; } }, Wo = { convertTo: (n, e, t, o) => { n.rowOption ? n.rowOption[e] = t : n.rowOption = { [e]: t }; }, convertFrom: (n, e, t) => { if (n.rowOption) { if (e === "customRowStyle") return n.rowOption.customRowStyle; if (e === "customCellStyle") return n.rowOption.customCellStyle; } return ""; } }; function nn(n, e, t) { const o = /* @__PURE__ */ new Map([ ["/converter/appearance.converter", Eo], ["/converter/buttons.converter", ko], ["/converter/property-editor.converter", Fo], ["/converter/items-count.converter", zo], ["/converter/type.converter", Bo], ["/converter/change-editor.converter", Oo], ["/converter/change-formatter.converter", Io], ["/converter/column-command.converter", Po], ["/converter/column-option.converter", No], ["/converter/summary.converter", Do], ["/converter/group.converter", Ro], ["/converter/form-group-label.converter", Ho], ["/converter/field-selector.converter", jo], ["/converter/pagination.converter", Vo], ["/converter/row-number.converter", $o], ["/converter/grid-selection.converter", Lo], ["/converter/size.converter", Ao], ["/converter/change-formatter-enum.converter", Uo], ["/converter/grid-sort.converter", _o], ["/converter/grid-filter.converter", qo], ["/converter/row-option.converter", Wo] ]), r = /* @__PURE__ */ new Map([ ["string", { type: "input-group", enableClear: !1 }], ["boolean", { type: "combo-list", textField: "name", valueField: "value", idField: "value", enableClear: !1, editable: !1, 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 }] ]), a = Mo(); function i(d, v) { return () => a.parseValueSchema(d, v); } function c(d, v, w) { return d.includes("visible") && v.visible !== void 0 ? typeof v.visible == "boolean" ? () => !!v.visible : v.visible === void 0 ? !0 : i(v.visible, w) : () => !0; } function s(d, v, w) { return d.includes("readonly") && v.readonly !== void 0 ? typeof v.readonly == "boolean" ? () => !!v.readonly : i(v.readonly, w) : () => !1; } function l(d, v) { const w = d.$converter || v; return typeof w == "string" && w && o.has(w) ? o.get(w) || null : w || null; } function f(d, v, w, M, O, z = "", T = "") { return Object.keys(d).map((g) => { const F = C(1), k = g, x = d[g], P = Object.keys(x), b = x.title, E = x.type, N = r.get(E) || { type: "input-group", enableClear: !1 }, R = x.editor ? Object.assign({}, N, x.editor) : Object.assign({}, N), $ = c(P, x, v), W = s(P, x, v); R.readonly = R.readonly === void 0 ? W() : R.readonly; const ee = x.type === "cascade" ? f(x.properties, v, w, M, O, z, T) : [], j = !0; let D = l(x, T); const G = U({ get() { if (F.value) { if (["class", "style"].find((le) => le === k) && !D && (D = o.get("/converter/appearance.converter") || null), D && D.convertFrom) return D.convertFrom(w, g, O, z); const re = w[g]; return Object.prototype.hasOwnProperty.call(x, "defaultValue") && (re === void 0 || typeof re == "string" && re === "") ? x.type === "boolean" ? x.defaultValue : x.defaultValue || "" : re; } return null; }, set(re) { F.value += 1, D && D.convertTo ? (D.convertTo(M, g, re, O, z), D.convertTo(w, g, re, O, z)) : (M[g] = re, w[g] = re); } }), { refreshPanelAfterChanged: H, description: te, isExpand: ve, parentPropertyID: he } = x, X = { propertyID: k, propertyName: b, propertyType: E, propertyValue: G, editor: R, visible: $, readonly: W, cascadeConfig: ee, hideCascadeTitle: j, refreshPanelAfterChanged: H, description: te, isExpand: ve, parentPropertyID: he }; return v[k] = X, X; }); } function u(d, v, w = {}) { const M = {}, O = n[d]; return O && O.categories ? Object.keys(O.categories).map((T) => { const h = O.categories[T], g = h == null ? void 0 : h.title, F = f(h.properties || {}, M, {}, w, v); return { categoryId: T, categoryName: g, properties: F }; }) : []; } function m(d, v, w, M, O = "") { const z = v.$ref.schema, T = v.$ref.converter, h = w[z], g = h.type, F = t(h), k = {}, x = n[g]; if (x && x.categories) { const P = x.categories[d], b = P == null ? void 0 : P.title; T && Object.keys(P.properties).forEach((R) => { P.properties[R].$converter = T; }); const E = (P == null ? void 0 : P.properties) || {}, N = f(E, k, F, h, M, O); return { categoryId: d, categoryName: b, properties: N }; } return { categoryId: d, categoryName: "", properties: [] }; } function p(d, v, w, M, O) { const z = d.type, T = t(d), h = {}; let g = O || n[z]; if (g && Object.keys(g).length === 0 && w && w.getPropConfig && (g = w.getPropConfig(M)), g && g.categories) { const F = []; return Object.keys(g.categories).map((k) => { const x = g.categories[k]; if (x.$ref) { F.push(m(k, x, d, v, M)); return; } const P = x == null ? void 0 : x.title, b = x == null ? void 0 : x.tabId, E = x == null ? void 0 : x.tabName, N = x == null ? void 0 : x.hide, R = x == null ? void 0 : x.hideTitle, $ = f(x.properties || {}, h, T, d, v, M, x.$converter), { setPropertyRelates: W } = x, ee = x == null ? void 0 : x.parentPropertyID; F.push({ categoryId: k, categoryName: P, tabId: b, tabName: E, hide: N, properties: $, hideTitle: R, setPropertyRelates: W, parentPropertyID: ee }); }), F; } return []; } return { getPropertyConfigBySchema: p, getPropertyConfigByType: u, propertyConverterMap: o }; } const on = {}, rn = {}; nn(on, rn, So); const an = {}, sn = {}, { getSchemaByType: Ns, resolveSchemaWithDefaultValue: Go, resolveSchemaToProps: Ds, mappingSchemaToProps: Rs, setDesignerContext: js } = Kt(an, sn), ln = {}, cn = {}; nn(ln, cn, Go); function st(n, e, t = /* @__PURE__ */ new Map(), o = (i, c, s, l) => c, r = {}, a = (i) => i) { return en[e.title] = e, tn[e.title] = o, on[e.title] = r, rn[e.title] = a, an[e.title] = e, sn[e.title] = o, ln[e.title] = r, cn[e.title] = a, (i = {}, c = !0) => { if (!c) return To(i, t); const s = xo(i, e, t), l = Object.keys(n).reduce((f, u) => (f[u] = n[u].default, f), {}); return Object.assign(l, s); }; } function Vt(n, e) { return { customClass: e.class, customStyle: e.style }; } const Yo = /* @__PURE__ */ new Map([ ["appearance", Vt] ]), Xo = "https://json-schema.org/draft/2020-12/schema", Qo = "https://farris-design.gitee.io/content-container.schema.json", Jo = "content-container", Zo = "A Farris Container Component", Ko = "object", er = { 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 } }, tr = [ "id", "type", "contents" ], nr = { $schema: Xo, $id: Qo, title: Jo, description: Zo, type: Ko, properties: er, required: tr }; function or(n, e, t) { return e; } const $t = { customClass: { type: String, default: "" }, customStyle: { type: String, default: "" }, /** 控制是否可见 */ visible: { type: Boolean, default: !0 } }, Yt = st($t, nr, Yo, or), It = /* @__PURE__ */ Be({ name: "FContentContainer", props: $t, emits: [], setup(n, e) { return () => n.visible && S("div", { class: n.customClass, style: n.customStyle }, [e.slots.default && e.slots.default()]); } }); function rr() { function n(e, t) { 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 = t == null ? void 0 : t.formSchemaUtils.getComponentById(o.belongedComponentId); return !((e.componentCategory === "input" || e.componentType === "form-group") && ![B["response-layout-item"].type, B["response-form"].type, B.fieldset.type].includes(r) || (e.componentType === B.tabs.type || e.componentType === B.section.type) && ((a == null ? void 0 : a.componentType) !== "frame" || ![B["content-container"].type, B["splitter-pane"].type, B["response-layout-item"].type].includes(r)) || [B["query-solution"].type, B["filter-bar"].type].includes(e.componentType) || e.componentType === B.fieldset.type && r !== B["response-form"].type); } return { basalDragulaRuleForContainer: n }; } class ir { getTemplateRule(e, t) { const o = t == null ? void 0 : t.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: c } = i; return c.forEach((s) => { if (!s || !r[s]) return; const { canMove: l, canDelete: f, canAccept: u } = r[s]; a.canMove = a.canMove && this.resolveRuleValue(l, i), a.canDelete = a.canDelete && this.resolveRuleValue(f, i), a.canAccept = a.canAccept && this.resolveRuleValue(u, i); }), a; } resolveRuleValue(e, t) { return typeof e == "boolean" ? e : this.parseRuleValueSchema(e, t); } parseRuleValueSchema(e, t) { const o = e.invalidContext || []; let r = !0; for (const a of o) { const { firstLevelChild: i, secondLevelChild: c, parent: s, ...l } = a; if (l && t.component) { let f = !0; for (const u of Object.keys(l)) if (l[u] !== t.component[u]) { f = !1; break; } if (!f) { r = !1; continue; } } if (a.firstLevelChild) { if (a.firstLevelChild.class) { const { firstLevelChildClassList: f } = t; if (f && !f.includes(a.firstLevelChild.class)) { r = !1; continue; } } if (a.firstLevelChild.type) { const { firstLevelChildSchema: f } = t; if (!f || f.type !== a.firstLevelChild.type) { r = !1; continue; } } } if (a.secondLevelChild) { if (a.secondLevelChild.class) { const { secondLevelChildClassList: f } = t; if (f && !f.includes(a.secondLevelChild.class)) { r = !1; continue; } } if (a.secondLevelChild.type) { const { secondLevelChildSchema: f } = t; if (!f || f.type !== a.secondLevelChild.type) { r = !1; continue; } } } if (a.parent) { if (a.parent.class) { const { parentClassList: f } = t; if (f && !f.includes(a.parent.class)) { r = !1; continue; } } if (a.parent.type) { const { parentSchema: f } = t; if (f && f.type !== a.parent.type) { r = !1; continue; } } } r = !0; break; } return !r; } getComponentContext(e) { var v, w, M, O; const t = e.schema, o = t.appearance && t.appearance.class || "", r = o.split(" ") || [], a = t.contents || [], i = a.length ? a[0] : null, c = i && i.appearance ? i.appearance.class : "", s = c ? c.split(" ") : [], l = (v = i == null ? void 0 : i.contents) != null && v.length ? i == null ? void 0 : i.contents[0] : null, f = l && l.appearance ? l.appearance.class : "", u = f ? f.split(" ") : [], m = t.type === "component" ? (M = (w = e.parent) == null ? void 0 : w.parent) == null ? void 0 : M.schema : (O = e.parent) == null ? void 0 : O.schema, p = m && m.appearance && m.appearance.class || "", d = p ? p.split(" ") : []; return { componentClass: o, componentClassList: r, childContents: a, firstLevelChildSchema: i, firstLevelChildClass: c, firstLevelChildClassList: s, secondLevelChildSchema: l, secondLevelChildClass: f, secondLevelChildClassList: u, parentSchema: m, parentClass: p, parentClassList: d, component: t }; } } const ar = C(0); var Ve = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function ut(n) { throw new Error('Could not dynamically require "' + n + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var sr = { exports: {} }; (function(n, e) { (function(t) { n.exports = t(); })(function() { return (/* @__PURE__ */ function() { function t(o, r, a) { function i(l, f) { if (!r[l]) { if (!o[l]) { var u = typeof ut == "function" && ut; if (!f && u) return u(l, !0); if (c) return c(l, !0); var m = new Error("Cannot find module '" + l + "'"); throw m.code = "MODULE_NOT_FOUND", m; } var p = r[l] = { exports: {} }; o[l][0].call(p.exports, function(d) { var v = o[l][1][d]; return i(v || d); }, p, p.exports, t, o, r, a); } return r[l].exports; } for (var c = typeof ut == "function" && ut, s = 0; s < a.length; s++) i(a[s]); return i; } return t; }())({ 1: [function(t, o, r) { var a = {}, i = "(?:^|\\s)", c = "(?:\\s|$)"; function s(u) { var m = a[u]; return m ? m.lastIndex = 0 : a[u] = m = new RegExp(i + u + c, "g"), m; } function l(u, m) { var p = u.className; p.length ? s(m).test(p) || (u.className += " " + m) : u.className = m; } function f(u, m) { u.className = u.className.replace(s(m), " ").trim(); } o.exports = { add: l, rm: f }; }, {}], 2: [function(t, o, r) { (function(a) { var i = t("contra/emitter"), c = t("crossvent"), s = t("./classes"), l = document, f = l.documentElement; function u(b, E) { var N = arguments.length; N === 1 && Array.isArray(b) === !1 && (E = b, b = []); var R, $, W, ee, j, D, G, H, te, ve = null, he, X, re = !1, le = 0, ne, _ = E || {}; _.moves === void 0 && (_.moves = O), _.accepts === void 0 && (_.accepts = O), _.invalid === void 0 && (_.invalid = et), _.containers === void 0 && (_.containers = b || []), _.isContainer === void 0 && (_.isContainer = M), _.copy === void 0 && (_.copy = !1), _.copySortSource === void 0 && (_.copySortSource = !1), _.revertOnSpill === void 0 && (_.revertOnSpill = !1), _.removeOnSpill === void 0 && (_.removeOnSpill = !1), _.direction === void 0 && (_.direction = "vertical"), _.ignoreInputTextSelection === void 0 && (_.ignoreInputTextSelection = !0), _.mirrorContainer === void 0 && (_.mirrorContainer = l.body); var oe = i({ containers: _.containers, start: Pe, end: Ae, cancel: Q, remove: I, destroy: ze, canMove: Ie, dragging: !1 }); return _.removeOnSpill === !0 && oe.on("over", bt).on("out", wt), Oe(), oe; function Le(y) { return oe.containers.indexOf(y) !== -1 || _.isContainer(y); } function Oe(y) { var V = y ? "remove" : "add"; d(f, V, "mousedown", ce), d(f, V, "mouseup", De); } function xe(y) { var V = y ? "remove" : "add"; d(f, V, "mousemove", Ke); } function Ye(y) { var V = y ? "remove" : "add"; c[V](f, "selectstart", He), c[V](f, "click", He); } function ze() { Oe(!0), De({}); } function He(y) { he && y.preventDefault(); } function ce(y) { ee = y.clientX, j = y.clientY; var V = v(y) !== 1 || y.metaKey || y.ctrlKey; if (!V) { var L = y.target, q = Te(L); q && (he = q, xe(), y.type === "mousedown" && (g(L) ? L.focus() : y.preventDefault())); } } function Ke(y) { if (he) { if (v(y) === 0) { De({}); return; } if (!(y.clientX !== void 0 && Math.abs(y.clientX - ee) <= (_.slideFactorX || 0) && y.clientY !== void 0 && Math.abs(y.clientY - j) <= (_.slideFactorY || 0))) { if (_.ignoreInputTextSelection) { var V = P("clientX", y) || 0, L = P("clientY", y) || 0, q = l.elementFromPoint(V, L); if (g(q)) return; } var J = he; xe(!0), Ye(), Ae(), Ne(J), s.add(H || W, "gu-transit"), St(), Ct(), le = 0, tt(y); } } } function Te(y) { if (!(oe.dragging && R) && !Le(y)) { for (var V = y; h(y) && Le(h(y)) === !1; ) if (_.invalid(y, V) || (y = h(y), !y)) return; var L = h(y); if (L && !_.invalid(y, V)) { var q = _.moves(y, L, V, k(y)); if (q) return { item: y, source: L }; } } } function Ie(y) { return !!Te(y); } function Pe(y) { var V = Te(y); V && Ne(V); } function Ne(y) { Bt(y.item, y.source) && (H = y.item.cloneNode(!0), oe.emit("cloned", H, y.item, "copy")), $ = y.source, W = y.item, D = G = k(y.item), oe.dragging = !0, oe.emit("drag", W, $); } function et() { return !1; } function Ae() { if (oe.dragging) { var y = H || W; Xe(y, h(y)); } } function Fe() { he = !1, xe(!0), Ye(!0); } function De(y) { if (Fe(), !!oe.dragging) { var V = H || W, L = P("clientX", y) || 0, q = P("clientY", y) || 0, J = w(R, L, q), Z = Re(J, L, q); Z && (H && _.copySortSource || !H || Z !== $) ? Xe(V, Z) : _.removeOnSpill ? I() : Q(); } } function Xe(y, V) { var L = h(y); H && _.copySortSource && V === $ && L.removeChild(W), se(V) ? oe.emit("cancel", y, $) : oe.emit("drop", y, V, $, G), ae(); } function I() { if (oe.dragging) { var y = H || W, V = h(y); V && V.removeChild(y), oe.emit(H ? "cancel" : "remove", y, V, $), ae(); } } function Q(y) { if (oe.dragging) { var V = arguments.length > 0 ? y : _.revertOnSpill, L = H || W, q = h(L), J = se(q); J === !1 && V && (H ? q && q.removeChild(H) : $.insertBefore(L, D)), J || V ? oe.emit("cancel", L, $, $) : oe.emit("drop", L, q, $, G), ae(); } } function ae() { var y = H || W; Fe(), xt(), Tt(), y && s.rm(y, "gu-transit"), te && clearTimeout(te), oe.dragging = !1, ve && oe.emit("out", y, ve, $), oe.emit("dragend", y, le), $ = W = H = D = G = te = ve = null; } function se(y, V) { var L; return V !== void 0 ? L = V : R ? L = G : L = k(H || W), y === $ && L === D; } function Re(y, V, L) { for (var q = y; q && !J(); ) q = h(q); return q; function J() { var Z = Le(q); if (Z === !1) return !1; var Ce = lt(q, y), ge = ct(q, Ce, V, L), ye = se(q, ge); return ye ? !0 : _.accepts(W, q, $, ge); } } function tt(y) { if (!R) return; y.preventDefault(); var V = P("clientX", y) || 0, L = P("clientY", y) || 0; R.style.left = V - 2 + "px", R.style.top = L - 2 + "px"; var q = H || W, J = w(R, V, L), Z = Re(J, V, L), Ce = Z !== null && Z !== ve; (Ce || Z === null) && (be(), ve = Z, Ee()), Ft(J, L); var ge = h(q); if (Z === $ && H && !_.copySortSource) { ge && ge.removeChild(q); return; } var ye, Me = lt(Z, J); if (re = nt(Me, Z), Me !== null) ye = ct(Z, Me, V, L); else if (_.revertOnSpill === !0 && !H) ye = D, Z = $; else { H && ge && ge.removeChild(q), H && X && (X.style.display = "none"); return; } X.style.display = "block", yt(ye, q, Ce), ye ? Et(Me, ye) : kt(Z); function ue(pe) { oe.emit(pe, q, ve, $); } function Ee() { Ce && ue("over"); } function be() { ve && ue("out"); } } function yt(y, V, L) { (y === V || y === k(V)) && (G = k(V)), (y === null && L || y !== V && y !== k(V)) && (G = y); } function bt(y) { s.rm(y, "gu-hide"); } function wt(y) { oe.dragging && s.add(y, "gu-hide"); } function Ct() { R || (R = document.createElement("div"), R.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;", R.innerHTML = _.getMirrorText && _.getMirrorText(W) || "控件", s.add(R, "gu-mirror"), _.mirrorContainer.appendChild(R), d(f, "add", "mousemove", tt), s.add(_.mirrorContainer, "gu-unselectable"), oe.emit("cloned", R, W, "mirror")); } function St() { if (X = document.createElement("div"), s.add(X, "gu-insertion"), W) { var y = W.getBoundingClientRect(); X.style.left = y.left + "px", X.style.top = y.top + "px"; } re = !1, _.mirrorContainer.appendChild(X); } function xt() { R && (s.rm(_.mirrorContainer, "gu-unselectable"), d(f, "remove", "mousemove", tt), h(R).removeChild(R), R = null); } function Tt() { X && (h(X).removeChild(X), X = null); } function lt(y, V) { for (var L = V; L !== y && h(L) !== y; ) L = h(L); return L === f ? null : L; } function nt(y, V) { if (!V) return re; var L = y || V && V.lastElementChild; if (!L) return !0; var q = getComputedStyle(y), J = /^inline/.test(q.getPropertyValue("display")) || /^(left|right)$/.test(q.getPropertyValue("float")); if (J) return !0; if (V) { var Z = getComputedStyle(V), Ce = Z.getPropertyValue("display"); if (/flex$/.test(Ce)) { var ge = Z.getPropertyValue("flex-direction") || "row"; if (ge === "row" || ge === "row-reverse") return !Mt(V); } return !1; } return !0; } function Mt(y) { if (!y.children || !y.children.length) return !1; for (const V of Array.from(y.children)) { const q = (V.className && V.className.split(" ") || []).filter((J) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(J)); if (!q.length) return !1; for (const J of q) { const Z = J.slice(J.lastIndexOf("-") + 1); if (parseInt(Z, 10) !== 12) return !1; } } return !0; } function Et(y, V) { const L = V.getBoundingClientRect(); if (X.style.left = L.left + "px", X.style.top = L.top + "px", re) { if (X.style.height = L.height + "px", X.style.width = "4px", y) { const q = y.getBoundingClientRect(); q.top !== L.top && (X.style.left = q.right + "px", X.style.top = q.top + "px", X.style.height = q.height + "px"); } } else if (X.style.height = "4px", X.style.width = L.width + "px", ne) { const q = ne.getBoundingClientRect(); L.top < q.top && (X.style.display = "none"); } V === W && W && (X.style.display = "none"); } function kt(y) { G = null; var V = y.lastElementChild; if (V) { var L = V.getBoundingClientRect(); re ? (X.style.left = L.right + "px", X.style.top = L.top + "px", X.style.height = L.height + "px", X.style.width = "4px") : (X.style.left = L.left + "px", X.style.top = L.bottom + "px", X.style.height = "4px", X.style.width = L.width + "px"), V === W && W && (X.style.display = "none"); } else X.style.display = "none"; } function Ft(y, V) { if (!_.mirrorContainer.contains(y) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (ne = m(y), !ne || !ne.contains(y))) return; const L = document.querySelector(".dgComponentSelected"), q = ne.getBoundingClientRect(); if (V - 30 < q.top && ne.scrollTop > 0) { let J = ne.scrollTop < 10 ? ne.scrollTop : 10; ne.scrollBy(0, -1 * J), L && ne.contains(L) && (le = le + -1 * J); } if (V + 30 > q.bottom && ne.scrollTop < ne.scrollHeight - ne.clientHeight) { const J = ne.scrollHeight - ne.clientHeight - ne.scrollTop; let Z = J < 10 ? J : 10; ne.scrollBy(0, Z), L && ne.contains(L) && (le = le + Z); } } function ct(y, V, L, q) { var J = _.direction === "horizontal", Z = _.direction === "mixed", Ce = V !== y ? ye() : ge(); return Ce; function ge() { var ue = y.children.length, Ee, be, pe; for (Ee = 0; Ee < ue; Ee++) if (be = y.children[Ee], pe = be.getBoundingClientRect(), J && pe.left + pe.width / 2 > L || !Z && !J && pe.top + pe.height / 2 > q || Z && pe.left + pe.width > L && pe.top + pe.height > q) return be; return null; } function ye() { var ue = V.getBoundingClientRect(); if (Z) { var Ee = q - ue.top, be = L - ue.left, pe = ue.bottom - q, ot = ue.right - L, rt = Math.min(be, ot, Ee, pe), it; return re ? it = ot < be : it = pe === rt || ot === rt || be === rt, Me(it); } return Me(J ? L > ue.left + z(ue) / 2 : q > ue.top + T(ue) / 2); } function Me(ue) { return ue ? k(V) : V; } } function Bt(y, V) { return typeof _.copy == "boolean" ? _.copy : _.copy(y, V); } } function m(b) { const E = Array.from(window.scrollContainerList); if (E.length === 1) { const R = Array.from(window.scrollContainerList)[0]; return document.getElementById(R); } const N = p(E); for (const R of N) if (R.contains(b)) return R; return null; } function p(b) { const E = []; return b.forEach((N) => { const R = document.getElementById(N); R && E.push(R); }), E.sort((N, R) => N.contains(R) ? 1 : R.contains(N) ? -1 : 0), E; } function d(b, E, N, R) { var $ = { mouseup: "touchend", mousedown: "touchstart", mousemove: "touchmove" }, W = { mouseup: "pointerup", mousedown: "pointerdown", mousemove: "pointermove" }, ee = { mouseup: "MSPointerUp", mousedown: "MSPointerDown", mousemove: "MSPointerMove" }; a.navigator.pointerEnabled ? c[E](b, W[N], R) : a.navigator.msPointerEnabled ? c[E](b, ee[N], R) : (c[E](b, $[N], R), c[E](b, N, R)); } function v(b) { if (b.touches !== void 0) return b.touches.length; if (b.which !== void 0 && b.which !== 0) return b.which; if (b.buttons !== void 0) return b.buttons; var E = b.button; if (E !== void 0) return E & 1 ? 1 : E & 2 ? 3 : E & 4 ? 2 : 0; } function w(b, E, N) { b = b || {}; var R = b.className || "", $; return b.className += " gu-hide", $ = l.elementFromPoint(E, N), b.className = R, $; } function M() { return !1; } function O() { return !0; } function z(b) { return b.width || b.right - b.left; } function T(b) { return b.height || b.bottom - b.top; } function h(b) { return b.parentNode === l ? null : b.parentNode; } function g(b) { return b.tagName === "INPUT" || b.tagName === "TEXTAREA" || b.tagName === "SELECT" || F(b); } function F(b) { return !b || b.contentEditable === "false" ? !1 : b.contentEditable === "true" ? !0 : F(h(b)); } function k(b) { return b.nextElementSibling || E(); function E() { var N = b; do N = N.nextSibling; while (N && N.nodeType !== 1); return N; } } function x(b) { return b.targetTouches && b.targetTouches.length ? b.targetTouches[0] : b.changedTouches && b.changedTouches.length ? b.changedTouches[0] : b; } function P(b, E) { var N = x(E), R = { pageX: "clientX", // IE8