@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,580 lines (1,579 loc) • 64.3 kB
JavaScript
var ye = Object.defineProperty;
var xe = (e, t, n) => t in e ? ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var X = (e, t, n) => xe(e, typeof t != "symbol" ? t + "" : t, n);
import { defineComponent as V, ref as B, inject as G, onMounted as j, computed as S, createVNode as p, createTextVNode as ee, watch as M, withDirectives as ne, vModelText as he, resolveDirective as Ce, Fragment as q, mergeProps as oe, reactive as Te, createApp as we, onUnmounted as Se, Transition as Be, toRefs as Oe } from "vue";
import { useDesignerComponent as Pe } from "../designer-canvas/index.esm.js";
import { InputBaseProperty as Fe } from "../property-panel/index.esm.js";
import Ne from "../button-edit/index.esm.js";
import { createPropsResolver as ke, getPropsResolverGenerator as Me } from "../dynamic-resolver/index.esm.js";
import { isPlainObject as te, cloneDeep as Z } from "lodash-es";
import { FInputGroup as Ie } from "../input-group/index.esm.js";
import { LocaleService as $ } from "../locale/index.esm.js";
import { useTextBox as Le, useClear as Ee, withInstall as Re, isMobilePhone as De } from "../common/index.esm.js";
import { useNumber as je, useFormat as Ae, useSpinner as Ve, useTextBox as $e, getSpinnerRender as ze, getNumberTextBoxRender as He } from "../number-spinner/index.esm.js";
import { useInputExpand as _e } 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 qe(e, t) {
function n(o, a) {
const d = e.schema;
return new Ge(o, t).getPropertyConfig(d, a);
}
return { getPropsConfig: n };
}
const We = /* @__PURE__ */ V({
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 = G("design-item-context"), a = G("designer-host-service"), d = qe(o, a), i = Pe(n, o, d);
j(() => {
n.value.componentInstance = i;
});
const C = 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), () => p("div", {
class: "f-button-edit f-cmp-inputgroup f-button-edit-nowrap",
ref: n,
style: "pointer-events: none;"
}, [p("div", {
class: "input-group"
}, [p("input", {
autocomplete: "off",
class: "text-left form-control f-utils-fill",
readonly: "true",
type: "text",
placeholder: e.placeholder
}, null), p("div", {
class: "input-group-append"
}, [p("span", {
class: "input-group-text input-group-append-button"
}, [p("i", {
class: "f-icon f-icon-yxs_earth"
}, null)])]), e.expandable && e.expandContent && p("div", {
class: C.value
}, [p("div", {
class: "input-group-text",
innerHTML: e.expandContent
}, null)])])]);
}
});
function ae(e, t) {
let n;
function o(l) {
const { properties: f, title: b, ignore: r } = l, u = r && Array.isArray(r), m = Object.keys(f).reduce((h, g) => ((!u || !r.find((O) => O === g)) && (h[g] = f[g].type === "object" && f[g].properties ? o(f[g]) : Z(f[g].default)), h), {});
if (b && (!u || !r.find((h) => h === "id"))) {
const h = b.toLowerCase().replace(/-/g, "_");
m.id = `${h}_${Math.random().toString().slice(2, 6)}`;
}
return m;
}
function a(l) {
const { properties: f, title: b, required: r } = l;
if (r && Array.isArray(r)) {
const u = r.reduce((m, h) => (m[h] = f[h].type === "object" && f[h].properties ? o(f[h]) : Z(f[h].default), m), {});
if (b && r.find((m) => m === "id")) {
const m = b.toLowerCase().replace(/-/g, "_");
u.id = `${m}_${Math.random().toString().slice(2, 6)}`;
}
return u;
}
return {
type: b
};
}
function d(l, f = {}, b) {
const r = e[l];
if (r) {
let u = a(r);
const m = t[l];
return u = m ? m({ getSchemaByType: d }, u, f, b) : u, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(u), u;
}
return null;
}
function i(l, f) {
const b = o(f);
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 C(l, f) {
return Object.keys(l).filter((r) => l[r] != null).reduce((r, u) => {
if (f.has(u)) {
const m = f.get(u);
if (typeof m == "string")
r[m] = l[u];
else {
const h = m(u, l[u], l);
Object.assign(r, h);
}
} else
r[u] = l[u];
return r;
}, {});
}
function T(l, f, b = /* @__PURE__ */ new Map()) {
const r = i(l, f);
return C(r, b);
}
function c(l) {
var b;
const f = l.type;
if (f) {
const r = e[f];
if (!r)
return l;
const u = i(l, r), m = ((b = l.editor) == null ? void 0 : b.type) || "";
if (m) {
const h = e[m], g = i(l.editor, h);
u.editor = g;
}
return u;
}
return l;
}
function v(l) {
n = l;
}
return { getSchemaByType: d, resolveSchemaWithDefaultValue: c, resolveSchemaToProps: T, mappingSchemaToProps: C, setDesignerContext: v };
}
const Ue = {}, Ye = {}, { resolveSchemaWithDefaultValue: Xe } = ae(Ue, Ye);
function Ze(e = {}) {
function t(c, v, l, f) {
if (typeof l == "number")
return f[c].length === l;
if (typeof l == "object") {
const b = Object.keys(l)[0], r = l[b];
if (b === "not")
return Number(f[c].length) !== Number(r);
if (b === "moreThan")
return Number(f[c].length) >= Number(r);
if (b === "lessThan")
return Number(f[c].length) <= Number(r);
}
return !1;
}
function n(c, v, l, f) {
return f[c] && f[c].propertyValue && String(f[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((f) => {
if (f === "length")
return { target: l, operator: "length", param: null, value: v[f] };
const b = f, r = v[f];
return { target: l, operator: "getProperty", param: b, value: r };
}) : [];
}
function d(c) {
return Object.keys(c).reduce((l, f) => {
const b = a(f, c[f]);
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 C(c, v) {
return d(c).reduce((b, r) => b && i(r, v), !0);
}
function T(c, v) {
const l = Object.keys(c), f = l.includes("allOf"), b = l.includes("anyOf"), r = f || b, h = (r ? c[r ? f ? "allOf" : "anyOf" : "allOf"] : [c]).map((O) => C(O, v));
return f ? !h.includes(!1) : h.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} 项` : "无"
}, Ke = {
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]
}, et = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
table: { type: "table", name: "表格布局" },
"table-td": { type: "table-td", 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: "动态表单" }
}, tt = {
convertFrom: (e, t, n) => {
var a;
const o = e.editor && e.editor[t] ? e.editor[t] : e[t];
return ((a = et[o]) == null ? void 0 : a.name) || o;
}
}, nt = {
convertTo: (e, t, n, o) => {
e[t] = e[t];
},
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
}, ot = {
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";
}
}, at = {
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 d = (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 ? d ? "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 "";
}
}, rt = {
convertTo: (e, t, n, o) => {
if (e.column || (e.column = {}), t === "fitMode") {
n && n !== "none" ? (e.column.fitColumns = !0, e.column.fitMode = n) : (e.column.fitColumns = !1, e.column.fitMode = "average");
return;
}
if (t === "fitColumns") {
e.column.fitColumns = n, n && !e.column.fitMode && (e.column.fitMode = "average");
return;
}
e.column[t] = n;
},
convertFrom: (e, t, n) => {
if (e.column) {
if (t === "fitMode")
return e.column.fitColumns ? e.column.fitMode || "average" : "none";
if (t === "fitColumns")
return e.column.fitColumns;
}
return t === "fitMode" ? "none" : "";
}
}, it = {
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 : "";
}
}, lt = {
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;
}
}
}, ut = {
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;
}
}
}, st = {
convertTo: (e, t, n, o) => {
if (e.pagination || (e.pagination = {}), t === "sizeLimits")
if (n == null)
delete e.pagination.sizeLimits;
else {
const a = [...new Set(
String(n).split(",").map((d) => d.trim()).filter((d) => d !== "").map((d) => parseInt(d, 10)).filter((d) => !Number.isNaN(d) && d > 0)
)];
a.length > 0 ? e.pagination.sizeLimits = a : delete e.pagination.sizeLimits;
}
else
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];
}
}, ct = {
convertTo: (e, t, n, o) => {
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
},
convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
}, dt = {
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;
}
}, ft = {
convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
}, mt = {
convertFrom: (e, t) => e[t] || "",
convertTo: (e, t, n) => {
e[t] = n;
}
}, pt = {
convertTo: (e, t, n, o) => {
e.size || (e.size = {}), e.size[t] = n;
},
convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
}, vt = {
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;
}
}, gt = {
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);
}
}, bt = {
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, d, 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" ? ((d = e.filter) == null ? void 0 : d.enable) !== void 0 ? !!e.filter.enable : !!e.enableFilter : ((i = e.filter) == null ? void 0 : i[t]) || void 0;
}
}, yt = {
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 "";
}
}, xt = {
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", Ke],
["/converter/items-count.converter", ft],
["/converter/type.converter", tt],
["/converter/change-editor.converter", nt],
["/converter/change-formatter.converter", ot],
["/converter/column-command.converter", at],
["/converter/column-option.converter", rt],
["/converter/summary.converter", it],
["/converter/group.converter", lt],
["/converter/form-group-label.converter", mt],
["/converter/field-selector.converter", ut],
["/converter/pagination.converter", st],
["/converter/row-number.converter", ct],
["/converter/grid-selection.converter", dt],
["/converter/size.converter", pt],
["/converter/change-formatter-enum.converter", vt],
["/converter/grid-sort.converter", gt],
["/converter/grid-filter.converter", bt],
["/converter/row-option.converter", yt],
["/converter/change-formatter-type.converter", xt],
["/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" }]
]), d = Ze();
function i(r, u) {
return () => d.parseValueSchema(r, u);
}
function C(r, u, m) {
return r.includes("visible") && u.visible !== void 0 ? typeof u.visible == "boolean" ? () => !!u.visible : u.visible === void 0 ? !0 : i(u.visible, m) : () => !0;
}
function T(r, u, m) {
return r.includes("readonly") && u.readonly !== void 0 ? typeof u.readonly == "boolean" ? () => !!u.readonly : i(u.readonly, m) : () => !1;
}
function c(r, u) {
const m = r.$converter || u;
return typeof m == "string" && m && o.has(m) ? o.get(m) || null : m || null;
}
function v(r, u, m, h, g, O = "", P = "") {
return Object.keys(r).map((w) => {
const N = B(1), s = w, x = r[w], y = Object.keys(x), k = x.title, I = x.type, L = a.get(I) || { type: "input-group", enableClear: !1 }, D = x.editor ? Object.assign({}, L, x.editor) : Object.assign({}, L), W = C(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, m, h, g, O, P) : [], Y = !0;
let E = c(x, P);
const me = S({
get() {
if (N.value) {
if (["class", "style"].find((H) => H === s) && !E && (E = o.get("/converter/appearance.converter") || null), E && E.convertFrom) {
const H = E.convertFrom(m, w, g, O);
return H === void 0 && Object.prototype.hasOwnProperty.call(x, "defaultValue") ? x.type === "boolean" ? x.defaultValue : x.defaultValue || "" : H;
}
const R = m[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) {
N.value += 1, E && E.convertTo ? (E.convertTo(h, w, R, g, O), E.convertTo(m, w, R, g, O)) : (h[w] = R, m[w] = R);
}
}), { refreshPanelAfterChanged: pe, description: ve, isExpand: ge, parentPropertyID: be } = x, K = { propertyID: s, propertyName: k, propertyType: I, propertyValue: me, editor: D, visible: W, readonly: z, cascadeConfig: U, hideCascadeTitle: Y, refreshPanelAfterChanged: pe, description: ve, isExpand: ge, parentPropertyID: be };
return u[s] = K, K;
});
}
function l(r, u, m = {}) {
const h = {}, g = e[r];
return g && g.categories ? Object.keys(g.categories).map((P) => {
const F = g.categories[P], w = F == null ? void 0 : F.title, N = v(F.properties || {}, h, {}, m, u);
return { categoryId: P, categoryName: w, properties: N };
}) : [];
}
function f(r, u, m, h, g = "") {
const O = u.$ref.schema, P = u.$ref.converter, F = m[O], w = F.type, N = n(F), s = {}, x = e[w];
if (x && x.categories) {
const y = x.categories[r], k = y == null ? void 0 : y.title;
P && Object.keys(y.properties).forEach((D) => {
y.properties[D].$converter = P;
});
const I = (y == null ? void 0 : y.properties) || {}, L = v(I, s, N, F, h, g);
return { categoryId: r, categoryName: k, properties: L };
}
return { categoryId: r, categoryName: "", properties: [] };
}
function b(r, u, m, h, g) {
const O = r.type, P = n(r), F = {};
let w = g || e[O];
if (!(w && Object.keys(w).length > 0) && m && m.getPropConfig && (w = m.getPropConfig(h)), w && w.categories) {
const s = [];
return Object.keys(w.categories).map((x) => {
const y = w.categories[x];
if (y.$ref) {
s.push(f(x, y, r, u, h));
return;
}
const k = y == null ? void 0 : y.title, I = 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 || {}, F, P, r, u, h, y.$converter), { setPropertyRelates: U } = y, Y = y == null ? void 0 : y.parentPropertyID;
s.push({ categoryId: x, categoryName: k, tabId: I, tabName: L, hide: D, properties: z, hideTitle: W, setPropertyRelates: U, parentPropertyID: Y });
}), s;
}
return [];
}
return {
getPropertyConfigBySchema: b,
getPropertyConfigByType: l,
propertyConverterMap: o
};
}
const Ct = {}, Tt = {};
re(Ct, Tt, Xe);
const wt = {}, St = {}, { resolveSchemaWithDefaultValue: Bt } = ae(wt, St), Ot = {}, Pt = {};
re(Ot, Pt, Bt);
function Ft(e, t) {
return { customClass: t.class, customStyle: t.style };
}
const ie = /* @__PURE__ */ new Map([
["appearance", Ft]
]), Nt = "https://json-schema.org/draft/2020-12/schema", kt = "https://farris-design.gitee.io/input-group.schema.json", Mt = "language-textbox", It = "A Farris Input Component", Lt = "object", Et = {
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
}
}, Rt = [
"type"
], Dt = [
"id",
"appearance",
"binding",
"visible"
], le = {
$schema: Nt,
$id: kt,
title: Mt,
description: It,
type: Lt,
properties: Et,
required: Rt,
ignore: Dt
};
function ue(e, t, n) {
return t;
}
const Q = {
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 },
/**
* 传入数值
* @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 }
}, pn = ke(Q, le, ie, ue), se = Me(
Q,
le,
ie,
ue
), jt = /* @__PURE__ */ V({
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 = Z(e.modelValue || {}));
});
function d(T, c) {
o.value[c.code] = T, !e.needConfirm && t.emit("update:modelValue", o.value);
}
function i() {
t.emit("cancel", e.modelValue);
}
function C() {
t.emit("confirm", o.value);
}
return () => {
var T;
return p("ul", {
class: "list-group",
style: "background: white;",
ref: a
}, [(T = n.value) == null ? void 0 : T.map((c) => p("li", {
class: "list-group-item border-0 p-2 px-2"
}, [p("div", {
class: "farris-group-wrap form-inline farris-form-inline"
}, [p("div", {
class: "form-group farris-form-group"
}, [p("label", {
for: "hpinput01",
class: "col-form-label"
}, [p("span", {
class: "farris-label-text",
title: c.name
}, [c.name])]), p("div", {
class: "farris-input-wrap"
}, [p(Ie, {
id: e.id + "_" + c.code,
modelValue: o.value[c.code],
readonly: e.readonly,
"onUpdate:modelValue": (v) => {
d(v, c);
},
updateOn: "change",
maxLength: e.maxLength
}, null)])])])])), e.needConfirm && !e.readonly && p("li", {
class: "list-group-item border-0 p-2 px-2",
style: "text-align: right;"
}, [p("button", {
type: "button",
class: "btn btn-secondary mr-3",
onClick: i
}, [ee("取消")]), p("button", {
type: "button",
class: "btn btn-primary",
onClick: C
}, [ee("确定")])])]);
};
}
}), At = {
id: { Type: String, default: "" },
/**
* 针对 txt 类型的输入框,是否启用自动完成.off 不启用自动完成,on 启用自动完成,具体可以参考原生input autocomplete属性赋值
* @default off
*/
autocomplete: { Type: String, default: "off" },
/**
* 自定义样式
*/
customClass: { Type: String, default: "" },
/**
* 禁用
*/
disabled: { Type: Boolean, default: !1 },
/**
* 是否允许编辑,true 是允许编辑
* @default true
*/
editable: { Type: Boolean, default: !0 },
/**
* 是否启用清空按钮,true 是当有文本时显示清空按钮
* @default true
*/
enableClear: { Type: Boolean, default: !0 },
/**
* 鼠标移动到组件内时显示组件内的文本,true 是启用提示
* @default true
*/
enableTitle: { Type: Boolean, default: !0 },
/**
* 是否启用查看密码明文功能,true 是启用
* @default true
*/
enableViewPassword: { Type: Boolean, default: !0 },
/**
* 是否始终显示占位符文本。true 始终显示占位符
* @default false
*/
forcePlaceholder: { Type: Boolean, default: !1 },
/**
* 扩展按钮的文本
*/
groupText: { Type: String, default: "" },
/**
* 密码模式
*/
showType: { Type: String, default: "text" },
/**
* 输入框类型,可选:text 文本输入框、number 数字输入框、password 密码输入框、textarea 多行文本输入框
* @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: "" },
/**
* 是否显示边线,默认 true显示边线
* @default true
*/
showBorder: { Type: Boolean, default: !0 },
/**
* 步长
*/
step: { Type: Number, default: 1 },
/**
* 启用提示信息文本
*/
placeholder: { Type: String, default: "" },
precision: { Type: Number, default: 0 },
/**
* 只读
* @default false
*/
readonly: { Type: Boolean, default: !1 },
/**
* 当组件禁用或只读时显示后边的按钮
* @default false
*/
showButtonWhenDisabled: { Type: Boolean, default: !1 },
/**
* tab键索引,默认从0开始,-1表示不可通过Tab键获得焦点
* @default 0
*/
tabIndex: { Type: Number, default: 0 },
/**
* 文本在输入框中的对齐方式,可选: left 左对齐、center 居中对齐、right 右对齐
* @default left
*/
textAlign: { Type: String, default: "left" },
/**
* 是否启用前置扩展信息;设置为true后,鼠标悬停时显示 `extendInfo`配置的文本
* @default false
*/
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 $t(e, t, n, o) {
const { appendedContent: a } = o, d = B(e.enableViewPassword), i = S(() => e.type === "password" || e.showType === "password"), C = '<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);
M(() => [e.readonly, e.disabled], ([f, b]) => {
i.value && (n.value = f || b ? "password" : n.value, a.value = e.readonly || e.disabled ? "" : d.value ? T : "");
});
function v() {
return c.value = !c.value, n.value = c.value ? "text" : "password", a.value = c.value ? C : T, !1;
}
function l() {
n.value = i.value ? "password" : n.value, i.value && (a.value = e.readonly || e.disabled ? "" : d.value ? T : "");
}
return l(), { isPassword: i, onClickAppendedButton: v };
}
function zt(e, t) {
const n = je(e, t), o = Ae(e, t, n), a = Ve(e, t, o, n), d = $e(e, t, o, n, a), i = ze(e, t, a), {
displayValue: C,
modelValue: T,
getRealValue: c
} = n, v = He(e, t, d), {
format: l
} = o, {
isFocus: f
} = d, b = S(() => !e.disabled && !e.readonly);
return j(() => {
const r = c(e.modelValue);
C.value = l(r);
}), M(() => [e.value], ([r]) => {
const u = c(r);
T.value = u, C.value = l(u);
}), M(() => [e.modelValue], ([r]) => {
r !== T.value && (T.value = r, !f.value && (C.value = l(c(r))));
}), M(() => [e.precision, e.useThousands, e.prefix, e.suffix, e.showZero], () => {
C.value = l(T.value);
}), () => p("div", {
class: "input-group flex-row f-cmp-number-spinner",
style: "border:none;"
}, [v(), b.value && i()]);
}
function Ht(e) {
return e ? $.getRealPropertyValue(e, "请输入", "input-group.placeholder") : "";
}
function _t(e, t, n, o) {
const a = B(), {
inputGroupClass: d,
onBlur: i,
onFocus: C
} = o, {
clearButtonClass: T,
clearButtonStyle: c
} = n, v = S(() => e.maxLength ? e.maxLength : e.modelValue ? e.modelValue.length : 0), l = (w) => {
var N, s;
w.stopPropagation(), t.emit("update:modelValue", (N = w.target) == null ? void 0 : N.value), t.emit("valueChange", (s = w.target) == null ? void 0 : s.value);
}, f = S(() => ({
"form-control": !0,
"h-100": e.autoHeight
})), b = S(() => e.enableClear && !e.readonly && !e.disabled), r = Ht(e.placeholder), u = S(() => e.disabled || e.readonly ? "" : r), m = 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"
})), h = 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 O() {
return ne(p("textarea", {
class: f.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: C,
onBlur: i,
style: h.value
}, null), [[he, e.modelValue]]);
}
function P() {
return e.showCount && p("span", {
style: "position: absolute;bottom: 0;right: 5px;z-index:999;font-size:12px"
}, [`${e.modelValue ? e.modelValue.length : 0}/${v.value}`]);
}
function F() {
return b.value && p("span", {
id: "clearIcon",
class: T.value,
style: m.value,
onClick: (w) => g(w)
}, [p("i", {
class: "f-icon modal_close",
style: "font-size:8px;color:#fff"
}, null)]);
}
return {
renderTextarea: O,
renderCount: P,
renderClear: F
};
}
function Gt(e, t, n, o) {
const a = B(), d = B(e.autocomplete), i = B(e.enableTitle), {
isPassword: C
} = n, T = B(e.minLength), c = B(e.maxLength), v = B(e.tabIndex), {
disabled: l,
displayText: f,
inputType: b,
onBlur: r,
onFocus: u,
onInput: m,
onClick: h,
onKeydown: g,
onKeyup: O,
onMousedown: P,
onMouseup: F,
onTextBoxValueChange: w,
readonly: N,
placeholder: s,
textBoxClass: x,
textBoxTitle: y
} = o;
return j(() => {
var k, I;
e.selectOnCreated && ((k = a.value) == null || k.select()), e.focusOnCreated && ((I = a.value) == null || I.focus({
preventScroll: !0
}));
}), () => p("input", {
id: e.id + "_textbox",
ref: a,
name: "input-group-value",
autocomplete: d.value,
class: x.value,
disabled: l == null ? void 0 : l.value,
maxlength: c.value,
minlength: T.value,
placeholder: s.value,
readonly: N == null ? void 0 : N.value,
tabindex: v.value,
title: i.value && !C.value ? y.value : "",
type: b.value,
value: f == null ? void 0 : f.value,
onBlur: r,
onClick: h,
onChange: w,
onFocus: u,
onInput: m,
onKeydown: g,
onKeyup: O,
onMousedown: P,
onMouseup: F
}, null);
}
function qt(e, t) {
const n = B(e.extendInfo), o = S(() => e.useExtendInfo && !!e.extendInfo), a = S(() => ({
content: n.value
}));
M(() => e.extendInfo, (i) => {
n.value = i;
});
function d() {
t.emit("updateExtendInfo");
}
return () => o.value && ne(p("span", {
class: "input-group-before-tips",
onMouseenter: d
}, [p("i", {
class: "f-icon f-icon-info-circle"
}, null), p("b", {
class: "tips-arrow"
}, null)]), [[Ce("tooltip"), a.value]]);
}
function Wt(e, t, n, o, a) {
const {
appendedButtonClass: d,
appendedContent: i
} = n, C = S(() => !e.readonly && !e.disabled), T = S(() => i.value && !t.slots.groupTextTemplate), c = S(() => !!t.slots.groupTextTemplate), {
clearButtonClass: v,
clearButtonStyle: l,
onClearValue: f,
shouldShowClearButton: b
} = o, r = B(0);
M(i, (s) => {
r.value++;
});
function u() {
return p("span", {
id: "clearIcon",
class: v.value,
style: l.value,
onClick: (s) => f(s)
}, [p("i", {
class: "f-icon modal_close"
}, null)]);
}
function m(s) {
t.emit("iconMouseEnter", s);
}
function h(s) {
t.emit("iconMouseLeave", s);
}
function g(s) {
C.value && t.emit("clickHandle", {
originalEvent: s
}), s.stopPropagation();
}
const O = e.type === "password" || e.showType === "password" ? a.onClickAppendedButton : g;
function P() {
const s = i.value;
if (!s || !(e.showButtonWhenDisabled || !e.disabled && !e.readonly))
return null;
const y = {
class: "input-group-text",
onMouseenter: m,
onMouseleave: h,
onClick: O
};
if (typeof s == "string")
return p("span", oe(y, {
innerHTML: s
}), null);
if (typeof s == "function") {
const k = s();
return p("span", y, [typeof k == "string" ? p("span", {
innerHTML: k
}, null) : k]);
} else
return p("span", y, [s]);
}
function F() {
return t.slots.groupTextTemplate && t.slots.groupTextTemplate();
}
function w() {
return T.value ? P() : c.value ? F() : "";
}
M(() => e.expandDisabled, (s, x) => {
r.value++;
});
const {
renderExpandContent: N
} = _e({
...e,
skipReadonlyCheck: !0
}, t);
return () => p(q, null, [p("div", {
class: d.value,
key: "append-button-" + r.value
}, [b.value && u(), w()]), N()]);
}
const ce = /* @__PURE__ */ V({
name: "FInputGroup",
props: At,
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), d = Le(e, t, o, a, n), {
inputGroupClass: i,
inputType: C,
inputGroupStyle: T,
changeTextBoxValue: c
} = d, v = Vt(e), {
shouldShowAppendedButton: l
} = v, f = Ee(e, t, d), {
onMouseEnter: b,
onMouseLeave: r
} = f, u = $t(e, t, C, v), m = zt(e, t), {
renderTextarea: h,
renderCount: g,
renderClear: O
} = _t(e, t, f, d), P = Gt(e, t, u, d), F = Wt(e, t, v, f, u), w = qt(e, t), N = S(() => C.value === "number"), s = S(() => C.value === "textarea");
M(() => [e.value], ([y]) => {
o.value = y, a.value = y;
}), M(() => [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 = () => p("div", {
ref: n,
id: e.id,
class: i.value,
style: T.value,
onMouseenter: b,
onMouseleave: r
}, [N.value ? m() : s.value ? h() : p(q, null, [w(), P()]), !s.value && !N.value && l.value && F(), s.value && O(), s.value && g()]);
return () => x();
}
});
Re(ce);
const Ut = {
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 }
}, Yt = {
showCloseButton: { type: Boolean, default: !0 },
animate: { type: String, default: "fadeIn" },
options: { type: Object }
}, J = /* @__PURE__ */ V({
name: "Toast",
props: Yt,
emits: ["close", "click"],
setup: (e, t) => {
const n = B(e.animate), o = "fadeOut", a = S(() => e.options), d = B(!1), i = S(() => a.value.title && a.value.message), C = S(() => !a.value.title && a.value.message), T = S(() => {
const g = {
animated: d.value,
toast: !0,
"toast--only-content": !i.value
};
return g[e.animate] = !1, g[o] = d.value, g["toasty-type-" + a.value.type] = !0, a.value.theme && (g[a.value.theme] = !0), g;
}), c = S(() => {
const P = `f-icon-${a.value && a.value.type ? a.value.type.replace("toasty-type-", "") : "default"}`, F = {
"f-icon": !0
};
return F[P] = !0, F;
}), v = S(() => a.value.title || a.value.message), l = S(() => e.showCloseButton), f = S(() => !!a.value.buttons || !!t.slots.default), b = S(() => $.getLocale() === "en" ? {
wordBreak: "keep-all",
overflowWrap: "break-word"
} : {});
function r(g) {
g.stopPropagation(), g.preventDefault(), d.value = !1, setTimeout(() => {
t.emit("close", a.value);
}, 200);
}
function u(g, O) {
}
function m(g) {
return `f-preten-link ${g.customClass ? g.customClass : ""}`;
}
M(n, () => {
n.value;
});
const h = () => {
var g;
return p(q, null, [p("div", {
class: "after-toast-msg text-right"
}, [!t.slots.default && ((g = a.value.buttons) == null ? void 0 : g.map((O) => p("span", {
class: m(O),
onClick: (P) => void 0
}, [O.text]))), t.slots.default && t.slots.default()])]);
};
return () => p("div", {
class: T.value,
style: "min-height:44px"