@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,475 lines • 81.5 kB
JavaScript
import { useCommonUtils as Ft, resolveField as yn, getCustomClass as pn, withInstall as Cn } from "../common/index.esm.js";
import { ref as de, computed as ne, reactive as nt, watch as Le, createVNode as f, isVNode as dt, Comment as xt, Fragment as ot, createTextVNode as Je, defineComponent as Tt, onMounted as hn, nextTick as bn, onUnmounted as Sn, provide as wn, getCurrentInstance as Fn } from "vue";
import { useResizeObserver as xn } from "@vueuse/core";
import { isPlainObject as bt, cloneDeep as St } from "lodash-es";
import { SETTING_COLUMN_FIELD as Tn, COMMAND_COLUMN_FIELD as On, CellMode as Ot, SETTING_COLUMN_DATA_TYPE as _e, COMMAND_COLUMN_DATA_TYPE as He, useScreen as kn, useIdentify as Bn, useGroupData as En, useFilter as Pn, useHierarchy as Dn, useLoading as In, useDataView as Mn, usePagination as Gn, useSelection as Nn, useDataViewContainerStyle as jn, useCommandColumn as Vn, useSettingColumn as An, useColumn as zn, useSort as _n, useGroupColumn as Hn, useRow as Ln, useEdit as Wn, useVisualDataBound as Rn, useVisualDataCell as $n, useVisualDataRow as Un, useVisualGroupRow as Yn, useVisualSummaryRow as qn, useVisualData as Xn, useCellContentStyle as Jn, useCellPosition as Qn, useSidebar as Zn, useVirtualScroll as Kn, useFitColumn as eo, useFilterHistory as to, useColumnFilter as no, useDragColumn as oo, getColumnHeader as ro, getPagination as io, getSidebar as lo, getDisableMask as ao, getSummary as uo, getHorizontalScrollbar as so, getVerticalScrollbar as co, getFilterPanel as fo, getGroupPanel as mo, useAdapt as vo, useNavigation as go, getEmpty as yo, ColumnSettingSolution as po, refreshScrollAfterDataSourceLoad as Co } from "../data-view/index.esm.js";
import ho, { FDynamicForm as bo, FDynamicFormLabel as So } from "../dynamic-form/index.esm.js";
import { FButton as wt } from "../button/index.esm.js";
import wo from "../drawer/index.esm.js";
function kt(e, t) {
let i;
function u(d) {
const { properties: C, title: p, ignore: a } = d, c = a && Array.isArray(a), h = Object.keys(C).reduce((g, E) => ((!c || !a.find((U) => U === E)) && (g[E] = C[E].type === "object" && C[E].properties ? u(C[E]) : St(C[E].default)), g), {});
if (p && (!c || !a.find((g) => g === "id"))) {
const g = p.toLowerCase().replace(/-/g, "_");
h.id = `${g}_${Math.random().toString().slice(2, 6)}`;
}
return h;
}
function F(d) {
const { properties: C, title: p, required: a } = d;
if (a && Array.isArray(a)) {
const c = a.reduce((h, g) => (h[g] = C[g].type === "object" && C[g].properties ? u(C[g]) : St(C[g].default), h), {});
if (p && a.find((h) => h === "id")) {
const h = p.toLowerCase().replace(/-/g, "_");
c.id = `${h}_${Math.random().toString().slice(2, 6)}`;
}
return c;
}
return {
type: p
};
}
function N(d, C = {}, p) {
const a = e[d];
if (a) {
let c = F(a);
const h = t[d];
return c = h ? h({ getSchemaByType: N }, c, C, p) : c, i != null && i.appendIdentifyForNewControl && i.appendIdentifyForNewControl(c), c;
}
return null;
}
function A(d, C) {
const p = u(C);
return Object.keys(p).reduce((a, c) => (Object.prototype.hasOwnProperty.call(d, c) && (a[c] && bt(a[c]) && bt(d[c] || !d[c]) ? Object.assign(a[c], d[c] || {}) : a[c] = d[c]), a), p), p;
}
function L(d, C) {
return Object.keys(d).filter((a) => d[a] != null).reduce((a, c) => {
if (C.has(c)) {
const h = C.get(c);
if (typeof h == "string")
a[h] = d[c];
else {
const g = h(c, d[c], d);
Object.assign(a, g);
}
} else
a[c] = d[c];
return a;
}, {});
}
function z(d, C, p = /* @__PURE__ */ new Map()) {
const a = A(d, C);
return L(a, p);
}
function x(d) {
var p;
const C = d.type;
if (C) {
const a = e[C];
if (!a)
return d;
const c = A(d, a), h = ((p = d.editor) == null ? void 0 : p.type) || "";
if (h) {
const g = e[h], E = A(d.editor, g);
c.editor = E;
}
return c;
}
return d;
}
function b(d) {
i = d;
}
return { getSchemaByType: N, resolveSchemaWithDefaultValue: x, resolveSchemaToProps: z, mappingSchemaToProps: L, setDesignerContext: b };
}
const Fo = {}, xo = {}, { resolveSchemaWithDefaultValue: To } = kt(Fo, xo);
function Oo(e = {}) {
function t(x, b, d, C) {
if (typeof d == "number")
return C[x].length === d;
if (typeof d == "object") {
const p = Object.keys(d)[0], a = d[p];
if (p === "not")
return Number(C[x].length) !== Number(a);
if (p === "moreThan")
return Number(C[x].length) >= Number(a);
if (p === "lessThan")
return Number(C[x].length) <= Number(a);
}
return !1;
}
function i(x, b, d, C) {
return C[x] && C[x].propertyValue && String(C[x].propertyValue.value) === String(d);
}
const u = /* @__PURE__ */ new Map([
["length", t],
["getProperty", i]
]);
Object.keys(e).reduce((x, b) => (x.set(b, e[b]), x), u);
function F(x, b) {
const d = x;
return typeof b == "number" ? [{ target: d, operator: "length", param: null, value: Number(b) }] : typeof b == "boolean" ? [{ target: d, operator: "getProperty", param: x, value: !!b }] : typeof b == "object" ? Object.keys(b).map((C) => {
if (C === "length")
return { target: d, operator: "length", param: null, value: b[C] };
const p = C, a = b[C];
return { target: d, operator: "getProperty", param: p, value: a };
}) : [];
}
function N(x) {
return Object.keys(x).reduce((d, C) => {
const p = F(C, x[C]);
return d.push(...p), d;
}, []);
}
function A(x, b) {
if (u.has(x.operator)) {
const d = u.get(x.operator);
return d && d(x.target, x.param, x.value, b) || !1;
}
return !1;
}
function L(x, b) {
return N(x).reduce((p, a) => p && A(a, b), !0);
}
function z(x, b) {
const d = Object.keys(x), C = d.includes("allOf"), p = d.includes("anyOf"), a = C || p, g = (a ? x[a ? C ? "allOf" : "anyOf" : "allOf"] : [x]).map((U) => L(U, b));
return C ? !g.includes(!1) : g.includes(!0);
}
return { parseValueSchema: z };
}
const ko = {
convertTo: (e, t, i, u) => {
e.appearance || (e.appearance = {}), e.appearance[t] = i;
},
convertFrom: (e, t, i) => e.appearance ? e.appearance[t] : e[t]
}, Bo = {
convertFrom: (e, t, i) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
}, Eo = {
convertTo: (e, t, i, u) => {
e.editor && (e.editor[t] = i);
},
convertFrom: (e, t, i) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
}, Po = {
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: "动态表单" }
}, Do = {
convertFrom: (e, t, i) => {
var F;
const u = e.editor && e.editor[t] ? e.editor[t] : e[t];
return ((F = Po[u]) == null ? void 0 : F.name) || u;
}
}, Io = {
convertTo: (e, t, i, u) => {
e[t] = e[t];
},
convertFrom: (e, t, i) => e.editor ? i.getRealEditorType(e.editor.type) : ""
}, Mo = {
convertTo: (e, t, i, u) => {
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = i : e.formatter = {
[t]: i
});
},
convertFrom: (e, t, i) => {
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";
}
}, Go = {
convertTo: (e, t, i, u) => {
e.command ? e.command[t] = i : e.command = {
[t]: i
}, t === "enableType" && i === "default" && (e.command.enable = !0, e.command.formatter = "", e.command.commands = [
{
text: "编辑",
type: "primary",
command: "edit"
},
{
text: "删除",
type: "danger",
command: "remove"
}
]), t === "enableType" && i === "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" && i === "unable" && (e.command.enable = !1, e.command.formatter = "");
},
convertFrom: (e, t, i) => {
var u, F;
if (e.command) {
if (t === "enableType") {
if (e.command.enableType)
return e.command.enableType;
const N = (F = (u = e.command) == null ? void 0 : u.commands) == null ? void 0 : F.find((A) => A.command === "edit" && A.type === "primary");
return e.command.enable ? N ? "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 "";
}
}, No = {
convertTo: (e, t, i, u) => {
if (e.column || (e.column = {}), t === "fitMode") {
i && i !== "none" ? (e.column.fitColumns = !0, e.column.fitMode = i) : (e.column.fitColumns = !1, e.column.fitMode = "average");
return;
}
if (t === "fitColumns") {
e.column.fitColumns = i, i && !e.column.fitMode && (e.column.fitMode = "average");
return;
}
e.column[t] = i;
},
convertFrom: (e, t, i) => {
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" : "";
}
}, jo = {
convertTo: (e, t, i, u) => {
e.summary ? e.summary[t] = i : e.summary = {
[t]: i
}, t === "enable" && i && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
enable: i,
groupFields: []
});
},
convertFrom: (e, t, i) => {
var u, F;
return t === "customSummaryStyle" ? e.summary.customSummaryStyle : t === "position" ? ((u = e.summary) == null ? void 0 : u[t]) || "bottom" : t === "customRender" ? ((F = e.summary) == null ? void 0 : F[t]) || "" : e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : "";
}
}, Vo = {
convertTo: (e, t, i, u) => {
e.group ? e.group[t] = i : e.group = {
[t]: i
}, t === "enable" && i && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = {
enable: i,
groupFields: [],
showSummary: !1,
customRender: ""
});
},
convertFrom: (e, t, i) => {
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;
}
}
}, Ao = {
convertFrom: (e, t) => e.binding ? e.binding.path : "",
convertTo: (e, t, i) => {
if (i && i.length > 0) {
const u = i[0];
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = u.bindingField, e.binding.field = u.id, e.binding.fullPath = u.path, e.path = u.bindingPath;
}
}
}, zo = {
convertTo: (e, t, i, u) => {
if (e.pagination || (e.pagination = {}), t === "sizeLimits")
if (i == null)
delete e.pagination.sizeLimits;
else {
const F = [...new Set(
String(i).split(",").map((N) => N.trim()).filter((N) => N !== "").map((N) => parseInt(N, 10)).filter((N) => !Number.isNaN(N) && N > 0)
)];
F.length > 0 ? e.pagination.sizeLimits = F : delete e.pagination.sizeLimits;
}
else
e.pagination[t] = i;
},
convertFrom: (e, t, i) => {
var u;
return e.pagination ? t === "sizeLimits" ? ((u = e.pagination.sizeLimits) == null ? void 0 : u.join(",")) ?? "" : e.pagination[t] : e[t];
}
}, _o = {
convertTo: (e, t, i, u) => {
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = i;
},
convertFrom: (e, t, i) => e.rowNumber ? e.rowNumber[t] : e[t]
}, Ho = {
convertTo: (e, t, i, u) => {
e.selection || (e.selection = {}), e.selection[t] = i;
},
convertFrom: (e, t, i) => {
if (!e.selection)
return !!e[t];
const u = !!e.selection[t];
return t === "showCheckbox" && u == null && e.selection.multiSelect === !0 ? !0 : u;
}
}, Lo = {
convertFrom: (e, t, i) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
}, Wo = {
convertFrom: (e, t) => e[t] || "",
convertTo: (e, t, i) => {
e[t] = i;
}
}, Ro = {
convertTo: (e, t, i, u) => {
e.size || (e.size = {}), e.size[t] = i;
},
convertFrom: (e, t, i) => e.size ? e.size[t] : e[t]
}, $o = {
convertFrom: (e, t, i) => {
var u, F;
return (u = e.formatter) != null && u.data && t === "formatterEnumData" && !e.formatterEnumData ? (F = e.formatter) == null ? void 0 : F.data : e.formatterEnumData;
}
}, Uo = {
convertTo: (e, t, i, u) => {
e.sort || (e.sort = {}), e.sort[t] = i;
},
convertFrom: (e, t, i) => {
var u, F;
if (t === "mode")
return ((u = e.sort) == null ? void 0 : u.mode) || "client";
if (t === "multiSort")
return !!((F = e.sort) != null && F.multiSort);
}
}, Yo = {
convertTo: (e, t, i, u) => {
e.filter || (e.filter = {}), e.filter[t] = i, t === "enable" && (e.enableFilter = !1);
},
convertFrom: (e, t, i) => {
var u, F, N, A;
return t === "mode" ? ((u = e.filter) == null ? void 0 : u.mode) || "server" : t === "filterStyle" ? ((F = e.filter) == null ? void 0 : F.filterStyle) || "filter-column" : t === "enable" ? ((N = e.filter) == null ? void 0 : N.enable) !== void 0 ? !!e.filter.enable : !!e.enableFilter : ((A = e.filter) == null ? void 0 : A[t]) || void 0;
}
}, qo = {
convertTo: (e, t, i, u) => {
e.rowOption ? e.rowOption[t] = i : e.rowOption = {
[t]: i
};
},
convertFrom: (e, t, i) => {
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 "";
}
}, Xo = {
convertTo: (e, t, i, u) => {
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e[t] = i, t === "columnTemplateType" && i === "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" && i === "default" && (e.columnTemplate = ""), t === "columnTemplateType" && i === "custom" && (e.columnTemplate = ""));
},
convertFrom: (e, t, i) => t === "columnTemplate" ? e.columnTemplate : t === "columnTemplateType" ? e.columnTemplateType ? e.columnTemplateType || "default" : e.columnTemplate && !e.onClickLinkCommand ? "custom" : e.columnTemplate && e.onClickLinkCommand ? "hyperlink" : "default" : ""
}, Jo = {
convertTo: (e, t, i, u) => {
e.hierarchy || (e.hierarchy = {
cascadeOption: {}
}), e.hierarchy.cascadeOption || (e.hierarchy.cascadeOption = {}), e.hierarchy.cascadeOption[t] = i;
},
convertFrom: (e, t, i) => {
var u, F;
return !!((F = (u = e.hierarchy) == null ? void 0 : u.cascadeOption) != null && F[t]);
}
};
function Bt(e, t, i) {
const u = /* @__PURE__ */ new Map([
["/converter/appearance.converter", ko],
["/converter/buttons.converter", Bo],
["/converter/property-editor.converter", Eo],
["/converter/items-count.converter", Lo],
["/converter/type.converter", Do],
["/converter/change-editor.converter", Io],
["/converter/change-formatter.converter", Mo],
["/converter/column-command.converter", Go],
["/converter/column-option.converter", No],
["/converter/summary.converter", jo],
["/converter/group.converter", Vo],
["/converter/form-group-label.converter", Wo],
["/converter/field-selector.converter", Ao],
["/converter/pagination.converter", zo],
["/converter/row-number.converter", _o],
["/converter/grid-selection.converter", Ho],
["/converter/size.converter", Ro],
["/converter/change-formatter-enum.converter", $o],
["/converter/grid-sort.converter", Uo],
["/converter/grid-filter.converter", Yo],
["/converter/row-option.converter", qo],
["/converter/change-formatter-type.converter", Xo],
["/converter/tree-auto-check.converter", Jo]
]), F = /* @__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" }]
]), N = Oo();
function A(a, c) {
return () => N.parseValueSchema(a, c);
}
function L(a, c, h) {
return a.includes("visible") && c.visible !== void 0 ? typeof c.visible == "boolean" ? () => !!c.visible : c.visible === void 0 ? !0 : A(c.visible, h) : () => !0;
}
function z(a, c, h) {
return a.includes("readonly") && c.readonly !== void 0 ? typeof c.readonly == "boolean" ? () => !!c.readonly : A(c.readonly, h) : () => !1;
}
function x(a, c) {
const h = a.$converter || c;
return typeof h == "string" && h && u.has(h) ? u.get(h) || null : h || null;
}
function b(a, c, h, g, E, U = "", Y = "") {
return Object.keys(a).map((D) => {
const Q = de(1), X = D, P = a[D], s = Object.keys(P), se = P.title, ee = P.type, G = F.get(ee) || { type: "input-group", enableClear: !1 }, oe = P.editor ? Object.assign({}, G, P.editor) : Object.assign({}, G), te = L(s, P, c), re = z(s, P, c);
oe.readonly = oe.readonly === void 0 ? re() : oe.readonly;
const pe = P.type === "cascade" ? b(P.properties, c, h, g, E, U, Y) : [], ve = !0;
let H = x(P, Y);
const ue = ne({
get() {
if (Q.value) {
if (["class", "style"].find((J) => J === X) && !H && (H = u.get("/converter/appearance.converter") || null), H && H.convertFrom) {
const J = H.convertFrom(h, D, E, U);
return J === void 0 && Object.prototype.hasOwnProperty.call(P, "defaultValue") ? P.type === "boolean" ? P.defaultValue : P.defaultValue || "" : J;
}
const le = h[D];
return Object.prototype.hasOwnProperty.call(P, "defaultValue") && (le === void 0 || typeof le == "string" && le === "") ? P.type === "boolean" ? P.defaultValue : P.defaultValue || "" : le;
}
return null;
},
set(le) {
Q.value += 1, H && H.convertTo ? (H.convertTo(g, D, le, E, U), H.convertTo(h, D, le, E, U)) : (g[D] = le, h[D] = le);
}
}), { refreshPanelAfterChanged: ie, description: ye, isExpand: De, parentPropertyID: we } = P, K = { propertyID: X, propertyName: se, propertyType: ee, propertyValue: ue, editor: oe, visible: te, readonly: re, cascadeConfig: pe, hideCascadeTitle: ve, refreshPanelAfterChanged: ie, description: ye, isExpand: De, parentPropertyID: we };
return c[X] = K, K;
});
}
function d(a, c, h = {}) {
const g = {}, E = e[a];
return E && E.categories ? Object.keys(E.categories).map((Y) => {
const _ = E.categories[Y], D = _ == null ? void 0 : _.title, Q = b(_.properties || {}, g, {}, h, c);
return { categoryId: Y, categoryName: D, properties: Q };
}) : [];
}
function C(a, c, h, g, E = "") {
const U = c.$ref.schema, Y = c.$ref.converter, _ = h[U], D = _.type, Q = i(_), X = {}, P = e[D];
if (P && P.categories) {
const s = P.categories[a], se = s == null ? void 0 : s.title;
Y && Object.keys(s.properties).forEach((oe) => {
s.properties[oe].$converter = Y;
});
const ee = (s == null ? void 0 : s.properties) || {}, G = b(ee, X, Q, _, g, E);
return { categoryId: a, categoryName: se, properties: G };
}
return { categoryId: a, categoryName: "", properties: [] };
}
function p(a, c, h, g, E) {
const U = a.type, Y = i(a), _ = {};
let D = E || e[U];
if (!(D && Object.keys(D).length > 0) && h && h.getPropConfig && (D = h.getPropConfig(g)), D && D.categories) {
const X = [];
return Object.keys(D.categories).map((P) => {
const s = D.categories[P];
if (s.$ref) {
X.push(C(P, s, a, c, g));
return;
}
const se = s == null ? void 0 : s.title, ee = s == null ? void 0 : s.tabId, G = s == null ? void 0 : s.tabName, oe = s == null ? void 0 : s.hide, te = s == null ? void 0 : s.hideTitle, re = b(s.properties || {}, _, Y, a, c, g, s.$converter), { setPropertyRelates: pe } = s, ve = s == null ? void 0 : s.parentPropertyID;
X.push({ categoryId: P, categoryName: se, tabId: ee, tabName: G, hide: oe, properties: re, hideTitle: te, setPropertyRelates: pe, parentPropertyID: ve });
}), X;
}
return [];
}
return {
getPropertyConfigBySchema: p,
getPropertyConfigByType: d,
propertyConverterMap: u
};
}
const Qo = {}, Zo = {};
Bt(Qo, Zo, To);
const Ko = {}, er = {}, { resolveSchemaWithDefaultValue: tr } = kt(Ko, er), nr = {}, or = {};
Bt(nr, or, tr);
function rr(e, t) {
if (!e || e.length < 1)
return null;
for (const i of e) {
if (i.id === t)
return i;
if (i.children) {
const u = i.children.find((F) => F.id === t);
if (u)
return u;
}
}
return null;
}
function ir() {
function e(t, i) {
const { name: u } = i;
if (u !== "fieldsClick")
return t[`on${u.charAt(0).toUpperCase()}${u.slice(1)}`] || t[u];
const F = t.cardToolbar;
if (!F || F.length < 1)
return null;
const [N, A] = i.payloads, L = rr(F, A);
return L ? L.onClick || L.click : null;
}
return {
resolve: e
};
}
var lr = /* @__PURE__ */ ((e) => (e.AUTO = "auto", e.ALWAYS = "always", e))(lr || {});
function ar(e, t) {
return null;
}
const Fr = {
/** 是否启用分页。 */
enable: { type: Boolean, default: !1 },
/** 当前页码。 */
index: { type: Number, default: 1 },
/** 分页交互模式,可选 `client` 或 `server`。 */
mode: { type: String, default: "client" },
/** 是否显示页码输入框。 */
showGoto: { type: Boolean, default: !1 },
/** 是否显示页码。 */
showIndex: { type: Boolean, default: !0 },
/** 是否显示每页记录数选择器。 */
showLimits: { type: Boolean, default: !1 },
/** 是否显示分页汇总信息。 */
showPageInfo: { type: Boolean, default: !0 },
/** 默认每页记录数。 */
size: { type: Number, default: 20 },
/** 可选择的每页记录数集合。 */
sizeLimits: { type: Array, default: [10, 20, 30, 50, 100] },
/** 总记录数。 */
total: { type: Number, default: 0 },
/** 是否禁用分页。 */
disabled: { type: Boolean, default: !1 }
}, xr = {
/** 是否启用排序。 */
enable: { type: Boolean, default: !1 },
/** 排序字段集合。 */
fields: { type: Array, default: [] },
/** 排序交互模式,可选 `client` 或 `server`。 */
mode: { type: String, default: "client" },
/** 是否支持多列排序。 */
multiSort: { type: Boolean, default: !1 }
}, Tr = {
/** 自定义分组行内容。 */
customGroupRow: { type: Function, default: () => {
} },
/** 自定义分组行样式。 */
customGroupRowStyle: { type: Function, default: () => {
} },
/** 自定义分组合计行样式。 */
customSummaryStyle: { type: Function, default: () => {
} },
/** 是否启用数据分组。 */
enable: { type: Boolean, default: !1 },
/** 分组行合并列数。 */
groupColSpan: { type: Number, default: 1 },
/** 行数据分组字段,多字段分组以英文逗号分隔。 */
groupFields: { type: Array, default: [] },
/** 是否在 DataGrid 中显示被分组的列。 */
showGroupedColumn: { type: Boolean, default: !0 },
/** 是否显示分组面板。 */
showGroupPanel: { type: Boolean, default: !1 },
/** 是否启用合计行。 */
showSummary: { type: Boolean, default: !1 },
/** 合计行显示位置。 */
summaryPosition: { type: String, default: "separate" },
/** 自定义分组合计内容渲染函数。 */
customRender: { type: Function, default: () => {
} }
}, Or = {
/** 是否启用筛选总开关。 */
enable: { type: Boolean, default: !1 },
/** 筛选风格,可选 `filter-column` 或 `filter-row`。 */
filterStyle: { type: String, default: "filter-column" },
/** 筛选交互模式,可选 `client` 或 `server`。 */
mode: { type: String, default: "server" },
/** 是否显示过滤条件工具条。 */
showSummary: { type: Boolean, default: !0 }
}, kr = {
/** 是否允许折行显示列标题。 */
wrapHeadings: { type: Boolean, default: !1 }
}, Br = {
/** 是否显示行号。 */
enable: { type: Boolean, default: !1 },
/** 行号列表头标题。 */
heading: { type: String, default: "序号" },
/** 行号宽度,单位 px。 */
width: { type: Number, default: 36 },
/** 是否展示省略号。 */
showEllipsis: { type: Boolean, default: !0 }
}, Er = {
/** 自定义行样式函数。 */
customRowStyle: { type: Function, default: () => {
} },
/** 自定义单元格样式函数。 */
customCellStyle: { type: Function, default: () => {
} },
/** 自定义行状态函数。 */
customRowStatus: { type: Function, default: () => {
} },
/** 禁止行选中的判断函数。 */
disable: { type: Function, default: () => {
} },
/** 行高度,单位 px。 */
height: { type: Number, default: 28 },
/** 是否启用鼠标滑过行效果。 */
showHovering: { type: Boolean, default: !0 },
/** 是否允许数据折行。 */
wrapContent: { type: Boolean, default: !1 }
}, Pr = {
/** 是否启用合计行。 */
enable: { type: Boolean, default: !1 },
/** 合计行自定义样式函数。 */
customSummaryStyle: { type: Function, default: () => {
} },
/** 分组合计字段集合。 */
groupFields: { type: Array, default: [] },
/** 合计交互模式,可选 `client` 或 `server`。 */
mode: { type: String, default: "client" },
/** 合计行显示位置,可选 `bottom`、`top`、`both`。 */
position: { type: String, default: "bottom" },
/** 自定义合计行内容渲染函数。 */
customRender: { type: Function, default: () => {
} }
}, Dr = {
/** 是否自动列宽,设为 true 后所有列将填满表格,不出现横向滚动条。 */
fitColumns: { type: Boolean, default: !1 },
/** 自动适配列宽度模式。 */
fitMode: { type: String, default: "average" },
/** 表头分组集合。 */
groups: { type: Array, defaut: [] },
/** 是否允许拖动表头改变列显示顺序。 */
reorderColumn: { type: Boolean, default: !1 },
/** 是否允许拖动改变列宽度。 */
resizeColumn: { type: Boolean, default: !0 },
/** 双击表头列是否自适应内容宽度。 */
resizeColumnOnDoubleClick: { type: Boolean, default: !0 }
};
function tt(e) {
const t = e == null ? void 0 : e.fitColumns;
return t === !0 || typeof t == "object" && t !== null && "enable" in t && t.enable === !0;
}
const Ir = {
/** 启用多选且显示 checkbox,选中行后勾选前面的 checkbox。 */
checkOnSelect: { type: Boolean, default: !1 },
/** 数据源为空时是否清空已选记录。 */
clearSelectionOnEmpty: { type: Boolean, default: !0 },
/** 自定义已选记录列表中的显示内容。 */
customSelectionItem: { type: Function, default: () => {
} },
/** 是否允许选中行。 */
enabelSelectRow: { type: Boolean, default: !0 },
/** 重复点击行时是否保留选中状态。 */
keepSelectingOnClick: { type: Boolean, default: !0 },
/** 是否允许跨页多选。 */
keepSelectingOnPaging: { type: Boolean, default: !0 },
/** 是否启用多选。 */
multiSelect: { type: Boolean, default: !1 },
/** 多选时点击行仅选中当前行的模式。 */
focusSelection: { type: String, default: "current" },
/** 启用多选且显示 checkbox,勾选后是否选中行。 */
selectOnCheck: { type: Boolean, default: !1 },
/** 每行前面是否显示 checkbox。 */
showCheckbox: { type: Boolean, default: !1 },
/** 是否显示全选 checkbox。 */
showSelectAll: { type: Boolean, default: !1 },
/** 是否显示已选数据。 */
showSelection: { type: Boolean, default: !1 }
}, Mr = {
/** 编辑时是否选中文本。 */
selectOnEditing: { type: Boolean, default: !1 },
/** 编辑模式,`row` 为整行编辑,`cell` 为单元格编辑。 */
editMode: { type: String, default: "cell" }
}, Gr = {
/** 是否显示 loading。 */
show: { type: Boolean, default: !1 },
/** loading 提示文本。 */
message: { type: String, default: "加载中..." }
}, ur = {
/** 自定义表格 CSS 类名。 */
customClass: { type: String, default: "" },
/** 是否在最后一个单元格回车时新增一行。 */
appendOnEnterAtLastCell: { type: Boolean, default: !1 },
/** 编辑单元格前的回调函数。 */
beforeEditCell: {
type: Function,
default: (e) => !0
},
/** 结束编辑前的校验函数。 */
beforeEndEditCell: { type: Function, default: () => !0 },
/** 列集合。 */
columns: { type: Array, default: [] },
/** 列布局配置。 */
columnOption: { type: Object },
/** 操作列配置。 */
commandOption: {
type: Object,
default: {
enable: !1,
commands: [],
halign: "center",
columnWidth: 150
}
},
/** 表格数据源。 */
data: { type: Array, default: [] },
/** 是否禁用组件。 */
disabled: { type: Boolean, default: !1 },
/** 行数据中禁用标识的字段名。 */
disabledField: { type: String, default: "disabled" },
/** 是否允许编辑。 */
editable: { type: Boolean, default: !1 },
/** 编辑配置。 */
editOption: { type: Object, default: { selectOnEditing: !1, editMode: "cell" } },
/** 是否启用操作列。 */
enableCommands: { type: Boolean, default: !1 },
/** 是否启用表格过滤。 */
enableFilter: { type: Boolean, default: !1 },
/** 筛选配置。 */
filter: { type: Object },
/** 是否适配父组件尺寸。 */
fit: { type: Boolean, default: !1 },
/** 编辑单元格时是否默认获得焦点。 */
focusOnEditingCell: { type: Boolean, default: !0 },
/** 分组配置。 */
group: { type: Object },
/** 列标题配置。 */
header: { type: Object },
/** 表格高度,单位 px。 */
height: { type: Number, default: -1 },
/** DataGrid 组件唯一标识。 */
id: { type: String, default: "" },
/** 数据源中作为行记录标识的字段名。 */
idField: { type: String, default: "id", require: !0 },
/** 是否展示 loading 状态。 */
loading: { type: Boolean, default: !1 },
/** 是否纵向合并具有相同值的单元格。 */
mergeCell: { type: Boolean, default: !1 },
/** 纵向合并的字段集合。 */
mergeFields: { type: Object, default: [] },
/** 最小高度,单位 px。 */
minHeight: { type: Number, default: 300 },
/** 最小宽度,单位 px。 */
minWidth: { type: Number, default: 400 },
/** 新增行的工厂函数。 */
newDataItem: { type: Function, default: () => {
} },
/** 分页配置。 */
pagination: { type: Object, default: { enable: !1, size: 20 } },
/** 行号配置。 */
rowNumber: {
type: Object,
default: {
enable: !0,
width: 36,
showEllipsis: !0,
heading: "序号"
}
},
/** 行配置。 */
rowOption: { type: Object, default: { wrapContent: !1 } },
/** 选择配置。 */
selection: {
type: Object,
default: {
enableSelectRow: !0,
multiSelect: !1,
multiSelectMode: "DependOnCheck",
showCheckbox: !1,
showSelectAll: !1,
showSelection: !1,
keepSelectingOnClick: !0
}
},
/** 已选数据标识列表。 */
selectionValues: { type: Array, default: [] },
/** 编辑单元格时是否默认选中文本。 */
selectOnEditingCell: { type: Boolean, default: !1 },
/** 是否显示边框。 */
showBorder: { type: Boolean, default: !1 },
/** 是否显示底部面板。 */
showFooter: { type: Boolean, default: !1 },
/** 是否显示顶部面板。 */
showHeader: { type: Boolean, default: !0 },
/** 是否显示横向行分割线。 */
showHorizontalLines: { type: Boolean, default: !0 },
/** 是否显示滚动条,可选 `auto`、`always`、`never`。 */
showScrollBar: { type: String, default: "auto" },
/** 是否显示列设置按钮。 */
showSetting: { type: Boolean, default: !1 },
/** 是否显示条纹(斑马线样式)。 */
showStripe: { type: Boolean, default: !0 },
/** 是否显示纵向列分割线。 */
showVerticallLines: { type: Boolean, default: !1 },
/** 排序配置。 */
sort: { type: Object },
/** 合计配置。 */
summary: {
type: Object,
default: {
enable: !1,
groupFields: ["numericField1", "numericField2"]
}
},
/** 是否启用虚拟渲染。 */
virtualized: { type: Boolean, default: !0 },
/** 表格宽度,单位 px。 */
width: { type: Number, default: -1 },
/** 空数据模板渲染函数。 */
emptyTemplate: { type: Object },
/** 数据更新前的回调函数。 */
beforeUpdate: { type: Function },
/** 绑定动态字段的解析器。 */
fieldsResolver: { type: Function, default: ar },
/** 绑定动态字段的值回调函数。 */
fieldsCallback: { type: Function, default: () => {
} },
/** 展示模式,可选 `List` 或 `Card`。 */
displayType: { type: String, default: "List" },
/** 卡片模式下是否显示表头。 */
showCardHeader: { type: Boolean, default: !0 },
/** 卡片模式下是否显示底部模板。 */
showCardFooter: { type: Boolean, default: !0 },
/** 卡片模式下自定义表头内容渲染函数。 */
cardHeaderTemplate: {
type: Function,
default: () => null
},
/** 卡片模式下自定义底部内容渲染函数。 */
cardFooterTemplate: {
type: Function,
default: () => null
},
/** 卡片模式下自定义头部标题渲染函数。 */
cardTitleTemplate: {
type: Function,
default: () => null
},
/** 卡片模式下自定义工具栏渲染函数或数组。 */
cardToolbar: {
type: [Array, Function],
default: () => []
},
/** 卡片模式下主标题。 */
cardMainTitle: {
type: String,
default: ""
},
/** 表单标识。 */
formId: {
type: String,
default: ""
},
/** 是否可见。 */
visible: {
type: Boolean,
default: !0
},
/** 是否启用列设置方案。 */
enableColumnSettingSolution: { type: Boolean, default: !1 }
}, Nr = ir();
function dr() {
const e = /* @__PURE__ */ new Map([
["boolean", "check-box"],
["datetime", "date-picker"],
["enum", "combo-list"],
["number", "number-spinner"],
["string", "input-group"],
["text", "text"]
]);
function t(i) {
if (!i.editor) {
const u = i.dataType, F = { type: e.get(u) || "input-group", readonly: !0 };
return {
...i,
type: "form-group",
label: i.title,
editor: F
};
}
return {
...i,
type: "form-group",
label: i.title
};
}
return { transformColumnToField: t };
}
function sr(e, t, i, u, F, N, A, L, z, x, b, d, C, p, a, c, h) {
const {
isNull: g,
isUndefined: E
} = Ft(), {
totalItems: U,
rawView: Y
} = c, {
calculateCellPositionInRow: _,
cellKey: D,
cellPosition: Q,
rowKey: X,
rowPosition: P,
rowSpanCellPosition: s,
groupCellPosition: se,
summaryCellPosition: ee
} = A, {
cellContentClass: G,
cellContentPosition: oe,
cellContentClassWithEllipsis: te
} = N, {
collpaseGroupIconClass: re
} = x, {
gridCellClass: pe,
gridRowClass: ve,
onClickRow: H,
onMouseoverRow: ue,
onMouseoutRow: ie
} = d, {
onClickCell: ye,
showRowEditPanel: De
} = z, {
toggleGroupRow: we
} = C, {
columnContext: K,
hasLeftFixedColumn: le,
hasRightFixedColumn: J
} = L, {
navigateOnKeyUp: ge,
navigateOnKeyDown: We
} = b, Ce = (o) => (o || []).some((S) => dt(S) ? !(S.type === xt || S.type === ot && !Ce(S.children)) : !0) ? o : null, Ie = (o) => {
var S, n, l;
return ((n = (S = o.column) == null ? void 0 : S.editor) == null ? void 0 : n.type) === "switch" || ((l = o.column) == null ? void 0 : l.dataType) === "boolean" ? {
display: "flex",
flexGrow: "1",
minWidth: 0,
overflow: "hidden"
} : {
flexGrow: "1",
minWidth: 0
};
}, he = nt({
"fv-grid-content-left-fixed": !0
}), ae = nt({
"fv-grid-content-right-fixed": !0
});
Le([U, Y], (o) => {
!o[0] && !o[1].length ? (he["fv-grid-content-left-fixed"] = !1, ae["fv-grid-content-right-fixed"] = !1) : (he["fv-grid-content-left-fixed"] = !0, ae["fv-grid-content-right-fixed"] = !0);
});
const {
gridDataStyle: R,
gridMergedDataStyle: Me,
leftFixedGridDataStyle: Fe,
leftFixedGridMergedDataStyle: Ge,
rightFixedGridDataStyle: Qe,
rightFixedGridMergedDataStyle: Ze
} = p;
function Te(o, S) {
o.stopPropagation(), S.collapse = !S.collapse, a.value = we(S.collapse ? "collapse" : "expand", S, a.value);
}
function Re(o, S, n) {
var v, m;
const l = [];
if (o.groupField) {
const I = S[o.groupField], T = o.data[o.groupField];
if (n === "primary")
for (let w = 0; w <= o.layer; w++)
l.push(f("div", {
class: "fv-grid-group-row-icon",
style: {
position: "relative",
zIndex: 10
},
onClick: ($) => Te($, o)
}, [f("span", {
class: re(o)
}, null)]));
n === "primary" && ((v = e.group) != null && v.customRender) ? l.push(f("div", {
ref: T == null ? void 0 : T.setRef,
key: D(o, o.layer + 1),
style: {
flex: "1",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
paddingLeft: "4px"
}
}, [e.group.customRender(o)])) : (m = e.group) != null && m.customRender || (n === "primary" && T && l.push(f("div", {
ref: T.setRef,
key: D(o, o.layer + 1),
style: {
flex: "1",
minWidth: 0,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
lineHeight: "26px",
padding: "0 0.75rem"
},
title: T.data
}, [T.data])), Object.values(o.data).filter((w) => w.field !== o.groupField && S[w.field] && w.colSpan !== 0 && w.field !== Tn && w.field !== On).forEach((w) => {
var Z;
const $ = Q(o, w, S);
if (!I) {
const O = (o.layer + 1) * (((Z = T == null ? void 0 : T.parent) == null ? void 0 : Z.height) || 0);
$.left = `${Number($.left.replace("px", "")) + O}px`;
}
l.push(f("div", {
ref: w.setRef,
key: D(o, w.index),
class: "fv-grid-cell",
style: $
}, [w.data]));
}));
}
return l;
}
function Ne(o, S, n, l) {
return o.layer > -1 && f("div", {
ref: o.setRef,
key: X(o),
class: {
...ve(o, n),
"d-flex": !0,
"align-items-center": !0
},
style: P(o),
onClick: (v) => H(v, o),
onMouseover: (v) => ue(v, o)
}, [Re(o, S, l)]);
}
function je(o, S) {
const n = [];
if (o.groupField && S[o.groupField]) {
const l = o.data[o.groupField];
n.push(f("div", {
ref: l.setRef,
key: D(o, o.layer + 1),
class: "fv-grid-cell",
style: ee(l, S, o.layer)
}, [l.data]));
}
return n;
}
function Oe(o, S, n, l) {
return o.layer > -1 && f("div", {
ref: o.setRef,
key: X(o),
class: ve(o, n),
style: P(o),
onClick: (v) => H(v, o),
onMouseover: (v) => ue(v, o)
}, [je(o, S)]);
}
function $e(o, S) {
var n, l, v;
return o.showTips && typeof ((n = o.column) == null ? void 0 : n.formatter) != "function" && ((l = o.column) == null ? void 0 : l.dataType) !== "commands" && ((v = o.column) == null ? void 0 : v.dataType) !== "setting" ? f("div", {
class: te(o),
title: o.formatter(o, S)
}, [o.formatter(o, S)]) : f("div", {
class: te(o)
}, [o.formatter(o, S)]);
}
function Ue() {
return f("div", null, [Je("******")]);
}
function j(o) {
var l, v;
const S = !g(o.data) && !E(o.data) ? o.data.toString() : o.data;
return ((v = (l = o.column) == null ? void 0 : l.editor) == null ? void 0 : v.showType) === "password" ? Ue() : o.showTips ? f("div", {
class: te(o),
title: S
}, [S]) : f("div", {
class: te(o)
}, [S]);
}
function Ye(o, S) {
return o.mode === Ot.editing ? f("div", {
style: Ie(o)
}, [o.getEditor(o)]) : o.column.columnTemplate ? o.column.columnTemplate(o, S) : o.formatter ? $e(o, S) : j(o);
}
function Ve(o, S, n, l, v) {
return f("div", {
ref: o.setRef,
key: X(o),
class: ve(o, n),
style: l,
onClick: (m) => H(m, o),
onMouseover: (m) => ue(m, o),
onMouseout: (m) => ie(m, o)
}, [Object.values(o.data).filter((m) => S[m.field] && m.rowSpan === 1).map((m) => {
var T, w;
const I = t.slots.cellTemplate && Ce(t.slots.cellTemplate({
cell: m,
row: o
}));
return f("div", {
ref: m.setRef,
key: D(o, m.index),
class: pe(m, o),
style: Q(o, m, S),
onClick: ($) => {
ye($, m, o, m.column);
},
onKeydown: ($) => ge($, m)
}, [f("div", {
class: G(m),
style: oe(m)
}, [I ? (w = (T = t.slots).cellTemplate) == null ? void 0 : w.call(T, {
cell: m,
row: o
}) : Ye(m, o)])]);
})]);
}
function ke(o, S, n, l) {
return Ve(o, S, n, P(o));
}
const xe = [ke, Ne, Oe];
function ce(o, S) {
const n = _(o);
return a.value.map((l, v) => xe[l.type](l, n, v, S));
}
function Be(o) {
const S = _(o);
return a.value.map((n) => Object.values(n.data).filter((l) => S[l.field] && l.rowSpan > 1).map((l) => f("div", {
key: D(n, l.index),
class: "fv-grid-cell fv-grid-merged-cell",
style: s(n, l, S)
}, [l.data])));
}
function Ee() {
return f("div", {
ref: u,
class: he
}, [f("div", {
class: "fv-grid-data",
style: Fe.value
}, [ce(K.value.leftColumns.filter((o) => o.visible), "left")]), f("div", {
class: "fv-grid-merge-date",
style: Ge.value
}, [Be(K.value.leftColumns.filter((o) => o.visible))])]);
}
function Pe() {
return f("div", {
ref: i,
class: "fv-grid-content-primary"
}, [f("div", {
class: "fv-grid-data",
style: R.value
}, [ce(K.value.primaryColumns.filter((o) => o.visible), "primary")]), f("div", {
class: "fv-grid-merge-date",
style: Me.value
}, [Be(K.value.primaryColumns.filter((o) => o.visible))])]);
}
function Ae() {
return f("div", {
ref: F,
class: ae
}, [f("div", {
class: "fv-grid-data",
style: Qe.value
}, [ce(K.value.rightColumns.filter((o) => o.visible), "right")]), f("div", {
class: "fv-grid-merge-date",
style: Ze.value
}, [Be(K.value.rightColumns.filter((o) => o.visible))])]);
}
function qe() {
const o = [];
return le.value && o.push(Ee()), o.push(Pe()), J.value && o.push(Ae()), o;
}
return {
renderDataArea: qe
};
}
const cr = /* @__PURE__ */ Tt({
name: "FDataGridRowForm",
props: {
columns: {
type: Array,
required: !0
},
/** 绑定动态字段 */
fields: {
type: Array,
required: !0
},
data: {
type: Object,
default: null
},
/** 绑定动态字段的值*/
formData: {
type: Object,
default: null
},
/** 绑定动态字段的解析器 */
fieldsCallback: {
type: Function,
default: () => {
}
},
/** 是否显示表头 */
showHeader: {
type: Boolean,
default: !0
},
/** 是否显示底部模板 */
showFooter: {
type: Boolean,
default: !0
},
/** 自定义工具栏渲染函数 */
toolbar: {
type: [Array, Function],
default: () => []
},
/** 主标题 */
mainTitle: {
type: String,
default: ""
},
/** 自定义表头标题渲染函数 */
headerTitleRenderFunction: {
type: Function
},
/** 自定义表头内容渲染函数 */
headerContentRenderFunction: {
type: Function
},
/** 自定义底部模板渲染函数 */
footerRenderFunction: {
type: Function
}
},
emits: ["fieldsValueChange", "fieldsEvent", "click"],
setup(e, {
emit: t
}) {
return () => f(bo, {
fields: e.fields,
formData: e.formData,
showHeader: e.showHeader,
showFooter: e.showFooter,
mainTitle: e.mainTitle,
toolbar: e.toolbar,
mode: "full",
headerTitleRenderFunction: e.headerTitleRenderFunction,
headerContentRenderFunction: e.headerContentRenderFunction,
footerRenderFunction: e.footerRenderFunction,
callback: (...i) => e.fieldsCallback(...i),
"onUpdate:modelValue": (i) => {
t("fieldsValueChange", i, e.data);
},
onEvent: (i) => {
t("fieldsEvent", i);
},
onClick: (...i) => {
t("click", ...i);
}
}, null);
}
});
function fr(e, t, i, u, F, N, A, L, z, x, b, d, C, p, a, c, h) {
const {
transformColumnToField: g
} = dr(), {
isNull: E,
isUndefined: U
} = Ft(), {
totalItems: Y,
rawView: _
} = c, {
calculateCellPositionInRow: D,
cellKey: Q,
cellPosition: X,
rowKey: P,
rowPosition: s,
rowSpanCellPosition: se,
groupCellPosition: ee,
summaryCellPosition: G
} = A, {
cellContentClass: oe,
cellContentPosition: te,
cellContentClassWithEllipsis: re
} = N, {
collpaseGroupIconClass: pe
} = x, {
gridCellClass: ve,
gridRowClass: H,
onClickRow: ue,
onMouseoverRow: ie,
onMouseoutRow: ye
} = d, {
onClickCell: De
} = z, {
toggleGroupRow: we
} = C, {
columnContext: K,
hasLeftFixedColumn: le,
hasRightFixedColumn: J
} = L, ge = ne(() => {
var l;
if (e.displayType !== "Card" || (((l = e.columns) == null ? void 0 : l.length) ?? 0) === 0 || e.fit && tt(e.columnOption))
return;
const n = K.value.primaryColumnsWidth || 0;
return n > 0 ? `${n}px` : void 0;
}), {
navigateOnKeyUp: We,
navigateOnKeyDown: Ce
} = b, Ie = (n) => (n || []).some((l) => dt(l) ? !(l.type === xt || l.type === ot && !Ie(l.children)) : !0) ? n : null, he = (n) => {
var l, v, m;
return ((v = (l = n.column) == null ? void 0 : l.editor) == null ? void 0 : v.type) === "switch" || ((m = n.column) == null ? void 0 : m.dataType) === "boolean" ? {
display: "flex",
flexGrow: "1",
minWidth: 0,
overflow: "hidden"
} : {
flexGrow: "1",
minWidth: 0
};
}, ae = nt({
"fv-grid-content-left-fixed": !0
}), R = nt({
"fv-grid-content-right-fixed": !0
});
Le([Y, _], (n) => {
!n[0] && !n[1].length ? (ae["fv-grid-content-left-fixed"] = !1, R["fv-grid-content-right-fixed"] = !1) : (ae["fv-grid-content-left-fixed"] = !0, R["fv-grid-content-right-fixed"] = !0);
});
const {
gridDataStyle: Me,
gridMergedDataStyle: Fe,
leftFixedGridDataStyle: Ge,
leftFixedGridMergedDataSt