@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,884 lines • 389 kB
JavaScript
var Co = Object.defineProperty;
var wo = (e, t, n) => t in e ? Co(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var U = (e, t, n) => wo(e, typeof t != "symbol" ? t + "" : t, n);
import { ref as b, defineComponent as Be, computed as O, watch as ye, onMounted as je, createVNode as F, Teleport as yn, createApp as en, onUnmounted as Mt, Fragment as xt, onBeforeMount as So, Transition as bn, shallowRef as xo, nextTick as yt, render as zt, h as _o, cloneVNode as To, mergeProps as bt, inject as Ke, reactive as ct, createTextVNode as wt, onBeforeUnmount as Cn, withDirectives as Et, resolveDirective as wn, provide as Fo, triggerRef as Vo, isVNode as Io, vModelText as Xt } from "vue";
import { isPlainObject as dn, cloneDeep as ge, isUndefined as fn } from "lodash-es";
import Sn from "../list-view/index.esm.js";
import xn from "../button-edit/index.esm.js";
import { resolveAppearance as Eo, createPropsResolver as ko } from "../dynamic-resolver/index.esm.js";
import { useDesignerComponent as tn, DgControl as pn } from "../designer-canvas/index.esm.js";
import Xe from "bignumber.js";
import { useTextBoxDesign as Bo, useClear as _n, useDateFormat as Mo, useNumberFormat as Oo, resolveField as Qe, setFieldValue as Kt, getCustomClass as qt, withInstall as At, FormSchemaEntityField$Type as mn, FormSchemaEntityFieldType$Type as No, useTextBox as Ro } from "../common/index.esm.js";
import { useResizeObserver as Tn } from "@vueuse/core";
import { useIdentify as Po, useGroupData as $o, useFilter as Do, useHierarchy as jo, useLoading as Lo, useDataView as Ao, useSelection as Ho, useSelectHierarchyItem as Wo, useDataViewContainerStyle as Go, useCommandColumn as zo, useColumn as qo, useSort as Uo, useGroupColumn as Yo, useRow as Xo, useEdit as Ko, useVisualDataBound as Zo, useVisualDataCell as Jo, useVisualDataRow as Qo, useVisualData as ea, useCellPosition as ta, useSidebar as na, useVirtualScroll as oa, useFitColumn as aa, useFilterHistory as la, useColumnFilter as ia, useDragColumn as ra, getColumnHeader as sa, getSidebar as ua, getDisableMask as ca, getHorizontalScrollbar as da, getVerticalScrollbar as fa, getEmpty as pa } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import ma from "../transfer/index.esm.js";
import va from "../tabs/index.esm.js";
import ha from "../order/index.esm.js";
import "../condition/index.esm.js";
import ga, { FCheckbox as ya } from "../checkbox/index.esm.js";
import ba from "../filter-bar/index.esm.js";
import vn from "../tooltip/index.esm.js";
import Ca from "../pagination/index.esm.js";
import wa from "../button/index.esm.js";
import Sa from "../search-box/index.esm.js";
import xa from "../tags/index.esm.js";
import _a, { FDynamicFormGroup as Ta, FDynamicFormInput as Fa } from "../dynamic-form/index.esm.js";
import Va from "../binding-selector/index.esm.js";
import "../notify/index.esm.js";
import Ia from "../accordion/index.esm.js";
import Ea from "../avatar/index.esm.js";
import ka from "../button-group/index.esm.js";
import Ba from "../calendar/index.esm.js";
import Ma from "../capsule/index.esm.js";
import Oa from "../color-picker/index.esm.js";
import Zt from "../combo-list/index.esm.js";
import Na from "../content-container/index.esm.js";
import Ra from "../data-grid/index.esm.js";
import Pa from "../date-picker/index.esm.js";
import $a from "../dropdown/index.esm.js";
import "../external-container/index.esm.js";
import Da from "../events-editor/index.esm.js";
import ja from "../image-cropper/index.esm.js";
import La from "../input-group/index.esm.js";
import Aa from "../layout/index.esm.js";
import Ha from "../list-nav/index.esm.js";
import Wa from "../lookup/index.esm.js";
import Ga from "../nav/index.esm.js";
import za, { useNumber as qa, useFormat as Ua, useSpinner as Ya, useTextBox as Xa } from "../number-spinner/index.esm.js";
import Ka from "../number-range/index.esm.js";
import Za from "../page-header/index.esm.js";
import Ja from "../page-footer/index.esm.js";
import Qa from "../progress/index.esm.js";
import el from "../query-solution/index.esm.js";
import tl from "../radio-group/index.esm.js";
import nl from "../rate/index.esm.js";
import ol from "../response-toolbar/index.esm.js";
import al from "../response-layout/index.esm.js";
import ll from "../response-layout-editor/index.esm.js";
import il from "../section/index.esm.js";
import rl from "../smoke-detector/index.esm.js";
import sl from "../splitter/index.esm.js";
import ul from "../step/index.esm.js";
import cl from "../switch/index.esm.js";
import dl from "../text/index.esm.js";
import fl from "../time-picker/index.esm.js";
import pl from "../tree-view/index.esm.js";
import ml from "../uploader/index.esm.js";
import vl from "../verify-detail/index.esm.js";
import hl from "../component/index.esm.js";
import gl from "../video/index.esm.js";
import yl from "../textarea/index.esm.js";
import bl from "../tree-grid/index.esm.js";
import Cl from "../fieldset/index.esm.js";
import wl from "../drawer/index.esm.js";
import Sl from "../combo-tree/index.esm.js";
import xl from "../field-selector/index.esm.js";
import _l from "../mapping-editor/index.esm.js";
import Tl from "../schema-selector/index.esm.js";
import Fl from "../event-parameter/index.esm.js";
import Vl from "../filter-condition-editor/index.esm.js";
import Il from "../sort-condition-editor/index.esm.js";
import El from "../menu-lookup/index.esm.js";
const Fn = {}, Vn = {};
function nn(e) {
const { properties: t, title: n, ignore: o } = e, a = o && Array.isArray(o), l = Object.keys(t).reduce((i, s) => ((!a || !o.find((u) => u === s)) && (i[s] = t[s].type === "object" && t[s].properties ? nn(t[s]) : ge(t[s].default)), i), {});
if (n && (!a || !o.find((i) => i === "id"))) {
const i = n.toLowerCase().replace(/-/g, "_");
l.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return l;
}
function kl(e) {
const { properties: t, title: n, required: o } = e;
if (o && Array.isArray(o)) {
const a = o.reduce((l, i) => (l[i] = t[i].type === "object" && t[i].properties ? nn(t[i]) : ge(t[i].default), l), {});
if (n && o.find((l) => l === "id")) {
const l = n.toLowerCase().replace(/-/g, "_");
a.id = `${l}_${Math.random().toString().slice(2, 6)}`;
}
return a;
}
return {
type: n
};
}
function In(e, t = {}, n) {
const o = Fn[e];
if (o) {
let a = kl(o);
const l = Vn[e];
return a = l ? l({ getSchemaByType: In }, a, t, n) : a, a;
}
return null;
}
function Bl(e, t) {
const n = nn(t);
return Object.keys(n).reduce((o, a) => (Object.prototype.hasOwnProperty.call(e, a) && (o[a] && dn(o[a]) && dn(e[a] || !e[a]) ? Object.assign(o[a], e[a] || {}) : o[a] = e[a]), o), n), n;
}
function En(e, t) {
return Object.keys(e).filter((o) => e[o] != null).reduce((o, a) => {
if (t.has(a)) {
const l = t.get(a);
if (typeof l == "string")
o[l] = e[a];
else {
const i = l(a, e[a], e);
Object.assign(o, i);
}
} else
o[a] = e[a];
return o;
}, {});
}
function Ml(e, t, n = /* @__PURE__ */ new Map()) {
const o = Bl(e, t);
return En(o, n);
}
function Ol(e = {}) {
function t(f, d, r, c) {
if (typeof r == "number")
return c[f].length === r;
if (typeof r == "object") {
const m = Object.keys(r)[0], h = r[m];
if (m === "not")
return Number(c[f].length) !== Number(h);
if (m === "moreThan")
return Number(c[f].length) >= Number(h);
if (m === "lessThan")
return Number(c[f].length) <= Number(h);
}
return !1;
}
function n(f, d, r, c) {
return c[f] && c[f].propertyValue && String(c[f].propertyValue.value) === String(r);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", n]
]);
Object.keys(e).reduce((f, d) => (f.set(d, e[d]), f), o);
function a(f, d) {
const r = f;
return typeof d == "number" ? [{ target: r, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: r, operator: "getProperty", param: f, value: !!d }] : typeof d == "object" ? Object.keys(d).map((c) => {
if (c === "length")
return { target: r, operator: "length", param: null, value: d[c] };
const m = c, h = d[c];
return { target: r, operator: "getProperty", param: m, value: h };
}) : [];
}
function l(f) {
return Object.keys(f).reduce((r, c) => {
const m = a(c, f[c]);
return r.push(...m), r;
}, []);
}
function i(f, d) {
if (o.has(f.operator)) {
const r = o.get(f.operator);
return r && r(f.target, f.param, f.value, d) || !1;
}
return !1;
}
function s(f, d) {
return l(f).reduce((m, h) => m && i(h, d), !0);
}
function u(f, d) {
const r = Object.keys(f), c = r.includes("allOf"), m = r.includes("anyOf"), h = c || m, v = (h ? f[h ? c ? "allOf" : "anyOf" : "allOf"] : [f]).map((_) => s(_, d));
return c ? !v.includes(!1) : v.includes(!0);
}
return { parseValueSchema: u };
}
const re = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
"input-group": { type: "input-group", name: "文本" },
textarea: { type: "textarea", name: "多行文本" },
lookup: { type: "lookup", name: "帮助" },
"number-spinner": { type: "number-spinner", name: "数值" },
"date-picker": { type: "date-picker", name: "日期" },
switch: { type: "switch", name: "开关" },
"radio-group": { type: "radio-group", name: "单选组" },
"check-box": { type: "check-box", name: "复选框" },
"check-group": { type: "check-group", name: "复选框组" },
"combo-list": { type: "combo-list", name: "下拉列表" },
"response-form": { type: "response-form", name: "卡片面板" },
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
"tree-grid": { type: "tree-grid", name: "树表格" },
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
"data-grid": { type: "data-grid", name: "表格" },
"data-grid-column": { type: "data-grid-column", name: "表格列" },
module: { type: "Module", name: "模块" },
component: { type: "component", name: "组件" },
tabs: { type: "tabs", name: "标签页" },
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
"time-picker": { type: "time-picker", name: "时间选择" },
section: { type: "section", name: "分组面板" },
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
splitter: { type: "splitter", name: "分栏面板" },
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
"component-ref": { type: "component-ref", name: "组件引用节点" },
uploader: { type: "uploader", name: "附件上传" },
"page-header": { type: "page-header", name: "页头" },
"page-footer": { type: "page-footer", name: "页脚" },
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
fieldset: { type: "fieldset", name: "分组" },
"query-solution": { type: "query-solution", name: "筛选方案" },
drawer: { type: "drawer", name: "抽屉" }
}, Nl = {}, Rl = {};
Ol();
function lt(e, t, n = /* @__PURE__ */ new Map(), o = (i, s, u, f) => s, a = {}, l = (i) => i) {
return Fn[t.title] = t, Vn[t.title] = o, Nl[t.title] = a, Rl[t.title] = l, (i = {}, s = !0) => {
if (!s)
return En(i, n);
const u = Ml(i, t, n), f = Object.keys(e).reduce((d, r) => (d[r] = e[r].default, d), {});
return Object.assign(f, u);
};
}
function _t(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 $l() {
function e(t, n) {
return t.selectItemById(n);
}
return {
selectItemById: e
};
}
function Dl() {
function e(t, n) {
const { columns: o } = n;
return t.updateColumns(o);
}
return {
updateColumns: e
};
}
const jl = /* @__PURE__ */ new Map([
["appearance", _t]
]);
function Ll(e, t, n) {
return t;
}
const Al = "https://json-schema.org/draft/2020-12/schema", Hl = "https://farris-design.gitee.io/property-editor.schema.json", Wl = "property-editor", Gl = "A Farris Component", zl = "object", ql = {
id: {
description: "The unique identifier for property-editor",
type: "string"
},
type: {
description: "The type string of property-editor",
type: "string",
default: "property-editor"
},
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
},
placeholder: {
description: "",
type: "string",
default: ""
},
readonly: {
description: "",
type: "boolean",
default: !1
},
require: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
visible: {
description: "",
type: "boolean",
default: !0
}
}, Ul = [
"id",
"type"
], Yl = {
$schema: Al,
$id: Hl,
title: Wl,
description: Gl,
type: zl,
properties: ql,
required: Ul
}, Xl = "property-editor", Kl = "A Farris Component", Zl = "object", Jl = {
basic: {
description: "Basic Infomation",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "waiting for modification",
enum: []
}
}
}
}
}, Ql = {
title: Xl,
description: Kl,
type: Zl,
categories: Jl
}, kn = {}, ei = lt(kn, Yl, jl, Ll, Ql), ke = b({
/** 常量值 */
constValue: {
/** 值类型:常量(const), 变量(variable), 状态机(state), 自定义(custom) */
type: "const",
/** 属性值 */
value: ""
},
/** 变量值 */
variableValue: {
type: "variable",
value: {
category: "",
path: "",
field: "",
fullPath: ""
}
},
/** 状态值 */
stateValue: null,
/** 自定义属性值 */
customValue: {
type: "custom",
value: ""
},
expressionValue: {
type: "expression",
/** 用户点击弹窗内确认按钮后置为true */
value: ""
},
stateMachineValue: {
type: "stateMachine",
value: ""
},
dataStatesValue: {
type: "dataStates",
value: ""
}
}), ti = b([
{
id: "const",
label: "常量"
},
{
id: "variable",
label: "变量"
},
{
id: "custom",
label: "自定义"
},
{
id: "stateMachine",
label: "状态机"
},
{
id: "expression",
label: "表达式"
},
{
id: "dataStates",
label: "数据状态"
}
]), ni = {
controlName: "userName",
propertyName: "readonly",
propertyType: "enum",
isNewVariable: !1,
propertyValue: {
// type: 'dataStates',
// value: undefined
type: "const",
value: "true"
},
editorOptions: {
types: ["const", "variable", "custom", "expression", "stateMachine", "dataStates"],
enums: [{ key: "true", value: "是" }, { key: "false", value: "否" }],
variables: [
{
category: "remote",
path: "root-component.isUserNameReadonly",
field: "49311371-fd9f-4019-8611-dce4dcae97fe",
fullPath: "isUserNameReadonly"
},
{
category: "remote",
path: "isSystem",
field: "49311371-fd9f-4019-8611-dce4dcae99fe",
fullPath: "isSystem"
}
],
expressionConfig: {
editor: "ExpressionEditorComponent",
beforeOpenModal: () => ({
editorParams: {
modalTitle: "只读编辑器",
fieldId: "ca30ad64-c9f6-4660-ad66-38073f6bd0b5",
viewModelId: "basic-form-viewmodel",
expType: "readonly"
},
value: "{'expr':'DefaultFunction.Length(\\'aaa\\')>2','sexpr':''}"
}),
exprValue: {
type: "expression",
value: {
type: "expression",
parameters: "ca30ad64-c9f6",
value: "{'expr':'DefaultFunction.Length(\\'aaa\\')>2','sexpr':''}"
}
}
},
stateMachine: [
{
id: "canRemove",
name: "删除",
exist: "非"
},
{
id: "canCancelApprove",
name: "取消提交审批",
exist: "是"
},
{
id: "canApprove",
name: "提交审批",
exist: "是"
},
{
id: "editable",
name: "可编辑",
exist: "是"
},
{
id: "canEdit",
name: "编辑",
exist: "是"
},
{
id: "canRemoveDetail",
name: "删除明细",
exist: "是"
},
{
id: "canAdd",
name: "新增",
exist: "是"
},
{
id: "canSave",
name: "保存",
exist: "是"
},
{
id: "canCancel",
name: "取消",
exist: "是"
},
{
id: "canAddDetail",
name: "新增明细",
exist: "是"
}
],
dataStates: [
{
textField: "制单",
titleField: "制单",
valueField: "Billing"
},
{
textField: "提交审批",
titleField: "提交审批",
valueField: "SubmitApproval"
},
{
textField: "审批通过",
titleField: "审批通过",
valueField: "Approved"
},
{
textField: "审批不通过",
titleField: "审批不通过",
valueField: "ApprovalNotPassed"
}
]
},
/** 状态机是否有前缀viewModel.stateMachine && */
hasPrefix: 2
}, oi = /* @__PURE__ */ new Map([
["appearance", _t]
]), ai = "https://json-schema.org/draft/2020-12/schema", li = "https://farris-design.gitee.io/combo-list.schema.json", ii = "combo-list", ri = "A Farris Input Component", si = "object", ui = {
id: {
description: "The unique identifier for a combo list",
type: "string"
},
type: {
description: "The type string of number combo list component",
type: "string",
default: "combo-list"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
disabled: {
description: "",
type: "boolean",
default: !1
},
enableClear: {
description: "",
type: "boolean",
default: !1
},
editable: {
description: "",
type: "boolean",
default: !1
},
enableLinkLabel: {
description: "",
type: "boolean",
default: !1
},
label: {
description: "",
type: "string",
default: ""
},
lableWidth: {
description: "",
type: "number"
},
placeholder: {
description: "",
type: "string",
default: "请选择"
},
idField: {
description: "",
type: "string",
default: "id"
},
valueField: {
description: "",
type: "string",
default: "id"
},
titleField: {
description: "",
type: "string",
default: "name"
},
textField: {
description: "",
type: "string",
default: "name"
},
dataSourceType: {
description: "",
type: "string",
default: "static"
},
data: {
description: "",
type: "array"
},
remote: {
description: "",
type: "string"
},
readonly: {
description: "",
type: "boolean",
default: !1
},
required: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
textAlign: {
description: "",
type: "string",
enum: [
"left",
"middle",
"right"
],
default: "left"
},
multiSelect: {
description: "",
type: "boolean",
default: !1
},
visible: {
description: "",
type: "boolean",
default: !0
},
onBlur: {
description: "",
type: "string",
default: ""
},
onClickLinkLabel: {
description: "",
type: "sting",
default: ""
},
maxHeight: {
description: "",
type: "number",
default: 350
},
minPanelWidth: {
description: "",
type: "number",
default: 160
},
popupOnClick: {
description: "",
type: "boolean",
default: !0
}
}, ci = [
"type"
], di = [
"id",
"appearance",
"binding",
"visible"
], fi = {
$schema: ai,
$id: li,
title: ii,
description: ri,
type: si,
properties: ui,
required: ci,
ignore: di
};
function pi(e, t, n) {
return t;
}
const on = {
/**
* 组件标识
*/
id: { type: String },
/**
* 下拉数据源
*/
data: { type: Array, default: [] },
/**
* 可选,展示文本
* 默认为空字符串 -----内部需要根据value重新生成展示文本,此属性不生效
* displayText: { type: String, default: '' },
*/
/**
* 可选,是否禁用
* 默认为`false`
*/
disabled: { default: !1, type: Boolean },
/**
* 可选,下拉图标
* 默认为'<span class="f-icon f-icon-arrow-60-down"></span>'
*/
dropDownIcon: { type: String, default: '<span class="f-icon f-icon-arrow-60-down"></span>' },
/**
* 可选,是否可编辑
* 默认`false`
*/
editable: { default: !1, type: Boolean },
/**
* 可选,是否启用清空
* 默认启用
*/
enableClear: { default: !0, type: Boolean },
/**
* 可选,启用搜索
* 默认为`false`
*/
enableSearch: { type: Boolean, default: !0 },
/**
* 可选,鼠标悬停时是否显示控件值
* 默认显示
*/
enableTitle: { default: !0, type: Boolean },
fitEditor: { default: !1, type: Boolean },
/**
* 可选,强制显示占位符
* 默认`false`
*/
forcePlaceholder: { default: !1, type: Boolean },
/**
* 可选,清空值时隐藏面板
* 默认`true`
*/
hidePanelOnClear: { default: !0, type: Boolean },
/**
* 可选,数据源id字段
* 默认为`id`
*/
idField: { default: "id", type: String },
/**
* 可选,字段映射
*/
mapFields: { type: Object },
/**
* 可选,最大高度
* 默认`350`
*/
maxHeight: { default: 350, type: Number },
/**
* 最大输入长度
*/
maxLength: { type: Number },
/**
* 可选,是否支持多选
* 默认`false`
*/
multiSelect: { type: Boolean, default: !1 },
/**
* 绑定值
*/
modelValue: {},
/**
* 占位符
*/
placeholder: { type: String, default: "请选择" },
/**
* 可选,下拉面板展示位置
* 默认为`auto`
*/
placement: {
type: String,
default: "auto"
/* auto */
},
/**
* 可选,是否只读
* 默认为`false`
*/
readonly: { default: !1, type: Boolean },
/**
* 远端数据源信息
*/
remote: { default: null, type: Object },
/**
* 可选,是否支持远端过滤
* 默认`false`
*/
remoteSearch: { default: !1, type: Boolean },
/**
* 可选,分隔符
* 默认`,`
*/
separator: { default: ",", type: String },
/**
* tabIndex
*/
tabIndex: { type: Number, default: -1 },
/**
* 可选,数据源显示字段
* 默认为`name`
*/
textField: { default: "name", type: String },
/**
* 可选,数据源的title
* 默认为`name`
*/
titleField: { default: "name", type: String },
/**
* 可选,数据源值字段
* 默认为`id`
*/
valueField: { default: "id", type: String },
/**
* 可选,启用多选下,下拉列表值在输入框中的展示方式
* 支持text | tag
* 因为ButtonEdit内部处理类型只有在批量的情况下才会有展示类型区分
*/
viewType: { default: "tag", type: String },
/**
* 值变化事件
*/
change: { type: Function, default: () => {
} },
/**
* 作为内嵌编辑器被创建后默认获得焦点
*/
focusOnCreated: { type: Boolean, default: !1 },
/**
* 作为内嵌编辑器被创建后默认选中文本
*/
selectOnCreated: { type: Boolean, default: !1 },
/**
* 此属性废弃
*/
autoHeight: { type: Boolean, default: !0 },
/**
* 打开前
*/
beforeOpen: { type: Function, default: null },
searchOption: {
type: [Boolean, Function],
default: !1
},
// 搜索启用高亮
enableHighlightSearch: { type: Boolean, default: !0 },
minPanelWidth: { type: Number, default: 160 },
popupOnClick: { type: Boolean, default: !0 }
}, mi = Object.assign({}, on, {
readonly: {}
}), Bn = lt(on, fi, oi, pi), vi = {
dataSource: { type: Array, default: [] },
enableSearch: { type: Boolean, default: !1 },
idField: { type: String, default: "id" },
multiSelect: { type: Boolean, default: !1 },
selectedValues: { type: String, default: "" },
separator: { type: String, default: "," },
textField: { type: String, default: "name" },
titleField: { type: String, default: "name" },
width: { type: Number },
maxHeight: { type: Number },
valueField: { type: String, default: "id" },
/** 值变化事件 */
onSelectionChange: { type: Function, default: () => {
} },
searchOption: {
type: [Boolean, Function],
default: !1
},
// 搜索启用高亮
enableHighlightSearch: { type: Boolean, default: !0 }
}, hi = /* @__PURE__ */ Be({
name: "FComboListContainer",
props: vi,
emits: ["selectionChange"],
setup(e, t) {
const n = b(), o = b(e.dataSource), a = b([]), l = b(e.separator), i = b(e.width), s = b(e.maxHeight), u = b(String(e.selectedValues).split(l.value)), f = O(() => e.multiSelect), d = O(() => ({
enableSelectRow: !0,
multiSelect: e.multiSelect,
multiSelectMode: "OnCheckAndClick",
showCheckbox: f.value,
showSelectAll: !1,
showSelection: !0
}));
ye(e.dataSource, () => {
o.value = e.dataSource;
}), O(() => e.enableSearch ? "SearchBar" : "ContentHeader");
const r = O(() => {
const y = {};
return i.value !== void 0 && (y.width = `${i.value}px`), s.value !== void 0 && s.value > 0 && (y.maxHeight = `${s.value}px`), y;
});
function c(y) {
n.value.search(y);
}
function m(y) {
a.value = y.map((v) => Object.assign({}, v)), u.value = y.map((v) => v[e.idField]), t.emit("selectionChange", a.value);
}
function h(y) {
if (e.enableHighlightSearch)
return;
let v = [];
const {
searchOption: C
} = e;
typeof C == "function" ? v = o.value.filter((_) => C(y, _)) : v = o.value.filter((_) => _[e.valueField].indexOf(y) > -1 || _[e.textField].indexOf(y) > -1), n.value.updateDataSource(v);
}
ye([() => e.selectedValues], ([y]) => {
u.value = y.split(l.value);
});
function V(y) {
n.value.activeRowById(y);
}
return je(() => {
e.multiSelect || V(u.value[0]);
}), t.expose({
search: c,
activeRowById: V
}), () => F("div", {
class: "f-combo-list-container",
style: r.value
}, [F(Sn, {
ref: n,
size: "small",
itemClass: "f-combo-list-item",
itemContentClass: "text-truncate",
header: "ContentHeader",
headerClass: "f-combo-list-search-box",
data: o.value,
idField: e.idField,
textField: e.textField,
titleField: e.titleField,
multiSelect: e.multiSelect,
selection: d.value,
enableHighlightSearch: e.enableHighlightSearch,
selectionValues: u.value,
onSelectionChange: m,
onAfterSearch: h
}, null)]);
}
});
function gi(e) {
const t = b(""), n = b(e.modelValue), o = b(e.data || []), a = b(e.editable);
function l(r) {
const c = e.multiSelect ? String(r).split(e.separator) : [String(r)], m = c.map((y) => [y, !0]), h = new Map(m);
return o.value.filter((y) => h.has(String(y[e.valueField]))).sort((y, v) => {
const C = c.indexOf(y[e.valueField]), _ = c.indexOf(v[e.valueField]);
return C - _;
});
}
function i(r) {
const c = l(r).map((m) => m[e.textField]).join(e.separator);
t.value = a.value ? c || r : c;
}
function s(r) {
const c = r.split(e.separator).map((h) => [h, !0]), m = new Map(c);
return o.value.filter((h) => m.has(h[e.textField]));
}
function u(r) {
const c = {};
return c[e.idField] = r, c[e.textField] = r, [c];
}
function f(r) {
let c = s(r);
const m = c && c.length > 0;
return a.value && !m && (c = u(r)), c;
}
function d() {
const { url: r, method: c = "GET", headers: m = {}, body: h = null } = e.remote, V = c.toLowerCase() === "get" ? { method: c, headers: m } : { method: c, headers: m, body: h };
let y = !1;
fetch(r, V).then((v) => {
var _, g;
if (v.status === 200)
return y = !!((g = (_ = v.headers) == null ? void 0 : _.get("content-type")) != null && g.includes("application/json")), y ? v.text() : v.json();
throw new Error(v.statusText);
}).then((v) => {
o.value = y ? JSON.parse(v) : v;
}).catch((v) => {
console.error(v);
});
}
return e.remote && d(), ye(() => e.data, () => {
o.value = e.data;
}), ye([o], ([r]) => {
if (e.modelValue != null) {
const c = r.find((m) => m[e.valueField] === e.modelValue);
c && (t.value = c[e.textField]);
}
}), ye(() => e.modelValue, (r) => {
n.value = r, i(r);
}), i(e.modelValue), { dataSource: o, displayText: t, editable: a, modelValue: n, getItemsByDisplayText: s, getItemsByValue: l, getSelectedItemsByDisplayText: f };
}
const pt = /* @__PURE__ */ Be({
name: "FComboList",
props: on,
emits: ["clear", "update:modelValue", "change", "input"],
setup(e, t) {
const n = b(), o = b(), a = b(e.disabled), l = b(e.enableClear), i = b(e.enableSearch), s = b(e.readonly);
let u = "";
const {
dataSource: f,
displayText: d,
editable: r,
modelValue: c,
getSelectedItemsByDisplayText: m
} = gi(e), h = O(() => e.multiSelect), V = O(() => o.value ? o.value.elementRef.getBoundingClientRect().width : 0);
function y() {
!h.value && o.value && o.value.hidePopup();
}
function v(w) {
d.value = w.map((T) => T[e.textField]).join(e.separator);
let I = "";
w.length === 1 ? I = w[0][e.valueField] : I = w.map((T) => T[e.valueField]).join(e.separator), c.value !== I && (c.value = I, t.emit("update:modelValue", c.value), t.emit("change", w, c.value));
}
function C() {
const w = m(u);
v(w);
}
function _() {
s.value || (u = d.value);
}
function g(w) {
c.value = "", n.value.activeRowById(""), t.emit("update:modelValue", ""), t.emit("clear");
}
function S(w) {
e.enableSearch ? (n.value.search(w), n.value.activeRowById(w)) : (c.value = w, d.value = w, t.emit("update:modelValue", c.value), t.emit("change", [w], w));
}
function E() {
return d.value;
}
function p(w) {
S(w), t.emit("input", w);
}
function x() {
o.value.hidePopup();
}
return t.expose({
getDisplayText: E,
hidePopup: x
}), ye([() => e.disabled, () => e.editable, () => e.enableClear, () => e.enableSearch, () => e.readonly], ([w, I, T, P, N]) => {
a.value = w, r.value = I, l.value = T, i.value = P, s.value = N;
}), () => F(xn, {
ref: o,
id: e.id,
disable: a.value,
readonly: s.value,
forcePlaceholder: e.forcePlaceholder,
editable: r.value,
buttonContent: e.dropDownIcon,
placeholder: e.placeholder,
enableClear: l.value,
maxLength: e.maxLength,
tabIndex: e.tabIndex,
enableTitle: e.enableTitle,
multiSelect: e.multiSelect,
inputType: e.multiSelect ? e.viewType : "text",
modelValue: d.value,
"onUpdate:modelValue": (w) => d.value = w,
focusOnCreated: e.focusOnCreated,
selectOnCreated: e.selectOnCreated,
onClear: g,
onClick: _,
onBlur: C,
onInput: p,
beforeOpen: e.beforeOpen,
placement: e.placement,
popupMinWidth: e.minPanelWidth,
popupClass: "f-combo-list-wrapper",
popupOnClick: e.popupOnClick
}, {
default: () => [F(hi, {
ref: n,
idField: e.idField,
valueField: e.valueField,
textField: e.textField,
titleField: e.titleField,
dataSource: f.value,
selectedValues: c.value,
multiSelect: e.multiSelect,
enableSearch: i.value,
maxHeight: e.maxHeight,
enableHighlightSearch: e.enableHighlightSearch,
width: e.fitEditor ? V.value : void 0,
onSelectionChange: (w) => {
v(w), y();
}
}, null)]
});
}
}), yi = /* @__PURE__ */ new Map([
["appearance", Eo]
]);
function bi(e, t, n) {
return t;
}
const Ci = "https://json-schema.org/draft/2020-12/schema", wi = "https://farris-design.gitee.io/button-edit.schema.json", Si = "button-edit", xi = "A Farris Input Component", _i = "object", Ti = {
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: ""
}
}, Fi = [
"id",
"type"
], Vi = {
$schema: Ci,
$id: wi,
title: Si,
description: xi,
type: _i,
properties: Ti,
required: Fi
}, Ii = "buttonEdit", Ei = "A Farris Component", ki = "object", Bi = {
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: "右对齐"
}
]
}
}
}
}
}, Mi = {
title: Ii,
description: Ei,
type: ki,
categories: Bi
}, Mn = {
/**
* 组件标识
*/
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 }
};
lt(Mn, Vi, yi, bi, Mi);
const Oi = {
popupContentPosition: { type: Object, default: { left: 0, top: 0 } },
host: { type: Object },
backgroundColor: { type: String, default: "" }
}, Ni = /* @__PURE__ */ Be({
name: "FOverlay",
props: Oi,
emits: ["click"],
setup(e, t) {
const n = b(e.popupContentPosition), o = b(e.host), a = O(() => ({
backgroundColor: e.backgroundColor || "",
pointerEvents: "auto"
}));
function l(s) {
t.emit("click"), s.preventDefault(), s.stopPropagation();
}
O(() => {
const s = o.value;
if (s) {
const u = s.getBoundingClientRect(), {
left: f,
top: d,
height: r
} = u;
return {
left: f,
top: d + r
};
}
return n.value;
});
const i = O(() => ({
// position: 'relative',
// left: `${position.value.left}px`,
// top: `${position.value.top}px`
}));
return () => F(yn, {
to: "body"
}, {
default: () => {
var s, u;
return [F("div", {
class: "overlay-container",
onClick: (f) => l(f),
style: a.value
}, [F("div", {
style: i.value
}, [(u = (s = t.slots).default) == null ? void 0 : u.call(s)])])];
}
});
}
});
function Ri(e) {
if (e.content && e.content.render)
return e.content.render;
if (e.render && typeof e.render == "function")
return e.render;
}
function Pi(e) {
const t = document.createElement("div");
t.style.display = "contents";
let n;
const o = e.onClickCallback || (() => {
}), a = () => {
o(), n && n.unmount();
};
return n = en({
setup() {
Mt(() => {
document.body.removeChild(t);
});
const l = Ri(e);
return () => F(Ni, {
"popup-content-position": e.popupPosition,
host: e.host,
onClick: a,
backgroundColor: e.backgroundColor
}, {
default: () => [l && l()]
});
}
}), document.body.appendChild(t), n.mount(t), n;
}
class $i {
static show(t) {
return Pi(t);
}
}
const Di = {
/**
* 自定义类
*/
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 Re {
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), l = parseInt(o[5], 10);
return { x: a, y: l };
}
return { x: 0, y: 0 };
}
static fromEvent(t, n = null) {
if (this.isMouseEvent(t))
return new Re(t.clientX, t.clientY);
if (n === null || t.changedTouches.length === 1)
return new Re(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 Re(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 Re(0, 0);
if (window) {
const o = window.getComputedStyle(t);
if (o) {
const a = parseInt(o.getPropertyValue("left"), 10), l = parseInt(o.getPropertyValue("top"), 10);
n.x = isNaN(a) ? 0 : a, n.y = isNaN(l) ? 0 : l;
}
return n;
}
return null;
}
static copy(t) {
return new Re(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 Ct {
constructor(t, n) {
this.width = t, this.height = n;
}
static getCurrent(t) {
const n = new Ct(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 Ct(0, 0).set(t);
}
set(t) {
return this.width = t.width, this.height = t.height, this;
}
}
function ji(e, t) {
const n = b(), o = b(), a = b(), l = b(), i = b(), s = b(), u = b(), f = b(), d = b(), r = b(), c = b(), m = b(), h = b(e.draggable), V = b(!1);
function y() {
const B = o.value || document.body, D = window.getComputedStyle(B);
if (!D || !n.value)
return;
const W = Re.getTransformInfo(n.value), Z = {};
u.value && (Z.deltaL = n.value.offsetLeft - u.value.x, Z.deltaT = n.value.offsetTop - u.value.y);
const oe = D.getPropertyValue("position");
Z.width = B.clientWidth, Z.height = B.clientHeight, Z.pr = parseInt(D.getPropertyValue("padding-right"), 10), Z.pb = parseInt(D.getPropertyValue("padding-bottom"), 10), Z.position = D.getPropertyValue("position"), oe === "static" && (B.style.position = "relative"), Z.translateX = W.x, Z.translateY = W.y, r.value = Z;
}
function v(B) {
if (n.value) {
l.value = Ct.getCurrent(n.value), i.value = Re.getCurrent(n.value), s.value = l.value ? Ct.copy(l.value) : null, u.value = i.value ? Re.copy(i.value) : null, y();
const D = B.target.getAttribute("type") || "";
f.value = {
n: !!D.match(/n/),
s: !!D.match(/s/),
w: !!D.match(/w/),
e: !!D.match(/e/)
};
}
}
function C() {
var B, D, W, Z;
if (n.value) {
const oe = n.value;
f.value && ((f.value.n || f.value.s) && ((B = s.value) != null && B.height) && (oe.style.height = s.value.height + "px"), (f.value.w || f.value.e) && ((D = s.value) != null && D.width) && (oe.style.width = s.value.width + "px"), u.value && ((W = u.value) != null && W.x && (oe.style.left = u.value.x + "px"), (Z = u.value) != null && Z.y && (oe.style.top = u.value.y + "px")));
}
}
function _() {
const B = e.minHeight ? e.minHeight : 1, D = e.minWidth ? e.minWidth : 1;
s.value && u.value && f.value && l.value && (s.value.height < B && (s.value.height = B, f.value.n && i.value && (u.value.y = i.value.y + (l.value.height - B))), s.value.width < D && (s.value.width = D, f.value.w && i.value && (u.value.x = i.value.x + (l.value.width - D))), e.maxHeight && s.value.height > e.maxHeight && (s.value.height = e.maxHeight, i.value && f.value.n && (u.value.y = i.value.y + (l.value.height - e.maxHeight))), e.maxWidth && s.value.width > e.maxWidth && (s.value.width = e.maxWidth, f.value.w && i.value && (u.value.x = i.value.x + (l.value.width - e.maxWidth))));
}
function g() {
if (o.value) {
const B = r.value;
if (u.value && s.value && f.value && l.value) {
const D = B.width - B.pr - B.deltaL - B.translateX - u.value.x, W = B.height - B.pb - B.deltaT - B.translateY - u.value.y;
f.value.n && u.value.y + B.translateY < 0 && i.value && (u.value.y = -B.translateY, s.value.height = l.value.height + i.value.y + B.translateY), f.value.w && u.value.x + B.translateX < 0 && i.value && (u.value.x = -B.translateX, s.value.width = l.value.width + i.value.x + B.translateX), s.value.width > D && (s.value.width = D), s.value.height > W && (s.value.height = W);
}
}
}
function S(B) {
if (!a.value || !l.value || !i.value || !f.value)
return;
B.subtract(a.value);
const D = B.x, W = B.y;
f.value.n ? (u.value.y = i.value.y + W, s.value.height = l.value.height - W) : f.value.s && (s.value.height = l.value.height + W), f.value.e ? s.value.width = l.value.width + D : f.value.w && (s.value.width = l.value.width - D, u.value.x = i.value.x + D), g(), _(), C();
}
function E(B) {
if (!d.value)
return;
const D = Re.fromEvent(B);
D && S(D);
}
function p() {
if (n.value) {
const {
width: B,
height: D,
x: W,
y: Z
} = n.value.getBoundingClientRect(), oe = Re.getTransformInfo(n.value);
return {
size: {
width: B,
height: D
},
position: {
x: W - oe.x,
y: Z - oe.y
}
};
}
return null;
}
function x(B) {
if (n.value) {
const D = p();
c.value = D;
}
a.value = void 0, l.value = null, i.val