@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,381 lines • 219 kB
JavaScript
var Vn = Object.defineProperty;
var qn = (e, t, n) => t in e ? Vn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var He = (e, t, n) => qn(e, typeof t != "symbol" ? t + "" : t, n);
import { ref as w, createVNode as y, Fragment as yt, watch as Te, defineComponent as Me, computed as ve, nextTick as Ge, onBeforeMount as dn, onMounted as Qe, onUnmounted as fn, watchEffect as Wn, Teleport as Xn, Transition as Yn, shallowRef as Jn, render as Tt, h as gt, cloneVNode as Gn, createApp as Qn, mergeProps as $t, createTextVNode as Re, reactive as Zn, withDirectives as pn, resolveDirective as Kn, inject as Ue, vModelText as eo, onBeforeUnmount as mn, provide as tt } from "vue";
import { LocaleService as ct } from "../locale/index.esm.js";
import { isMobilePhone as Rt, getMaxZIndex as Ut, useThirdComponent as to } from "../common/index.esm.js";
import "../property-panel/index.esm.js";
import no from "../button/index.esm.js";
import oo from "../field-selector/index.esm.js";
import "../collection-property-editor/index.esm.js/src/use-button-items.designer";
import { isPlainObject as Ht, cloneDeep as vt, debounce as ro } from "lodash-es";
import so from "../accordion/index.esm.js";
import io from "../../designer/avatar/index.esm.js";
import ao from "../../designer/approval-logs/index.esm.js";
import lo from "../../designer/button-edit/index.esm.js";
import uo from "../button-group/index.esm.js";
import co from "../calendar/index.esm.js";
import fo from "../../designer/capsule/index.esm.js";
import Vt from "../../designer/checkbox/index.esm.js";
import qt from "../../designer/checkbox-group/index.esm.js";
import po from "../combo-list/index.esm.js";
import mo from "../combo-tree/index.esm.js";
import vo from "../component/index.esm.js";
import ho from "../color-picker/index.esm.js";
import yo from "../content-container/index.esm.js";
import go from "../../designer/date-picker/index.esm.js";
import bo from "../../designer/data-grid/index.esm.js";
import Co from "../dropdown/index.esm.js";
import wo from "../../designer/dynamic-form/index.esm.js";
import xo from "../events-editor/index.esm.js";
import So from "../filter-bar/index.esm.js";
import Po from "../binding-selector/index.esm.js";
import Eo from "../image-cropper/index.esm.js";
import Fo from "../../designer/input-group/index.esm.js";
import To from "../layout/index.esm.js";
import ko from "../list-nav/index.esm.js";
import Oo from "../../designer/list-view/index.esm.js";
import No from "../lookup/index.esm.js";
import Ro from "../mapping-editor/index.esm.js";
import Mo from "../../designer/nav/index.esm.js";
import Bo from "../number-range/index.esm.js";
import Ao from "../../designer/number-spinner/index.esm.js";
import Io from "../order/index.esm.js";
import Lo from "../page-header/index.esm.js";
import $o from "../page-footer/index.esm.js";
import jo from "../pagination/index.esm.js";
import zo from "../progress/index.esm.js";
import Do from "../query-solution/index.esm.js";
import _o from "../../designer/radio-group/index.esm.js";
import Uo from "../../designer/rate/index.esm.js";
import Ho from "../../designer/response-toolbar/index.esm.js";
import Vo from "../response-layout/index.esm.js";
import qo from "../../designer/response-layout-editor/index.esm.js";
import Wo from "../search-box/index.esm.js";
import Xo from "../../designer/section/index.esm.js";
import Yo from "../smoke-detector/index.esm.js";
import Jo from "../splitter/index.esm.js";
import Go from "../step/index.esm.js";
import Qo from "../../designer/switch/index.esm.js";
import Zo from "../../designer/tabs/index.esm.js";
import Ko from "../../designer/tags/index.esm.js";
import er from "../text/index.esm.js";
import tr from "../../designer/time-picker/index.esm.js";
import nr from "../transfer/index.esm.js";
import or from "../tree-view/index.esm.js";
import rr from "../uploader/index.esm.js";
import sr from "../verify-detail/index.esm.js";
import ir from "../video/index.esm.js";
import ar from "../../designer/textarea/index.esm.js";
import lr from "../schema-selector/index.esm.js";
import ur from "../../designer/tree-grid/index.esm.js";
import cr from "../event-parameter/index.esm.js";
import dr from "../filter-condition-editor/index.esm.js";
import fr from "../fieldset/index.esm.js";
import pr from "../sort-condition-editor/index.esm.js";
import mr from "../menu-lookup/index.esm.js";
import vr from "../../designer/drawer/index.esm.js";
import hr from "../json-editor/index.esm.js";
import yr from "../property-editor/index.esm.js";
import gr from "../expression-editor/index.esm.js";
import br from "../code-editor/index.esm.js";
import Cr from "../html-template/index.esm.js";
import wr from "../collection-property-editor/index.esm.js";
import xr from "../../designer/modal/index.esm.js";
import Sr from "../external-container/index.esm.js";
import Pr from "../language-textbox/index.esm.js";
import Er from "../image/index.esm.js";
import Fr from "../comment/index.esm.js";
import Tr from "../../designer/wizard/index.esm.js";
import { schemaResolverMap as kr, propertyEffectMap as Or, propertyConfigSchemaMap as Nr, schemaMap as Rr, createPropsResolver as Mr, propertyConfigSchemaMapForDesigner as Br, propertyEffectMapForDesigner as Ar } from "../dynamic-resolver/index.esm.js";
import Ir from "../tooltip/index.esm.js";
import { DgControl as L } from "../designer-canvas/index.esm.js";
const Lr = {
/**
* 允许点击遮罩关闭对话框
*/
allowClickMaskToClose: { type: Boolean, default: !1 },
/**
* 关闭对话框前事件, 是个函数,返回true或者false
*/
beforeClose: { type: Function, default: () => !0 },
/**
* 自定义类
*/
class: { type: String, default: "" },
/**
* 自定义遮罩类
*/
maskClass: { type: String, default: "" },
/**
* 模态框标题
*/
title: { type: String, default: "" },
/**
* 模态框宽度
*/
width: { type: Number, default: 500 },
/**
* 模态框高度
*/
height: { type: Number, default: 320 },
/**
* 自定义按钮列表
*/
buttons: {
type: Array,
default: []
},
/**
* 是否展示模态框
*/
modelValue: { type: Boolean, default: !1 },
/**
* 是否模态
*/
mask: { type: Boolean, default: !0 },
/**
* 是否展示头部
*/
showHeader: { type: Boolean, default: !0 },
/**
* 是否展示默认按钮
*/
showButtons: { type: Boolean, default: !0 },
/**
* 是否启用自适应样式
*/
fitContent: { type: Boolean, default: !0 },
/**
* 是否展示右上角按钮
*/
showCloseButton: { type: Boolean, default: !0 },
/**
* 是否在窗口右上角展示浮动关闭按钮
*/
showFloatingClose: { type: Boolean, default: !1 },
showMaxButton: { type: Boolean, default: !1 },
minHeight: { type: Number },
maxHeight: { type: Number },
minWidth: { type: Number },
maxWidth: { type: Number },
containment: { type: Object, default: null },
resizeable: { type: Boolean, default: !1 },
draggable: { type: Boolean, default: !1 },
dragHandle: { type: Object, default: null },
closedCallback: { type: Function, default: null },
openedCallback: { type: Function, default: null },
// 窗口打开后的回调函数
resizeHandle: { type: Function, default: null },
render: { type: Function, default: null },
acceptCallback: { type: Function, default: null },
rejectCallback: { type: Function, default: null },
enableEsc: { type: Boolean, default: !0 },
enableEnter: { type: Boolean, default: !1 },
dialogType: { type: String, default: "" },
src: { type: String, default: "" },
footerHeight: { type: Number, default: 60 },
position: { type: String, default: "center" },
host: { type: Object, default: "body" },
isMessager: { type: Boolean, default: !1 },
fullscreen: { type: Boolean, default: !1 },
maximized: { type: Boolean, default: !1 },
useTransform: { type: Boolean, default: !0 }
};
class Ne {
constructor(t, n) {
this.x = t, this.y = n;
}
static getTransformInfo(t) {
const o = window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g, "").split(",");
if (o.length >= 6) {
const r = parseInt(o[4], 10), i = parseInt(o[5], 10);
return { x: r, y: i };
}
return { x: 0, y: 0 };
}
static fromEvent(t, n = null) {
if (this.isMouseEvent(t))
return new Ne(t.clientX, t.clientY);
if (n === null || t.changedTouches.length === 1)
return new Ne(t.changedTouches[0].clientX, t.changedTouches[0].clientY);
for (let o = 0; o < t.changedTouches.length; o++)
if (t.changedTouches[o].target === n)
return new Ne(t.changedTouches[o].clientX, t.changedTouches[o].clientY);
}
static isMouseEvent(t) {
return Object.prototype.toString.apply(t).indexOf("MouseEvent") === 8;
}
static isIPosition(t) {
return !!t && "x" in t && "y" in t;
}
static getCurrent(t) {
const n = new Ne(0, 0);
if (window) {
const o = window.getComputedStyle(t);
if (o) {
const r = parseInt(o.getPropertyValue("left"), 10), i = parseInt(o.getPropertyValue("top"), 10);
n.x = isNaN(r) ? 0 : r, n.y = isNaN(i) ? 0 : i;
}
return n;
}
return null;
}
static copy(t) {
return new Ne(0, 0).set(t);
}
get value() {
return { x: this.x, y: this.y };
}
add(t) {
return this.x += t.x, this.y += t.y, this;
}
subtract(t) {
return this.x -= t.x, this.y -= t.y, this;
}
multiply(t) {
this.x *= t, this.y *= t;
}
divide(t) {
this.x /= t, this.y /= t;
}
reset() {
return this.x = 0, this.y = 0, this;
}
set(t) {
return this.x = t.x, this.y = t.y, this;
}
}
class Ve {
constructor(t, n) {
this.width = t, this.height = n;
}
static getCurrent(t) {
const n = new Ve(0, 0);
if (window) {
const o = window.getComputedStyle(t);
return o && (n.width = parseInt(o.getPropertyValue("width"), 10), n.height = parseInt(o.getPropertyValue("height"), 10)), n;
}
return null;
}
static copy(t) {
return new Ve(0, 0).set(t);
}
set(t) {
return this.width = t.width, this.height = t.height, this;
}
}
function $r(e, t) {
const n = w(), o = w(), r = w(), i = w(), s = w(), a = w(), m = w(), u = w(), c = w(), d = w(), C = w(), b = w(e.resizeable), l = w(), g = w(e.draggable), h = w(!1);
function T() {
const I = o.value || document.body, $ = window.getComputedStyle(I);
if (!$ || !n.value)
return;
const ue = Ne.getTransformInfo(n.value), ne = {};
m.value && (ne.deltaL = n.value.offsetLeft - m.value.x, ne.deltaT = n.value.offsetTop - m.value.y);
const fe = $.getPropertyValue("position");
ne.width = I.clientWidth, ne.height = I.clientHeight, ne.pr = parseInt($.getPropertyValue("padding-right"), 10), ne.pb = parseInt($.getPropertyValue("padding-bottom"), 10), ne.position = $.getPropertyValue("position"), fe === "static" && (I.style.position = "relative"), ne.translateX = ue.x, ne.translateY = ue.y, d.value = ne;
}
function R(I) {
if (n.value) {
i.value = Ve.getCurrent(n.value), s.value = Ne.getCurrent(n.value), a.value = i.value ? Ve.copy(i.value) : null, m.value = s.value ? Ne.copy(s.value) : null, T();
const $ = I.target.getAttribute("type") || "";
u.value = {
n: !!$.match(/n/),
s: !!$.match(/s/),
w: !!$.match(/w/),
e: !!$.match(/e/)
};
}
}
function _() {
var I, $, ue, ne;
if (n.value) {
const fe = n.value;
u.value && ((u.value.n || u.value.s) && ((I = a.value) != null && I.height) && (fe.style.height = a.value.height + "px"), (u.value.w || u.value.e) && (($ = a.value) != null && $.width) && (fe.style.width = a.value.width + "px"), m.value && ((ue = m.value) != null && ue.x && (fe.style.left = m.value.x + "px"), (ne = m.value) != null && ne.y && (fe.style.top = m.value.y + "px")));
}
}
function G() {
const I = e.minHeight ? e.minHeight : 1, $ = e.minWidth ? e.minWidth : 1;
a.value && m.value && u.value && i.value && (a.value.height < I && (a.value.height = I, u.value.n && s.value && (m.value.y = s.value.y + (i.value.height - I))), a.value.width < $ && (a.value.width = $, u.value.w && s.value && (m.value.x = s.value.x + (i.value.width - $))), e.maxHeight && a.value.height > e.maxHeight && (a.value.height = e.maxHeight, s.value && u.value.n && (m.value.y = s.value.y + (i.value.height - e.maxHeight))), e.maxWidth && a.value.width > e.maxWidth && (a.value.width = e.maxWidth, u.value.w && s.value && (m.value.x = s.value.x + (i.value.width - e.maxWidth))));
}
function se() {
if (o.value) {
const I = d.value;
if (m.value && a.value && u.value && i.value) {
const $ = I.width - I.pr - I.deltaL - I.translateX - m.value.x, ue = I.height - I.pb - I.deltaT - I.translateY - m.value.y;
u.value.n && m.value.y + I.translateY < 0 && s.value && (m.value.y = -I.translateY, a.value.height = i.value.height + s.value.y + I.translateY), u.value.w && m.value.x + I.translateX < 0 && s.value && (m.value.x = -I.translateX, a.value.width = i.value.width + s.value.x + I.translateX), a.value.width > $ && (a.value.width = $), a.value.height > ue && (a.value.height = ue);
}
}
}
function Z(I) {
if (!r.value || !i.value || !s.value || !u.value)
return;
I.subtract(r.value);
const $ = I.x, ue = I.y;
u.value.n ? (m.value.y = s.value.y + ue, a.value.height = i.value.height - ue) : u.value.s && (a.value.height = i.value.height + ue), u.value.e ? a.value.width = i.value.width + $ : u.value.w && (a.value.width = i.value.width - $, m.value.x = s.value.x + $), se(), G(), _();
}
function F(I) {
if (!c.value)
return;
const $ = Ne.fromEvent(I);
$ && Z($);
}
function N() {
if (n.value) {
const {
width: I,
height: $,
x: ue,
y: ne
} = n.value.getBoundingClientRect(), fe = Ne.getTransformInfo(n.value);
return {
size: {
width: I,
height: $
},
position: {
x: ue - fe.x,
y: ne - fe.y
}
};
}
return null;
}
function H(I) {
if (n.value) {
const $ = N();
C.value = $;
}
r.value = void 0, i.value = null, s.value = null, a.value = null, m.value = null, u.value = null, c.value = null, document.removeEventListener("mousemove", F), document.removeEventListener("mouseup", H);
}
function W() {
document.addEventListener("mousemove", F), document.addEventListener("mouseup", H);
}
function X(I) {
I instanceof MouseEvent && I.button === 2 || g.value && (document.body.click(), I.stopPropagation(), I.preventDefault(), r.value = Ne.fromEvent(I), c.value = I.target, R(I), W());
}
function Q(I) {
return n.value = I, b.value && y(yt, null, [y("div", {
class: "fv-resizable-handle fv-resizable-n",
type: "n",
onMousedown: ($) => X($)
}, null), y("div", {
class: "fv-resizable-handle fv-resizable-e",
type: "e",
onMousedown: ($) => X($)
}, null), y("div", {
class: "fv-resizable-handle fv-resizable-s",
type: "s",
onMousedown: ($) => X($)
}, null), y("div", {
class: "fv-resizable-handle fv-resizable-w",
type: "w",
onMousedown: ($) => X($)
}, null), y("div", {
class: "fv-resizable-handle fv-resizable-ne",
type: "ne",
onMousedown: ($) => X($)
}, null), y("div", {
class: "fv-resizable-handle fv-resizable-se fv-resizable-diagonal",
type: "se",
onMousedown: ($) => X($)
}, null), y("div", {
class: "fv-resizable-handle fv-resizable-sw",
type: "sw",
onMousedown: ($) => X($)
}, null), y("div", {
class: "fv-resizable-handle fv-resizable-nw",
type: "nw",
onMousedown: ($) => X($)
}, null)]);
}
function B(I = !0) {
document.body.click();
const $ = o.value || document.body, ue = Ve.getCurrent($), ne = n.value;
I && ne && (l.value = N(), l.value.transform = ne.style.transform), ue && ne && (a.value = ue, a.value.height -= 14, a.value.width -= 14, ne.style.height = a.value.height + "px", ne.style.width = a.value.width + "px", ne.style.left = "7px", ne.style.top = "7px", ne.style.transform = "", C.value = {
size: a.value,
position: {
x: 0,
y: 0
}
}, g.value = !1, h.value = !0);
}
function Y() {
var I, $;
if (document.body.click(), l.value) {
const ue = {
width: l.value.size.width || 0,
height: l.value.size.height || 0
}, ne = {
x: (window.innerWidth - ue.width) / 2,
y: (window.innerHeight - ue.height) / 2
};
(I = a.value) == null || I.set(ue), ($ = m.value) == null || $.set(ne);
const fe = n.value;
fe.style.height = ue.height + "px", fe.style.width = ue.width + "px", fe.style.left = `${ne.x}px`, fe.style.top = `${ne.y}px`, fe.style.transform = "", C.value = {
size: ue,
position: ne
}, g.value = e.draggable, h.value = !1;
}
}
function K() {
if (n.value) {
const I = Ve.getCurrent(n.value);
if (I) {
const {
width: $,
height: ue
} = I;
n.value.style.left = `${(window.innerWidth - $) / 2}px`, n.value.style.top = `${(window.innerHeight - ue) / 2}px`, n.value.style.transform = "";
}
}
}
function ae() {
const I = () => {
h.value ? B(!1) : K(), document.body.click();
};
return window.addEventListener("resize", I), () => {
window.removeEventListener("resize", I);
};
}
const ye = ae();
return {
renderResizeBar: Q,
boundingElement: o,
resizedEventParam: C,
maximize: B,
restore: Y,
allowDrag: g,
isMaximized: h,
unWindowResizeHandle: ye,
moveToCenter: K
};
}
function jr(e, t, n) {
const o = w(), r = w(e.draggable), i = w(e.lockAxis), s = w(), a = w(), m = w(!1), u = w(new Ne(0, 0)), c = w(new Ne(0, 0)), d = w(new Ne(0, 0)), C = w(new Ne(0, 0));
Te(() => n.value, (F) => {
s.value.style.cursor = F ? "move" : "default";
});
function b(F, N) {
if (N.tagName === "BUTTON")
return !1;
if (N === F)
return !0;
for (const H in N.children)
if (Object.prototype.hasOwnProperty.call(N.children, H) && b(F, N.children[H]))
return !0;
return !1;
}
function l() {
var W, X;
let F = d.value.x + c.value.x, N = d.value.y + c.value.y;
i.value === "x" ? (F = ((W = u.value) == null ? void 0 : W.x) || 0, d.value.x = 0) : i.value === "y" && (N = ((X = u.value) == null ? void 0 : X.y) || 0, d.value.y = 0);
const H = `translate3d(${Math.round(F)}px, ${Math.round(N)}px, 0px)`;
o.value && (o.value.style.transform = H), C.value.x = F, C.value.y = N;
}
function g() {
if (!a.value || !o.value)
return null;
const F = a.value.getBoundingClientRect(), N = o.value.getBoundingClientRect(), H = {
top: F.top < N.top,
right: F.right > N.right,
bottom: F.bottom > N.bottom,
left: F.left < N.left
};
return H.top || (d.value.y -= N.top - F.top), H.bottom || (d.value.y -= N.bottom - F.bottom), H.right || (d.value.x -= N.right - F.right), H.left || (d.value.x -= N.left - F.left), l(), H;
}
function h(F) {
F && (u.value && F.subtract(u.value), d.value.set(F), l(), g());
}
function T(F) {
m.value && r.value && (F.stopPropagation(), F.preventDefault(), h(Ne.fromEvent(F, s.value)));
}
function R() {
var F;
if (m.value) {
if (m.value = !1, c.value.add(d.value), d.value.reset(), (F = o.value) == null || F.classList.remove("ng-dragging"), !e.useTransform && o.value) {
const { left: N, top: H } = o.value.getBoundingClientRect();
o.value.style.left = Math.ceil(N) + "px", o.value.style.top = Math.ceil(H) + "px", o.value.style.transform = "none";
}
t.emit("stopMove"), document.removeEventListener("mousemove", T), document.removeEventListener("mouseup", R);
}
}
function _() {
!m.value && s.value && (m.value = !0, s.value.classList.add("ng-dragging"), document.addEventListener("mousemove", T), document.addEventListener("mouseup", R));
}
function G() {
if (o.value) {
const F = Ne.getTransformInfo(o.value);
c.value.set(F);
return;
}
c.value.reset();
}
function se(F) {
if (!n.value || F instanceof MouseEvent && F.button === 2)
return;
const N = F.target || F.srcElement;
s.value !== void 0 && N && !b(N, s.value) || r.value !== !1 && (document.body.click(), F.stopPropagation(), F.preventDefault(), u.value = Ne.fromEvent(F, o.value), G(), _());
}
function Z(F, N, H) {
if (r.value && N) {
if (F)
s.value = F;
else if (e.dragHandle) {
if (e.dragHandle instanceof HTMLElement)
s.value = e.dragHandle;
else if (typeof e.dragHandle == "string") {
const W = N.querySelector(e.dragHandle);
W && (s.value = W);
}
}
o.value = N, a.value = H, s.value ? (s.value.classList.add("ng-draggable"), s.value.addEventListener("mousedown", se)) : r.value = !1;
}
}
return {
registerDraggle: Z,
resetTranslate: G
};
}
function vn(e, t) {
if (e) {
const n = (o) => {
o.key.toLowerCase() === e.toLowerCase() && t({ event: o, key: e });
};
return document.addEventListener("keydown", n), () => {
document.removeEventListener("keydown", n);
};
}
}
function zr(e, t) {
const n = w(e.enableEsc);
let o = null;
return n.value ? (o = vn("Escape", (r) => {
t.emit("esc", { event: r.event, type: "esc" });
}), {
remove: o
}) : null;
}
function Dr(e, t) {
const n = w(e.enableEnter);
let o = null;
return n.value ? (o = vn("Enter", (r) => {
t.emit("enter", { event: r.event, type: "enter" });
}), {
remove: o
}) : null;
}
const Je = /* @__PURE__ */ Me({
name: "FModal",
props: Lr,
emits: ["update:modelValue", "accept", "cancel", "closed", "resize", "esc", "enter", "stopMove", "buttonClick"],
setup(e, t) {
const n = w(e.width || 300), o = w(e.height || 200), r = w(e.modelValue), i = w(""), s = w(e.class), a = w(e.fitContent), m = w(e.showHeader), u = w(""), c = w(e.showCloseButton), d = w(e.showMaxButton), C = w(!1), b = w(e.dialogType), l = w(e.src), g = w(""), h = w(e.showButtons), T = w(e.title), R = w(e.containment || null), _ = w();
T.value === "错误提示" && (T.value = ct.getLocaleValue("messageBox.errorTitle"));
const G = w(!1);
function se() {
const f = document.querySelectorAll(".farris-modal").length;
(!f || f - 1 <= 0) && _.value === document.querySelectorAll(".farris-modal")[0] && document.body.classList.remove("modal-open"), _.value && _.value.classList.remove("show");
}
function Z(f, A) {
const le = A ? "accept" : "cancel";
Promise.resolve().then(() => {
var ce;
return (ce = e.beforeClose) == null ? void 0 : ce.call(e, {
closeType: le
});
}).then((ce) => {
ce && (r.value = !1, t.emit("update:modelValue", !1), A != null && t.emit(A ? "accept" : "cancel"), t.emit("closed", f), se());
});
}
const F = [{
name: "cancel",
text: ct.getLocaleValue("messageBox.cancel") || "取消",
class: "btn btn-secondary",
handle: (f) => {
Z(f, !1);
}
}, {
name: "accept",
text: ct.getLocaleValue("messageBox.ok") || "确定",
class: "btn btn-primary",
handle: (f) => {
Z(f, !0);
}
}], N = w(e.buttons && e.buttons.length ? e.buttons : F), H = ve(() => !!u.value), W = ve(() => !!h.value && !!N.value), X = w(), Q = w(), B = w(e.maximized || !1), {
renderResizeBar: Y,
maximize: K,
restore: ae,
boundingElement: ye,
resizedEventParam: I,
allowDrag: $,
unWindowResizeHandle: ue,
moveToCenter: ne
} = $r(e), {
registerDraggle: fe
} = jr(e, t, $);
function ke() {
return !!document.querySelectorAll(".farris-modal").length && document.body.classList.contains("modal-open");
}
Te(() => e.title, (f, A) => {
f !== A && (T.value = f);
}), Te(() => e.modelValue, (f, A) => {
f !== A && (r.value = f, r.value && e.draggable && Ge(() => {
Q.value && !R.value && (R.value = Q.value.parentElement, ye.value = R.value, fe(X.value, Q.value, ye.value), ne());
}), f || (R.value && (R.value = null), se())), r.value ? G.value = ke() : (B.value = !1, $.value = e.draggable);
}), Te(() => e.showHeader, (f, A) => {
f !== A && (m.value = f);
}), Te(() => e.showButtons, (f, A) => {
f !== A && (h.value = f);
}), Te(() => I.value, (f, A) => {
const le = f || {}, ce = A || {};
JSON.stringify(le) !== JSON.stringify(ce) && t.emit("resize", {
newSize: f,
oldSize: A,
isMaximized: B.value
});
}), Te([() => e.width, () => e.height], (f, A) => {
(f[0] !== A[0] || f[1] !== A[1]) && (n.value = f[0] || 500, o.value = f[1] || 600);
}), Te(() => e.class, (f, A) => {
s.value = f;
});
const Se = ve(() => (r.value && document.body.classList.add("modal-open"), r.value)), v = ve(() => {
var le;
const f = {
modal: !0,
"farris-modal": !0,
fade: !0,
"fe-cmp-page-modal": !!e.showFloatingClose
};
f["f-modal-fitContent"] = !!a.value, f.show = !!Se.value;
const A = (le = e.maskClass) == null ? void 0 : le.split(" ");
return A == null || A.reduce((ce, Fe) => (ce[Fe] = !0, ce), f), f;
}), p = ve(() => {
var le;
const f = {
"modal-dialog": !0
}, A = (le = s.value) == null ? void 0 : le.split(" ");
return A == null || A.reduce((ce, Fe) => (ce[Fe] = !0, ce), f), f;
}), P = () => Rt() && !e.isMessager || !!e.fullscreen, M = ve(() => {
const f = document.documentElement.clientWidth, A = document.documentElement.clientHeight;
if (B.value)
return {
position: "fixed",
top: "0px",
left: "0px",
width: "100vw",
height: "100vh",
margin: "0"
};
const le = Math.min(n.value, f), ce = e.position === "right" ? "100%" : a.value ? "auto" : `${Math.min(o.value, A - 10)}px`, Fe = `${(window.innerHeight - (ce === "100%" || ce === "auto" ? 0 : parseInt(ce))) / 2}px`, je = e.position === "right" ? `${window.innerWidth - le}px` : `${(window.innerWidth - le) / 2}px`, Ie = {
position: "absolute",
top: Fe,
left: je,
width: Rt() ? "auto" : `${le}px`,
height: ce
};
return e.mask || (Ie.pointerEvents = "auto"), Ie;
}), k = w(Ut() || 1050), S = ve(() => {
const f = {
display: "block",
overflow: "hidden"
};
return e.mask || (f.pointerEvents = "none", f.backgroundColor = "transparent"), G.value && (f.backgroundColor = "transparent"), f.zIndex = k.value, f;
}), re = ve(() => ({
"modal-content": !0,
"modal-content-has-header": m.value,
"is-mobile": P()
})), ee = ve(() => {
const f = {
display: m.value ? "" : "none"
};
return f["pointer-events"] = $.value ? "auto" : "none", f;
}), be = ve(() => ({
"f-icon": !0,
modal_maximize: !0,
modalrevert: B.value
})), xe = ve(() => ({
"modal-body": !0,
"f-utils-flex-column": b.value === "iframe",
"f-utils-fill": !0
}));
function ge() {
return {
height: `${e.footerHeight || 60}px`
};
}
const Pe = ve(() => {
const f = {
textAlgin: g.value
}, A = ge();
return Object.assign(f, A);
});
function ie(f) {
if (f == null || f.stopPropagation(), B.value) {
B.value = !1, ae();
return;
}
K(), B.value = !0;
}
async function he(f, A) {
f.handle ? await f.handle(A, f) && t.emit("closed", A) : t.emit("buttonClick", {
button: f,
$event: A
});
}
function Oe(f) {
f.width && (n.value = f.width), f.height && (o.value = f.height), f.buttons && (N.value = f.buttons), f.title && (T.value = f.title);
}
let me = null, te = null;
dn(() => {
G.value = ke();
}), Qe(() => {
Q.value && !R.value && (R.value = Q.value.parentElement, ye.value = R.value, fe(X.value, Q.value, ye.value)), Se.value && document.body.classList.add("modal-open"), me = zr(e, t), te = Dr(e, t);
}), fn(() => {
ue && ue(), me && me.remove(), te && te.remove();
}), t.expose({
modalElementRef: Q,
updateModalOptions: Oe,
close: Z,
maxDialog: ie,
isMaximized: B,
disableButtons: (f, A = !0) => {
N.value.forEach((le) => {
le.name && f.includes(le.name) && (le.disabled = A);
});
}
});
function q() {
return y("div", {
class: "action-wrapper",
onClick: (f) => Z(f, !1)
}, [y("span", {
class: "close-icon"
}, [y("i", {
class: "f-icon f-icon-close"
}, null)])]);
}
function U() {
return y("ul", null, [C.value && y("li", {
class: "f-btn-icon f-bare"
}, [y("span", {
class: "f-icon modal_minimize"
}, null)]), d.value && y("li", {
onClick: ie,
class: "f-btn-icon f-bare",
style: "pointer-events: auto;"
}, [y("span", {
class: be.value
}, null)]), c.value && y("li", {
class: "f-btn-icon f-bare",
onClick: (f) => Z(f, !1),
style: "pointer-events: auto;"
}, [y("span", {
class: "f-icon modal_close"
}, null)])]);
}
const J = (f) => {
f.preventDefault();
const A = f.currentTarget, le = f.deltaY * 0.5;
A.scrollLeft += le;
};
function oe() {
return y("div", {
class: "modal-footer",
style: Pe.value
}, [N.value && y("div", {
class: "buttons",
onWheel: J
}, [N.value.map((f) => {
var ce;
const A = w(f.disabled), le = f.class || ((ce = f.appearance) == null ? void 0 : ce.class);
return y("button", {
name: f.name,
style: f.styles,
type: "button",
disabled: A.value,
class: le + (f.iconClass ? " btn-icontext" : "") + (f.visible === !1 ? "d-none" : ""),
onClick: (Fe) => {
he(f, Fe);
}
}, [!!f.iconClass && y("i", {
class: f.iconClass
}, null), f.text]);
})])]);
}
function de(f) {
d.value && ie();
}
function Ce() {
return y(yt, null, [B.value && y("div", {
class: "modal-header",
style: "position: absolute;background: transparent;height: 45px;width: 100%;",
onDblclick: (f) => de()
}, null), y("div", {
ref: X,
class: "modal-header",
style: ee.value,
onDblclick: (f) => de()
}, [t.slots.headerTemplate ? t.slots.headerTemplate() : y("div", {
class: "modal-title"
}, [H.value && y("span", {
class: u.value,
style: "margin-right: 8px"
}, null), y("span", {
class: "modal-title-label"
}, [T.value])]), y("div", {
class: "actions"
}, [U()])])]);
}
function Ee() {
return t.slots.footerTemplate ? t.slots.footerTemplate() : W.value && oe();
}
function Ae(f) {
if (f.stopPropagation(), e.allowClickMaskToClose) {
if (f.target !== _.value)
return;
Z(f, !1);
}
}
function E() {
var f, A;
return y("div", {
id: i.value,
class: p.value,
style: M.value,
ref: Q
}, [e.showFloatingClose && q(), y("div", {
class: re.value
}, [m.value && Ce(), y("div", {
class: xe.value
}, [(A = (f = t.slots).default) == null ? void 0 : A.call(f), b.value === "iframe" && y("iframe", {
title: i.value,
class: "f-utils-fill",
width: "100%",
frameborder: "0",
src: l.value
}, null)]), Ee()]), !a.value && Q.value && !B.value && Y(Q.value)]);
}
function O(f) {
return f || "body";
}
return Wn(() => {
Se.value && (k.value = Ut() || 1050);
}), () => y(Xn, {
to: O(e.host)
}, {
default: () => [Se.value && y(Yn, {
name: "fade",
appear: !0
}, {
default: () => [y("div", {
ref: _,
class: v.value,
style: S.value,
onClick: Ae
}, [E()])]
})]
});
}
});
function hn(e) {
if (e.content && e.content.render)
return e.content.render;
if (e.render && typeof e.render == "function")
return e.render;
}
function _r(e) {
const t = document.createElement("div");
t.style.display = "contents";
const n = Qn({
setup(o, r) {
fn(() => {
document.body.removeChild(t);
});
const i = w(), s = w(e.class || ""), a = w(!!e.showButtons), m = w(!!e.showHeader), u = w(e.showCloseButton == null ? !0 : e.showCloseButton), c = w(!!e.showFloatingClose), d = w(!0), C = w(e.title || ""), b = e.acceptCallback || (() => {
}), l = e.rejectCallback || (() => {
}), g = e.closedCallback || ((G) => {
}), h = e.resizeHandle || ((G) => {
}), T = e.stopMoveHandle || ((G) => {
}), R = hn(e), _ = (G) => {
d.value = !1, n.unmount(), g(G);
};
return Qe(() => {
}), r.expose({
modalRef: i
}), () => y(Je, {
ref: i,
class: s.value,
modelValue: d.value,
"onUpdate:modelValue": (G) => d.value = G,
title: C.value,
width: e.width,
height: e.height,
buttons: e.buttons,
"show-header": m.value,
"show-buttons": a.value,
"show-close-button": u.value,
"show-max-button": !1,
showFloatingClose: c.value,
onAccept: b,
onCancel: l,
fitContent: e.fitContent == null ? !0 : e.fitContent,
onClosed: _,
onResize: h,
onStopMove: T
}, {
default: () => [R && R(n)]
});
}
});
return document.body.appendChild(t), n.use(ct.i18n), n.mount(t), n;
}
class Ur {
// private activeModalInstance = computed(() => {
// return this.modalRefs[this.activeModalIndex.value];
// });
constructor(t) {
He(this, "appContext", null);
He(this, "modalRef", w());
He(this, "activeModalIndex", w(0));
He(this, "modalRefs", {});
He(this, "isUseEscCloseModal", w(!1));
this.app = t, this.appContext = t ? t._context : null;
}
getCurrentModal() {
return this.modalRefs[this.activeModalIndex.value];
}
adaptToWindow(t, n) {
const {
width: o,
height: r
} = {
width: window.innerWidth,
height: window.innerHeight
};
return o < t && (t = o - 14), r < n && (n = r - 14), {
width: t,
height: n
};
}
static show(t) {
const n = Object.assign({
title: "",
showButtons: !0,
showHeader: !0
}, t);
return _r(n);
}
close(t) {
var n, o;
t ? (o = t.value) == null || o.close() : (n = this.getCurrentModal()) == null || n.close();
}
open(t) {
const n = document.createDocumentFragment();
t.showMaxButton && t.fitContent && (t.showMaxButton = !1);
const o = Jn(Object.assign({
title: "",
showButtons: !0,
showHeader: !0,
maximized: !1
}, t)), r = w(!0), i = o.value.acceptCallback || (() => {
}), s = o.value.rejectCallback || (() => {
}), a = o.value.closedCallback || ((N, H) => {
}), m = o.value.openedCallback || ((N) => {
}), u = o.value.resizeHandle || ((N) => {
}), c = t.stopMoveHandle || ((N) => {
});
let d;
const C = hn(o.value), b = (N) => {
var W;
r.value = !1;
const H = (W = N == null ? void 0 : N.target) == null ? void 0 : W.classList.contains("modal_close");
a(N, this.isUseEscCloseModal.value ? "esc" : H ? "icon" : "button");
}, l = (N) => {
b(N), d && Ge(() => {
if (this.modalRefs[this.activeModalIndex.value] && delete this.modalRefs[this.activeModalIndex.value], Tt(null, n), d = null, this.modalRef.value = null, this.modalRefs) {
const H = Object.keys(this.modalRefs).map((W) => Number(W));
H.length > 0 ? this.activeModalIndex.value = Math.max(...H) : this.activeModalIndex.value = 0, this.modalRefs[this.activeModalIndex.value] && (this.modalRef.value = this.modalRefs[this.activeModalIndex.value]);
}
this.isUseEscCloseModal.value = !1;
});
}, g = (N) => {
var H;
this.isUseEscCloseModal.value = !0, (H = this.getCurrentModal()) == null || H.close(N == null ? void 0 : N.event);
}, {
width: h,
height: T
} = o.value, R = this.adaptToWindow(h || 500, T || 320);
Object.assign(o.value, R);
const _ = w(), G = () => y(Je, $t({
ref: _,
modelValue: r.value,
"onUpdate:modelValue": (N) => r.value = N
}, o.value, {
isMessager: o.value.class && o.value.class.indexOf("modal-message") > -1,
onAccept: i,
onCancel: s,
onClosed: l,
onResize: u,
onEsc: g,
onStopMove: c,
maximized: o.value.maximized
}), {
default: () => [C && C(this.app)]
});
d = ((N) => {
const H = gt(G, N);
return H.appContext = this.appContext, Tt(H, n), H;
})({
...o.value
// 'onUpdate:modelValue': onUpdateModelValue,
}), this.activeModalIndex.value++;
const Z = this.activeModalIndex.value;
this.modalRefs[Z] = _.value;
const F = (N) => {
o.value = {
...o.value,
...N
}, d && Tt(Gn(d, {
...o
}), n);
};
return Ge(() => {
this.modalRefs[Z] = _.value, this.modalRef.value = _.value, m(new Event("opened"));
}), {
update: F,
destroy: l,
modalRef: _,
close: () => {
var N;
(N = _.value) == null || N.close();
},
disableButtons: (N, H = !0) => {
var W;
(W = _.value) == null || W.disableButtons(N, H);
}
};
}
}
const Hr = Symbol("FModalService");
Je.install = (e) => {
e.component(Je.name, Je);
const t = new Ur(e);
e.provide(Hr, t), e.provide("FModalService", t);
};
const Vr = {
width: { type: String, default: "300px" },
height: { type: Number, default: 10 },
isWidePanel: { type: Boolean, default: !1 },
/** 是否启用搜索 */
enableSearch: { type: Boolean, default: !0 },
/** 使用模式 */
mode: { type: String, default: "panel" },
/** 是否持有面板的隐藏显示状态 */
isPersitOpenState: { type: Boolean, default: !1 },
/** isPersitOpenState=true时,控制面板是否隐藏显示 */
isShowPanel: { type: Boolean, default: !1 },
/** 属性名 */
propertyName: { type: String, default: "" },
/** 属性类型 */
propertyConfig: { type: Array },
/** 属性值 */
propertyData: { type: Object, default: {} },
/** 是否展示关闭按钮 */
showCloseBtn: { type: Boolean, default: !1 },
/** 当前选中的标签页id */
selectedTabId: { type: String, default: "" },
/** 是否是白色主题 */
isWhiteTheme: { type: Boolean, default: !0 },
/** dom结构 */
schema: { type: Object, default: {} },
/** 属性变更后事件 */
propertyChanged: { type: Function },
/** 允许折叠面板 */
allowCollapse: { type: Boolean, default: !0 }
};
function qr(e = {}) {
function t(u, c, d, C) {
if (typeof d == "number")
return C[u].length === d;
if (typeof d == "object") {
const b = Object.keys(d)[0], l = d[b];
if (b === "not")
return Number(C[u].length) !== Number(l);
if (b === "moreThan")
return Number(C[u].length) >= Number(l);
if (b === "lessThan")
return Number(C[u].length) <= Number(l);
}
return !1;
}
function n(u, c, d, C) {
return C[u] && C[u].propertyValue && String(C[u].propertyValue.value) === String(d);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", n]
]);
Object.keys(e).reduce((u, c) => (u.set(c, e[c]), u), o);
function r(u, c) {
const d = u;
return typeof c == "number" ? [{ target: d, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: d, operator: "getProperty", param: u, value: !!c }] : typeof c == "object" ? Object.keys(c).map((C) => {
if (C === "length")
return { target: d, operator: "length", param: null, value: c[C] };
const b = C, l = c[C];
return { target: d, operator: "getProperty", param: b, value: l };
}) : [];
}
function i(u) {
return Object.keys(u).reduce((d, C) => {
const b = r(C, u[C]);
return d.push(...b), d;
}, []);
}
function s(u, c) {
if (o.has(u.operator)) {
const d = o.get(u.operator);
return d && d(u.target, u.param, u.value, c) || !1;
}
return !1;
}
function a(u, c) {
return i(u).reduce((b, l) => b && s(l, c), !0);
}
function m(u, c) {
const d = Object.keys(u), C = d.includes("allOf"), b = d.includes("anyOf"), l = C || b, T = (l ? u[l ? C ? "allOf" : "anyOf" : "allOf"] : [u]).map((_) => a(_, c));
return C ? !T.includes(!1) : T.includes(!0);
}
return { parseValueSchema: m };
}
const Wr = {
convertTo: (e, t, n, o) => {
e.appearance || (e.appearance = {}), e.appearance[t] = n;
},
convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
}, Xr = {
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
}, Yr = {
convertTo: (e, t, n, o) => {
e.editor && (e.editor[t] = n);
},
convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
}, Jr = {
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: "标签页工具栏按钮" },
"drawer-toolbar-item": { type: "drawer-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: "标签页工具栏" },
"drawer-toolbar": { type: "drawer-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: "列表导航" },
nav: { type: "nav", name: "标签类导航" },
"list-view": { type: "list-view", name: "列表" },
"filter-bar": { type: "filter-bar", name: "筛选条" },
"language-textbox": { type: "language-textbox", name: "多语输入框" },
image: { type: "image", name: "图像" },
avatar: { type: "avatar", name: "头像" },
"discussion-editor": { type: "discussion-editor", name: "评论编辑区" },
"discussion-list": { type: "discussion-list", name: "评论列表" },
comment: { type: "comment", name: "评论区" },
"approval-logs": { type: "approval-logs", name: "审批记录" },
"rich-text-editor": { type: "rich-text-editor", name: "富文本", icon: "rich-text-box" },
calendar: { type: "calendar", name: "日历", icon: "date-picker" },
wizard: { type: "wizard", name: "向导", icon: "wizard" },
"wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" },
"wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" },
step: { type: "step", name: "步骤条", icon: "step" },
"dynamic-form": { type: "dynamic-form", name: "动态表单" }
}, Gr = {
convertFrom: (e, t, n) => {
var r;
const o = e.editor && e.editor[t] ? e.editor[t] : e[t];
return ((r = Jr[o]) == null ? void 0 : r.name) || o;
}
}, Qr = {
convertTo: (e, t, n, o) => {
e[t] = e[t];
},
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
}, Zr = {
convertTo: (e, t, n, o) => {
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = {
[t]: n
});
},
convertFrom: (e, t, n) => {
if (e.formatter) {
if (t === "trueText")
return e.formatter.trueText;
if (t === "falseText")
return e.formatter.falseText;
if (t === "prefix")
return e.formatter.prefix;
if (t === "suffix")
return e.formatter.suffix;
if (t === "precision")
return e.formatter.precision;
if (t === "decimal")
return e.formatter.decimal;
if (t === "thousand")
return e.formatter.thousand;
if (t === "dateFormat")
return e.formatter.dateFormat || "yyyy-MM-dd";
if (t === "customFormat")
return e.formatter.customFormat;
if (t === "type")
return e.formatter.type || "none";
}
return "none";
}
}, Kr = {
convertTo: (e, t, n, o) => {
e.command ? e.command[t] = n : e.command = {
[t]: n
}, t === "enableType" && n === "default" && (e.command.enable = !0, e.command.formatter = "", e.command.commands = [
{
text: "编辑",
type: "primary",
command: "edit"
},
{
text: "删除",
type: "danger",
command: "remove"
}
]), t === "enableType" && n === "custom" && (e.command.enable = !0, e.command.commands = [
{
value: "add",
text: "增加",
type: "link"
},
{
value: "edit",
text: "编辑",
type: "link"
},
{
value: "remove",
text: "删除",
type: "link"
}
]), t === "enableType" && n === "unable" && (e.command.enable = !1, e.command.formatter = "");
},
convertFrom: (e, t, n) => {
var o, r;
if (e.command) {
if (t === "enableType") {
if (e.command.enableType)
return e.command.enableType;
const i = (r = (o = e.command) == null ? void 0 : o.commands) == null ? void 0 : r.find((s) => s.command === "edit" && s.type === "primary");
return e.command.enable ? i ? "default" : "custom" : "unable";
}
if (t === "commands")
return e.command.enableType === "custom" ? e.command.commands : [];
if (t === "formatter")
return e.command.formatter;
if (t === "count")
return e.command.count;
if (t === "columnWidth")
return e.command.columnWidth || 200;
}
return "";
}
}, es = {
convertTo: (e, t, n, o) => {
e.column ? e.column[t] = n : e.column = {
[t]: n
}, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average"));
},
convertFrom: (e, t, n) => {
if (e.column) {
if (t === "fitColumns")
return e.column.fitColumns;
if (t === "fitMode")
return e.column.fitMode;
}
return "";
}
}, ts = {
convertTo: (e, t, n, o) => {
e.summary ? e.summary[t] = n : e.summary = {
[t]: n
}, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
enable: n,
groupFields: []
});
},
convertFrom: (e, t, n) => {
var o, r;
return t === "customSummaryStyle" ? e.summary.customSummaryStyle : t === "position" ? ((o = e.summary) == null ? void 0 : o[t]) || "bottom" : t === "customRender" ? ((r = e.summary) == null ? void 0 : r[t]) || "" : e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : "";
}
}, ns = {
convertTo: (e, t, n, o) => {
e.group ? e.group[t] = n : e.group = {
[t]: n
}, t === "enable" && n && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = {
enable: n,
groupFields: [],
showSummary: !1,
customRender: ""
});
},
convertFrom: (e, t, n) => {
if (e.group) {
if (t === "enable")
return e.group.enable;
if (t === "showSummary")
return e.group.showSummary;
if (t === "customRender")
return e.group.customRender;
if (t === "groupFields")
return e.group.groupFields;
}
}
}, os = {
convertFrom: (e, t) => e.binding ? e.binding.path : "",
convertTo: (e, t, n) => {
if (n && n.length > 0) {
const o = n[0];
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = o.bindingField, e.binding.field = o.id, e.binding.fullPath = o.path, e.path = o.bindingPath;
}
}
}