@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,391 lines • 345 kB
JavaScript
var oo = Object.defineProperty;
var ro = (t, e, n) => e in t ? oo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
var G = (t, e, n) => ro(t, typeof e != "symbol" ? e + "" : e, n);
import { ref as b, computed as P, createVNode as F, defineComponent as Ve, watch as we, onMounted as et, Fragment as _t, reactive as ut, createApp as un, onUnmounted as Et, Transition as cn, mergeProps as yt, createTextVNode as mt, onBeforeUnmount as Yt, withDirectives as io, resolveDirective as ao, onBeforeMount as lo, Teleport as so, shallowRef as uo, nextTick as St, render as Lt, h as co, cloneVNode as fo, inject as Ne, provide as dn, triggerRef as po, isVNode as mo, withModifiers as vo } from "vue";
import { isPlainObject as tn, cloneDeep as ht, isUndefined as nn } from "lodash-es";
import fn from "../response-toolbar/index.esm.js";
import "bignumber.js";
import { useDateFormat as ho, useNumberFormat as go, resolveField as Xe, setFieldValue as Wt, getCustomClass as Ct, withInstall as pn } from "../common/index.esm.js";
import { useResizeObserver as mn } from "@vueuse/core";
import { useIdentify as yo, useGroupData as bo, useFilter as Co, useHierarchy as wo, useLoading as _o, useDataView as So, useSelection as To, useSelectHierarchyItem as xo, useDataViewContainerStyle as Fo, useCommandColumn as ko, useColumn as Io, useSort as Eo, useGroupColumn as Mo, useRow as Oo, useEdit as Do, useVisualDataBound as Bo, useVisualDataCell as Ro, useVisualDataRow as Vo, useVisualData as Po, useCellPosition as No, useSidebar as $o, useVirtualScroll as jo, useFitColumn as Ao, useFilterHistory as Lo, useColumnFilter as Ho, useDragColumn as Wo, getColumnHeader as zo, getSidebar as Go, getDisableMask as qo, getHorizontalScrollbar as Uo, getVerticalScrollbar as Yo, getEmpty as Xo } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import Ko from "../transfer/index.esm.js";
import Qo from "../tabs/index.esm.js";
import Jo from "../order/index.esm.js";
import "../condition/index.esm.js";
import Zo, { FCheckbox as er } from "../checkbox/index.esm.js";
import tr from "../filter-bar/index.esm.js";
import on from "../tooltip/index.esm.js";
import nr from "../pagination/index.esm.js";
import or from "../button/index.esm.js";
import rr from "../search-box/index.esm.js";
import ir from "../tags/index.esm.js";
import ar, { FDynamicFormGroup as lr, FDynamicFormInput as sr } from "../dynamic-form/index.esm.js";
import { useDesignerInnerComponent as ur, useDesignerComponent as cr } from "../designer-canvas/index.esm.js";
import dr from "../binding-selector/index.esm.js";
import "../notify/index.esm.js";
import fr from "../accordion/index.esm.js";
import pr from "../avatar/index.esm.js";
import mr from "../button-edit/index.esm.js";
import vr from "../button-group/index.esm.js";
import hr from "../calendar/index.esm.js";
import gr from "../capsule/index.esm.js";
import yr from "../color-picker/index.esm.js";
import zt from "../combo-list/index.esm.js";
import br from "../content-container/index.esm.js";
import Cr from "../data-grid/index.esm.js";
import wr from "../date-picker/index.esm.js";
import _r from "../dropdown/index.esm.js";
import "../external-container/index.esm.js";
import Sr from "../events-editor/index.esm.js";
import Tr from "../image-cropper/index.esm.js";
import xr from "../input-group/index.esm.js";
import Fr from "../layout/index.esm.js";
import kr from "../list-nav/index.esm.js";
import Ir from "../list-view/index.esm.js";
import Er from "../lookup/index.esm.js";
import Mr from "../nav/index.esm.js";
import Or from "../number-spinner/index.esm.js";
import Dr from "../number-range/index.esm.js";
import Br from "../page-header/index.esm.js";
import Rr from "../page-footer/index.esm.js";
import Vr from "../progress/index.esm.js";
import Pr from "../query-solution/index.esm.js";
import Nr from "../radio-group/index.esm.js";
import $r from "../rate/index.esm.js";
import jr from "../response-layout/index.esm.js";
import Ar from "../response-layout-editor/index.esm.js";
import Lr from "../section/index.esm.js";
import Hr from "../smoke-detector/index.esm.js";
import Wr from "../splitter/index.esm.js";
import zr from "../step/index.esm.js";
import Gr from "../switch/index.esm.js";
import qr from "../text/index.esm.js";
import Ur from "../time-picker/index.esm.js";
import Yr from "../tree-view/index.esm.js";
import Xr from "../uploader/index.esm.js";
import Kr from "../verify-detail/index.esm.js";
import Qr from "../component/index.esm.js";
import Jr from "../video/index.esm.js";
import Zr from "../textarea/index.esm.js";
import ei from "../tree-grid/index.esm.js";
import ti from "../fieldset/index.esm.js";
import ni from "../drawer/index.esm.js";
import oi from "../combo-tree/index.esm.js";
import ri from "../field-selector/index.esm.js";
import ii from "../mapping-editor/index.esm.js";
import ai from "../schema-selector/index.esm.js";
import li from "../event-parameter/index.esm.js";
import si from "../filter-condition-editor/index.esm.js";
import ui from "../sort-condition-editor/index.esm.js";
import ci from "../menu-lookup/index.esm.js";
import { createPropsResolver as di } from "../dynamic-resolver/index.esm.js";
const vn = {}, hn = {};
function Xt(t) {
const { properties: e, title: n, ignore: o } = t, r = o && Array.isArray(o), a = Object.keys(e).reduce((i, d) => ((!r || !o.find((l) => l === d)) && (i[d] = e[d].type === "object" && e[d].properties ? Xt(e[d]) : ht(e[d].default)), i), {});
if (n && (!r || !o.find((i) => i === "id"))) {
const i = n.toLowerCase().replace(/-/g, "_");
a.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return a;
}
function fi(t) {
const { properties: e, title: n, required: o } = t;
if (o && Array.isArray(o)) {
const r = o.reduce((a, i) => (a[i] = e[i].type === "object" && e[i].properties ? Xt(e[i]) : ht(e[i].default), a), {});
if (n && o.find((a) => a === "id")) {
const a = n.toLowerCase().replace(/-/g, "_");
r.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return r;
}
return {
type: n
};
}
function Tt(t, e = {}, n) {
const o = vn[t];
if (o) {
let r = fi(o);
const a = hn[t];
return r = a ? a({ getSchemaByType: Tt }, r, e, n) : r, r;
}
return null;
}
function pi(t, e) {
const n = Xt(e);
return Object.keys(n).reduce((o, r) => (Object.prototype.hasOwnProperty.call(t, r) && (o[r] && tn(o[r]) && tn(t[r] || !t[r]) ? Object.assign(o[r], t[r] || {}) : o[r] = t[r]), o), n), n;
}
function gn(t, e) {
return Object.keys(t).filter((o) => t[o] != null).reduce((o, r) => {
if (e.has(r)) {
const a = e.get(r);
if (typeof a == "string")
o[a] = t[r];
else {
const i = a(r, t[r], t);
Object.assign(o, i);
}
} else
o[r] = t[r];
return o;
}, {});
}
function mi(t, e, n = /* @__PURE__ */ new Map()) {
const o = pi(t, e);
return gn(o, n);
}
function vi(t = {}) {
function e(f, c, s, p) {
if (typeof s == "number")
return p[f].length === s;
if (typeof s == "object") {
const m = Object.keys(s)[0], y = s[m];
if (m === "not")
return Number(p[f].length) !== Number(y);
if (m === "moreThan")
return Number(p[f].length) >= Number(y);
if (m === "lessThan")
return Number(p[f].length) <= Number(y);
}
return !1;
}
function n(f, c, s, p) {
return p[f] && p[f].propertyValue && String(p[f].propertyValue.value) === String(s);
}
const o = /* @__PURE__ */ new Map([
["length", e],
["getProperty", n]
]);
Object.keys(t).reduce((f, c) => (f.set(c, t[c]), f), o);
function r(f, c) {
const s = f;
return typeof c == "number" ? [{ target: s, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: s, operator: "getProperty", param: f, value: !!c }] : typeof c == "object" ? Object.keys(c).map((p) => {
if (p === "length")
return { target: s, operator: "length", param: null, value: c[p] };
const m = p, y = c[p];
return { target: s, operator: "getProperty", param: m, value: y };
}) : [];
}
function a(f) {
return Object.keys(f).reduce((s, p) => {
const m = r(p, f[p]);
return s.push(...m), s;
}, []);
}
function i(f, c) {
if (o.has(f.operator)) {
const s = o.get(f.operator);
return s && s(f.target, f.param, f.value, c) || !1;
}
return !1;
}
function d(f, c) {
return a(f).reduce((m, y) => m && i(y, c), !0);
}
function l(f, c) {
const s = Object.keys(f), p = s.includes("allOf"), m = s.includes("anyOf"), y = p || m, v = (y ? f[y ? p ? "allOf" : "anyOf" : "allOf"] : [f]).map((T) => d(T, c));
return p ? !v.includes(!1) : v.includes(!0);
}
return { parseValueSchema: l };
}
const re = {
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: "抽屉" }
}, hi = {}, gi = {};
vi();
function tt(t, e, n = /* @__PURE__ */ new Map(), o = (i, d, l, f) => d, r = {}, a = (i) => i) {
return vn[e.title] = e, hn[e.title] = o, hi[e.title] = r, gi[e.title] = a, (i = {}, d = !0) => {
if (!d)
return gn(i, n);
const l = mi(i, e, n), f = Object.keys(t).reduce((c, s) => (c[s] = t[s].default, c), {});
return Object.assign(f, l);
};
}
function xt(t, e) {
return { customClass: e.class, customStyle: e.style };
}
function yi() {
function t(e, n) {
const { dataSource: o } = e || {};
return o === void 0 ? {} : {};
}
return {
resolve: t
};
}
function bi() {
function t(e, n) {
return e.selectItemById(n);
}
return {
selectItemById: t
};
}
function Ci() {
function t(e, n) {
var d;
const o = (d = e.toolbar) == null ? void 0 : d.buttons;
if (!o || o.length < 1)
return null;
const [r, a] = n.payloads, i = o.find((l) => l.id === a);
return i ? i.onClick || i.click : null;
}
return {
resolve: t
};
}
function wi() {
function t(e, n) {
const { columns: o } = n;
return e.updateColumns(o);
}
return {
updateColumns: t
};
}
function _i(t, e, n) {
return e ? { enableAccordion: n.accordionMode } : { enableAccordion: "" };
}
function Si(t, e) {
return {
buttons: e.buttons,
buttonPosition: e.position
};
}
const Ti = /* @__PURE__ */ new Map([
["appearance", xt],
["expanded", "expandStatus"],
["enableAccordion", _i],
["toolbar", Si]
]);
function xi(t, e, n) {
const o = Math.random().toString().slice(2, 6), r = n.parentComponentInstance;
Object.assign(e, {
id: `section-${o}`,
appearance: {
class: "f-section-in-mainsubcard"
},
mainTitle: n.mainTitle || e.mainTitle || "标题"
});
const a = t.getSchemaByType("content-container");
Object.assign(a, {
id: `container-${o}`,
appearance: {
class: "f-struct-wrapper"
},
contents: [e]
});
const i = r.schema;
switch (i && i.type) {
case re["splitter-pane"].type: {
e.appearance.class = "f-section-in-main";
break;
}
}
const d = r.elementRef, l = window.getComputedStyle(d);
return l && l.display === "flex" && (a.appearance.class += " d-block"), a;
}
function Fi(t, e, n) {
return n.parentComponentInstance ? xi(t, e, n) : e;
}
const ki = "https://json-schema.org/draft/2020-12/schema", Ii = "https://farris-design.gitee.io/section.schema.json", Ei = "section", Mi = "A Farris Container Component", Oi = "object", Di = {
id: {
description: "The unique identifier for a Section",
type: "string"
},
type: {
description: "The type string of Section component",
type: "string",
default: "section"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
contentClass: {
description: "",
type: "string",
default: ""
},
contents: {
description: "",
type: "array",
default: []
},
enableAccordion: {
description: "",
type: "string",
default: ""
},
accordionMode: {
description: "",
type: "string",
default: "default"
},
enableMaximize: {
description: "",
type: "boolean",
default: !1
},
expanded: {
description: "",
type: "boolean",
default: !0
},
fill: {
description: "",
type: "boolean",
default: !1
},
headerClass: {
description: "",
type: "string",
default: ""
},
size: {
description: "",
type: "object",
properties: {
width: {
type: "number"
},
height: {
type: "number"
}
},
default: null
},
showHeader: {
description: "",
type: "string",
default: !0
},
mainTitle: {
description: "",
type: "string",
default: ""
},
subTitle: {
description: "",
type: "string",
default: ""
},
headerContentClass: {
description: "",
type: "string",
default: ""
},
extendClass: {
description: "",
type: "string",
default: ""
},
visible: {
description: "",
type: "boolean",
default: !0
},
toolbar: {
description: "",
type: "object",
properties: {
type: {
type: "string",
default: "section-toolbar"
},
position: {
type: "string",
default: "inHead"
},
buttons: {
type: "array",
default: []
}
},
default: null
}
}, Bi = [
"id",
"type",
"contents"
], Ri = {
$schema: ki,
$id: Ii,
title: Ei,
description: Mi,
type: Oi,
properties: Di,
required: Bi
}, Kt = {
/** 设置内容区域样式 */
contentClass: { type: String, default: "" },
/** 自定义样式 */
customClass: { type: String, default: "" },
customStyle: { type: String, default: "" },
/** 设置是否启用収折功能。支持:空字符串,不启用収折 | default 默认収折方式 || custom自定义収折方式 */
enableAccordion: { type: String, default: "" },
/** 设置初始是否处于展开状态,支持:true 内容区域被展开|false 内容区域被収折 */
expandStatus: { type: Boolean, default: !0 },
/** 设置Section的主标题 */
mainTitle: { type: String, default: "" },
/** 设置是否显示头部区域 */
showHeader: { type: Boolean, default: !0 },
/** 设置Section的副标题 */
subTitle: { type: String, default: "" },
/** 展开文本 */
expandLabel: { type: String, default: "展开" },
/** 收起文本 */
collapseLabel: { type: String, default: "收起" },
/** 头部区域的自定义样式。配置头部自定义模板后,此属性有效。 */
headerClass: { type: String, default: "" },
/** 设置是否启用最大化 */
enableMaximize: { type: Boolean, default: !1 },
/** 头部扩展区域的自定义样式。配置头部扩展区域模板后,此属性有效。 */
headerContentClass: { type: String, default: "" },
/** 扩展区域的自定义样式。配置扩展区域模板后,此属性有效。 */
extendClass: { type: String, default: "" },
/** 按钮组 */
buttons: { type: Array, default: [] },
/** 按钮组的位置,inHead:头部区域| inContent:内容区域 */
buttonPosition: { type: String, default: "inHead" },
/** 设置是否铺满剩余空间,支持:false按照内容自动高度|true 铺满剩余空间 */
fill: { type: Boolean, default: !1 }
// 暂未使用该属性
// clickThrottleTime: { type: Number, default: 350 },
// context: { type: Object },
// 暂未使用该属性
// index: { type: Number },
// maxStatus: { type: Boolean, default: false },
// showToolbarMoreButton: { type: Boolean, default: true },
// 暂未使用该属性
// toolbarPosition: { type: String, default: '' },
// toolbarButtons: { type: Array<object>, default: [] },
// toolbar: { type: Object as PropType<ToolbarConfig>, default: {} }
}, yn = tt(Kt, Ri, Ti, Fi), Vi = Ci(), Pi = Object.assign({}, Kt, { componentId: { type: String, default: "" } });
function bn(t, e, n) {
let o;
function r(l = 1) {
const f = [
"body>.f-datagrid-settings-simple-host",
"body>div",
"body>farris-dialog>.farris-modal.show",
"body>.farris-modal.show",
"body>farris-filter-panel>.f-filter-panel-wrapper",
"body .f-sidebar-show>.f-sidebar-main",
"body>.popover.show",
"body>filter-row-panel>.f-datagrid-filter-panel",
"body>.f-section-maximize"
], c = Array.from(document.body.querySelectorAll(f.join(","))).filter((p) => p).map((p) => {
const { display: m, zIndex: y } = window.getComputedStyle(p);
return m === "none" ? 0 : parseInt(y, 10);
}).filter((p) => p);
let s = Math.max(...c);
return s < 1040 && (s = 1040), s + l;
}
function a() {
o = t.value.nextElementSibling;
const l = document && document.querySelector("body");
l && (l.appendChild(t.value), t.value.style.zIndex = r());
}
function i() {
o ? e.value.insertBefore(
t.value,
o
) : e.value.appendChild(t.value), t.value.style.zIndex = null;
}
function d() {
!t || !e.value || (n.value = !n.value, n.value ? a() : i());
}
return { onClickMaxMinIcon: d };
}
function Cn(t, e) {
const n = b(t.buttons), o = P(() => t.buttonPosition === "inHead" ? "right" : "left"), r = P(() => "f-section-toolbar" + (t.buttonPosition === "inHead" ? " f-section-header--toolbar" : " f-section-content--toolbar")), a = P(() => t.buttons && t.buttons.length > 0 && t.buttonPosition === "inHead");
function i(d, l) {
e.emit("click", d, l);
}
return () => a.value && F(fn, {
customClass: r.value,
items: n.value,
onClick: i,
alignment: o.value
}, null);
}
function Ni(t, e, n, o, r, a) {
const i = P(() => t.buttonPosition), d = Cn(t, e), {
onClickMaxMinIcon: l
} = bn(o, r, a), f = P(() => t.enableMaximize), c = P(() => t.enableAccordion !== ""), s = P(() => {
const g = {
"f-section-header": !0
};
return e.slots.header && t.headerClass.split(" ").reduce((h, _) => (h[_] = !0, h), g), g;
});
function p(g) {
g.stopPropagation(), t.enableAccordion !== "" && (n.value = !n.value);
}
function m() {
const g = P(() => ({
btn: !0,
"f-btn-collapse-expand": !0,
"f-btn-mx": !0,
"f-state-expand": n.value
})), T = P(() => ({
"f-icon": !0,
"f-icon-maximize": !a.value,
"f-icon-minimize": a.value
}));
return F("div", {
class: "f-max-accordion"
}, [f.value ? F("span", {
class: T.value,
onClick: l
}, null) : "", c.value ? F("button", {
class: g.value,
onClick: p
}, [F("span", null, [n.value ? t.collapseLabel : t.expandLabel])]) : ""]);
}
function y() {
return e.slots.header ? F("div", {
class: s.value
}, [e.slots.header()]) : "";
}
function R() {
return F("div", {
class: "f-title",
onClick: p
}, [F("h4", {
class: "f-title-text"
}, [t.mainTitle]), t.subTitle && F("span", null, [t.subTitle])]);
}
function x() {
const g = P(() => {
const T = {
"f-content": !0
};
return t.headerContentClass && t.headerContentClass.split(" ").reduce((_, I) => (_[I] = !0, _), T), T;
});
return e.slots.headerContent ? F("div", {
class: g.value
}, [e.slots.headerContent()]) : "";
}
function v() {
return F("div", {
class: s.value
}, [e.slots.headerTitle ? e.slots.headerTitle() : R(), x(), i.value === "inHead" && d(), (f.value || c.value) && m()]);
}
return () => t.showHeader && (e.slots.header ? y() : v());
}
const $i = ["moz", "ms", "webkit"];
function ji() {
let t = 0;
return (e) => {
const n = (/* @__PURE__ */ new Date()).getTime(), o = Math.max(0, 16 - (n - t)), r = setTimeout(() => {
e(n + o);
}, o);
return t = n + o, r;
};
}
function Ai() {
if (typeof window > "u")
return () => 0;
if (window.requestAnimationFrame)
return window.requestAnimationFrame.bind(window);
const t = $i.filter((e) => `${e}RequestAnimationFrame` in window)[0];
return t ? window[`${t}RequestAnimationFrame`] : ji();
}
Ai();
function wt(t, e) {
return ((e == null ? void 0 : e.split(" ")) || []).reduce((o, r) => (r && (o[r] = !0), o), t), t;
}
var Gt = /* @__PURE__ */ ((t) => (t.String = "String", t.DateTime = "DateTime", t.Date = "Date", t.Enum = "Enum", t.Boolean = "Boolean", t.Number = "Number", t.Text = "Text", t.BigNumber = "BigNumber", t))(Gt || {});
const Bt = /* @__PURE__ */ Ve({
name: "FSection",
props: Kt,
emits: ["click"],
setup(t, e) {
const n = b(), o = b(), r = b(t.customClass), a = P(() => t.enableAccordion), i = b(t.expandStatus), d = P(() => t.buttonPosition), l = b(!1), f = Ni(t, e, i, n, o, l), c = Cn(t, e), s = P(() => {
const x = {
"f-section": !0,
"f-section-accordion": a.value === "default",
"f-state-collapse": (a.value === "default" || a.value === "custom") && !i.value,
"f-section-custom-accordion": a.value === "custom",
"f-section-fill": t.fill,
"f-section-maximize": l.value
};
return wt(x, r.value);
}), p = P(() => wt({
"f-section-content": !0
}, t.contentClass)), m = P(() => wt({
"f-section-extend": !0
}, m.value));
function y() {
return e.slots.extend && F("div", {
class: m.value
}, [e.slots.extend()]);
}
function R() {
return F("div", {
class: p.value
}, [d.value === "inContent" && c(), e.slots.default && e.slots.default()]);
}
return we(() => t.expandStatus, (x, v) => {
x !== v && (i.value = x);
}), et(() => {
n.value && n.value && (o.value = n.value.parentElement);
}), () => F("div", {
class: s.value,
ref: n,
style: t.customStyle
}, [f(), y(), R()]);
}
});
function Li() {
function t(e, n) {
var i;
if (!e)
return !1;
const o = ((i = e.targetContainer) == null ? void 0 : i.componentInstance) && e.targetContainer.componentInstance.value;
if (!o)
return !1;
const r = o.schema.type, a = n == null ? void 0 : n.formSchemaUtils.getComponentById(o.belongedComponentId);
return !((e.componentCategory === "input" || e.componentType === "form-group") && ![re["response-layout-item"].type, re["response-form"].type, re.fieldset.type].includes(r) || (e.componentType === re.tabs.type || e.componentType === re.section.type) && ((a == null ? void 0 : a.componentType) !== "frame" || ![re["content-container"].type, re["splitter-pane"].type, re["response-layout-item"].type].includes(r)) || e.componentType === re["query-solution"].type || e.componentType === re.fieldset.type && r !== re["response-form"].type);
}
return {
basalDragulaRuleForContainer: t
};
}
const vt = b(0);
function Hi(t, e) {
const n = e.getBoundingClientRect(), o = t.getBoundingClientRect(), r = o.top >= n.top, a = o.top <= n.bottom;
return r && a;
}
function wn(t) {
const e = t.querySelector(".component-btn-group");
if (!e)
return;
e.style.display = "";
const n = e.getBoundingClientRect();
if (!(n.top === 0 && n.left === 0)) {
const o = e.querySelector("div");
if (o) {
const r = o.getBoundingClientRect();
o.style.top = n.top + "px";
let a = n.left - r.width;
const i = document.querySelector(".editorDiv");
if (i) {
const d = i.getBoundingClientRect();
a < d.left && ({ left: a } = t.getBoundingClientRect());
}
o.style.left = a + "px";
}
}
}
function Wi(t) {
if (!window.scrollContainerList)
return;
const e = Array.from(window.scrollContainerList);
if (e.length && e.length === 1) {
const n = e[0], o = document.querySelector(`[id=${n}]`);
if (o && o.contains(t))
return o;
}
}
function Qt(t) {
if (!t)
return;
const e = t.getBoundingClientRect();
if (e.width === 0 && e.height === 0)
return;
const n = t.querySelector(".component-btn-group");
if (n) {
let o = !0;
const r = Wi(t);
if (r && (o = Hi(t, r)), !o) {
n.style.display = "none";
return;
}
wn(t);
}
}
function _n(t) {
if (!t)
return;
let e;
t.className.includes("dgComponentSelected") ? e = t : e = t.querySelector(".dgComponentSelected"), e && Qt(e);
}
function zi(t) {
const e = document.querySelector(".dgComponentSelected");
if (!e)
return;
const n = e.getBoundingClientRect(), o = t.getBoundingClientRect(), r = e.querySelector(".component-btn-group");
if (r) {
const a = r.getBoundingClientRect(), i = o.top < n.top;
a.top !== 0 && i && wn(e);
}
}
const Gi = {
title: "section",
description: "A Farris Container Component",
type: "object",
categories: {
basic: {
title: "基本信息",
description: "Basic Infomation",
properties: {
id: {
title: "标识",
type: "string",
description: "组件标识",
readonly: !0
},
type: {
title: "组件类型",
type: "enum",
description: "组件类型",
editor: {
type: "combo-list",
textField: "value",
valueField: "key",
editable: !1,
data: [
{
key: "section",
value: "分组面板"
}
]
}
}
}
},
appearance: {
title: "外观",
description: "Appearance",
properties: {
class: {
description: "组件的CSS样式",
title: "class样式"
},
style: {
description: "组件的内容样式",
title: "style样式"
},
showHeader: {
title: "显示标题区域",
type: "boolean",
description: ""
},
mainTitle: {
title: "主标题",
type: "string",
description: "",
visible: {
showHeader: !0
}
},
subTitle: {
title: "副标题",
type: "string",
description: "",
visible: {
showHeader: !0
}
},
fill: {
title: "填充内容区域",
type: "boolean",
description: ""
},
enableAccordion: {
title: "面板收折",
type: "enum",
description: "是否启用分组面板的收折特性",
editor: {
type: "combo-list",
textField: "value",
valueField: "key",
editable: !1,
data: [
{
key: "",
value: "不启用"
},
{
key: "default",
value: "启用默认收折"
}
]
},
visible: {
showHeader: !0
}
}
},
setPropertyRelates(t, e) {
if (t)
switch (t && t.propertyID) {
case "mainTitle": {
t.needRefreshControlTree = !0;
break;
}
case "showHeader": {
const n = document.getElementsByClassName("dgComponentFocused");
Array.from(n).forEach((o) => o.classList.remove("dgComponentFocused")), vt.value++;
break;
}
}
}
},
extends: {
title: "扩展",
description: "",
properties: {
contentClass: {
title: "内容区域样式",
type: "string",
description: ""
}
}
}
}
};
class qi {
getTemplateRule(e, n) {
const o = n == null ? void 0 : n.formSchemaUtils, r = o == null ? void 0 : o.getFormTemplateRule(), a = { canAccept: !0, canDelete: !0, canMove: !0 };
if (!r)
return a;
const i = this.getComponentContext(e), { componentClassList: d } = i;
return d.forEach((l) => {
if (!l || !r[l])
return;
const { canMove: f, canDelete: c, canAccept: s } = r[l];
a.canMove = a.canMove && this.resolveRuleValue(f, i), a.canDelete = a.canDelete && this.resolveRuleValue(c, i), a.canAccept = a.canAccept && this.resolveRuleValue(s, i);
}), a;
}
resolveRuleValue(e, n) {
return typeof e == "boolean" ? e : this.parseRuleValueSchema(e, n);
}
parseRuleValueSchema(e, n) {
const o = e.invalidContext || [];
let r = !0;
for (const a of o) {
if (a.firstLevelChild) {
if (a.firstLevelChild.class) {
const { firstLevelChildClassList: i } = n;
if (i && !i.includes(a.firstLevelChild.class)) {
r = !1;
continue;
}
}
if (a.firstLevelChild.type) {
const { firstLevelChildSchema: i } = n;
if (!i || i.type !== a.firstLevelChild.type) {
r = !1;
continue;
}
}
}
if (a.secondLevelChild) {
if (a.secondLevelChild.class) {
const { secondLevelChildClassList: i } = n;
if (i && !i.includes(a.secondLevelChild.class)) {
r = !1;
continue;
}
}
if (a.secondLevelChild.type) {
const { secondLevelChildSchema: i } = n;
if (!i || i.type !== a.secondLevelChild.type) {
r = !1;
continue;
}
}
}
if (a.parent) {
if (a.parent.class) {
const { parentClassList: i } = n;
if (i && !i.includes(a.parent.class)) {
r = !1;
continue;
}
}
if (a.parent.type) {
const { parentSchema: i } = n;
if (i && i.type !== a.parent.type) {
r = !1;
continue;
}
}
}
r = !0;
break;
}
return !r;
}
getComponentContext(e) {
var R, x, v, g;
const n = e.schema, o = n.appearance && n.appearance.class || "", r = o.split(" ") || [], a = n.contents || [], i = a.length ? a[0] : null, d = i && i.appearance ? i.appearance.class : "", l = d ? d.split(" ") : [], f = (R = i == null ? void 0 : i.contents) != null && R.length ? i == null ? void 0 : i.contents[0] : null, c = f && f.appearance ? f.appearance.class : "", s = c ? c.split(" ") : [], p = n.type === "component" ? (v = (x = e.parent) == null ? void 0 : x.parent) == null ? void 0 : v.schema : (g = e.parent) == null ? void 0 : g.schema, m = p && p.appearance && p.appearance.class || "", y = m ? m.split(" ") : [];
return {
componentClass: o,
componentClassList: r,
childContents: a,
firstLevelChildSchema: i,
firstLevelChildClass: d,
firstLevelChildClassList: l,
secondLevelChildSchema: f,
secondLevelChildClass: c,
secondLevelChildClassList: s,
parentSchema: p,
parentClass: m,
parentClassList: y
};
}
}
var ft = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Ui(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function Mt(t) {
throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var Sn = { exports: {} };
(function(t, e) {
(function(n) {
t.exports = n();
})(function() {
return (/* @__PURE__ */ function() {
function n(o, r, a) {
function i(f, c) {
if (!r[f]) {
if (!o[f]) {
var s = typeof Mt == "function" && Mt;
if (!c && s) return s(f, !0);
if (d) return d(f, !0);
var p = new Error("Cannot find module '" + f + "'");
throw p.code = "MODULE_NOT_FOUND", p;
}
var m = r[f] = { exports: {} };
o[f][0].call(m.exports, function(y) {
var R = o[f][1][y];
return i(R || y);
}, m, m.exports, n, o, r, a);
}
return r[f].exports;
}
for (var d = typeof Mt == "function" && Mt, l = 0; l < a.length; l++) i(a[l]);
return i;
}
return n;
}())({
1: [function(n, o, r) {
var a = {}, i = "(?:^|\\s)", d = "(?:\\s|$)";
function l(s) {
var p = a[s];
return p ? p.lastIndex = 0 : a[s] = p = new RegExp(i + s + d, "g"), p;
}
function f(s, p) {
var m = s.className;
m.length ? l(p).test(m) || (s.className += " " + p) : s.className = p;
}
function c(s, p) {
s.className = s.className.replace(l(p), " ").trim();
}
o.exports = {
add: f,
rm: c
};
}, {}],
2: [function(n, o, r) {
(function(a) {
var i = n("contra/emitter"), d = n("crossvent"), l = n("./classes"), f = document, c = f.documentElement;
function s(S, V) {
var M = arguments.length;
M === 1 && Array.isArray(S) === !1 && (V = S, S = []);
var O, E, B, D, N, H, K, oe, te, pe = null, L, A, W = !1, Y = 0, J, X = V || {};
X.moves === void 0 && (X.moves = g), X.accepts === void 0 && (X.accepts = g), X.invalid === void 0 && (X.invalid = lt), X.containers === void 0 && (X.containers = S || []), X.isContainer === void 0 && (X.isContainer = v), X.copy === void 0 && (X.copy = !1), X.copySortSource === void 0 && (X.copySortSource = !1), X.revertOnSpill === void 0 && (X.revertOnSpill = !1), X.removeOnSpill === void 0 && (X.removeOnSpill = !1), X.direction === void 0 && (X.direction = "vertical"), X.ignoreInputTextSelection === void 0 && (X.ignoreInputTextSelection = !0), X.mirrorContainer === void 0 && (X.mirrorContainer = f.body);
var $ = i({
containers: X.containers,
start: qe,
end: ne,
cancel: st,
remove: ke,
destroy: Te,
canMove: Me,
dragging: !1
});
return X.removeOnSpill === !0 && $.on("over", me).on("out", he), ae(), $;
function q(j) {
return $.containers.indexOf(j) !== -1 || X.isContainer(j);
}
function ae(j) {
var Q = j ? "remove" : "add";
y(c, Q, "mousedown", xe), y(c, Q, "mouseup", Ie);
}
function Z(j) {
var Q = j ? "remove" : "add";
y(c, Q, "mousemove", He);
}
function ee(j) {
var Q = j ? "remove" : "add";
d[Q](c, "selectstart", Fe), d[Q](c, "click", Fe);
}
function Te() {
ae(!0), Ie({});
}
function Fe(j) {
L && j.preventDefault();
}
function xe(j) {
D = j.clientX, N = j.clientY;
var Q = R(j) !== 1 || j.metaKey || j.ctrlKey;
if (!Q) {
var U = j.target, ce = Pe(U);
ce && (L = ce, Z(), j.type === "mousedown" && (I(U) ? U.focus() : j.preventDefault()));
}
}
function He(j) {
if (L) {
if (R(j) === 0) {
Ie({});
return;
}
if (!(j.clientX !== void 0 && Math.abs(j.clientX - D) <= (X.slideFactorX || 0) && j.clientY !== void 0 && Math.abs(j.clientY - N) <= (X.slideFactorY || 0))) {
if (X.ignoreInputTextSelection) {
var Q = k("clientX", j) || 0, U = k("clientY", j) || 0, ce = f.elementFromPoint(Q, U);
if (I(ce))
return;
}
var ge = L;
Z(!0), ee(), ne(), ze(ge), l.add(oe || B, "gu-transit"), Ee(), Se(), Y = 0, Ue(j);
}
}
}
function Pe(j) {
if (!($.dragging && O) && !q(j)) {
for (var Q = j; _(j) && q(_(j)) === !1; )
if (X.invalid(j, Q) || (j = _(j), !j))
return;
var U = _(j);
if (U && !X.invalid(j, Q)) {
var ce = X.moves(j, U, Q, C(j));
if (ce)
return {
item: j,
source: U
};
}
}
}
function Me(j) {
return !!Pe(j);
}
function qe(j) {
var Q = Pe(j);
Q && ze(Q);
}
function ze(j) {
je(j.item, j.source) && (oe = j.item.cloneNode(!0), $.emit("cloned", oe, j.item, "copy")), E = j.source, B = j.item, H = K = C(j.item), $.dragging = !0, $.emit("drag", B, E);
}
function lt() {
return !1;
}
function ne() {
if ($.dragging) {
var j = oe || B;
Be(j, _(j));
}
}
function be() {
L = !1, Z(!0), ee(!0);
}
function Ie(j) {
if (be(), !!$.dragging) {
var Q = oe || B, U = k("clientX", j) || 0, ce = k("clientY", j) || 0, ge = x(O, U, ce), ye = ct(ge, U, ce);
ye && (oe && X.copySortSource || !oe || ye !== E) ? Be(Q, ye) : X.removeOnSpill ? ke() : st();
}
}
function Be(j, Q) {
var U = _(j);
oe && X.copySortSource && Q === E && U.removeChild(B), ot(Q) ? $.emit("cancel", j, E) : $.emit("drop", j, Q, E, K), nt();
}
function ke() {
if ($.dragging) {
var j = oe || B, Q = _(j);
Q && Q.removeChild(j), $.emit(oe ? "cancel" : "remove", j, Q, E), nt();
}
}
function st(j) {
if ($.dragging) {
var Q = arguments.length > 0 ? j : X.revertOnSpill, U = oe || B, ce = _(U), ge = ot(ce);
ge === !1 && Q && (oe ? ce && ce.removeChild(oe) : E.insertBefore(U, H)), ge || Q ? $.emit("cancel", U, E, E) : $.emit("drop", U, ce, E, K), nt();
}
}
function nt() {
var j = oe || B;
be(), $e(), Ge(), j && l.rm(j, "gu-transit"), te && clearTimeout(te), $.dragging = !1, pe && $.emit("out", j, pe, E), $.emit("dragend", j, Y), E = B = oe = H = K = te = pe = null;
}
function ot(j, Q) {
var U;
return Q !== void 0 ? U = Q : O ? U = K : U = C(oe || B), j === E && U === H;
}
function ct(j, Q, U) {
for (var ce = j; ce && !ge(); )
ce = _(ce);
return ce;
function ge() {
var ye = q(ce);
if (ye === !1)
return !1;
var le = rt(ce, j), _e = De(ce, le, Q, U), Re = ot(ce, _e);
return Re ? !0 : X.accepts(B, ce, E, _e);
}
}
function Ue(j) {
if (!O)
return;
j.preventDefault();
var Q = k("clientX", j) || 0, U = k("clientY", j) || 0;
O.style.left = Q - 2 + "px", O.style.top = U - 2 + "px";
var ce = oe || B, ge = x(O, Q, U), ye = ct(ge, Q, U), le = ye !== null && ye !== pe;
(le || ye === null) && (Qe(), pe = ye, dt()), Ce(ge, U);
var _e = _(ce);
if (ye === E && oe && !X.copySortSource) {
_e && _e.removeChild(ce);
return;
}
var Re, Ke = rt(ye, ge);
if (W = it(Ke, ye), Ke !== null)
Re = De(ye, Ke, Q, U);
else if (X.revertOnSpill === !0 && !oe)
Re = H, ye = E;
else {
oe && _e && _e.removeChild(ce), oe && A && (A.style.display = "none");
return;
}
A.style.display = "block", ie(Re, ce, le), Re ? z(Ke, Re) : ve(ye);
function Ae(We) {
$.emit(We, ce, pe, E);
}
function dt() {
le && Ae("over");
}
function Qe() {
pe && Ae("out");
}
}
function ie(j, Q, U) {
(j === Q || j === C(Q)) && (K = C(Q)), (j === null && U || j !== Q && j !== C(Q)) && (K = j);
}
function me(j) {
l.rm(j, "gu-hide");
}
function he(j) {
$.dragging && l.add(j, "gu-hide");
}
function Se() {
O || (O = document.createElement("div"), O.style = "background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;", O.innerHTML = X.getMirrorText && X.getMirrorText(B) || "控件", l.add(O, "gu-mirror"), X.mirrorContainer.appendChild(O), y(c, "add", "mousemove", Ue), l.add(X.mirrorContainer, "gu-unselectable"), $.emit("cloned", O, B, "mirror"));
}
function Ee() {
if (A = document.createElement("div"), l.add(A, "gu-insertion"), B) {
var j = B.getBoundingClientRect();
A.style.left = j.left + "px", A.style.top = j.top + "px";
}
W = !1, X.mirrorContainer.appendChild(A);
}
function $e() {
O && (l.rm(X.mirrorContainer, "gu-unselectable"), y(c, "remove", "mousemove", Ue), _(O).removeChild(O), O = null);
}
function Ge() {
A && (_(A).removeChild(A), A = null);
}
function rt(j, Q) {
for (var U = Q; U !== j && _(U) !== j; )
U = _(U);
return U === c ? null : U;
}
function it(j, Q) {
if (!Q)
return W;
var U = j || Q && Q.lastElementChild;
if (!U)
return !0;
var ce = getComputedStyle(j), ge = /^inline/.test(ce.getPropertyValue("display")) || /^(left|right)$/.test(ce.getPropertyValue("float"));
if (ge)
return !0;
if (Q) {
var ye = getComputedStyle(Q), le = ye.getPropertyValue("display");
if (/flex$/.test(le)) {
var _e = ye.getPropertyValue("flex-direction") || "row";
if (_e === "row" || _e === "row-reverse")
return !Ye(Q);
}
return !1;
}
return !0;
}
function Ye(j) {
if (!j.children || !j.children.length)
return !1;
for (const Q of Array.from(j.children)) {
const ce = (Q.className && Q.className.split(" ") || []).filter((ge) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(ge));
if (!ce.length)
return !1;
for (const ge of ce) {
const ye = ge.slice(ge.lastIndexOf("-") + 1);
if (parseInt(ye, 10) !== 12)
return !1;
}
}
return !0;
}
function z(j, Q) {
const U = Q.getBoundingClientRect();
if (A.style.left = U.left + "px", A.style.top = U.top + "px", W) {
if (A.style.height = U.height + "px", A.style.width = "4px", j) {
const ce = j.getBoundingClientRect();
ce.top !== U.top && (A.style.left = ce.right + "px", A.style.top = ce.top + "px", A.style.height = ce.height + "px");
}
} else if (A.style.height = "4px", A.style.width = U.width + "px", J) {
const ce = J.getBoundingClientRect();
U.top < ce.top && (A.style.display = "none");
}
Q === B && B && (A.style.display = "none");
}
function ve(j) {
K = null;
var Q = j.lastElementChild;
if (Q) {
var U = Q.getBoundingClientRect();
W ? (A.style.left = U.right + "px", A.style.top = U.top + "px", A.style.height = U.height + "px", A.style.width = "4px") : (A.style.left = U.left + "px", A.style.top = U.bottom + "px", A.style.height = "4px", A.style.width = U.width + "px"), Q === B && B && (A.style.display = "none");
} else
A.style.display = "none";
}
function Ce(j, Q) {
if (!X.mirrorContainer.contains(j) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (J = p(j), !J || !J.contains(j)))
return;
const U = document.querySelector(".dgComponentSelected"), ce = J.getBoundingClientRect();
if (Q - 30 < ce.top && J.scrollTop > 0) {
let ge = J.scrollTop < 10 ? J.scrollTop : 10;
J.scrollBy(0, -1 * ge), U && J.contains(U) && (Y = Y + -1 * ge);
}
if (Q + 30 > ce.bottom && J.scrollTop < J.scrollHeight - J.clientHeight) {
const ge = J.scrollHeight - J.clientHeight - J.scrollTop;
let ye = ge < 10 ? ge : 10;
J.scrollBy(0, ye), U && J.contains(U) && (Y = Y + ye);
}
}
function De(j, Q, U, ce) {
var ge = X.direction === "horizontal", ye = X.direction === "mixed", le = Q !== j ? Re() : _e();
return le;
function _e() {
var Ae = j.children.length, dt, Qe, We;
for (dt = 0; dt < Ae; dt++)
if (Qe = j.children[dt], We = Qe.getBoundingClientRect(), ge && We.left + We.width / 2 > U || !ye && !ge && We.top + We.height / 2 > ce || ye && We.left + We.width > U && We.top + We.height > ce)
return Qe;
return null;
}
function Re() {
var Ae = Q.getBoundingClientRect();
if (ye) {
var dt = ce - Ae.top, Qe = U - Ae.left, We = Ae.bottom - ce, $t = Ae.right - U, jt = Math.min(Qe, $t, dt, We), At;
return W ? At = $t < Qe : At = We === jt || $t === jt || Qe === jt, Ke(At);
}
return Ke(ge ? U > Ae.left + T(Ae) / 2 : ce > Ae.top + h(Ae) / 2);
}
function Ke(Ae) {
return Ae ? C(Q) : Q;
}
}
function je(j, Q) {
return typeof X.copy == "boolean" ? X.copy : X.copy(j, Q);
}
}
function p(S) {
const V = Array.from(window.scrollContainerList);
if (V.length === 1) {
const O = Array.from(window.scrollContainerList)[0];
return document.getElementById(O);
}
const M = m(V);
for (const O of M)
if (O.contains(S))
return O;
return null;
}
function m(S) {
const V = [];
return S.forEach((M) => {
const O = document.getElementById(M);
O && V.push(O);
}), V.sort((M, O) => M.contains(O) ? 1 : O.contains(M) ? -1 : 0), V;
}
function y(S, V, M, O) {
var E = {
mouseup: "touchend",
mousedown: "touchstart",
mousemove: "touchmove"
}, B = {
mouseup: "pointerup",
mousedown: "pointerdown",
mousemove: "pointermove"
}, D = {
mouseup: "MSPointerUp",
mousedown: "MSPointerDown",
mousemove: "MSPointerMove"
};
a.navigator.pointerEnabled ? d[V](S, B[M], O) : a.navigator.msPointerEnabled ? d[V](S, D[M], O) : (d[V](S, E[M], O), d[V](S, M, O));
}
function R(S) {
if (S.touches !== void 0)
return S.touches.length;
if (S.which !== void 0 && S.which !== 0)
return S.which;
if (S.buttons !== void 0)
return S.buttons;
var