@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,545 lines • 597 kB
JavaScript
var Ko = Object.defineProperty;
var Jo = (e, n, t) => n in e ? Ko(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
var V = (e, n, t) => Jo(e, typeof n != "symbol" ? n + "" : n, t);
import { defineComponent as Te, ref as k, computed as B, createVNode as F, Teleport as Sa, createApp as Hn, onUnmounted as sn, Fragment as Qt, watch as ye, nextTick as St, onBeforeMount as Zo, onMounted as Je, Transition as Ta, shallowRef as ei, render as En, h as ti, cloneVNode as ni, mergeProps as Tt, inject as Ye, withDirectives as An, vShow as ai, onBeforeUnmount as Fn, reactive as Ft, createTextVNode as je, resolveDirective as oi, provide as zn, triggerRef as ii, isVNode as ri, vModelText as li, onUpdated as Ma } from "vue";
import Ea from "../tags/index.esm.js";
import si from "../popover/index.esm.js";
import { isPlainObject as ia, cloneDeep as ct, isUndefined as ut, throttle as ui } from "lodash-es";
import Oa from "../list-view/index.esm.js";
import _a, { FButtonEdit as Da } from "../button-edit/index.esm.js";
import Ia from "../../designer/button-edit/index.esm.js";
import { useGuid as ci, resolveField as lt, FormSchemaEntityFieldTypeName as ra, useCommonUtils as di, useDateFormat as fi, useNumberFormat as pi, setFieldValue as Nn, getCustomClass as fn, withInstall as Sn, FormSchemaEntityField$Type as la, FormSchemaEntityFieldType$Type as Pa, getCustomStyle as mi } from "../common/index.esm.js";
import { DgControl as sa, useDesignerComponent as hi } from "../designer-canvas/index.esm.js";
import { useResizeObserver as Ba } from "@vueuse/core";
import { useIdentify as yi, useGroupData as vi, useFilter as gi, useHierarchy as bi, useLoading as wi, useDataView as Ci, useSelection as xi, useSelectHierarchyItem as ki, useDataViewContainerStyle as Fi, useCommandColumn as Si, useColumn as Ti, useSort as Mi, useGroupColumn as Ei, useRow as Oi, useEdit as _i, useVisualDataBound as Di, useVisualDataCell as Ii, useVisualDataRow as Pi, useVisualData as Bi, useCellPosition as Vi, useSidebar as Ni, useVirtualScroll as Ri, useFitColumn as ji, useFilterHistory as Li, useColumnFilter as $i, useDragColumn as Wi, getColumnHeader as Hi, getSidebar as Ai, getDisableMask as zi, getHorizontalScrollbar as qi, getVerticalScrollbar as Gi, getEmpty as Yi } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import Ui from "../transfer/index.esm.js";
import Xi from "../tabs/index.esm.js";
import Qi from "../order/index.esm.js";
import "../condition/index.esm.js";
import { FCheckbox as Ki } from "../checkbox/index.esm.js";
import Ji from "../filter-bar/index.esm.js";
import ua from "../tooltip/index.esm.js";
import Zi from "../pagination/index.esm.js";
import er from "../button/index.esm.js";
import tr from "../search-box/index.esm.js";
import nr, { FDynamicFormGroup as ar, FDynamicFormInput as or } from "../dynamic-form/index.esm.js";
import { createPropsResolver as ir } from "../dynamic-resolver/index.esm.js";
import "../property-panel/index.esm.js";
import rr from "../accordion/index.esm.js";
import lr from "../avatar/index.esm.js";
import sr from "../button-group/index.esm.js";
import ur from "../calendar/index.esm.js";
import cr from "../capsule/index.esm.js";
import ca from "../../designer/checkbox/index.esm.js";
import da from "../../designer/checkbox-group/index.esm.js";
import Rn from "../combo-list/index.esm.js";
import dr from "../combo-tree/index.esm.js";
import fr from "../component/index.esm.js";
import pr from "../color-picker/index.esm.js";
import mr from "../content-container/index.esm.js";
import hr from "../date-picker/index.esm.js";
import yr from "../../designer/data-grid/index.esm.js";
import vr from "../dropdown/index.esm.js";
import gr from "../events-editor/index.esm.js";
import br from "../field-selector/index.esm.js";
import wr from "../binding-selector/index.esm.js";
import Cr from "../image-cropper/index.esm.js";
import xr from "../../designer/input-group/index.esm.js";
import kr from "../layout/index.esm.js";
import Fr from "../list-nav/index.esm.js";
import Sr from "../lookup/index.esm.js";
import Tr from "../mapping-editor/index.esm.js";
import Mr from "../nav/index.esm.js";
import Er from "../number-range/index.esm.js";
import Or from "../number-spinner/index.esm.js";
import _r from "../page-header/index.esm.js";
import Dr from "../page-footer/index.esm.js";
import Ir from "../progress/index.esm.js";
import Pr from "../query-solution/index.esm.js";
import Br from "../../designer/radio-group/index.esm.js";
import Vr from "../rate/index.esm.js";
import Nr from "../response-toolbar/index.esm.js";
import Rr from "../response-layout/index.esm.js";
import jr from "../response-layout-editor/index.esm.js";
import Lr from "../section/index.esm.js";
import $r from "../smoke-detector/index.esm.js";
import Wr from "../splitter/index.esm.js";
import Hr from "../step/index.esm.js";
import Ar from "../switch/index.esm.js";
import zr from "../text/index.esm.js";
import qr from "../time-picker/index.esm.js";
import qn from "../tree-view/index.esm.js";
import Gr from "../uploader/index.esm.js";
import Yr from "../verify-detail/index.esm.js";
import Ur from "../video/index.esm.js";
import Xr from "../textarea/index.esm.js";
import Qr from "../schema-selector/index.esm.js";
import Kr from "../tree-grid/index.esm.js";
import Va from "../event-parameter/index.esm.js";
import Jr from "../filter-condition-editor/index.esm.js";
import Zr from "../fieldset/index.esm.js";
import el from "../sort-condition-editor/index.esm.js";
import tl from "../menu-lookup/index.esm.js";
import nl from "../drawer/index.esm.js";
import al from "../json-editor/index.esm.js";
import ol from "../property-editor/index.esm.js";
import il from "../expression-editor/index.esm.js";
import rl from "../code-editor/index.esm.js";
import ll from "../html-template/index.esm.js";
import "../external-container/index.esm.js";
import "../notify/index.esm.js";
const sl = {
/**
* 组件标识
*/
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" }
}, ul = {
popupContentPosition: { type: Object, default: { left: 0, top: 0 } },
host: { type: Object },
backgroundColor: { type: String, default: "" }
}, cl = /* @__PURE__ */ Te({
name: "FOverlay",
props: ul,
emits: ["click"],
setup(e, n) {
const t = k(e.popupContentPosition), a = k(e.host), o = B(() => ({
backgroundColor: e.backgroundColor || "",
pointerEvents: "auto"
}));
function i(l) {
n.emit("click"), l.preventDefault(), l.stopPropagation();
}
B(() => {
const l = a.value;
if (l) {
const u = l.getBoundingClientRect(), {
left: c,
top: f,
height: s
} = u;
return {
left: c,
top: f + s
};
}
return t.value;
});
const r = B(() => ({
// position: 'relative',
// left: `${position.value.left}px`,
// top: `${position.value.top}px`
}));
return () => F(Sa, {
to: "body"
}, {
default: () => {
var l, u;
return [F("div", {
class: "overlay-container",
onClick: (c) => i(c),
style: o.value
}, [F("div", {
style: r.value
}, [(u = (l = n.slots).default) == null ? void 0 : u.call(l)])])];
}
});
}
});
function dl(e) {
if (e.content && e.content.render)
return e.content.render;
if (e.render && typeof e.render == "function")
return e.render;
}
function fl(e) {
const n = document.createElement("div");
n.style.display = "contents";
let t;
const a = e.onClickCallback || (() => {
}), o = () => {
a(), t && t.unmount();
};
return t = Hn({
setup() {
sn(() => {
document.body.removeChild(n);
});
const i = dl(e);
return () => F(cl, {
"popup-content-position": e.popupPosition,
host: e.host,
onClick: o,
backgroundColor: e.backgroundColor
}, {
default: () => [i && i()]
});
}
}), document.body.appendChild(n), t.mount(n), t;
}
class pl {
static show(n) {
return fl(n);
}
}
const ml = {
/**
* 允许点击遮罩关闭对话框
*/
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 },
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 Xe {
constructor(n, t) {
this.x = n, this.y = t;
}
static getTransformInfo(n) {
const a = window.getComputedStyle(n).getPropertyValue("transform").replace(/[^-\d,]/g, "").split(",");
if (a.length >= 6) {
const o = parseInt(a[4], 10), i = parseInt(a[5], 10);
return { x: o, y: i };
}
return { x: 0, y: 0 };
}
static fromEvent(n, t = null) {
if (this.isMouseEvent(n))
return new Xe(n.clientX, n.clientY);
if (t === null || n.changedTouches.length === 1)
return new Xe(n.changedTouches[0].clientX, n.changedTouches[0].clientY);
for (let a = 0; a < n.changedTouches.length; a++)
if (n.changedTouches[a].target === t)
return new Xe(n.changedTouches[a].clientX, n.changedTouches[a].clientY);
}
static isMouseEvent(n) {
return Object.prototype.toString.apply(n).indexOf("MouseEvent") === 8;
}
static isIPosition(n) {
return !!n && "x" in n && "y" in n;
}
static getCurrent(n) {
const t = new Xe(0, 0);
if (window) {
const a = window.getComputedStyle(n);
if (a) {
const o = parseInt(a.getPropertyValue("left"), 10), i = parseInt(a.getPropertyValue("top"), 10);
t.x = isNaN(o) ? 0 : o, t.y = isNaN(i) ? 0 : i;
}
return t;
}
return null;
}
static copy(n) {
return new Xe(0, 0).set(n);
}
get value() {
return { x: this.x, y: this.y };
}
add(n) {
return this.x += n.x, this.y += n.y, this;
}
subtract(n) {
return this.x -= n.x, this.y -= n.y, this;
}
multiply(n) {
this.x *= n, this.y *= n;
}
divide(n) {
this.x /= n, this.y /= n;
}
reset() {
return this.x = 0, this.y = 0, this;
}
set(n) {
return this.x = n.x, this.y = n.y, this;
}
}
class zt {
constructor(n, t) {
this.width = n, this.height = t;
}
static getCurrent(n) {
const t = new zt(0, 0);
if (window) {
const a = window.getComputedStyle(n);
return a && (t.width = parseInt(a.getPropertyValue("width"), 10), t.height = parseInt(a.getPropertyValue("height"), 10)), t;
}
return null;
}
static copy(n) {
return new zt(0, 0).set(n);
}
set(n) {
return this.width = n.width, this.height = n.height, this;
}
}
function hl(e, n) {
const t = k(), a = k(), o = k(), i = k(), r = k(), l = k(), u = k(), c = k(), f = k(), s = k(), d = k(), p = k(e.resizeable), m = k(), T = k(e.draggable), y = k(!1);
function h() {
const L = a.value || document.body, N = window.getComputedStyle(L);
if (!N || !t.value)
return;
const Q = Xe.getTransformInfo(t.value), j = {};
u.value && (j.deltaL = t.value.offsetLeft - u.value.x, j.deltaT = t.value.offsetTop - u.value.y);
const R = N.getPropertyValue("position");
j.width = L.clientWidth, j.height = L.clientHeight, j.pr = parseInt(N.getPropertyValue("padding-right"), 10), j.pb = parseInt(N.getPropertyValue("padding-bottom"), 10), j.position = N.getPropertyValue("position"), R === "static" && (L.style.position = "relative"), j.translateX = Q.x, j.translateY = Q.y, s.value = j;
}
function C(L) {
if (t.value) {
i.value = zt.getCurrent(t.value), r.value = Xe.getCurrent(t.value), l.value = i.value ? zt.copy(i.value) : null, u.value = r.value ? Xe.copy(r.value) : null, h();
const N = L.target.getAttribute("type") || "";
c.value = {
n: !!N.match(/n/),
s: !!N.match(/s/),
w: !!N.match(/w/),
e: !!N.match(/e/)
};
}
}
function g() {
var L, N, Q, j;
if (t.value) {
const R = t.value;
c.value && ((c.value.n || c.value.s) && ((L = l.value) != null && L.height) && (R.style.height = l.value.height + "px"), (c.value.w || c.value.e) && ((N = l.value) != null && N.width) && (R.style.width = l.value.width + "px"), u.value && ((Q = u.value) != null && Q.x && (R.style.left = u.value.x + "px"), (j = u.value) != null && j.y && (R.style.top = u.value.y + "px")));
}
}
function S() {
const L = e.minHeight ? e.minHeight : 1, N = e.minWidth ? e.minWidth : 1;
l.value && u.value && c.value && i.value && (l.value.height < L && (l.value.height = L, c.value.n && r.value && (u.value.y = r.value.y + (i.value.height - L))), l.value.width < N && (l.value.width = N, c.value.w && r.value && (u.value.x = r.value.x + (i.value.width - N))), e.maxHeight && l.value.height > e.maxHeight && (l.value.height = e.maxHeight, r.value && c.value.n && (u.value.y = r.value.y + (i.value.height - e.maxHeight))), e.maxWidth && l.value.width > e.maxWidth && (l.value.width = e.maxWidth, c.value.w && r.value && (u.value.x = r.value.x + (i.value.width - e.maxWidth))));
}
function w() {
if (a.value) {
const L = s.value;
if (u.value && l.value && c.value && i.value) {
const N = L.width - L.pr - L.deltaL - L.translateX - u.value.x, Q = L.height - L.pb - L.deltaT - L.translateY - u.value.y;
c.value.n && u.value.y + L.translateY < 0 && r.value && (u.value.y = -L.translateY, l.value.height = i.value.height + r.value.y + L.translateY), c.value.w && u.value.x + L.translateX < 0 && r.value && (u.value.x = -L.translateX, l.value.width = i.value.width + r.value.x + L.translateX), l.value.width > N && (l.value.width = N), l.value.height > Q && (l.value.height = Q);
}
}
}
function b(L) {
if (!o.value || !i.value || !r.value || !c.value)
return;
L.subtract(o.value);
const N = L.x, Q = L.y;
c.value.n ? (u.value.y = r.value.y + Q, l.value.height = i.value.height - Q) : c.value.s && (l.value.height = i.value.height + Q), c.value.e ? l.value.width = i.value.width + N : c.value.w && (l.value.width = i.value.width - N, u.value.x = r.value.x + N), w(), S(), g();
}
function v(L) {
if (!f.value)
return;
const N = Xe.fromEvent(L);
N && b(N);
}
function M() {
if (t.value) {
const {
width: L,
height: N,
x: Q,
y: j
} = t.value.getBoundingClientRect(), R = Xe.getTransformInfo(t.value);
return {
size: {
width: L,
height: N
},
position: {
x: Q - R.x,
y: j - R.y
}
};
}
return null;
}
function O(L) {
if (t.value) {
const N = M();
d.value = N;
}
o.value = void 0, i.value = null, r.value = null, l.value = null, u.value = null, c.value = null, f.value = null, document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", O);
}
function E() {
document.addEventListener("mousemove", v), document.addEventListener("mouseup", O);
}
function x(L) {
L instanceof MouseEvent && L.button === 2 || T.value && (document.body.click(), L.stopPropagation(), L.preventDefault(), o.value = Xe.fromEvent(L), f.value = L.target, C(L), E());
}
function I(L) {
return t.value = L, p.value && F(Qt, null, [F("div", {
class: "fv-resizable-handle fv-resizable-n",
type: "n",
onMousedown: (N) => x(N)
}, null), F("div", {
class: "fv-resizable-handle fv-resizable-e",
type: "e",
onMousedown: (N) => x(N)
}, null), F("div", {
class: "fv-resizable-handle fv-resizable-s",
type: "s",
onMousedown: (N) => x(N)
}, null), F("div", {
class: "fv-resizable-handle fv-resizable-w",
type: "w",
onMousedown: (N) => x(N)
}, null), F("div", {
class: "fv-resizable-handle fv-resizable-ne",
type: "ne",
onMousedown: (N) => x(N)
}, null), F("div", {
class: "fv-resizable-handle fv-resizable-se fv-resizable-diagonal",
type: "se",
onMousedown: (N) => x(N)
}, null), F("div", {
class: "fv-resizable-handle fv-resizable-sw",
type: "sw",
onMousedown: (N) => x(N)
}, null), F("div", {
class: "fv-resizable-handle fv-resizable-nw",
type: "nw",
onMousedown: (N) => x(N)
}, null)]);
}
function D(L = !0) {
document.body.click();
const N = a.value || document.body, Q = zt.getCurrent(N), j = t.value;
L && j && (m.value = M(), m.value.transform = j.style.transform), Q && j && (l.value = Q, l.value.height -= 14, l.value.width -= 14, j.style.height = l.value.height + "px", j.style.width = l.value.width + "px", j.style.left = "7px", j.style.top = "7px", j.style.transform = "", d.value = {
size: l.value,
position: {
x: 0,
y: 0
}
}, T.value = !1, y.value = !0);
}
function _() {
var L, N;
if (document.body.click(), m.value) {
const Q = {
width: m.value.size.width || 0,
height: m.value.size.height || 0
}, j = {
x: (window.innerWidth - Q.width) / 2,
y: (window.innerHeight - Q.height) / 2
};
(L = l.value) == null || L.set(Q), (N = u.value) == null || N.set(j);
const R = t.value;
R.style.height = Q.height + "px", R.style.width = Q.width + "px", R.style.left = `${j.x}px`, R.style.top = `${j.y}px`, R.style.transform = "", d.value = {
size: Q,
position: j
}, T.value = e.draggable, y.value = !1;
}
}
function P() {
if (t.value) {
const L = zt.getCurrent(t.value);
if (L) {
const {
width: N,
height: Q
} = L;
t.value.style.left = `${(window.innerWidth - N) / 2}px`, t.value.style.top = `${(window.innerHeight - Q) / 2}px`, t.value.style.transform = "";
}
}
}
function z() {
const L = () => {
y.value ? D(!1) : P(), document.body.click();
};
return window.addEventListener("resize", L), () => {
window.removeEventListener("resize", L);
};
}
const H = z();
return {
renderResizeBar: I,
boundingElement: a,
resizedEventParam: d,
maximize: D,
restore: _,
allowDrag: T,
isMaximized: y,
unWindowResizeHandle: H
};
}
function yl(e, n, t) {
const a = k(), o = k(e.draggable), i = k(e.lockAxis), r = k(), l = k(), u = k(!1), c = k(new Xe(0, 0)), f = k(new Xe(0, 0)), s = k(new Xe(0, 0)), d = k(new Xe(0, 0));
ye(() => t.value, (v) => {
r.value.style.cursor = v ? "move" : "default";
});
function p(v, M) {
if (M.tagName === "BUTTON")
return !1;
if (M === v)
return !0;
for (const O in M.children)
if (Object.prototype.hasOwnProperty.call(M.children, O) && p(v, M.children[O]))
return !0;
return !1;
}
function m() {
var E, x;
let v = s.value.x + f.value.x, M = s.value.y + f.value.y;
i.value === "x" ? (v = ((E = c.value) == null ? void 0 : E.x) || 0, s.value.x = 0) : i.value === "y" && (M = ((x = c.value) == null ? void 0 : x.y) || 0, s.value.y = 0);
const O = `translate3d(${Math.round(v)}px, ${Math.round(M)}px, 0px)`;
a.value && (a.value.style.transform = O), d.value.x = v, d.value.y = M;
}
function T() {
if (!l.value || !a.value)
return null;
const v = l.value.getBoundingClientRect(), M = a.value.getBoundingClientRect(), O = {
top: v.top < M.top,
right: v.right > M.right,
bottom: v.bottom > M.bottom,
left: v.left < M.left
};
return O.top || (s.value.y -= M.top - v.top), O.bottom || (s.value.y -= M.bottom - v.bottom), O.right || (s.value.x -= M.right - v.right), O.left || (s.value.x -= M.left - v.left), m(), O;
}
function y(v) {
v && (c.value && v.subtract(c.value), s.value.set(v), m(), T());
}
function h(v) {
u.value && o.value && (v.stopPropagation(), v.preventDefault(), y(Xe.fromEvent(v, r.value)));
}
function C() {
var v;
u.value && (u.value = !1, f.value.add(s.value), s.value.reset(), (v = a.value) == null || v.classList.remove("ng-dragging"), n.emit("stopMove"), document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", C));
}
function g() {
!u.value && r.value && (u.value = !0, r.value.classList.add("ng-dragging"), document.addEventListener("mousemove", h), document.addEventListener("mouseup", C));
}
function S() {
if (a.value) {
const v = Xe.getTransformInfo(a.value);
f.value.set(v);
return;
}
f.value.reset();
}
function w(v) {
if (!t.value || v instanceof MouseEvent && v.button === 2)
return;
const M = v.target || v.srcElement;
r.value !== void 0 && M && !p(M, r.value) || o.value !== !1 && (document.body.click(), v.stopPropagation(), v.preventDefault(), c.value = Xe.fromEvent(v, a.value), S(), g());
}
function b(v, M, O) {
if (o.value && M) {
if (v)
r.value = v;
else if (e.dragHandle) {
if (e.dragHandle instanceof HTMLElement)
r.value = e.dragHandle;
else if (typeof e.dragHandle == "string") {
const E = M.querySelector(e.dragHandle);
E && (r.value = E);
}
}
a.value = M, l.value = O, r.value ? (r.value.classList.add("ng-draggable"), r.value.addEventListener("mousedown", w)) : o.value = !1;
}
}
return {
registerDraggle: b,
resetTranslate: S
};
}
function Na(e, n) {
if (e) {
const t = (a) => {
a.key.toLowerCase() === e.toLowerCase() && n({ event: a, key: e });
};
return document.addEventListener("keydown", t), () => {
document.removeEventListener("keydown", t);
};
}
}
function vl(e, n) {
const t = k(e.enableEsc);
let a = null;
return t.value ? (a = Na("Escape", (o) => {
n.emit("esc", { event: o.event, type: "esc" });
}), {
remove: a
}) : null;
}
function gl(e, n) {
const t = k(e.enableEnter);
let a = null;
return t.value ? (a = Na("Enter", (o) => {
n.emit("enter", { event: o.event, type: "enter" });
}), {
remove: a
}) : null;
}
const an = /* @__PURE__ */ Te({
name: "FModal",
props: ml,
emits: ["update:modelValue", "accept", "cancel", "closed", "resize", "esc", "enter", "stopMove"],
setup(e, n) {
const t = k(e.width || 300), a = k(e.height || 200), o = k(e.modelValue), i = k(""), r = k(e.class), l = k(e.fitContent), u = k(e.showHeader), c = k(""), f = k(e.showCloseButton), s = k(e.showMaxButton), d = k(!1), p = k(e.dialogType), m = k(e.src), T = k(""), y = k(e.showButtons), h = k(e.title), C = k(e.containment || null), g = k(), S = k(!1);
function w(J, Se) {
Promise.resolve().then(() => {
var Ie;
return (Ie = e.beforeClose) == null ? void 0 : Ie.call(e);
}).then((Ie) => {
Ie && (o.value = !1, n.emit("update:modelValue", !1), Se != null && n.emit(Se ? "accept" : "cancel"), n.emit("closed", J));
});
}
const b = [{
name: "cancel",
text: "取消",
class: "btn btn-secondary",
handle: (J) => {
w(J, !1);
}
}, {
name: "accept",
text: "确定",
class: "btn btn-primary",
handle: (J) => {
w(J, !0);
}
}], v = k(e.buttons && e.buttons.length ? e.buttons : b), M = B(() => !!c.value), O = B(() => !!y.value && !!v.value), E = k(), x = k(), I = k(!1), {
renderResizeBar: D,
maximize: _,
restore: P,
boundingElement: z,
resizedEventParam: H,
allowDrag: L,
unWindowResizeHandle: N
} = hl(e), {
registerDraggle: Q
} = yl(e, n, L);
function j() {
return !!document.querySelectorAll(".farris-modal").length && document.body.classList.contains("modal-open");
}
function R() {
const J = document.querySelectorAll(".farris-modal").length;
(!J || J - 1 <= 0) && document.body.classList.remove("modal-open"), g.value && g.value.classList.remove("show");
}
ye(() => e.title, (J, Se) => {
J !== Se && (h.value = J);
}), ye(() => e.modelValue, (J, Se) => {
J !== Se && (o.value = J, o.value && e.draggable && St(() => {
x.value && !C.value && (C.value = x.value.parentElement, z.value = C.value, Q(E.value, x.value, z.value));
}), J || (C.value && (C.value = null), R())), o.value && (S.value = j());
}), ye(() => e.showHeader, (J, Se) => {
J !== Se && (u.value = J);
}), ye(() => e.showButtons, (J, Se) => {
J !== Se && (y.value = J);
}), ye(() => H.value, (J, Se) => {
const Ie = J || {}, Ge = Se || {};
JSON.stringify(Ie) !== JSON.stringify(Ge) && n.emit("resize", {
newSize: J,
oldSize: Se,
isMaximized: I.value
});
});
const X = B(() => (o.value && document.body.classList.add("modal-open"), o.value)), A = B(() => {
var Ie;
const J = {
modal: !0,
"farris-modal": !0,
fade: !0
};
J["f-modal-fitContent"] = !!l.value, J.show = !!X.value;
const Se = (Ie = e.maskClass) == null ? void 0 : Ie.split(" ");
return Se == null || Se.reduce((Ge, Re) => (Ge[Re] = !0, Ge), J), J;
}), W = B(() => {
var Ie;
const J = {
"modal-dialog": !0
}, Se = (Ie = r.value) == null ? void 0 : Ie.split(" ");
return Se == null || Se.reduce((Ge, Re) => (Ge[Re] = !0, Ge), J), J;
}), G = B(() => {
const J = {
position: "absolute",
top: `${(window.innerHeight - a.value) / 2}px`,
left: `${(window.innerWidth - t.value) / 2}px`,
width: `${t.value}px`,
height: l.value ? "auto" : `${a.value}px`
};
return e.mask || (J.pointerEvents = "auto"), J;
}), K = B(() => {
const J = {
display: "block"
};
return e.mask || (J.pointerEvents = "none", J.backgroundColor = "transparent"), S.value && (J.backgroundColor = "transparent"), J;
}), ie = B(() => ({
"modal-content": !0,
"modal-content-has-header": u.value
})), Z = B(() => {
const J = {
display: u.value ? "" : "none"
};
return J["pointer-events"] = L.value ? "auto" : "none", J;
}), fe = B(() => ({
"f-icon": !0,
modal_maximize: !0,
modalrevert: I.value
})), ve = B(() => ({
"modal-body": !0,
"f-utils-flex-column": p.value === "iframe",
"f-utils-fill": !0
}));
function Fe() {
return {
height: `${e.footerHeight || 60}px`
};
}
const Be = B(() => {
const J = {
textAlgin: T.value
}, Se = Fe();
return Object.assign(J, Se);
});
function Le(J) {
if (J.stopPropagation(), I.value) {
I.value = !1, P();
return;
}
_(), I.value = !0;
}
async function Y(J, Se) {
J.handle && await J.handle(Se, J) && n.emit("closed", Se);
}
function de(J) {
J.width && (t.value = J.width), J.height && (a.value = J.height), J.buttons && (v.value = J.buttons), J.title && (h.value = J.title);
}
let q = null, te = null;
Zo(() => {
S.value = j();
}), Je(() => {
x.value && !C.value && (C.value = x.value.parentElement, z.value = C.value, Q(E.value, x.value, z.value)), X.value && document.body.classList.add("modal-open"), q = vl(e, n), te = gl(e, n);
}), sn(() => {
N && N(), q && q.remove(), te && te.remove();
}), n.expose({
modalElementRef: x,
updateModalOptions: de,
close: w,
maxDialog: Le,
isMaximized: I
});
function we() {
return F("ul", null, [d.value && F("li", {
class: "f-btn-icon f-bare"
}, [F("span", {
class: "f-icon modal_minimize"
}, null)]), s.value && F("li", {
onClick: Le,
class: "f-btn-icon f-bare",
style: "pointer-events: auto;"
}, [F("span", {
class: fe.value
}, null)]), f.value && F("li", {
class: "f-btn-icon f-bare",
onClick: (J) => w(J, !1),
style: "pointer-events: auto;"
}, [F("span", {
class: "f-icon modal_close"
}, null)])]);
}
function Ee() {
return F("div", {
class: "modal-footer",
style: Be.value
}, [v.value && v.value.map((J) => {
const Se = k(J.disabled);
return F("button", {
name: J.name,
type: "button",
disabled: Se.value,
class: J.class + (J.iconClass ? " btn-icontext" : ""),
onClick: (Ie) => {
Y(J, Ie);
}
}, [!!J.iconClass && F("i", {
class: J.iconClass
}, null), J.text]);
})]);
}
function Pe() {
return F("div", {
ref: E,
class: "modal-header",
style: Z.value
}, [n.slots.headerTemplate ? n.slots.headerTemplate() : F("div", {
class: "modal-title"
}, [M.value && F("span", {
class: c.value,
style: "margin-right: 8px"
}, null), F("span", {
class: "modal-title-label"
}, [h.value])]), F("div", {
class: "actions"
}, [we()])]);
}
function rt() {
return n.slots.footerTemplate ? n.slots.footerTemplate() : O.value && Ee();
}
function Ct(J) {
if (J.stopPropagation(), e.allowClickMaskToClose) {
if (J.target !== g.value)
return;
w(J, !1);
}
}
function ht() {
var J, Se;
return F("div", {
id: i.value,
class: W.value,
style: G.value,
ref: x
}, [F("div", {
class: ie.value
}, [u.value && Pe(), F("div", {
class: ve.value
}, [(Se = (J = n.slots).default) == null ? void 0 : Se.call(J), p.value === "iframe" && F("iframe", {
title: i.value,
class: "f-utils-fill",
width: "100%",
frameborder: "0",
src: m.value
}, null)]), rt()]), !l.value && x.value && !I.value && D(x.value)]);
}
return () => F(Sa, {
to: "body"
}, {
default: () => [X.value && F(Ta, {
name: "fade",
appear: !0
}, {
default: () => [F("div", {
ref: g,
class: A.value,
style: K.value,
onClick: Ct
}, [ht()])]
})]
});
}
});
function Ra(e) {
if (e.content && e.content.render)
return e.content.render;
if (e.render && typeof e.render == "function")
return e.render;
}
function bl(e) {
const n = document.createElement("div");
n.style.display = "contents";
const t = Hn({
setup(a, o) {
sn(() => {
document.body.removeChild(n);
});
const i = k(), r = k(e.class || ""), l = k(!!e.showButtons), u = k(!!e.showHeader), c = k(e.showCloseButton == null ? !0 : e.showCloseButton), f = k(!0), s = k(e.title || ""), d = e.acceptCallback || (() => {
}), p = e.rejectCallback || (() => {
}), m = e.closedCallback || ((g) => {
}), T = e.resizeHandle || ((g) => {
}), y = e.stopMoveHandle || ((g) => {
}), h = Ra(e), C = (g) => {
f.value = !1, t.unmount(), m(g);
};
return Je(() => {
}), o.expose({
modalRef: i
}), () => F(an, {
ref: i,
class: r.value,
modelValue: f.value,
"onUpdate:modelValue": (g) => f.value = g,
title: s.value,
width: e.width,
height: e.height,
buttons: e.buttons,
"show-header": u.value,
"show-buttons": l.value,
"show-close-button": c.value,
"show-max-button": !1,
onAccept: d,
onCancel: p,
fitContent: e.fitContent == null ? !0 : e.fitContent,
onClosed: C,
onResize: T,
onStopMove: y
}, {
default: () => [h && h(t)]
});
}
});
return document.body.appendChild(n), t.mount(n), t;
}
class ja {
constructor(n) {
V(this, "appContext", null);
V(this, "modalRef", k());
V(this, "activeModalIndex", k(0));
V(this, "modalRefs", {});
V(this, "isUseEscCloseModal", k(!1));
V(this, "activeModalInstance", B(() => this.modalRefs[this.activeModalIndex.value]));
this.app = n, this.appContext = n ? n._context : null;
}
getCurrentModal() {
return this.activeModalInstance.value;
}
adaptToWindow(n, t) {
const {
width: a,
height: o
} = {
width: window.innerWidth,
height: window.innerHeight
};
return a < n && (n = a - 14), o < t && (t = o - 14), {
width: n,
height: t
};
}
static show(n) {
const t = Object.assign({
title: "",
showButtons: !0,
showHeader: !0
}, n);
return bl(t);
}
close(n) {
var t, a;
n ? (a = n.value) == null || a.close() : (t = this.getCurrentModal()) == null || t.close();
}
open(n) {
const t = document.createDocumentFragment();
n.showMaxButton && n.fitContent && (n.showMaxButton = !1);
const a = ei(Object.assign({
title: "",
showButtons: !0,
showHeader: !0
}, n)), o = k(!0), i = a.value.acceptCallback || (() => {
}), r = a.value.rejectCallback || (() => {
}), l = a.value.closedCallback || ((w, b) => {
}), u = a.value.resizeHandle || ((w) => {
}), c = n.stopMoveHandle || ((w) => {
});
let f;
const s = Ra(a.value), d = (w) => {
var v;
o.value = !1;
const b = (v = w == null ? void 0 : w.target) == null ? void 0 : v.classList.contains("modal_close");
l(w, this.isUseEscCloseModal.value ? "esc" : b ? "icon" : "button");
}, p = (w) => {
d(w), f && St(() => {
if (this.modalRefs[this.activeModalIndex.value] && delete this.modalRefs[this.activeModalIndex.value], En(null, t), f = null, this.modalRef.value = null, this.modalRefs) {
const b = Object.keys(this.modalRefs).map((v) => Number(v));
b.length > 0 ? this.activeModalIndex.value = Math.max(...b) : this.activeModalIndex.value = 0;
}
this.isUseEscCloseModal.value = !1;
});
}, m = (w) => {
var b;
this.isUseEscCloseModal.value = !0, this.activeModalInstance && ((b = this.activeModalInstance.value) == null || b.close(w == null ? void 0 : w.event));
}, {
width: T,
height: y
} = a.value, h = this.adaptToWindow(T || 500, y || 320);
Object.assign(a.value, h);
const C = () => F(an, Tt({
ref: this.modalRef,
modelValue: o.value,
"onUpdate:modelValue": (w) => o.value = w
}, a.value, {
onAccept: i,
onCancel: r,
onClosed: p,
onResize: u,
onEsc: m,
onStopMove: c
}), {
default: () => [s && s(this.app)]
});
return f = ((w) => {
const b = ti(C, w);
return b.appContext = this.appContext, En(b, t), b;
})({
...a.value
// 'onUpdate:modelValue': onUpdateModelValue,
}), this.activeModalIndex.value++, this.modalRefs[this.activeModalIndex.value] = this.modalRef.value, {
update: (w) => {
a.value = {
...a.value,
...w
}, f && En(ni(f, {
...a
}), t);
},
destroy: p,
modalRef: this.activeModalInstance,
close: this.close
};
}
}
const La = Symbol("FModalService");
an.install = (e) => {
e.component(an.name, an);
const n = new ja(e);
e.provide(La, n), e.provide("FModalService", n);
};
function $a(e, n) {
function t() {
const a = e.beforeOpen || e.beforeClickButton || null;
let o = Promise.resolve(!0);
if (a) {
const i = a(n.value);
if (typeof i > "u")
return o;
typeof i == "boolean" ? o = Promise.resolve(i) : o = i;
}
return o;
}
return { judgeCanOpen: t };
}
function wl(e, n, t, a, o) {
const i = k(e.buttonBehavior), r = k(e.popupOnInput), l = B(() => ({
"input-group-append": !0,
"append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
})), { judgeCanOpen: u } = $a(e, o), c = B(() => e.showButtonWhenDisabled || (!e.editable || !e.readonly) && !e.disable), f = Ye(La, null), s = k();
async function d(T) {
if (await u() && c.value) {
const y = !!n.slots.default;
if (i.value === "Modal") {
const h = e.modalOptions, C = f == null ? void 0 : f.open({
...h,
render: () => n.slots.default && n.slots.default()
});
s.value = C == null ? void 0 : C.modalRef;
}
i.value === "Overlay" && pl.show({
// host: buttonEditRef.value,
host: document.body,
backgroundColor: "rgba(0,0,0,.15)",
render: () => n.slots.default && n.slots.default()
}), y && i.value === "Popup" && a.togglePopup(!0), y && r.value && a.hidePopup(), n.emit("clickButton", { origin: T, value: e.modelValue });
}
}
function p(T) {
n.emit("mouseEnterIcon", T);
}
function m(T) {
n.emit("mouseLeaveIcon", T);
}
return {
buttonGroupClass: l,
onClickButton: d,
onMouseEnterButton: p,
onMouseLeaveButton: m,
modalRef: s
};
}
function Cl(e, n, t, a, o, i) {
const r = k(!1), l = B(() => e.enableClear && !e.readonly && !e.disable), { changeTextBoxValue: u, hasClearClass: c } = i;
function f(m) {
r.value = m, c.value = m;
}
ye(o, () => {
f(!!o.value);
});
function s(m) {
const T = !e.readonly && !e.disable && e.editable, y = !e.editable;
m.stopPropagation(), (T || y) && (u(""), f(!r.value), n.emit("clear"));
}
function d(m) {
if (l.value) {
if (!t.value) {
f(!1);
return;
}
!e.disable && !e.readonly && f(!0);
}
}
function p(m) {
l.value && f(!1);
}
return {
enableClearButton: l,
showClearButton: r,
onClearValue: s,
onMouseEnterTextBox: d,
onMouseLeaveTextBox: p
};
}
function xl(e, n, t, a, o) {
const i = B(() => e.popupOnInput), r = B(() => e.popupOnFocus), { shouldPopupContent: l, closeAllPopover: u } = o, c = k(!1), f = B(() => e.enableTitle ? t.value : ""), s = B(() => (e.disable || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), d = B(() => e.readonly || !e.editable), p = k(!1), m = B(() => !e.disable && p.value), T = B(() => ({
"text-left": e.textAlign === "left",
"text-center": e.textAlign === "center",
"text-right": e.textAlign === "right",
"form-control": !0,
"f-utils-fill": !0
})), y = B(() => ({
"input-group": !0,
"f-state-disabled": e.disable,
"f-state-editable": e.editable && !e.disable && !e.readonly,
"f-state-readonly": e.readonly && !e.disable,
"f-state-focus": m.value,
"input-group--has-clear": e.enableClear && c.value
}));
function h(x, I = !0) {
t.value = x, I && (n.emit("change", x), n.emit("update:modelValue", x));
}
function C(x) {
l.value = !1, h(x, !0);
}
ye(
() => e.modelValue,
(x) => {
t.value = x;
}
);
function g(x) {
p.value = !1, n.emit("blur", x), x.stopPropagation();
}
function S(x) {
n.emit("click", x), u(), n.slots.default && !e.disable && !e.readonly && e.popupOnClick && o.togglePopup();
}
function w(x) {
e.disable || (p.value = !0, d.value || (n.emit("focus", x), r.value && !l.value && o.popup()));
}
function b(x) {
n.emit("input", x.target.value);
const I = x.target.value;
a.value = I, t.value !== I && h(I, e.updateOn === "change"), i.value && !l.value && o.popup();
}
function v(x) {
x.target.tagName !== "INPUT" && x.preventDefault(), x.stopPropagation();
}
function M(x) {
n.emit("keydown", x);
}
function O(x) {
x.key === "Enter" && (i.value || r.value) && o.hidePopup(), n.emit("keyup", x);
}
function E(x) {
const I = x.target.value;
x.stopPropagation(), h(I);
}
return {
hasFocusedTextBox: m,
isTextBoxReadonly: d,
textBoxClass: T,
textBoxPlaceholder: s,
textBoxTitle: f,
inputGroupClass: y,
hasClearClass: c,
changeTextBoxValue: h,
commitValue: C,
onBlurTextBox: g,
onClickTextBox: S,
onFocusTextBox: w,
onInput: b,
onKeyDownTextBox: M,
onKeyUpTextBox: O,
onMouseDownTextBox: v,
onTextBoxValueChange: E
};
}
const Ht = "FarrisVue_PopoverInstancesKey";
function kl(e, n, t, a) {
const o = k(), i = k(!1), { judgeCanOpen: r } = $a(e, a);
ye(() => o.value, (p, m) => {
window[Ht] = window[Ht] || /* @__PURE__ */ new WeakMap(), p ? window[Ht].set(t.value, p) : window[Ht].delete(t.value);
});
function l() {
if (window[Ht]) {
const p = window[Ht];
document.querySelectorAll(".f-button-edit,.v-popover").forEach((m) => {
p.get(m) && m !== t.value && p.get(m).hide();
});
}
}
function u() {
const p = o.value;
p && p.show(t.value);
}
async function c(p = !1) {
if (!!n.slots.default) {
if (!p && !i.value && !await r())
return;
i.value = !i.value, await St(), u();
}
}
async function f(p = !1) {
if (!!n.slots.default) {
if (!p && !await r())
return;
i.value = !0, await St(), u();
}
}
function s() {
i.value = !1;
}
function d() {
i.value = !0, St(() => {
u();
});
}
return { hidePopup: s, showPopup: d, popup: f, shouldPopupContent: i, togglePopup: c, popoverRef: o, closeAllPopover: l };
}
function Fl(e, n, t) {
const a = k(), {
isTextBoxReadonly: o,
textBoxClass: i,
textBoxPlaceholder: r,
textBoxTitle: l,
onBlurTextBox: u,
onClickTextBox: c,
onFocusTextBox: f,
onInput: s,
onKeyDownTextBox: d,
onKeyUpTextBox: p,
onMouseDownTextBox: m,
onTextBoxValueChange: T
} = t;
return Je(() => {
var y, h;
e.selectOnCreated && ((y = a.value) == null || y.select()), e.focusOnCreated && ((h = a.value) == null || h.focus({
preventScroll: !0
}));
}), () => F("input", {
ref: a,
name: "input-group-value",
autocomplete: e.autoComplete ? "on" : "off",
class: i.value,
disabled: e.disable,
maxlength: e.maxLength,
minlength: e.minLength,
placeholder: r.value,
readonly: o.value,
tabindex: e.tabIndex,
title: l.value,
type: e.inputType,
value: n.value,
onBlur: u,
onChange: T,
onClick: c,
onFocus: f,
onInput: s,
onKeydown: d,
onKeyup: p,
onMousedown: m
}, null);
}
function Sl(e, n, t) {
const a = k(e.separator), {
changeTextBoxValue: o
} = t, i = B(() => e.readonly || e.disable), r = B(() => n.value ? n.value.split(a.value).map((u) => ({
name: u,
selectable: !0
})) : []);
function l(u) {
o(u.map((c) => c.name).join(a.value), !0);
}
return () => F(Ea, {
id: `${e.id}-tag-editor`,
class: "form-control",
data: r.value,
showClose: !i.value,
disable: i.value,
showInput: !0,
onChange: l
}, null);
}
function Tl(e, n, t, a) {
const {
buttonGroupClass: o,
onClickButton: i,
onMouseEnterButton: r,
onMouseLeaveButton: l
} = t, {
enableClearButton: u,
showClearButton: c,
onClearValue: f
} = a, s = k();
return {
renderButtonGroup: () => F("div", {
id: `${e.id}-button-group`,
class: o.value
}, [u.value && An(F("span", {
class: "input-group-text input-group-clear",
onClick: f
}, [F("i", {
class: "f-icon modal_close"
}, null)]), [[ai, c.value]]), n.slots.buttonContent ? F("span", {
class: "input-group-text input-group-append-button",
onClick: i,
onMouseenter: r,
onMouseleave: l
}, [n.slots.buttonContent()]) : e.buttonContent ? F("span", {
class: "input-group-text input-group-append-button",
innerHTML: e.buttonContent,
ref: s,
onClick: i,
onMouseenter: r,
onMouseleave: l
}, null) : null]),
buttonHandleElement: s
};
}
function Ml(e, n, t) {
const a = k(e.popupMinWidth), {
hidePopup: o,
popoverRef: i
} = t;
return () => F(si, {
id: `${e.id}-popover`,
ref: i,
placement: e.placement,
host: e.popupHost,
"keep-width-with-reference": e.keepWidthWithReference,
fitContent: !0,
"right-boundary": e.popupRightBoundary,
minWidth: a.value,
class: e.popupClass,
offsetX: e.popupOffsetX,
onHidden: o
}, {
default: () => {
var r, l;
return [(l = (r = n.slots).default) == null ? void 0 : l.call(r)];
}
});
}
const Tn = /* @__PURE__ */ Te({
name: "FButtonEdit",
props: sl,
emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue"],
setup(e, n) {
const t = k(), a = k(e.customClass), o = k(e.modelValue), i = kl(e, n, t, o), {
shouldPopupContent: r,
hidePopup: l,
showPopup: u,
togglePopup: c
} = i, f = wl(e, n, t, i, o), s = k(""), d = xl(e, n, o, s, i), {
hasFocusedTextBox: p,
commitValue: m,
inputGroupClass: T
} = d, y = Cl(e, n, o, p, s, d), {
onMouseEnterTextBox: h,
onMouseLeaveTextBox: C
} = y, g = B(() => {
const E = {
"f-button-edit": !0,
"f-cmp-inputgroup": !0,
"f-button-edit-nowrap": !e.wrapText
};
return a.value && a.value.split(" ").reduce((x, I) => (x[I] = !0, x), E), E;
});
function S() {
return e.multiSelect && e.inputType === "tag" ? Sl(e, o, d) : Fl(e, o, d);
}
let w = S();
ye([() => e.multiSelect, () => e.inputType], () => {
w = S();
});
const {
renderButtonGroup: b,
buttonHandleElement: v
} = Tl(e, n, f, y), M = Ml(e, n, i), O = {
commitValue: m,
elementRef: t,
hidePopup: l,
showPopup: u,
popoverRef: i.popoverRef,
shouldPopupContent: r,
togglePopup: c,
openDialog: () => {
v.value && e.buttonBehavior === "Modal" && v.value.click();
},
getModal: () => {
var E;
return e.buttonBehavior === "Modal" ? (E = f.modalRef.value) == null ? void 0 : E.value : null;
}
};
return Je(() => {
t.value.componentInstance = O, window.onresize = () => {
document.body.click();
};
}), Fn(() => {
var