@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,375 lines (1,374 loc) • 421 kB
JavaScript
var Ia = Object.defineProperty;
var Na = (e, t, n) => t in e ? Ia(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var N = (e, t, n) => Na(e, typeof t != "symbol" ? t + "" : t, n);
import { ref as k, computed as j, watch as pe, defineComponent as Pe, onBeforeUnmount as rr, withDirectives as ar, createVNode as w, resolveDirective as La, createTextVNode as Tn, mergeProps as nn, Fragment as vt, reactive as Tt, createApp as uo, onUnmounted as on, onMounted as dt, Transition as ir, nextTick as jt, inject as en, onBeforeMount as Va, Teleport as sr, shallowRef as Da, render as _n, h as Aa, cloneVNode as qa, vShow as ja, onUpdated as Ha } from "vue";
import { getSchemaByTypeForDesigner as $a, resolveAppearance as lr, createPropsResolver as Fn, getSchemaByType as Oo } from "../dynamic-resolver/index.esm.js";
import { cloneDeep as fe, isPlainObject as Mo, isUndefined as wt, debounce as _a } from "lodash-es";
import { useI18n as gt } from "vue-i18n";
import Wa, { FDynamicFormGroup as Ua } from "../dynamic-form/index.esm.js";
import { useDateFormat as ur, resolveField as za, FormSchemaEntityField$Type as Jn, FormSchemaEntityFieldTypeName as Po, getCustomClass as Zn, withInstall as Ya, useGuid as gn } from "../common/index.esm.js";
import { DgControl as Bo, useDesignerComponent as Ga } from "../designer-canvas/index.esm.js";
import { InputBaseProperty as Qa, FPropertyPanel as Xa } from "../property-panel/index.esm.js";
import Ja from "../accordion/index.esm.js";
import Za from "../avatar/index.esm.js";
import Ka from "../../designer/button-edit/index.esm.js";
import ei from "../button-group/index.esm.js";
import ti from "../calendar/index.esm.js";
import ni from "../capsule/index.esm.js";
import Ro from "../../designer/checkbox/index.esm.js";
import Io from "../../designer/checkbox-group/index.esm.js";
import Kn from "../combo-list/index.esm.js";
import oi from "../combo-tree/index.esm.js";
import ri from "../component/index.esm.js";
import ai from "../color-picker/index.esm.js";
import ii from "../content-container/index.esm.js";
import si, { DATE_FORMATS as li } from "../date-picker/index.esm.js";
import ui from "../../designer/data-grid/index.esm.js";
import ci from "../dropdown/index.esm.js";
import di from "../events-editor/index.esm.js";
import fi from "../filter-bar/index.esm.js";
import pi from "../field-selector/index.esm.js";
import mi from "../binding-selector/index.esm.js";
import hi from "../image-cropper/index.esm.js";
import vi from "../../designer/input-group/index.esm.js";
import gi from "../layout/index.esm.js";
import yi from "../list-nav/index.esm.js";
import bi from "../../designer/list-view/index.esm.js";
import wi, { getLookupEditorCommonProperties as Ci, getLookupDialogCommonProperties as xi, getLookupPaginationProperties as Ti } from "../lookup/index.esm.js";
import Fi from "../mapping-editor/index.esm.js";
import ki from "../nav/index.esm.js";
import Si from "../number-range/index.esm.js";
import Ei from "../number-spinner/index.esm.js";
import Oi from "../order/index.esm.js";
import Mi from "../page-header/index.esm.js";
import Pi from "../page-footer/index.esm.js";
import Bi from "../pagination/index.esm.js";
import Ri from "../progress/index.esm.js";
import Ii from "../query-solution/index.esm.js";
import Ni from "../../designer/radio-group/index.esm.js";
import Li from "../rate/index.esm.js";
import Vi from "../response-toolbar/index.esm.js";
import Di from "../response-layout/index.esm.js";
import Ai from "../response-layout-editor/index.esm.js";
import qi from "../search-box/index.esm.js";
import ji from "../section/index.esm.js";
import Hi from "../smoke-detector/index.esm.js";
import $i from "../splitter/index.esm.js";
import _i from "../step/index.esm.js";
import Wi from "../switch/index.esm.js";
import Ui from "../tabs/index.esm.js";
import cr from "../tags/index.esm.js";
import zi from "../text/index.esm.js";
import Yi from "../time-picker/index.esm.js";
import dr, { FTransfer as fr } from "../transfer/index.esm.js";
import Gi from "../tree-view/index.esm.js";
import Qi from "../uploader/index.esm.js";
import Xi from "../verify-detail/index.esm.js";
import Ji from "../video/index.esm.js";
import Zi from "../textarea/index.esm.js";
import Ki from "../schema-selector/index.esm.js";
import es from "../../designer/tree-grid/index.esm.js";
import ts from "../event-parameter/index.esm.js";
import ns from "../filter-condition-editor/index.esm.js";
import os from "../fieldset/index.esm.js";
import rs from "../sort-condition-editor/index.esm.js";
import as from "../menu-lookup/index.esm.js";
import is from "../../designer/drawer/index.esm.js";
import ss from "../json-editor/index.esm.js";
import ls from "../property-editor/index.esm.js";
import us from "../expression-editor/index.esm.js";
import cs from "../code-editor/index.esm.js";
import ds from "../html-template/index.esm.js";
import fs from "../collection-property-editor/index.esm.js";
import ps, { F_MODAL_SERVICE_TOKEN as ms } from "../modal/index.esm.js";
import hs from "../external-container/index.esm.js";
import vs from "../language-textbox/index.esm.js";
import { LocaleService as _t } from "../locale/index.esm.js";
import { useResizeObserver as gs } from "@vueuse/core";
import { getHierarchyRow as ys, useIdentify as bs, useGroupData as ws, useFilter as Cs, useHierarchy as xs, useLoading as Ts, useDataView as Fs, useSelection as ks, useSelectHierarchyItem as Ss, usePagination as Es, useDataViewContainerStyle as Os, useCommandColumn as Ms, useSettingColumn as Ps, useColumn as Bs, useSort as Rs, useGroupColumn as Is, useRow as Ns, useEdit as Ls, useVisualDataBound as Vs, useVisualDataCell as Ds, useVisualDataRow as As, useVisualData as qs, useCellPosition as js, useSidebar as Hs, useVirtualScroll as $s, useFitColumn as _s, useFilterHistory as Ws, useColumnFilter as Us, useDragColumn as zs, getColumnHeader as Ys, getSidebar as Gs, getDisableMask as Qs, getHorizontalScrollbar as Xs, getVerticalScrollbar as Js, getEmpty as Zs, getPagination as Ks, getSummary as el } from "../data-view/index.esm.js";
import { FNotifyService as pr } from "../notify/index.esm.js";
import { useConditionValue as tl, FConditionFields as No, FConditionList as nl, FConditionFieldsDesign as ol } from "../condition/index.esm.js";
import { FInputGroup as rl } from "../input-group/index.esm.js";
import al, { FRadioGroup as il } from "../radio-group/index.esm.js";
import { FDataGrid as sl } from "../data-grid/index.esm.js";
import { FTooltip as ll } from "../tooltip/index.esm.js";
import { FCheckboxGroup as ul } from "../checkbox-group/index.esm.js";
import cl from "../popover/index.esm.js";
import { FButtonEdit as dl } from "../button-edit/index.esm.js";
function mr(e, t) {
let n;
function o(p) {
const { properties: s, title: l, ignore: d } = p, h = d && Array.isArray(d), v = Object.keys(s).reduce((F, O) => ((!h || !d.find((I) => I === O)) && (F[O] = s[O].type === "object" && s[O].properties ? o(s[O]) : fe(s[O].default)), F), {});
if (l && (!h || !d.find((F) => F === "id"))) {
const F = l.toLowerCase().replace(/-/g, "_");
v.id = `${F}_${Math.random().toString().slice(2, 6)}`;
}
return v;
}
function r(p) {
const { properties: s, title: l, required: d } = p;
if (d && Array.isArray(d)) {
const h = d.reduce((v, F) => (v[F] = s[F].type === "object" && s[F].properties ? o(s[F]) : fe(s[F].default), v), {});
if (l && d.find((v) => v === "id")) {
const v = l.toLowerCase().replace(/-/g, "_");
h.id = `${v}_${Math.random().toString().slice(2, 6)}`;
}
return h;
}
return {
type: l
};
}
function a(p, s = {}, l) {
const d = e[p];
if (d) {
let h = r(d);
const v = t[p];
return h = v ? v({ getSchemaByType: a }, h, s, l) : h, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(h), h;
}
return null;
}
function i(p, s) {
const l = o(s);
return Object.keys(l).reduce((d, h) => (Object.prototype.hasOwnProperty.call(p, h) && (d[h] && Mo(d[h]) && Mo(p[h] || !p[h]) ? Object.assign(d[h], p[h] || {}) : d[h] = p[h]), d), l), l;
}
function u(p, s) {
return Object.keys(p).filter((d) => p[d] != null).reduce((d, h) => {
if (s.has(h)) {
const v = s.get(h);
if (typeof v == "string")
d[v] = p[h];
else {
const F = v(h, p[h], p);
Object.assign(d, F);
}
} else
d[h] = p[h];
return d;
}, {});
}
function f(p, s, l = /* @__PURE__ */ new Map()) {
const d = i(p, s);
return u(d, l);
}
function c(p) {
var l;
const s = p.type;
if (s) {
const d = e[s];
if (!d)
return p;
const h = i(p, d), v = ((l = p.editor) == null ? void 0 : l.type) || "";
if (v) {
const F = e[v], O = i(p.editor, F);
h.editor = O;
}
return h;
}
return p;
}
function m(p) {
n = p;
}
return { getSchemaByType: a, resolveSchemaWithDefaultValue: c, resolveSchemaToProps: f, mappingSchemaToProps: u, setDesignerContext: m };
}
const hr = {}, vr = {}, { getSchemaByType: Fg, resolveSchemaWithDefaultValue: fl, resolveSchemaToProps: pl, mappingSchemaToProps: ml, setDesignerContext: kg } = mr(hr, vr);
function hl(e = {}) {
function t(c, m, p, s) {
if (typeof p == "number")
return s[c].length === p;
if (typeof p == "object") {
const l = Object.keys(p)[0], d = p[l];
if (l === "not")
return Number(s[c].length) !== Number(d);
if (l === "moreThan")
return Number(s[c].length) >= Number(d);
if (l === "lessThan")
return Number(s[c].length) <= Number(d);
}
return !1;
}
function n(c, m, p, s) {
return s[c] && s[c].propertyValue && String(s[c].propertyValue.value) === String(p);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", n]
]);
Object.keys(e).reduce((c, m) => (c.set(m, e[m]), c), o);
function r(c, m) {
const p = c;
return typeof m == "number" ? [{ target: p, operator: "length", param: null, value: Number(m) }] : typeof m == "boolean" ? [{ target: p, operator: "getProperty", param: c, value: !!m }] : typeof m == "object" ? Object.keys(m).map((s) => {
if (s === "length")
return { target: p, operator: "length", param: null, value: m[s] };
const l = s, d = m[s];
return { target: p, operator: "getProperty", param: l, value: d };
}) : [];
}
function a(c) {
return Object.keys(c).reduce((p, s) => {
const l = r(s, c[s]);
return p.push(...l), p;
}, []);
}
function i(c, m) {
if (o.has(c.operator)) {
const p = o.get(c.operator);
return p && p(c.target, c.param, c.value, m) || !1;
}
return !1;
}
function u(c, m) {
return a(c).reduce((l, d) => l && i(d, m), !0);
}
function f(c, m) {
const p = Object.keys(c), s = p.includes("allOf"), l = p.includes("anyOf"), d = s || l, F = (d ? c[d ? s ? "allOf" : "anyOf" : "allOf"] : [c]).map((I) => u(I, m));
return s ? !F.includes(!1) : F.includes(!0);
}
return { parseValueSchema: f };
}
const vl = {
convertTo: (e, t, n, o) => {
e.appearance || (e.appearance = {}), e.appearance[t] = n;
},
convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
}, gl = {
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
}, yl = {
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]
}, Q = {
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: "列表导航" },
"list-view": { type: "list-view", name: "列表" },
"filter-bar": { type: "filter-bar", name: "筛选条" },
"language-textbox": { type: "language-textbox", name: "多语输入框" }
}, bl = {
convertFrom: (e, t, n) => {
var r;
const o = e.editor && e.editor[t] ? e.editor[t] : e[t];
return ((r = Q[o]) == null ? void 0 : r.name) || o;
}
}, wl = {
convertTo: (e, t, n, o) => {
e[t] = e[t];
},
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
}, Cl = {
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 === "tempDateFormat")
return e.formatter.dateFormat === "yyyy年MM月dd日" ? "yearMonthDay" : e.formatter.dateFormat === "yyyy-MM-dd HH:mm:ss" ? "yyyy-MM-ddTHH:mm:ss" : e.formatter.dateFormat === "yyyy/MM/dd HH:mm:ss" ? "yyyy/MM/ddTHH:mm:ss" : e.formatter.dateFormat === "yyyy年MM月dd日 HH时mm分ss秒" ? "yearMonthDayHourMinuteSecond" : e.formatter.tempDateFormat || e.formatter.dateFormat || "yyyy-MM-dd";
if (t === "customFormat")
return e.formatter.customFormat;
if (t === "type")
return e.formatter.type || "none";
}
return "none";
}
}, xl = {
convertTo: (e, t, n, o) => {
e.command ? e.command[t] = n : e.command = {
[t]: n
}, t === "enable" && n && (e.command.commands || (e.command.commands = [
{
text: "编辑",
type: "primary",
command: "edit"
},
{
text: "删除",
type: "danger",
command: "remove"
}
]));
},
convertFrom: (e, t, n) => e.command && t === "enable" ? e.command.enable : ""
}, Tl = {
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 "";
}
}, Fl = {
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) => e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : ""
}, kl = {
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
});
},
convertFrom: (e, t, n) => {
if (e.group) {
if (t === "enable")
return e.group.enable;
if (t === "showSummary")
return e.group.showSummary;
}
}
}, Sl = {
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;
}
}
}, El = {
convertTo: (e, t, n, o) => {
e.pagination || (e.pagination = {}), e.pagination[t] = n;
},
convertFrom: (e, t, n) => e.pagination ? e.pagination[t] : e[t]
}, Ol = {
convertTo: (e, t, n, o) => {
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
},
convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
}, Ml = {
convertTo: (e, t, n, o) => {
e.selection || (e.selection = {}), e.selection[t] = n;
},
convertFrom: (e, t, n) => e.selection ? e.selection[t] : e[t]
}, Pl = {
convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
}, Bl = {
convertFrom: (e, t) => e[t] || "",
convertTo: (e, t, n) => {
e[t] = n;
}
}, Rl = {
convertTo: (e, t, n, o) => {
e.size || (e.size = {}), e.size[t] = n;
},
convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
}, Il = {
convertFrom: (e, t, n) => {
var o, r;
return (o = e.formatter) != null && o.data && t === "formatterEnumData" && !e.formatterEnumData ? (r = e.formatter) == null ? void 0 : r.data : e.formatterEnumData;
}
}, Nl = {
convertTo: (e, t, n, o) => {
e.sort || (e.sort = {}), e.sort[t] = n;
},
convertFrom: (e, t, n) => {
var o, r;
if (t === "mode")
return ((o = e.sort) == null ? void 0 : o.mode) || "client";
if (t === "multiSort")
return !!((r = e.sort) != null && r.multiSort);
}
}, Ll = {
convertTo: (e, t, n, o) => {
e.filter || (e.filter = {}), e.filter[t] = n;
},
convertFrom: (e, t, n) => {
var o;
if (t === "mode")
return ((o = e.filter) == null ? void 0 : o.mode) || "client";
}
}, Vl = {
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;
}
return "";
}
};
function gr(e, t, n) {
const o = /* @__PURE__ */ new Map([
["/converter/appearance.converter", vl],
["/converter/buttons.converter", gl],
["/converter/property-editor.converter", yl],
["/converter/items-count.converter", Pl],
["/converter/type.converter", bl],
["/converter/change-editor.converter", wl],
["/converter/change-formatter.converter", Cl],
["/converter/column-command.converter", xl],
["/converter/column-option.converter", Tl],
["/converter/summary.converter", Fl],
["/converter/group.converter", kl],
["/converter/form-group-label.converter", Bl],
["/converter/field-selector.converter", Sl],
["/converter/pagination.converter", El],
["/converter/row-number.converter", Ol],
["/converter/grid-selection.converter", Ml],
["/converter/size.converter", Rl],
["/converter/change-formatter-enum.converter", Il],
["/converter/grid-sort.converter", Nl],
["/converter/grid-filter.converter", Ll],
["/converter/row-option.converter", Vl]
]), r = /* @__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 }]
]), a = hl();
function i(d, h) {
return () => a.parseValueSchema(d, h);
}
function u(d, h, v) {
return d.includes("visible") && h.visible !== void 0 ? typeof h.visible == "boolean" ? () => !!h.visible : h.visible === void 0 ? !0 : i(h.visible, v) : () => !0;
}
function f(d, h, v) {
return d.includes("readonly") && h.readonly !== void 0 ? typeof h.readonly == "boolean" ? () => !!h.readonly : i(h.readonly, v) : () => !1;
}
function c(d, h) {
const v = d.$converter || h;
return typeof v == "string" && v && o.has(v) ? o.get(v) || null : v || null;
}
function m(d, h, v, F, O, I = "", g = "") {
return Object.keys(d).map((x) => {
const S = k(1), M = x, b = d[x], E = Object.keys(b), y = b.title, P = b.type, R = r.get(P) || { type: "input-group", enableClear: !1 }, C = b.editor ? Object.assign({}, R, b.editor) : Object.assign({}, R), B = u(E, b, h), D = f(E, b, h);
C.readonly = C.readonly === void 0 ? D() : C.readonly;
const _ = b.type === "cascade" ? m(b.properties, h, v, F, O, I, g) : [], A = !0;
let q = c(b, g);
const K = j({
get() {
if (S.value) {
if (["class", "style"].find((Se) => Se === M) && !q && (q = o.get("/converter/appearance.converter") || null), q && q.convertFrom)
return q.convertFrom(v, x, O, I);
const be = v[x];
return Object.prototype.hasOwnProperty.call(b, "defaultValue") && (be === void 0 || typeof be == "string" && be === "") ? b.type === "boolean" ? b.defaultValue : b.defaultValue || "" : be;
}
return null;
},
set(be) {
S.value += 1, q && q.convertTo ? (q.convertTo(F, x, be, O, I), q.convertTo(v, x, be, O, I)) : (F[x] = be, v[x] = be);
}
}), { refreshPanelAfterChanged: W, description: ie, isExpand: te, parentPropertyID: se } = b, re = { propertyID: M, propertyName: y, propertyType: P, propertyValue: K, editor: C, visible: B, readonly: D, cascadeConfig: _, hideCascadeTitle: A, refreshPanelAfterChanged: W, description: ie, isExpand: te, parentPropertyID: se };
return h[M] = re, re;
});
}
function p(d, h, v = {}) {
const F = {}, O = e[d];
return O && O.categories ? Object.keys(O.categories).map((g) => {
const T = O.categories[g], x = T == null ? void 0 : T.title, S = m(T.properties || {}, F, {}, v, h);
return { categoryId: g, categoryName: x, properties: S };
}) : [];
}
function s(d, h, v, F, O = "") {
const I = h.$ref.schema, g = h.$ref.converter, T = v[I], x = T.type, S = n(T), M = {}, b = e[x];
if (b && b.categories) {
const E = b.categories[d], y = E == null ? void 0 : E.title;
g && Object.keys(E.properties).forEach((C) => {
E.properties[C].$converter = g;
});
const P = (E == null ? void 0 : E.properties) || {}, R = m(P, M, S, T, F, O);
return { categoryId: d, categoryName: y, properties: R };
}
return { categoryId: d, categoryName: "", properties: [] };
}
function l(d, h, v, F, O) {
const I = d.type, g = n(d), T = {};
let x = O || e[I];
if (x && Object.keys(x).length === 0 && v && v.getPropConfig && (x = v.getPropConfig(F)), x && x.categories) {
const S = [];
return Object.keys(x.categories).map((M) => {
const b = x.categories[M];
if (b.$ref) {
S.push(s(M, b, d, h, F));
return;
}
const E = b == null ? void 0 : b.title, y = b == null ? void 0 : b.tabId, P = b == null ? void 0 : b.tabName, R = b == null ? void 0 : b.hide, C = b == null ? void 0 : b.hideTitle, B = m(b.properties || {}, T, g, d, h, F, b.$converter), { setPropertyRelates: D } = b, _ = b == null ? void 0 : b.parentPropertyID;
S.push({ categoryId: M, categoryName: E, tabId: y, tabName: P, hide: R, properties: B, hideTitle: C, setPropertyRelates: D, parentPropertyID: _ });
}), S;
}
return [];
}
return {
getPropertyConfigBySchema: l,
getPropertyConfigByType: p,
propertyConverterMap: o
};
}
const yr = {}, br = {};
gr(yr, br, fl);
const wr = {}, Cr = {}, { getSchemaByType: Sg, resolveSchemaWithDefaultValue: Dl, resolveSchemaToProps: Eg, mappingSchemaToProps: Og, setDesignerContext: Mg } = mr(wr, Cr), xr = {}, Tr = {};
gr(xr, Tr, Dl);
function rn(e, t, n = /* @__PURE__ */ new Map(), o = (i, u, f, c) => u, r = {}, a = (i) => i) {
return hr[t.title] = t, vr[t.title] = o, yr[t.title] = r, br[t.title] = a, wr[t.title] = t, Cr[t.title] = o, xr[t.title] = r, Tr[t.title] = a, (i = {}, u = !0) => {
if (!u)
return ml(i, n);
const f = pl(i, t, n), c = Object.keys(e).reduce((m, p) => (m[p] = e[p].default, m), {});
return Object.assign(c, f);
};
}
function kn(e, t) {
return { customClass: t.class, customStyle: t.style };
}
function Al() {
const { t: e } = gt();
return { conditionListLocale: {
// 添加条件
add: e("condition.add"),
// 生成条件组
create: e("condition.create"),
// 重置
reset: e("condition.reset"),
and: e("condition.and"),
or: e("condition.or")
} };
}
function ql() {
const { t: e } = gt();
return { operatorsLocale: {
equal: e("operators.equal"),
notEqual: e("operators.notEqual"),
greater: e("operators.greater"),
greaterOrEqual: e("operators.greaterOrEqual"),
lessOrEqual: e("operators.lessOrEqual"),
less: e("operators.less"),
contains: e("operators.contains"),
startWith: e("operators.startWith"),
endWith: e("operators.endWith")
} };
}
var co = /* @__PURE__ */ ((e) => (e.Equal = "0", e.NotEqual = "1", e.Greater = "2", e.GreaterOrEqual = "3", e.Less = "4", e.LessOrEqual = "5", e.Like = "6", e.LikeStartWith = "7", e.LikeEndWith = "8", e.In = "9", e.NotIn = "10", e))(co || {});
function jl() {
const { operatorsLocale: e } = ql();
return [
{
value: "0",
name: e.equal
// 等于
},
{
value: "1",
name: e.equal
// 不等于
},
{
value: "2",
name: e.equal
// 大于
},
{
value: "3",
name: e.equal
// 大于等于
},
{
value: "4",
name: e.less
// 小于
},
{
value: "5",
name: e.lessOrEqual
// 小于等于
},
{
value: "6",
name: e.contains
// 包含
},
{
value: "7",
name: e.startWith
// 开始是
},
{
value: "8",
name: e.endWith
// 结束是
}
];
}
const Hl = {
"button-edit": ["0", "1", " 6", "7", "8"],
"check-box": ["0"],
"combo-list": ["0", "1"],
"combo-lookup": ["0", "1", " 6", "7", "8"],
"date-picker": ["0", "1", "2", "3", "4", "5"],
"date-range": [],
"datetime-picker": ["0", "1", "2", "3", "4", "5"],
"datetime-range": [],
"month-picker": ["0", "1", "2", "3", "4", "5"],
"month-range": [],
"year-picker": ["0", "1", "2", "3", "4", "5"],
"year-range": [],
"input-group": ["0", "1", "6", "7", "8"],
lookup: ["0", "1"],
"number-range": [],
"number-spinner": ["0", " 1", "2", "3", "4", "5"],
"radio-group": ["0"],
text: ["0", "1", " 6", "7", "8"]
};
function $l(e, t, n) {
const { fieldMap: o } = n;
function r(a) {
const i = o.get(a.fieldCode);
if (!i)
return [];
const u = i.editor.type, f = new Set(Hl[u]);
return jl().filter((m) => f.has(m.value));
}
return { getCompareOperators: r };
}
const Fr = {
conditions: { type: Array, default: [] },
fields: { type: Array, default: [] },
key: { type: String, default: "" },
/**
* 控间标签同行展示
*/
isControlInline: {
type: [Boolean, String],
default: "auto",
validator: (e) => [!0, !1, "auto"].includes(e)
},
/**
* 条件项统一的样式
*/
itemClass: { type: Boolean, default: "col-12 col-md-6 col-xl-3 col-el-2" }
};
class _l {
constructor(t = { value: [] }, n) {
N(this, "editorType", "check-box");
N(this, "value");
N(this, "valueType", "boolean");
// 编辑器配置
N(this, "editiorConfig");
const r = (Array.isArray(t.value) ? t.value : typeof t.value == "string" ? t.value.split(",") : []).map((a) => JSON.parse(a));
this.value = r, this.editiorConfig = Object.assign({}, n);
}
clear() {
this.value = [];
}
setValue(t) {
this.value = t;
}
getValue() {
return this.value;
}
getDisplayText() {
return this.value.map((t) => t ? "是" : "否").join(",");
}
isEmpty() {
return this.value.length === 0;
}
}
class Wl {
constructor(t = { textValue: "", value: "", valueField: "" }, n) {
N(this, "editorType", "combo-lookup");
N(this, "textValue");
N(this, "value");
N(this, "valueField");
N(this, "valueType", "text");
// 编辑器配置
N(this, "editiorConfig");
this.textValue = t == null ? void 0 : t.textValue, this.value = t == null ? void 0 : t.value, this.editiorConfig = Object.assign({}, n), this.valueField = t == null ? void 0 : t.valueField;
}
clear() {
this.value = "", this.valueField = "", this.textValue = "";
}
getPropValue(t, n) {
if (n.length > 1) {
const o = n.shift();
return t[o] ? this.getPropValue(t[o], n) : null;
}
return t[n[0]];
}
getTextValue(t) {
const n = t.split("."), o = this.value.split(",").map((r) => this.getPropValue(r, fe(n)));
return o && o.length ? o.join(",") : "";
}
getValue() {
const t = this.valueField.split("."), n = this.value.split(",").map((o) => this.getPropValue(o, fe(t)));
return n && n.length ? n.join(",") : "";
}
getDisplayText() {
return this.getValue();
}
setValue(t) {
throw new Error("Method not implemented.");
}
isEmpty() {
return !this.valueField;
}
}
class Sn {
constructor(t = { value: "", displayFormat: "", valueFormat: "" }, n) {
N(this, "editorType", "date-picker");
N(this, "value");
N(this, "valueType", "datetime");
N(this, "displayFormat", "");
N(this, "valueFormat", "");
// 编辑器配置
N(this, "editiorConfig");
this.value = t == null ? void 0 : t.value, this.editiorConfig = Object.assign({}, n), this.displayFormat = (t == null ? void 0 : t.displayFormat) || (n == null ? void 0 : n.displayFormat) || "", this.valueFormat = (t == null ? void 0 : t.valueFormat) || (n == null ? void 0 : n.valueFormat) || "";
}
formatValue() {
const { formatTo: t, parseToDate: n } = ur();
if (!this.value)
return "";
const o = n(this.value, this.valueFormat);
return t(o, this.displayFormat);
}
setValue(t) {
this.value = t;
}
getValue() {
return this.value;
}
getDisplayText() {
return this.formatValue();
}
isEmpty() {
return !this.value;
}
clear() {
this.value = void 0;
}
}
class fo {
constructor(t = { begin: "", end: "", displayFormat: "", valueFormat: "" }, n = {}) {
N(this, "editorType", "date-range");
N(this, "begin", "");
N(this, "end", "");
N(this, "valueType", "datetime");
N(this, "value", "");
// 编辑器配置
N(this, "editiorConfig");
N(this, "displayFormat", "");
N(this, "valueFormat", "");
this.begin = (t == null ? void 0 : t.begin) || "", this.end = (t == null ? void 0 : t.end) || "", this.editiorConfig = Object.assign({}, n, { delimiter: "~" }), this.displayFormat = (t == null ? void 0 : t.displayFormat) || (n == null ? void 0 : n.displayFormat) || "", this.valueFormat = (t == null ? void 0 : t.valueFormat) || (n == null ? void 0 : n.valueFormat) || "", this.value = (this.begin === null ? "" : this.begin) + "~" + (this.end === null ? "" : this.end);
}
clear() {
this.begin = "", this.end = "", this.value = "";
}
formatValue(t) {
const { formatTo: n, parseToDate: o } = ur();
if (!t)
return "";
const r = o(t, this.valueFormat);
return n(r, this.displayFormat);
}
getValue() {
return {
begin: this.begin,
end: this.end
};
}
// TODO
getDisplayText() {
return !this.begin && !this.end ? "" : (this.begin === null ? "" : this.formatValue(this.begin)) + "~" + (this.end === null ? "" : this.formatValue(this.end));
}
setValue(t) {
if (t) {
const n = t.split(this.editiorConfig.delimiter);
this.begin = n[0] || "", this.end = n[1] || "", this.value = t;
} else
this.clear();
}
isEmpty() {
return !this.begin && !this.end;
}
}
class Ul {
constructor(t = { value: "", valueList: [] }, n) {
N(this, "editorType", "combo-list");
N(this, "value");
N(this, "valueType", "enum");
N(this, "valueList", []);
// 编辑器配置
N(this, "editiorConfig");
this.value = t == null ? void 0 : t.value, this.editiorConfig = Object.assign({}, n), this.editiorConfig.data && this.editiorConfig.data.length ? this.valueList = this.editiorConfig.data : this.valueList = (t == null ? void 0 : t.valueList) || [];
}
clear() {
this.value = "", this.valueList = [];
}
getValue() {
return this.value;
}
getDisplayText() {
var r, a;
const t = typeof this.value;
let n = "", o = [];
switch (t) {
case "string":
o = this.value.split(",") || [], n = this.valueList.filter((i) => o.indexOf(i.value) > -1).map((i) => i.name).join(",");
break;
case "boolean":
n = ((r = this.valueList.find((i) => i.value === this.value)) == null ? void 0 : r.name) || "";
break;
case "number":
n = ((a = this.valueList.find((i) => i.value === this.value)) == null ? void 0 : a.name) || "";
break;
}
return n;
}
// setValue(data: { value: string; displayText: string }) {
// // this.displayText = data.dispalyText;
// const enumValues = getEnumValues(data);
// this.value = enumValues;
// return this.displayText;
// }
setValue(t) {
this.value = t.value;
}
isEmpty() {
return !this.value && this.value !== !1 && this.value !== 0;
}
}
class zl {
constructor(t = { value: "", displayText: "", displayField: "", isInputText: !1 }, n) {
N(this, "editorType", "input-group");
// 通过弹窗返回的若干个值对象构成的数组
N(this, "value");
N(this, "valueType", "text");
// 控件内显示的值
N(this, "displayText");
// 弹窗模式下,取列表中哪个字段的值映射到当前字段
N(this, "valueField");
// 是否是手动输入的值
N(this, "isInputText");
// 编辑器配置
N(this, "editiorConfig");
this.value = t == null ? void 0 : t.value, this.displayText = t == null ? void 0 : t.displayText, this.valueField = t == null ? void 0 : t.displayField, this.isInputText = t == null ? void 0 : t.isInputText, this.editiorConfig = Object.assign({}, n);
}
clear() {
this.value = "", this.displayText = "", this.valueField = "";
}
getPropValue(t, n) {
if (n.length > 1) {
const o = n.shift();
return t[o] ? this.getPropValue(t[o], n) : "";
}
return t[n[0]];
}
getTextValue(t) {
const n = t.split("."), o = this.value.map((r) => this.getPropValue(r, fe(n)));
return o && o.length ? o.join(",") : "";
}
getValue() {
return this.value;
}
getDisplayText() {
return this.getValue();
}
setValue(t) {
throw new Error("Method not implemented.");
}
isEmpty() {
var t;
return !this.displayText && (this.value == null || !((t = this.value) != null && t.length));
}
}
class Yl {
constructor(t = { mapFields: [], value: "", valueField: "", isInputText: !1, helpId: "" }, n) {
N(this, "editorType", "lookup");
N(this, "helpId");
N(this, "mapFields");
N(this, "value");
N(this, "valueField");
N(this, "valueType", "text");
// 帮助的值是否为手动输入的任意值,对应帮助的任意输入属性nosearch
N(this, "isInputText");
// 编辑器配置
N(this, "editiorConfig");
this.editiorConfig = Object.assign({}, n), this.value = (t == null ? void 0 : t.value) || "", this.valueField = (t == null ? void 0 : t.valueField) || (n == null ? void 0 : n.valueField), this.mapFields = t.mapFields, this.isInputText = (t == null ? void 0 : t.isInputText) || (n == null ? void 0 : n.isInputText), this.helpId = (t == null ? void 0 : t.helpId) || (n == null ? void 0 : n.helpId);
}
clear() {
this.value = "", this.mapFields = [];
}
getValue() {
return this.mapFields.map((t) => za(t, this.valueField || "id")).join(",");
}
getDisplayText() {
return this.value;
}
setValue(t) {
throw new Error("Method not implemented.");
}
isEmpty() {
return !this.mapFields.length;
}
}
class Gl extends Sn {
constructor(n = { value: "", displayFormat: "", valueFormat: "" }, o) {
super(n, o);
N(this, "editorType", "month-picker");
}
}
class Ql extends fo {
constructor(n = { begin: "", end: "", displayFormat: "", valueFormat: "" }, o) {
super(n, o);
N(this, "editorType", "month-range");
}
}
class Xl {
constructor(t = { begin: null, end: null }, n) {
N(this, "editorType", "number-range");
N(this, "begin");
N(this, "end");
N(this, "valueType", "number");
// 编辑器配置
N(this, "editiorConfig");
this.editiorConfig = Object.assign({}, n), this.begin = (t == null ? void 0 : t.begin) == null ? null : parseFloat(t.begin), this.end = (t == null ? void 0 : t.end) == null ? null : parseFloat(t.end);
}
clear() {
this.begin = null, this.end = null;
}
getValue() {
return {
begin: this.begin,
end: this.end
};
}
getDisplayText() {
return (this.begin === null ? "" : this.begin) + "~" + (this.end === null ? "" : this.end);
}
setValue(t) {
this.begin = t.begin == null ? null : parseFloat(t.begin), this.end = t.end == null ? null : parseFloat(t.end);
}
isEmpty() {
return this.begin == null && this.end == null;
}
}
class Jl {
constructor(t = { value: "" }, n) {
N(this, "editorType", "number-spinner");
N(this, "value");
N(this, "valueType", "number");
// 编辑器配置
N(this, "editiorConfig");
this.editiorConfig = Object.assign({}, n);
const o = parseFloat(t.value);
this.value = isNaN(o) ? null : o;
}
clear() {
this.value = null;
}
getValue() {
return this.value;
}
getDisplayText() {
return this.getValue();
}
setValue(t) {
this.value = isNaN(parseFloat(t)) ? null : t;
}
isEmpty() {
return this.value == null || isNaN(this.value);
}
}
class Zl {
constructor(t = { value: null, valueList: [] }, n) {
N(this, "editorType", "radio-group");
N(this, "value");
N(this, "valueType", "enum");
N(this, "valueList", []);
// 编辑器配置
N(this, "editiorConfig");
this.editiorConfig = Object.assign({}, n), this.value = t == null ? void 0 : t.value, this.editiorConfig.data && this.editiorConfig.data.length ? this.valueList = this.editiorConfig.data : this.valueList = (t == null ? void 0 : t.valueList) || [];
}
clear() {
this.value = void 0, this.valueList = [];
}
getValue() {
return this.value;
}
getDisplayText() {
var t;
return ((t = this.valueList.find((n) => n.value === this.value)) == null ? void 0 : t.name) || "";
}
setValue(t) {
this.value = t;
}
isEmpty() {
return !this.value && this.value !== 0 && this.value !== !1;
}
}
class Kl extends Sn {
constructor(n = { value: "", displayFormat: "", valueFormat: "" }, o) {
super(n, o);
N(this, "editorType", "year-picker");
}
}
class kr {
constructor(t = { value: "" }, n) {
N(this, "editorType", "text");
N(this, "value");
N(this, "valueType", "text");
// 编辑器配置
N(this, "editiorConfig");
this.value = t.value;
}
clear() {
this.value = void 0;
}
getValue() {
return this.value;
}
getDisplayText() {
return this.getValue();
}
setValue(t) {
this.value = t;
}
isEmpty() {
return !this.value;
}
}
class eu extends Sn {
constructor(n = { value: "", displayFormat: "", valueFormat: "" }, o) {
super(n, o);
N(this, "editorType", "datetime-picker");
}
}
class tu extends fo {
constructor(n = { begin: "", end: "", displayFormat: "", valueFormat: "" }, o = {}) {
super(n, o);
// 这个属性会在后面进行比对
N(this, "editorType", "datetime-range");
N(this, "valueType", "datetime");
}
}
function Sr() {
function e(t, n, o) {
switch (t) {
case "check-box":
return new _l(n, o);
case "combo-list":
return new Ul(n, o);
case "combo-lookup":
return new Wl(n, o);
case "input-group":
return new zl(n, o);
case "year-picker":
return new Kl(n, o);
case "date-picker":
return new Sn(n, o);
case "datetime-range":
return new tu(n, o);
case "date-range":
return new fo(n, o);
case "datetime-picker":
return new eu(n, o);
case "lookup":
return new Yl(n, o);
case "month-picker":
return new Gl(n, o);
case "month-range":
return new Ql(n, o);
case "number-range":
return new Xl(n, o);
case "number-spinner":
return new Jl(n, o);
case "radio-group":
return new Zl(n, o);
default:
return new kr(n, o);
}
}
return { createConditionValue: e };
}
function Er(e, t) {
const n = k(e.fields), o = k([]), r = /* @__PURE__ */ new Map(), { createConditionValue: a } = Sr();
function i(p) {
let s = "input-group";
switch (p) {
case "year-picker":
case "month-picker":
case "month-range":
case "date-range":
case "datetime-range":
case "datetime-picker":
s = "date-picker";
break;
default:
s = p;
}
return s;
}
function u(p) {
const s = p.editor ? p.editor.type : "input-group";
return p.editor.type = i(s), p.editor.type === "date-picker" && (s.indexOf("range") > -1 && (p.editor.enablePeriod = !0), s.indexOf("datetime") > -1 && (p.editor.showTime = !0), s.indexOf("year") > -1 && (p.editor.selectMode = "year"), s.indexOf("month") > -1 && (p.editor.selectMode = "month"), p.editor.weekSelect && (p.editor.selectMode = "week")), s === "input-group" && (p.editor.placeholder = "请输入"), p.editor;
}
function f(p) {
return p.map((l) => Object.assign({}, l)).map((l) => (l.editor = u(l), l));
}
function c(p = !0) {
n.value.reduce((s, l) => (p && (l.editor = u(l)), s.set(l.labelCode, l), s), r);
}
function m(p) {
return p.forEach((s) => {
if (s) {
const l = r.get(s.fieldCode);
l.controlType && (s.value = a(l.controlType, s.value, l.editor));
}
}), p;
}
return { convertToSingleControl: f, fields: n, fieldMap: r, fieldConditions: o, loadFieldConfigs: c, initialConditionValue: m };
}
function nu(e, t, n) {
const o = k(null), r = k(n), a = k(0);
function i(m, p) {
let s = null;
return function() {
const l = arguments;
s ? (clearTimeout(s), s = setTimeout(() => {
s = null, m(...l);
}, 200)) : (m(...l), s = setTimeout(() => {
s = null;
}, 200));
};
}
function u() {
r.value && (o.value = new ResizeObserver(i((m) => {
const p = m[0];
a.value = p.contentRect.width;
})), o.value.observe(r.value));
}
function f(m) {
let s = "col-12";
return m > 250 * 6 ? s = "col-2" : m > 250 * 4 ? s = "col-3" : m > 250 * 3 ? s = "col-4" : m > 250 * 2 && (s = "col-6"), s;
}
const c = j(() => f(a.value));
return pe([n], ([m]) => {
r.value = m, u();
}), {
conditionClass: c,
resizeObserver: o
};
}
const Lo = /* @__PURE__ */ Pe({
name: "FConditionFields",
props: Fr,
emits: ["valueChange", "blur", "focus", "click", "input"],
setup(e, t) {
const n = k(), {
locale: o
} = gt(), r = k(e.key), a = k(e.conditions), i = Er(e), {
initialConditionValue: u,
fieldMap: f,
loadFieldConfigs: c
} = i, m = nu(e, t, n), {
conditionClass: p,
resizeObserver: s
} = m;
c(!0), u(a.value), rr(() => {
var v;
(v = s.value) == null || v.unobserve(n.value);
}), pe(() => e.conditions, () => {
a.value = e.conditions, u(a.value);
});
const l = j(() => ({
// row: true,
"f-utils-flex-row-wrap": !0,
"farris-form": !0,
"condition-div": !0,
"farris-form-controls-inline": !o.value || e.isControlInline === !0 || e.isControlInline === "auto" && o.value !== "en"
}));
function d(v, F, O, I) {
switch (v.value.editorType) {
case "combo-list":
I.newValue && (v.value.valueList = I.newValue.map((g) => ({
name: g.name,
value: g.value
})));
break;
case "radio-group":
v.value.valueList = [O.data.find((g) => g.value === F)];
break;
case "year-range":
case "month-range":
case "date-range":
case "datetime-range":
v.value.setValue(F);
break;
}
t.emit("valueChange", F, v);
}
function h() {
return a.value.map((v) => {
var T, x, S, M, b, E;
const F = (T = f.get(v.fieldCode)) == null ? void 0 : T.editor, O = (x = f.get(v.fieldCode)) == null ? void 0 : x.id;
let I = !0;
((S = v.value) == null ? void 0 : S.editorType) === "lookup" && F ? (F.idValue = (M = v.value.mapFields) == null ? void 0 : M.map((y) => y.id).join(","), F.onClear = () => {
v.value.mapFields = [], d(v, "");
}, F["onUpdate:dataMapping"] = (y) => {
v.value.mapFields = y.items, d(v, v.value.getValue());
}, I = !1) : ((b = v.value) == null ? void 0 : b.editorType) === "number-range" && F ? (F.beginValue = v.value.begin, F.onBeginValueChange = (y) => {
v.value.begin = y, d(v, y);
}, F.endValue = v.value.end, F.onEndValueChange = (y) => {
v.value.end = y, d(v, y);
}, I = !1) : F && ["year-range", "month-range", "date-range", "datetime-range"].find((y) => {
var P;
return y === ((P = v.value) == null ? void 0 : P.editorType);
}) && (F.beginValue = v.value.begin, F.endValue = v.value.end);
let g = ((E = F == null ? void 0 : F.appearance) == null ? void 0 : E.class) || e.itemClass;
return F != null && F.multiLineLabel && (g = g + " farris-group-multi-label"), w(Ua, {
id: O,
key: O,
customClass: g,
label: (F == null ? void 0 : F.showLabel) === !1 ? " " : v.fieldName,
editor: F,
required: F == null ? void 0 : F.required,
modelValue: v.value.value,
"onUpdate:modelValue": (y) => v.value.value = y,
onChange: (y, P) => {
I && d(v, y, F, P);
}
}, null);
});
}
return () => ar(w("div", {
class: l.value,
key: r.value,
ref: n
}, [h()]), [[La("area-response")]]);
}
}), po = /* @__PURE__ */ new Map([
["appearance", kn]
]), ou = /* @__PURE__ */ new Map([]), ru = "root-viewmodel";
class au {
constructor(t, n) {
N(this, "formSchemaUtils");
N(this, "controlCreatorUtils");
N(this, "designViewModelUtils");
this.resolver = t, this.designerHostService = n, this.formSchemaUtils = this.designerHostService.formSchemaUtils, this.controlCreatorUtils = this.designerHostService.controlCreatorUtils, this.designViewModelUtils = this.designerHostService.designViewModelUtils;
}
createComponent(t) {
const n = this.createComponentRefNode(t), o = this.createComponentNode(t), r = this.createViewModeNode(t), a = this.formSchemaUtils.getFormSchema();
return a.module.viewmodels.push(r), a.module.components.push(o), this.designViewModelUtils.assembleDesignViewModel(), n;
}
createComponentRefNode(t) {
const n = this.resolver.getSchemaByType("component-ref");
return Object.assign(n, {
id: `${t.componentId}-component-ref`,
component: `${t.componentId}-component`
}), n;
}
createComponentNode(t) {
const n = this.resolver.getSchemaByType("component"), o = this.createFormComponentContents(t);
return Object.assign(n, {
id: `${t.componentId}-component`,
viewModel: `${t.componentId}-component-viewmodel`,
componentType: t.componentType,
appearance: {
class: this.getFormComponentClass()
},
formColumns: t.formColumns,
contents: o
}), n;
}
/**
* 获取卡片组件层级的class样式
*/
getFormComponentClass() {
const { templateId: t } = this.formSchemaUtils.getFormSchema().module;
return t === "double-list-in-tab-template" ? "f-struct-wrapper f-utils-fill-flex-column" : "f-struct-wrapper";
}
createFormComponentContents(t) {