@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,531 lines • 425 kB
JavaScript
var Qo = Object.defineProperty;
var Ko = (n, t, e) => t in n ? Qo(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
var L = (n, t, e) => Ko(n, typeof t != "symbol" ? t + "" : t, e);
import { defineComponent as Qe, ref as S, onUnmounted as qt, createVNode as E, createTextVNode as Oe, computed as q, watch as Fe, Fragment as Mt, reactive as wt, createApp as Qn, onMounted as It, Transition as Kn, mergeProps as Lt, onBeforeUnmount as Jn, withDirectives as Zn, resolveDirective as Jo, inject as Et, provide as Zo, triggerRef as er, isVNode as tr, nextTick as en, onBeforeMount as Sn, Teleport as nr, shallowRef as or, render as dn, h as rr, cloneVNode as ir, vModelText as ar } from "vue";
import { isPlainObject as Bn, cloneDeep as at, isUndefined as dt, throttle as sr } from "lodash-es";
import { useResizeObserver as eo } from "@vueuse/core";
import { useIdentify as lr, useGroupData as ur, useFilter as cr, useHierarchy as dr, useLoading as fr, useDataView as pr, useSelection as mr, useSelectHierarchyItem as hr, useDataViewContainerStyle as vr, useCommandColumn as gr, useColumn as yr, useSort as br, useGroupColumn as wr, useRow as Cr, useEdit as xr, useVisualDataBound as _r, useVisualDataCell as Sr, useVisualDataRow as Tr, useVisualData as Fr, useCellPosition as Er, useSidebar as Mr, useVirtualScroll as kr, useFitColumn as Ir, useFilterHistory as Or, useColumnFilter as Dr, useDragColumn as Vr, getColumnHeader as Pr, getSidebar as Br, getDisableMask as Nr, getHorizontalScrollbar as Rr, getVerticalScrollbar as Lr, getEmpty as jr } from "../data-view/index.esm.js";
import "../modal/index.esm.js";
import $r from "../transfer/index.esm.js";
import Wr from "../tabs/index.esm.js";
import Hr from "../order/index.esm.js";
import "../condition/index.esm.js";
import { FCheckbox as Ar } from "../checkbox/index.esm.js";
import { useGuid as Gr, resolveField as it, FormSchemaEntityFieldTypeName as Nn, getCustomClass as fn, useCommonUtils as qr, useDateFormat as zr, useNumberFormat as Yr, setFieldValue as vn, withInstall as Ur } from "../common/index.esm.js";
import Xr from "../filter-bar/index.esm.js";
import Rn from "../tooltip/index.esm.js";
import Qr from "../pagination/index.esm.js";
import Kr from "../button/index.esm.js";
import Jr from "../search-box/index.esm.js";
import Zr from "../tags/index.esm.js";
import ei, { FDynamicFormGroup as ti, FDynamicFormInput as ni } from "../dynamic-form/index.esm.js";
import { createPropsResolver as oi } from "../dynamic-resolver/index.esm.js";
import { DgControl as $t } from "../designer-canvas/index.esm.js";
import { FormBindingType as ri } from "../property-panel/index.esm.js";
import ii from "../accordion/index.esm.js";
import ai from "../avatar/index.esm.js";
import si from "../../designer/button-edit/index.esm.js";
import li from "../button-group/index.esm.js";
import ui from "../calendar/index.esm.js";
import ci from "../capsule/index.esm.js";
import Ln from "../../designer/checkbox/index.esm.js";
import jn from "../../designer/checkbox-group/index.esm.js";
import gn from "../combo-list/index.esm.js";
import di from "../combo-tree/index.esm.js";
import fi from "../component/index.esm.js";
import pi from "../color-picker/index.esm.js";
import mi from "../content-container/index.esm.js";
import hi from "../date-picker/index.esm.js";
import vi from "../../designer/data-grid/index.esm.js";
import gi from "../dropdown/index.esm.js";
import yi from "../events-editor/index.esm.js";
import bi from "../field-selector/index.esm.js";
import wi from "../binding-selector/index.esm.js";
import Ci from "../image-cropper/index.esm.js";
import xi from "../../designer/input-group/index.esm.js";
import _i from "../layout/index.esm.js";
import Si from "../list-nav/index.esm.js";
import Ti from "../list-view/index.esm.js";
import Fi from "../lookup/index.esm.js";
import Ei from "../mapping-editor/index.esm.js";
import Mi from "../nav/index.esm.js";
import ki from "../number-range/index.esm.js";
import Ii from "../number-spinner/index.esm.js";
import Oi from "../page-header/index.esm.js";
import Di from "../page-footer/index.esm.js";
import Vi from "../progress/index.esm.js";
import Pi from "../query-solution/index.esm.js";
import Bi from "../../designer/radio-group/index.esm.js";
import Ni from "../rate/index.esm.js";
import Ri from "../response-toolbar/index.esm.js";
import Li from "../response-layout/index.esm.js";
import ji from "../response-layout-editor/index.esm.js";
import $i from "../section/index.esm.js";
import Wi from "../smoke-detector/index.esm.js";
import Hi from "../splitter/index.esm.js";
import Ai from "../step/index.esm.js";
import Gi from "../switch/index.esm.js";
import qi from "../text/index.esm.js";
import zi from "../time-picker/index.esm.js";
import Yi from "../tree-view/index.esm.js";
import Ui from "../uploader/index.esm.js";
import Xi from "../verify-detail/index.esm.js";
import Qi from "../video/index.esm.js";
import Ki from "../textarea/index.esm.js";
import Ji from "../schema-selector/index.esm.js";
import to from "../tree-grid/index.esm.js";
import Zi from "../event-parameter/index.esm.js";
import ea from "../filter-condition-editor/index.esm.js";
import ta from "../fieldset/index.esm.js";
import na from "../sort-condition-editor/index.esm.js";
import oa from "../menu-lookup/index.esm.js";
import ra from "../drawer/index.esm.js";
import ia from "../json-editor/index.esm.js";
import aa from "../property-editor/index.esm.js";
import sa from "../expression-editor/index.esm.js";
import la from "../code-editor/index.esm.js";
import ua from "../html-template/index.esm.js";
import "../external-container/index.esm.js";
import { FNotifyService as ca } from "../notify/index.esm.js";
import "bignumber.js";
const Tn = {}, no = {};
function Fn(n) {
const { properties: t, title: e, ignore: o } = n, r = o && Array.isArray(o), i = Object.keys(t).reduce((a, s) => ((!r || !o.find((l) => l === s)) && (a[s] = t[s].type === "object" && t[s].properties ? Fn(t[s]) : at(t[s].default)), a), {});
if (e && (!r || !o.find((a) => a === "id"))) {
const a = e.toLowerCase().replace(/-/g, "_");
i.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return i;
}
function da(n) {
const { properties: t, title: e, required: o } = n;
if (o && Array.isArray(o)) {
const r = o.reduce((i, a) => (i[a] = t[a].type === "object" && t[a].properties ? Fn(t[a]) : at(t[a].default), i), {});
if (e && o.find((i) => i === "id")) {
const i = e.toLowerCase().replace(/-/g, "_");
r.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return r;
}
return {
type: e
};
}
function Xt(n, t = {}, e) {
const o = Tn[n];
if (o) {
let r = da(o);
const i = no[n];
return r = i ? i({ getSchemaByType: Xt }, r, t, e) : r, r;
}
return null;
}
function fa(n, t) {
const e = Fn(t);
return Object.keys(e).reduce((o, r) => (Object.prototype.hasOwnProperty.call(n, r) && (o[r] && Bn(o[r]) && Bn(n[r] || !n[r]) ? Object.assign(o[r], n[r] || {}) : o[r] = n[r]), o), e), e;
}
function oo(n, t) {
return Object.keys(n).filter((o) => n[o] != null).reduce((o, r) => {
if (t.has(r)) {
const i = t.get(r);
if (typeof i == "string")
o[i] = n[r];
else {
const a = i(r, n[r], n);
Object.assign(o, a);
}
} else
o[r] = n[r];
return o;
}, {});
}
function pa(n, t, e = /* @__PURE__ */ new Map()) {
const o = fa(n, t);
return oo(o, e);
}
function ma(n = {}) {
function t(u, c, d, h) {
if (typeof d == "number")
return h[u].length === d;
if (typeof d == "object") {
const b = Object.keys(d)[0], p = d[b];
if (b === "not")
return Number(h[u].length) !== Number(p);
if (b === "moreThan")
return Number(h[u].length) >= Number(p);
if (b === "lessThan")
return Number(h[u].length) <= Number(p);
}
return !1;
}
function e(u, c, d, h) {
return h[u] && h[u].propertyValue && String(h[u].propertyValue.value) === String(d);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", e]
]);
Object.keys(n).reduce((u, c) => (u.set(c, n[c]), u), o);
function r(u, c) {
const d = u;
return typeof c == "number" ? [{ target: d, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: d, operator: "getProperty", param: u, value: !!c }] : typeof c == "object" ? Object.keys(c).map((h) => {
if (h === "length")
return { target: d, operator: "length", param: null, value: c[h] };
const b = h, p = c[h];
return { target: d, operator: "getProperty", param: b, value: p };
}) : [];
}
function i(u) {
return Object.keys(u).reduce((d, h) => {
const b = r(h, u[h]);
return d.push(...b), d;
}, []);
}
function a(u, c) {
if (o.has(u.operator)) {
const d = o.get(u.operator);
return d && d(u.target, u.param, u.value, c) || !1;
}
return !1;
}
function s(u, c) {
return i(u).reduce((b, p) => b && a(p, c), !0);
}
function l(u, c) {
const d = Object.keys(u), h = d.includes("allOf"), b = d.includes("anyOf"), p = h || b, m = (p ? u[p ? h ? "allOf" : "anyOf" : "allOf"] : [u]).map((w) => s(w, c));
return h ? !m.includes(!1) : m.includes(!0);
}
return { parseValueSchema: l };
}
const de = {
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: "标签页工具栏按钮" },
"html-template": { type: "html-template", name: "模板容器" },
"time-picker": { type: "time-picker", name: "时间选择" },
section: { type: "section", name: "分组面板" },
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
splitter: { type: "splitter", name: "分栏面板" },
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
"component-ref": { type: "component-ref", name: "组件引用节点" },
uploader: { type: "uploader", name: "附件上传" },
"page-header": { type: "page-header", name: "页头" },
"page-footer": { type: "page-footer", name: "页脚" },
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
fieldset: { type: "fieldset", name: "分组" },
"query-solution": { type: "query-solution", name: "筛选方案" },
drawer: { type: "drawer", name: "抽屉" },
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
"list-nav": { type: "list-nav", name: "列表导航" },
"filter-bar": { type: "filter-bar", name: "筛选条" }
}, ha = {}, va = {};
ma();
function jt(n, t, e = /* @__PURE__ */ new Map(), o = (a, s, l, u) => s, r = {}, i = (a) => a) {
return Tn[t.title] = t, no[t.title] = o, ha[t.title] = r, va[t.title] = i, (a = {}, s = !0) => {
if (!s)
return oo(a, e);
const l = pa(a, t, e), u = Object.keys(n).reduce((c, d) => (c[d] = n[d].default, c), {});
return Object.assign(u, l);
};
}
function cn(n, t) {
return { customClass: t.class, customStyle: t.style };
}
function ga() {
function n(t, e) {
const { dataSource: o } = t || {};
return o === void 0 ? {} : {};
}
return {
resolve: n
};
}
function ya() {
function n(t, e) {
return t.selectItemById(e);
}
return {
selectItemById: n
};
}
function ba() {
function n(t, e) {
const { columns: o } = e;
return t.updateColumns(o);
}
return {
updateColumns: n
};
}
const wa = "https://json-schema.org/draft/2020-12/schema", Ca = "https://farris-design.gitee.io/video.schema.json", xa = "video", _a = "A Farris Video Component", Sa = "object", Ta = {
id: {
description: "The unique identifier for a Video",
type: "string"
},
type: {
description: "The type string of Video component",
type: "string",
default: "video"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
visible: {
description: "",
type: "boolean",
default: !0
}
}, Fa = [
"id",
"type"
], Ea = {
$schema: wa,
$id: Ca,
title: xa,
description: _a,
type: Sa,
properties: Ta,
required: Fa
}, Ma = /* @__PURE__ */ new Map([
["appearance", cn]
]);
function ka(n, t, e) {
return t;
}
const Ia = "verify-detail", Oa = "A Farris Component", Da = "object", Va = {
basic: {
description: "Basic Infomation",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "waiting for modification",
enum: []
}
}
}
}
}, Pa = {
title: Ia,
description: Oa,
type: Da,
categories: Va
}, En = {
src: {
type: String,
required: !0,
default: ""
},
autoplay: {
type: Boolean,
default: !0
},
controls: {
type: Boolean,
default: !0
},
loop: {
type: Boolean,
default: !1
},
muted: {
type: Boolean,
default: !1
},
preload: {
type: String,
default: "none"
},
poster: {
type: String
},
width: {
type: [String, Number],
default: 300
},
height: {
type: [String, Number],
default: 168
}
}, $n = jt(En, Ea, Ma, ka, Pa);
function Ba(n, t) {
function e(g) {
g.stopPropagation(), t.emit("abort");
}
function o(g) {
g.stopPropagation(), t.emit("play");
}
function r(g) {
g.stopPropagation(), t.emit("pause");
}
function i(g) {
g.stopPropagation(), t.emit("ended");
}
function a(g) {
g.stopPropagation(), t.emit("durationchange");
}
function s(g) {
g.stopPropagation(), t.emit("error");
}
function l(g) {
g.stopPropagation(), t.emit("loadeddata");
}
function u(g) {
g.stopPropagation(), t.emit("loadedmetadata");
}
function c(g) {
g.stopPropagation(), t.emit("loadstart");
}
function d(g) {
g.stopPropagation(), t.emit("playing");
}
function h(g) {
g.stopPropagation(), t.emit("progress");
}
function b(g) {
g.stopPropagation(), t.emit("timeupdate");
}
function p(g) {
g.stopPropagation(), t.emit("volumechange");
}
function I(g) {
g.stopPropagation(), t.emit("canplay");
}
return {
onAbort: e,
onPlay: o,
onPause: r,
onEnded: i,
onDurationchange: a,
onError: s,
onLoadeddata: l,
onLoadedmetadata: u,
onLoadstart: c,
onPlaying: d,
onProgress: h,
onTimeupdate: b,
onVolumechange: p,
onCanplay: I
};
}
const pn = /* @__PURE__ */ Qe({
name: "FVideo",
props: En,
emits: ["abort", "play", "pause", "ended", "durationchange", "canplay", "error", "loadeddata", "loadedmetadata", "loadstart", "playing", "progress", "timeupdate", "volumechange"],
setup(n, t) {
const e = S(), {
onAbort: o,
onPlay: r,
onPause: i,
onEnded: a,
onDurationchange: s,
onError: l,
onLoadeddata: u,
onLoadedmetadata: c,
onLoadstart: d,
onPlaying: h,
onProgress: b,
onTimeupdate: p,
onVolumechange: I,
onCanplay: g
} = Ba(n, t);
return qt(() => {
}), () => E("video", {
ref: e,
src: n.src,
autoplay: n.autoplay,
controls: n.controls,
loop: n.loop,
muted: n.muted,
width: n.width,
height: n.height,
poster: n.poster,
onAbort: (m) => o(m),
onPlay: (m) => r(m),
onPause: (m) => i(m),
onEnded: (m) => a(m),
onDurationchange: (m) => s(m),
onError: (m) => l(m),
onLoadeddata: (m) => u(m),
onLoadedmetadata: (m) => c(m),
onLoadstart: (m) => d(m),
onPlaying: (m) => h(m),
onProgress: (m) => b(m),
onTimeupdate: (m) => p(m),
onVolumechange: (m) => I(m),
onCanplay: (m) => g(m)
}, [Oe("Your browser does not support the video tag.")]);
}
});
function ro(n, t, e) {
var f;
const o = e && e.getStyles && e.getStyles() || "", r = e && e.getDesignerClass && e.getDesignerClass() || "", i = S();
function a() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanMoveComponent ? e.checkCanMoveComponent() : !0;
}
function s() {
return !1;
}
function l() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanDeleteComponent ? e.checkCanDeleteComponent() : !0;
}
function u() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : e && e.hideNestedPaddingInDesginerView ? e.hideNestedPaddingInDesginerView() : !1;
}
function c(y) {
if (!y || !y.value)
return null;
if (y.value.schema && y.value.schema.type === "component")
return y.value;
const C = S(y == null ? void 0 : y.value.parent), T = c(C);
return T || null;
}
function d(y = t) {
var O;
if (e != null && e.getDraggableDesignItemElement)
return e.getDraggableDesignItemElement(y);
const { componentInstance: C, designerItemElementRef: T } = y;
if (!C || !C.value)
return null;
const { getCustomButtons: v } = C.value;
return C.value.canMove || v && ((O = v()) != null && O.length) ? T : d(y.parent);
}
function h(y) {
return !!e && e.canAccepts(y);
}
function b() {
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
}
function p() {
}
function I(y, C) {
var T;
!y || !C || (e != null && e.onAcceptMovedChildElement && e.onAcceptMovedChildElement(y, C), (T = t == null ? void 0 : t.setupContext) == null || T.emit("dragEnd"));
}
function g(y, C) {
const { componentType: T } = y;
let v = Xt(T, y, C);
e && e.onResolveNewComponentSchema && (v = e.onResolveNewComponentSchema(y, v));
const O = T.toLowerCase().replace(/-/g, "_");
return v && !v.id && v.type === T && (v.id = `${O}_${Math.random().toString().slice(2, 6)}`), v;
}
function m(y) {
y && e != null && e.onChildElementMovedOut && e.onChildElementMovedOut(y);
}
function x(...y) {
if (e && e.getPropsConfig)
return e.getPropsConfig(...y);
}
function w(y) {
if (!y)
return;
const C = t == null ? void 0 : t.schema, { formSchemaUtils: T } = y;
if (C && T.getExpressions().length) {
const v = T.getExpressions().findIndex((O) => O.target === C.id);
v > -1 && T.getExpressions().splice(v, 1);
}
}
function F(y) {
e && e.onRemoveComponent && e.onRemoveComponent(), w(y), t != null && t.schema.contents && t.schema.contents.map((C) => {
let T = C.id;
C.type === "component-ref" && (T = C.component);
const v = n.value.querySelectorAll(`#${T}-design-item`);
v != null && v.length && Array.from(v).map((O) => {
var V;
(V = O == null ? void 0 : O.componentInstance) != null && V.value.onRemoveComponent && O.componentInstance.value.onRemoveComponent(y);
});
});
}
function M() {
if (e && e.getCustomButtons)
return e.getCustomButtons();
}
function _(y) {
if (e && e.onPropertyChanged)
return e.onPropertyChanged(y);
}
return i.value = {
canMove: a(),
canSelectParent: s(),
canDelete: l(),
canNested: !u(),
contents: t == null ? void 0 : t.schema.contents,
elementRef: n,
parent: (f = t == null ? void 0 : t.parent) == null ? void 0 : f.componentInstance,
schema: t == null ? void 0 : t.schema,
styles: o,
designerClass: r,
canAccepts: h,
getBelongedComponentInstance: c,
getDraggableDesignItemElement: d,
getDraggingDisplayText: b,
getPropConfig: x,
getDragScopeElement: p,
onAcceptMovedChildElement: I,
onChildElementMovedOut: m,
addNewChildComponentSchema: g,
triggerBelongedComponentToMoveWhenMoved: !!e && e.triggerBelongedComponentToMoveWhenMoved || S(!1),
triggerBelongedComponentToDeleteWhenDeleted: !!e && e.triggerBelongedComponentToDeleteWhenDeleted || S(!1),
onRemoveComponent: F,
getCustomButtons: M,
onPropertyChanged: _
}, i;
}
class Na {
getTemplateRule(t, e) {
const o = e == null ? void 0 : e.formSchemaUtils, r = o == null ? void 0 : o.getFormTemplateRule(), i = { canAccept: !0, canDelete: !0, canMove: !0 };
if (!r)
return i;
const a = this.getComponentContext(t), { componentClassList: s } = a;
return s.forEach((l) => {
if (!l || !r[l])
return;
const { canMove: u, canDelete: c, canAccept: d } = r[l];
i.canMove = i.canMove && this.resolveRuleValue(u, a), i.canDelete = i.canDelete && this.resolveRuleValue(c, a), i.canAccept = i.canAccept && this.resolveRuleValue(d, a);
}), i;
}
resolveRuleValue(t, e) {
return typeof t == "boolean" ? t : this.parseRuleValueSchema(t, e);
}
parseRuleValueSchema(t, e) {
const o = t.invalidContext || [];
let r = !0;
for (const i of o) {
if (i.firstLevelChild) {
if (i.firstLevelChild.class) {
const { firstLevelChildClassList: a } = e;
if (a && !a.includes(i.firstLevelChild.class)) {
r = !1;
continue;
}
}
if (i.firstLevelChild.type) {
const { firstLevelChildSchema: a } = e;
if (!a || a.type !== i.firstLevelChild.type) {
r = !1;
continue;
}
}
}
if (i.secondLevelChild) {
if (i.secondLevelChild.class) {
const { secondLevelChildClassList: a } = e;
if (a && !a.includes(i.secondLevelChild.class)) {
r = !1;
continue;
}
}
if (i.secondLevelChild.type) {
const { secondLevelChildSchema: a } = e;
if (!a || a.type !== i.secondLevelChild.type) {
r = !1;
continue;
}
}
}
if (i.parent) {
if (i.parent.class) {
const { parentClassList: a } = e;
if (a && !a.includes(i.parent.class)) {
r = !1;
continue;
}
}
if (i.parent.type) {
const { parentSchema: a } = e;
if (a && a.type !== i.parent.type) {
r = !1;
continue;
}
}
}
r = !0;
break;
}
return !r;
}
getComponentContext(t) {
var I, g, m, x;
const e = t.schema, o = e.appearance && e.appearance.class || "", r = o.split(" ") || [], i = e.contents || [], a = i.length ? i[0] : null, s = a && a.appearance ? a.appearance.class : "", l = s ? s.split(" ") : [], u = (I = a == null ? void 0 : a.contents) != null && I.length ? a == null ? void 0 : a.contents[0] : null, c = u && u.appearance ? u.appearance.class : "", d = c ? c.split(" ") : [], h = e.type === "component" ? (m = (g = t.parent) == null ? void 0 : g.parent) == null ? void 0 : m.schema : (x = t.parent) == null ? void 0 : x.schema, b = h && h.appearance && h.appearance.class || "", p = b ? b.split(" ") : [];
return {
componentClass: o,
componentClassList: r,
childContents: i,
firstLevelChildSchema: a,
firstLevelChildClass: s,
firstLevelChildClassList: l,
secondLevelChildSchema: u,
secondLevelChildClass: c,
secondLevelChildClassList: d,
parentSchema: h,
parentClass: b,
parentClassList: p
};
}
}
const Ra = S(0);
function io() {
Ra.value++;
}
const Qt = S(0);
function La(n, t) {
const e = t.getBoundingClientRect(), o = n.getBoundingClientRect(), r = o.top >= e.top, i = o.top <= e.bottom;
return r && i;
}
function ja(n) {
const t = n.querySelector(".component-btn-group");
if (!t)
return;
t.style.display = "";
const e = t.getBoundingClientRect();
if (!(e.top === 0 && e.left === 0)) {
const o = t.querySelector("div");
if (o) {
const r = o.getBoundingClientRect();
o.style.top = e.top + "px";
let i = e.left - r.width;
const a = document.querySelector(".editorDiv");
if (a) {
const s = a.getBoundingClientRect();
i < s.left && ({ left: i } = n.getBoundingClientRect());
}
o.style.left = i + "px";
}
}
}
function $a(n) {
if (!window.scrollContainerList)
return;
const t = Array.from(window.scrollContainerList);
if (t.length && t.length === 1) {
const e = t[0], o = document.querySelector(`[id=${e}]`);
if (o && o.contains(n))
return o;
}
}
function ao(n) {
if (!n)
return;
const t = n.getBoundingClientRect();
if (t.width === 0 && t.height === 0)
return;
const e = n.querySelector(".component-btn-group");
if (e) {
let o = !0;
const r = $a(n);
if (r && (o = La(n, r)), !o) {
e.style.display = "none";
return;
}
ja(n);
}
}
function Wa(n) {
if (!n)
return;
let t;
n.className.includes("dgComponentSelected") ? t = n : t = n.querySelector(".dgComponentSelected"), t && ao(t);
}
function Ha(n) {
const { formSchemaUtils: t, formStateMachineUtils: e } = n;
function o(l, u = "") {
return {
path: u + l.code,
field: l.id,
fullPath: l.code
};
}
function r(l, u = "") {
return t.getViewModelById(l).states.map((d) => o(d, u));
}
function i(l) {
const u = t.getRootViewModelId(), c = r(l);
if (l === u)
return c;
const d = r(u, "root-component.");
return [...c, ...d];
}
function a(l) {
return l.binding && l.binding.path || l.id || "";
}
function s() {
return e && e.getRenderStates() || [];
}
return { getVariables: i, getControlName: a, getStateMachines: s };
}
class Aa {
constructor(t) {
L(this, "sessionVariables", [
{
key: "CurrentSysOrgName",
name: "当前组织Name",
description: "当前组织Name"
},
// {
// key: "CurrentSysOrgCode",
// name: "当前组织Code",
// description: "当前组织Code"
// },
{
key: "CurrentSysOrgId",
name: "当前组织Id",
description: "当前组织Id"
},
{
key: "CurrentUserName",
name: "当前用户Name",
description: "当前用户Name"
},
{
key: "CurrentUserCode",
name: "当前用户Code",
description: "当前用户Code"
},
{
key: "CurrentUserId",
name: "当前用户Id",
description: "当前用户Id"
},
{
key: "CurrentLanguage",
name: "当前语言编号",
description: "当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"
}
]);
L(this, "expressionNames", {
compute: "计算表达式",
dependency: "依赖表达式",
validate: "验证表达式",
dataPicking: "帮助前表达式",
visible: "可见表达式",
readonly: "只读表达式",
required: "必填表达式"
});
L(this, "getExpressionConverter", (t, e) => ({
convertFrom: (o, r, i, a) => {
const s = i.getExpressionRuleValue(t, e || r);
return s && s.value || "";
},
convertTo: (o, r, i, a, s) => {
var l;
if (r === "dataPicking" && (i != null && i.target)) {
const u = `${i.target}_dataPicking`;
((l = i.rules) == null ? void 0 : l.some(
(d) => d.id === u && d.value
)) ? o.dictPickingExpressionId = u : delete o.dictPickingExpressionId;
}
a.updateExpression(i);
}
}));
this.formSchemaService = t;
}
getExpressionRule(t, e) {
const o = this.formSchemaService.getExpressions();
if (!o)
return "";
const r = o.find((a) => a.target === t);
if (!r)
return "";
const i = r.rules.find((a) => a.type === e);
return i || "";
}
// 获取上下文表单变量
getContextFormVariables() {
const { module: t } = this.formSchemaService.getFormSchema();
if (!t.viewmodels || t.viewmodels.length === 0)
return [];
const e = this.formSchemaService.getRootViewModelId(), o = this.formSchemaService.getViewModelById(e);
if (!o || !o.states || o.states.length === 0)
return [];
const r = [];
return o.states.forEach((i) => {
r.push({
key: i.code,
name: i.name,
description: i.name,
category: i.category
});
}), r;
}
createTreeNode(t, e, o = "label") {
return {
id: t.id,
name: t.name,
bindingPath: t[o],
parents: e
};
}
buildEntityFieldsTreeData(t = null, e) {
const o = [];
return t == null || t.forEach((r) => {
var s;
const i = this.createTreeNode(r, e);
let a = [];
(s = r.type) != null && s.fields && (a = this.buildEntityFieldsTreeData(r.type.fields, [...e, r.label])), o.push({
data: i,
children: a,
expanded: !0
});
}), o;
}
buildChildEntityTreeData(t = null, e) {
const o = [];
return t == null || t.forEach((r) => {
var l, u;
const i = this.createTreeNode(r, e), a = this.buildEntityFieldsTreeData((l = r.type) == null ? void 0 : l.fields, [...e, r.label]), s = this.buildChildEntityTreeData((u = r.type) == null ? void 0 : u.entities, [...e, r.label]);
s != null && s.length && (a == null || a.push(...s)), o.push({
data: i,
children: a || [],
// 空值回退
expanded: !0
});
}), o;
}
getEntitiesTreeData() {
const t = this.formSchemaService.getSchemaEntities();
if (!(t != null && t.length))
return [];
const e = t[0];
if (!(e != null && e.type))
return [];
const o = this.buildEntityFieldsTreeData(e.type.fields, [e.code]), r = this.buildChildEntityTreeData(e.type.entities, [e.code]);
return r != null && r.length && (o == null || o.push(...r)), {
entityCode: e.code,
fields: [{
data: this.createTreeNode(e, [], "code"),
children: o || []
}]
};
}
getEntitiesAndVariables() {
return {
entities: this.getEntitiesTreeData(),
variables: {
session: {
name: "系统变量",
items: this.sessionVariables,
visible: !1
},
forms: {
name: "表单变量",
items: this.getContextFormVariables(),
visible: !0
}
}
};
}
onBeforeOpenExpression(t, e, o) {
const r = o === "Field" ? t.binding.field : t.id, i = this.getExpressionRule(r, e), a = this.getEntitiesAndVariables(), s = {
message: ["validate", "required", "dataPicking"].includes(e) && i ? i.message : "",
...a
};
return i.messageType != null && (s.messageType = i.messageType), s;
}
buildRule(t, e, o, r) {
const { expression: i, message: a, messageType: s } = e, l = {
id: `${t}_${o}`,
type: o,
value: i
};
return (o === "validate" || o === "dataPicking" || o === "required") && (l.message = a), o === "dataPicking" && (l.messageType = s), o === "validate" && r && (l.elementId = r), l;
}
getExpressionData() {
const { expressions: t } = this.formSchemaService.getFormSchema().module;
return t || [];
}
updateExpression(t, e, o, r) {
const i = e === "Field" ? t.binding.field : t.id, a = this.buildRule(i, o, r, t.type === "form-group" ? t.id : "");
let l = this.getExpressionData().find((c) => c.targetType === e && c.target === i);
const u = (c) => c.value.trim() === "";
if (l) {
const c = l.rules.find((d) => d.id === a.id);
if (c)
u(a) ? l.rules = l.rules.filter((d) => d.id !== a.id) : (Object.assign(c, a), r === "validate" && t.type === "form-group" && (c.elementId = t.id));
else {
if (u(a))
return null;
l.rules = l.rules || [], l.rules.push(a);
}
} else {
if (u(a))
return null;
l = {
target: `${i}`,
rules: [a],
targetType: e
};
}
return l;
}
getExpressionEditorOptions(t, e, o, r) {
return o.reduce((i, a) => {
var l, u;
const s = e === "Field" ? (l = t == null ? void 0 : t.binding) == null ? void 0 : l.field : t.id;
return i[a] = {
hide: e === "Field" ? !!((u = t == null ? void 0 : t.binding) != null && u.field) : !1,
description: "",
title: this.expressionNames[a],
type: "string",
$converter: this.getExpressionConverter(s),
editor: {
type: "expression-editor",
singleExpand: !1,
dialogTitle: `${this.expressionNames[a]}编辑器`,
showMessage: a === "validate" || a === "dataPicking" || a === "required",
showMessageType: a === "dataPicking",
beforeOpen: () => this.onBeforeOpenExpression(t, a, e),
onSubmitModal: (c) => {
const d = this.updateExpression(t, e, c, a);
if (r) {
const h = this.buildRule(s, c, a);
r(h);
}
return d;
}
}
}, i;
}, {});
}
getExpressionInfo(t, e, o) {
const r = e === "Field" ? t.binding.field : t.id, i = this.getExpressionRule(r, o), a = {
value: i && i.value,
targetId: r,
targetType: e,
expressionType: o
};
return i && i.message && (a.message = i.message), a;
}
getExpressionConfig(t, e, o = ["compute", "dependency", "validate"], r) {
return {
description: "表达式",
title: "表达式",
properties: {
...this.getExpressionEditorOptions(t, e, o, r)
}
};
}
getExpressionOptions(t, e, o) {
const r = this.getExpressionInfo(t, e, o);
return {
dialogTitle: `${this.expressionNames[o]}编辑器`,
singleExpand: !1,
showMessage: o === "required",
beforeOpen: () => this.onBeforeOpenExpression(t, o, e),
expressionInfo: r
};
}
}
class so {
constructor(t, e) {
L(this, "componentId");
L(this, "viewModelId");
L(this, "eventsEditorUtils");
L(this, "formSchemaUtils");
L(this, "formMetadataConverter");
L(this, "designViewModelUtils");
L(this, "designViewModelField");
L(this, "controlCreatorUtils");
L(this, "designerHostService");
L(this, "schemaService", null);
L(this, "metadataService", null);
L(this, "propertyConfig", {
type: "object",
categories: {}
});
var o;
this.componentId = t, this.designerHostService = e, this.eventsEditorUtils = e.eventsEditorUtils, this.formSchemaUtils = e.formSchemaUtils, this.formMetadataConverter = e.formMetadataConverter, this.viewModelId = ((o = this.formSchemaUtils) == null ? void 0 : o.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = e.designViewModelUtils, this.controlCreatorUtils = e.controlCreatorUtils, this.metadataService = e.metadataService, this.schemaService = e.schemaService;
}
getTableInfo() {
var t;
return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
}
setDesignViewModelField(t) {
var o;
const e = t.binding && t.binding.type === "Form" && t.binding.field;
if (e) {
if (!this.designViewModelField) {
const r = this.designViewModelUtils.getDgViewModel(this.viewModelId);
this.designViewModelField = r.fields.find((i) => i.id === e);
}
t.updateOn = (o = this.designViewModelField) == null ? void 0 : o.updateOn;
}
}
getBasicPropConfig(t) {
return {
description: "Basic Information",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "combo-list",
textField: "name",
valueField: "value",
idField: "value",
editable: !1,
data: [{ value: t.type, name: de[t.type].name }]
}
}
}
};
}
getAppearanceConfig(t = null, e = {}, o) {
const r = {
title: "外观",
description: "Appearance"
}, i = {
class: {
title: "class样式",
type: "string",
description: "组件的CSS样式",
$converter: "/converter/appearance.converter"
},
style: {
title: "style样式",
type: "string",
description: "组件的样式",
$converter: "/converter/appearance.converter"
}
};
for (const a in e)
i[a] = Object.assign(i[a] || {}, e[a]);
return {
...r,
properties: { ...i },
setPropertyRelates(a, s) {
if (a) {
switch (a && a.propertyID) {
case "class":
case "style": {
Qt.value++;
break;
}
}
o && o(a, t, s);
}
}
};
}
getPropertyEditorParams(t, e = [], o = "visible", r = {}, i = {}) {
const { getVariables: a, getControlName: s, getStateMachines: l } = Ha(this.designerHostService), u = this.getRealTargetType(t), c = e && e.length > 0 ? e : ["Const", "Variable", "StateMachine", "Expression"], d = {
type: "property-editor",
propertyTypes: c
};
return c.map((h) => {
switch (h) {
case "Const":
Object.assign(d, {
constType: "enum",
constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
}, r);
break;
case "Expression":
d.expressionConfig = this.getExpressionOptions(t, u, o);
break;
case "StateMachine":
d.stateMachines = l();
break;
case "Variable":
Object.assign(d, {
controlName: s(t),
newVariablePrefix: "is",
newVariableType: "Boolean",
variables: a(this.viewModelId),
onBeforeOpenVariables: (b) => {
b.value = a(this.viewModelId);
}
}, i);
break;
}
}), d;
}
getVisibleProperty(t, e = "") {
return {
visible: {
title: "是否可见",
type: "boolean",
description: "运行时组件是否可见",
editor: this.getPropertyEditorParams(t, e === "gridFieldEditor" ? ["Const", "Expression"] : ["Const", "Variable", "StateMachine", "Expression"], "visible")
}
};
}
/**
* 获取行为
* @param propertyData
* @param viewModelId
* @returns
*/
getBehaviorConfig(t, e = "", o = {}, r) {
const i = {
title: "行为",
description: ""
}, a = this.getVisibleProperty(t, e);
for (const l in o)
a[l] = Object.assign(a[l] || {}, o[l]);
const s = this;
return {
...i,
properties: { ...a },
setPropertyRelates(l, u) {
if (l) {
switch (l.propertyID) {
case "disabled":
case "readonly":
case "visible":
s.afterMutilEditorChanged(t, l);
break;
}
r && r(l, u);
}
}
};
}
/**
* 当多值编辑器变更时
* @param propertyData
* @param changeObject
*/
afterMutilEditorChanged(t, e) {
this.addNewVariableToViewModel(e, this.viewModelId), this.updateExpressionValue(e), this.clearExpression(e, t);
}
/**
*
* @param propertyId
* @param componentInstance
* @returns
*/
updateElementByParentContainer(t, e) {
const o = e && e.parent && e.parent.schema;
if (!o)
return;
const r = o.contents.findIndex((a) => a.id === t), i = at(o.contents[r]);
o.contents.splice(r, 1), o.contents.splice(r, 0, i), io();
}
/**
* 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
* @param changeObject
* @param viewModelId
* @returns
*/
addNewVariableToViewModel(t, e) {
const o = t.propertyValue;
if (!(o && typeof o == "object") || !(o.type === "Variable" && o.isNewVariable))
return;
const a = {
id: o.field,
category: "locale",
code: o.fullPath,
name: o.fullPath,
type: o.newVariableType || "String"
};
delete o.newVariableType, delete o.isNewVariable, this.formSchemaUtils.getVariableByCode(a.code) || this.formSchemaUtils.getViewModelById(e).states.push(a);
}
/**
* 更新表达式到expressions节点
* @param changeObject
*/
updateExpressionValue(t) {
const e = t.propertyValue;
if (!((e && e.type) === "Expression" && e.expressionInfo))
return;
const { expressionId: i, expressionInfo: a } = e, { targetId: s, targetType: l, expressionType: u, value: c, message: d } = a, h = this.formSchemaUtils.getModule();
h.expressions ?? (h.expressions = []);
const { expressions: b } = h;
let p = b.find((g) => g.target === s);
p || (p = { target: s, rules: [], targetType: l }, b.push(p));
const I = p.rules.find((g) => g.type === u);
if (I)
I.value = c, I.message = d;
else {
const g = { id: i, type: u, value: c, message: d };
p.rules.push(g);
}
delete e.expressionInfo;
}
/**
* 属性类型切换为非表达式后,清除原表达式
* @param changeObject
* @param propertyData
* @returns
*/
clearExpression(t, e) {
const o = t.propertyValue;
if (o && o.type === "Expression")
return;
const i = t.propertyID, a = this.formSchemaUtils.getExpressions(), s = e.binding ? e.binding.field : e.id, l = a.find((u) => u.target === s);
!l || !l.rules || (l.rules = l.rules.filter((u) => u.type !== i));
}
getExpressionOptions(t, e, o) {
return new Aa(this.formSchemaUtils).getExpressionOptions(t, e, o);
}
getRealTargetType(t) {
return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item"].indexOf(t.type) > -1 ? "Button" : t.binding && t.binding.field ? "Field" : "Container";
}
}
class Ga extends so {
constructor(t, e) {
super(t, e);
}
getPropertyConfig(t) {
return this.propertyConfig.categories.basic = this.getBasicPropConfig(t), this.propertyConfig.categories.appearance = this.getAppearancePropConfig(t), this.getBehaviorConfig(t), this.getEventPropConfig(t), this.propertyConfig;
}
getAppearancePropConfig(t) {
const e = this.formSchemaUtils.getViewModelById(this.viewModelId);
t.name = e ? e.name : null;
const o = this;
return this.getAppearanceConfig(t, {
name: {
title: "组件名称",
type: "string",
description: "组件名称",
defaultValue: t.name
}
}, (i, a, s) => {
switch (i.propertyID) {
case "name":
o.syncChangesToViewModel({ name: i.propertyValue }), delete a.name;
break;
}
});
}
getEventPropConfig(t) {
const e = [
{
label: "onInit",
name: "初始化事件"
},
{
label: "onAfterViewInit",
name: "视图初始化后事件"
}
], o = this, r = o.eventsEditorUtils.formProperties(t, o.viewModelId, e), i = {};
i[o.viewModelId] = {
type: "events-editor",
editor: {
initialData: r
}
}, this.propertyConfig.categories.eventsEditor = {
title: "事件",
hideTitle: !0,
properties: i,
// 这个属性,标记当属性变更得时候触发重新更新属性
refreshPanelAfterChanged: !0,
tabId: "commands",
tabName: "交互",
setPropertyRelates(a, s) {
const l = a.propertyValue;
delete t[o.viewModelId], l && (l.setPropertyRelates = this.setPropertyRelates, o.eventsEditorUtils.saveRelatedParameters(t, o.viewModelId, l.events, l));
}
};
}
getBehaviorConfig(t) {
const e = this.formSchemaUtils.getViewModelById(this.viewModelId), o = e ? e.enableValidation : null, r = this;
this.propertyConfig.categories.behavior = {
title: "行为",
description: "",
properties: {
enableValidation: {
title: "启用校验",
type: "boolean",
description: "运行时组件是否启用校验",
defaultValue: o
}
},
setPropertyRelates: (i) => {
if (i)
switch (i.propertyID) {
case "enableValidation": {
r.syncChangesToViewModel({ enableValidation: i.propertyValue }), delete t.enableValidation;
break;
}
}
}
};
}
/**
* 将变更的属性值同步到ViewModel上
*/
syncChangesToViewModel(t) {
const e = this.formSchemaUtils.getViewModelById(this.viewModelId);
e && Object.assign(e, t);
}
}
const qa = {
showCloseButton: { type: Boolean, default: !0 },
position: { type: String, default: "top-center" },
timeout: { type: Number, default: 3e3 },
theme: { type: String, default: "bootstrap" },
left: { type: Number },
right: { type: Number },
top: { type: Number },
bottom: { type: Number },
id: { type: String },
animate: { type: String, default: "fadeIn" },
options: { type: Object },
safeHtml: { type: Boolean, default: !0 }
}, za = {
showCloseButton: { type: Boolean, default: !0 },
animate: { type: String, default: "fadeIn" },
options: { type: Object }
}, yn = /* @__PURE__ */ Qe({
name: "Toast",
props: za,
emits: ["close", "click"],
setup: (n, t) => {
const e = S(n.animate), o = "fadeOut", r = q(() => n.options), i = S(!1), a = q(() => {
const m = {
animated: i.value,
toast: !0
};
return m[n.animate] = !1, m[o] = i.value, m[r.value.type] = !0, r.value.theme && (m[r.value.theme] = !0), m;
}), s = q(() => {
const w = `f-icon-${r.value && r.value.type ? r.value.type.replace("toasty-type-", "") : "default"}`, F = {
"f-icon": !0
};
return F[w] = !0, F;
}), l = q(() => r.value.title || r.value.message), u = q(() => r.value.title && r.value.message), c = q(() => !r.value.title && r.value.message), d = q(() => n.showCloseButton), h = q(() => !!r.value.buttons || !!t.slots.default);
function b(m) {
m.stopPropagation(), m.preventDefault(), i.value = !1, setTimeout(() => {
t.emit("close", r.value);
}, 200);
}
function p(m, x) {
}
function I(m) {
return `f-preten-link ${m.customClass ? m.customClass : ""}`;
}
Fe(e, () => {
e.value;
});
const g = () => {
var m;
return E(Mt, null, [E("div", {
class: "after-toast-msg text-right"
}, [!t.slots.default && ((m = r.value.buttons) == null ? void 0 : m.map((x) => E("span", {
class: I(x),
onClick: (w) => void 0
}, [x.text]))), t.slots.default && t.slots.default()])]);
};
return () => E("div", {
class: a.value,
style: "min-height:44px"
}, [d.value && E("button", {
title: "关闭",
class: "toast-close f-btn-icon f-bare",
onClick: b
}, [E("span", {
class: "f-icon modal_close"
}, null)]), l.value && E("section", {
class: "modal-tips"
}, [E("div", {
class: "float-left modal-tips-iconwrap"
}, [E("span", {
class: s.value
}, null)]), E("div", {
class: "modal-tips-content"
}, [u.value && E(Mt, null, [E("h5", {
class: "toast-title modal-tips-title",
innerHTML: r.value.title
}, null), E("p", {
class: "toast-msg",
innerHTML: r.value.message
}, null), h.value && g()]), c.value && (r.value.buttons ? E("div", {
class: "toast-title-btns-wrapper d-flex"
}, [E("h5", {
class: "toast-title modal-tips-title only-toast-msg",
innerHTML: r.value.message
}, null), E("div", {
class: "after-toast-title text-right ml-auto"
}, [g()])]) : E("h5", {
class: "toast-title modal-tips-title only-toast-msg",
innerHTML: r.value.message
}, null))])])]);
}
}), on = /* @__PURE__ */ Qe({
name: "Notify",
props: qa,
emits: ["close", "empty"],
setup(n, t) {
const e = q(() => ({
"farris-notify": !0
})), o = {
left: 12,
right: 12,
top: 20,
bottom: 12
}, r = S(), i = S(n.options), a = S(n.showCloseButton), s = q(() => n.position || "bottom-right"), l = q(() => n.timeout != null ? n.timeout : 3e3), u = q(() => {
const h = n.bottom ? n.bottom : o.bottom, b = n.top ? n.top : o.top, p = {
transition: "all 0.2s ease",
left: s.value.indexOf("left") > -1 ? `${n.left ? n.left : o.left}px` : "",
right: s.value.indexOf("right") > -1 ? `${n.right ? n.right : o.right}px` : "",
top: s.value.indexOf("top") > -1 ? `${b}px` : "",
bottom: s.value.indexOf("bottom") > -1 ? `${h}px` : ""
};
return s.value.indexOf("center") > -1 && (p.left = "50%", p.marginLeft = "calc(-24rem / 2)", s.value === "center-center" && (p.top = "50%", p.transform = "translate(-50%, -50%)")), p;
});
function c(h) {
t.emit("close");
}
l.value && setTimeout(() => {
c();
}, l.value), t.expose({
closeToast: c,
container: r,
notifyPosition: s
});
function d(h, b) {
c();
}
return () => E("div", {
class: e.value,