@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,574 lines • 166 kB
JavaScript
var no = Object.defineProperty;
var oo = (e, t, n) => t in e ? no(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var Ae = (e, t, n) => oo(e, typeof t != "symbol" ? t + "" : t, n);
import { ref as f, onMounted as ot, defineComponent as Ge, computed as E, createVNode as l, Teleport as Xt, createApp as Pt, onUnmounted as vt, Fragment as Be, watch as ce, nextTick as nt, onBeforeMount as ao, watchEffect as lo, Transition as Jt, shallowRef as io, render as kt, h as ro, cloneVNode as uo, mergeProps as wt, inject as pt, withDirectives as Zt, vShow as so, createTextVNode as Pe, onUpdated as co, onBeforeUnmount as fo, reactive as Se, isVNode as Dt, Comment as Qt, provide as mo, getCurrentInstance as Kt, vModelCheckbox as vo } from "vue";
import { LocaleService as We } from "../locale/index.esm.js";
import { isMobilePhone as ft, getMaxZIndex as Ut, useGuid as go, withInstall as en, useCommonUtils as tn, resolveField as ho, getCustomClass as po } from "../common/index.esm.js";
import "../property-panel/index.esm.js";
import { FButton as qt } from "../button/index.esm.js";
import "../field-selector/index.esm.js";
import "../collection-property-editor/index.esm.js/src/use-button-items.designer";
import yo from "../tags/index.esm.js";
import { debounce as nn, isPlainObject as Yt, cloneDeep as Ot } from "lodash-es";
import { useInputExpand as bo } from "../common/index.esm.js/text-box/use-input-expand";
import Co from "../popover/index.esm.js";
import on from "../drawer/index.esm.js";
import { useResizeObserver as wo } from "@vueuse/core";
import { SETTING_COLUMN_FIELD as xo, COMMAND_COLUMN_FIELD as So, CellMode as an, SETTING_COLUMN_DATA_TYPE as rt, COMMAND_COLUMN_DATA_TYPE as ut, useScreen as To, useIdentify as Bo, useGroupData as Fo, useFilter as ko, useHierarchy as Mo, useLoading as Oo, useDataView as Eo, usePagination as Io, useSelection as Po, useDataViewContainerStyle as Do, useCommandColumn as Ro, useSettingColumn as No, useColumn as jo, useSort as Ho, useGroupColumn as zo, useRow as Lo, useEdit as Vo, useVisualDataBound as Ao, useVisualDataCell as Wo, useVisualDataRow as Go, useVisualGroupRow as _o, useVisualSummaryRow as $o, useVisualData as Uo, useCellContentStyle as qo, useCellPosition as Yo, useSidebar as Xo, useVirtualScroll as Jo, useFitColumn as Zo, useFilterHistory as Qo, useColumnFilter as Ko, useDragColumn as ea, getColumnHeader as ta, getPagination as na, getSidebar as oa, getDisableMask as aa, getSummary as la, getHorizontalScrollbar as ia, getVerticalScrollbar as ra, getFilterPanel as ua, getGroupPanel as sa, useAdapt as ca, useNavigation as da, getEmpty as fa, ColumnSettingSolution as ma, refreshScrollAfterDataSourceLoad as va } from "../data-view/index.esm.js";
import ga, { FDynamicForm as ha, FDynamicFormLabel as pa } from "../dynamic-form/index.esm.js";
import "bignumber.js";
import { createPropsResolver as ya } from "../dynamic-resolver/index.esm.js";
const ba = {
/**
* 标记组件的唯一标识
*/
id: { type: String, default: "" },
/**
* 按钮内容,缺省为点击按钮图标
*/
buttonContent: { type: String, default: '<i class="f-icon f-icon-lookup"></i>' },
/**
* --
* @default Popup
*/
buttonBehavior: { type: String, default: "Popup" },
/**
* 是否启用自动完成录入文本功能
* @default false
*/
autoComplete: { type: Boolean, default: !1 },
/**
* 组件自定义样式
*/
customClass: { type: String, default: "" },
/**
* 将组件设置为禁用状态
* @default false
*/
disable: { type: Boolean, default: !1 },
/**
* 是否允许在输入框编辑文本;inputType为tag时,此属性无效
* @default true
*/
editable: { type: Boolean, default: !0 },
/**
* 是否启用清空按钮
* @default false
*/
enableClear: { type: Boolean, default: !1 },
/**
* 组件值
*/
modelValue: { type: String, default: "" },
/**
* 将组件输入框设置为只读
* @default false
*/
readonly: { type: Boolean, default: !1 },
/**
* 是否允许在禁用组件时仍然显示组件按钮
* @default false
*/
showButtonWhenDisabled: { type: Boolean, default: !1 },
/**
* 显示扩展按钮
*/
showAppendButton: { type: Boolean, default: !0 },
/**
* 是否启用输入框的的提示文本
* @default false
*/
enableTitle: { type: Boolean, default: !1 },
/**
* 'text'
* @default 'text'
*/
inputType: { type: String, default: "text" },
/**
* 是否始终显示输入框提示文本
* @default false
*/
forcePlaceholder: { type: Boolean, default: !1 },
/**
* 设置输入框提示文本
*/
placeholder: { type: String, default: "" },
/**
* 设置输入框文本最小长度
*/
minLength: Number,
/**
* 设置输入框文本最大长度
*/
maxLength: { type: Number },
/**
* 设置组件 Tab 键索引
*/
tabIndex: Number,
popupHost: { type: Object },
popupRightBoundary: { type: Object },
popupOffsetX: { type: Object, default: 0 },
popupOffsetY: { type: Object, default: 0 },
/**
* 开启后,输入时自动弹出选择面板;inputType为tag时,此属性无效
* @default false
*/
popupOnInput: { type: Boolean, default: !1 },
/**
* 开启后,点击输入框自动弹出选择面板;inputType为tag时,此属性无效
* @default false
*/
popupOnFocus: { type: Boolean, default: !1 },
popupOnClick: { type: Boolean, default: !1 },
/**
* 样式追加到弹出窗口
*/
popupClass: { type: String, default: "" },
/**
* 弹出面板最小宽度
* @default 160
*/
popupMinWidth: { type: Number, default: 160 },
modalOptions: { type: Object, default: {} },
wrapText: { type: Boolean, default: !1 },
/**
* 是否支持多选
* @default false
*/
multiSelect: { type: Boolean, default: !1 },
/**
* 多选分隔符
* @default ,
*/
separator: { type: String, default: "," },
/**
* 设置输入框对齐方式,缺省状况为左对齐,可选择的值包括:'left','center','right'; inputType为tag时,此属性无效
* @default 'left'
*/
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" },
/**
* 根据空间大小重新调整,原下拉面板内容指定的高度
*/
limitContentBySpace: { type: Boolean, default: !1 },
beforeClosePopup: { type: Function, default: null },
/**
* 是否可扩展
*/
expandable: { type: Boolean, default: !1 },
/**
* 扩展模式 text | button
*/
expandMode: { type: String, default: "text" },
/**
* 扩展文本内容
*/
expandContent: { type: String, default: "" },
/**
* 扩展按钮是否禁用
*/
expandDisabled: { type: Boolean, default: !1 }
}, Ca = {
popupContentPosition: { type: Object, default: { left: 0, top: 0 } },
host: { type: Object },
backgroundColor: { type: String, default: "" }
};
function wa() {
const e = f(!1);
return ot(() => {
e.value = !0;
}), e;
}
const xa = /* @__PURE__ */ Ge({
name: "FOverlay",
props: Ca,
emits: ["click"],
setup(e, t) {
const n = f(e.popupContentPosition), o = f(e.host), a = wa(), i = E(() => ({
backgroundColor: e.backgroundColor || "",
pointerEvents: "auto"
}));
function s(m) {
t.emit("click"), m.preventDefault(), m.stopPropagation();
}
E(() => {
const m = o.value;
if (m) {
const h = m.getBoundingClientRect(), {
left: p,
top: u,
height: T
} = h;
return {
left: p,
top: u + T
};
}
return n.value;
});
const b = E(() => ({
// position: 'relative',
// left: `${position.value.left}px`,
// top: `${position.value.top}px`
}));
return () => a.value ? l(Xt, {
to: "body"
}, {
default: () => {
var m, h;
return [l("div", {
class: "overlay-container",
onClick: (p) => s(p),
style: i.value
}, [l("div", {
style: b.value
}, [(h = (m = t.slots).default) == null ? void 0 : h.call(m)])])];
}
}) : null;
}
});
function Sa(e) {
if (e.content && e.content.render)
return e.content.render;
if (e.render && typeof e.render == "function")
return e.render;
}
function Ta(e) {
const t = document.createElement("div");
t.style.display = "contents";
let n;
const o = e.onClickCallback || (() => {
}), a = () => {
o(), n && n.unmount();
};
return n = Pt({
setup() {
vt(() => {
document.body.removeChild(t);
});
const i = Sa(e);
return () => l(xa, {
"popup-content-position": e.popupPosition,
host: e.host,
onClick: a,
backgroundColor: e.backgroundColor
}, {
default: () => [i && i()]
});
}
}), document.body.appendChild(t), n.mount(t), n;
}
class Ba {
static show(t) {
return Ta(t);
}
}
const Fa = {
/**
* 允许点击蒙层关闭对话框
* @default false
*/
allowClickMaskToClose: { type: Boolean, default: !1 },
/**
* 关闭前事件
* @default () => { return true; }
*/
beforeClose: { type: Function, default: () => !0 },
/**
* 自定义样式,类名以空格隔开
* @default ''
*/
class: { type: String, default: "" },
/**
* 自定义蒙层样式,类名以空格隔开
* @default ''
*/
maskClass: { type: String, default: "" },
/**
* 窗口标题
*/
title: { type: String, default: "" },
/**
* 窗口宽度
* @default 500
*/
width: { type: Number, default: 500 },
/**
* 窗口高度
* @default 320
*/
height: { type: Number, default: 320 },
/**
* 底部按钮
*/
buttons: {
type: Array,
default: []
},
/**
* 双向绑定属性是否显示窗口
* @default false
*/
modelValue: { type: Boolean, default: !1 },
/**
* 是否模态
* @default true
*/
mask: { type: Boolean, default: !0 },
/**
* 展示头部
* @default true
*/
showHeader: { type: Boolean, default: !0 },
/**
* 展示默认按钮
* @default true
*/
showButtons: { type: Boolean, default: !0 },
/**
* 自适应尺寸
* @default true
*/
fitContent: { type: Boolean, default: !0 },
/**
* 展示右上角关闭弹窗按钮
* @default true
*/
showCloseButton: { type: Boolean, default: !0 },
/**
* 是否在窗口右上角展示浮动关闭按钮
*/
showFloatingClose: { type: Boolean, default: !1 },
/**
* 展示右上角最大化按钮
* @default false
*/
showMaxButton: { type: Boolean, default: !1 },
minHeight: { type: Number },
maxHeight: { type: Number },
minWidth: { type: Number },
maxWidth: { type: Number },
containment: { type: Object, default: null },
/**
* 可调整窗口尺寸
* @default false
*/
resizeable: { type: Boolean, default: !1 },
/**
* 可拖拽窗口
* @default false
*/
draggable: { type: Boolean, default: !1 },
/**
* 拖拽抓手,赋值css选择器
*/
dragHandle: { type: Object, default: null },
/**
* 命令式调用属性,默认关闭按钮回调事件
*/
closedCallback: { type: Function, default: null },
openedCallback: { type: Function, default: null },
// 窗口打开后的回调函数
resizeHandle: { type: Function, default: null },
/**
* 命令式调用属性,默认插槽,返回VNode
*/
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: "" },
/**
* 底部区域高度,如果设置为0,则不显示底部区域
* @default 60
*/
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 ye {
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 a = parseInt(o[4], 10), i = parseInt(o[5], 10);
return { x: a, y: i };
}
return { x: 0, y: 0 };
}
static fromEvent(t, n = null) {
if (this.isMouseEvent(t))
return new ye(t.clientX, t.clientY);
if (n === null || t.changedTouches.length === 1)
return new ye(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 ye(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 ye(0, 0);
if (window) {
const o = window.getComputedStyle(t);
if (o) {
const a = parseInt(o.getPropertyValue("left"), 10), i = parseInt(o.getPropertyValue("top"), 10);
n.x = isNaN(a) ? 0 : a, n.y = isNaN(i) ? 0 : i;
}
return n;
}
return null;
}
static copy(t) {
return new ye(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 tt {
constructor(t, n) {
this.width = t, this.height = n;
}
static getCurrent(t) {
const n = new tt(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 tt(0, 0).set(t);
}
set(t) {
return this.width = t.width, this.height = t.height, this;
}
}
function ka(e, t) {
const n = f(), o = f(), a = f(), i = f(), s = f(), b = f(), m = f(), h = f(), p = f(), u = f(), T = f(), c = f(e.resizeable), d = f(), v = f(e.draggable), S = f(!1);
function x() {
const g = o.value || document.body, F = window.getComputedStyle(g);
if (!F || !n.value)
return;
const D = ye.getTransformInfo(n.value), V = {};
m.value && (V.deltaL = n.value.offsetLeft - m.value.x, V.deltaT = n.value.offsetTop - m.value.y);
const Q = F.getPropertyValue("position");
V.width = g.clientWidth, V.height = g.clientHeight, V.pr = parseInt(F.getPropertyValue("padding-right"), 10), V.pb = parseInt(F.getPropertyValue("padding-bottom"), 10), V.position = F.getPropertyValue("position"), Q === "static" && (g.style.position = "relative"), V.translateX = D.x, V.translateY = D.y, u.value = V;
}
function B(g) {
if (n.value) {
i.value = tt.getCurrent(n.value), s.value = ye.getCurrent(n.value), b.value = i.value ? tt.copy(i.value) : null, m.value = s.value ? ye.copy(s.value) : null, x();
const F = g.target.getAttribute("type") || "";
h.value = {
n: !!F.match(/n/),
s: !!F.match(/s/),
w: !!F.match(/w/),
e: !!F.match(/e/)
};
}
}
function z() {
var g, F, D, V;
if (n.value) {
const Q = n.value;
h.value && ((h.value.n || h.value.s) && ((g = b.value) != null && g.height) && (Q.style.height = b.value.height + "px"), (h.value.w || h.value.e) && ((F = b.value) != null && F.width) && (Q.style.width = b.value.width + "px"), m.value && ((D = m.value) != null && D.x && (Q.style.left = m.value.x + "px"), (V = m.value) != null && V.y && (Q.style.top = m.value.y + "px")));
}
}
function G() {
const g = e.minHeight ? e.minHeight : 1, F = e.minWidth ? e.minWidth : 1;
b.value && m.value && h.value && i.value && (b.value.height < g && (b.value.height = g, h.value.n && s.value && (m.value.y = s.value.y + (i.value.height - g))), b.value.width < F && (b.value.width = F, h.value.w && s.value && (m.value.x = s.value.x + (i.value.width - F))), e.maxHeight && b.value.height > e.maxHeight && (b.value.height = e.maxHeight, s.value && h.value.n && (m.value.y = s.value.y + (i.value.height - e.maxHeight))), e.maxWidth && b.value.width > e.maxWidth && (b.value.width = e.maxWidth, h.value.w && s.value && (m.value.x = s.value.x + (i.value.width - e.maxWidth))));
}
function W() {
if (o.value) {
const g = u.value;
if (m.value && b.value && h.value && i.value) {
const F = g.width - g.pr - g.deltaL - g.translateX - m.value.x, D = g.height - g.pb - g.deltaT - g.translateY - m.value.y;
h.value.n && m.value.y + g.translateY < 0 && s.value && (m.value.y = -g.translateY, b.value.height = i.value.height + s.value.y + g.translateY), h.value.w && m.value.x + g.translateX < 0 && s.value && (m.value.x = -g.translateX, b.value.width = i.value.width + s.value.x + g.translateX), b.value.width > F && (b.value.width = F), b.value.height > D && (b.value.height = D);
}
}
}
function A(g) {
if (!a.value || !i.value || !s.value || !h.value)
return;
g.subtract(a.value);
const F = g.x, D = g.y;
h.value.n ? (m.value.y = s.value.y + D, b.value.height = i.value.height - D) : h.value.s && (b.value.height = i.value.height + D), h.value.e ? b.value.width = i.value.width + F : h.value.w && (b.value.width = i.value.width - F, m.value.x = s.value.x + F), W(), G(), z();
}
function I(g) {
if (!p.value)
return;
const F = ye.fromEvent(g);
F && A(F);
}
function O() {
if (n.value) {
const {
width: g,
height: F,
x: D,
y: V
} = n.value.getBoundingClientRect(), Q = ye.getTransformInfo(n.value);
return {
size: {
width: g,
height: F
},
position: {
x: D - Q.x,
y: V - Q.y
}
};
}
return null;
}
function P(g) {
if (n.value) {
const F = O();
T.value = F;
}
a.value = void 0, i.value = null, s.value = null, b.value = null, m.value = null, h.value = null, p.value = null, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", P);
}
function k() {
document.addEventListener("mousemove", I), document.addEventListener("mouseup", P);
}
function N(g) {
g instanceof MouseEvent && g.button === 2 || v.value && (document.body.click(), g.stopPropagation(), g.preventDefault(), a.value = ye.fromEvent(g), p.value = g.target, B(g), k());
}
function X(g) {
return n.value = g, c.value && l(Be, null, [l("div", {
class: "fv-resizable-handle fv-resizable-n",
type: "n",
onMousedown: (F) => N(F)
}, null), l("div", {
class: "fv-resizable-handle fv-resizable-e",
type: "e",
onMousedown: (F) => N(F)
}, null), l("div", {
class: "fv-resizable-handle fv-resizable-s",
type: "s",
onMousedown: (F) => N(F)
}, null), l("div", {
class: "fv-resizable-handle fv-resizable-w",
type: "w",
onMousedown: (F) => N(F)
}, null), l("div", {
class: "fv-resizable-handle fv-resizable-ne",
type: "ne",
onMousedown: (F) => N(F)
}, null), l("div", {
class: "fv-resizable-handle fv-resizable-se fv-resizable-diagonal",
type: "se",
onMousedown: (F) => N(F)
}, null), l("div", {
class: "fv-resizable-handle fv-resizable-sw",
type: "sw",
onMousedown: (F) => N(F)
}, null), l("div", {
class: "fv-resizable-handle fv-resizable-nw",
type: "nw",
onMousedown: (F) => N(F)
}, null)]);
}
function $(g = !0) {
document.body.click();
const F = o.value || document.body, D = tt.getCurrent(F), V = n.value;
g && V && (d.value = O(), d.value.transform = V.style.transform), D && V && (b.value = D, b.value.height -= 14, b.value.width -= 14, V.style.height = b.value.height + "px", V.style.width = b.value.width + "px", V.style.left = "7px", V.style.top = "7px", V.style.transform = "", T.value = {
size: b.value,
position: {
x: 0,
y: 0
}
}, v.value = !1, S.value = !0);
}
function se() {
var g, F;
if (document.body.click(), d.value) {
const D = {
width: d.value.size.width || 0,
height: d.value.size.height || 0
}, V = {
x: (window.innerWidth - D.width) / 2,
y: (window.innerHeight - D.height) / 2
};
(g = b.value) == null || g.set(D), (F = m.value) == null || F.set(V);
const Q = n.value;
Q.style.height = D.height + "px", Q.style.width = D.width + "px", Q.style.left = `${V.x}px`, Q.style.top = `${V.y}px`, Q.style.transform = "", T.value = {
size: D,
position: V
}, v.value = e.draggable, S.value = !1;
}
}
function ue() {
if (n.value) {
const g = tt.getCurrent(n.value);
if (g) {
const {
width: F,
height: D
} = g;
n.value.style.left = `${(window.innerWidth - F) / 2}px`, n.value.style.top = `${(window.innerHeight - D) / 2}px`, n.value.style.transform = "";
}
}
}
function ae() {
const g = () => {
S.value ? $(!1) : ue(), document.body.click();
};
return window.addEventListener("resize", g), () => {
window.removeEventListener("resize", g);
};
}
const L = ae();
return {
renderResizeBar: X,
boundingElement: o,
resizedEventParam: T,
maximize: $,
restore: se,
allowDrag: v,
isMaximized: S,
unWindowResizeHandle: L,
moveToCenter: ue
};
}
function Ma(e, t, n) {
const o = f(), a = f(e.draggable), i = f(e.lockAxis), s = f(), b = f(), m = f(!1), h = f(new ye(0, 0)), p = f(new ye(0, 0)), u = f(new ye(0, 0)), T = f(new ye(0, 0));
ce(() => n.value, (I) => {
s.value.style.cursor = I ? "move" : "default";
});
function c(I, O) {
if (O.tagName === "BUTTON")
return !1;
if (O === I)
return !0;
for (const P in O.children)
if (Object.prototype.hasOwnProperty.call(O.children, P) && c(I, O.children[P]))
return !0;
return !1;
}
function d() {
var k, N;
let I = u.value.x + p.value.x, O = u.value.y + p.value.y;
i.value === "x" ? (I = ((k = h.value) == null ? void 0 : k.x) || 0, u.value.x = 0) : i.value === "y" && (O = ((N = h.value) == null ? void 0 : N.y) || 0, u.value.y = 0);
const P = `translate3d(${Math.round(I)}px, ${Math.round(O)}px, 0px)`;
o.value && (o.value.style.transform = P), T.value.x = I, T.value.y = O;
}
function v() {
if (!b.value || !o.value)
return null;
const I = b.value.getBoundingClientRect(), O = o.value.getBoundingClientRect(), P = {
top: I.top < O.top,
right: I.right > O.right,
bottom: I.bottom > O.bottom,
left: I.left < O.left
};
return P.top || (u.value.y -= O.top - I.top), P.bottom || (u.value.y -= O.bottom - I.bottom), P.right || (u.value.x -= O.right - I.right), P.left || (u.value.x -= O.left - I.left), d(), P;
}
function S(I) {
I && (h.value && I.subtract(h.value), u.value.set(I), d(), v());
}
function x(I) {
m.value && a.value && (I.stopPropagation(), I.preventDefault(), S(ye.fromEvent(I, s.value)));
}
function B() {
var I;
if (m.value) {
if (m.value = !1, p.value.add(u.value), u.value.reset(), (I = o.value) == null || I.classList.remove("ng-dragging"), !e.useTransform && o.value) {
const { left: O, top: P } = o.value.getBoundingClientRect();
o.value.style.left = Math.ceil(O) + "px", o.value.style.top = Math.ceil(P) + "px", o.value.style.transform = "none";
}
t.emit("stopMove"), document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", B);
}
}
function z() {
!m.value && s.value && (m.value = !0, s.value.classList.add("ng-dragging"), document.addEventListener("mousemove", x), document.addEventListener("mouseup", B));
}
function G() {
if (o.value) {
const I = ye.getTransformInfo(o.value);
p.value.set(I);
return;
}
p.value.reset();
}
function W(I) {
if (!n.value || I instanceof MouseEvent && I.button === 2)
return;
const O = I.target || I.srcElement;
s.value !== void 0 && O && !c(O, s.value) || a.value !== !1 && (document.body.click(), I.stopPropagation(), I.preventDefault(), h.value = ye.fromEvent(I, o.value), G(), z());
}
function A(I, O, P) {
if (a.value && O) {
if (I)
s.value = I;
else if (e.dragHandle) {
if (e.dragHandle instanceof HTMLElement)
s.value = e.dragHandle;
else if (typeof e.dragHandle == "string") {
const k = O.querySelector(e.dragHandle);
k && (s.value = k);
}
}
o.value = O, b.value = P, s.value ? (s.value.classList.add("ng-draggable"), s.value.addEventListener("mousedown", W)) : a.value = !1;
}
}
return {
registerDraggle: A,
resetTranslate: G
};
}
function ln(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 Oa(e, t) {
const n = f(e.enableEsc);
let o = null;
return n.value ? (o = ln("Escape", (a) => {
t.emit("esc", { event: a.event, type: "esc" });
}), {
remove: o
}) : null;
}
function Ea(e, t) {
const n = f(e.enableEnter);
let o = null;
return n.value ? (o = ln("Enter", (a) => {
t.emit("enter", { event: a.event, type: "enter" });
}), {
remove: o
}) : null;
}
const ct = /* @__PURE__ */ Ge({
name: "FModal",
props: Fa,
emits: ["update:modelValue", "accept", "cancel", "closed", "resize", "esc", "enter", "stopMove", "buttonClick"],
setup(e, t) {
const n = f(e.width || 300), o = f(e.height || 200), a = f(e.modelValue), i = f(""), s = f(e.class), b = f(e.fitContent), m = f(e.showHeader), h = f(""), p = f(e.showCloseButton), u = f(e.showMaxButton), T = f(!1), c = f(e.dialogType), d = f(e.src), v = f(""), S = f(e.showButtons), x = f(e.title), B = f(e.containment || null), z = f();
x.value === "错误提示" && (x.value = We.getLocaleValue("messageBox.errorTitle"));
const G = f(!1);
function W() {
const w = document.querySelectorAll(".farris-modal").length;
(!w || w - 1 <= 0) && z.value === document.querySelectorAll(".farris-modal")[0] && document.body.classList.remove("modal-open"), z.value && z.value.classList.remove("show");
}
function A(w, _) {
const ne = _ ? "accept" : "cancel";
Promise.resolve().then(() => {
var oe;
return (oe = e.beforeClose) == null ? void 0 : oe.call(e, {
closeType: ne
});
}).then((oe) => {
oe && (a.value = !1, t.emit("update:modelValue", !1), _ != null && t.emit(_ ? "accept" : "cancel"), t.emit("closed", w), W());
});
}
const I = [{
name: "cancel",
text: We.getLocaleValue("messageBox.cancel") || "取消",
class: "btn btn-secondary",
handle: (w) => {
A(w, !1);
}
}, {
name: "accept",
text: We.getLocaleValue("messageBox.ok") || "确定",
class: "btn btn-primary",
handle: (w) => {
A(w, !0);
}
}], O = f(e.buttons && e.buttons.length ? e.buttons : I), P = E(() => !!h.value), k = E(() => !!S.value && !!O.value), N = f(), X = f(), $ = f(e.maximized || !1), {
renderResizeBar: se,
maximize: ue,
restore: ae,
boundingElement: L,
resizedEventParam: g,
allowDrag: F,
unWindowResizeHandle: D,
moveToCenter: V
} = ka(e), {
registerDraggle: Q
} = Ma(e, t, F);
function ie() {
return !!document.querySelectorAll(".farris-modal").length && document.body.classList.contains("modal-open");
}
ce(() => e.title, (w, _) => {
w !== _ && (x.value = w);
}), ce(() => e.modelValue, (w, _) => {
w !== _ && (a.value = w, a.value && e.draggable && nt(() => {
X.value && !B.value && (B.value = X.value.parentElement, L.value = B.value, Q(N.value, X.value, L.value), V());
}), w || (B.value && (B.value = null), W())), a.value ? G.value = ie() : ($.value = !1, F.value = e.draggable);
}), ce(() => e.showHeader, (w, _) => {
w !== _ && (m.value = w);
}), ce(() => e.showButtons, (w, _) => {
w !== _ && (S.value = w);
}), ce(() => g.value, (w, _) => {
const ne = w || {}, oe = _ || {};
JSON.stringify(ne) !== JSON.stringify(oe) && t.emit("resize", {
newSize: w,
oldSize: _,
isMaximized: $.value
});
}), ce([() => e.width, () => e.height], (w, _) => {
(w[0] !== _[0] || w[1] !== _[1]) && (n.value = w[0] || 500, o.value = w[1] || 600);
}), ce(() => e.class, (w, _) => {
s.value = w;
});
const he = E(() => (a.value && document.body.classList.add("modal-open"), a.value)), de = E(() => {
var ne;
const w = {
modal: !0,
"farris-modal": !0,
fade: !0,
"fe-cmp-page-modal": !!e.showFloatingClose
};
w["f-modal-fitContent"] = !!b.value, w.show = !!he.value;
const _ = (ne = e.maskClass) == null ? void 0 : ne.split(" ");
return _ == null || _.reduce((oe, xe) => (oe[xe] = !0, oe), w), w;
}), Ce = E(() => {
var ne;
const w = {
"modal-dialog": !0
}, _ = (ne = s.value) == null ? void 0 : ne.split(" ");
return _ == null || _.reduce((oe, xe) => (oe[xe] = !0, oe), w), w;
}), ve = () => ft() && !e.isMessager || !!e.fullscreen, Te = E(() => {
const w = document.documentElement.clientWidth, _ = document.documentElement.clientHeight;
if ($.value)
return {
position: "fixed",
top: "0px",
left: "0px",
width: "100vw",
height: "100vh",
margin: "0"
};
const ne = Math.min(n.value, w), oe = e.position === "right" ? "100%" : b.value ? "auto" : `${Math.min(o.value, _ - 10)}px`, xe = `${(window.innerHeight - (oe === "100%" || oe === "auto" ? 0 : parseInt(oe))) / 2}px`, Ke = e.position === "right" ? `${window.innerWidth - ne}px` : `${(window.innerWidth - ne) / 2}px`, y = {
position: "absolute",
top: xe,
left: Ke,
width: ft() ? "auto" : `${ne}px`,
height: oe
};
return e.mask || (y.pointerEvents = "auto"), y;
}), _e = f(Ut() || 1050), Oe = E(() => {
const w = {
display: "block",
overflow: "hidden"
};
return e.mask || (w.pointerEvents = "none", w.backgroundColor = "transparent"), G.value && (w.backgroundColor = "transparent"), w.zIndex = _e.value, w;
}), $e = E(() => ({
"modal-content": !0,
"modal-content-has-header": m.value,
"is-mobile": ve()
})), Ee = E(() => {
const w = {
display: m.value ? "" : "none"
};
return w["pointer-events"] = F.value ? "auto" : "none", w;
}), we = E(() => ({
"f-icon": !0,
modal_maximize: !0,
modalrevert: $.value
})), fe = E(() => ({
"modal-body": !0,
"f-utils-flex-column": c.value === "iframe",
"f-utils-fill": !0
}));
function Ue() {
return {
height: `${e.footerHeight || 60}px`
};
}
const De = E(() => {
const w = {
textAlgin: v.value
}, _ = Ue();
return Object.assign(w, _);
});
function Re(w) {
if (w == null || w.stopPropagation(), $.value) {
$.value = !1, ae();
return;
}
ue(), $.value = !0;
}
async function at(w, _) {
w.handle ? await w.handle(_, w) && t.emit("closed", _) : t.emit("buttonClick", {
button: w,
$event: _
});
}
function lt(w) {
w.width && (n.value = w.width), w.height && (o.value = w.height), w.buttons && (O.value = w.buttons), w.title && (x.value = w.title);
}
let Ie = null, je = null;
ao(() => {
G.value = ie();
}), ot(() => {
X.value && !B.value && (B.value = X.value.parentElement, L.value = B.value, Q(N.value, X.value, L.value)), he.value && document.body.classList.add("modal-open"), Ie = Oa(e, t), je = Ea(e, t);
}), vt(() => {
D && D(), Ie && Ie.remove(), je && je.remove();
}), t.expose({
modalElementRef: X,
updateModalOptions: lt,
close: A,
maxDialog: Re,
isMaximized: $,
disableButtons: (w, _ = !0) => {
O.value.forEach((ne) => {
ne.name && w.includes(ne.name) && (ne.disabled = _);
});
}
});
function qe() {
return l("div", {
class: "action-wrapper",
onClick: (w) => A(w, !1)
}, [l("span", {
class: "close-icon"
}, [l("i", {
class: "f-icon f-icon-close"
}, null)])]);
}
function Ye() {
return l("ul", null, [T.value && l("li", {
class: "f-btn-icon f-bare"
}, [l("span", {
class: "f-icon modal_minimize"
}, null)]), u.value && l("li", {
onClick: Re,
class: "f-btn-icon f-bare",
style: "pointer-events: auto;"
}, [l("span", {
class: we.value
}, null)]), p.value && l("li", {
class: "f-btn-icon f-bare",
onClick: (w) => A(w, !1),
style: "pointer-events: auto;"
}, [l("span", {
class: "f-icon modal_close"
}, null)])]);
}
const He = (w) => {
w.preventDefault();
const _ = w.currentTarget, ne = w.deltaY * 0.5;
_.scrollLeft += ne;
};
function Ze() {
return l("div", {
class: "modal-footer",
style: De.value
}, [O.value && l("div", {
class: "buttons",
onWheel: He
}, [O.value.map((w) => {
var oe;
const _ = f(w.disabled), ne = w.class || ((oe = w.appearance) == null ? void 0 : oe.class);
return l("button", {
name: w.name,
style: w.styles,
type: "button",
disabled: _.value,
class: ne + (w.iconClass ? " btn-icontext" : "") + (w.visible === !1 ? "d-none" : ""),
onClick: (xe) => {
at(w, xe);
}
}, [!!w.iconClass && l("i", {
class: w.iconClass
}, null), w.text]);
})])]);
}
function Xe(w) {
u.value && Re();
}
function le() {
return l(Be, null, [$.value && l("div", {
class: "modal-header",
style: "position: absolute;background: transparent;height: 45px;width: 100%;",
onDblclick: (w) => Xe()
}, null), l("div", {
ref: N,
class: "modal-header",
style: Ee.value,
onDblclick: (w) => Xe()
}, [t.slots.headerTemplate ? t.slots.headerTemplate() : l("div", {
class: "modal-title"
}, [P.value && l("span", {
class: h.value,
style: "margin-right: 8px"
}, null), l("span", {
class: "modal-title-label"
}, [x.value])]), l("div", {
class: "actions"
}, [Ye()])])]);
}
function Qe() {
return t.slots.footerTemplate ? t.slots.footerTemplate() : k.value && Ze();
}
function Je(w) {
if (w.stopPropagation(), e.allowClickMaskToClose) {
if (w.target !== z.value)
return;
A(w, !1);
}
}
function ze() {
var w, _;
return l("div", {
id: i.value,
class: Ce.value,
style: Te.value,
ref: X
}, [e.showFloatingClose && qe(), l("div", {
class: $e.value
}, [m.value && le(), l("div", {
class: fe.value
}, [(_ = (w = t.slots).default) == null ? void 0 : _.call(w), c.value === "iframe" && l("iframe", {
title: i.value,
class: "f-utils-fill",
width: "100%",
frameborder: "0",
src: d.value
}, null)]), Qe()]), !b.value && X.value && !$.value && se(X.value)]);
}
function Ne(w) {
return w || "body";
}
return lo(() => {
he.value && (_e.value = Ut() || 1050);
}), () => l(Xt, {
to: Ne(e.host)
}, {
default: () => [he.value && l(Jt, {
name: "fade",
appear: !0
}, {
default: () => [l("div", {
ref: z,
class: de.value,
style: Oe.value,
onClick: Je
}, [ze()])]
})]
});
}
});
function rn(e) {
if (e.content && e.content.render)
return e.content.render;
if (e.render && typeof e.render == "function")
return e.render;
}
function Ia(e) {
const t = document.createElement("div");
t.style.display = "contents";
const n = Pt({
setup(o, a) {
vt(() => {
document.body.removeChild(t);
});
const i = f(), s = f(e.class || ""), b = f(!!e.showButtons), m = f(!!e.showHeader), h = f(e.showCloseButton == null ? !0 : e.showCloseButton), p = f(!!e.showFloatingClose), u = f(!0), T = f(e.title || ""), c = e.acceptCallback || (() => {
}), d = e.rejectCallback || (() => {
}), v = e.closedCallback || ((G) => {
}), S = e.resizeHandle || ((G) => {
}), x = e.stopMoveHandle || ((G) => {
}), B = rn(e), z = (G) => {
u.value = !1, n.unmount(), v(G);
};
return ot(() => {
}), a.expose({
modalRef: i
}), () => l(ct, {
ref: i,
class: s.value,
modelValue: u.value,
"onUpdate:modelValue": (G) => u.value = G,
title: T.value,
width: e.width,
height: e.height,
buttons: e.buttons,
"show-header": m.value,
"show-buttons": b.value,
"show-close-button": h.value,
"show-max-button": !1,
showFloatingClose: p.value,
onAccept: c,
onCancel: d,
fitContent: e.fitContent == null ? !0 : e.fitContent,
onClosed: z,
onResize: S,
onStopMove: x
}, {
default: () => [B && B(n)]
});
}
});
return document.body.appendChild(t), n.use(We.i18n), n.mount(t), n;
}
class un {
// private activeModalInstance = computed(() => {
// return this.modalRefs[this.activeModalIndex.value];
// });
constructor(t) {
Ae(this, "appContext", null);
Ae(this, "modalRef", f());
Ae(this, "activeModalIndex", f(0));
Ae(this, "modalRefs", {});
Ae(this, "isUseEscCloseModal", f(!1));
this.app = t, this.appContext = t ? t._context : null;
}
getCurrentModal() {
return this.modalRefs[this.activeModalIndex.value];
}
adaptToWindow(t, n) {
const {
width: o,
height: a
} = {
width: window.innerWidth,
height: window.innerHeight
};
return o < t && (t = o - 14), a < n && (n = a - 14), {
width: t,
height: n
};
}
static show(t) {
const n = Object.assign({
title: "",
showButtons: !0,
showHeader: !0
}, t);
return Ia(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 = io(Object.assign({
title: "",
showButtons: !0,
showHeader: !0,
maximized: !1
}, t)), a = f(!0), i = o.value.acceptCallback || (() => {
}), s = o.value.rejectCallback || (() => {
}), b = o.value.closedCallback || ((O, P) => {
}), m = o.value.openedCallback || ((O) => {
}), h = o.value.resizeHandle || ((O) => {
}), p = t.stopMoveHandle || ((O) => {
});
let u;
const T = rn(o.value), c = (O) => {
var k;
a.value = !1;
const P = (k = O == null ? void 0 : O.target) == null ? void 0 : k.classList.contains("modal_close");
b(O, this.isUseEscCloseModal.value ? "esc" : P ? "icon" : "button");
}, d = (O) => {
c(O), u && nt(() => {
if (this.modalRefs[this.activeModalIndex.value] && delete this.modalRefs[this.activeModalIndex.value], kt(null, n), u = null, this.modalRef.value = null, this.modalRefs) {
const P = Object.keys(this.modalRefs).map((k) => Number(k));
P.length > 0 ? this.activeModalIndex.value = Math.max(...P) : this.activeModalIndex.value = 0, this.modalRefs[this.activeModalIndex.value] && (this.modalRef.value = this.modalRefs[this.activeModalIndex.value]);
}
this.isUseEscCloseModal.value = !1;
});
}, v = (O) => {
var P;
this.isUseEscCloseModal.value = !0, (P = this.getCurrentModal()) == null || P.close(O == null ? void 0 : O.event);
}, {
width: S,
height: x
} = o.value, B = this.adaptToWindow(S || 500, x || 320);
Object.assign(o.value, B);
const z = f(), G = () => l(ct, wt({
ref: z,
modelValue: a.value,
"onUpdate:modelValue": (O) => a.value = O
}, o.value, {
isMessager: o.value.class && o.value.class.indexOf("modal-message") > -1,
onAccept: i,
onCancel: s,
onClosed: d,
onResize: h,
onEsc: v,
onStopMove: p,
maximized: o.value.maximized
}), {
default: () => [T && T(this.app)]
});
u = ((O) => {
const P = ro(G, O);
return P.appContext = this.appContext, kt(P, n), P;
})({
...o.value
// 'onUpdate:modelValue': onUpdateModelValue,
}), this.activeModalIndex.value++;
const A = this.activeModalIndex.value;
this.modalRefs[A] = z.value;
const I = (O) => {
o.value = {
...o.value,
...O
}, u && kt(uo(u, {
...o
}), n);
};
return nt(() => {
this.modalRefs[A] = z.value, this.modalRef.value = z.value, m(new Event("opened"));
}), {
update: I,
destroy: d,
modalRef: z,
close: () => {
var O;
(O = z.value) == null || O.close();
},
disableButtons: (O, P = !0) => {
var k;
(k = z.value) == null || k.disableButtons(O, P);
}
};
}
}
const dt = Symbol("FModalService");
ct.install = (e) => {
e.component(ct.name, ct);
const t = new un(e);
e.provide(dt, t), e.provide("FModalService", t);
};
function sn(e, t) {
function n() {
const o = e.beforeOpen || e.beforeClickButton || null;
let a = Promise.resolve(!0);
if (o) {
const i = o(t.value);
if (typeof i > "u")
return a;
typeof i == "boolean" ? a = Promise.resolve(i) : a = i;
}
return a;
}
return { judgeCanOpen: n };
}
function Pa(e, t, n, o, a) {
const i = f(e.buttonBehavior), s = f(e.popupOnInput), b = E(() => ({
"input-group-append": !0,
"append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
})), { judgeCanOpen: m } = sn(e, a), h = E(() => e.showButtonWhenDisabled || (!e.editable || !e.readonly) && !e.disable), p = pt(dt, null), u = f();
async function T(v) {
if (await m() && h.value) {
const S = !!t.slots.default;
if (i.value === "Modal") {
const x = e.modalOptions, B = p == null ? void 0 : p.open({
...x,
render: () => t.slots.default && t.slots.default()
});
u.value = B == null ? void 0 : B.modalRef;
}
i.value === "Overlay" && Ba.show({
// host: buttonEditRef.value,
host: document.body,
backgroundColor: "rgba(0,0,0,.15)",
render: () => t.slots.default && t.slots.default()
}), S && i.value === "Popup" && o.togglePopup(!0), S && s.value && o.hidePopup(), t.emit("clickButton", { origin: v, value: e.modelValue });
}
}
function c(v) {
t.emit("mouseEnterIcon", v);
}
function d(v) {
t.emit("mouseLeaveIcon", v);
}
return {
buttonGroupClass: b,
onClickButton: T,
onMouseEnterButton: c,
onMouseLeaveButton: d,
modalRef: u
};
}
function Da(e, t, n, o, a, i) {
const s = f(!1), b = E(() => e.enableClear && !e.readonly && !e.disable && !ft()), { changeTextBoxValue: m, hasClearClass: h } = i, p = f(!1);
function u(S) {
s.value = S, h.value = S;
}
const T = E(() => b.value && !!(a != null && a.value) && p.value);
ce(a, () => {
u(T.value);
});
function c(S) {
const x = !e.readonly && !e.disable && e.editable, B = !e.editable;
S == null || S.stopPropagation(), (x || B) && (m(""), a.value = "", u(!s.value), t.emit("clear"));
}
function d(S) {
if (p.value = !0, !!b.value) {
if (!n.value) {
u(!1);
return;
}
!e.disable && !e.readonly && u(!0);
}
}
function v(S) {
p.value = !1, b.value && u(!1);
}
return {
enableClearButton: b,
showClearButton: s,
onClearValue: c,
onMouseEnterTextBox: d,
onMouseLeaveTextBox: v
};
}
function Ra(e, t, n, o, a) {
const i = E(() => e.popupOnInput), s = E(() => e.popupOnFocus), { shouldPopupContent: b, closeAllPopover: m } = a, h = f(!1), p = E(() => e.enableTitle ? n.value : ""), u = E(() => (e.disable || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), T = E(() => e.readonly || !e.editable || ft()), c = f(!1), d = E(() => !e.disable && c.value), v = E(() => ({
"text-left": e.textAlign === "left",
"text-center": e.textAlign === "center",
"text-right": e.textAlign === "right",
"form-control": !0,
"f-utils-fill": !0
})), S = E(() => ({
"input-group": !0,
"f-state-disabled": e.disable,
"f-state-editable": e.editable && !e.disable && !e.readonly,
"f-state-readonly": e.readonly,
"f-state-focus": d.value,
"input-group--has-clear": e.enableClear && h.value
}));
function x(N, X = !0) {
n.value = N, X && (t.emit("change", N), t.emit("update:modelValue", N));
}
function B(N) {
b.value = !1, x(N, !0);
}
ce(
() => e.modelValue,
(N) => {
n.value = N;
}
);
function z(N) {
c.value = !1, t.emit("blur", N), N.stopPropagation();
}
function G(N) {
t.emit("click", N), m(), t.slots.default && !e.disable && !e.readonly && e.popupOnClick && a.togglePopup();
}
function W(N) {
!e.disable && !e.readonly && (c.value = !0, T.value || (t.emit("focus", N), s.value && !b.value && a.popup()));
}
function A(N) {
t.emit("input", N);
const X = N.target.value;
o.value = X, n.value !== X && x(X, e.updateOn === "change"), i.value && !b.value && a.popup();
}
function I(N) {
N.target.tagName !== "INPUT" && N.preventDefault(), N.stopPropagation();
}
function O(N) {
t.emit("keydown", N);
}
function P(N) {
N.key === "Enter" && (i.value || s.value) && a.hidePopup(), t.emit("keyup", N);
}
function k(N) {
const X = N.target.value;
N.stopPropagation(), x(X);
}
return {
hasFocusedTextBox: d,
isTextBoxReadonly: T,
textBoxClass: v,
textBoxPlaceholder: u,
textBoxTitle: p,
inputGroupClass: S,
hasClearClass: h,
changeTextBoxValue: x,
commitValue: B,
onBlurTextBox: z,
onClickTextBox: G,
onFocusTextBox: W,
onInput: A,
onKeyDownTextBox: O,
onKeyUpTextBox: P,
onMouseDownTextBox: I,
onTextBoxValueChange: k
};
}
const et = "FarrisVue_PopoverInstancesKey";
function Na(e, t, n, o) {
const a = f(), i = f(!1), { judgeCanOpen: s } = sn(e, o);
ce(() => a.value, (c, d) => {
window[et] = window[et] || /* @__PURE__ */ new WeakMap(), c ? window[et].set(n.value, c) : window[et].delete(n.value);
});
function b() {
if (window[et]) {
const c = window[et];
document.querySelectorAll(".f-button-edit,.v-popover").forEach((d) => {
const v = c.get(d);
v && d !== n.value && !n.value.closest(".popover-fitcontent") && v.hide();
});
}
}
function m() {
const c = a.value;
c && (c.show ? c.show(n.value) : c.open && c.open(n.value));
}
async function h(c = !1) {
if (!!t.slots.default) {
if (!c && !i.value && !await s())
return;
i.value = !i.value, i.value && (await nt(), m());
}
}
async function p(c = !1) {
if (!!t.slots.default) {
if (!c && !await s())
return;
i.value = !0, await nt(), m();
}
}
function u() {
i.value = !1;
}
function T() {
i.value = !0, nt(() => {
m();
});
}
return { hidePopup: u, showPopup: T, popup: p, shouldPopupContent: i, togglePopup: h, popoverRef: a, closeAllPopover: b };
}
function ja(e, t, n) {
const o = f(), {
isTextBoxReadonly: a,
textBoxClass: i,
textBoxPlaceholder: s,
textBoxTitle: b,
onBlurTextBox: m,
onClickTextBox: h,
onFocusTextBox: p,
onInput: u,
onKeyDownTextBox: T,
onKeyUpTextBox: c,
onMouseDownTextBox: d,
onTextBoxValueChange: v
} = n, S = f(e.id), {
uuid: x
} = go(), B = E(() => ({
// 'border-top-right-radius': '6px',
// 'border-bottom-right-radius': '6px'
}));
ot(() => {
var I, O;
e.selectOnCreated && ((I = o.value) == null || I.select()), e.focusOnCreated && ((O = o.value) == null || O.focus({
preventScroll: !0
})), S.value || (S.value = "button-edit_" + x(8)), S.value = S.value + "-textbox";
});
const z = f(!1), G = (I) => {
I.preventDefault(), z.value = !0;
}, W = (I) => {
I.preventDefault(), z.value = !1, u(I);
};
function A(I) {
z.value || u(I);
}
return () => l("input", {
id: e.id ? e.id + "-textbox" : void 0,
ref: o,
name: "input-group-value",
autocomplete: e.autoComplete ? "on" : "off",
class: i.value,
style: B.value,
disabled: e.disable,
maxlength: e.maxLength,
minlength: e.minLength,
placeholder: s.value,
readonly: a.value,
tabindex: e.tabIndex,
title: b.value,
type: e.inputType,
value: t.value,
onBlur: m,
onChange: v,
onClick: h,
onFocus: p,
onInput: A,
onKeydown: T,
onKeyup: c,
onMousedown: d,
onCompositionend: W,
onCompositionstart: G
}, null);
}
function Ha(e, t, n) {
const o = f(e.separator), a = E(() => e.readonly || e.disable), {
changeTextBoxValue: i,
onFocusTextBox: s,
onBlurTextBox: b,
onClickTextBox: m,
textBoxPlaceholder: h
} = n, p = E(() => t.value ? t.value.split(o.value).map((d)