@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,618 lines • 454 kB
JavaScript
var Jo = Object.defineProperty;
var Ko = (e, t, n) => t in e ? Jo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var Z = (e, t, n) => Ko(e, typeof t != "symbol" ? t + "" : t, n);
import { defineComponent as _e, ref as C, computed as $, createVNode as E, Teleport as Rn, createApp as gn, onUnmounted as wt, Fragment as Mt, watch as re, onBeforeMount as Qo, onMounted as je, Transition as $n, shallowRef as Zo, nextTick as Et, render as an, h as ei, cloneVNode as ti, mergeProps as ht, inject as Ce, reactive as Ne, createTextVNode as qe, onBeforeUnmount as jn, withDirectives as yn, resolveDirective as An, provide as Ct, triggerRef as ni, isVNode as zn, toRaw as oi, vModelCheckbox as ii } from "vue";
import { isPlainObject as En, cloneDeep as ft, isUndefined as Bn, isNaN as ai, flatten as li, throttle as ri, isEmpty as si } from "lodash-es";
import { resolveAppearance as ui, createPropsResolver as ci } from "../dynamic-resolver/index.esm.js";
import { useDesignerComponent as Hn, DgControl as Mn } from "../designer-canvas/index.esm.js";
import { useDateFormat as di, useNumberFormat as fi, resolveField as Ke, setFieldValue as un, getCustomClass as ln, withInstall as Wn, FormSchemaEntityField$Type as Ln, FormSchemaEntityFieldType$Type as pi, encrypt as mi } from "../common/index.esm.js";
import { useResizeObserver as Gn } from "@vueuse/core";
import { useIdentify as hi, useGroupData as vi, useFilter as gi, useHierarchy as yi, useLoading as bi, useDataView as Ci, useSelection as wi, useSelectHierarchyItem as Si, useDataViewContainerStyle as Ti, useCommandColumn as Fi, useColumn as _i, useSort as xi, useGroupColumn as Ii, useRow as ki, useEdit as Oi, useVisualDataBound as Ei, useVisualDataCell as Bi, useVisualDataRow as Mi, useVisualData as Li, useCellPosition as Di, useSidebar as Pi, useVirtualScroll as Vi, useFitColumn as Ni, useFilterHistory as Ri, useColumnFilter as $i, useDragColumn as ji, getColumnHeader as Ai, getSidebar as zi, getDisableMask as Hi, getHorizontalScrollbar as Wi, getVerticalScrollbar as Gi, getEmpty as qi } from "../data-view/index.esm.js";
import { F_MODAL_SERVICE_TOKEN as Ui } from "../modal/index.esm.js";
import Yi from "../transfer/index.esm.js";
import Xi from "../tabs/index.esm.js";
import Ji from "../order/index.esm.js";
import "../condition/index.esm.js";
import Ki, { FCheckbox as Qi } from "../checkbox/index.esm.js";
import Zi from "../filter-bar/index.esm.js";
import Dn from "../tooltip/index.esm.js";
import ea from "../pagination/index.esm.js";
import ta from "../button/index.esm.js";
import na from "../search-box/index.esm.js";
import oa from "../tags/index.esm.js";
import ia, { FDynamicFormGroup as aa, FDynamicFormInput as la } from "../dynamic-form/index.esm.js";
import ra from "../binding-selector/index.esm.js";
import { F_NOTIFY_SERVICE_TOKEN as qn } from "../notify/index.esm.js";
import sa from "../accordion/index.esm.js";
import ua from "../avatar/index.esm.js";
import Un, { FButtonEdit as Yn } from "../button-edit/index.esm.js";
import ca from "../button-group/index.esm.js";
import da from "../calendar/index.esm.js";
import fa from "../capsule/index.esm.js";
import pa from "../color-picker/index.esm.js";
import cn from "../combo-list/index.esm.js";
import ma from "../content-container/index.esm.js";
import ha, { FDataGrid as Kt } from "../data-grid/index.esm.js";
import va from "../date-picker/index.esm.js";
import ga from "../dropdown/index.esm.js";
import "../external-container/index.esm.js";
import ya from "../events-editor/index.esm.js";
import ba from "../image-cropper/index.esm.js";
import Ca from "../input-group/index.esm.js";
import wa from "../layout/index.esm.js";
import Sa from "../list-nav/index.esm.js";
import Xn from "../list-view/index.esm.js";
import Ta from "../lookup/index.esm.js";
import Fa from "../nav/index.esm.js";
import _a from "../number-spinner/index.esm.js";
import xa from "../number-range/index.esm.js";
import Ia from "../page-header/index.esm.js";
import ka from "../page-footer/index.esm.js";
import Oa from "../progress/index.esm.js";
import Ea from "../query-solution/index.esm.js";
import Ba from "../radio-group/index.esm.js";
import Ma from "../rate/index.esm.js";
import La from "../response-toolbar/index.esm.js";
import Da from "../response-layout/index.esm.js";
import Pa from "../response-layout-editor/index.esm.js";
import Va from "../section/index.esm.js";
import Na from "../smoke-detector/index.esm.js";
import Ra from "../splitter/index.esm.js";
import $a from "../step/index.esm.js";
import ja from "../switch/index.esm.js";
import Aa from "../text/index.esm.js";
import za from "../time-picker/index.esm.js";
import Ha from "../tree-view/index.esm.js";
import Wa from "../uploader/index.esm.js";
import Ga from "../verify-detail/index.esm.js";
import qa from "../component/index.esm.js";
import Ua from "../video/index.esm.js";
import Ya from "../textarea/index.esm.js";
import Xa, { FTreeGrid as bn } from "../tree-grid/index.esm.js";
import Ja from "../fieldset/index.esm.js";
import Ka from "../drawer/index.esm.js";
import Qa from "../combo-tree/index.esm.js";
import Za from "../field-selector/index.esm.js";
import el from "../mapping-editor/index.esm.js";
import tl from "../schema-selector/index.esm.js";
import nl from "../event-parameter/index.esm.js";
import ol from "../filter-condition-editor/index.esm.js";
import il from "../sort-condition-editor/index.esm.js";
import al from "../menu-lookup/index.esm.js";
import ll from "../popover/index.esm.js";
import "bignumber.js";
const Jn = {}, Kn = {};
function Cn(e) {
const { properties: t, title: n, ignore: o } = e, i = o && Array.isArray(o), a = Object.keys(t).reduce((l, r) => ((!i || !o.find((u) => u === r)) && (l[r] = t[r].type === "object" && t[r].properties ? Cn(t[r]) : ft(t[r].default)), l), {});
if (n && (!i || !o.find((l) => l === "id"))) {
const l = n.toLowerCase().replace(/-/g, "_");
a.id = `${l}_${Math.random().toString().slice(2, 6)}`;
}
return a;
}
function rl(e) {
const { properties: t, title: n, required: o } = e;
if (o && Array.isArray(o)) {
const i = o.reduce((a, l) => (a[l] = t[l].type === "object" && t[l].properties ? Cn(t[l]) : ft(t[l].default), a), {});
if (n && o.find((a) => a === "id")) {
const a = n.toLowerCase().replace(/-/g, "_");
i.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return i;
}
return {
type: n
};
}
function Qn(e, t = {}, n) {
const o = Jn[e];
if (o) {
let i = rl(o);
const a = Kn[e];
return i = a ? a({ getSchemaByType: Qn }, i, t, n) : i, i;
}
return null;
}
function sl(e, t) {
const n = Cn(t);
return Object.keys(n).reduce((o, i) => (Object.prototype.hasOwnProperty.call(e, i) && (o[i] && En(o[i]) && En(e[i] || !e[i]) ? Object.assign(o[i], e[i] || {}) : o[i] = e[i]), o), n), n;
}
function Zn(e, t) {
return Object.keys(e).filter((o) => e[o] != null).reduce((o, i) => {
if (t.has(i)) {
const a = t.get(i);
if (typeof a == "string")
o[a] = e[i];
else {
const l = a(i, e[i], e);
Object.assign(o, l);
}
} else
o[i] = e[i];
return o;
}, {});
}
function ul(e, t, n = /* @__PURE__ */ new Map()) {
const o = sl(e, t);
return Zn(o, n);
}
function cl(e = {}) {
function t(m, d, s, f) {
if (typeof s == "number")
return f[m].length === s;
if (typeof s == "object") {
const b = Object.keys(s)[0], p = s[b];
if (b === "not")
return Number(f[m].length) !== Number(p);
if (b === "moreThan")
return Number(f[m].length) >= Number(p);
if (b === "lessThan")
return Number(f[m].length) <= Number(p);
}
return !1;
}
function n(m, d, s, f) {
return f[m] && f[m].propertyValue && String(f[m].propertyValue.value) === String(s);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", n]
]);
Object.keys(e).reduce((m, d) => (m.set(d, e[d]), m), o);
function i(m, d) {
const s = m;
return typeof d == "number" ? [{ target: s, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: s, operator: "getProperty", param: m, value: !!d }] : typeof d == "object" ? Object.keys(d).map((f) => {
if (f === "length")
return { target: s, operator: "length", param: null, value: d[f] };
const b = f, p = d[f];
return { target: s, operator: "getProperty", param: b, value: p };
}) : [];
}
function a(m) {
return Object.keys(m).reduce((s, f) => {
const b = i(f, m[f]);
return s.push(...b), s;
}, []);
}
function l(m, d) {
if (o.has(m.operator)) {
const s = o.get(m.operator);
return s && s(m.target, m.param, m.value, d) || !1;
}
return !1;
}
function r(m, d) {
return a(m).reduce((b, p) => b && l(p, d), !0);
}
function u(m, d) {
const s = Object.keys(m), f = s.includes("allOf"), b = s.includes("anyOf"), p = f || b, h = (p ? m[p ? f ? "allOf" : "anyOf" : "allOf"] : [m]).map((S) => r(S, d));
return f ? !h.includes(!1) : h.includes(!0);
}
return { parseValueSchema: u };
}
const ae = {
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: "抽屉" }
}, dl = {}, fl = {};
cl();
function Qe(e, t, n = /* @__PURE__ */ new Map(), o = (l, r, u, m) => r, i = {}, a = (l) => l) {
return Jn[t.title] = t, Kn[t.title] = o, dl[t.title] = i, fl[t.title] = a, (l = {}, r = !0) => {
if (!r)
return Zn(l, n);
const u = ul(l, t, n), m = Object.keys(e).reduce((d, s) => (d[s] = e[s].default, d), {});
return Object.assign(m, u);
};
}
function kt(e, t) {
return { customClass: t.class, customStyle: t.style };
}
function pl() {
function e(t, n) {
const { dataSource: o } = t || {};
return o === void 0 ? {} : {};
}
return {
resolve: e
};
}
function ml() {
function e(t, n) {
return t.selectItemById(n);
}
return {
selectItemById: e
};
}
function hl() {
function e(t, n) {
const { columns: o } = n;
return t.updateColumns(o);
}
return {
updateColumns: e
};
}
const vl = /* @__PURE__ */ new Map([
["appearance", ui]
]);
function gl(e, t, n) {
return t;
}
const yl = "https://json-schema.org/draft/2020-12/schema", bl = "https://farris-design.gitee.io/button-edit.schema.json", Cl = "button-edit", wl = "A Farris Input Component", Sl = "object", Tl = {
id: {
description: "The unique identifier for a Input Group",
type: "string"
},
type: {
description: "The type string of Input Group component",
type: "string",
default: "button-edit"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
disable: {
type: "string",
default: !1
},
editable: {
description: "",
type: "boolean",
default: !0
},
enableLinkLabel: {
description: "",
type: "boolean",
default: !1
},
label: {
description: "",
type: "string",
default: ""
},
lableWidth: {
description: "",
type: "number"
},
placeholder: {
description: "",
type: "string",
default: ""
},
forcePlaceholder: {
description: "",
type: "boolean",
default: !1
},
readonly: {
description: "",
type: "boolean",
default: !1
},
require: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
textAlign: {
description: "",
type: "string",
enum: [
"left",
"middle",
"right"
],
default: "left"
},
visible: {
description: "",
type: "boolean",
default: !0
},
onBlur: {
description: "",
type: "string",
default: ""
},
onClickLinkLabel: {
description: "",
type: "sting",
default: ""
},
autoComplete: {
description: "",
type: "boolean",
default: !1
},
buttonContent: {
description: "",
type: "string",
default: ""
},
enableClear: {
description: "",
type: "boolean",
default: !0
},
inputType: {
description: "",
type: "string",
enum: [
"text",
"tag"
],
default: "text"
},
multiSelect: {
description: "",
type: "boolean",
default: !1
},
popup: {
description: "",
type: "object",
properties: {
footerButtons: {
type: "array",
default: []
},
height: {
type: "number",
default: 600
},
dataMapping: {
type: "object"
},
contents: {
type: "array",
default: []
},
showMaxButton: {
type: "boolean",
default: !0
},
showCloseButton: {
type: "boolean",
default: !0
},
showFooter: {
type: "boolean",
default: !0
},
title: {
type: "string",
default: ""
},
width: {
type: "number",
default: 800
}
}
},
popupClass: {
description: "",
type: "sting",
default: ""
},
separator: {
type: "string",
default: ","
},
showButtonWhenDisabled: {
description: "",
type: "boolean",
default: !1
},
wrapText: {
type: "boolean",
default: !1
},
onClear: {
description: "",
type: "string",
default: ""
}
}, Fl = [
"id",
"type"
], _l = {
$schema: yl,
$id: bl,
title: Cl,
description: wl,
type: Sl,
properties: Tl,
required: Fl
}, xl = "buttonEdit", Il = "A Farris Component", kl = "object", Ol = {
basic: {
description: "Basic Infomation",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "waiting for modification",
enum: []
}
}
}
},
behavior: {
description: "Basic Infomation",
title: "行为",
properties: {
editable: {
description: "",
title: "允许编辑",
type: "boolean"
},
readonly: {
description: "",
title: "只读",
type: "string"
},
required: {
description: "",
title: "必填",
type: "boolean"
},
visible: {
description: "",
title: "可见",
type: "boolean"
},
placeholder: {
description: "",
title: "提示文本",
type: "string"
},
tabindex: {
description: "",
title: "tab索引",
type: "number"
},
textAlign: {
description: "",
title: "对齐方式",
type: "enum",
editor: {
type: "combo-list",
textField: "name",
valueField: "value",
data: [
{
value: "left",
name: "左对齐"
},
{
value: "center",
name: "居中"
},
{
value: "right",
name: "右对齐"
}
]
}
}
}
}
}, El = {
title: xl,
description: Il,
type: kl,
categories: Ol
}, eo = {
/**
* 组件标识
*/
id: String,
/**
* 扩展按钮显示内容,这是一段现在扩展按钮中的html标签
*/
buttonContent: { type: String, default: '<i class="f-icon f-icon-lookup"></i>' },
buttonBehavior: { type: String, default: "Popup" },
/**
* 启用输入框自动完成功能
*/
autoComplete: { type: Boolean, default: !1 },
/**
* 组件自定义样式
*/
customClass: { type: String, default: "" },
/**
* 禁用组件,既不允许在输入框中录入,也不允许点击扩展按钮。
*/
disable: { type: Boolean, default: !1 },
/**
* 允许在输入框中录入文本。
*/
editable: { type: Boolean, default: !0 },
/**
* 显示清空文本按钮
*/
enableClear: { type: Boolean, default: !1 },
/**
* 组件值
*/
modelValue: { type: String, default: "" },
/**
* 将组件设置为只读,既不允许在输入框中录入,也不允许点击扩展按钮,但是允许复制输入框中的内容。
*/
readonly: { type: Boolean, default: !1 },
/**
* 禁用组件时,是否显示扩展按钮
*/
showButtonWhenDisabled: { type: Boolean, default: !1 },
/**
* 显示输入框的标签
*/
enableTitle: { type: Boolean, default: !1 },
/**
* 输入框类型
*/
inputType: { type: String, default: "text" },
/**
* 显示输入框提示信息
*/
forcePlaceholder: { type: Boolean, default: !1 },
/**
* 输入框提示文本
*/
placeholder: { type: String, default: "" },
/**
* 输入框最小长度
*/
minLength: Number,
/**
* 输入框最大长度
*/
maxLength: Number,
/**
* 输入框Tab键索引
*/
tabIndex: Number,
popupHost: { type: Object },
popupRightBoundary: { type: Object },
popupOffsetX: { type: Object },
popupOnInput: { type: Boolean, default: !1 },
popupOnFocus: { type: Boolean, default: !1 },
popupOnClick: { type: Boolean, default: !1 },
/**
* 样式追加到弹出窗口
*/
popupClass: { type: String, default: "" },
popupMinWidth: { type: Number, default: 160 },
modalOptions: { type: Object, default: {} },
wrapText: { type: Boolean, default: !1 },
/**
* 可选,是否支持多选
* 默认`false`
*/
multiSelect: { type: Boolean, default: !1 },
/**
* 可选,分隔符
* 默认`,`
*/
separator: { type: String, default: "," },
/** 对齐方式 */
textAlign: { type: String, default: "left" },
/**
* 废弃
*/
beforeClickButton: { type: Function, default: null },
/**
* 作为内嵌编辑器被创建后默认获得焦点
*/
focusOnCreated: { type: Boolean, default: !1 },
/**
* 作为内嵌编辑器被创建后默认选中文本
*/
selectOnCreated: { type: Boolean, default: !1 },
/**
* 打开前
*/
beforeOpen: { type: Function, default: null },
/** 更新方式 blur | change */
updateOn: { type: String, default: "change" },
keepWidthWithReference: { type: Boolean, default: !0 },
placement: { type: String, default: "bottom-left" },
preventScroll: { type: Boolean, default: !1 }
};
Qe(eo, _l, vl, gl, El);
const Bl = {
popupContentPosition: { type: Object, default: { left: 0, top: 0 } },
host: { type: Object },
backgroundColor: { type: String, default: "" }
}, Ml = /* @__PURE__ */ _e({
name: "FOverlay",
props: Bl,
emits: ["click"],
setup(e, t) {
const n = C(e.popupContentPosition), o = C(e.host), i = $(() => ({
backgroundColor: e.backgroundColor || "",
pointerEvents: "auto"
}));
function a(r) {
t.emit("click"), r.preventDefault(), r.stopPropagation();
}
$(() => {
const r = o.value;
if (r) {
const u = r.getBoundingClientRect(), {
left: m,
top: d,
height: s
} = u;
return {
left: m,
top: d + s
};
}
return n.value;
});
const l = $(() => ({
// position: 'relative',
// left: `${position.value.left}px`,
// top: `${position.value.top}px`
}));
return () => E(Rn, {
to: "body"
}, {
default: () => {
var r, u;
return [E("div", {
class: "overlay-container",
onClick: (m) => a(m),
style: i.value
}, [E("div", {
style: l.value
}, [(u = (r = t.slots).default) == null ? void 0 : u.call(r)])])];
}
});
}
});
function Ll(e) {
if (e.content && e.content.render)
return e.content.render;
if (e.render && typeof e.render == "function")
return e.render;
}
function Dl(e) {
const t = document.createElement("div");
t.style.display = "contents";
let n;
const o = e.onClickCallback || (() => {
}), i = () => {
o(), n && n.unmount();
};
return n = gn({
setup() {
wt(() => {
document.body.removeChild(t);
});
const a = Ll(e);
return () => E(Ml, {
"popup-content-position": e.popupPosition,
host: e.host,
onClick: i,
backgroundColor: e.backgroundColor
}, {
default: () => [a && a()]
});
}
}), document.body.appendChild(t), n.mount(t), n;
}
class Pl {
static show(t) {
return Dl(t);
}
}
const Vl = {
/**
* 自定义类
*/
class: { 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 },
/**
* 是否展示头部
*/
showHeader: { type: Boolean, default: !0 },
/**
* 是否展示默认按钮
*/
showButtons: { type: Boolean, default: !0 },
/**
* 是否启用自适应样式
*/
fitContent: { type: Boolean, default: !0 },
/**
* 是否展示右上角按钮
*/
showCloseButton: { type: Boolean, default: !0 },
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 },
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 }
};
class Pe {
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 i = parseInt(o[4], 10), a = parseInt(o[5], 10);
return { x: i, y: a };
}
return { x: 0, y: 0 };
}
static fromEvent(t, n = null) {
if (this.isMouseEvent(t))
return new Pe(t.clientX, t.clientY);
if (n === null || t.changedTouches.length === 1)
return new Pe(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 Pe(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 Pe(0, 0);
if (window) {
const o = window.getComputedStyle(t);
if (o) {
const i = parseInt(o.getPropertyValue("left"), 10), a = parseInt(o.getPropertyValue("top"), 10);
n.x = isNaN(i) ? 0 : i, n.y = isNaN(a) ? 0 : a;
}
return n;
}
return null;
}
static copy(t) {
return new Pe(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 Ft {
constructor(t, n) {
this.width = t, this.height = n;
}
static getCurrent(t) {
const n = new Ft(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 Ft(0, 0).set(t);
}
set(t) {
return this.width = t.width, this.height = t.height, this;
}
}
function Nl(e, t) {
const n = C(), o = C(), i = C(), a = C(), l = C(), r = C(), u = C(), m = C(), d = C(), s = C(), f = C(), b = C(), p = C(e.draggable), _ = C(!1);
function v() {
const B = o.value || document.body, D = window.getComputedStyle(B);
if (!D || !n.value)
return;
const R = Pe.getTransformInfo(n.value), G = {};
u.value && (G.deltaL = n.value.offsetLeft - u.value.x, G.deltaT = n.value.offsetTop - u.value.y);
const U = D.getPropertyValue("position");
G.width = B.clientWidth, G.height = B.clientHeight, G.pr = parseInt(D.getPropertyValue("padding-right"), 10), G.pb = parseInt(D.getPropertyValue("padding-bottom"), 10), G.position = D.getPropertyValue("position"), U === "static" && (B.style.position = "relative"), G.translateX = R.x, G.translateY = R.y, s.value = G;
}
function h(B) {
if (n.value) {
a.value = Ft.getCurrent(n.value), l.value = Pe.getCurrent(n.value), r.value = a.value ? Ft.copy(a.value) : null, u.value = l.value ? Pe.copy(l.value) : null, v();
const D = B.target.getAttribute("type") || "";
m.value = {
n: !!D.match(/n/),
s: !!D.match(/s/),
w: !!D.match(/w/),
e: !!D.match(/e/)
};
}
}
function g() {
var B, D, R, G;
if (n.value) {
const U = n.value;
m.value && ((m.value.n || m.value.s) && ((B = r.value) != null && B.height) && (U.style.height = r.value.height + "px"), (m.value.w || m.value.e) && ((D = r.value) != null && D.width) && (U.style.width = r.value.width + "px"), u.value && ((R = u.value) != null && R.x && (U.style.left = u.value.x + "px"), (G = u.value) != null && G.y && (U.style.top = u.value.y + "px")));
}
}
function S() {
const B = e.minHeight ? e.minHeight : 1, D = e.minWidth ? e.minWidth : 1;
r.value && u.value && m.value && a.value && (r.value.height < B && (r.value.height = B, m.value.n && l.value && (u.value.y = l.value.y + (a.value.height - B))), r.value.width < D && (r.value.width = D, m.value.w && l.value && (u.value.x = l.value.x + (a.value.width - D))), e.maxHeight && r.value.height > e.maxHeight && (r.value.height = e.maxHeight, l.value && m.value.n && (u.value.y = l.value.y + (a.value.height - e.maxHeight))), e.maxWidth && r.value.width > e.maxWidth && (r.value.width = e.maxWidth, m.value.w && l.value && (u.value.x = l.value.x + (a.value.width - e.maxWidth))));
}
function y() {
if (o.value) {
const B = s.value;
if (u.value && r.value && m.value && a.value) {
const D = B.width - B.pr - B.deltaL - B.translateX - u.value.x, R = B.height - B.pb - B.deltaT - B.translateY - u.value.y;
m.value.n && u.value.y + B.translateY < 0 && l.value && (u.value.y = -B.translateY, r.value.height = a.value.height + l.value.y + B.translateY), m.value.w && u.value.x + B.translateX < 0 && l.value && (u.value.x = -B.translateX, r.value.width = a.value.width + l.value.x + B.translateX), r.value.width > D && (r.value.width = D), r.value.height > R && (r.value.height = R);
}
}
}
function w(B) {
if (!i.value || !a.value || !l.value || !m.value)
return;
B.subtract(i.value);
const D = B.x, R = B.y;
m.value.n ? (u.value.y = l.value.y + R, r.value.height = a.value.height - R) : m.value.s && (r.value.height = a.value.height + R), m.value.e ? r.value.width = a.value.width + D : m.value.w && (r.value.width = a.value.width - D, u.value.x = l.value.x + D), y(), S(), g();
}
function x(B) {
if (!d.value)
return;
const D = Pe.fromEvent(B);
D && w(D);
}
function c() {
if (n.value) {
const {
width: B,
height: D,
x: R,
y: G
} = n.value.getBoundingClientRect(), U = Pe.getTransformInfo(n.value);
return {
size: {
width: B,
height: D
},
position: {
x: R - U.x,
y: G - U.y
}
};
}
return null;
}
function T(B) {
if (n.value) {
const D = c();
f.value = D;
}
i.value = void 0, a.value = null, l.value = null, r.value = null, u.value = null, m.value = null, d.value = null, document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", T);
}
function F() {
document.addEventListener("mousemove", x), document.addEventListener("mouseup", T);
}
function O(B) {
B instanceof MouseEvent && B.button === 2 || p.value && (document.body.click(), B.stopPropagation(), B.preventDefault(), i.value = Pe.fromEvent(B), d.value = B.target, h(B), F());
}
function k(B) {
return n.value = B, E(Mt, null, [E("div", {
class: "fv-resizable-handle fv-resizable-n",
type: "n",
onMousedown: (D) => O(D)
}, null), E("div", {
class: "fv-resizable-handle fv-resizable-e",
type: "e",
onMousedown: (D) => O(D)
}, null), E("div", {
class: "fv-resizable-handle fv-resizable-s",
type: "s",
onMousedown: (D) => O(D)
}, null), E("div", {
class: "fv-resizable-handle fv-resizable-w",
type: "w",
onMousedown: (D) => O(D)
}, null), E("div", {
class: "fv-resizable-handle fv-resizable-ne",
type: "ne",
onMousedown: (D) => O(D)
}, null), E("div", {
class: "fv-resizable-handle fv-resizable-se fv-resizable-diagonal",
type: "se",
onMousedown: (D) => O(D)
}, null), E("div", {
class: "fv-resizable-handle fv-resizable-sw",
type: "sw",
onMousedown: (D) => O(D)
}, null), E("div", {
class: "fv-resizable-handle fv-resizable-nw",
type: "nw",
onMousedown: (D) => O(D)
}, null)]);
}
function L(B = !0) {
document.body.click();
const D = o.value || document.body, R = Ft.getCurrent(D), G = n.value;
B && G && (b.value = c(), b.value.transform = G.style.transform), R && G && (r.value = R, G.style.height = r.value.height - 14 + "px", G.style.width = r.value.width - 14 + "px", G.style.left = "7px", G.style.top = "7px", G.style.transform = "", f.value = {
size: r.value,
position: {
x: 0,
y: 0
}
}, p.value = !1, _.value = !0);
}
function V() {
var B, D;
if (document.body.click(), b.value) {
const R = {
width: b.value.size.width || 0,
height: b.value.size.height || 0
}, G = {
x: (window.innerWidth - R.width) / 2,
y: (window.innerHeight - R.height) / 2
};
(B = r.value) == null || B.set(R), (D = u.value) == null || D.set(G);
const U = n.value;
U.style.height = R.height + "px", U.style.width = R.width + "px", U.style.left = `${G.x}px`, U.style.top = `${G.y}px`, U.style.transform = "", f.value = {
size: R,
position: G
}, p.value = e.draggable, _.value = !1;
}
}
function P() {
if (n.value) {
const B = Ft.getCurrent(n.value);
if (B) {
const {
width: D,
height: R
} = B;
n.value.style.left = `${(window.innerWidth - D) / 2}px`, n.value.style.top = `${(window.innerHeight - R) / 2}px`, n.value.style.transform = "";
}
}
}
function M() {
const B = () => {
_.value ? L(!1) : P(), document.body.click();
};
return window.addEventListener("resize", B), () => {
window.removeEventListener("resize", B);
};
}
const I = M();
return {
renderResizeBar: k,
boundingElement: o,
resizedEventParam: f,
maximize: L,
restore: V,
allowDrag: p,
isMaximized: _,
unWindowResizeHandle: I
};
}
function Rl(e, t, n) {
const o = C(), i = C(e.draggable), a = C(e.lockAxis), l = C(), r = C(), u = C(!1), m = C(new Pe(0, 0)), d = C(new Pe(0, 0)), s = C(new Pe(0, 0)), f = C(new Pe(0, 0));
re(() => n.value, (c) => {
l.value.style.cursor = c ? "move" : "default";
});
function b(c, T) {
if (T.tagName === "BUTTON")
return !1;
if (T === c)
return !0;
for (const F in T.children)
if (Object.prototype.hasOwnProperty.call(T.children, F) && b(c, T.children[F]))
return !0;
return !1;
}
function p() {
var O, k;
let c = s.value.x + d.value.x, T = s.value.y + d.value.y;
a.value === "x" ? (c = ((O = m.value) == null ? void 0 : O.x) || 0, s.value.x = 0) : a.value === "y" && (T = ((k = m.value) == null ? void 0 : k.y) || 0, s.value.y = 0);
const F = `translate3d(${Math.round(c)}px, ${Math.round(T)}px, 0px)`;
o.value && (o.value.style.transform = F), f.value.x = c, f.value.y = T;
}
function _() {
if (!r.value || !o.value)
return null;
const c = r.value.getBoundingClientRect(), T = o.value.getBoundingClientRect(), F = {
top: c.top < T.top,
right: c.right > T.right,
bottom: c.bottom > T.bottom,
left: c.left < T.left
};
return F.top || (s.value.y -= T.top - c.top), F.bottom || (s.value.y -= T.bottom - c.bottom), F.right || (s.value.x -= T.right - c.right), F.left || (s.value.x -= T.left - c.left), p(), F;
}
function v(c) {
c && (m.value && c.subtract(m.value), s.value.set(c), p(), _());
}
function h(c) {
u.value && i.value && (c.stopPropagation(), c.preventDefault(), v(Pe.fromEvent(c, l.value)));
}
function g() {
var c;
u.value && (u.value = !1, d.value.add(s.value), s.value.reset(), (c = o.value) == null || c.classList.remove("ng-dragging"), document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", g));
}
function S() {
!u.value && l.value && (u.value = !0, l.value.classList.add("ng-dragging"), document.addEventListener("mousemove", h), document.addEventListener("mouseup", g));
}
function y() {
if (o.value) {
const c = Pe.getTransformInfo(o.value);
d.value.set(c);
return;
}
d.value.reset();
}
function w(c) {
if (!n.value || c instanceof MouseEvent && c.button === 2)
return;
const T = c.target || c.srcElement;
l.value !== void 0 && T && !b(T, l.value) || i.value !== !1 && (document.body.click(), c.stopPropagation(), c.preventDefault(), m.value = Pe.fromEvent(c, o.value), y(), S());
}
function x(c, T, F) {
if (i.value && T) {
if (c)
l.value = c;
else if (e.dragHandle) {
if (e.dragHandle instanceof HTMLElement)
l.value = e.dragHandle;
else if (typeof e.dragHandle == "string") {
const O = T.querySelector(e.dragHandle);
O && (l.value = O);
}
}
o.value = T, r.value = F, l.value ? (l.value.classList.add("ng-draggable"), l.value.addEventListener("mousedown", w)) : i.value = !1;
}
}
return {
registerDraggle: x,
resetTranslate: y
};
}
function to(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 $l(e, t) {
const n = C(e.enableEsc);
let o = null;
return n.value ? (o = to("Escape", (i) => {
t.emit("esc", { event: i.event, type: "esc" });
}), {
remove: o
}) : null;
}
function jl(e, t) {
const n = C(e.enableEnter);
let o = null;
return n.value ? (o = to("Enter", (i) => {
t.emit("enter", { event: i.event, type: "enter" });
}), {
remove: o
}) : null;
}
const Vt = /* @__PURE__ */ _e({
name: "FModal",
props: Vl,
emits: ["update:modelValue", "accept", "cancel", "closed", "resize", "esc", "enter"],
setup(e, t) {
const n = C(e.width || 300), o = C(e.height || 200), i = C(e.modelValue), a = C(""), l = C(e.class), r = C(e.fitContent), u = C(e.showHeader), m = C(""), d = C(e.showCloseButton), s = C(e.showMaxButton), f = C(!1), b = C(e.dialogType), p = C(e.src), _ = C(""), v = C(e.showButtons), h = C(e.title), g = C(e.resizeable), S = C(e.containment || null), y = C(), w = C(!1);
function x(ie, we) {
i.value = !1, t.emit("update:modelValue", !1), we != null && t.emit(we ? "accept" : "cancel"), t.emit("closed", ie);
}
const c = [{
name: "cancel",
text: "取消",
class: "btn btn-secondary",
handle: (ie) => {
x(ie, !1);
}
}, {
name: "accept",
text: "确定",
class: "btn btn-primary",
handle: (ie) => {
x(ie, !0);
}
}], T = C(e.buttons && e.buttons.length ? e.buttons : c), F = $(() => !!m.value), O = $(() => !!v.value && !!T.value), k = C(), L = C(), V = C(!1), {
renderResizeBar: P,
maximize: M,
restore: I,
boundingElement: B,
resizedEventParam: D,
allowDrag: R,
unWindowResizeHandle: G
} = Nl(e), {
registerDraggle: U
} = Rl(e, t, R);
function K() {
return !!document.querySelectorAll(".farris-modal").length && document.body.classList.contains("modal-open");
}
function q() {
const ie = document.querySelectorAll(".farris-modal").length;
(!ie || ie - 1 <= 0) && document.body.classList.remove("modal-open"), y.value && y.value.classList.remove("show");
}
re(() => e.title, (ie, we) => {
ie !== we && (h.value = ie);
}), re(() => e.modelValue, (ie, we) => {
ie !== we && (i.value = ie, ie || q()), i.value && (w.value = K());
}), re(() => e.showHeader, (ie, we) => {
ie !== we && (u.value = ie);
}), re(() => e.showButtons, (ie, we) => {
ie !== we && (v.value = ie);
}), re(() => D.value, (ie, we) => {
const Be = ie || {}, Re = we || {};
JSON.stringify(Be) !== JSON.stringify(Re) && t.emit("resize", {
newSize: ie,
oldSize: we
});
});
const N = $(() => (i.value && document.body.classList.add("modal-open"), i.value)), j = $(() => {
const ie = {
modal: !0,
"farris-modal": !0,
fade: !0
};
return ie["f-modal-fitContent"] = !!r.value, ie.show = !!N.value, ie;
}), H = $(() => {
var Be;
const ie = {
"modal-dialog": !0
}, we = (Be = l.value) == null ? void 0 : Be.split(" ");
return we == null || we.reduce((Re, Ee) => (Re[Ee] = !0, Re), ie), ie;
}), A = $(() => ({
position: "absolute",
top: `${(window.innerHeight - o.value) / 2}px`,
left: `${(window.innerWidth - n.value) / 2}px`,
width: `${n.value}px`,
height: r.value ? "auto" : `${o.value}px`
})), Y = $(() => ({
"modal-content": !0,
"modal-content-has-header": u.value
})), X = $(() => {
const ie = {
display: u.value ? "" : "none"
};
return ie["pointer-events"] = R.value ? "auto" : "none", ie;
}), z = $(() => ({
"f-icon": !0,
modal_maximize: !0,
modalrevert: V.value
})), J = $(() => ({
"modal-body": !0,
"f-utils-flex-column": b.value === "iframe",
"f-utils-fill": !0
}));
function se() {
return {
height: `${e.footerHeight || 60}px`
};
}
const te = $(() => {
const ie = {
textAlgin: _.value
}, we = se();
return Object.assign(ie, we);
});
function ne(ie) {
if (ie.stopPropagation(), V.value) {
V.value = !1, I();
return;
}
M(), V.value = !0;
}
async function xe(ie, we) {
ie.handle && await ie.handle(we, ie) && t.emit("closed", we);
}
function Oe(ie) {
ie.width && (n.value = ie.width), ie.height && (o.value = ie.height), ie.buttons && (T.value = ie.buttons), ie.title && (h.value = ie.title);
}
const Ie = $(() => {
const ie = {
display: "inline-block"
};
return w.value && (ie["background-color"] = "transparent"), ie;
});
let Ue = null, Ae = null;
Qo(() => {
w.value = K();
}), je(() => {
L.value && !S.value && (S.value = L.value.parentElement, B.value = S.value, U(k.value, L.value, B.value)), N.value && document.body.classList.add("modal-open"), Ue = $l(e, t), Ae = jl(e, t);
}), wt(() => {
G && G(), Ue && Ue.remove(), Ae && Ae.remove();
}), t.expose({
modalElementRef: L,
updateModalOptions: Oe,
close: x,
maxDialog: ne
});
function Le() {
return E("ul", null, [f.value && E("li", {
class: "f-btn-icon f-bare"
}, [E("span", {
class: "f-icon modal_minimize"
}, null)]), s.value && E("li", {
onClick: ne,
class: "f-btn-icon f-bare",
style: "pointer-events: auto;"
}, [E("span", {
class: z.value
}, null)]), d.value && E("li", {
class: "f-btn-icon f-bare",
onClick: (ie) => x(ie, !1),
style: "pointer-events: auto;"
}, [E("span", {
class: "f-icon modal_close"
}, null)])]);
}
function Ze() {
return E("div", {
class: "modal-footer",
style: te.value
}, [T.value && T.value.map((ie) => E("button", {
name: ie.name,
type: "button",
class: ie.class + (ie.iconClass ? " btn-icontext" : ""),
onClick: (we) => {
xe(ie, we);
}
}, [!!ie.iconClass && E("i", {
class: ie.iconClass
}, null), ie.text]))]);
}
function Xe() {
return E("div", {
ref: k,
class: "modal-header",
style: X.value
}, [E("div", {
class: "modal-title"
}, [F.value && E("span", {
class: m.value,
style: "margin-right: 8px"
}, null), E("span", {
class: "modal-title-label"
}, [h.value])]), E("div", {
class: "actions"
}, [Le()])]);
}
function pt(ie) {
ie.stopPropagation();
}
return () => E(Rn, {
to: "body"
}, {
default: () => [N.value && E($n, {
name: "fade",
appear: !0
}, {
default: () => {
var ie, we;
return [E("div", {
class: j.value,
style: Ie.value,
ref: y,
onClick: pt
}, [E("div", {
id: a.value,
class: H.value,
style: A.value,
ref: L
}, [E("div", {
class: Y.value
}, [u.value && Xe(), E("div", {
class: J.value
}, [(we = (ie = t.slots).default) == null ? void 0 : we.call(ie), b.value === "iframe" && E("iframe", {
title: a.value,
class: "f-utils-fill",
width: "100%",
frameborder: "0",
src: p.value
}, null)]), O.value && Ze()]), !r.value && g.value && L.value && !V.value && P(L.value)])])];
}
})]
});
}
});
function no(e) {
if (e.content && e.content.render)
return e.content.render;
if (e.render && typeof e.render == "function")
return e.render;
}
function Al(e) {
const t = document.createElement("div");
t.style.display = "contents";
const n = gn({
setup(o, i) {
wt(() => {
document.body.removeChild(t);
});
const a = C(), l = C(e.class || ""), r = C(!!e.showButtons), u = C(!!e.showHeader), m = C(e.showCloseButton == null ? !0 : e.showCloseButton), d = C(!0), s = C(e.title || ""), f = e.acceptCallback || (() => {
}), b = e.rejectCallback || (() => {
}), p = e.closedCallback || ((g) => {
}), _ = e.resizeHandle || ((g) => {
}), v = no(e), h = (g) => {
d.value = !1, n.unmount(), p(g);
};
return je(() => {
}), i.expose({
modalRef: a
}), () => E(Vt, {
ref: a,
class: l.value,
modelValue: d.value,
"onUpdate:modelValue": (g) => d.value = g,
title: s.value,
width: e.width,
height: e.height,
buttons: e.buttons,
"show-header": u.value,
"show-buttons": r.value,
"show-close-button": m.value,
"show-max-button": !1,
onAccept: f,
onCancel: b,
fitContent: e.fitContent == null ? !0 : e.fitContent,
onClosed: h,
onResize: _
}, {
default: () => [v && v(n)]
});
}
});
return document.body.appendChild(t), n.mount(t), n;
}
class oo {
constructor(t) {
Z(this, "appContext", null);
Z(this, "modalRef", C());
Z(this, "activeModalIndex", C(0));
Z(this, "modalRefs", {});
Z(this, "isUseEscCloseModal", C(!1));
Z(this, "activeModalInstance", $(() => this.modalRefs[this.activeModalIndex.value]));
this.app = t, this.appContext = t ? t._context : null;
}
getCurrentModal() {
return this.activeModalInstance.value;
}
adaptToWindow(t, n) {
const {
width: o,
height: i
} = {
width: window.innerWidth,
height: window.innerHeight
};
return o < t && (t = o), i < n && (n = i), {
width: t,
height: n
};
}
static show(t) {
const n = Object.assign({
title: "",
showButtons: !0,
showHeader: !0
}, t);
return Al(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 = Zo(Object.assign({
title: "",
showButtons: !0,
showHeader: !0
}, t)), i = C(!0), a = o.value.acceptCallback || (() => {
}), l = o.value.rejectCallback || (() => {
}), r = o.value.closedCallback || ((y, w) => {
}), u = o.value.resizeHandle || ((y) => {
});
let m;
const d = no(o.value), s = (y) => {
var x;
i.value = !1;
const w = (x = y == null ? void 0 : y.target) == null ? void 0 : x.classList.contains("modal_close");
r(y, this.isUseEscCloseModal.value ? "esc" : w ? "icon" : "button");
}, f = (y) => {
s(y), m && Et(() => {
if (this.modalRefs[this.activeModalIndex.value] && delete this.modalRefs[this.activeModalIndex.value], an(null, n), m = null, this.modalRef.value = null, this.modalRefs) {
const w = Object.keys(this.modalRefs).map((x) => Number(x));
w.length > 0 ? this.activeModalIndex.value = Math.max(...w) : this.activeModalIndex.value = 0;
}
this.isUseEscCloseModal.value = !1;
});
}, b = (y) => {
var w;
this.isUseEscCloseModal.value = !0, this.activeModalInstance && ((w = this.activeModalInstance.value) == null || w.close(y == null ? void 0 : y.event));
}, {
width: p,
height: _
} = o.value, v = this.adaptToWindow(p || 500, _ || 320);
Object.assign(o.value, v);
const h = () => E(Vt, ht({
ref: this.modalRef,
modelValue: i.value,
"onUpdate:modelValue": (y) => i.value = y
}, o.value, {
onAccept: a,
onCancel: l,
onClosed: f,
onResize: u,
onEsc: b
}), {
default: () => [d && d(this.app)]
});
return m = ((y) => {
const w = ei(h, y);
return w.appContext = this.appContext, an(w, n), w;
})({
...o.value
// 'onUpdate:modelValue': onUpdateModelValue,
}), this.activeModalIndex.value++, this.modalRefs[this.activeModalIndex.value] = this.modalRef.value, {
update: (y) => {
o.value = {
...o.value,
...y
}, m && an(ti(m, {
...o
}), n);
},
destroy: f,
modalRef: this.activeModalInstance,
close: this.close
};
}
}
const io = Symbol("FModalService");
Vt.install = (e) => {
e.component(Vt.name, Vt);
const t = new oo(e);
e.provide(io, t), e.provide("FModalService", t);
};
function ao(e, t) {
function n() {
const o = e.beforeOpen || e.beforeClickButton || null;
let i = Promise.resolve(!0);
if (o) {
const a = o(t.value);
if (typeof a > "u")
return i;
typeof a == "boolean" ? i = Promise.resolve(a) : i = a;
}
return i;
}
return { judgeCanOpen: n };
}
function zl(e, t, n, o, i) {
const a = C(e.buttonBehavior), l = C(e.popupOnInput), r = $(() => ({
"input-group-a