@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,305 lines • 404 kB
JavaScript
var Go = Object.defineProperty;
var zo = (n, t, e) => t in n ? Go(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
var A = (n, t, e) => zo(n, typeof t != "symbol" ? t + "" : t, e);
import { ref as S, computed as j, defineComponent as tt, createVNode as I, watch as Fe, Fragment as Qt, reactive as yt, createApp as qn, onUnmounted as ln, onMounted as Rt, Transition as Gn, mergeProps as Vt, createTextVNode as Bt, onBeforeUnmount as zn, withDirectives as Yo, resolveDirective as Uo, nextTick as un, onBeforeMount as Qo, Teleport as Xo, shallowRef as Ko, render as cn, h as Zo, cloneVNode as Jo, inject as Tt, provide as er, triggerRef as tr, isVNode as nr } from "vue";
import { isPlainObject as In, cloneDeep as Et, isUndefined as ut, throttle as or } from "lodash-es";
import { resolveAppearance as rr, createPropsResolver as ir } from "../dynamic-resolver/index.esm.js";
import { DgControl as On, useDesignerComponent as ar } from "../designer-canvas/index.esm.js";
import { useGuid as sr, resolveField as rt, FormSchemaEntityFieldTypeName as An, useCommonUtils as lr, useDateFormat as ur, useNumberFormat as cr, setFieldValue as mn, getCustomClass as dn, withInstall as Yn, FormSchemaEntityField$Type as Pn, FormSchemaEntityFieldType$Type as dr } from "../common/index.esm.js";
import { useResizeObserver as Un } from "@vueuse/core";
import { useIdentify as fr, useGroupData as pr, useFilter as mr, useHierarchy as hr, useLoading as gr, useDataView as vr, useSelection as yr, useSelectHierarchyItem as br, useDataViewContainerStyle as wr, useCommandColumn as Cr, useColumn as xr, useSort as _r, useGroupColumn as Sr, useRow as Tr, useEdit as Er, useVisualDataBound as Fr, useVisualDataCell as kr, useVisualDataRow as Mr, useVisualData as Ir, useCellPosition as Or, useSidebar as Ar, useVirtualScroll as Pr, useFitColumn as Dr, useFilterHistory as Vr, useColumnFilter as Br, useDragColumn as Nr, getColumnHeader as Rr, getSidebar as Hr, getDisableMask as Wr, getHorizontalScrollbar as Lr, getVerticalScrollbar as jr, getEmpty as $r } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import qr from "../transfer/index.esm.js";
import Gr from "../tabs/index.esm.js";
import zr from "../order/index.esm.js";
import "../condition/index.esm.js";
import { FCheckbox as Yr } from "../checkbox/index.esm.js";
import Ur from "../filter-bar/index.esm.js";
import Dn from "../tooltip/index.esm.js";
import Qr from "../pagination/index.esm.js";
import Xr from "../button/index.esm.js";
import Kr from "../search-box/index.esm.js";
import Zr from "../tags/index.esm.js";
import Jr, { FDynamicFormGroup as ei, FDynamicFormInput as ti } from "../dynamic-form/index.esm.js";
import "../property-panel/index.esm.js";
import ni from "../accordion/index.esm.js";
import oi from "../avatar/index.esm.js";
import ri from "../../designer/button-edit/index.esm.js";
import ii from "../button-group/index.esm.js";
import ai from "../calendar/index.esm.js";
import si from "../capsule/index.esm.js";
import Vn from "../../designer/checkbox/index.esm.js";
import Bn from "../../designer/checkbox-group/index.esm.js";
import hn from "../combo-list/index.esm.js";
import li from "../combo-tree/index.esm.js";
import ui from "../component/index.esm.js";
import ci from "../color-picker/index.esm.js";
import di from "../content-container/index.esm.js";
import fi from "../date-picker/index.esm.js";
import pi from "../../designer/data-grid/index.esm.js";
import mi from "../dropdown/index.esm.js";
import hi from "../events-editor/index.esm.js";
import gi from "../field-selector/index.esm.js";
import vi from "../binding-selector/index.esm.js";
import yi from "../image-cropper/index.esm.js";
import bi from "../../designer/input-group/index.esm.js";
import wi from "../layout/index.esm.js";
import Ci from "../list-nav/index.esm.js";
import xi from "../list-view/index.esm.js";
import _i from "../lookup/index.esm.js";
import Si from "../mapping-editor/index.esm.js";
import Ti from "../nav/index.esm.js";
import Ei from "../number-range/index.esm.js";
import Fi from "../number-spinner/index.esm.js";
import ki from "../page-header/index.esm.js";
import Mi from "../page-footer/index.esm.js";
import Ii from "../progress/index.esm.js";
import Oi from "../query-solution/index.esm.js";
import Ai from "../../designer/radio-group/index.esm.js";
import Pi from "../rate/index.esm.js";
import Di from "../response-toolbar/index.esm.js";
import Vi from "../response-layout/index.esm.js";
import Bi from "../response-layout-editor/index.esm.js";
import Ni from "../section/index.esm.js";
import Ri from "../smoke-detector/index.esm.js";
import Hi from "../splitter/index.esm.js";
import Wi from "../step/index.esm.js";
import Li from "../switch/index.esm.js";
import ji from "../text/index.esm.js";
import $i from "../time-picker/index.esm.js";
import qi from "../tree-view/index.esm.js";
import Gi from "../uploader/index.esm.js";
import zi from "../verify-detail/index.esm.js";
import Yi from "../video/index.esm.js";
import Ui from "../textarea/index.esm.js";
import Qi from "../schema-selector/index.esm.js";
import Xi from "../tree-grid/index.esm.js";
import Ki from "../event-parameter/index.esm.js";
import Zi from "../filter-condition-editor/index.esm.js";
import Ji from "../fieldset/index.esm.js";
import ea from "../sort-condition-editor/index.esm.js";
import ta from "../menu-lookup/index.esm.js";
import na from "../drawer/index.esm.js";
import oa from "../json-editor/index.esm.js";
import ra from "../property-editor/index.esm.js";
import ia from "../expression-editor/index.esm.js";
import aa from "../code-editor/index.esm.js";
import sa from "../html-template/index.esm.js";
import "../external-container/index.esm.js";
import "../notify/index.esm.js";
const Qn = {}, Xn = {};
function wn(n) {
const { properties: t, title: e, ignore: o } = n, r = o && Array.isArray(o), i = Object.keys(t).reduce((a, s) => ((!r || !o.find((l) => l === s)) && (a[s] = t[s].type === "object" && t[s].properties ? wn(t[s]) : Et(t[s].default)), a), {});
if (e && (!r || !o.find((a) => a === "id"))) {
const a = e.toLowerCase().replace(/-/g, "_");
i.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return i;
}
function la(n) {
const { properties: t, title: e, required: o } = n;
if (o && Array.isArray(o)) {
const r = o.reduce((i, a) => (i[a] = t[a].type === "object" && t[a].properties ? wn(t[a]) : Et(t[a].default), i), {});
if (e && o.find((i) => i === "id")) {
const i = e.toLowerCase().replace(/-/g, "_");
r.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return r;
}
return {
type: e
};
}
function Kn(n, t = {}, e) {
const o = Qn[n];
if (o) {
let r = la(o);
const i = Xn[n];
return r = i ? i({ getSchemaByType: Kn }, r, t, e) : r, r;
}
return null;
}
function ua(n, t) {
const e = wn(t);
return Object.keys(e).reduce((o, r) => (Object.prototype.hasOwnProperty.call(n, r) && (o[r] && In(o[r]) && In(n[r] || !n[r]) ? Object.assign(o[r], n[r] || {}) : o[r] = n[r]), o), e), e;
}
function Zn(n, t) {
return Object.keys(n).filter((o) => n[o] != null).reduce((o, r) => {
if (t.has(r)) {
const i = t.get(r);
if (typeof i == "string")
o[i] = n[r];
else {
const a = i(r, n[r], n);
Object.assign(o, a);
}
} else
o[r] = n[r];
return o;
}, {});
}
function ca(n, t, e = /* @__PURE__ */ new Map()) {
const o = ua(n, t);
return Zn(o, e);
}
function da(n = {}) {
function t(c, d, u, p) {
if (typeof u == "number")
return p[c].length === u;
if (typeof u == "object") {
const f = Object.keys(u)[0], m = u[f];
if (f === "not")
return Number(p[c].length) !== Number(m);
if (f === "moreThan")
return Number(p[c].length) >= Number(m);
if (f === "lessThan")
return Number(p[c].length) <= Number(m);
}
return !1;
}
function e(c, d, u, p) {
return p[c] && p[c].propertyValue && String(p[c].propertyValue.value) === String(u);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", e]
]);
Object.keys(n).reduce((c, d) => (c.set(d, n[d]), c), o);
function r(c, d) {
const u = c;
return typeof d == "number" ? [{ target: u, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: u, operator: "getProperty", param: c, value: !!d }] : typeof d == "object" ? Object.keys(d).map((p) => {
if (p === "length")
return { target: u, operator: "length", param: null, value: d[p] };
const f = p, m = d[p];
return { target: u, operator: "getProperty", param: f, value: m };
}) : [];
}
function i(c) {
return Object.keys(c).reduce((u, p) => {
const f = r(p, c[p]);
return u.push(...f), u;
}, []);
}
function a(c, d) {
if (o.has(c.operator)) {
const u = o.get(c.operator);
return u && u(c.target, c.param, c.value, d) || !1;
}
return !1;
}
function s(c, d) {
return i(c).reduce((f, m) => f && a(m, d), !0);
}
function l(c, d) {
const u = Object.keys(c), p = u.includes("allOf"), f = u.includes("anyOf"), m = p || f, g = (m ? c[m ? p ? "allOf" : "anyOf" : "allOf"] : [c]).map((v) => s(v, d));
return p ? !g.includes(!1) : g.includes(!0);
}
return { parseValueSchema: l };
}
const de = {
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: "列表导航" },
"filter-bar": { type: "filter-bar", name: "筛选条" }
}, fa = {}, pa = {};
da();
function Ht(n, t, e = /* @__PURE__ */ new Map(), o = (a, s, l, c) => s, r = {}, i = (a) => a) {
return Qn[t.title] = t, Xn[t.title] = o, fa[t.title] = r, pa[t.title] = i, (a = {}, s = !0) => {
if (!s)
return Zn(a, e);
const l = ca(a, t, e), c = Object.keys(n).reduce((d, u) => (d[u] = n[u].default, d), {});
return Object.assign(c, l);
};
}
function ma(n, t, e) {
return t;
}
const ha = /* @__PURE__ */ new Map([
["appearance", rr]
]), ga = "https://json-schema.org/draft/2020-12/schema", va = "https://farris-design.gitee.io/avatar.schema.json", ya = "avatar", ba = "A Farris Component", wa = "object", Ca = {
id: {
description: "The unique identifier for avatar",
type: "string"
},
type: {
description: "The type string of avatar",
type: "string",
default: "avatar"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
disabled: {
type: "boolean",
default: !1
},
avatarWidth: {
description: "",
type: "number",
default: 100
},
avatarHeight: {
description: "",
type: "number",
default: 100
},
readonly: {
description: "",
type: "boolean",
default: !1
},
cover: {
description: "",
type: "string",
default: ""
},
tabindex: {
description: "",
type: "number",
default: -1
},
visible: {
description: "",
type: "boolean",
default: !0
}
}, xa = [
"id",
"type"
], _a = [
"id",
"appearance",
"binding",
"visible"
], Sa = {
$schema: ga,
$id: va,
title: ya,
description: ba,
type: wa,
properties: Ca,
required: xa,
ignore: _a
}, Cn = {
/**
* 头像宽度
*/
avatarWidth: { type: Number, default: 100 },
/**
* 头像高度
*/
avatarHeight: { type: Number, default: 100 },
/**
* 组件标识
*/
cover: { type: String },
/**
* 只读
*/
readonly: { type: Boolean, default: !1 },
/**
* 头像形状
*/
shape: { type: String, default: "circle" },
/**
* 头像最大尺寸, 单位MB
*/
maxSize: { type: Number, default: 1 },
/**
* 组件值
*/
modelValue: { type: String, default: "" },
/**
* 头像标题
*/
title: { type: String, default: "" },
/**
* 支持的头像类型
*/
imageType: { type: Array, default: ["jpeg"] }
}, Jn = Ht(Cn, Sa, ha, ma);
function eo(n, t, e, o) {
const r = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAZABkAAD/2wBDAAwICQoJBwwKCQoNDAwOER0TERAQESMZGxUdKiUsKyklKCguNEI4LjE/MigoOk46P0RHSktKLTdRV1FIVkJJSkf/2wBDAQwNDREPESITEyJHMCgwR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAEsASwDASIAAhEBAxEB/8QAGgABAQEBAQEBAAAAAAAAAAAAAAECAwQFB//EADMQAQEAAQEECAQGAgMBAAAAAAABAhEDITFBBBRRUmFxgaESkcHwEyIysdHhM3IjQvE0/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAXEQEBAQEAAAAAAAAAAAAAAAAAEQEh/9oADAMBAAIRAxEAPwD9BBYqCiyAGhougIqyGgEhIui6AyuixdATQ0WQA0BdA4houhoCaGgugMrouhoCaJoum80BNDRdDQGTRbEBNCxdDQGTRUBE0asQGRTQGTT71WxNPP5AugqyACyAC6dpIsgGgshoBISKAiroQDQ0OSyAgoBoaABoaABomigJTRQGV0XRATRGizUGRSwGdEsaqAljLQDOiNWJQZNJ4KffEFIRYAsFkAkFkAJFFkAkNCLIAAAC6AguhoCCl3TW2TzugIHx4S788Z6wmWN4ZY3ysoA1pu+qAgpYCAAaIoDIoCaJZvVAQ03LUBlGqWAzYmimn3vAaRYA1IkWASKKACgirIgAsgBoBdJNbZNN9t3aeIHNw2vSccbZhPxLN27dJ68/Rx222u1/LjbNn8vi/ieHPm58N03SKN5bfa58c7jOzHd78XOyXfd98bqoCaScp8jSdk+SgLjlljdccssfK12w6TlN2cmXjN1/iuAD34Z47Sa43XTjLus82nz5bjl8WNss4WPXsNtNpNLuzk3zlZ2wHUsBBF5CAFgAhouiUGRUBErSAyffFamgKqKCqkUBYcgBpADiuhoAKeYA8fStp8WX4WPCfq8b2eT1bXObPZZZ8bJrJ23lHz5rpvutu+3tvOqAAAAAAAACy3HKZY3Sy6yoA+hs85tMJlN2vGdlaeTomem0+C/9pu849SAKlARQERrkgJUWoCUVKDIqb/ugqxFBVRQFFBFABRAUAHn6bl+XDGc7bfT/ANeV26XddvJ2Yz3tcVAAAAAAAAAAFxy+HKZTjLq+l+z5j6Gzuuywt54z9jRoEQAARSoCCoCIqAIJQaCLzBZxCAKC8wIAChOIAADxdL/+i/6z6uTt0yabfXtxnta4qAAAAAAAAAAD37H/AAbP/WPBwfQ2c02WE7MYaNAIIoAhzCggHMEqaNIDNPviHoAsRqcAFSKC8iIoHNUAUAAAHl6ZPzbPLtln1ed7el467DXu2X0+68SgAAAAAAAAABpru7bo+npy7Po8HR8fi2+M46XW+Ue4ABAAAQAQUvAEvBL6BQS8U3feqpv7fcFnBUUBUUBScQFRUBQAAATKTLG43nLL6vnaWWy8ZdL5x9J4ulY/DtrZwymvrzUcgAAAAAAAANdwPT0LH9Wd8MZ+9elnY4fh7HHG8prfOtIAABQAQAKi1AE5KlBD09hPl7gKjUAVFBeYTiAqKgKAAAA5dKw+PY2ya5Y/mn19nVQfMG9th+HtbjOF3zyrCgAAAAAA6dHw+PbSWfln5r6Ob29Gw+DZS2fmy33y5T6g7cbreaAgAAAAgqAcgqfIBOapQSnr7lPS/IEaScAFVFgKIoKioCgAABgADj0nZ/HstZvyx3zxnN4+T6b52ePw7TLGcJbIoyAAAAADex2f4m1mN1+Gb75Tl9H0PbweboeOmGWXO3T0n/r0AAIAAAACKgHJFpyBEpyARFT74gKnNQVeaRQF5IoKTiigCKAAACZWY4/FlZMZxt3SAvnuna+dnlM8885wyts8nXb9I/Elw2e7G7rleN8J4ePNxUAAAAAAeroeUuFx7LrPKvQ+djlcMpljdLHs2W3x2k0/Tl2W8fLtB1C8ewQAAEUBDmt4oBeJeCAIUARFvBN3gByVAFUIChzWcAOSpGdpnjs5rnlMdeHbfKcwb58x5c+l23TZ7P1y3e0+rldvtcuO0snZjJFHvtmM1ysnjbpHHLpOyx3TK5eGM1eKyW63W3tt1UHfPpeV3YYTGduW+/JwyuWd1zyuVnDXhPKcgAAAAAAAAAAB0w2+0w3TKZTsy3+7tj0vG/rxyxvbN8eUB9DDa7PP9OeNvZrpfdu8OD5mkvGNY55Y/pzyx8ruIPePJj0nazj8OU8ZpfZ1w6Ts8rJlrhfHfPmg7FKgAF4AgVARPW/NanoAsZaBVlZUFVF4g57fbfhY7pLld0l/e+EeO23K5ZW5ZXjb97o1tcvj22WXHS/DPKMqAAAAAAAAAAAAAAAAAAAAAAOux212d0ttwvGdnjHr3ceMfPevo2XxbLTu3T0B1TmHJAZVOYF4p98xPviBFScQGlRZxBdS3TG3slvsibS/8WX+t/YHhx/TPGaqk4TyVQAAAAAAAAAAAAAAAAAAAAAAd+iX82c7ZL9/Nwdui/5b/rfoD00vARAQqAhfvcVNfL3A1WMqDSxmVQVNr/iz4/pv7LDOXLDLGcbNPDeDxTh6DtOjZaafFju816tlf+2Puo4Dv1bPvY+51bLvY+5RwHfq2Xex9zquXex9yjgO/Vcu9j7nVc+9j7lHAd+q597H3Oq597H3BwHfqufex9zqufex9yjgO/Vc+9j7nVc+9j7lHAd+q597H3Oq597H3KOA79Vz72PudVz72PuUcB36rl3sfc6rn3sfco4DvejZd7H3OrZd7H3KOA79Wy72PudWz72PuDg7dG/y3/W/Q6tl3sfdvY7K7PO25S6yzSdoOqWlEBmhaBamt+6J6AnmqaqDQy0CxYyoNCKC6m/VAGhPJdQBOSgKi6+QGu41QBRAF1LUABbUABNdAVOYUC0tE13gIWloCcTXeloFQLQTmffMtT74gixOa6gqysrzBVSVQVdWdQGpRNV1BV10SUlBYIvIF1E1Ne0F5iAKIAohaCmqWgBaapqC2ohqC6pqWoC2paa70tAqCACACa+F+RanyAWJ/a8vkAuqT6fVf7AVOz0X+AXVYh2egNSifx9T+wVWefyX+PqCyrqn807PQFEn0+p/YKH9H37gAc/kC6onL0P5BRP6OV8vqC2of2l/gAOSAuqan9J/AKmon9AUtL9PqnP1oCWl5ehfv5gh635nP1qWg//Z", i = S(n.readonly);
function a(f) {
return f.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/) != null;
}
function s(f) {
return f.indexOf("data:image/") > -1;
}
function l(f) {
return f ? "data:image/jpeg;base64," + f : "";
}
const c = j(() => {
var m;
if (!n.imageType || !n.imageType.length)
return "";
const f = (m = n.imageType) == null ? void 0 : m.map((k) => (k === "jpg" && (k = "jpeg"), `image/${k}`));
return !f || !f.length ? "image/*" : f.join(",");
}), d = j(() => {
const f = o.value || n.cover || r;
return a(f) || s(f) ? f : l(f);
}), u = j(() => i.value ? "" : n.title);
function p() {
i.value || e && e.value && e.value.click();
}
return { acceptTypes: c, imageSource: d, imageTitle: u, onClickImage: p };
}
const en = /* @__PURE__ */ tt({
name: "FAvatar",
props: Cn,
emits: ["change", "update:modelValue"],
setup(n, t) {
const e = j(() => ({
"f-avatar": !0,
"f-avatar-readonly": n.readonly,
"f-avatar-circle": n.shape === "circle",
"f-avatar-square": n.shape === "square"
})), o = S(n.modelValue), r = j(() => ({
width: n.avatarWidth + "px",
height: n.avatarHeight + "px"
})), i = !1;
function a() {
return "";
}
function s() {
}
const l = S(null), {
acceptTypes: c,
imageSource: d,
onClickImage: u
} = eo(n, t, l, o);
return () => I("div", {
class: e.value,
style: r.value,
onClick: u
}, [i, I("img", {
title: n.title,
class: "f-avatar-image",
src: d.value,
onError: a
}, null), !n.readonly && I("div", {
class: "f-avatar-icon"
}, [I("span", {
class: "f-icon f-icon-camera"
}, null)]), I("input", {
ref: "file",
name: "file-input",
type: "file",
class: "f-avatar-upload",
accept: c.value,
onChange: s,
style: "display: none;"
}, null)]);
}
}), Ta = S(0);
function Ea() {
Ta.value++;
}
const Nt = S(0);
function Fa(n, t) {
const e = t.getBoundingClientRect(), o = n.getBoundingClientRect(), r = o.top >= e.top, i = o.top <= e.bottom;
return r && i;
}
function ka(n) {
const t = n.querySelector(".component-btn-group");
if (!t)
return;
t.style.display = "";
const e = t.getBoundingClientRect();
if (!(e.top === 0 && e.left === 0)) {
const o = t.querySelector("div");
if (o) {
const r = o.getBoundingClientRect();
o.style.top = e.top + "px";
let i = e.left - r.width;
const a = document.querySelector(".editorDiv");
if (a) {
const s = a.getBoundingClientRect();
i < s.left && ({ left: i } = n.getBoundingClientRect());
}
o.style.left = i + "px";
}
}
}
function Ma(n) {
if (!window.scrollContainerList)
return;
const t = Array.from(window.scrollContainerList);
if (t.length && t.length === 1) {
const e = t[0], o = document.querySelector(`[id=${e}]`);
if (o && o.contains(n))
return o;
}
}
function to(n) {
if (!n)
return;
const t = n.getBoundingClientRect();
if (t.width === 0 && t.height === 0)
return;
const e = n.querySelector(".component-btn-group");
if (e) {
let o = !0;
const r = Ma(n);
if (r && (o = Fa(n, r)), !o) {
e.style.display = "none";
return;
}
ka(n);
}
}
function Ia(n) {
if (!n)
return;
let t;
n.className.includes("dgComponentSelected") ? t = n : t = n.querySelector(".dgComponentSelected"), t && to(t);
}
function Oa(n) {
const { formSchemaUtils: t, formStateMachineUtils: e } = n;
function o(l, c = "") {
return {
path: c + l.code,
field: l.id,
fullPath: l.code
};
}
function r(l, c = "") {
return t.getViewModelById(l).states.map((u) => o(u, c));
}
function i(l) {
const c = t.getRootViewModelId(), d = r(l);
if (l === c)
return d;
const u = r(c, "root-component.");
return [...d, ...u];
}
function a(l) {
return l.binding && l.binding.path || l.id || "";
}
function s() {
return e && e.getRenderStates() || [];
}
return { getVariables: i, getControlName: a, getStateMachines: s };
}
class no {
constructor(t) {
A(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'"
}
]);
A(this, "expressionNames", {
compute: "计算表达式",
dependency: "依赖表达式",
validate: "验证表达式",
dataPicking: "帮助前表达式",
visible: "可见表达式",
readonly: "只读表达式",
required: "必填表达式"
});
A(this, "getExpressionConverter", (t, e) => ({
convertFrom: (o, r, i, a) => {
const s = i.getExpressionRuleValue(t, e || r);
return s && s.value || "";
},
convertTo: (o, r, i, a, s) => {
var l;
if (r === "dataPicking" && (i != null && i.target)) {
const c = `${i.target}_dataPicking`;
((l = i.rules) == null ? void 0 : l.some(
(u) => u.id === c && u.value
)) ? o.dictPickingExpressionId = c : delete o.dictPickingExpressionId;
}
a.updateExpression(i);
}
}));
this.formSchemaService = t;
}
getExpressionRule(t, e) {
const o = this.formSchemaService.getExpressions();
if (!o)
return "";
const r = o.find((a) => a.target === t);
if (!r)
return "";
const i = r.rules.find((a) => a.type === e);
return i || "";
}
// 获取上下文表单变量
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 r = [];
return o.states.forEach((i) => {
r.push({
key: i.code,
name: i.name,
description: i.name,
category: i.category
});
}), r;
}
createTreeNode(t, e, o = "label") {
return {
id: t.id,
name: t.name,
bindingPath: t[o],
parents: e
};
}
buildEntityFieldsTreeData(t = null, e) {
const o = [];
return t == null || t.forEach((r) => {
var s;
const i = this.createTreeNode(r, e);
let a = [];
(s = r.type) != null && s.fields && (a = this.buildEntityFieldsTreeData(r.type.fields, [...e, r.label])), o.push({
data: i,
children: a,
expanded: !0
});
}), o;
}
buildChildEntityTreeData(t = null, e) {
const o = [];
return t == null || t.forEach((r) => {
var l, c;
const i = this.createTreeNode(r, e), a = this.buildEntityFieldsTreeData((l = r.type) == null ? void 0 : l.fields, [...e, r.label]), s = this.buildChildEntityTreeData((c = r.type) == null ? void 0 : c.entities, [...e, r.label]);
s != null && s.length && (a == null || a.push(...s)), o.push({
data: i,
children: a || [],
// 空值回退
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]), r = this.buildChildEntityTreeData(e.type.entities, [e.code]);
return r != null && r.length && (o == null || o.push(...r)), {
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 r = o === "Field" ? t.binding.field : t.id, i = this.getExpressionRule(r, e), a = this.getEntitiesAndVariables(), s = {
message: ["validate", "required", "dataPicking"].includes(e) && i ? i.message : "",
...a
};
return i.messageType != null && (s.messageType = i.messageType), s;
}
buildRule(t, e, o, r) {
const { expression: i, message: a, messageType: s } = e, l = {
id: `${t}_${o}`,
type: o,
value: i
};
return (o === "validate" || o === "dataPicking" || o === "required") && (l.message = a), o === "dataPicking" && (l.messageType = s), o === "validate" && r && (l.elementId = r), l;
}
getExpressionData() {
const { expressions: t } = this.formSchemaService.getFormSchema().module;
return t || [];
}
updateExpression(t, e, o, r) {
const i = e === "Field" ? t.binding.field : t.id, a = this.buildRule(i, o, r, t.type === "form-group" ? t.id : "");
let l = this.getExpressionData().find((d) => d.targetType === e && d.target === i);
const c = (d) => d.value.trim() === "";
if (l) {
const d = l.rules.find((u) => u.id === a.id);
if (d)
c(a) ? l.rules = l.rules.filter((u) => u.id !== a.id) : (Object.assign(d, a), r === "validate" && t.type === "form-group" && (d.elementId = t.id));
else {
if (c(a))
return null;
l.rules = l.rules || [], l.rules.push(a);
}
} else {
if (c(a))
return null;
l = {
target: `${i}`,
rules: [a],
targetType: e
};
}
return l;
}
getExpressionEditorOptions(t, e, o, r) {
return o.reduce((i, a) => {
var l, c;
const s = e === "Field" ? (l = t == null ? void 0 : t.binding) == null ? void 0 : l.field : t.id;
return i[a] = {
hide: e === "Field" ? !!((c = t == null ? void 0 : t.binding) != null && c.field) : !1,
description: "",
title: this.expressionNames[a],
type: "string",
$converter: this.getExpressionConverter(s),
editor: {
type: "expression-editor",
singleExpand: !1,
dialogTitle: `${this.expressionNames[a]}编辑器`,
showMessage: a === "validate" || a === "dataPicking" || a === "required",
showMessageType: a === "dataPicking",
beforeOpen: () => this.onBeforeOpenExpression(t, a, e),
onSubmitModal: (d) => {
const u = this.updateExpression(t, e, d, a);
if (r) {
const p = this.buildRule(s, d, a);
r(p);
}
return u;
}
}
}, i;
}, {});
}
getExpressionInfo(t, e, o) {
const r = e === "Field" ? t.binding.field : t.id, i = this.getExpressionRule(r, o), a = {
value: i && i.value,
targetId: r,
targetType: e,
expressionType: o
};
return i && i.message && (a.message = i.message), a;
}
getExpressionConfig(t, e, o = ["compute", "dependency", "validate"], r) {
return {
description: "表达式",
title: "表达式",
properties: {
...this.getExpressionEditorOptions(t, e, o, r)
}
};
}
getExpressionOptions(t, e, o) {
const r = this.getExpressionInfo(t, e, o);
return {
dialogTitle: `${this.expressionNames[o]}编辑器`,
singleExpand: !1,
showMessage: o === "required",
beforeOpen: () => this.onBeforeOpenExpression(t, o, e),
expressionInfo: r
};
}
}
class oo {
constructor(t, e) {
A(this, "componentId");
A(this, "viewModelId");
A(this, "eventsEditorUtils");
A(this, "formSchemaUtils");
A(this, "formMetadataConverter");
A(this, "designViewModelUtils");
A(this, "designViewModelField");
A(this, "controlCreatorUtils");
A(this, "designerHostService");
A(this, "schemaService", null);
A(this, "metadataService", null);
A(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;
}
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 r = this.designViewModelUtils.getDgViewModel(this.viewModelId);
this.designViewModelField = r.fields.find((i) => i.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: de[t.type].name }]
}
}
}
};
}
getAppearanceConfig(t = null, e = {}, o) {
const r = {
title: "外观",
description: "Appearance"
}, i = {
class: {
title: "class样式",
type: "string",
description: "组件的CSS样式",
$converter: "/converter/appearance.converter"
},
style: {
title: "style样式",
type: "string",
description: "组件的样式",
$converter: "/converter/appearance.converter"
}
};
for (const a in e)
i[a] = Object.assign(i[a] || {}, e[a]);
return {
...r,
properties: { ...i },
setPropertyRelates(a, s) {
if (a) {
switch (a && a.propertyID) {
case "class":
case "style": {
Nt.value++;
break;
}
}
o && o(a, t, s);
}
}
};
}
getPropertyEditorParams(t, e = [], o = "visible", r = {}, i = {}) {
const { getVariables: a, getControlName: s, getStateMachines: l } = Oa(this.designerHostService), c = this.getRealTargetType(t), d = e && e.length > 0 ? e : ["Const", "Variable", "StateMachine", "Expression"], u = {
type: "property-editor",
propertyTypes: d
};
return d.map((p) => {
switch (p) {
case "Const":
Object.assign(u, {
constType: "enum",
constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
}, r);
break;
case "Expression":
u.expressionConfig = this.getExpressionOptions(t, c, o);
break;
case "StateMachine":
u.stateMachines = l();
break;
case "Variable":
Object.assign(u, {
controlName: s(t),
newVariablePrefix: "is",
newVariableType: "Boolean",
variables: a(this.viewModelId),
onBeforeOpenVariables: (f) => {
f.value = a(this.viewModelId);
}
}, i);
break;
}
}), u;
}
getVisibleProperty(t, e = "") {
return {
visible: {
title: "是否可见",
type: "boolean",
description: "运行时组件是否可见",
editor: this.getPropertyEditorParams(t, e === "gridFieldEditor" ? ["Const", "Expression"] : ["Const", "Variable", "StateMachine", "Expression"], "visible")
}
};
}
/**
* 获取行为
* @param propertyData
* @param viewModelId
* @returns
*/
getBehaviorConfig(t, e = "", o = {}, r) {
const i = {
title: "行为",
description: ""
}, a = this.getVisibleProperty(t, e);
for (const l in o)
a[l] = Object.assign(a[l] || {}, o[l]);
const s = this;
return {
...i,
properties: { ...a },
setPropertyRelates(l, c) {
if (l) {
switch (l.propertyID) {
case "disabled":
case "readonly":
case "visible":
s.afterMutilEditorChanged(t, l);
break;
}
r && r(l, c);
}
}
};
}
/**
* 当多值编辑器变更时
* @param propertyData
* @param changeObject
*/
afterMutilEditorChanged(t, e) {
this.addNewVariableToViewModel(e, this.viewModelId), this.updateExpressionValue(e), this.clearExpression(e, t);
}
/**
*
* @param propertyId
* @param componentInstance
* @returns
*/
updateElementByParentContainer(t, e) {
const o = e && e.parent && e.parent.schema;
if (!o)
return;
const r = o.contents.findIndex((a) => a.id === t), i = Et(o.contents[r]);
o.contents.splice(r, 1), o.contents.splice(r, 0, i), Ea();
}
/**
* 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
* @param changeObject
* @param viewModelId
* @returns
*/
addNewVariableToViewModel(t, e) {
const o = t.propertyValue;
if (!(o && typeof o == "object") || !(o.type === "Variable" && o.isNewVariable))
return;
const a = {
id: o.field,
category: "locale",
code: o.fullPath,
name: o.fullPath,
type: o.newVariableType || "String"
};
delete o.newVariableType, delete o.isNewVariable, this.formSchemaUtils.getVariableByCode(a.code) || this.formSchemaUtils.getViewModelById(e).states.push(a);
}
/**
* 更新表达式到expressions节点
* @param changeObject
*/
updateExpressionValue(t) {
const e = t.propertyValue;
if (!((e && e.type) === "Expression" && e.expressionInfo))
return;
const { expressionId: i, expressionInfo: a } = e, { targetId: s, targetType: l, expressionType: c, value: d, message: u } = a, p = this.formSchemaUtils.getModule();
p.expressions ?? (p.expressions = []);
const { expressions: f } = p;
let m = f.find((w) => w.target === s);
m || (m = { target: s, rules: [], targetType: l }, f.push(m));
const k = m.rules.find((w) => w.type === c);
if (k)
k.value = d, k.message = u;
else {
const w = { id: i, type: c, value: d, message: u };
m.rules.push(w);
}
delete e.expressionInfo;
}
/**
* 属性类型切换为非表达式后,清除原表达式
* @param changeObject
* @param propertyData
* @returns
*/
clearExpression(t, e) {
const o = t.propertyValue;
if (o && o.type === "Expression")
return;
const i = t.propertyID, a = this.formSchemaUtils.getExpressions(), s = e.binding ? e.binding.field : e.id, l = a.find((c) => c.target === s);
!l || !l.rules || (l.rules = l.rules.filter((c) => c.type !== i));
}
getExpressionOptions(t, e, o) {
return new no(this.formSchemaUtils).getExpressionOptions(t, e, o);
}
getRealTargetType(t) {
return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item"].indexOf(t.type) > -1 ? "Button" : t.binding && t.binding.field ? "Field" : "Container";
}
}
const Lt = class Lt {
/**
* 根据绑定字段类型获取可用的输入类控件
*/
static getEditorTypesByMDataType(t, e = "") {
let o = Lt.fieldControlTypeMapping[t];
if (e === "data-grid-column" && (o != null && o.length)) {
const r = [de["check-group"].type, de["radio-group"].type];
o = o.filter((i) => !r.includes(i.key));
}
return o;
}
/**
* 获取所有输入类控件
*/
static getAllInputTypes() {
const t = [];
for (const e in Lt.fieldControlTypeMapping)
Lt.fieldControlTypeMapping[e].forEach((o) => {
t.find((r) => r.key === o.key && r.value === o.value) || t.push({ key: o.key, value: o.value });
});
return t;
}
/**
* 提供schema字段基础属性和DOM控件属性的映射
* @param control 控件元数据
*/
static mappingDomPropAndSchemaProp(t, e) {
var i;
const o = (i = t.editor) == null ? void 0 : i.type, r = [];
return (t.type === de["data-grid-column"].type || t.type === de["tree-grid-column"].type) && e && e.categoryId && e.categoryId.indexOf("gridFieldEditor") < 0 && r.push({ domField: "title", schemaField: "name" }), r.push({ domField: "label", schemaField: "name" }), r.push({ domField: "editor.required", schemaField: "require" }), r.push({ domField: "editor.readonly", schemaField: "readonly" }), (o === de["input-group"].type || o === de.textarea.type || o === de["number-spinner"].type) && r.push({ domField: "editor.maxLength", schemaField: "type.length" }), o === de["number-spinner"].type && r.push({ domField: "editor.precision", schemaField: "type.precision" }), (t.type === de["data-grid-column"].type || t.type === de["tree-grid-column"].type) && r.push({ domField: "formatter.precision", schemaField: "type.precision" }), (o === de["combo-list"].type || o === de["radio-group"].type) && r.push({ domField: "editor.data", schemaField: "type.enumValues" }), (t.type === de["data-grid-column"].type || t.type === de["tree-grid-column"].type) && r.push({ domField: "formatter.data", schemaField: "type.enumValues" }), o === de["date-picker"].type && (r.push({ domField: "editor.displayFormat", schemaField: "editor.format" }), r.push({ domField: "editor.fieldType", schemaField: "type.name" })), o === de["number-spinner"].type && (r.push({ domField: "editor.max", schemaField: "editor.maxValue" }), r.push({ domField: "editor.min", schemaField: "editor.minValue" })), o === de.lookup.type && (r.push({ domField: "editor.dataSource", schemaField: "editor.dataSource" }), r.push({ domField: "editor.valueField", schemaField: "editor.valueField" }), r.push({ domField: "editor.textField", schemaField: "editor.textField" }), r.push({ domField: "editor.displayType", schemaField: "editor.displayType" }), r.push({ domField: "editor.mapFields", schemaField: "editor.mapFields" }), r.push({ domField: "editor.helpId", schemaField: "editor.helpId" })), r.push({ domField: "path", schemaField: "bindingPath" }), r.push({ domField: "binding.path", schemaField: "bindingField" }), r.push({ domField: "binding.fullPath", schemaField: "path" }), (t.type === de["data-grid-column"].type || t.type === de["tree-grid-column"].type) && r.push({ domField: "field", schemaField: "bindingPath" }), r;
}
};
/**
* <字段类型,可配置的控件类型列表>的映射
*/
A(Lt, "fieldControlTypeMapping", {
String: [
{ key: de["input-group"].type, value: de["input-group"].name },
{ key: de.lookup.type, value: de.lookup.name },
{ key: de["date-picker"].type, value: de["date-picker"].name },
{ key: de["check-group"].type, value: de["check-group"].name },
{ key: de["radio-group"].type, value: de["radio-group"].name },
{ key: de["combo-list"].type, value: de["combo-list"].name },
{ key: de.textarea.type, value: de.textarea.name },
{ key: de["time-picker"].type, value: de["time-picker"].name }
],
Text: [
{ key: de.textarea.type, value: de.textarea.name },
{ key: de.lookup.type, value: de.lookup.name }
],
Decimal: [
{ key: de["number-spinner"].type, value: de["number-spinner"].name }
],
Integer: [
{ key: de["number-spinner"].type, value: de["number-spinner"].name }
],
Number: [
{ key: de["number-spinner"].type, value: de["number-spinner"].name }
],
BigNumber: [
{ key: de["number-spinner"].type, value: de["number-spinner"].name }
],
Date: [
{ key: de["date-picker"].type, value: de["date-picker"].name }
],
DateTime: [
{ key: de["date-picker"].type, value: de["date-picker"].name }
],
Boolean: [
{ key: de.switch.type, value: de.switch.name },
{ key: de["check-box"].type, value: de["check-box"].name }
],
Enum: [
{ key: de["combo-list"].type, value: de["combo-list"].name },
{ key: de["radio-group"].type, value: de["radio-group"].name }
],
Object: [
{ key: de.lookup.type, value: de.lookup.name },
{ key: de["combo-list"].type, value: de["combo-list"].name },
{ key: de["radio-group"].type, value: de["radio-group"].name }
]
});
let tn = Lt;
var Kt = /* @__PURE__ */ ((n) => (n.Form = "Form", n.Variable = "Variable", n))(Kt || {});
class Aa {
constructor() {
/** 控件标题 */
A(this, "label", "");
/** 控件id */
A(this, "id", "");
/** 每个控件占用的栅格数 */
A(this, "columnInSM", 12);
A(this, "columnInMD", 6);
A(this, "columnInLG", 3);
A(this, "columnInEL", 2);
/** 每个控件占用的列数 */
A(this, "displayWidthInSM", 1);
A(this, "displayWidthInMD", 1);
A(this, "displayWidthInLG", 1);
A(this, "displayWidthInEL", 1);
/** 编辑器内部默认显示的屏幕大小-----可以去掉 */
A(this, "displayColumnCountAtBreakPoint", "md");
/** 控件所在行,传0即可-----编辑器内部使用 */
A(this, "tagRow", 0);
/** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
A(this, "showTopBorder", 0);
/** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
A(this, "group", 1);
/** 控件是否符合标准的class配置(设计器用的) */
A(this, "isSupportedClass", !0);
/** 控件所在分组id(设计器用的) */
A(this, "fieldSetId", "");
}
}
function Pa(n) {
let t, e;
const o = /* @__PURE__ */ new Map();
let r = [];
function i(d, u) {
const f = d.split(" ").filter((b) => b.startsWith("col-"));
if (f.length === 0) {
u.isSupportedClass = !1;
return;
}
let m = f.find((b) => /^col-([1-9]|10|11|12)$/.test(b)), k = f.find((b) => /^col-md-([1-9]|10|11|12)$/.test(b)), w = f.find((b) => /^col-xl-([1-9]|10|11|12)$/.test(b)), g = f.find((b) => /^col-el-([1-9]|10|11|12)$/.test(b));
m = m || "col-12", u.columnInSM = parseInt(m.replace("col-", ""), 10), u.displayWidthInSM = u.columnInSM / 12, u.displayWidthInSM !== 1 && (u.isSupportedClass = !1), k = k || "col-md-" + u.columnInSM, u.columnInMD = parseInt(k.replace("col-md-", ""), 10), u.displayWidthInMD = u.columnInMD / 6, [1, 2].includes(u.displayWidthInMD) || (u.isSupportedClass = !1), w = w || "col-xl-" + u.columnInMD, u.columnInLG = parseInt(w.replace("col-xl-", ""), 10), u.displayWidthInLG = u.columnInLG / 3, [1, 2, 3, 4].includes(u.displayWidthInLG) || (u.isSupportedClass = !1), g = g || "col-el-" + u.columnInLG, u.columnInEL = parseInt(g.replace("col-el-", ""), 10), u.displayWidthInEL = u.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(u.displayWidthInEL) || (u.isSupportedClass = !1);
}
function a(d, u, p, f = !1) {
let m = !1;
d.contents.forEach((k) => {
if (k.type === "fieldset") {
p += 1, a(k, u, p, !0), m = !0;
return;
}
m && (p += 1, m = !1);
const w = k.appearance && k.appearance.class, g = new Aa();
w ? i(w, g) : g.isSupportedClass = !1, g.label = k.label || k.id, g.id = k.id, g.group = p, f && (g.fieldSetId = d.id), e === k.id && (t = p), o.set(k.id, k), u.push(g);
});
}
function s(d) {
const u = n.getComponentById(d);
if (!u || !u.componentType || !u.componentType.startsWith("form"))
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
const p = n.selectNode(u, (f) => f.type === On["response-form"].type);
return !p || !p.contents || p.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: p };
}
function l(d, u) {
u = u || d.id;
const { result: p, message: f, formNode: m } = s(u);
if (!p)
return { result: p, message: f };
e = d.id, r = [], o.clear();
const k = m.contents[0].type === On.fieldset.type ? 0 : 1;
a(m, r, k);
const w = r.find((b) => !b.isSupportedClass);
return {
defaultState: {
defaultGroupNumber: t || 1,
model: w ? "customize" : "standard"
},
importData: r
};
}
function c(d, u) {
u = u;
const { result: p, formNode: f } = s(u);
if (!p)
return "";
const m = [];
return d.forEach((k) => {
var b;
const w = o.get(k.id), g = w.appearance && w.appearance.class;
if (g) {
const x = g.split(" ").filter((F) => !F.startsWith("col-")), T = "col-" + k.columnInSM, E = "col-md-" + k.columnInMD, h = "col-xl-" + k.columnInLG, _ = "col-el-" + k.columnInEL, C = [T, E, h, _].concat(x);
w.appearance.class = C.join(" ");
}
if (k.fieldSetId) {
const v = f.contents.find((T) => T.id === k.fieldSetId), x = m.find((T) => T.id === k.fieldSetId);
x ? (b = x.contents) == null || b.push(w) : (m.push(v), v.contents = [w]);
} else
m.push(w);
}), f.contents = m, f.id;
}
return {
checkCanFindFormNode: s,
checkCanOpenLayoutEditor: l,
changeFormControlsByResponseLayoutConfig: c,
getResonseFormLayoutConfig: a
};
}
var xt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Xt(n) {
throw new Error('Could not dynamically require "' + n + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var Da = { exports: {} };
(function(n, t) {
(function(e) {
n.exports = e();
})(function() {
return (/* @__PURE__ */ function() {
function e(o, r, i) {
function a(c, d) {
if (!r[c]) {
if (!o[c]) {
var u = typeof Xt == "function" && Xt;
if (!d && u) return u(c, !0);
if (s) return s(c, !0);
var p = new Error("Cannot find module '" + c + "'");
throw p.code = "MODULE_NOT_FOUND", p;
}
var f = r[c] = { exports: {} };
o[c][0].call(f.exports, function(m) {
var k = o[c][1][m];
return a(k || m);
}, f, f.exports, e, o, r, i);
}
return r[c].exports;
}
for (var s = typeof Xt == "function" && Xt, l = 0; l < i.length; l++) a(i[l]);
return a;
}
return e;
}())({
1: [function(e, o, r) {
var i = {}, a = "(?:^|\\s)", s = "(?:\\s|$)";
function l(u) {
var p = i[u];
return p ? p.lastIndex = 0 : i[u] = p = new RegExp(a + u + s, "g"), p;
}
function c(u, p) {
var f = u.className;
f.length ? l(p).test(f) || (u.className += " " + p) : u.className = p;
}
function d(u, p) {
u.className = u.className.replace(l(p), " ").trim();
}
o.exports = {
add: c,
rm: d
};
}, {}],
2: [function(e, o, r) {
(function(i) {
var a = e("contra/emitter"), s = e("crossvent"), l = e("./classes"), c = document, d = c.documentElement;
function u(y, P) {
var D = arguments.length;
D === 1 && Array.isArray(y) === !1 && (P = y, y = []);
var M, O, G, L, N, W, X, B, V, Q = null, $, H, z = !1, K = 0, ie, J = P || {};
J.moves === void 0 && (J.moves = b), J.accepts === void 0 && (J.accepts = b), J.invalid === void 0 && (J.invalid = ht), J.containers === void 0 && (J.containers = y || []), J.isContainer === void 0 && (J.isContainer = g), J.copy === void 0 && (J.copy = !1), J.copySortSource === void 0 && (J.copySortSource = !1), J.revertOnSpill === void 0 && (J.revertOnSpill = !1), J.removeOnSpill === void 0 && (J.removeOnSpill = !1), J.direction === void 0 && (J.direction = "vertical"), J.ignoreInputTextSelection === void 0 && (J.ignoreInputTex