@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,443 lines • 205 kB
JavaScript
var On = Object.defineProperty;
var Pn = (n, t, e) => t in n ? On(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
var X = (n, t, e) => Pn(n, typeof t != "symbol" ? t + "" : t, e);
import { ref as C, computed as R, defineComponent as ke, watch as we, onMounted as Xe, createVNode as w, withDirectives as Vn, vModelText as Nn, nextTick as st, Fragment as at, reactive as Le, createApp as Zt, onUnmounted as wt, Transition as Kt, mergeProps as Rt, createTextVNode as jn, inject as Dt, onBeforeMount as Dn, Teleport as $n, shallowRef as Ln, render as jt, h as Rn, cloneVNode as Hn } from "vue";
import { cloneDeep as ht, isPlainObject as Yt, isUndefined as De } from "lodash-es";
import { useCommonUtils as zn, useTextBox as An, useClear as Un, getCustomClass as $t, withInstall as en, FormSchemaEntityField$Type as gt, FormSchemaEntityFieldTypeName as Jt, FormSchemaEntityFieldType$Type as qn } from "../common/index.esm.js";
import { getSchemaByTypeForDesigner as Wn, createPropsResolver as tn, resolveAppearance as _n } from "../dynamic-resolver/index.esm.js";
import { DgControl as Qt } from "../designer-canvas/index.esm.js";
import { useI18n as Ht } from "vue-i18n";
import { LocaleService as St } from "../locale/index.esm.js";
import { useResizeObserver as Gn } from "@vueuse/core";
import { getHierarchyRow as Xn, useIdentify as Yn, useGroupData as Jn, useFilter as Qn, useHierarchy as Zn, useLoading as Kn, useDataView as eo, useSelection as to, useSelectHierarchyItem as no, usePagination as oo, useDataViewContainerStyle as io, useCommandColumn as ro, useSettingColumn as ao, useColumn as so, useSort as lo, useGroupColumn as co, useRow as uo, useEdit as fo, useVisualDataBound as po, useVisualDataCell as mo, useVisualDataRow as vo, useVisualData as ho, useCellPosition as go, useSidebar as yo, useVirtualScroll as bo, useFitColumn as Co, useFilterHistory as wo, useColumnFilter as So, useDragColumn as xo, getColumnHeader as To, getSidebar as Mo, getDisableMask as Eo, getHorizontalScrollbar as Fo, getVerticalScrollbar as Bo, getEmpty as ko, getPagination as Io, getSummary as Oo } from "../data-view/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 nn(n, t) {
let e;
function o(l) {
const { properties: m, title: d, ignore: f } = l, v = f && Array.isArray(f), x = Object.keys(m).reduce((F, I) => ((!v || !f.find((z) => z === I)) && (F[I] = m[I].type === "object" && m[I].properties ? o(m[I]) : ht(m[I].default)), F), {});
if (d && (!v || !f.find((F) => F === "id"))) {
const F = d.toLowerCase().replace(/-/g, "_");
x.id = `${F}_${Math.random().toString().slice(2, 6)}`;
}
return x;
}
function i(l) {
const { properties: m, title: d, required: f } = l;
if (f && Array.isArray(f)) {
const v = f.reduce((x, F) => (x[F] = m[F].type === "object" && m[F].properties ? o(m[F]) : ht(m[F].default), x), {});
if (d && f.find((x) => x === "id")) {
const x = d.toLowerCase().replace(/-/g, "_");
v.id = `${x}_${Math.random().toString().slice(2, 6)}`;
}
return v;
}
return {
type: d
};
}
function a(l, m = {}, d) {
const f = n[l];
if (f) {
let v = i(f);
const x = t[l];
return v = x ? x({ getSchemaByType: a }, v, m, d) : v, e != null && e.appendIdentifyForNewControl && e.appendIdentifyForNewControl(v), v;
}
return null;
}
function r(l, m) {
const d = o(m);
return Object.keys(d).reduce((f, v) => (Object.prototype.hasOwnProperty.call(l, v) && (f[v] && Yt(f[v]) && Yt(l[v] || !l[v]) ? Object.assign(f[v], l[v] || {}) : f[v] = l[v]), f), d), d;
}
function u(l, m) {
return Object.keys(l).filter((f) => l[f] != null).reduce((f, v) => {
if (m.has(v)) {
const x = m.get(v);
if (typeof x == "string")
f[x] = l[v];
else {
const F = x(v, l[v], l);
Object.assign(f, F);
}
} else
f[v] = l[v];
return f;
}, {});
}
function s(l, m, d = /* @__PURE__ */ new Map()) {
const f = r(l, m);
return u(f, d);
}
function c(l) {
var d;
const m = l.type;
if (m) {
const f = n[m];
if (!f)
return l;
const v = r(l, f), x = ((d = l.editor) == null ? void 0 : d.type) || "";
if (x) {
const F = n[x], I = r(l.editor, F);
v.editor = I;
}
return v;
}
return l;
}
function p(l) {
e = l;
}
return { getSchemaByType: a, resolveSchemaWithDefaultValue: c, resolveSchemaToProps: s, mappingSchemaToProps: u, setDesignerContext: p };
}
const on = {}, rn = {}, { getSchemaByType: As, resolveSchemaWithDefaultValue: Po, resolveSchemaToProps: Vo, mappingSchemaToProps: No, setDesignerContext: Us } = nn(on, rn);
function jo(n = {}) {
function t(c, p, l, m) {
if (typeof l == "number")
return m[c].length === l;
if (typeof l == "object") {
const d = Object.keys(l)[0], f = l[d];
if (d === "not")
return Number(m[c].length) !== Number(f);
if (d === "moreThan")
return Number(m[c].length) >= Number(f);
if (d === "lessThan")
return Number(m[c].length) <= Number(f);
}
return !1;
}
function e(c, p, l, m) {
return m[c] && m[c].propertyValue && String(m[c].propertyValue.value) === String(l);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", e]
]);
Object.keys(n).reduce((c, p) => (c.set(p, n[p]), c), o);
function i(c, p) {
const l = c;
return typeof p == "number" ? [{ target: l, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: l, operator: "getProperty", param: c, value: !!p }] : typeof p == "object" ? Object.keys(p).map((m) => {
if (m === "length")
return { target: l, operator: "length", param: null, value: p[m] };
const d = m, f = p[m];
return { target: l, operator: "getProperty", param: d, value: f };
}) : [];
}
function a(c) {
return Object.keys(c).reduce((l, m) => {
const d = i(m, c[m]);
return l.push(...d), l;
}, []);
}
function r(c, p) {
if (o.has(c.operator)) {
const l = o.get(c.operator);
return l && l(c.target, c.param, c.value, p) || !1;
}
return !1;
}
function u(c, p) {
return a(c).reduce((d, f) => d && r(f, p), !0);
}
function s(c, p) {
const l = Object.keys(c), m = l.includes("allOf"), d = l.includes("anyOf"), f = m || d, F = (f ? c[f ? m ? "allOf" : "anyOf" : "allOf"] : [c]).map((z) => u(z, p));
return m ? !F.includes(!1) : F.includes(!0);
}
return { parseValueSchema: s };
}
const Do = {
convertTo: (n, t, e, o) => {
n.appearance || (n.appearance = {}), n.appearance[t] = e;
},
convertFrom: (n, t, e) => n.appearance ? n.appearance[t] : n[t]
}, $o = {
convertFrom: (n, t, e) => n.buttons && n.buttons.length ? `共 ${n.buttons.length} 项` : "无"
}, Lo = {
convertTo: (n, t, e, o) => {
n.editor && (n.editor[t] = e);
},
convertFrom: (n, t, e) => n.editor && Object.prototype.hasOwnProperty.call(n.editor, t) ? n.editor[t] : n[t]
}, L = {
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: "多语输入框" }
}, Ro = {
convertFrom: (n, t, e) => {
var i;
const o = n.editor && n.editor[t] ? n.editor[t] : n[t];
return ((i = L[o]) == null ? void 0 : i.name) || o;
}
}, Ho = {
convertTo: (n, t, e, o) => {
n[t] = n[t];
},
convertFrom: (n, t, e) => n.editor ? e.getRealEditorType(n.editor.type) : ""
}, zo = {
convertTo: (n, t, e, o) => {
(n.type === "data-grid-column" || n.type === "tree-grid-column") && (n.formatter ? n.formatter[t] = e : n.formatter = {
[t]: e
});
},
convertFrom: (n, t, e) => {
if (n.formatter) {
if (t === "trueText")
return n.formatter.trueText;
if (t === "falseText")
return n.formatter.falseText;
if (t === "prefix")
return n.formatter.prefix;
if (t === "suffix")
return n.formatter.suffix;
if (t === "precision")
return n.formatter.precision;
if (t === "decimal")
return n.formatter.decimal;
if (t === "thousand")
return n.formatter.thousand;
if (t === "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 (t === "customFormat")
return n.formatter.customFormat;
if (t === "type")
return n.formatter.type || "none";
}
return "none";
}
}, Ao = {
convertTo: (n, t, e, o) => {
n.command ? n.command[t] = e : n.command = {
[t]: e
}, t === "enable" && e && (n.command.commands || (n.command.commands = [
{
text: "编辑",
type: "primary",
command: "edit"
},
{
text: "删除",
type: "danger",
command: "remove"
}
]));
},
convertFrom: (n, t, e) => n.command && t === "enable" ? n.command.enable : ""
}, Uo = {
convertTo: (n, t, e, o) => {
n.column ? n.column[t] = e : n.column = {
[t]: e
}, t === "fitColumns" && e && (n.column.fitMode || (n.column.fitMode = "average"));
},
convertFrom: (n, t, e) => {
if (n.column) {
if (t === "fitColumns")
return n.column.fitColumns;
if (t === "fitMode")
return n.column.fitMode;
}
return "";
}
}, qo = {
convertTo: (n, t, e, o) => {
n.summary ? n.summary[t] = e : n.summary = {
[t]: e
}, t === "enable" && e && (n.summary ? n.summary.groupFields || (n.summary.groupFields = []) : n.summary = {
enable: e,
groupFields: []
});
},
convertFrom: (n, t, e) => n.summary && t === "enable" ? n.summary.enable : n.type === "data-grid-column" ? n.enableSummary === void 0 ? !1 : n.enableSummary : ""
}, Wo = {
convertTo: (n, t, e, o) => {
n.group ? n.group[t] = e : n.group = {
[t]: e
}, t === "enable" && e && (n.group ? n.group.groupFields || (n.group.groupFields = []) : n.group = {
enable: e,
groupFields: [],
showSummary: !1
});
},
convertFrom: (n, t, e) => {
if (n.group) {
if (t === "enable")
return n.group.enable;
if (t === "showSummary")
return n.group.showSummary;
}
}
}, _o = {
convertFrom: (n, t) => n.binding ? n.binding.path : "",
convertTo: (n, t, e) => {
if (e && e.length > 0) {
const o = e[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;
}
}
}, Go = {
convertTo: (n, t, e, o) => {
n.pagination || (n.pagination = {}), n.pagination[t] = e;
},
convertFrom: (n, t, e) => n.pagination ? n.pagination[t] : n[t]
}, Xo = {
convertTo: (n, t, e, o) => {
n.rowNumber || (n.rowNumber = {}), n.rowNumber[t] = e;
},
convertFrom: (n, t, e) => n.rowNumber ? n.rowNumber[t] : n[t]
}, Yo = {
convertTo: (n, t, e, o) => {
n.selection || (n.selection = {}), n.selection[t] = e;
},
convertFrom: (n, t, e) => n.selection ? n.selection[t] : n[t]
}, Jo = {
convertFrom: (n, t, e) => n[t] && n[t].length ? `共 ${n[t].length} 项` : ""
}, Qo = {
convertFrom: (n, t) => n[t] || "",
convertTo: (n, t, e) => {
n[t] = e;
}
}, Zo = {
convertTo: (n, t, e, o) => {
n.size || (n.size = {}), n.size[t] = e;
},
convertFrom: (n, t, e) => n.size ? n.size[t] : n[t]
}, Ko = {
convertFrom: (n, t, e) => {
var o, i;
return (o = n.formatter) != null && o.data && t === "formatterEnumData" && !n.formatterEnumData ? (i = n.formatter) == null ? void 0 : i.data : n.formatterEnumData;
}
}, ei = {
convertTo: (n, t, e, o) => {
n.sort || (n.sort = {}), n.sort[t] = e;
},
convertFrom: (n, t, e) => {
var o, i;
if (t === "mode")
return ((o = n.sort) == null ? void 0 : o.mode) || "client";
if (t === "multiSort")
return !!((i = n.sort) != null && i.multiSort);
}
}, ti = {
convertTo: (n, t, e, o) => {
n.filter || (n.filter = {}), n.filter[t] = e;
},
convertFrom: (n, t, e) => {
var o;
if (t === "mode")
return ((o = n.filter) == null ? void 0 : o.mode) || "client";
}
}, ni = {
convertTo: (n, t, e, o) => {
n.rowOption ? n.rowOption[t] = e : n.rowOption = {
[t]: e
};
},
convertFrom: (n, t, e) => {
if (n.rowOption) {
if (t === "customRowStyle")
return n.rowOption.customRowStyle;
if (t === "customCellStyle")
return n.rowOption.customCellStyle;
}
return "";
}
};
function an(n, t, e) {
const o = /* @__PURE__ */ new Map([
["/converter/appearance.converter", Do],
["/converter/buttons.converter", $o],
["/converter/property-editor.converter", Lo],
["/converter/items-count.converter", Jo],
["/converter/type.converter", Ro],
["/converter/change-editor.converter", Ho],
["/converter/change-formatter.converter", zo],
["/converter/column-command.converter", Ao],
["/converter/column-option.converter", Uo],
["/converter/summary.converter", qo],
["/converter/group.converter", Wo],
["/converter/form-group-label.converter", Qo],
["/converter/field-selector.converter", _o],
["/converter/pagination.converter", Go],
["/converter/row-number.converter", Xo],
["/converter/grid-selection.converter", Yo],
["/converter/size.converter", Zo],
["/converter/change-formatter-enum.converter", Ko],
["/converter/grid-sort.converter", ei],
["/converter/grid-filter.converter", ti],
["/converter/row-option.converter", ni]
]), i = /* @__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 = jo();
function r(f, v) {
return () => a.parseValueSchema(f, v);
}
function u(f, v, x) {
return f.includes("visible") && v.visible !== void 0 ? typeof v.visible == "boolean" ? () => !!v.visible : v.visible === void 0 ? !0 : r(v.visible, x) : () => !0;
}
function s(f, v, x) {
return f.includes("readonly") && v.readonly !== void 0 ? typeof v.readonly == "boolean" ? () => !!v.readonly : r(v.readonly, x) : () => !1;
}
function c(f, v) {
const x = f.$converter || v;
return typeof x == "string" && x && o.has(x) ? o.get(x) || null : x || null;
}
function p(f, v, x, F, I, z = "", T = "") {
return Object.keys(f).map((g) => {
const k = C(1), M = g, S = f[g], P = Object.keys(S), y = S.title, E = S.type, V = i.get(E) || { type: "input-group", enableClear: !1 }, j = S.editor ? Object.assign({}, V, S.editor) : Object.assign({}, V), B = u(P, S, v), q = s(P, S, v);
j.readonly = j.readonly === void 0 ? q() : j.readonly;
const Z = S.type === "cascade" ? p(S.properties, v, x, F, I, z, T) : [], D = !0;
let N = c(S, T);
const G = R({
get() {
if (k.value) {
if (["class", "style"].find((le) => le === M) && !N && (N = o.get("/converter/appearance.converter") || null), N && N.convertFrom)
return N.convertFrom(x, g, I, z);
const ie = x[g];
return Object.prototype.hasOwnProperty.call(S, "defaultValue") && (ie === void 0 || typeof ie == "string" && ie === "") ? S.type === "boolean" ? S.defaultValue : S.defaultValue || "" : ie;
}
return null;
},
set(ie) {
k.value += 1, N && N.convertTo ? (N.convertTo(F, g, ie, I, z), N.convertTo(x, g, ie, I, z)) : (F[g] = ie, x[g] = ie);
}
}), { refreshPanelAfterChanged: A, description: te, isExpand: ve, parentPropertyID: he } = S, J = { propertyID: M, propertyName: y, propertyType: E, propertyValue: G, editor: j, visible: B, readonly: q, cascadeConfig: Z, hideCascadeTitle: D, refreshPanelAfterChanged: A, description: te, isExpand: ve, parentPropertyID: he };
return v[M] = J, J;
});
}
function l(f, v, x = {}) {
const F = {}, I = n[f];
return I && I.categories ? Object.keys(I.categories).map((T) => {
const h = I.categories[T], g = h == null ? void 0 : h.title, k = p(h.properties || {}, F, {}, x, v);
return { categoryId: T, categoryName: g, properties: k };
}) : [];
}
function m(f, v, x, F, I = "") {
const z = v.$ref.schema, T = v.$ref.converter, h = x[z], g = h.type, k = e(h), M = {}, S = n[g];
if (S && S.categories) {
const P = S.categories[f], y = P == null ? void 0 : P.title;
T && Object.keys(P.properties).forEach((j) => {
P.properties[j].$converter = T;
});
const E = (P == null ? void 0 : P.properties) || {}, V = p(E, M, k, h, F, I);
return { categoryId: f, categoryName: y, properties: V };
}
return { categoryId: f, categoryName: "", properties: [] };
}
function d(f, v, x, F, I) {
const z = f.type, T = e(f), h = {};
let g = I || n[z];
if (g && Object.keys(g).length === 0 && x && x.getPropConfig && (g = x.getPropConfig(F)), g && g.categories) {
const k = [];
return Object.keys(g.categories).map((M) => {
const S = g.categories[M];
if (S.$ref) {
k.push(m(M, S, f, v, F));
return;
}
const P = S == null ? void 0 : S.title, y = S == null ? void 0 : S.tabId, E = S == null ? void 0 : S.tabName, V = S == null ? void 0 : S.hide, j = S == null ? void 0 : S.hideTitle, B = p(S.properties || {}, h, T, f, v, F, S.$converter), { setPropertyRelates: q } = S, Z = S == null ? void 0 : S.parentPropertyID;
k.push({ categoryId: M, categoryName: P, tabId: y, tabName: E, hide: V, properties: B, hideTitle: j, setPropertyRelates: q, parentPropertyID: Z });
}), k;
}
return [];
}
return {
getPropertyConfigBySchema: d,
getPropertyConfigByType: l,
propertyConverterMap: o
};
}
const sn = {}, ln = {};
an(sn, ln, Po);
const cn = {}, un = {}, { getSchemaByType: qs, resolveSchemaWithDefaultValue: oi, resolveSchemaToProps: Ws, mappingSchemaToProps: _s, setDesignerContext: Gs } = nn(cn, un), dn = {}, fn = {};
an(dn, fn, oi);
function lt(n, t, e = /* @__PURE__ */ new Map(), o = (r, u, s, c) => u, i = {}, a = (r) => r) {
return on[t.title] = t, rn[t.title] = o, sn[t.title] = i, ln[t.title] = a, cn[t.title] = t, un[t.title] = o, dn[t.title] = i, fn[t.title] = a, (r = {}, u = !0) => {
if (!u)
return No(r, e);
const s = Vo(r, t, e), c = Object.keys(n).reduce((p, l) => (p[l] = n[l].default, p), {});
return Object.assign(c, s);
};
}
function zt(n, t) {
return { customClass: t.class, customStyle: t.style };
}
const ii = /* @__PURE__ */ new Map([
["appearance", zt]
]), ri = "https://json-schema.org/draft/2020-12/schema", ai = "https://farris-design.gitee.io/switch.schema.json", si = "textarea", li = "A Farris Component", ci = "object", ui = {
id: {
description: "The unique identifier for a textarea",
type: "string"
},
type: {
description: "The type string of textarea component",
type: "string",
default: "textarea"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
disabled: {
type: "boolean",
default: !1
},
editable: {
description: "",
type: "boolean",
default: !0
},
placeholder: {
description: "",
type: "string",
default: ""
},
readonly: {
description: "",
type: "boolean",
default: !1
},
required: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
visible: {
description: "",
type: "boolean",
default: !0
},
rows: {
description: "",
type: "number"
},
showCount: {
description: "",
type: "boolean",
default: !1
},
maxLength: {
description: "",
type: "number",
default: 0
},
updateOn: {
description: "",
type: "string",
default: "blur"
},
allowUnlimtedWhenEmpty: {
description: "",
type: "boolean",
default: !0
},
autoHeight: {
description: "",
type: "boolean",
default: !1
},
resizable: {
description: "",
type: "boolean",
default: !1
},
lineBreak: {
description: "",
type: "boolean",
default: "enter"
}
}, di = [
"type"
], fi = [
"id",
"appearance",
"binding",
"visible"
], pi = {
$schema: ri,
$id: ai,
title: si,
description: li,
type: ci,
properties: ui,
required: di,
ignore: fi
};
function mi(n, t, e) {
return t;
}
const At = {
/** 是否撑开高度 */
autoHeight: { type: Boolean, default: !1 },
/** 自动聚焦 */
autofocus: { type: Boolean, default: !1 },
/** 自动完成 */
autocomplete: { type: Boolean, default: !1 },
/** when length equals 0 and allowUnlimtedWhenEmpty equals true,
character input is not limited */
allowUnlimtedWhenEmpty: { type: Boolean, default: !1 },
/** 禁用 */
disabled: { type: Boolean, default: !1 },
/** 启用清除按钮 */
enableClear: { type: Boolean, default: !1 },
/** 组件标识 */
id: { type: String, default: "" },
/** 最小字符长度 */
minLength: { type: Number, default: 0 },
/** 最大字符长度 */
maxLength: { type: Number },
/** 组件值 */
modelValue: { type: String, default: "" },
/** 背景文字 */
placeholder: { type: String, default: "" },
/** 只读 */
readonly: { type: Boolean, default: !1 },
/** 文本区域可见的行数 */
rows: { type: Number },
/** 是否可以拖拽调整大小 */
resizable: { type: Boolean, default: !1 },
/** 展示输入文本数量 */
showCount: { type: Boolean, default: !1 },
/** 展示边线 */
showBorder: { Type: Boolean, default: !0 },
/** 键盘按键索引 */
tabIndex: { type: Number, default: -1 },
/**
* 作为内嵌编辑器被创建后默认获得焦点
*/
focusOnCreated: { type: Boolean, default: !1 },
/**
* 作为内嵌编辑器被创建后默认选中文本
*/
selectOnCreated: { type: Boolean, default: !1 },
/**
* modelValue 更新时机, 默认 blur; 可选值:blur | input
* - blur: 离开焦点时更新
* - change: 输入时更新
*/
updateOn: { type: String, default: "blur" },
lineBreak: { type: Boolean, default: "enter" }
}, vi = Object.assign({}, At, {
readonly: {}
}), pn = lt(At, pi, ii, mi), yt = /* @__PURE__ */ ke({
name: "FTextarea",
props: At,
emits: ["update:modelValue", "valueChange", "change", "mousedownEvent", "mouseupEvent"],
setup(n, t) {
var j;
const {
isUndefined: e
} = zn(), o = C(), i = C(null), a = R(() => n.modelValue), r = R(() => {
if (!(n.allowUnlimtedWhenEmpty && n.maxLength === 0 || e(n.maxLength)))
return typeof n.maxLength == "number" && !isNaN(n.maxLength) ? n.maxLength : n.modelValue ? n.modelValue.length : 0;
}), u = C(((j = n.modelValue) == null ? void 0 : j.slice(0, r.value)) || ""), s = An(n, t, u, a, o), {
inputGroupClass: c,
onBlur: p,
onFocus: l,
onMousedown: m,
onMouseup: d,
onTextBoxValueChange: f,
hasFocused: v
} = s, x = Un(n, t, s), {
onMouseEnter: F,
onMouseLeave: I,
clearButtonClass: z,
shouldShowClearButton: T,
clearButtonStyle: h
} = x, g = (B) => {
var q, Z, D;
B.stopPropagation(), t.emit("update:modelValue", (q = B.target) == null ? void 0 : q.value), t.emit("valueChange", (Z = B.target) == null ? void 0 : Z.value), t.emit("change", (D = B.target) == null ? void 0 : D.value);
}, k = (B) => {
B.stopPropagation(), i.value.value = "", t.emit("update:modelValue", ""), t.emit("valueChange", ""), t.emit("change", "");
}, M = (B) => {
if (n.readonly || !v)
return;
const {
altKey: q,
key: Z
} = B;
if (Z === "Enter" && !q && n.lineBreak === "alt enter") {
B.preventDefault();
return;
}
if (q && Z === "Enter" && n.lineBreak === "alt enter") {
B.stopPropagation(), B.preventDefault();
const {
selectionStart: D,
selectionEnd: N
} = i.value;
u.value = u.value.slice(0, D) + `
` + u.value.slice(N), st(() => {
var G;
i.value.selectionStart = D + 1, i.value.selectionEnd = D + 1, (G = i.value) == null || G.focus();
}), t.emit("update:modelValue", u.value), t.emit("valueChange", u.value), t.emit("change", u.value);
return;
}
}, S = R(() => ({
"form-control": !0,
"h-100": n.autoHeight
})), P = R(() => {
const B = {};
return n.resizable || (B.resize = "none"), n.rows > 2 ? {
height: "auto",
...B
} : B;
}), y = R(() => n.disabled || n.readonly ? "" : n.placeholder);
we(() => n.modelValue, (B, q) => {
B !== q && (u.value = B);
});
const E = () => i.value;
t.expose({
elementRef: i,
getTextareaElement: E
});
function V() {
var B, q;
n.selectOnCreated && ((B = i.value) == null || B.select()), n.focusOnCreated && ((q = i.value) == null || q.focus({
preventScroll: !0
}));
}
return Xe(() => {
V();
}), () => w("div", {
ref: o,
class: c.value,
onMouseenter: F,
onMouseleave: I,
style: "position:relative"
}, [Vn(w("textarea", {
ref: i,
class: S.value,
id: n.id,
"onUpdate:modelValue": (B) => u.value = B,
minlength: n.minLength,
maxlength: r.value,
tabindex: n.tabIndex,
disabled: n.disabled,
readonly: n.readonly,
autocomplete: n.autocomplete,
placeholder: y.value,
autofocus: n.autofocus,
rows: n.rows,
onInput: g,
onFocus: l,
onChange: f,
onKeydown: M,
onBlur: p,
onMousedown: m,
onMouseup: d,
style: P.value
}, null), [[Nn, u.value]]), T.value && w("span", {
id: "clearIcon",
class: z.value,
style: h.value,
onClick: (B) => k(B)
}, [w("i", {
class: "f-icon modal_close"
}, null)])]);
}
});
function mn(n, t, e) {
var y;
const o = e && e.getStyles && e.getStyles() || "", i = e && e.getDesignerClass && e.getDesignerClass() || "", a = C();
let r;
function u() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanMoveComponent ? e.checkCanMoveComponent() : !0;
}
function s() {
return !1;
}
function c() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanDeleteComponent ? e.checkCanDeleteComponent() : !0;
}
function p() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : e && e.hideNestedPaddingInDesginerView ? e.hideNestedPaddingInDesginerView() : !1;
}
function l(E) {
if (!E || !E.value)
return null;
if (E.value.schema && E.value.schema.type === "component")
return E.value;
const V = C(E == null ? void 0 : E.value.parent), j = l(V);
return j || null;
}
function m(E = t) {
var q;
if (e != null && e.getDraggableDesignItemElement)
return e.getDraggableDesignItemElement(E);
const { componentInstance: V, designerItemElementRef: j } = E;
if (!V || !V.value)
return null;
const { getCustomButtons: B } = V.value;
return V.value.canMove || B && ((q = B()) != null && q.length) ? j : m(E.parent);
}
function d(E) {
return !!e && e.canAccepts(E);
}
function f() {
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
}
function v() {
}
function x(E, V) {
var j;
!E || !V || (e != null && e.onAcceptMovedChildElement && e.onAcceptMovedChildElement(E, V), (j = t == null ? void 0 : t.setupContext) == null || j.emit("dragEnd"));
}
function F(E, V) {
const { componentType: j } = E;
let B = Wn(j, E, V);
e && e.onResolveNewComponentSchema && (B = e.onResolveNewComponentSchema(E, B));
const q = j.toLowerCase().replace(/-/g, "_");
return B && !B.id && B.type === j && (B.id = `${q}_${Math.random().toString().slice(2, 6)}`), B;
}
function I(E) {
E && e != null && e.onChildElementMovedOut && e.onChildElementMovedOut(E);
}
function z(...E) {
if (e && e.getPropsConfig)
return e.getPropsConfig(...E);
}
function T(E) {
if (!E)
return;
const V = t == null ? void 0 : t.schema, { formSchemaUtils: j } = E;
if (V && j.getExpressions().length) {
const B = j.getExpressions().findIndex((q) => q.target === V.id);
B > -1 && j.getExpressions().splice(B, 1);
}
}
function h(E) {
if (!E || !(t != null && t.schema))
return;
const V = t.schema, { formSchemaUtils: j } = E;
j.removeCommunicationInComponent(V);
}
function g(E) {
e && e.onRemoveComponent && e.onRemoveComponent(), T(E), h(E), t != null && t.schema.contents && t.schema.contents.map((V) => {
let j = V.id;
V.type === "component-ref" && (j = V.component);
const B = n.value.querySelectorAll(`#${j}-design-item`);
B != null && B.length && Array.from(B).map((q) => {
var Z;
(Z = q == null ? void 0 : q.componentInstance) != null && Z.value.onRemoveComponent && q.componentInstance.value.onRemoveComponent(E);
});
});
}
function k() {
if (e && e.getCustomButtons)
return e.getCustomButtons();
}
function M(E) {
var j, B;
if (!((j = t == null ? void 0 : t.schema) != null && j.id))
return;
if (!r && E && (r = E.formSchemaUtils), e != null && e.setComponentBasicInfoMap) {
e.setComponentBasicInfoMap();
return;
}
let V = "";
if (e != null && e.getComponentTitle)
V = e.getComponentTitle();
else {
const { text: q, title: Z, label: D, mainTitle: N, name: G, type: A } = t.schema;
V = q || Z || D || N || G || ((B = L[A]) == null ? void 0 : B.name);
}
V && r.getControlBasicInfoMap().set(t.schema.id, {
componentTitle: V,
parentPathName: V
});
}
function S(E) {
var q;
const { changeObject: V } = E, { propertyID: j, propertyValue: B } = V;
if (["text", "title", "label", "name", "mainTitle"].includes((q = E == null ? void 0 : E.changeObject) == null ? void 0 : q.propertyID) && j && B && (M(), r)) {
const Z = r.getControlBasicInfoMap(), D = Z.keys().toArray().filter((N) => {
var G, A;
return ((G = Z.get(N)) == null ? void 0 : G.reliedComponentId) === ((A = t == null ? void 0 : t.schema) == null ? void 0 : A.id);
});
D != null && D.length && D.forEach((N) => {
const G = Z.get(N).parentPathName.split(" > ");
G[0] = B, Z.get(N).parentPathName = G.join(" > ");
});
}
}
function P(E) {
if (S(E), e && e.onPropertyChanged)
return e.onPropertyChanged(E);
}
return a.value = {
canMove: u(),
canSelectParent: s(),
canDelete: c(),
canNested: !p(),
contents: t == null ? void 0 : t.schema.contents,
elementRef: n,
parent: (y = t == null ? void 0 : t.parent) == null ? void 0 : y.componentInstance,
schema: t == null ? void 0 : t.schema,
styles: o,
designerClass: i,
canAccepts: d,
getBelongedComponentInstance: l,
getDraggableDesignItemElement: m,
getDraggingDisplayText: f,
getPropConfig: z,
getDragScopeElement: v,
onAcceptMovedChildElement: x,
onChildElementMovedOut: I,
addNewChildComponentSchema: F,
triggerBelongedComponentToMoveWhenMoved: !!e && e.triggerBelongedComponentToMoveWhenMoved || C(!1),
triggerBelongedComponentToDeleteWhenDeleted: !!e && e.triggerBelongedComponentToDeleteWhenDeleted || C(!1),
onRemoveComponent: g,
getCustomButtons: k,
onPropertyChanged: P,
setComponentBasicInfoMap: M,
updateContextSchema: t == null ? void 0 : t.updateContextSchema
}, a;
}
const hi = C(0);
function gi() {
hi.value++;
}
const ft = C(0);
function yi(n) {
const { formSchemaUtils: t, formStateMachineUtils: e } = n;
function o(s, c = "") {
return {
path: c + s.code,
field: s.id,
fullPath: s.code
};
}
function i(s, c = "") {
return t.getViewModelById(s).states.map((l) => o(l, c));
}
function a(s) {
const c = t.getRootViewModelId(), p = i(s);
if (s === c)
return p;
const l = i(c, "root-component.");
return [...p, ...l];
}
function r(s) {
return s.binding && s.binding.path || s.id || "";
}
function u() {
return e && e.getRenderStates() || [];
}
return { getVariables: a, getControlName: r, getStateMachines: u };
}
class vn {
constructor(t) {
X(this, "sessionVariables", [
{
key: "CurrentSysOrgName",
name: "当前组织Name",
description: "当前组织Name"
},
// {
// key: "CurrentSysOrgCode",
// name: "当前组织Code",
// description: "当前组织Code"
// },
{
key: "CurrentSysOrgId",
name: "当前组织Id",
description: "当前组织Id"
},
{
key: "CurrentUserName",
name: "当前用户Name",
description: "当前用户Name"
},
{
key: "CurrentUserCode",
name: "当前用户Code",
description: "当前用户Code"
},
{
key: "CurrentUserId",
name: "当前用户Id",
description: "当前用户Id"
},
{
key: "CurrentLanguage",
name: "当前语言编号",
description: "当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"
}
]);
X(this, "expressionNames", {
compute: "计算表达式",
dependency: "依赖表达式",
validate: "验证表达式",
dataPicking: "帮助前表达式",
visible: "可见表达式",
readonly: "只读表达式",
required: "必填表达式"
});
X(this, "getExpressionConverter", (t, e) => ({
convertFrom: (o, i, a, r) => {
const u = a.getExpressionRuleValue(t, e || i);
return u && u.value || "";
},
convertTo: (o, i, a, r, u) => {
var s;
if (i === "dataPicking" && (a != null && a.target)) {
const c = `${a.target}_dataPicking`;
((s = a.rules) == null ? void 0 : s.some(
(l) => l.id === c && l.value
)) ? o.dictPickingExpressionId = c : delete o.dictPickingExpressionId;
}
r.updateExpression(a);
}
}));
this.formSchemaService = t;
}
getExpressionRule(t, e) {
const o = this.formSchemaService.getExpressions();
if (!o)
return "";
const i = o.find((r) => r.target === t);
if (!i)
return "";
const a = i.rules.find((r) => r.type === e);
return a || "";
}
// 获取上下文表单变量
getContextFormVariables() {
const { module: t } = this.formSchemaService.getFormSchema();
if (!t.viewmodels || t.viewmodels.length === 0)
return [];
const e = this.formSchemaService.getRootViewModelId(), o = this.formSchemaService.getViewModelById(e);
if (!o || !o.states || o.states.length === 0)
return [];
const i = [];
return o.states.forEach((a) => {
i.push({
key: a.code,
name: a.name,
description: a.name,
category: a.category
});
}), i;
}
createTreeNode(t, e, o = "label") {
return {
id: t.id,
name: t.name,
bindingPath: t[o],
parents: e,
type: "field"
};
}
buildEntityFieldsTreeData(t = null, e) {
const o = [];
return t == null || t.forEach((i) => {
var u;
const a = this.createTreeNode(i, e);
let r = [];
(u = i.type) != null && u.fields && (r = this.buildEntityFieldsTreeData(i.type.fields, [...e, i.label])), o.push({
data: a,
children: r,
expanded: !0
});
}), o;
}
buildChildEntityTreeData(t = null, e) {
const o = [];
return t == null || t.forEach((i) => {
var s, c;
const a = this.createTreeNode(i, e);
a.type = "entity";
const r = this.buildEntityFieldsTreeData((s = i.type) == null ? void 0 : s.fields, [...e, i.label]), u = this.buildChildEntityTreeData((c = i.type) == null ? void 0 : c.entities, [...e, i.label]);
u != null && u.length && (r == null || r.push(...u)), o.push({
data: a,
children: r || [],
// 空值回退
expanded: !0
});
}), o;
}
getEntitiesTreeData() {
const t = this.formSchemaService.getSchemaEntities();
if (!(t != null && t.length))
return [];
const e = t[0];
if (!(e != null && e.type))
return [];
const o = this.buildEntityFieldsTreeData(e.type.fields, [e.code]), i = this.buildChildEntityTreeData(e.type.entities, [e.code]);
return i != null && i.length && (o == null || o.push(...i)), {
entityCode: e.code,
fields: [{
data: this.createTreeNode(e, [], "code"),
children: o || []
}]
};
}
getEntitiesAndVariables() {
return {
entities: this.getEntitiesTreeData(),
variables: {
session: {
name: "系统变量",
items: this.sessionVariables,
visible: !1
},
forms: {
name: "表单变量",
items: this.getContextFormVariables(),
visible: !0
}
}
};
}
onBeforeOpenExpression(t, e, o) {
const i = o === "Field" ? t.binding.field : t.id, a = this.getExpressionRule(i, e), r = this.getEntitiesAndVariables(), u = {
message: ["validate", "required", "dataPicking"].includes(e) && a ? a.message : "",
...r
};
return a.messageType != null && (u.messageType = a.messageType), u;
}
buildRule(t, e, o, i) {
const { expression: a, message: r, messageType: u } = e, s = {
id: `${t}_${o}`,
type: o,
value: a
};
return (o === "validate" || o === "dataPicking" || o === "required") && (s.message = r), o === "dataPicking" && (s.messageType = u), o === "validate" && i && (s.elementId = i), s;
}
getExpressionData() {
const { expressions: t } = this.formSchemaService.getFormSchema().module;
return t || [];
}
updateExpression(t, e, o, i) {
const a = e === "Field" ? t.binding.field : t.id, r = this.buildRule(a, o, i, t.type === "form-group" ? t.id : "");
let s = this.getExpressionData().find((p) => p.targetType === e && p.target === a);
const c = (p) => p.value.trim() === "";
if (s) {
const p = s.rules.find((l) => l.id === r.id);
if (p)
c(r) ? s.rules = s.rules.filter((l) => l.id !== r.id) : (Object.assign(p, r), i === "validate" && t.type === "form-group" && (p.elementId = t.id));
else {
if (c(r))
return null;
s.rules = s.rules || [], s.rules.push(r);
}
} else {
if (c(r))
return null;
s = {
target: `${a}`,
rules: [r],
targetType: e
};
}
return s;
}
getExpressionEditorOptions(t, e, o, i) {
return o.reduce((a, r) => {
var s, c;
const u = e === "Field" ? (s = t == null ? void 0 : t.binding) == null ? void 0 : s.field : t.id;
return a[r] = {
hide: e === "Field" ? !!((c = t == null ? void 0 : t.binding) != null && c.field) : !1,
description: "",
title: this.expressionNames[r],
type: "string",
$converter: this.getExpressionConverter(u),
refreshPanelAfterChanged: !0,
editor: {
type: "expression-editor",
singleExpand: !1,
dialogTitle: `${this.expressionNames[r]}编辑器`,
showMessage: r === "validate" || r === "dataPicking" || r === "required",
showMessageType: r === "dataPicking",
beforeOpen: () => this.onBeforeOpenExpression(t, r, e),
onSubmitModal: (p) => {
const l = this.updateExpression(t, e, p, r);
if (i) {
const m = this.buildRule(u, p, r);
i(m);
}
return l;
}
}
}, a;
}, {});
}
getExpressionInfo(t, e, o) {
const i = e === "Field" ? t.binding.field : t.id, a = this.getExpressionRule(i, o), r = {
value: a && a.value,
targetId: i,
targetType: e,
expressionType: o
};
return a && a.message && (r.message = a.message), r;
}
getExpressionConfig(t, e, o = ["compute", "dependency", "validate"], i) {
return {
description: "表达式",
title: "表达式",
hide: !t.binding,
properties: {
...this.getExpressionEditorOptions(t, e, o, i)
}
};
}
getExpressionOptions(t, e, o) {
const i = this.getExpressionInfo(t, e, o);
return {
dialogTitle: `${this.expressionNames[o]}编辑器`,
singleExpand: !1,
showMessage: o === "required",
beforeOpen: () => this.onBeforeOpenExpression(t, o, e),
expressionInfo: i
};
}
}
class bi {
constructor(t, e) {
X(this, "componentId");
X(this, "viewModelId");
X(this, "eventsEditorUtils");
X(this, "formSchemaUtils");
X(this, "formMetadataConverter");
X(this, "designViewModelUtils");
X(this, "designViewModelField");
X(this, "controlCreatorUtils");
X(this, "designerHostService");
X(this, "designerContext");
X(this, "schemaService", null);
X(this, "metadataService", null);
X(this, "propertyConfig", {
type: "object",
categories: {}
});
var o;
this.componentId = t, this.designerHostService = e, this.eventsEditorUtils = e.eventsEditorUtils, this.formSchemaUtils = e.formSchemaUtils, this.formMetadataConverter = e.formMetadataConverter, this.viewModelId = ((o = this.formSchemaUtils) == null ? void 0 : o.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = e.designViewModelUtils, this.controlCreatorUtils = e.controlCreatorUtils, this.metadataService = e.metadataService, this.schemaService = e.schemaService, this.designerContext = e.designerContext;
}
getFormDesignerInstance() {
var t, e;
return (e = (t = this.designerContext) == null ? void 0 : t.instances) == null ? void 0 : e.formDesigner.value;
}
getTableInfo() {
var t;
return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
}
setDesignViewModelField(t) {
var o;
const e = t.binding && t.binding.type === "Form" && t.binding.field;
if (e) {
if (!this.designViewModelField) {
const i = this.designViewModelUtils.getDgViewModel(this.viewModelId);
this.designViewModelField = i.fields.find((a) => a.id === e);
}
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",
idField: "value",
editable: !1,
data: [{ value: t.type, name: L[t.type] && L[t.type].name }]
}
}
}
};
}
getAppearanceConfig(t = null, e = {}, o) {
const i = {
title: "外观",
description: "Appearance"
}, a = {
class: {
title: "class样式",
type: "string",
description: "组件的CSS样式",
$converter: "/converter/appearance.converter",
parentPropertyID: "appearance"
},
style: {
title: "style样式",
type: "string",
description: "组件的样式",
$converter: "/converter/appearance.converter",
parentPropertyID: "appearance"
}
};
for (const r in e)
a[r] = Object.assign(a[r] || {}, e[r]);
return {
...i,
properties: { ...a },
setProp