@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,521 lines • 62.1 kB
JavaScript
var be = Object.defineProperty;
var ye = (e, t, n) => t in e ? be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var Z = (e, t, n) => ye(e, typeof t != "symbol" ? t + "" : t, n);
import { defineComponent as A, ref as B, inject as _, onMounted as j, computed as S, createVNode as m, createTextVNode as ee, watch as I, withDirectives as ne, vModelText as he, resolveDirective as xe, Fragment as q, mergeProps as oe, reactive as Ce, createApp as Te, onUnmounted as we, Transition as Se, toRefs as Be } from "vue";
import { useDesignerComponent as Pe } from "../designer-canvas/index.esm.js";
import { InputBaseProperty as Fe } from "../property-panel/index.esm.js";
import Oe from "../button-edit/index.esm.js";
import { createPropsResolver as ke, getPropsResolverGenerator as Ne } from "../dynamic-resolver/index.esm.js";
import { isPlainObject as te, cloneDeep as J } from "lodash-es";
import { FInputGroup as Ie } from "../input-group/index.esm.js";
import { LocaleService as $ } from "../locale/index.esm.js";
import { useTextBox as Ee, useClear as Le, withInstall as Me, isMobilePhone as Re } from "../common/index.esm.js";
import { useNumber as De, useFormat as je, useSpinner as Ve, useTextBox as Ae, getSpinnerRender as $e, getNumberTextBoxRender as ze } from "../number-spinner/index.esm.js";
import { useInputExpand as He } from "../common/index.esm.js/text-box/use-input-expand";
import "bignumber.js";
class Ge extends Fe {
constructor(t, n) {
super(t, n);
}
getEditorProperties(t) {
return this.getComponentConfig(t, { type: "language-textbox" }, {
maxLength: {
description: "文本字数最大长度",
title: "最大长度",
type: "number",
editor: {
nullable: !0,
min: 0,
useThousands: !1,
max: t.editor.maxLength,
needValid: !0
}
}
});
}
}
function _e(e, t) {
function n(o, a) {
const p = e.schema;
return new Ge(o, t).getPropertyConfig(p, a);
}
return { getPropsConfig: n };
}
const qe = /* @__PURE__ */ A({
name: "FLanguageTextboxDesign",
props: {
placeholder: {
type: String,
default: ""
},
expandable: {
type: Boolean,
default: !1
},
expandMode: {
type: String,
default: "text"
},
expandContent: {
type: String,
default: ""
},
expandDisabled: {
type: Boolean,
default: !1
}
},
setup(e, t) {
const n = B(), o = _("design-item-context"), a = _("designer-host-service"), p = _e(o, a), i = Pe(n, o, p);
j(() => {
n.value.componentInstance = i;
});
const h = S(() => ({
"input-group-append input-append-wrapper": !0,
"input-append-button": e.expandMode === "button",
"input-append-text": e.expandMode === "text"
}));
return t.expose(i.value), () => m("div", {
class: "f-button-edit f-cmp-inputgroup f-button-edit-nowrap",
ref: n,
style: "pointer-events: none;"
}, [m("div", {
class: "input-group"
}, [m("input", {
autocomplete: "off",
class: "text-left form-control f-utils-fill",
readonly: "true",
type: "text",
placeholder: e.placeholder
}, null), m("div", {
class: "input-group-append"
}, [m("span", {
class: "input-group-text input-group-append-button"
}, [m("i", {
class: "f-icon f-icon-yxs_earth"
}, null)])]), e.expandable && e.expandContent && m("div", {
class: h.value
}, [m("div", {
class: "input-group-text",
innerHTML: e.expandContent
}, null)])])]);
}
});
function ae(e, t) {
let n;
function o(l) {
const { properties: d, title: b, ignore: r } = l, u = r && Array.isArray(r), f = Object.keys(d).reduce((C, g) => ((!u || !r.find((P) => P === g)) && (C[g] = d[g].type === "object" && d[g].properties ? o(d[g]) : J(d[g].default)), C), {});
if (b && (!u || !r.find((C) => C === "id"))) {
const C = b.toLowerCase().replace(/-/g, "_");
f.id = `${C}_${Math.random().toString().slice(2, 6)}`;
}
return f;
}
function a(l) {
const { properties: d, title: b, required: r } = l;
if (r && Array.isArray(r)) {
const u = r.reduce((f, C) => (f[C] = d[C].type === "object" && d[C].properties ? o(d[C]) : J(d[C].default), f), {});
if (b && r.find((f) => f === "id")) {
const f = b.toLowerCase().replace(/-/g, "_");
u.id = `${f}_${Math.random().toString().slice(2, 6)}`;
}
return u;
}
return {
type: b
};
}
function p(l, d = {}, b) {
const r = e[l];
if (r) {
let u = a(r);
const f = t[l];
return u = f ? f({ getSchemaByType: p }, u, d, b) : u, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(u), u;
}
return null;
}
function i(l, d) {
const b = o(d);
return Object.keys(b).reduce((r, u) => (Object.prototype.hasOwnProperty.call(l, u) && (r[u] && te(r[u]) && te(l[u] || !l[u]) ? Object.assign(r[u], l[u] || {}) : r[u] = l[u]), r), b), b;
}
function h(l, d) {
return Object.keys(l).filter((r) => l[r] != null).reduce((r, u) => {
if (d.has(u)) {
const f = d.get(u);
if (typeof f == "string")
r[f] = l[u];
else {
const C = f(u, l[u], l);
Object.assign(r, C);
}
} else
r[u] = l[u];
return r;
}, {});
}
function T(l, d, b = /* @__PURE__ */ new Map()) {
const r = i(l, d);
return h(r, b);
}
function c(l) {
var b;
const d = l.type;
if (d) {
const r = e[d];
if (!r)
return l;
const u = i(l, r), f = ((b = l.editor) == null ? void 0 : b.type) || "";
if (f) {
const C = e[f], g = i(l.editor, C);
u.editor = g;
}
return u;
}
return l;
}
function v(l) {
n = l;
}
return { getSchemaByType: p, resolveSchemaWithDefaultValue: c, resolveSchemaToProps: T, mappingSchemaToProps: h, setDesignerContext: v };
}
const We = {}, Ue = {}, { resolveSchemaWithDefaultValue: Ye } = ae(We, Ue);
function Ze(e = {}) {
function t(c, v, l, d) {
if (typeof l == "number")
return d[c].length === l;
if (typeof l == "object") {
const b = Object.keys(l)[0], r = l[b];
if (b === "not")
return Number(d[c].length) !== Number(r);
if (b === "moreThan")
return Number(d[c].length) >= Number(r);
if (b === "lessThan")
return Number(d[c].length) <= Number(r);
}
return !1;
}
function n(c, v, l, d) {
return d[c] && d[c].propertyValue && String(d[c].propertyValue.value) === String(l);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", n]
]);
Object.keys(e).reduce((c, v) => (c.set(v, e[v]), c), o);
function a(c, v) {
const l = c;
return typeof v == "number" ? [{ target: l, operator: "length", param: null, value: Number(v) }] : typeof v == "boolean" ? [{ target: l, operator: "getProperty", param: c, value: !!v }] : typeof v == "object" ? Object.keys(v).map((d) => {
if (d === "length")
return { target: l, operator: "length", param: null, value: v[d] };
const b = d, r = v[d];
return { target: l, operator: "getProperty", param: b, value: r };
}) : [];
}
function p(c) {
return Object.keys(c).reduce((l, d) => {
const b = a(d, c[d]);
return l.push(...b), l;
}, []);
}
function i(c, v) {
if (o.has(c.operator)) {
const l = o.get(c.operator);
return l && l(c.target, c.param, c.value, v) || !1;
}
return !1;
}
function h(c, v) {
return p(c).reduce((b, r) => b && i(r, v), !0);
}
function T(c, v) {
const l = Object.keys(c), d = l.includes("allOf"), b = l.includes("anyOf"), r = d || b, C = (r ? c[r ? d ? "allOf" : "anyOf" : "allOf"] : [c]).map((P) => h(P, v));
return d ? !C.includes(!1) : C.includes(!0);
}
return { parseValueSchema: T };
}
const Je = {
convertTo: (e, t, n, o) => {
e.appearance || (e.appearance = {}), e.appearance[t] = n;
},
convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
}, Qe = {
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
}, Xe = {
convertTo: (e, t, n, o) => {
e.editor && (e.editor[t] = n);
},
convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
}, Ke = {
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: "标签页工具栏按钮" },
"drawer-toolbar-item": { type: "drawer-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: "标签页工具栏" },
"drawer-toolbar": { type: "drawer-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: "列表导航" },
nav: { type: "nav", name: "标签类导航" },
"list-view": { type: "list-view", name: "列表" },
"filter-bar": { type: "filter-bar", name: "筛选条" },
"language-textbox": { type: "language-textbox", name: "多语输入框" },
image: { type: "image", name: "图像" },
avatar: { type: "avatar", name: "头像" },
"discussion-editor": { type: "discussion-editor", name: "评论编辑区" },
"discussion-list": { type: "discussion-list", name: "评论列表" },
comment: { type: "comment", name: "评论区" },
"approval-logs": { type: "approval-logs", name: "审批记录" },
"rich-text-editor": { type: "rich-text-editor", name: "富文本", icon: "rich-text-box" },
calendar: { type: "calendar", name: "日历", icon: "date-picker" },
wizard: { type: "wizard", name: "向导", icon: "wizard" },
"wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" },
"wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" },
step: { type: "step", name: "步骤条", icon: "step" },
"dynamic-form": { type: "dynamic-form", name: "动态表单" }
}, et = {
convertFrom: (e, t, n) => {
var a;
const o = e.editor && e.editor[t] ? e.editor[t] : e[t];
return ((a = Ke[o]) == null ? void 0 : a.name) || o;
}
}, tt = {
convertTo: (e, t, n, o) => {
e[t] = e[t];
},
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
}, nt = {
convertTo: (e, t, n, o) => {
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = {
[t]: n
});
},
convertFrom: (e, t, n) => {
if (e.formatter) {
if (t === "trueText")
return e.formatter.trueText;
if (t === "falseText")
return e.formatter.falseText;
if (t === "prefix")
return e.formatter.prefix;
if (t === "suffix")
return e.formatter.suffix;
if (t === "precision")
return e.formatter.precision;
if (t === "decimal")
return e.formatter.decimal;
if (t === "thousand")
return e.formatter.thousand;
if (t === "dateFormat")
return e.formatter.dateFormat || "yyyy-MM-dd";
if (t === "customFormat")
return e.formatter.customFormat;
if (t === "type")
return e.formatter.type || "none";
}
return "none";
}
}, ot = {
convertTo: (e, t, n, o) => {
e.command ? e.command[t] = n : e.command = {
[t]: n
}, t === "enableType" && n === "default" && (e.command.enable = !0, e.command.formatter = "", e.command.commands = [
{
text: "编辑",
type: "primary",
command: "edit"
},
{
text: "删除",
type: "danger",
command: "remove"
}
]), t === "enableType" && n === "custom" && (e.command.enable = !0, e.command.commands = [
{
value: "add",
text: "增加",
type: "link"
},
{
value: "edit",
text: "编辑",
type: "link"
},
{
value: "remove",
text: "删除",
type: "link"
}
]), t === "enableType" && n === "unable" && (e.command.enable = !1, e.command.formatter = "");
},
convertFrom: (e, t, n) => {
var o, a;
if (e.command) {
if (t === "enableType") {
if (e.command.enableType)
return e.command.enableType;
const p = (a = (o = e.command) == null ? void 0 : o.commands) == null ? void 0 : a.find((i) => i.command === "edit" && i.type === "primary");
return e.command.enable ? p ? "default" : "custom" : "unable";
}
if (t === "commands")
return e.command.enableType === "custom" ? e.command.commands : [];
if (t === "formatter")
return e.command.formatter;
if (t === "count")
return e.command.count;
if (t === "columnWidth")
return e.command.columnWidth || 200;
}
return "";
}
}, at = {
convertTo: (e, t, n, o) => {
e.column ? e.column[t] = n : e.column = {
[t]: n
}, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average"));
},
convertFrom: (e, t, n) => {
if (e.column) {
if (t === "fitColumns")
return e.column.fitColumns;
if (t === "fitMode")
return e.column.fitMode;
}
return "";
}
}, rt = {
convertTo: (e, t, n, o) => {
e.summary ? e.summary[t] = n : e.summary = {
[t]: n
}, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
enable: n,
groupFields: []
});
},
convertFrom: (e, t, n) => {
var o, a;
return t === "customSummaryStyle" ? e.summary.customSummaryStyle : t === "position" ? ((o = e.summary) == null ? void 0 : o[t]) || "bottom" : t === "customRender" ? ((a = e.summary) == null ? void 0 : a[t]) || "" : e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : "";
}
}, it = {
convertTo: (e, t, n, o) => {
e.group ? e.group[t] = n : e.group = {
[t]: n
}, t === "enable" && n && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = {
enable: n,
groupFields: [],
showSummary: !1,
customRender: ""
});
},
convertFrom: (e, t, n) => {
if (e.group) {
if (t === "enable")
return e.group.enable;
if (t === "showSummary")
return e.group.showSummary;
if (t === "customRender")
return e.group.customRender;
if (t === "groupFields")
return e.group.groupFields;
}
}
}, lt = {
convertFrom: (e, t) => e.binding ? e.binding.path : "",
convertTo: (e, t, n) => {
if (n && n.length > 0) {
const o = n[0];
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = o.bindingField, e.binding.field = o.id, e.binding.fullPath = o.path, e.path = o.bindingPath;
}
}
}, ut = {
convertTo: (e, t, n, o) => {
e.pagination || (e.pagination = {}), t === "sizeLimits" ? e.pagination.sizeLimits = n.split(",") : e.pagination[t] = n;
},
convertFrom: (e, t, n) => {
var o;
return e.pagination ? t === "sizeLimits" ? (o = e.pagination.sizeLimits) == null ? void 0 : o.join(",") : e.pagination[t] : e[t];
}
}, st = {
convertTo: (e, t, n, o) => {
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
},
convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
}, ct = {
convertTo: (e, t, n, o) => {
e.selection || (e.selection = {}), e.selection[t] = n;
},
convertFrom: (e, t, n) => {
if (!e.selection)
return !!e[t];
const o = !!e.selection[t];
return t === "showCheckbox" && o == null && e.selection.multiSelect === !0 ? !0 : o;
}
}, dt = {
convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
}, ft = {
convertFrom: (e, t) => e[t] || "",
convertTo: (e, t, n) => {
e[t] = n;
}
}, mt = {
convertTo: (e, t, n, o) => {
e.size || (e.size = {}), e.size[t] = n;
},
convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
}, pt = {
convertFrom: (e, t, n) => {
var o, a;
return (o = e.formatter) != null && o.data && t === "formatterEnumData" && !e.formatterEnumData ? (a = e.formatter) == null ? void 0 : a.data : e.formatterEnumData;
}
}, vt = {
convertTo: (e, t, n, o) => {
e.sort || (e.sort = {}), e.sort[t] = n;
},
convertFrom: (e, t, n) => {
var o, a;
if (t === "mode")
return ((o = e.sort) == null ? void 0 : o.mode) || "client";
if (t === "multiSort")
return !!((a = e.sort) != null && a.multiSort);
}
}, gt = {
convertTo: (e, t, n, o) => {
e.filter || (e.filter = {}), e.filter[t] = n, t === "enable" && (e.enableFilter = !1);
},
convertFrom: (e, t, n) => {
var o, a, p, i;
return t === "mode" ? ((o = e.filter) == null ? void 0 : o.mode) || "server" : t === "filterStyle" ? ((a = e.filter) == null ? void 0 : a.filterStyle) || "filter-column" : t === "enable" ? ((p = e.filter) == null ? void 0 : p.enable) !== void 0 ? !!e.filter.enable : !!e.enableFilter : ((i = e.filter) == null ? void 0 : i[t]) || void 0;
}
}, bt = {
convertTo: (e, t, n, o) => {
e.rowOption ? e.rowOption[t] = n : e.rowOption = {
[t]: n
};
},
convertFrom: (e, t, n) => {
if (e.rowOption) {
if (t === "customRowStyle")
return e.rowOption.customRowStyle;
if (t === "customCellStyle")
return e.rowOption.customCellStyle;
if (t === "height")
return e.rowOption.height;
}
return "";
}
}, yt = {
convertTo: (e, t, n, o) => {
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e[t] = n, t === "columnTemplateType" && n === "hyperlink" && (e.onClickLinkCommand ? e.columnTemplate = `
<span class="f-pretend-link f-cursor-pointer"
@click="(ctx)=>viewModel.current.${e.onClickLinkCommand || ""}({id: rowData.id,context: ctx})">
{{rowData.${e.field}}}
</span>` : e.columnTemplate = `
<span class="f-pretend-link f-cursor-pointer">
{{rowData.${e.field}}}
</span>`), t === "columnTemplateType" && n === "default" && (e.columnTemplate = ""), t === "columnTemplateType" && n === "custom" && (e.columnTemplate = ""));
},
convertFrom: (e, t, n) => t === "columnTemplate" ? e.columnTemplate : t === "columnTemplateType" ? e.columnTemplateType ? e.columnTemplateType || "default" : e.columnTemplate && !e.onClickLinkCommand ? "custom" : e.columnTemplate && e.onClickLinkCommand ? "hyperlink" : "default" : ""
}, ht = {
convertTo: (e, t, n, o) => {
e.hierarchy || (e.hierarchy = {
cascadeOption: {}
}), e.hierarchy.cascadeOption || (e.hierarchy.cascadeOption = {}), e.hierarchy.cascadeOption[t] = n;
},
convertFrom: (e, t, n) => {
var o, a;
return !!((a = (o = e.hierarchy) == null ? void 0 : o.cascadeOption) != null && a[t]);
}
};
function re(e, t, n) {
const o = /* @__PURE__ */ new Map([
["/converter/appearance.converter", Je],
["/converter/buttons.converter", Qe],
["/converter/property-editor.converter", Xe],
["/converter/items-count.converter", dt],
["/converter/type.converter", et],
["/converter/change-editor.converter", tt],
["/converter/change-formatter.converter", nt],
["/converter/column-command.converter", ot],
["/converter/column-option.converter", at],
["/converter/summary.converter", rt],
["/converter/group.converter", it],
["/converter/form-group-label.converter", ft],
["/converter/field-selector.converter", lt],
["/converter/pagination.converter", ut],
["/converter/row-number.converter", st],
["/converter/grid-selection.converter", ct],
["/converter/size.converter", mt],
["/converter/change-formatter-enum.converter", pt],
["/converter/grid-sort.converter", vt],
["/converter/grid-filter.converter", gt],
["/converter/row-option.converter", bt],
["/converter/change-formatter-type.converter", yt],
["/converter/tree-auto-check.converter", ht]
]), a = /* @__PURE__ */ new Map([
["string", { type: "input-group", enableClear: !1 }],
["boolean", {
type: "combo-list",
textField: "name",
valueField: "value",
idField: "value",
enableClear: !1,
editable: !1,
data: [
{
value: !0,
name: "是"
},
{
value: !1,
name: "否"
}
]
}],
["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }],
["array", { type: "button-edit" }],
["number", { type: "number-spinner", placeholder: "" }],
["events-editor", { type: "events-editor", hide: !0 }],
["multiLanguage", { type: "language-textbox" }]
]), p = Ze();
function i(r, u) {
return () => p.parseValueSchema(r, u);
}
function h(r, u, f) {
return r.includes("visible") && u.visible !== void 0 ? typeof u.visible == "boolean" ? () => !!u.visible : u.visible === void 0 ? !0 : i(u.visible, f) : () => !0;
}
function T(r, u, f) {
return r.includes("readonly") && u.readonly !== void 0 ? typeof u.readonly == "boolean" ? () => !!u.readonly : i(u.readonly, f) : () => !1;
}
function c(r, u) {
const f = r.$converter || u;
return typeof f == "string" && f && o.has(f) ? o.get(f) || null : f || null;
}
function v(r, u, f, C, g, P = "", F = "") {
return Object.keys(r).map((w) => {
const k = B(1), s = w, x = r[w], y = Object.keys(x), N = x.title, E = x.type, L = a.get(E) || { type: "input-group", enableClear: !1 }, D = x.editor ? Object.assign({}, L, x.editor) : Object.assign({}, L), W = h(y, x, u), z = T(y, x, u);
D.readonly = D.readonly === void 0 ? z() : D.readonly;
const U = x.type === "cascade" ? v(x.properties, u, f, C, g, P, F) : [], Y = !0;
let M = c(x, F);
const fe = S({
get() {
if (k.value) {
if (["class", "style"].find((H) => H === s) && !M && (M = o.get("/converter/appearance.converter") || null), M && M.convertFrom) {
const H = M.convertFrom(f, w, g, P);
return H === void 0 && Object.prototype.hasOwnProperty.call(x, "defaultValue") ? x.type === "boolean" ? x.defaultValue : x.defaultValue || "" : H;
}
const R = f[w];
return Object.prototype.hasOwnProperty.call(x, "defaultValue") && (R === void 0 || typeof R == "string" && R === "") ? x.type === "boolean" ? x.defaultValue : x.defaultValue || "" : R;
}
return null;
},
set(R) {
k.value += 1, M && M.convertTo ? (M.convertTo(C, w, R, g, P), M.convertTo(f, w, R, g, P)) : (C[w] = R, f[w] = R);
}
}), { refreshPanelAfterChanged: me, description: pe, isExpand: ve, parentPropertyID: ge } = x, K = { propertyID: s, propertyName: N, propertyType: E, propertyValue: fe, editor: D, visible: W, readonly: z, cascadeConfig: U, hideCascadeTitle: Y, refreshPanelAfterChanged: me, description: pe, isExpand: ve, parentPropertyID: ge };
return u[s] = K, K;
});
}
function l(r, u, f = {}) {
const C = {}, g = e[r];
return g && g.categories ? Object.keys(g.categories).map((F) => {
const O = g.categories[F], w = O == null ? void 0 : O.title, k = v(O.properties || {}, C, {}, f, u);
return { categoryId: F, categoryName: w, properties: k };
}) : [];
}
function d(r, u, f, C, g = "") {
const P = u.$ref.schema, F = u.$ref.converter, O = f[P], w = O.type, k = n(O), s = {}, x = e[w];
if (x && x.categories) {
const y = x.categories[r], N = y == null ? void 0 : y.title;
F && Object.keys(y.properties).forEach((D) => {
y.properties[D].$converter = F;
});
const E = (y == null ? void 0 : y.properties) || {}, L = v(E, s, k, O, C, g);
return { categoryId: r, categoryName: N, properties: L };
}
return { categoryId: r, categoryName: "", properties: [] };
}
function b(r, u, f, C, g) {
const P = r.type, F = n(r), O = {};
let w = g || e[P];
if (!(w && Object.keys(w).length > 0) && f && f.getPropConfig && (w = f.getPropConfig(C)), w && w.categories) {
const s = [];
return Object.keys(w.categories).map((x) => {
const y = w.categories[x];
if (y.$ref) {
s.push(d(x, y, r, u, C));
return;
}
const N = y == null ? void 0 : y.title, E = y == null ? void 0 : y.tabId, L = y == null ? void 0 : y.tabName, D = y == null ? void 0 : y.hide, W = y == null ? void 0 : y.hideTitle, z = v(y.properties || {}, O, F, r, u, C, y.$converter), { setPropertyRelates: U } = y, Y = y == null ? void 0 : y.parentPropertyID;
s.push({ categoryId: x, categoryName: N, tabId: E, tabName: L, hide: D, properties: z, hideTitle: W, setPropertyRelates: U, parentPropertyID: Y });
}), s;
}
return [];
}
return {
getPropertyConfigBySchema: b,
getPropertyConfigByType: l,
propertyConverterMap: o
};
}
const xt = {}, Ct = {};
re(xt, Ct, Ye);
const Tt = {}, wt = {}, { resolveSchemaWithDefaultValue: St } = ae(Tt, wt), Bt = {}, Pt = {};
re(Bt, Pt, St);
function Ft(e, t) {
return { customClass: t.class, customStyle: t.style };
}
const ie = /* @__PURE__ */ new Map([
["appearance", Ft]
]), Ot = "https://json-schema.org/draft/2020-12/schema", kt = "https://farris-design.gitee.io/input-group.schema.json", Nt = "language-textbox", It = "A Farris Input Component", Et = "object", Lt = {
id: {
description: "The unique identifier for a Input Group",
type: "string"
},
type: {
description: "The type string of Input Group component",
type: "string",
default: "language-textbox"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
formatValidation: {
description: "",
type: "object",
default: {}
},
editable: {
description: "",
type: "boolean",
default: !0
},
enableLinkLabel: {
description: "",
type: "boolean",
default: !1
},
label: {
description: "",
type: "string",
default: ""
},
labelWidth: {
description: "",
type: "number"
},
placeholder: {
description: "",
type: "string",
default: ""
},
readonly: {
description: "",
type: "boolean",
default: !1
},
disabled: {
description: "",
type: "boolean",
default: !1
},
required: {
description: "",
type: "boolean",
default: !1
},
tabIndex: {
description: "",
type: "number",
default: -1
},
maxLength: {
description: "",
type: "number",
default: ""
},
visible: {
description: "",
type: "boolean",
default: !0
},
onBlur: {
description: "",
type: "string",
default: ""
},
onClickLinkLabel: {
description: "",
type: "string",
default: ""
},
languages: {
description: "语种列表",
type: "array",
default: []
},
modelValue: {
description: "绑定值",
type: "object",
default: {}
},
enableClear: {
description: "",
type: "boolean",
default: !0
},
maxWords: {
description: "各语种最大字符数",
type: "object",
default: null
},
expandable: {
description: "",
type: "boolean",
default: !1
},
expandMode: {
description: "",
type: "string",
default: "text"
},
expandContent: {
description: "",
type: "string",
default: ""
},
expandDisabled: {
description: "",
type: "boolean",
default: !1
},
onExpandClick: {
description: "",
type: "string",
default: ""
},
needConfirm: {
description: "是否需要确认",
type: "boolean",
default: !1
},
beforeSubmit: {
description: "提交前回调",
type: "object",
default: null
}
}, Mt = [
"type"
], Rt = [
"id",
"appearance",
"binding",
"visible"
], le = {
$schema: Ot,
$id: kt,
title: Nt,
description: It,
type: Et,
properties: Lt,
required: Mt,
ignore: Rt
};
function ue(e, t, n) {
return t;
}
const X = {
id: { type: String, required: !0 },
languages: { type: Array, default: [] },
disabled: { type: Boolean, default: !1 },
editable: { type: Boolean, default: !1 },
readonly: { type: Boolean, default: !1 },
placeholder: { type: String, default: "" },
maxWords: { type: Object, default: null },
modelValue: { type: Object, default: null },
dropDownIcon: { type: String, default: '<span class="f-icon f-icon-yxs_earth"></span>' },
tabIndex: { type: Number, default: -1 },
enableClear: { type: Boolean, default: !0 },
enableTitle: { type: Boolean, default: !0 },
maxLength: { type: Number, default: null },
/** 是否可扩展 */
expandable: { type: Boolean, default: !1 },
/** 扩展模式 text | button */
expandMode: { type: String, default: "text" },
/** 扩展文本内容 */
expandContent: { type: String, default: "" },
/** 扩展按钮是否禁用 */
expandDisabled: { type: Boolean, default: !1 },
needConfirm: { type: Boolean, default: !1 },
beforeSubmit: { type: Function },
allowShowLanguage: { type: Boolean, default: !0 }
}, mn = ke(X, le, ie, ue), se = Ne(
X,
le,
ie,
ue
), Dt = /* @__PURE__ */ A({
name: "LanguageContents",
props: {
languages: {
type: Array,
default: []
},
modelValue: {
type: Object,
default: null
},
id: {
type: String,
default: ""
},
maxLength: {
type: Number,
default: void 0
},
needConfirm: {
type: Boolean,
default: !1
},
readonly: {
type: Boolean,
default: !1
}
},
emits: ["update:modelValue", "confirm", "cancel"],
setup(e, t) {
const n = B(e.languages), o = B(e.modelValue || {}), a = B();
j(() => {
setTimeout(() => {
var T, c;
(c = (T = a.value) == null ? void 0 : T.querySelector("input")) == null || c.focus();
}, 130), e.needConfirm && (o.value = J(e.modelValue || {}));
});
function p(T, c) {
o.value[c.code] = T, !e.needConfirm && t.emit("update:modelValue", o.value);
}
function i() {
t.emit("cancel", e.modelValue);
}
function h() {
t.emit("confirm", o.value);
}
return () => {
var T;
return m("ul", {
class: "list-group",
style: "background: white;",
ref: a
}, [(T = n.value) == null ? void 0 : T.map((c) => m("li", {
class: "list-group-item border-0 p-2 px-2"
}, [m("div", {
class: "farris-group-wrap form-inline farris-form-inline"
}, [m("div", {
class: "form-group farris-form-group"
}, [m("label", {
for: "hpinput01",
class: "col-form-label"
}, [m("span", {
class: "farris-label-text",
title: c.name
}, [c.name])]), m("div", {
class: "farris-input-wrap"
}, [m(Ie, {
id: e.id + "_" + c.code,
modelValue: o.value[c.code],
readonly: e.readonly,
"onUpdate:modelValue": (v) => {
p(v, c);
},
updateOn: "change",
maxLength: e.maxLength
}, null)])])])])), e.needConfirm && !e.readonly && m("li", {
class: "list-group-item border-0 p-2 px-2",
style: "text-align: right;"
}, [m("button", {
type: "button",
class: "btn btn-secondary mr-3",
onClick: i
}, [ee("取消")]), m("button", {
type: "button",
class: "btn btn-primary",
onClick: h
}, [ee("确定")])])]);
};
}
}), jt = {
id: { Type: String, default: "" },
/** 是否自动完成 */
autocomplete: { Type: String, default: "off" },
/** 自定义CLASS */
customClass: { Type: String, default: "" },
/** 禁用 */
disabled: { Type: Boolean, default: !1 },
/** 允许编辑 */
editable: { Type: Boolean, default: !0 },
/** 启用清除按钮 */
enableClear: { Type: Boolean, default: !0 },
/** 启用提示文本 */
enableTitle: { Type: Boolean, default: !0 },
/** 能否查看密码 */
enableViewPassword: { Type: Boolean, default: !0 },
/** 始终显示占位符文本 */
forcePlaceholder: { Type: Boolean, default: !1 },
/** 扩展按钮 */
groupText: { Type: String, default: "" },
/** 密码模式 */
showType: { Type: String, default: "text" },
/** 密码模式 --废弃*/
type: { Type: String, default: "text" },
/** 最大值 */
max: { type: [Number, String] },
/** 最小值 */
min: { type: [Number, String] },
/** 最大长度 */
maxLength: { Type: Number || void 0, default: void 0 },
/** 最小长度 */
minLength: { Type: Number || void 0, default: void 0 },
/** 组件值 */
modelValue: { Type: String || Boolean, default: "" },
/** 隐藏边线 */
showBorder: { Type: Boolean, default: !0 },
/** 步长 */
step: { Type: Number, default: 1 },
/** 启用提示信息 */
placeholder: { Type: String, default: "" },
precision: { Type: Number, default: 0 },
/** 只读 */
readonly: { Type: Boolean, default: !1 },
/** 当组件禁用或只读时显示后边的按钮 */
showButtonWhenDisabled: { Type: Boolean, default: !1 },
/** tab索引 */
tabIndex: { Type: Number, default: 0 },
/** 文本在输入框中的对齐方式 */
textAlign: { Type: String, default: "left" },
/** 是否启用前置扩展信息;在输入框前面 显示 ① 图标鼠标滑过后显示 */
useExtendInfo: { Type: Boolean, default: !1 },
/** 前置扩展信息 */
extendInfo: { Type: String, default: "" },
/** 输入值 */
value: { Type: String, default: "" },
/** 是否撑开高度 */
autoHeight: { type: Boolean, default: !1 },
/** 自动聚焦 */
autofocus: { type: Boolean, default: !1 },
/** 文本区域可见的行数 */
rows: { type: Number, default: 2 },
/** 展示输入文本数量 */
showCount: { type: Boolean, default: !1 },
showZero: { type: Boolean, default: !1 },
/**
* 作为内嵌编辑器被创建后默认获得焦点
*/
focusOnCreated: { type: Boolean, default: !1 },
/**
* 作为内嵌编辑器被创建后默认选中文本
*/
selectOnCreated: { type: Boolean, default: !1 },
/**
* modelValue 更新时机, 默认 blur; 可选值:blur | input
* - blur: 离开焦点时更新
* - change: 输入时更新
*/
updateOn: { type: String, default: "blur" },
formatValidation: { type: Object, default: {} },
/**
* 是否启用快捷键
*/
keyboard: { type: Boolean, default: !0 },
/** 是否可扩展 */
expandable: { type: Boolean, default: !1 },
/** 扩展模式 text | button */
expandMode: { type: String, default: "text" },
/** 扩展文本内容 */
expandContent: { type: String, default: "" },
/** 扩展按钮是否禁用 */
expandDisabled: { type: Boolean, default: !1 }
};
function Vt(e, t) {
const n = B(e.groupText), o = S(() => e.showButtonWhenDisabled && (e.readonly || e.disabled)), a = S(() => e.type === "password" || e.showType === "password" || e.enableClear || !!e.groupText || o.value);
return { appendedButtonClass: S(() => ({
"input-group-append": !0,
"append-force-show": o.value
})), appendedContent: n, shouldShowAppendedButton: a };
}
function At(e, t, n, o) {
const { appendedContent: a } = o, p = B(e.enableViewPassword), i = S(() => e.type === "password" || e.showType === "password"), h = '<span class="f-icon f-icon-eye" style="color: rgb(56, 143, 255);"></span>', T = '<span class="f-icon f-icon-eye"></span>', c = B(!1);
I(() => [e.readonly, e.disabled], ([d, b]) => {
i.value && (n.value = d || b ? "password" : n.value, a.value = e.readonly || e.disabled ? "" : p.value ? T : "");
});
function v() {
return c.value = !c.value, n.value = c.value ? "text" : "password", a.value = c.value ? h : T, !1;
}
function l() {
n.value = i.value ? "password" : n.value, i.value && (a.value = e.readonly || e.disabled ? "" : p.value ? T : "");
}
return l(), { isPassword: i, onClickAppendedButton: v };
}
function $t(e, t) {
const n = De(e, t), o = je(e, t, n), a = Ve(e, t, o, n), p = Ae(e, t, o, n, a), i = $e(e, t, a), {
displayValue: h,
modelValue: T,
getRealValue: c
} = n, v = ze(e, t, p), {
format: l
} = o, {
isFocus: d
} = p, b = S(() => !e.disabled && !e.readonly);
return j(() => {
const r = c(e.modelValue);
h.value = l(r);
}), I(() => [e.value], ([r]) => {
const u = c(r);
T.value = u, h.value = l(u);
}), I(() => [e.modelValue], ([r]) => {
r !== T.value && (T.value = r, !d.value && (h.value = l(c(r))));
}), I(() => [e.precision, e.useThousands, e.prefix, e.suffix, e.showZero], () => {
h.value = l(T.value);
}), () => m("div", {
class: "input-group flex-row f-cmp-number-spinner",
style: "border:none;"
}, [v(), b.value && i()]);
}
function zt(e) {
return e ? $.getRealPropertyValue(e, "请输入", "input-group.placeholder") : "";
}
function Ht(e, t, n, o) {
const a = B(), {
inputGroupClass: p,
onBlur: i,
onFocus: h
} = o, {
clearButtonClass: T,
clearButtonStyle: c
} = n, v = S(() => e.maxLength ? e.maxLength : e.modelValue ? e.modelValue.length : 0), l = (w) => {
var k, s;
w.stopPropagation(), t.emit("update:modelValue", (k = w.target) == null ? void 0 : k.value), t.emit("valueChange", (s = w.target) == null ? void 0 : s.value);
}, d = S(() => ({
"form-control": !0,
"h-100": e.autoHeight
})), b = S(() => e.enableClear && !e.readonly && !e.disabled), r = zt(e.placeholder), u = S(() => e.disabled || e.readonly ? "" : r), f = S(() => ({
...c.value,
position: "absolute",
right: "5px",
top: "50%",
transform: "translateY(-50%)",
"background-color": "rgb(199, 207, 221)",
"border-radius": "100%",
width: "16px",
height: "16px"
})), C = S(() => {
const w = {
resize: "none",
"padding-right": "15px"
};
return e.rows > 2 ? {
height: "auto",
...w
} : w;
}), g = (w) => {
w.stopPropagation(), a.value.value = "", t.emit("update:modelValue", ""), t.emit("valueChange", "");
};
function P() {
return ne(m("textarea", {
class: d.value,
id: e.id,
"onUpdate:modelValue": (w) => e.modelValue = w,
ref: a,
minlength: e.minLength,
maxlength: e.maxLength ? e.maxLength : null,
tabindex: e.tabIndex,
disabled: e.disabled,
readonly: e.readonly,
autocomplete: e.autocomplete,
placeholder: u.value,
autofocus: e.autofocus,
rows: e.rows,
onInput: l,
onFocus: h,
onBlur: i,
style: C.value
}, null), [[he, e.modelValue]]);
}
function F() {
return e.showCount && m("span", {
style: "position: absolute;bottom: 0;right: 5px;z-index:999;font-size:12px"
}, [`${e.modelValue ? e.modelValue.length : 0}/${v.value}`]);
}
function O() {
return b.value && m("span", {
id: "clearIcon",
class: T.value,
style: f.value,
onClick: (w) => g(w)
}, [m("i", {
class: "f-icon modal_close",
style: "font-size:8px;color:#fff"
}, null)]);
}
return {
renderTextarea: P,
renderCount: F,
renderClear: O
};
}
function Gt(e, t, n, o) {
const a = B(), p = B(e.autocomplete), i = B(e.enableTitle), {
isPassword: h
} = n, T = B(e.minLength), c = B(e.maxLength), v = B(e.tabIndex), {
disabled: l,
displayText: d,
inputType: b,
onBlur: r,
onFocus: u,
onInput: f,
onClick: C,
onKeydown: g,
onKeyup: P,
onMousedown: F,
onMouseup: O,
onTextBoxValueChange: w,
readonly: k,
placeholder: s,
textBoxClass: x,
textBoxTitle: y
} = o;
return j(() => {
var N, E;
e.selectOnCreated && ((N = a.value) == null || N.select()), e.focusOnCreated && ((E = a.value) == null || E.focus({
preventScroll: !0
}));
}), () => m("input", {
id: e.id + "_textbox",
ref: a,
name: "input-group-value",
autocomplete: p.value,
class: x.value,
disabled: l == null ? void 0 : l.value,
maxlength: c.value,
minlength: T.value,
placeholder: s.value,
readonly: k == null ? void 0 : k.value,
tabindex: v.value,
title: i.value && !h.value ? y.value : "",
type: b.value,
value: d == null ? void 0 : d.value,
onBlur: r,
onClick: C,
onChange: w,
onFocus: u,
onInput: f,
onKeydown: g,
onKeyup: P,
onMousedown: F,
onMouseup: O
}, null);
}
function _t(e, t) {
const n = B(e.extendInfo), o = S(() => e.useExtendInfo && !!e.extendInfo), a = S(() => ({
content: n.value
}));
I(() => e.extendInfo, (i) => {
n.value = i;
});
function p() {
t.emit("updateExtendInfo");
}
return () => o.value && ne(m("span", {
class: "input-group-before-tips",
onMouseenter: p
}, [m("i", {
class: "f-icon f-icon-info-circle"
}, null), m("b", {
class: "tips-arrow"
}, null)]), [[xe("tooltip"), a.value]]);
}
function qt(e, t, n, o, a) {
const {
appendedButtonClass: p,
appendedContent: i
} = n, h = S(() => !e.readonly && !e.disabled), T = S(() => i.value && !t.slots.groupTextTemplate), c = S(() => !!t.slots.groupTextTemplate), {
clearButtonClass: v,
clearButtonStyle: l,
onClearValue: d,
shouldShowClearButton: b
} = o, r = B(0);
I(i, (s) => {
r.value++;
});
function u() {
return m("span", {
id: "clearIcon",
class: v.value,
style: l.value,
onClick: (s) => d(s)
}, [m("i", {
class: "f-icon modal_close"
}, null)]);
}
function f(s) {
t.emit("iconMouseEnter", s);
}
function C(s) {
t.emit("iconMouseLeave", s);
}
function g(s) {
h.value && t.emit("clickHandle", {
originalEvent: s
}), s.stopPropagation();
}
const P = e.type === "password" || e.showType === "password" ? a.onClickAppendedButton : g;
function F() {
const s = i.value;
if (!s || !(e.showButtonWhenDisabled || !e.disabled && !e.readonly))
return null;
const y = {
class: "input-group-text",
onMouseenter: f,
onMouseleave: C,
onClick: P
};
if (typeof s == "string")
return m("span", oe(y, {
innerHTML: s
}), null);
if (typeof s == "function") {
const N = s();
return m("span", y, [typeof N == "string" ? m("span", {
innerHTML: N
}, null) : N]);
} else
return m("span", y, [s]);
}
function O() {
return t.slots.groupTextTemplate && t.slots.groupTextTemplate();
}
function w() {
return T.value ? F() : c.value ? O() : "";
}
I(() => e.expandDisabled, (s, x) => {
r.value++;
});
const {
renderExpandContent: k
} = He({
...e,
skipReadonlyCheck: !0
}, t);
return () => m(q, null, [m("div", {
class: p.value,
key: "append-button-" + r.value
}, [b.value && u(), w()]), k()]);
}
const ce = /* @__PURE__ */ A({
name: "FInputGroup",
props: jt,
emits: ["clear", "change", "blur", "click", "clickHandle", "focus", "input", "keydown", "keyup", "iconMouseEnter", "iconMouseLeave", "update:modelValue", "update:value", "updateExtendInfo", "valueChange", "mousedownEvent", "mouseupEvent", "expandClick"],
setup(e, t) {
const n = B(), o = B(e.modelValue), a = B(e.modelValue), p = Ee(e, t, o, a, n), {
inputGroupClass: i,
inputType: h,
inputGroupStyle: T,
changeTextBoxValue: c
} = p, v = Vt(e), {
shouldShowAppendedButton: l
} = v, d = Le(e, t, p), {
onMouseEnter: b,
onMouseLeave: r
} = d, u = At(e, t, h, v), f = $t(e, t), {
renderTextarea: C,
renderCount: g,
renderClear: P
} = Ht(e, t, d, p), F = Gt(e, t, u, p), O = qt(e, t, v, d, u), w = _t(e, t), k = S(() => h.value === "number"), s = S(() => h.value === "textarea");
I(() => [e.value], ([y]) => {
o.value = y, a.value = y;
}), I(() => [e.modelValue], ([y]) => {
o.value = y, a.value = y;
}), j(() => {
e.value && (o.value = e.value, a.value = e.value);
}), t.expose({
clear: () => {
c("", !1), a.value = "";
},
setText: (y) => {
c(y, !1), a.value = y;
}
});
const x = () => m("div", {
ref: n,
id: e.id,
class: i.value,
style: T.value,
onMouseenter: b,
onMouseleave: r
}, [k.value ? f() : s.value ? C() : m(q, null, [w(), F()]), !s.value && !k.value && l.value && O(), s.value && P(), s.value && g()]);
return () => x();
}
});
Me(ce);
const Wt = {
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 }
}, Ut = {
showCloseButton: { type: Boolean, default: !0 },
animate: { type: String, default: "fadeIn" },
options: { type: Object }
}, Q = /* @__PURE__ */ A({
name: "Toast",
props: Ut,
emits: ["close", "click"],
setup: (e, t) => {
const n = B(e.animate), o = "fadeOut", a = S(() => e.options), p = B(!1), i = S(() => a.value.title && a.value.message), h = S(() => !a.value.title && a.value.message), T = S(() => {
const g = {
animated: p.value,
toast: !0,
"toast--only-content": !i.value
};
return g[e.animate] = !1, g[o] = p.value, g["toasty-type-" + a.value.type] = !0, a.value.theme && (g[a.value.theme] = !0), g;
}), c = S(() => {
const F = `f-icon-${a.value && a.value.type ? a.value.type.replace("toasty-type-", "") : "default"}`, O = {
"f-icon": !0
};
return O[F] = !0, O;
}), v = S(() => a.value.title || a.value.message), l = S(() => e.showCloseButton), d = S(() => !!a.value.buttons || !!t.slots.default), b = S(() => $.getLocale() === "en" ? {
wordBreak: "keep-all",
overflowWrap: "break-word"
} : {});
function r(g) {
g.stopPropagation(), g.preventDefault(), p.value = !1, setTimeout(() => {
t.emit("close", a.value);
}, 200);
}
function u(g, P) {
}
function f(g) {
return `f-preten-link ${g.customClass ? g.customClass : ""}`;
}
I(n, () => {
n.value;
});
const C = () => {
var g;
return m(q, null, [m("div", {
class: "after-toast-msg text-right"
}, [!t.slots.default && ((g = a.value.buttons) == null ? void 0 : g.map((P) => m("span", {
class: f(P),
onClick: (F) => void 0
}, [P.text]))), t.slots.default && t.slots.default()])]);
};
return () => m("div", {
class: T.value,
style: "min-height:44px"
}, [l.value && m("button", {
title: $.getLocaleValue("messageBox.close"),
class: "toast-close f-btn-icon f-bare",
onClick: r
}, [m("span", {
class: "f-icon modal_close"
}, null)]), v.value && m("section", {
class: "modal-tips"
}, [!i.value && m("div", {
class: "float-left modal-tips-iconwrap"
}, [m("span", {
class: c.value
}, null)]), m("div", {
class: "modal-tips-content"
}, [i.value && m(q, null, [m("h5", {
class: "toast-title modal-tips-title",
innerHTML: a.value.title
}, null), m("p", {
class: "toast-msg",
innerHTML: a.value.message,
style: b.value
}, null), d.value && C()]), h.value && (a.value.buttons ? m("div", {
class: "toast-title-btns-wrapper d-flex"
}, [m("h5", {
class: "toast-title modal-tips-title only-toast-msg",
style: b.value,
innerHTML: a.value.message
}, null), m("div", {
class: "after-toast-title text-right ml-auto"
}, [C()])]) : m("h5", {
class: "toast-title modal-tips-title only-toast-msg",
style: b.value,
innerHTML: a.value.message
}, null))])])]);
}
}), Yt = ["moz", "ms", "webkit"];
function Zt() {
let e = 0;
return (t) => {
const n = (/* @__PURE__ */ new Date()).getTime(), o = Math.max(0, 16 - (n - e)), a = setTimeout(() => {
t(n + o);
}, o);
return e = n + o, a;
};
}
function Jt() {
if (typeof window > "u")
return () => 0;
if (window.requestAnimationFrame)
return window.requestAnimationFrame.bind(window);
const e = Yt.filter((t) => `${t}RequestAnimationF