@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,546 lines • 530 kB
JavaScript
var qi = Object.defineProperty;
var Wi = (e, n, t) => n in e ? qi(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
var B = (e, n, t) => Wi(e, typeof n != "symbol" ? n + "" : n, t);
import { ref as S, computed as N, watch as Se, defineComponent as Le, onBeforeUnmount as po, withDirectives as mo, createVNode as _, resolveDirective as sr, Fragment as Gt, reactive as Pt, createApp as ho, onUnmounted as un, onMounted as ut, Transition as lr, mergeProps as Mt, createTextVNode as ht, nextTick as Xt, inject as nt, provide as Hi, triggerRef as Gi, isVNode as Ui, onBeforeMount as zi, Teleport as ur, shallowRef as Yi, render as Ln, h as Xi, cloneVNode as Qi, vShow as Ki } from "vue";
import { isPlainObject as Bo, cloneDeep as Ee, isUndefined as Ro } from "lodash-es";
import Ji, { FDynamicFormGroup as Zi, FDynamicFormInput as ea } from "../dynamic-form/index.esm.js";
import { DgControl as Xn, useDesignerComponent as ta } from "../designer-canvas/index.esm.js";
import { useResizeObserver as cr } from "@vueuse/core";
import { useIdentify as na, useGroupData as oa, useFilter as ra, useHierarchy as ia, useLoading as aa, useDataView as sa, useSelection as la, useSelectHierarchyItem as ua, useDataViewContainerStyle as ca, useCommandColumn as da, useColumn as fa, useSort as pa, useGroupColumn as ma, useRow as ha, useEdit as ga, useVisualDataBound as va, useVisualDataCell as ya, useVisualDataRow as ba, useVisualData as wa, useCellPosition as Ca, useSidebar as xa, useVirtualScroll as Sa, useFitColumn as Ta, useFilterHistory as Fa, useColumnFilter as _a, useDragColumn as ka, getColumnHeader as Ea, getSidebar as Ma, getDisableMask as Oa, getHorizontalScrollbar as Ia, getVerticalScrollbar as Pa, getEmpty as Ba } from "../data-view/index.esm.js";
import { F_MODAL_SERVICE_TOKEN as Ra } from "../modal/index.esm.js";
import Da, { FTransfer as dr } from "../transfer/index.esm.js";
import Na from "../tabs/index.esm.js";
import Va from "../order/index.esm.js";
import { useConditionValue as La } from "../condition/index.esm.js";
import Aa, { FCheckbox as $a } from "../checkbox/index.esm.js";
import ja from "../filter-bar/index.esm.js";
import Do from "../tooltip/index.esm.js";
import qa from "../pagination/index.esm.js";
import Wa from "../button/index.esm.js";
import Ha from "../search-box/index.esm.js";
import fr from "../tags/index.esm.js";
import { useDateFormat as Ga, useNumberFormat as Ua, resolveField as mt, setFieldValue as Qn, getCustomClass as An, withInstall as za, FormSchemaEntityField$Type as No, FormSchemaEntityFieldType$Type as Ya, useTextBoxDesign as Xa, useClear as Qa } from "../common/index.esm.js";
import Ka from "../accordion/index.esm.js";
import Ja from "../avatar/index.esm.js";
import Za, { FButtonEdit as es } from "../button-edit/index.esm.js";
import ts from "../button-group/index.esm.js";
import ns from "../calendar/index.esm.js";
import os from "../capsule/index.esm.js";
import rs from "../color-picker/index.esm.js";
import Kn from "../combo-list/index.esm.js";
import is from "../content-container/index.esm.js";
import as, { FDataGrid as ss } from "../data-grid/index.esm.js";
import ls from "../date-picker/index.esm.js";
import us from "../dropdown/index.esm.js";
import "../external-container/index.esm.js";
import cs from "../events-editor/index.esm.js";
import ds from "../image-cropper/index.esm.js";
import fs, { FInputGroup as ps } from "../input-group/index.esm.js";
import ms from "../layout/index.esm.js";
import hs from "../list-nav/index.esm.js";
import gs from "../list-view/index.esm.js";
import vs, { LookupSchemaRepositoryToken as ys } from "../lookup/index.esm.js";
import bs from "../nav/index.esm.js";
import ws from "../number-spinner/index.esm.js";
import Cs from "../number-range/index.esm.js";
import xs from "../page-header/index.esm.js";
import Ss from "../page-footer/index.esm.js";
import Ts from "../progress/index.esm.js";
import Fs from "../query-solution/index.esm.js";
import pr from "../radio-group/index.esm.js";
import _s from "../rate/index.esm.js";
import ks from "../response-toolbar/index.esm.js";
import Es from "../response-layout/index.esm.js";
import Ms from "../response-layout-editor/index.esm.js";
import Os from "../section/index.esm.js";
import Is from "../smoke-detector/index.esm.js";
import Ps from "../splitter/index.esm.js";
import Bs from "../step/index.esm.js";
import Rs from "../switch/index.esm.js";
import Ds from "../text/index.esm.js";
import Ns from "../time-picker/index.esm.js";
import Vs from "../tree-view/index.esm.js";
import Ls from "../uploader/index.esm.js";
import As from "../verify-detail/index.esm.js";
import $s from "../component/index.esm.js";
import js from "../video/index.esm.js";
import qs from "../textarea/index.esm.js";
import Ws from "../tree-grid/index.esm.js";
import Hs from "../fieldset/index.esm.js";
import Gs from "../drawer/index.esm.js";
import Us from "../binding-selector/index.esm.js";
import { FNotifyService as zs } from "../notify/index.esm.js";
import Ys from "../combo-tree/index.esm.js";
import Xs, { FieldSelectorRepositoryToken as $n } from "../field-selector/index.esm.js";
import Qs from "../mapping-editor/index.esm.js";
import Ks from "../schema-selector/index.esm.js";
import Js from "../event-parameter/index.esm.js";
import Zs from "../filter-condition-editor/index.esm.js";
import el from "../sort-condition-editor/index.esm.js";
import tl from "../menu-lookup/index.esm.js";
import { createPropsResolver as mr, resolveAppearance as hr } from "../dynamic-resolver/index.esm.js";
import "bignumber.js";
import { FPropertyPanel as nl } from "../property-panel/index.esm.js";
import ol from "../transfer/index.esm.js/src/transfer.component";
import rl from "../popover/index.esm.js";
const gr = {}, vr = {};
function go(e) {
const { properties: n, title: t, ignore: o } = e, r = o && Array.isArray(o), i = Object.keys(n).reduce((a, l) => ((!r || !o.find((u) => u === l)) && (a[l] = n[l].type === "object" && n[l].properties ? go(n[l]) : Ee(n[l].default)), a), {});
if (t && (!r || !o.find((a) => a === "id"))) {
const a = t.toLowerCase().replace(/-/g, "_");
i.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return i;
}
function il(e) {
const { properties: n, title: t, required: o } = e;
if (o && Array.isArray(o)) {
const r = o.reduce((i, a) => (i[a] = n[a].type === "object" && n[a].properties ? go(n[a]) : Ee(n[a].default), i), {});
if (t && o.find((i) => i === "id")) {
const i = t.toLowerCase().replace(/-/g, "_");
r.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return r;
}
return {
type: t
};
}
function yn(e, n = {}, t) {
const o = gr[e];
if (o) {
let r = il(o);
const i = vr[e];
return r = i ? i({ getSchemaByType: yn }, r, n, t) : r, r;
}
return null;
}
function al(e, n) {
const t = go(n);
return Object.keys(t).reduce((o, r) => (Object.prototype.hasOwnProperty.call(e, r) && (o[r] && Bo(o[r]) && Bo(e[r] || !e[r]) ? Object.assign(o[r], e[r] || {}) : o[r] = e[r]), o), t), t;
}
function yr(e, n) {
return Object.keys(e).filter((o) => e[o] != null).reduce((o, r) => {
if (n.has(r)) {
const i = n.get(r);
if (typeof i == "string")
o[i] = e[r];
else {
const a = i(r, e[r], e);
Object.assign(o, a);
}
} else
o[r] = e[r];
return o;
}, {});
}
function sl(e, n, t = /* @__PURE__ */ new Map()) {
const o = al(e, n);
return yr(o, t);
}
function ll(e = {}) {
function n(d, c, s, f) {
if (typeof s == "number")
return f[d].length === s;
if (typeof s == "object") {
const m = Object.keys(s)[0], p = s[m];
if (m === "not")
return Number(f[d].length) !== Number(p);
if (m === "moreThan")
return Number(f[d].length) >= Number(p);
if (m === "lessThan")
return Number(f[d].length) <= Number(p);
}
return !1;
}
function t(d, c, s, f) {
return f[d] && f[d].propertyValue && String(f[d].propertyValue.value) === String(s);
}
const o = /* @__PURE__ */ new Map([
["length", n],
["getProperty", t]
]);
Object.keys(e).reduce((d, c) => (d.set(c, e[c]), d), o);
function r(d, c) {
const s = d;
return typeof c == "number" ? [{ target: s, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: s, operator: "getProperty", param: d, value: !!c }] : typeof c == "object" ? Object.keys(c).map((f) => {
if (f === "length")
return { target: s, operator: "length", param: null, value: c[f] };
const m = f, p = c[f];
return { target: s, operator: "getProperty", param: m, value: p };
}) : [];
}
function i(d) {
return Object.keys(d).reduce((s, f) => {
const m = r(f, d[f]);
return s.push(...m), s;
}, []);
}
function a(d, c) {
if (o.has(d.operator)) {
const s = o.get(d.operator);
return s && s(d.target, d.param, d.value, c) || !1;
}
return !1;
}
function l(d, c) {
return i(d).reduce((m, p) => m && a(p, c), !0);
}
function u(d, c) {
const s = Object.keys(d), f = s.includes("allOf"), m = s.includes("anyOf"), p = f || m, g = (p ? d[p ? f ? "allOf" : "anyOf" : "allOf"] : [d]).map((w) => l(w, c));
return f ? !g.includes(!1) : g.includes(!0);
}
return { parseValueSchema: u };
}
const se = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
"input-group": { type: "input-group", name: "文本" },
textarea: { type: "textarea", name: "多行文本" },
lookup: { type: "lookup", name: "帮助" },
"number-spinner": { type: "number-spinner", name: "数值" },
"date-picker": { type: "date-picker", name: "日期" },
switch: { type: "switch", name: "开关" },
"radio-group": { type: "radio-group", name: "单选组" },
"check-box": { type: "check-box", name: "复选框" },
"check-group": { type: "check-group", name: "复选框组" },
"combo-list": { type: "combo-list", name: "下拉列表" },
"response-form": { type: "response-form", name: "卡片面板" },
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
"tree-grid": { type: "tree-grid", name: "树表格" },
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
"data-grid": { type: "data-grid", name: "表格" },
"data-grid-column": { type: "data-grid-column", name: "表格列" },
module: { type: "Module", name: "模块" },
component: { type: "component", name: "组件" },
tabs: { type: "tabs", name: "标签页" },
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
"time-picker": { type: "time-picker", name: "时间选择" },
section: { type: "section", name: "分组面板" },
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
splitter: { type: "splitter", name: "分栏面板" },
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
"component-ref": { type: "component-ref", name: "组件引用节点" },
uploader: { type: "uploader", name: "附件上传" },
"page-header": { type: "page-header", name: "页头" },
"page-footer": { type: "page-footer", name: "页脚" },
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
fieldset: { type: "fieldset", name: "分组" },
"query-solution": { type: "query-solution", name: "筛选方案" },
drawer: { type: "drawer", name: "抽屉" }
}, br = {}, ul = {};
ll();
function Ot(e, n, t = /* @__PURE__ */ new Map(), o = (a, l, u, d) => l, r = {}, i = (a) => a) {
return gr[n.title] = n, vr[n.title] = o, br[n.title] = r, ul[n.title] = i, (a = {}, l = !0) => {
if (!l)
return yr(a, t);
const u = sl(a, n, t), d = Object.keys(e).reduce((c, s) => (c[s] = e[s].default, c), {});
return Object.assign(d, u);
};
}
function Jt(e, n) {
return { customClass: n.class, customStyle: n.style };
}
function cl() {
function e(n, t) {
const { dataSource: o } = n || {};
return o === void 0 ? {} : {};
}
return {
resolve: e
};
}
function dl() {
function e(n, t) {
return n.selectItemById(t);
}
return {
selectItemById: e
};
}
function fl() {
function e(n, t) {
const { columns: o } = t;
return n.updateColumns(o);
}
return {
updateColumns: e
};
}
var pt = /* @__PURE__ */ ((e) => (e.Equal = "0", e.NotEqual = "1", e.Greater = "2", e.GreaterOrEqual = "3", e.Less = "4", e.LessOrEqual = "5", e.Like = "6", e.LikeStartWith = "7", e.LikeEndWith = "8", e.In = "9", e.NotIn = "10", e))(pt || {});
const pl = [
{
value: "0",
name: "等于"
},
{
value: "1",
name: "不等于"
},
{
value: "2",
name: "大于"
},
{
value: "3",
name: "大于等于"
},
{
value: "4",
name: "小于"
},
{
value: "5",
name: "小于等于"
},
{
value: "6",
name: "包含"
},
{
value: "7",
name: "开始是"
},
{
value: "8",
name: "结束是"
}
], ml = {
"button-edit": ["0", "1", " 6", "7", "8"],
"check-box": ["0"],
"combo-list": ["0", "1"],
"combo-lookup": ["0", "1", " 6", "7", "8"],
"date-picker": ["0", "1", "2", "3", "4", "5"],
"date-range": [],
"datetime-picker": ["0", "1", "2", "3", "4", "5"],
"datetime-range": [],
"month-picker": ["0", "1", "2", "3", "4", "5"],
"month-range": [],
"year-picker": ["0", "1", "2", "3", "4", "5"],
"year-range": [],
"input-group": ["0", "1", "6", "7", "8"],
lookup: ["0", "1"],
"number-range": [],
"number-spinner": ["0", " 1", "2", "3", "4", "5"],
"radio-group": ["0"],
text: ["0", "1", " 6", "7", "8"]
};
function hl(e, n, t) {
const { fieldMap: o } = t;
function r(i) {
const a = o.get(i.fieldCode);
if (!a)
return [];
const l = a.editor.type, u = new Set(ml[l]);
return pl.filter((c) => u.has(c.value));
}
return { getCompareOperators: r };
}
const vo = {
conditions: { type: Array, default: [] },
fields: { type: Array, default: [] },
key: { type: String, default: "" },
/**
* 控间标签同行展示
*/
isControlInline: { type: Boolean, default: !0 }
};
class wr {
constructor(n = { value: [] }) {
B(this, "editorType", "check-box");
B(this, "value");
B(this, "valueType", "boolean");
const o = (Array.isArray(n.value) ? n.value : typeof n.value == "string" ? n.value.split(",") : []).map((r) => JSON.parse(r));
this.value = o;
}
clear() {
this.value = [];
}
setValue(n) {
this.value = n;
}
getValue() {
return this.value;
}
getDisplayText() {
return this.value.map((n) => n ? "是" : "否").join(",");
}
isEmpty() {
return this.value.length === 0;
}
}
class Cr {
constructor(n = { textValue: "", value: "", valueField: "" }) {
B(this, "editorType", "combo-lookup");
B(this, "textValue");
B(this, "value");
B(this, "valueField");
B(this, "valueType", "text");
this.textValue = n.textValue, this.value = n.value, this.valueField = n.valueField;
}
clear() {
this.value = "", this.valueField = "", this.textValue = "";
}
getPropValue(n, t) {
if (t.length > 1) {
const o = t.shift();
return n[o] ? this.getPropValue(n[o], t) : null;
}
return n[t[0]];
}
getTextValue(n) {
const t = n.split("."), o = this.value.split(",").map((r) => this.getPropValue(r, Ee(t)));
return o && o.length ? o.join(",") : "";
}
getValue() {
const n = this.valueField.split("."), t = this.value.split(",").map((o) => this.getPropValue(o, Ee(n)));
return t && t.length ? t.join(",") : "";
}
getDisplayText() {
return this.getValue();
}
setValue(n) {
throw new Error("Method not implemented.");
}
isEmpty() {
return !this.valueField;
}
}
class xr {
constructor(n = { value: "", displayFormat: "", valueFormat: "" }) {
B(this, "editorType", "date-picker");
B(this, "value");
B(this, "valueType", "datetime");
B(this, "displayFormat", "");
B(this, "valueFormat", "");
this.value = n.value, this.displayFormat = n.displayFormat, this.valueFormat = n.valueFormat;
}
setValue(n) {
this.value = n.formatted;
}
getValue() {
return this.value;
}
getDisplayText() {
return this.getValue();
}
isEmpty() {
return !this.value;
}
clear() {
this.value = void 0;
}
}
class bn {
constructor(n = { begin: "", end: "" }) {
B(this, "editorType", "date-range");
B(this, "begin", "");
B(this, "end", "");
B(this, "valueType", "datetime");
this.begin = n.begin, this.end = n.end;
}
clear() {
this.begin = "", this.end = "";
}
getValue() {
return !this.begin || !this.end ? "" : `${this.begin}~${this.end}`;
}
getDisplayText() {
return this.getValue();
}
setValue(n) {
n.dataRange ? (this.begin = n.dataRange.split(n.delimiter)[0], this.end = n.dataRange.split(n.delimiter)[1]) : this.clear();
}
isEmpty() {
return !this.begin || !this.end;
}
}
class Sr {
constructor(n = { value: "" }) {
B(this, "editorType", "datetime-picker");
B(this, "value");
B(this, "valueType", "datetime");
this.value = n.value;
}
clear() {
this.value = void 0;
}
getValue() {
return this.value;
}
getDisplayText() {
return this.getValue();
}
setValue(n) {
this.value = n.formatted;
}
isEmpty() {
return !this.value;
}
}
class Tr {
constructor(n = { value: "", valueList: [] }) {
B(this, "editorType", "combo-list");
B(this, "value");
B(this, "valueType", "enum");
B(this, "valueList", []);
this.value = n.value, this.valueList = n.valueList;
}
clear() {
this.value = "", this.valueList = [];
}
getValue() {
return this.value;
}
getDisplayText() {
var r, i;
const n = typeof this.value;
let t = "", o = [];
switch (n) {
case "string":
o = this.value.split(",") || [], t = this.valueList.filter((a) => o.indexOf(a.value) > -1).map((a) => a.name).join(",");
break;
case "boolean":
t = ((r = this.valueList.find((a) => a.value === this.value)) == null ? void 0 : r.name) || "";
break;
case "number":
t = ((i = this.valueList.find((a) => a.value === this.value)) == null ? void 0 : i.name) || "";
break;
}
return t;
}
// setValue(data: { value: string; displayText: string }) {
// // this.displayText = data.dispalyText;
// const enumValues = getEnumValues(data);
// this.value = enumValues;
// return this.displayText;
// }
setValue(n) {
this.value = n.value;
}
isEmpty() {
return !this.value && this.value !== !1 && this.value !== 0;
}
}
class gl {
constructor(n = { value: "", displayText: "", displayField: "", isInputText: !1 }) {
B(this, "editorType", "input-group");
// 通过弹窗返回的若干个值对象构成的数组
B(this, "value");
B(this, "valueType", "text");
// 控件内显示的值
B(this, "displayText");
// 弹窗模式下,取列表中哪个字段的值映射到当前字段
B(this, "valueField");
// 是否是手动输入的值
B(this, "isInputText");
this.value = n.value, this.displayText = n.displayText, this.valueField = n.displayField, this.isInputText = n.isInputText;
}
clear() {
this.value = "", this.displayText = "", this.valueField = "";
}
getPropValue(n, t) {
if (t.length > 1) {
const o = t.shift();
return n[o] ? this.getPropValue(n[o], t) : "";
}
return n[t[0]];
}
getTextValue(n) {
const t = n.split("."), o = this.value.map((r) => this.getPropValue(r, Ee(t)));
return o && o.length ? o.join(",") : "";
}
getValue() {
return this.value;
}
getDisplayText() {
return this.getValue();
}
setValue(n) {
throw new Error("Method not implemented.");
}
isEmpty() {
return !this.displayText && !this.value.length;
}
}
class Fr {
constructor(n = { mapFields: [], value: "", valueField: "", isInputText: !1, helpId: "" }) {
B(this, "editorType", "lookup");
B(this, "idValue");
B(this, "helpId");
B(this, "mapFields");
B(this, "value");
B(this, "valueField");
B(this, "valueType", "text");
// 帮助的值是否为手动输入的任意值,对应帮助的任意输入属性nosearch
B(this, "isInputText");
this.value = n.value, this.valueField = n.valueField, this.mapFields = n.mapFields, this.idValue = n.mapFields.map((t) => t.id).join(","), this.isInputText = n.isInputText, this.helpId = n.helpId;
}
clear() {
this.value = "", this.idValue = "", this.mapFields = [];
}
getValue() {
return this.mapFields.map((n) => n[this.valueField || "id"]).join(",");
}
getDisplayText() {
return this.getValue();
}
setValue(n) {
throw new Error("Method not implemented.");
}
isEmpty() {
return !this.mapFields.length;
}
}
class _r {
constructor(n = { value: "" }) {
B(this, "editorType", "month-picker");
B(this, "value");
B(this, "valueType", "datetime");
this.value = n.value;
}
setValue(n) {
this.value = n.formatted;
}
getValue() {
return this.value;
}
getDisplayText() {
return this.getValue();
}
clear() {
this.value = void 0;
}
isEmpty() {
return !this.value;
}
}
class kr {
constructor(n = { begin: "", end: "" }) {
B(this, "editorType", "month-range");
B(this, "begin");
B(this, "end");
B(this, "valueType", "datetime");
this.begin = n.begin, this.end = n.end;
}
clear() {
this.begin = "", this.end = "";
}
getValue() {
return !this.begin || !this.end ? "" : `${this.begin}~${this.end}`;
}
getDisplayText() {
return this.getValue();
}
setValue(n) {
n.dataRange ? (this.begin = n.dataRange.split(n.delimiter)[0], this.end = n.dataRange.split(n.delimiter)[1]) : this.clear();
}
isEmpty() {
return !this.begin || !this.end;
}
}
class Er {
constructor(n = { begin: null, end: null }) {
B(this, "editorType", "number-range");
B(this, "begin");
B(this, "end");
B(this, "valueType", "number");
this.begin = n.begin == null ? null : parseFloat(n.begin), this.end = n.end == null ? null : parseFloat(n.end);
}
clear() {
this.begin = null, this.end = null;
}
getValue() {
return {
begin: this.begin,
end: this.end
};
}
getDisplayText() {
return this.getValue();
}
setValue(n) {
this.begin = n.begin == null ? null : parseFloat(n.begin), this.end = n.end == null ? null : parseFloat(n.end);
}
isEmpty() {
return this.begin == null && this.end == null;
}
}
class Mr {
constructor(n = { value: "" }) {
B(this, "editorType", "number-spinner");
B(this, "value");
B(this, "valueType", "number");
this.value = n.value == null ? null : parseFloat(n.value);
}
clear() {
this.value = null;
}
getValue() {
return this.value;
}
getDisplayText() {
return this.getValue();
}
setValue(n) {
this.value = isNaN(parseFloat(n)) ? null : n;
}
isEmpty() {
return this.value == null || isNaN(this.value);
}
}
class Or {
constructor(n = { value: null, valueList: [] }) {
B(this, "editorType", "radio-group");
B(this, "value");
B(this, "valueType", "enum");
B(this, "valueList", []);
this.value = n.value, this.valueList = n.valueList;
}
clear() {
this.value = void 0, this.valueList = [];
}
getValue() {
return this.value;
}
getDisplayText() {
var n;
return ((n = this.valueList.find((t) => t.value === this.value)) == null ? void 0 : n.name) || "";
}
setValue(n) {
this.value = n;
}
isEmpty() {
return !this.value && this.value !== 0 && this.value !== !1;
}
}
class wn {
constructor(n = { value: "" }) {
B(this, "editorType", "text");
B(this, "value");
B(this, "valueType", "text");
this.value = n.value;
}
clear() {
this.value = void 0;
}
getValue() {
return this.value;
}
getDisplayText() {
return this.getValue();
}
setValue(n) {
this.value = n;
}
isEmpty() {
return !this.value;
}
}
function Ir() {
function e(n, t) {
switch (n) {
case "check-box":
return new wr(t);
case "combo-list":
return new Tr(t);
case "combo-lookup":
return new Cr(t);
case "input-group":
return new gl(t);
case "date-picker":
return new xr(t);
case "date-range":
return new bn(t);
case "datetime-picker":
return new Sr(t);
case "datetime-range":
return new bn(t);
case "lookup":
return new Fr(t);
case "month-picker":
return new _r(t);
case "month-range":
return new kr(t);
case "number-range":
return new Er(t);
case "number-spinner":
return new Mr(t);
case "radio-group":
return new Or(t);
default:
return new wn(t);
}
}
return { createConditionValue: e };
}
function yo(e, n) {
const t = S(e.fields), o = S([]), r = /* @__PURE__ */ new Map(), { createConditionValue: i } = Ir();
function a(c) {
switch (c.editor ? c.editor.type : "input-group") {
case "date-range":
c.editor.type = "date-picker";
break;
case "datetime-range":
c.editor.type = "datetime-picker";
break;
case "number-range":
c.editor.type = "number-spinner";
break;
}
return c.editor;
}
function l(c) {
return c.map((f) => Object.assign({}, f)).map((f) => (f.editor = a(f), f));
}
function u(c = !0) {
t.value.reduce((s, f) => (c || (f.editor = a(f)), s.set(f.labelCode, f), s), r);
}
function d(c) {
return c.forEach((s) => {
if (s) {
const f = r.get(s.fieldCode);
s.value = i(f.editor.type, s.value);
}
}), c;
}
return { convertToSingleControl: l, fields: t, fieldMap: r, fieldConditions: o, loadFieldConfigs: u, initialConditionValue: d };
}
function Pr(e, n, t) {
const o = S(null), r = S(t), i = S(0);
function a(c, s) {
let f = null;
return function() {
const m = arguments;
f ? (clearTimeout(f), f = setTimeout(() => {
f = null, c(...m);
}, 200)) : (c(...m), f = setTimeout(() => {
f = null;
}, 200));
};
}
function l() {
r.value && (o.value = new ResizeObserver(a((c) => {
const s = c[0];
i.value = s.contentRect.width;
})), o.value.observe(r.value));
}
function u(c) {
let f = "col-12";
return c > 250 * 6 ? f = "col-2" : c > 250 * 4 ? f = "col-3" : c > 250 * 3 ? f = "col-4" : c > 250 * 2 && (f = "col-6"), f;
}
const d = N(() => u(i.value));
return Se([t], ([c]) => {
r.value = c, l();
}), {
conditionClass: d,
resizeObserver: o
};
}
const Cn = /* @__PURE__ */ Le({
name: "FConditionFields",
props: vo,
emits: ["valueChange", "blur", "focus", "click", "input"],
setup(e, n) {
const t = S(), o = S(e.key);
S(e.isControlInline);
const r = S(e.conditions), i = yo(e), {
initialConditionValue: a,
fieldMap: l,
loadFieldConfigs: u
} = i, d = Pr(e, n, t), {
conditionClass: c,
resizeObserver: s
} = d;
u(!0), a(r.value), po(() => {
var b;
(b = s.value) == null || b.unobserve(t.value);
}), Se(() => e.conditions, () => {
r.value = e.conditions, a(r.value);
});
const f = N(() => ({
// row: true,
"f-utils-flex-row-wrap": !0,
"farris-form": !0,
"condition-div": !0,
"farris-form-controls-inline": e.isControlInline
})), m = N(() => "col-12 col-md-6 col-xl-3 col-el-2 ");
function p(b, g, y, w) {
b.value.editorType === "combo-list" && w.newValue ? b.value.valueList = w.newValue.map((v) => ({
name: v.name,
value: v.value
})) : b.value.editorType === "radio-group" && (b.value.valueList = [y.data.find((v) => v.value === g)]), n.emit("valueChange", g, b);
}
function C() {
return r.value.map((b) => {
var v, x, M, h, T;
const g = (v = l.get(b.fieldCode)) == null ? void 0 : v.editor, y = (x = l.get(b.fieldCode)) == null ? void 0 : x.id;
let w = !0;
return ((M = b.value) == null ? void 0 : M.editorType) === "lookup" && g ? (g.idValue = b.value.idValue, g.onClear = () => {
b.value.idValue = "", b.value.mapFields = [], p(b, "");
}, g["onUpdate:dataMapping"] = (F) => {
b.value.mapFields = F.items, p(b, b.value.getValue());
}, w = !1) : ((h = b.value) == null ? void 0 : h.editorType) === "number-range" && g && (g.beginValue = b.value.begin, g.onBeginValueChange = (F) => {
b.value.begin = F, p(b, F);
}, g.endValue = b.value.end, g.onEndValueChange = (F) => {
b.value.end = F, p(b, F);
}, w = !1), _(Zi, {
id: y,
customClass: ((T = g == null ? void 0 : g.appearance) == null ? void 0 : T.class) || m.value,
label: (g == null ? void 0 : g.showLabel) === !1 ? " " : b.fieldName,
editor: g,
required: g == null ? void 0 : g.required,
modelValue: b.value.value,
"onUpdate:modelValue": (F) => b.value.value = F,
onChange: (F, E) => {
w && p(b, F, g, E);
}
}, null);
});
}
return () => mo(_("div", {
class: f.value,
key: o.value,
ref: t
}, [C()]), [[sr("area-response")]]);
}
}), bo = /* @__PURE__ */ new Map([
["appearance", Jt]
]), vl = /* @__PURE__ */ new Map([]);
var wo = /* @__PURE__ */ ((e) => (e.SimpleField = "SimpleField", e.ComplexField = "ComplexField", e))(wo || {}), Jn = /* @__PURE__ */ ((e) => (e.String = "String", e.DateTime = "DateTime", e.Date = "Date", e.Enum = "Enum", e.Boolean = "Boolean", e.Number = "Number", e.Text = "Text", e.BigNumber = "BigNumber", e))(Jn || {});
const yl = "root-viewmodel";
class bl {
constructor(n, t) {
B(this, "formSchemaUtils");
B(this, "controlCreatorUtils");
B(this, "designViewModelUtils");
this.resolver = n, this.designerHostService = t, this.formSchemaUtils = this.designerHostService.formSchemaUtils, this.controlCreatorUtils = this.designerHostService.controlCreatorUtils, this.designViewModelUtils = this.designerHostService.designViewModelUtils;
}
createComponent(n) {
const t = this.createComponentRefNode(n), o = this.createComponentNode(n), r = this.createViewModeNode(n), i = this.formSchemaUtils.getFormSchema();
return i.module.viewmodels.push(r), i.module.components.push(o), this.designViewModelUtils.assembleDesignViewModel(), t;
}
createComponentRefNode(n) {
const t = this.resolver.getSchemaByType("component-ref");
return Object.assign(t, {
id: `${n.componentId}-component-ref`,
component: `${n.componentId}-component`
}), t;
}
createComponentNode(n) {
const t = this.resolver.getSchemaByType("component"), o = this.createFormComponentContents(n);
return Object.assign(t, {
id: `${n.componentId}-component`,
viewModel: `${n.componentId}-component-viewmodel`,
componentType: n.componentType,
appearance: {
class: this.getFormComponentClass()
},
formColumns: n.formColumns,
contents: o
}), t;
}
/**
* 获取卡片组件层级的class样式
*/
getFormComponentClass() {
const { templateId: n } = this.formSchemaUtils.getFormSchema().module;
return n === "double-list-in-tab-template" ? "f-struct-wrapper f-utils-fill-flex-column" : "f-struct-wrapper";
}
createFormComponentContents(n) {
const t = this.resolver.getSchemaByType("section");
Object.assign(t, {
id: n.componentId + "-form-section",
appearance: {
class: "f-section-form f-section-in-mainsubcard"
},
mainTitle: n.componentName
});
const o = this.resolver.getSchemaByType("response-form"), r = [];
Object.assign(o, {
id: n.componentId + "-form",
appearance: {
class: "f-form-layout farris-form farris-form-controls-inline"
},
contents: r
}), t.contents = [o];
const { selectedFields: i } = n;
i == null || i.forEach((l) => {
const u = Ee(l), d = this.resolveControlClassByFormColumns(n), c = this.controlCreatorUtils.setFormFieldProperty(u, "", d);
c && r.push(c);
});
const { templateId: a } = this.formSchemaUtils.getFormSchema().module;
return a === "double-list-in-tab-template" && (t.appearance.class = "f-section-grid f-section-in-main px-0 pt-0", t.fill = !0), [t];
}
resolveControlClassByFormColumns(n) {
let t = "";
switch (n.formColumns) {
case 1: {
t = "col-12";
break;
}
case 2: {
t = "col-12 col-md-6 col-xl-6 col-el-6";
break;
}
case 3: {
t = "col-12 col-md-6 col-xl-4 col-el-4";
break;
}
case 4: {
t = "col-12 col-md-6 col-xl-3 col-el-2";
break;
}
}
return t;
}
/**
* 添加viewModel节点
*/
createViewModeNode(n) {
return {
id: `${n.componentId}-component-viewmodel`,
code: `${n.componentId}-component-viewmodel`,
name: n.componentName,
bindTo: n.bindTo,
parent: yl,
fields: this.assembleViewModelFields(n),
commands: [],
states: [],
enableValidation: !0
};
}
/**
* 组装viewModel fields 节点
*/
assembleViewModelFields(n) {
const t = [], { selectedFields: o } = n;
return o == null || o.forEach((r) => {
let i = "blur";
const a = r.type.name;
(a === Jn.Enum || a === Jn.Boolean) && (i = "change"), t.push({
type: "Form",
id: r.id,
fieldName: r.bindingField,
groupId: null,
groupName: null,
updateOn: i,
fieldSchema: {}
});
}), t;
}
}
function wl(e, n, t, o) {
var i, a, l, u, d, c;
const r = t.parentComponentInstance;
if (r && o) {
const s = (i = r.schema) == null ? void 0 : i.type, m = {
componentId: `form-${Math.random().toString(36).slice(2, 6)}`,
componentName: ((a = t.bindingSourceContext) == null ? void 0 : a.entityTitle) || ((u = (l = t.bindingSourceContext) == null ? void 0 : l.bindingEntity) == null ? void 0 : u.name) || "标题",
componentType: "form",
formColumns: s === "splitter-pane" ? 1 : 4,
parentContainerId: r.schema.id,
bindTo: ((d = t.bindingSourceContext) == null ? void 0 : d.bindTo) || "/",
selectedFields: (c = t.bindingSourceContext) == null ? void 0 : c.bindingEntityFields
};
return new bl(e, o).createComponent(m);
} else
return n;
}
function Cl(e, n, t) {
return n;
}
const xl = "https://json-schema.org/draft/2020-12/schema", Sl = "https://farris-design.gitee.io/response-form.schema.json", Tl = "response-form", Fl = "A Farris Data Collection Component", _l = "object", kl = {
id: {
description: "The unique identifier for a form group",
type: "string"
},
type: {
description: "The type string of form group component",
type: "string",
default: "response-form"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
contents: {
description: "",
type: "array",
default: []
}
}, El = [
"id",
"type",
"contents"
], Ml = {
$schema: xl,
$id: Sl,
title: Tl,
description: Fl,
type: _l,
properties: kl,
required: El
}, Ol = {
customClass: { type: String, default: "" },
customStyle: { type: String, defaut: "" }
};
Ot(Ol, Ml, bo, wl);
const Il = "https://json-schema.org/draft/2020-12/schema", Pl = "https://farris-design.gitee.io/form-group.schema.json", Bl = "form-group", Rl = "A Farris Input Component", Dl = "object", Nl = {
id: {
description: "The unique identifier for a form group",
type: "string"
},
type: {
description: "The type string of form group component",
type: "string",
default: "form-group"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
enableLinkLabel: {
description: "",
type: "boolean",
default: !1
},
editor: {
description: "",
type: "obejct",
default: null
},
label: {
description: "",
type: "string",
default: ""
},
lableWidth: {
description: "",
type: "number"
},
binding: {
description: "",
type: "object",
default: {}
}
}, Vl = [
"id",
"type",
"editor"
], Br = {
$schema: Il,
$id: Pl,
title: Bl,
description: Rl,
type: Dl,
properties: Nl,
required: Vl
}, En = {
id: { type: String, default: "" },
customClass: { type: String, default: "" },
customStyle: { type: String, default: "" },
/** 筛选组件配置器,具体配置项可查看各组件文档 */
editor: { type: Object, default: {} },
label: { type: String, default: "" },
/** 组件值 */
modelValue: { type: [String, Boolean, Array, Number], default: "" },
// readonly: { type: Boolean, default: false },
visible: { type: Boolean, default: !0 },
required: { type: Boolean, default: !1 },
showLabel: { type: Boolean, default: !0 },
type: { type: String, default: "input-group" },
componentId: { type: String, default: "" }
};
Ot(
En,
Br,
bo,
void 0
);
function Co(e, n, t) {
var M;
const o = t && t.getStyles && t.getStyles() || "", r = t && t.getDesignerClass && t.getDesignerClass() || "", i = S();
function a() {
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !1 : t && t.checkCanMoveComponent ? t.checkCanMoveComponent() : !0;
}
function l() {
return !1;
}
function u() {
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !1 : t && t.checkCanDeleteComponent ? t.checkCanDeleteComponent() : !0;
}
function d() {
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !0 : t && t.hideNestedPaddingInDesginerView ? t.hideNestedPaddingInDesginerView() : !1;
}
function c(h) {
if (!h || !h.value)
return null;
if (h.value.schema && h.value.schema.type === "component")
return h.value;
const T = S(h == null ? void 0 : h.value.parent), F = c(T);
return F || null;
}
function s(h = n) {
var k;
if (t != null && t.getDraggableDesignItemElement)
return t.getDraggableDesignItemElement(h);
const { componentInstance: T, designerItemElementRef: F } = h;
if (!T || !T.value)
return null;
const { getCustomButtons: E } = T.value;
return T.value.canMove || E && ((k = E()) != null && k.length) ? F : s(h.parent);
}
function f(h) {
return !!t && t.canAccepts(h);
}
function m() {
return (n == null ? void 0 : n.schema.label) || (n == null ? void 0 : n.schema.title) || (n == null ? void 0 : n.schema.name);
}
function p() {
}
function C(h, T) {
var F;
!h || !T || (t != null && t.onAcceptMovedChildElement && t.onAcceptMovedChildElement(h, T), (F = n == null ? void 0 : n.setupContext) == null || F.emit("dragEnd"));
}
function b(h, T) {
const { componentType: F } = h;
let E = yn(F, h, T);
t && t.onResolveNewComponentSchema && (E = t.onResolveNewComponentSchema(h, E));
const k = F.toLowerCase().replace(/-/g, "_");
return E && !E.id && E.type === F && (E.id = `${k}_${Math.random().toString().slice(2, 6)}`), E;
}
function g(h) {
h && t != null && t.onChildElementMovedOut && t.onChildElementMovedOut(h);
}
function y(...h) {
if (t && t.getPropsConfig)
return t.getPropsConfig(...h);
}
function w() {
t && t.onRemoveComponent && t.onRemoveComponent(), n != null && n.schema.contents && n.schema.contents.map((h) => {
let T = h.id;
h.type === "component-ref" && (T = h.component);
const F = e.value.querySelectorAll(`#${T}-design-item`);
F != null && F.length && Array.from(F).map((E) => {
var k;
(k = E == null ? void 0 : E.componentInstance) != null && k.value.onRemoveComponent && E.componentInstance.value.onRemoveComponent();
});
});
}
function v() {
if (t && t.getCustomButtons)
return t.getCustomButtons();
}
function x(h) {
if (t && t.onPropertyChanged)
return t.onPropertyChanged(h);
}
return i.value = {
canMove: a(),
canSelectParent: l(),
canDelete: u(),
canNested: !d(),
contents: n == null ? void 0 : n.schema.contents,
elementRef: e,
parent: (M = n == null ? void 0 : n.parent) == null ? void 0 : M.componentInstance,
schema: n == null ? void 0 : n.schema,
styles: o,
designerClass: r,
canAccepts: f,
getBelongedComponentInstance: c,
getDraggableDesignItemElement: s,
getDraggingDisplayText: m,
getPropConfig: y,
getDragScopeElement: p,
onAcceptMovedChildElement: C,
onChildElementMovedOut: g,
addNewChildComponentSchema: b,
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || S(!1),
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || S(!1),
onRemoveComponent: w,
getCustomButtons: v,
onPropertyChanged: x
}, i;
}
const Ll = S(0);
function Al() {
Ll.value++;
}
const Wt = S(0);
function $l(e, n) {
const t = n.getBoundingClientRect(), o = e.getBoundingClientRect(), r = o.top >= t.top, i = o.top <= t.bottom;
return r && i;
}
function jl(e) {
const n = e.querySelector(".component-btn-group");
if (!n)
return;
n.style.display = "";
const t = n.getBoundingClientRect();
if (!(t.top === 0 && t.left === 0)) {
const o = n.querySelector("div");
if (o) {
const r = o.getBoundingClientRect();
o.style.top = t.top + "px";
let i = t.left - r.width;
const a = document.querySelector(".editorDiv");
if (a) {
const l = a.getBoundingClientRect();
i < l.left && ({ left: i } = e.getBoundingClientRect());
}
o.style.left = i + "px";
}
}
}
function ql(e) {
if (!window.scrollContainerList)
return;
const n = Array.from(window.scrollContainerList);
if (n.length && n.length === 1) {
const t = n[0], o = document.querySelector(`[id=${t}]`);
if (o && o.contains(e))
return o;
}
}
function Rr(e) {
if (!e)
return;
const n = e.getBoundingClientRect();
if (n.width === 0 && n.height === 0)
return;
const t = e.querySelector(".component-btn-group");
if (t) {
let o = !0;
const r = ql(e);
if (r && (o = $l(e, r)), !o) {
t.style.display = "none";
return;
}
jl(e);
}
}
function Wl(e) {
if (!e)
return;
let n;
e.className.includes("dgComponentSelected") ? n = e : n = e.querySelector(".dgComponentSelected"), n && Rr(n);
}
class Dr {
constructor(n, t) {
B(this, "componentId");
B(this, "viewModelId");
B(this, "eventsEditorUtils");
B(this, "formSchemaUtils");
B(this, "formMetadataConverter");
B(this, "designViewModelUtils");
B(this, "designViewModelField");
B(this, "controlCreatorUtils");
B(this, "designerHostService");
B(this, "schemaService", null);
B(this, "metadataService", null);
B(this, "propertyConfig", {
type: "object",
categories: {}
});
var o;
this.componentId = n, this.designerHostService = t, this.eventsEditorUtils = t.eventsEditorUtils, this.formSchemaUtils = t.formSchemaUtils, this.formMetadataConverter = t.formMetadataConverter, this.viewModelId = ((o = this.formSchemaUtils) == null ? void 0 : o.getViewModelIdByComponentId(n)) || "", this.designViewModelUtils = t.designViewModelUtils, this.controlCreatorUtils = t.controlCreatorUtils, this.metadataService = t.metadataService, this.schemaService = t.schemaService;
}
getTableInfo() {
var n;
return (n = this.schemaService) == null ? void 0 : n.getTableInfoByViewModelId(this.viewModelId);
}
setDesignViewModelField(n) {
var o;
const t = n.binding && n.binding.type === "Form" && n.binding.field;
if (t) {
if (!this.designViewModelField) {
const r = this.designViewModelUtils.getDgViewModel(this.viewModelId);
this.designViewModelField = r.fields.find((i) => i.id === t);
}
n.updateOn = (o = this.designViewModelField) == null ? void 0 : o.updateOn;
}
}
getBasicPropConfig(n) {
return {
description: "Basic Information",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "combo-list",
textField: "name",
valueField: "value",
editable: !1,
data: [{ value: n.type, name: se[n.type].name }]
}
}
}
};
}
getAppearanceConfig(n = null) {
return {
title: "外观",
description: "Appearance",
properties: {
class: {
title: "class样式",
type: "string",
description: "组件的CSS样式",
$converter: "/converter/appearance.converter"
},
style: {
title: "style样式",
type: "string",
description: "组件的样式",
$converter: "/converter/appearance.converter"
}
},
setPropertyRelates(t, o) {
if (t)
switch (t && t.propertyID) {
case "class":
case "style": {
Wt.value++;
break;
}
}
}
};
}
/**
*
* @param propertyId
* @param componentInstance
* @returns
*/
updateElementByParentContainer(n, t) {
const o = t && t.parent && t.parent.schema;
if (!o)
return;
const r = o.contents.findIndex((a) => a.id === n), i = Ee(o.contents[r]);
o.contents.splice(r, 1), o.contents.splice(r, 0, i), Al();
}
}
class Hl {
constructor() {
/** 控件标题 */
B(this, "label", "");
/** 控件id */
B(this, "id", "");
/** 每个控件占用的栅格数 */
B(this, "columnInSM", 12);
B(this, "columnInMD", 6);
B(this, "columnInLG", 3);
B(this, "columnInEL", 2);
/** 每个控件占用的列数 */
B(this, "displayWidthInSM", 1);
B(this, "displayWidthInMD", 1);
B(this, "displayWidthInLG", 1);
B(this, "displayWidthInEL", 1);
/** 编辑器内部默认显示的屏幕大小-----可以去掉 */
B(this, "displayColumnCountAtBreakPoint", "md");
/** 控件所在行,传0即可-----编辑器内部使用 */
B(this, "tagRow", 0);
/** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
B(this, "showTopBorder", 0);
/** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
B(this, "group", 1);
/** 控件是否符合标准的class配置(设计器用的) */
B(this, "isSupportedClass", !0);
/** 控件所在分组id(设计器用的) */
B(this, "fieldSetId", "");
}
}
function Gl(e) {
let n, t;
const o = /* @__PURE__ */ new Map();
let r = [];
function i(c, s) {
const m = c.split(" ").filter((y) => y.startsWith("col-"));
if (m.length === 0) {
s.isSupportedClass = !1;
return;
}
let p = m.find((y) => /^col-([1-9]|10|11|12)$/.test(y)), C = m.find((y) => /^col-md-([1-9]|10|11|12)$/.test(y)), b = m.find((y) => /^col-xl-([1-9]|10|11|12)$/.test(y)), g = m.find((y) => /^col-el-([1-9]|10|11|12)$/.test(y));
p = p || "col-12", s.columnInSM = parseInt(p.replace("col-", ""), 10), s.displayWidthInSM = s.columnInSM / 12, s.displayWidthInSM !== 1 && (s.isSupportedClass = !1), C = C || "col-md-" + s.columnInSM, s.columnInMD = parseInt(C.replace("col-md-", ""), 10), s.displayWidthInMD = s.columnInMD / 6, [1, 2].includes(s.displayWidthInMD) || (s.isSupportedClass = !1), b = b || "col-xl-" + s.columnInMD, s.columnInLG = parseInt(b.replace("col-xl-", ""), 10), s.displayWidthInLG = s.columnInLG / 3, [1, 2, 3, 4].includes(s.displayWidthInLG) || (s.isSupportedClass = !1), g = g || "col-el-" + s.columnInLG, s.columnInEL = parseInt(g.replace("col-el-", ""), 10), s.displayWidthInEL = s.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(s.displayWidthInEL) || (s.isSupportedClass = !1);
}
function a(c, s, f, m = !1) {
let p = !1;
c.contents.forEach((C) => {
if (C.type === "fieldset") {
f += 1, a(C, s, f, !0), p = !0;
return;
}
p && (f += 1, p = !1);
const b = C.appearance && C.appearance.class, g = new Hl();
b ? i(b, g) : g.isSupportedClass = !1, g.label = C.label || C.id, g.id = C.id, g.group = f, m && (g.fieldSetId = c.id), t === C.id && (n = f), o.set(C.id, C), s.push(g);
});
}
function l(c) {
const s = e.getComponentById(c);
if (!s || !s.componentType || !s.componentType.startsWith("form"))
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
const f = e.selectNode(s, (m) => m.type === Xn["response-form"].type);
return !f || !f.contents || f.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: f };
}
function u(c, s) {
s = s || c.id;
const { result: f, message: m, formNode: p } = l(s);
if (!f)
return { result: f, message: m };
t = c.id, r = [], o.clear();
const C = p.contents[0].type === Xn.fieldset.type ? 0 : 1;
a(p, r, C);
const b = r.find((y) => !y.isSupportedClass);
return {
defaultState: {
defaultGroupNumber: n || 1,
model: b ? "customize" : "standard"
},
importData: r
};
}
function d(c, s) {
s = s;
const { result: f, formNode: m } = l(s);
if (!f)
return "";
const p = [];
return c.forEach((C) => {
var y;
const b = o.get(C.id), g = b.appearance && b.appearance.class;
if (g) {
const v = g.split(" ").filter((E) => !E.startsWith("col-")), x = "col-" + C.columnInSM, M = "col-md-" + C.columnInMD, h = "col-xl-" + C.columnInLG, T = "col-el-" + C.columnInEL, F = [x, M, h, T].co