@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,401 lines • 262 kB
JavaScript
var Wn = Object.defineProperty;
var Yn = (e, t, n) => t in e ? Wn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var Ve = (e, t, n) => Yn(e, typeof t != "symbol" ? t + "" : t, n);
import { ref as C, computed as H, inject as be, defineComponent as we, createVNode as r, onMounted as Je, createTextVNode as ye, Fragment as lt, onBeforeMount as Ut, reactive as Xe, withDirectives as on, resolveDirective as an, watch as Te, mergeProps as Lt, createApp as vn, onUnmounted as Et, Transition as pn, nextTick as Gt, Teleport as Xn, shallowRef as Jn, render as Ht, h as Qn, cloneVNode as Zn, provide as kt } from "vue";
import { cloneDeep as se, isPlainObject as rn, isUndefined as ct } from "lodash-es";
import { useGuid as Wt, ControllerSchemaRepositorySymbol as Kn, FormSchemaEntityField$Type as ln, FormSchemaEntityFieldTypeName as sn, getCustomClass as _t, withInstall as eo } from "../common/index.esm.js";
import { schemaMap as hn, getSchemaByTypeForDesigner as to, resolveAppearance as no, createPropsResolver as gn } from "../dynamic-resolver/index.esm.js";
import { FNotifyService as ht } from "../notify/index.esm.js";
import oo, { FTreeView as ao } from "../tree-view/index.esm.js";
import ro, { FSchemaSelector as lo } from "../schema-selector/index.esm.js";
import io, { F_MODAL_SERVICE_TOKEN as so } from "../modal/index.esm.js";
import co from "../input-group/index.esm.js";
import yn from "../combo-list/index.esm.js";
import Yt from "../event-parameter/index.esm.js";
import { useI18n as Xt } from "vue-i18n";
import "../designer-canvas/index.esm.js";
import "../property-panel/index.esm.js";
import uo from "../accordion/index.esm.js";
import mo from "../avatar/index.esm.js";
import fo from "../../designer/button-edit/index.esm.js";
import vo from "../button-group/index.esm.js";
import po from "../calendar/index.esm.js";
import ho from "../capsule/index.esm.js";
import cn from "../../designer/checkbox/index.esm.js";
import un from "../../designer/checkbox-group/index.esm.js";
import go from "../combo-tree/index.esm.js";
import yo from "../component/index.esm.js";
import bo from "../color-picker/index.esm.js";
import Co from "../content-container/index.esm.js";
import wo from "../date-picker/index.esm.js";
import So from "../../designer/data-grid/index.esm.js";
import Fo from "../dropdown/index.esm.js";
import Eo from "../dynamic-form/index.esm.js";
import To from "../events-editor/index.esm.js";
import xo from "../filter-bar/index.esm.js";
import Mo from "../field-selector/index.esm.js";
import Bo from "../binding-selector/index.esm.js";
import ko from "../image-cropper/index.esm.js";
import No from "../../designer/input-group/index.esm.js";
import Po from "../layout/index.esm.js";
import Oo from "../list-nav/index.esm.js";
import Io from "../../designer/list-view/index.esm.js";
import Lo from "../lookup/index.esm.js";
import Ro from "../mapping-editor/index.esm.js";
import Do from "../nav/index.esm.js";
import Vo from "../number-range/index.esm.js";
import $o from "../number-spinner/index.esm.js";
import jo from "../order/index.esm.js";
import Ao from "../page-header/index.esm.js";
import Ho from "../page-footer/index.esm.js";
import zo from "../pagination/index.esm.js";
import _o from "../progress/index.esm.js";
import qo from "../query-solution/index.esm.js";
import Uo from "../../designer/radio-group/index.esm.js";
import Go from "../rate/index.esm.js";
import Wo from "../response-toolbar/index.esm.js";
import Yo from "../response-layout/index.esm.js";
import Xo from "../response-layout-editor/index.esm.js";
import Jo from "../search-box/index.esm.js";
import Qo from "../section/index.esm.js";
import Zo from "../smoke-detector/index.esm.js";
import Ko from "../splitter/index.esm.js";
import ea from "../step/index.esm.js";
import ta from "../switch/index.esm.js";
import na from "../tabs/index.esm.js";
import oa from "../tags/index.esm.js";
import aa from "../text/index.esm.js";
import ra from "../time-picker/index.esm.js";
import la from "../transfer/index.esm.js";
import ia from "../uploader/index.esm.js";
import sa from "../verify-detail/index.esm.js";
import ca from "../video/index.esm.js";
import ua from "../textarea/index.esm.js";
import da from "../../designer/tree-grid/index.esm.js";
import ma from "../filter-condition-editor/index.esm.js";
import fa from "../fieldset/index.esm.js";
import va from "../sort-condition-editor/index.esm.js";
import pa from "../menu-lookup/index.esm.js";
import ha from "../../designer/drawer/index.esm.js";
import ga from "../json-editor/index.esm.js";
import ya from "../property-editor/index.esm.js";
import ba from "../expression-editor/index.esm.js";
import Ca from "../code-editor/index.esm.js";
import wa from "../html-template/index.esm.js";
import Sa from "../collection-property-editor/index.esm.js";
import Fa from "../external-container/index.esm.js";
import Ea from "../language-textbox/index.esm.js";
import { LocaleService as Rt } from "../locale/index.esm.js";
import { useResizeObserver as Ta } from "@vueuse/core";
import { getHierarchyRow as xa, useIdentify as Ma, useGroupData as Ba, useFilter as ka, useHierarchy as Na, useLoading as Pa, useDataView as Oa, useSelection as Ia, useSelectHierarchyItem as La, usePagination as Ra, useDataViewContainerStyle as Da, useCommandColumn as Va, useSettingColumn as $a, useColumn as ja, useSort as Aa, useGroupColumn as Ha, useRow as za, useEdit as _a, useVisualDataBound as qa, useVisualDataCell as Ua, useVisualDataRow as Ga, useVisualData as Wa, useCellPosition as Ya, useSidebar as Xa, useVirtualScroll as Ja, useFitColumn as Qa, useFilterHistory as Za, useColumnFilter as Ka, useDragColumn as er, getColumnHeader as tr, getSidebar as nr, getDisableMask as or, getHorizontalScrollbar as ar, getVerticalScrollbar as rr, getEmpty as lr, getPagination as ir, getSummary as sr } from "../data-view/index.esm.js";
function bn(e, t) {
let n;
function o(i) {
const { properties: d, title: u, ignore: f } = i, S = f && Array.isArray(f), F = Object.keys(d).reduce((E, k) => ((!S || !f.find((L) => L === k)) && (E[k] = d[k].type === "object" && d[k].properties ? o(d[k]) : se(d[k].default)), E), {});
if (u && (!S || !f.find((E) => E === "id"))) {
const E = u.toLowerCase().replace(/-/g, "_");
F.id = `${E}_${Math.random().toString().slice(2, 6)}`;
}
return F;
}
function a(i) {
const { properties: d, title: u, required: f } = i;
if (f && Array.isArray(f)) {
const S = f.reduce((F, E) => (F[E] = d[E].type === "object" && d[E].properties ? o(d[E]) : se(d[E].default), F), {});
if (u && f.find((F) => F === "id")) {
const F = u.toLowerCase().replace(/-/g, "_");
S.id = `${F}_${Math.random().toString().slice(2, 6)}`;
}
return S;
}
return {
type: u
};
}
function l(i, d = {}, u) {
const f = e[i];
if (f) {
let S = a(f);
const F = t[i];
return S = F ? F({ getSchemaByType: l }, S, d, u) : S, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(S), S;
}
return null;
}
function s(i, d) {
const u = o(d);
return Object.keys(u).reduce((f, S) => (Object.prototype.hasOwnProperty.call(i, S) && (f[S] && rn(f[S]) && rn(i[S] || !i[S]) ? Object.assign(f[S], i[S] || {}) : f[S] = i[S]), f), u), u;
}
function m(i, d) {
return Object.keys(i).filter((f) => i[f] != null).reduce((f, S) => {
if (d.has(S)) {
const F = d.get(S);
if (typeof F == "string")
f[F] = i[S];
else {
const E = F(S, i[S], i);
Object.assign(f, E);
}
} else
f[S] = i[S];
return f;
}, {});
}
function y(i, d, u = /* @__PURE__ */ new Map()) {
const f = s(i, d);
return m(f, u);
}
function h(i) {
var u;
const d = i.type;
if (d) {
const f = e[d];
if (!f)
return i;
const S = s(i, f), F = ((u = i.editor) == null ? void 0 : u.type) || "";
if (F) {
const E = e[F], k = s(i.editor, E);
S.editor = k;
}
return S;
}
return i;
}
function g(i) {
n = i;
}
return { getSchemaByType: l, resolveSchemaWithDefaultValue: h, resolveSchemaToProps: y, mappingSchemaToProps: m, setDesignerContext: g };
}
const Cn = {}, wn = {}, { getSchemaByType: Gc, resolveSchemaWithDefaultValue: cr, resolveSchemaToProps: ur, mappingSchemaToProps: dr, setDesignerContext: Wc } = bn(Cn, wn);
function mr(e = {}) {
function t(h, g, i, d) {
if (typeof i == "number")
return d[h].length === i;
if (typeof i == "object") {
const u = Object.keys(i)[0], f = i[u];
if (u === "not")
return Number(d[h].length) !== Number(f);
if (u === "moreThan")
return Number(d[h].length) >= Number(f);
if (u === "lessThan")
return Number(d[h].length) <= Number(f);
}
return !1;
}
function n(h, g, i, d) {
return d[h] && d[h].propertyValue && String(d[h].propertyValue.value) === String(i);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", n]
]);
Object.keys(e).reduce((h, g) => (h.set(g, e[g]), h), o);
function a(h, g) {
const i = h;
return typeof g == "number" ? [{ target: i, operator: "length", param: null, value: Number(g) }] : typeof g == "boolean" ? [{ target: i, operator: "getProperty", param: h, value: !!g }] : typeof g == "object" ? Object.keys(g).map((d) => {
if (d === "length")
return { target: i, operator: "length", param: null, value: g[d] };
const u = d, f = g[d];
return { target: i, operator: "getProperty", param: u, value: f };
}) : [];
}
function l(h) {
return Object.keys(h).reduce((i, d) => {
const u = a(d, h[d]);
return i.push(...u), i;
}, []);
}
function s(h, g) {
if (o.has(h.operator)) {
const i = o.get(h.operator);
return i && i(h.target, h.param, h.value, g) || !1;
}
return !1;
}
function m(h, g) {
return l(h).reduce((u, f) => u && s(f, g), !0);
}
function y(h, g) {
const i = Object.keys(h), d = i.includes("allOf"), u = i.includes("anyOf"), f = d || u, E = (f ? h[f ? d ? "allOf" : "anyOf" : "allOf"] : [h]).map((L) => m(L, g));
return d ? !E.includes(!1) : E.includes(!0);
}
return { parseValueSchema: y };
}
const fr = {
convertTo: (e, t, n, o) => {
e.appearance || (e.appearance = {}), e.appearance[t] = n;
},
convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
}, vr = {
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
}, pr = {
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]
}, U = {
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: "多语输入框" }
}, hr = {
convertFrom: (e, t, n) => {
var a;
const o = e.editor && e.editor[t] ? e.editor[t] : e[t];
return ((a = U[o]) == null ? void 0 : a.name) || o;
}
}, gr = {
convertTo: (e, t, n, o) => {
e[t] = e[t];
},
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
}, yr = {
convertTo: (e, t, n, o) => {
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = {
[t]: n
});
},
convertFrom: (e, t, n) => {
if (e.formatter) {
if (t === "trueText")
return e.formatter.trueText;
if (t === "falseText")
return e.formatter.falseText;
if (t === "prefix")
return e.formatter.prefix;
if (t === "suffix")
return e.formatter.suffix;
if (t === "precision")
return e.formatter.precision;
if (t === "decimal")
return e.formatter.decimal;
if (t === "thousand")
return e.formatter.thousand;
if (t === "tempDateFormat")
return e.formatter.dateFormat === "yyyy年MM月dd日" ? "yearMonthDay" : e.formatter.dateFormat === "yyyy-MM-dd HH:mm:ss" ? "yyyy-MM-ddTHH:mm:ss" : e.formatter.dateFormat === "yyyy/MM/dd HH:mm:ss" ? "yyyy/MM/ddTHH:mm:ss" : e.formatter.dateFormat === "yyyy年MM月dd日 HH时mm分ss秒" ? "yearMonthDayHourMinuteSecond" : e.formatter.tempDateFormat || e.formatter.dateFormat || "yyyy-MM-dd";
if (t === "customFormat")
return e.formatter.customFormat;
if (t === "type")
return e.formatter.type || "none";
}
return "none";
}
}, br = {
convertTo: (e, t, n, o) => {
e.command ? e.command[t] = n : e.command = {
[t]: n
}, t === "enable" && n && (e.command.commands || (e.command.commands = [
{
text: "编辑",
type: "primary",
command: "edit"
},
{
text: "删除",
type: "danger",
command: "remove"
}
]));
},
convertFrom: (e, t, n) => e.command && t === "enable" ? e.command.enable : ""
}, Cr = {
convertTo: (e, t, n, o) => {
e.column ? e.column[t] = n : e.column = {
[t]: n
}, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average"));
},
convertFrom: (e, t, n) => {
if (e.column) {
if (t === "fitColumns")
return e.column.fitColumns;
if (t === "fitMode")
return e.column.fitMode;
}
return "";
}
}, wr = {
convertTo: (e, t, n, o) => {
e.summary ? e.summary[t] = n : e.summary = {
[t]: n
}, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
enable: n,
groupFields: []
});
},
convertFrom: (e, t, n) => e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : ""
}, Sr = {
convertTo: (e, t, n, o) => {
e.group ? e.group[t] = n : e.group = {
[t]: n
}, t === "enable" && n && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = {
enable: n,
groupFields: [],
showSummary: !1
});
},
convertFrom: (e, t, n) => {
if (e.group) {
if (t === "enable")
return e.group.enable;
if (t === "showSummary")
return e.group.showSummary;
}
}
}, Fr = {
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;
}
}
}, Er = {
convertTo: (e, t, n, o) => {
e.pagination || (e.pagination = {}), e.pagination[t] = n;
},
convertFrom: (e, t, n) => e.pagination ? e.pagination[t] : e[t]
}, Tr = {
convertTo: (e, t, n, o) => {
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
},
convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
}, xr = {
convertTo: (e, t, n, o) => {
e.selection || (e.selection = {}), e.selection[t] = n;
},
convertFrom: (e, t, n) => e.selection ? e.selection[t] : e[t]
}, Mr = {
convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
}, Br = {
convertFrom: (e, t) => e[t] || "",
convertTo: (e, t, n) => {
e[t] = n;
}
}, kr = {
convertTo: (e, t, n, o) => {
e.size || (e.size = {}), e.size[t] = n;
},
convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
}, Nr = {
convertFrom: (e, t, n) => {
var o, a;
return (o = e.formatter) != null && o.data && t === "formatterEnumData" && !e.formatterEnumData ? (a = e.formatter) == null ? void 0 : a.data : e.formatterEnumData;
}
}, Pr = {
convertTo: (e, t, n, o) => {
e.sort || (e.sort = {}), e.sort[t] = n;
},
convertFrom: (e, t, n) => {
var o, a;
if (t === "mode")
return ((o = e.sort) == null ? void 0 : o.mode) || "client";
if (t === "multiSort")
return !!((a = e.sort) != null && a.multiSort);
}
}, Or = {
convertTo: (e, t, n, o) => {
e.filter || (e.filter = {}), e.filter[t] = n;
},
convertFrom: (e, t, n) => {
var o;
if (t === "mode")
return ((o = e.filter) == null ? void 0 : o.mode) || "client";
}
}, Ir = {
convertTo: (e, t, n, o) => {
e.rowOption ? e.rowOption[t] = n : e.rowOption = {
[t]: n
};
},
convertFrom: (e, t, n) => {
if (e.rowOption) {
if (t === "customRowStyle")
return e.rowOption.customRowStyle;
if (t === "customCellStyle")
return e.rowOption.customCellStyle;
}
return "";
}
};
function Sn(e, t, n) {
const o = /* @__PURE__ */ new Map([
["/converter/appearance.converter", fr],
["/converter/buttons.converter", vr],
["/converter/property-editor.converter", pr],
["/converter/items-count.converter", Mr],
["/converter/type.converter", hr],
["/converter/change-editor.converter", gr],
["/converter/change-formatter.converter", yr],
["/converter/column-command.converter", br],
["/converter/column-option.converter", Cr],
["/converter/summary.converter", wr],
["/converter/group.converter", Sr],
["/converter/form-group-label.converter", Br],
["/converter/field-selector.converter", Fr],
["/converter/pagination.converter", Er],
["/converter/row-number.converter", Tr],
["/converter/grid-selection.converter", xr],
["/converter/size.converter", kr],
["/converter/change-formatter-enum.converter", Nr],
["/converter/grid-sort.converter", Pr],
["/converter/grid-filter.converter", Or],
["/converter/row-option.converter", Ir]
]), a = /* @__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 }]
]), l = mr();
function s(f, S) {
return () => l.parseValueSchema(f, S);
}
function m(f, S, F) {
return f.includes("visible") && S.visible !== void 0 ? typeof S.visible == "boolean" ? () => !!S.visible : S.visible === void 0 ? !0 : s(S.visible, F) : () => !0;
}
function y(f, S, F) {
return f.includes("readonly") && S.readonly !== void 0 ? typeof S.readonly == "boolean" ? () => !!S.readonly : s(S.readonly, F) : () => !1;
}
function h(f, S) {
const F = f.$converter || S;
return typeof F == "string" && F && o.has(F) ? o.get(F) || null : F || null;
}
function g(f, S, F, E, k, L = "", b = "") {
return Object.keys(f).map((B) => {
const P = C(1), w = B, T = f[B], v = Object.keys(T), c = T.title, p = T.type, x = a.get(p) || { type: "input-group", enableClear: !1 }, N = T.editor ? Object.assign({}, x, T.editor) : Object.assign({}, x), V = m(v, T, S), O = y(v, T, S);
N.readonly = N.readonly === void 0 ? O() : N.readonly;
const A = T.type === "cascade" ? g(T.properties, S, F, E, k, L, b) : [], I = !0;
let D = h(T, b);
const q = H({
get() {
if (P.value) {
if (["class", "style"].find((Fe) => Fe === w) && !D && (D = o.get("/converter/appearance.converter") || null), D && D.convertFrom)
return D.convertFrom(F, B, k, L);
const ge = F[B];
return Object.prototype.hasOwnProperty.call(T, "defaultValue") && (ge === void 0 || typeof ge == "string" && ge === "") ? T.type === "boolean" ? T.defaultValue : T.defaultValue || "" : ge;
}
return null;
},
set(ge) {
P.value += 1, D && D.convertTo ? (D.convertTo(E, B, ge, k, L), D.convertTo(F, B, ge, k, L)) : (E[B] = ge, F[B] = ge);
}
}), { refreshPanelAfterChanged: z, description: j, isExpand: ie, parentPropertyID: de } = T, te = { propertyID: w, propertyName: c, propertyType: p, propertyValue: q, editor: N, visible: V, readonly: O, cascadeConfig: A, hideCascadeTitle: I, refreshPanelAfterChanged: z, description: j, isExpand: ie, parentPropertyID: de };
return S[w] = te, te;
});
}
function i(f, S, F = {}) {
const E = {}, k = e[f];
return k && k.categories ? Object.keys(k.categories).map((b) => {
const M = k.categories[b], B = M == null ? void 0 : M.title, P = g(M.properties || {}, E, {}, F, S);
return { categoryId: b, categoryName: B, properties: P };
}) : [];
}
function d(f, S, F, E, k = "") {
const L = S.$ref.schema, b = S.$ref.converter, M = F[L], B = M.type, P = n(M), w = {}, T = e[B];
if (T && T.categories) {
const v = T.categories[f], c = v == null ? void 0 : v.title;
b && Object.keys(v.properties).forEach((N) => {
v.properties[N].$converter = b;
});
const p = (v == null ? void 0 : v.properties) || {}, x = g(p, w, P, M, E, k);
return { categoryId: f, categoryName: c, properties: x };
}
return { categoryId: f, categoryName: "", properties: [] };
}
function u(f, S, F, E, k) {
const L = f.type, b = n(f), M = {};
let B = k || e[L];
if (B && Object.keys(B).length === 0 && F && F.getPropConfig && (B = F.getPropConfig(E)), B && B.categories) {
const P = [];
return Object.keys(B.categories).map((w) => {
const T = B.categories[w];
if (T.$ref) {
P.push(d(w, T, f, S, E));
return;
}
const v = T == null ? void 0 : T.title, c = T == null ? void 0 : T.tabId, p = T == null ? void 0 : T.tabName, x = T == null ? void 0 : T.hide, N = T == null ? void 0 : T.hideTitle, V = g(T.properties || {}, M, b, f, S, E, T.$converter), { setPropertyRelates: O } = T, A = T == null ? void 0 : T.parentPropertyID;
P.push({ categoryId: w, categoryName: v, tabId: c, tabName: p, hide: x, properties: V, hideTitle: N, setPropertyRelates: O, parentPropertyID: A });
}), P;
}
return [];
}
return {
getPropertyConfigBySchema: u,
getPropertyConfigByType: i,
propertyConverterMap: o
};
}
const Fn = {}, En = {};
Sn(Fn, En, cr);
const Tn = {}, xn = {}, { getSchemaByType: Yc, resolveSchemaWithDefaultValue: Lr, resolveSchemaToProps: Xc, mappingSchemaToProps: Jc, setDesignerContext: Qc } = bn(Tn, xn), Mn = {}, Bn = {};
Sn(Mn, Bn, Lr);
function Tt(e, t, n = /* @__PURE__ */ new Map(), o = (s, m, y, h) => m, a = {}, l = (s) => s) {
return Cn[t.title] = t, wn[t.title] = o, Fn[t.title] = a, En[t.title] = l, Tn[t.title] = t, xn[t.title] = o, Mn[t.title] = a, Bn[t.title] = l, (s = {}, m = !0) => {
if (!m)
return dr(s, n);
const y = ur(s, t, n), h = Object.keys(e).reduce((g, i) => (g[i] = e[i].default, g), {});
return Object.assign(h, y);
};
}
function Jt(e, t) {
return { customClass: t.class, customStyle: t.style };
}
const Rr = /* @__PURE__ */ new Map([
["appearance", Jt]
]);
function Dr(e, t, n) {
return t;
}
const Vr = "https://json-schema.org/draft/2020-12/schema", $r = "https://farris-design.gitee.io/events-editor.schema.json", jr = "events-editor", Ar = "A Farris Component", Hr = "object", zr = {
id: {
description: "The unique identifier for events-editor",
type: "string"
},
type: {
description: "The type events of events-editor",
type: "events",
default: "events-editor"
},
initialData: {
description: "",
type: "object",
default: {}
},
viewSourceHandle: {
description: "",
type: "function",
default: null
}
}, _r = [
"id",
"type"
], qr = {
$schema: Vr,
$id: $r,
title: jr,
description: Ar,
type: Hr,
properties: zr,
required: _r
}, Ur = "events-editor", Gr = "A Farris Component", Wr = "object", Yr = {}, Xr = {
title: Ur,
description: Gr,
type: Wr,
categories: Yr
}, dn = [
{
label: "pageChange",
name: "MockMock切换页码"
},
{
label: "pageSizeChanged",
name: "Mock分页条数变化事件"
},
{
label: "scrollYLoad",
name: "Mock滚动加载事件"
},
{
label: "onEditClicked",
name: "Mock操作列点击编辑"
},
{
label: "onDeleteClicked",
name: "Mock操作列点击删除"
}
], Jr = {
propertyID: "data-grid-component-viewmodel",
propertyType: "events",
/** 内置构件显示的命令列表 */
internalCommandList: [
{
controllerName: {
id: "70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",
label: "ListController",
name: "列表控制器"
},
controllerList: [
{
id: "93ee1cd2-cf0b-40b3-b99f-958a3d1fad1c",
label: "Load",
name: "Mock加载数据",
handlerName: "Load"
},
{
id: "71ae8a4c-6202-4875-9246-2e2d959da37f",
label: "Search",
name: "Mock查询",
handlerName: "Search"
},
{
id: "77556491-41c0-4356-8ccf-25e39817060e",
label: "Add",
name: "Mock添加数据",
handlerName: "Add"
},
{
id: "52fdcac3-46c8-466e-aa5d-19920ece2076",
label: "View",
name: "Mock查看数据",
handlerName: "View"
},
{
id: "7ade9996-0531-4401-b1bc-fb9ec8ee3f8e",
label: "Edit",
name: "Mock编辑数据",
handlerName: "Edit"
},
{
id: "6d5a354f-871f-43e6-82bc-7837184380d3",
label: "RemoveRows",
name: "Mock删除选中行",
handlerName: "RemoveRows"
},
{
id: "1a1b7c33-38f0-469f-a017-223086ee6259",
label: "ChangePage",
name: "Mock切换页码",
handlerName: "ChangePage"
},
{
id: "debae2dd-3387-48cf-90ba-96e74ab5a8e5",
label: "Remove",
name: "Mock删除指定数据",
handlerName: "Remove"
}
]
}
],
/** (事件设定)可绑定事件默认列表; */
events: dn,
/** 已绑定的事件(拼接已有的参数值,拼接当前事件->待集成-从dom结构中取值,事件及对应的字符串) */
boundEventsList: [],
/** 视图模型已有命令 */
viewModel: [],
/** 目标组件对应的所有可选的组件 */
componentLists: [
{ componentId: "root-component", viewModelId: "root-viewmodel" },
{ componentId: "data-grid-component", viewModelId: "data-grid-component-viewmodel" }
],
/** 所有组件列表 */
allComponentList: [
{ componentId: "root-component", viewModelId: "root-viewmodel" },
{ componentId: "data-grid-component", viewModelId: "data-grid-component-viewmodel" }
],
/** 初始为空,用于存储用户点击「导入新命令」的控制器值 */
newController: [],
isAddControllerMethod: !1,
getEventList: () => ({ events: dn, boundEventsList: [] })
}, kn = {
initialData: { type: Object, default: Jr },
viewSourceHandle: { type: Function, default: () => {
} }
}, Qr = Tt(
kn,
qr,
Rr,
Dr,
Xr
);
function Nn() {
function e(n, o) {
const a = [
{
controllerId: "45be24f9-c1f7-44f7-b447-fe2ada458a61",
controllerLabel: "AdvancedListCardController",
controllerName: "高级列卡控制器",
commands: [
{
name: "增加子表数据",
id: "250cd2a2-9995-4c01-64aa-5029afba08ca",
handlerName: "AddItem"
},
{
name: "删除子表数据",
id: "a2c06958-29b1-0582-5f3e-c3cfcc741f8f",
handlerName: "RemoveItem"
},
{
name: "插入数据",
id: "3208b00c-543d-c050-3c54-081715972dda",
handlerName: "Insert"
},
{
name: "查询从表数据(分页)",
id: "b60b7754-35cf-7eaa-0f1d-bc5e5d61c0bc",
handlerName: "queryChild"
},
{
name: "批量删除子表",
id: "378fcd7d-ce91-c052-5947-d60ecdb38df9",
handlerName: "batchDelete"
},
{
name: "移动数据",
id: "fcac5d5e-2367-2b61-a82a-f8e874e8efc0",
handlerName: "move"
},
{
name: "打开批量编辑界面",
id: "8d8b05d6-2d22-b0b7-7cb8-51bbb8cd8a18",
handlerName: "openBatchEditDialog"
}
]
},
{
controllerId: "d7ce1ba6-49c7-4a27-805f-f78f42e72725",
controllerLabel: "EditableListController",
controllerName: "可编辑列表控制器",
commands: [
{
name: "打开批量编辑界面",
id: "c3831e36-27d1-1c98-dd60-30e2d7ec04d2",
handlerName: "openBatchEditDialog"
},
{
name: "加载列表数据",
id: "f80e026b-bd9b-002b-d2aa-52c44a633bec",
handlerName: "Load"
}
]
},
{
controllerId: "8fe977a1-2b32-4f0f-a6b3-2657c4d03574",
controllerLabel: "TreeCardController",
controllerName: "树卡控制器",
commands: [
{
name: "新增子表数据",
id: "21b0c3af-3caf-b11d-2360-d9af20016501",
handlerName: "AddItem"
},
{
name: "删除子表数据",
id: "113f1d77-65a4-63bf-3973-80dd15f294d1",
handlerName: "RemoveItem"
},
{
name: "批量删除子表",
id: "bf13585c-a8f3-384b-356c-bd8bf06751c4",
handlerName: "batchDelete"
}
]
},
{
controllerId: "8d21e69c-70b3-44f6-88b5-fd6a8d3ce11b",
controllerLabel: "PopController",
controllerName: "弹出控制器",
commands: [
{
name: "新增子表数据",
id: "d6933772-8047-9bde-220b-449481883142",
handlerName: "AddItem"
},
{
name: "删除子表数据",
id: "03c233eb-e39e-8e34-6809-ee4ab3a0d97c",
handlerName: "RemoveItem"
},
{
name: "加载并新增",
id: "6882ab4a-9c23-8d59-6aac-de891eae20d2",
handlerName: "LoadAndAdd"
}
]
},
{
controllerId: "43f68561-eae4-4495-b318-d629615523f8",
controllerLabel: "BatchEditCommands",
controlleName: "批量编辑控制器",
commands: [
{
name: "打开批量编辑界面",
id: "a659aaba-daa4-3c07-8b26-164b01726022",
handlerName: "openBatchEditDialog"
},
{
name: "复制行",
id: "d5f67e0a-767d-a238-5ad4-b1285476c16f",
handlerName: "copyRow"
},
{
name: "复制行",
id: "229d2dd3-2fe7-f06a-b705-cfa0fc711614",
handlerName: "clone"
}
]
},
{
controllerId: "c121742e-6028-48bf-817c-1dda7fb098df",
controllerLabel: "AdvancedListCardWithSidebarController",
controllerName: "高级列卡控制器(侧边栏)",
commands: [
{
name: "增加子表数据(侧边栏)",
id: "250cd2a2-9995-4c01-64aa-5029afba08ca",
handlerName: "AddItem"
},
{
name: "删除子表数据(侧边栏)",
id: "a2c06958-29b1-0582-5f3e-c3cfcc741f8f",
handlerName: "RemoveItem"
}
]
},
{
controllerId: "8172a979-2c80-4637-ace7-b13074d3f393",
controllerLabel: "CardController",
controllerName: "卡片控制器",
commands: [
{
name: "新增子表数据",
id: "6f987222-ebe2-0f3c-1594-a12408b22801",
handlerName: "AddItem"
},
{
name: "删除子表数据",
id: "0cdeddcc-8332-f13f-be96-b5eeac84a334",
handlerName: "RemoveItem"
},
{
name: "插入数据",
id: "2666b526-a1b2-f268-1629-b1b95b71c8dd",
handlerName: "Insert"
},
{
name: "打开批量编辑界面",
id: "8104dd8e-bb27-a659-ff7c-a0321523f727",
handlerName: "openBatchEditDialog"
},
{
name: "新增子节点(子表树)",
id: "bbd11957-de2a-c727-11d6-64788c4b0fa8",
handlerName: "addSubChild"
},
{
name: "删除子表树节点",
id: "c8c9f652-ba52-3a9b-5eb9-dadd42c832cd",
handlerName: "RemoveTreeItem"
},
{
name: "批量删除子表",
id: "e96857fa-1617-fd92-8a05-5c684e0819a1",
handlerName: "batchDelete"
}
]
},
{
controllerId: "31c1022c-ab40-4e8d-bc31-85d539f1d36c",
controllerLabel: "FileController",
controllerName: "文件控制器",
commands: [
{
name: "批量删除文件数据",
id: "d5bf021b-1aa4-06fe-3236-188fd218f4f7",
handlerName: "removeFileRows"
}
]
},
{
controllerId: "2eb7bbd1-fabd-4d0f-991d-7242f53225b1",
controllerLabel: "AttachmentController",
controllerName: "附件控制器",
commands: [
{
name: "上传并更新行",
id: "2a84e28f-7202-d858-1466-748a8040c1f9",
handlerName: "UploadAndUpdateRow"
},
{
name: "通过属性名上传并更新行",
id: "0f98c9b8-a01b-55d4-3115-269a73f7ccff",
handlerName: "uploadAndUpdateRowWithPropertyName"
},
{
name: "移除版本附件行",
id: "b441b6a7-9e13-9f75-77a2-10b2c1f7ef26",
handlerName: "RemoveAttachmentItem"
},
{
name: "上传并批量新增行",
id: "e6fc25ca-853b-0b2d-76c9-a1f7a253679b",
handlerName: "UploadAndBatchAddRows"
}
]
},
{
controllerId: "e353b4e9-e073-4e18-b9f7-ec4cc8ac72b1",
controllerLabel: "PrintService",
controllerName: "打印控制器",
commands: [
{
name: "根据数据条件批量打印",
id: "774fa275-2da1-e927-e8bf-d27d9886a168",
handlerName: "printMulti"
}
]
},
{
controllerId: "70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",
controllerLabel: "ListController",
controllerName: "列表控制器",
commands: [
{
name: "加载数据",
id: "86c9f281-e5bc-5d5c-1b86-d1e17ab2e850",
handlerName: "Load"
}
]
},
{
controllerId: "7c48ef46-339c-42d4-8365-a21236c63044",
controllerLabel: "ListCardController",
controllerName: "列卡控制器",
commands: [
{
name: "加载列表数据",
id: "e573d6a2-8261-9ad4-c9f1-2e59af53302d",
handlerName: "loadList"
}
]
},
{
controllerId: "26436aa8-88a7-4aee-bf0b-9843c1e8afbf",
controllerLabel: "ListListController",
controllerName: "双列表控制器",
commands: [
{
name: "加载导航列表数据",
id: "f7dd2c84-7abd-d4bf-6b31-71d96035c034",
handlerName: "LoadNavList"
}
]
}
];
let l = -1;
const s = a.findIndex((m) => n === m.controllerId);
return s !== -1 && (l = a[s].commands.findIndex((m) => o === m.handlerName)), l !== -1;
}
function t(n, o, a) {
const l = e(n.controllerName.id, o.handlerName);
return a.componentLists.length !== 0 && l && (o.hasPath = !0, o.targetComponent = o.targetComponent || a.componentLists[0].componentId, o.componentLists = se(a.componentLists)), o;
}
return { isContextDependent: e, setComponentLists: t };
}
var gt = /* @__PURE__ */ ((e) => (e.Frame = "frame", e.dataGrid = "data-grid", e.listView = "list-view", e.form = "form", e.attachmentPanel = "attachment-panel", e))(gt || {});
function Zr(e, t) {
const n = C(""), o = C("");
function a(i) {
var f;
let d = "controlIcon fd-i-Family ", u = "";
switch (i == null ? void 0 : i.type) {
case "form-group": {
u = i.editor && i.editor.type ? `fd_pc-${i.editor.type}` : "";
break;
}
default: {
const S = ((f = U[i.type]) == null ? void 0 : f.icon) || i.type;
d += `fd_pc-${S}`;
}
}
return d += u, d;
}
function l(i, d) {
var S;
let u = i.id;
const f = d == null ? void 0 : d.contents;
if ((d == null ? void 0 : d.type) === "splitter" && f && f.length === 2) {
const F = d.direction !== "column";
i.id === ((S = f[0]) == null ? void 0 : S.id) ? u = F ? "左侧区域" : "上方区域" : u = F ? "右侧区域" : "下方区域";
}
return u;
}
function s(i) {
if (i.isLikeCardContainer)
return "区块";
const d = i.appearance && i.appearance.class || "", u = d.split(" ");
return i.id === "page-header" && d && d === "f-page-header" ? "页头" : u.includes("f-page-header-base") ? "页头容器" : u.includes("f-page-header-extend") ? "页头扩展容器" : u.includes("f-title") ? "标题容器" : u.includes("f-page") ? "根容器" : u.includes("f-page-main") ? "内容区域" : u.includes("f-scrollspy-content") && i.isScrollspyContainer ? "滚动监听容器" : u.includes("f-grid-is-sub") ? "表格容器" : u.includes("f-filter-container") ? "筛选条容器" : "容器";
}
function m(i) {
const { componentType: d } = i;
switch (d) {
case gt.Frame:
return "根组件";
case gt.dataGrid:
return (e == null ? void 0 : e.formSchemaUtils.selectNode(i, (f) => f.type === (U["tree-grid"] && U["tree-grid"].type))) ? "树表格组件" : "表格组件";
case gt.attachmentPanel:
return "附件组件";
case gt.listView:
return "列表视图组件";
case gt.form:
return "卡片组件";
default:
return "组件";
}
}
function y(i, d) {
const u = i.name || i.text || i.label || i.title || i.mainTitle;
if (i.type !== "component" && u && typeof u == "string")
return u.trim();
switch (i.type) {
case "content-container":
return s(i);
case "splitter-pane":
return l(i, d);
case "component":
return m(i);
default:
return U[i.type] && U[i.type].name || i.id;
}
}
function h(i) {
const d = i.length ? i[0] : null;
if (!d)
return;
o.value = "", n.value = d.originalId;
const u = d ? `${d.originalId}-design-item` : "", f = document.getElementById(u);
f && f.click(), t.emit("selectionChanged", d);
}
function g(i) {
if (!i)
return;
const d = `${i}-design-item`, u = document.getElementById(d);
u && u.click();
}
return { getIcon: a, getTitle: y, onChanged: h, currentSelectedNodeId: n, currentSelectedOutsideNodeId: o, triggerOutsideClick: g };
}
function Kr(e, t) {
const { getIcon: n, getTitle: o } = t;
function a(g, i, d, u, f) {
var F;
const S = (F = e.data.module) == null ? void 0 : F.components.find((E) => E.id === g.component);
S && l([S], i, d, u, f);
}
function l(g, i, d, u, f) {
return g.forEach((S) => {
if (S.type === "component-ref") {
a(S, i, d, u, f);
return;
}
const F = {
originalId: S.id,
layer: d,
originalParent: u == null ? void 0 : u.id,
componentId: f,
name: o(S, u),
type: S.type,
controlIcon: n(S),
rawSchema: S
};
i.push(se(F)), (S.contents || S.buttons) && l(S.contents || S.buttons, i, d + 1, S, f);
}), i;
}
function s(g) {
const i = [], d = g.find((F) => F.layer === 0);
g = g.filter((F) => F.layer !== 0), i.push(d);
let u = d.originalId, f = 0, S = 1e3;
for (; g.length !== 0 || S === 0; ) {
const F = g.find((E) => E.originalParent === u);
F ? (i.push(F), u = F.originalId, g = g.filter((E) => E.originalId !== u), f = 0) : (f -= 1, u = i.slice(f)[0].originalId), S -= 1;
}
return i;
}
function m(g) {
return g.forEach((i, d) => {
i.id = (d + 1).toString();
}), g.forEach((i) => {
var d;
i.parent = ((d = g.find((u) => u.originalId === i.originalParent)) == null ? void 0 : d.id) || "";
}), g.forEach((i) => {
i.hasChildren = g.findIndex((d) => d.parent === i.id) > 0;
}), g;
}
function y(g) {
const i = {
originalId: e.data.module.id,
layer: 0,
originalParent: null,
name: "页面",
type: "module",
controlIcon: "controlIcon fd-i-Family fd_pc-module",
rawSchema: e.data.module
}, d = [];
return g.forEach((u) => {
u[0].originalParent = i.originalId, d.push(...u);
}), d.unshift(i), d;
}
function h() {
const g = e.data.module ? C(e.data.module.components) : C([e.data]);
if (!g.value)
return;
const i = [];
g.value.forEach((S) => {
if (S) {
const F = [];
F.push(S);
const L = l(F, [], 1, null, S.id);
i.push(L);
}
});
const d = y(i), u = s(d);
return m(u);
}
return { getData: h };
}
function xt(e) {
const t = be("sourceOutlineData") || [], n = C(), o = C(!1), a = C([]), l = C();
function s(F, E, k, L) {
var b, M, B, P;
return {
id: Wt().guid(),
source: L || {
formId: (b = F.sourceCommunication) == null ? void 0 : b.formId,
formCode: (M = F.sourceCommunication) == null ? void 0 : M.formCode,
componentId: (B = F.sourceCommunication) == null ? void 0 : B.componentId,
externalContainerId: (P = F.sourceCommunication) == null ? void 0 : P.externalContainerId,
event: E || "onCommunication"
},
target: {
formId: (k == null ? void 0 : k.formId) || "",
formCode: (k == null ? void 0 : k.formCode) || "",
externalContainerId: (k == null ? void 0 : k.externalContainerId) || "",
commandCode: (k == null ? void 0 : k.commandCode) || "",
commandViewmodelId: (k == null ? void 0 : k.commandViewmodelId) || ""
},
paramMappings: []
};
}
function m(F) {
var E, k;
(E = F == null ? void 0 : F.communication) != null && E.length && ((k = F == null ? void 0 : F.communication) == null || k.map((L) => {
var b, M;
if (L != null && L.id && !((b = L == null ? void 0 : L.source) != null && b.componentId)) {
const B = (M = e.getFormSchema().module.communications) == null ? void 0 : M.find((P) => P.id === (L == null ? void 0 : L.id));
B && Object.assign(L, B);
}
}));
}
function y(F) {
const E = e.getFormSchema(), { communications: k } = E.module;
k || (E.module.communications = []);
const L = E.module.communications.findIndex((b) => b.id === F.id);
L === -1 ? E.module.communications.push(F) : Object.assign(E.module.communications[L], F);
}
function h(F) {
var E;
if ((E = F == null ? void 0 : F.communication) != null && E.length) {
const k = e.getFormSchema();
F.communication.map((L) => {
k.module.communications && L && (k.module.communications = k.module.communications.filter((b) => b.id !== L.id));
}), F.communication = [];
}
}
function g(F) {
var k;
const E = e.getFormSchema();
F && ((k = E.module.communications) != null && k.length) && (E.module.communications = E.module.communications.filter((L) => L.id !== F));
}
function i(F, E, k) {
const L = Zr(F, E), b = e.externalFormSchema.get(k);
if (b != null && b.content) {
const M = { data: b.content }, { getData: B } = Kr(M, L);
return B();
}
return [];
}
function d(F) {
var k;
if (!((k = F == null ? void 0 : F.source) != null && k.componentId)) {
o.value = !1;
return;
}
const E = t.find((L) => L.originalId === F.source.componentId);
E ? (o.value = !1, n.value = E) : (o.value = !0, n.value = { id: F.source.componentId });
}
function u(F) {
var b, M, B, P;
a.value = [];
const E = (b = n.value) == null ? void 0 : b.rawSchema;
if (!E) {
l.value = null;
return;
}
const k = E.type === "form-group" && E.editor ? E.editor.type : E.type, L = (M = hn[k]) == null ? void 0 : M.events;
L && Object.keys(L).forEach((w) => {
a.value.push({ eventCode: w, eventName: L[w] });
}), (B = F.source) != null && B.event && ((P = a.value) != null && P.length) && (l.value = a.value.find((w) => {
var T;
return w.eventCode === ((T = F.source) == null ? void 0 : T.event);
}));
}
function f(F) {
var L, b, M, B, P, w, T, v;
if (!(F != null && F.length))
return;
d(F[0]), u(F[0]);
let E = "", k = "";
return o.value ? E = `${((L = F[0].source) == null ? void 0 : L.componentId) || ""}-${((b = F[0].source) == null ? void 0 : b.event) || ""}` : (E = (M = n.value) == null ? void 0 : M.name, E && ((B = l.value) != null && B.eventName) && (E += `-${(P = l.value) == null ? void 0 : P.eventName}`), k = `${(w = n.value) == null ? void 0 : w.name} (${(T = n.value) == null ? void 0 : T.originalId})`, k = `${k}
${(v = l.value) == null ? void 0 : v.eventName} (${l.value.eventCode})`), { title: E, titleTip: k, isControlInvalid: o.value };
}
function S(F) {
var E;
if ((E = F == null ? void 0 : F.communication) != null && E.length) {
const k = F == null ? void 0 : F.communication[0];
return k == null ? void 0 : k.source;
}
}
return {
createNewCommunication: s,
resolveCommunication: m,
clearAllCommunication: h,
clearCommunicationById: g,
saveCommunication: y,
assembleSourceOutline: i,
resolveSourceControlEventTitle: f,
resolveCommunicationSource: S
};
}
function el(e, t, n) {
const o = C([]), { boundEvents: a, unBoundEvent: l } = t;
function s(d) {
var f, S;
return {
/** 当前事件名称及label */
event: {
label: (f = d.boundEvents) == null ? void 0 : f.label,
name: (S = d.boundEvents) == null ? void 0 : S.name
},
/** 控制组件的展示及顺序:
* 0:事件下拉框
* 1:事件名称
* 2:来源+方法列表
* 3:方法名
* 4:方法参数*/
showSwitch: [{
// 存储所有的展示设定
showSection: [[!1, !1, !1, !1, !1], [!1, !1, !0, !1, !1], [!1, !0, !1, !0, !1]],
// 展示哪个部分
showSwitchNumber: 2
}],
/** 方法列表 */
command: se(d.command),
/** 当前的控制器 */
controller: se(d.controller),
/** 通讯 */
communication: d.communication
};
}
function m() {
var d;
o.value = (d = a.value) == null ? void 0 : d.map((u) => s(u));
}
function y(d, u) {
const S = s({
boundEvents: d,
command: null,
controller: { id: "", name: "", label: "" },
communication: u ? [u] : []
});
if (u) {
S.showSwitch[0].showSwitchNumber = 2, S.showSwitch[0].showSection[2][2] = !1, S.showSwitch[0].showSection[2][3] = !1, S.needSelectCommunicationCommand = !0, o.value.unshift(S);
return;
}
d && (S.showSwitch[0].showSwitchNumber = 1, S.showSwitch[0].showSection[2][3] = !0, o.value.unshift(S));
}
function h() {
var d;
(d = o.value) == null || d.forEach((u) => {
u.showSwitch.forEach((f) => {
f.showSection[2][3] = !1;
});
});
}
function g(d) {
o.value[d].showSwitch.forEach((u) => {
u.showSection[2][3] = !u.showSection[2][3];
});
}
function i(d) {
if (d >= 0 && d <= o.value.length - 1) {
const u = o.value[d];
l(u.event), o.value.splice(d, 1);
const { clearAllCommunication: f } = xt(e);
f(u);
}
}
return {
addNewInteraction: y,
collapseInteractions: h,
deleteInteracton: i,
toggleMethodInInteraction: g,
interactions: o,
loadInteractions: m
};
}
function tl(e) {
const t = C([]), n = C([]), o = C([]), { isContextDependent: a } = Nn();
function l() {
const { allComponentList: d } = e.value;
e.value.componentLists.length && e.value.viewModel && e.value.viewModel.forEach((u) => {
u.controllerList.forEach((f) => {
if (f.targetComponent) {
co