@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,496 lines • 79 kB
JavaScript
import { useCommonUtils as Ft, resolveField as vn, getCustomClass as gn, withInstall as pn } from "../common/index.esm.js";
import { ref as de, computed as ne, reactive as nt, watch as De, createVNode as f, isVNode as dt, Comment as Tt, Fragment as ot, createTextVNode as Xe, defineComponent as xt, onMounted as yn, nextTick as Cn, onUnmounted as hn, provide as bn, getCurrentInstance as Sn } from "vue";
import { useResizeObserver as wn } from "@vueuse/core";
import { isPlainObject as bt, cloneDeep as St } from "lodash-es";
import { SETTING_COLUMN_FIELD as Fn, COMMAND_COLUMN_FIELD as Tn, CellMode as Ot, SETTING_COLUMN_DATA_TYPE as We, COMMAND_COLUMN_DATA_TYPE as Le, useScreen as xn, useIdentify as On, useGroupData as kn, useFilter as Bn, useHierarchy as En, useLoading as Pn, useDataView as Dn, usePagination as In, useSelection as Gn, useDataViewContainerStyle as Mn, useCommandColumn as Vn, useSettingColumn as jn, useColumn as Nn, useSort as An, useGroupColumn as _n, useRow as zn, useEdit as Hn, useVisualDataBound as Wn, useVisualDataCell as Ln, useVisualDataRow as Rn, useVisualGroupRow as $n, useVisualSummaryRow as Un, useVisualData as Yn, useCellContentStyle as qn, useCellPosition as Xn, useSidebar as Jn, useVirtualScroll as Qn, useFitColumn as Zn, useFilterHistory as Kn, useColumnFilter as eo, useDragColumn as to, getColumnHeader as no, getPagination as oo, getSidebar as ro, getDisableMask as io, getSummary as lo, getHorizontalScrollbar as ao, getVerticalScrollbar as uo, getFilterPanel as so, getGroupPanel as co, useAdapt as fo, useNavigation as mo, getEmpty as vo, ColumnSettingSolution as go } from "../data-view/index.esm.js";
import po, { FDynamicForm as yo, FDynamicFormLabel as Co } from "../dynamic-form/index.esm.js";
import { FButton as wt } from "../button/index.esm.js";
import ho from "../drawer/index.esm.js";
function kt(e, t) {
let i;
function a(d) {
const { properties: C, title: p, ignore: u } = d, c = u && Array.isArray(u), h = Object.keys(C).reduce((v, E) => ((!c || !u.find((U) => U === E)) && (v[E] = C[E].type === "object" && C[E].properties ? a(C[E]) : St(C[E].default)), v), {});
if (p && (!c || !u.find((v) => v === "id"))) {
const v = p.toLowerCase().replace(/-/g, "_");
h.id = `${v}_${Math.random().toString().slice(2, 6)}`;
}
return h;
}
function O(d) {
const { properties: C, title: p, required: u } = d;
if (u && Array.isArray(u)) {
const c = u.reduce((h, v) => (h[v] = C[v].type === "object" && C[v].properties ? a(C[v]) : St(C[v].default), h), {});
if (p && u.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 L(d, C = {}, p) {
const u = e[d];
if (u) {
let c = O(u);
const h = t[d];
return c = h ? h({ getSchemaByType: L }, c, C, p) : c, i != null && i.appendIdentifyForNewControl && i.appendIdentifyForNewControl(c), c;
}
return null;
}
function V(d, C) {
const p = a(C);
return Object.keys(p).reduce((u, c) => (Object.prototype.hasOwnProperty.call(d, c) && (u[c] && bt(u[c]) && bt(d[c] || !d[c]) ? Object.assign(u[c], d[c] || {}) : u[c] = d[c]), u), p), p;
}
function H(d, C) {
return Object.keys(d).filter((u) => d[u] != null).reduce((u, c) => {
if (C.has(c)) {
const h = C.get(c);
if (typeof h == "string")
u[h] = d[c];
else {
const v = h(c, d[c], d);
Object.assign(u, v);
}
} else
u[c] = d[c];
return u;
}, {});
}
function A(d, C, p = /* @__PURE__ */ new Map()) {
const u = V(d, C);
return H(u, p);
}
function F(d) {
var p;
const C = d.type;
if (C) {
const u = e[C];
if (!u)
return d;
const c = V(d, u), h = ((p = d.editor) == null ? void 0 : p.type) || "";
if (h) {
const v = e[h], E = V(d.editor, v);
c.editor = E;
}
return c;
}
return d;
}
function b(d) {
i = d;
}
return { getSchemaByType: L, resolveSchemaWithDefaultValue: F, resolveSchemaToProps: A, mappingSchemaToProps: H, setDesignerContext: b };
}
const bo = {}, So = {}, { resolveSchemaWithDefaultValue: wo } = kt(bo, So);
function Fo(e = {}) {
function t(F, b, d, C) {
if (typeof d == "number")
return C[F].length === d;
if (typeof d == "object") {
const p = Object.keys(d)[0], u = d[p];
if (p === "not")
return Number(C[F].length) !== Number(u);
if (p === "moreThan")
return Number(C[F].length) >= Number(u);
if (p === "lessThan")
return Number(C[F].length) <= Number(u);
}
return !1;
}
function i(F, b, d, C) {
return C[F] && C[F].propertyValue && String(C[F].propertyValue.value) === String(d);
}
const a = /* @__PURE__ */ new Map([
["length", t],
["getProperty", i]
]);
Object.keys(e).reduce((F, b) => (F.set(b, e[b]), F), a);
function O(F, b) {
const d = F;
return typeof b == "number" ? [{ target: d, operator: "length", param: null, value: Number(b) }] : typeof b == "boolean" ? [{ target: d, operator: "getProperty", param: F, 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, u = b[C];
return { target: d, operator: "getProperty", param: p, value: u };
}) : [];
}
function L(F) {
return Object.keys(F).reduce((d, C) => {
const p = O(C, F[C]);
return d.push(...p), d;
}, []);
}
function V(F, b) {
if (a.has(F.operator)) {
const d = a.get(F.operator);
return d && d(F.target, F.param, F.value, b) || !1;
}
return !1;
}
function H(F, b) {
return L(F).reduce((p, u) => p && V(u, b), !0);
}
function A(F, b) {
const d = Object.keys(F), C = d.includes("allOf"), p = d.includes("anyOf"), u = C || p, v = (u ? F[u ? C ? "allOf" : "anyOf" : "allOf"] : [F]).map((U) => H(U, b));
return C ? !v.includes(!1) : v.includes(!0);
}
return { parseValueSchema: A };
}
const To = {
convertTo: (e, t, i, a) => {
e.appearance || (e.appearance = {}), e.appearance[t] = i;
},
convertFrom: (e, t, i) => e.appearance ? e.appearance[t] : e[t]
}, xo = {
convertFrom: (e, t, i) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
}, Oo = {
convertTo: (e, t, i, a) => {
e.editor && (e.editor[t] = i);
},
convertFrom: (e, t, i) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
}, ko = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
"input-group": { type: "input-group", name: "文本" },
textarea: { type: "textarea", name: "多行文本" },
lookup: { type: "lookup", name: "帮助" },
"number-spinner": { type: "number-spinner", name: "数值" },
"date-picker": { type: "date-picker", name: "日期" },
switch: { type: "switch", name: "开关" },
"radio-group": { type: "radio-group", name: "单选组" },
"check-box": { type: "check-box", name: "复选框" },
"check-group": { type: "check-group", name: "复选框组" },
"combo-list": { type: "combo-list", name: "下拉列表" },
"response-form": { type: "response-form", name: "卡片面板" },
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
"tree-grid": { type: "tree-grid", name: "树表格" },
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
"data-grid": { type: "data-grid", name: "表格" },
"data-grid-column": { type: "data-grid-column", name: "表格列" },
module: { type: "Module", name: "模块" },
component: { type: "component", name: "组件" },
tabs: { type: "tabs", name: "标签页" },
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
"drawer-toolbar-item": { type: "drawer-toolbar-item", name: "抽屉工具栏按钮" },
"html-template": { type: "html-template", name: "模板容器" },
"time-picker": { type: "time-picker", name: "时间选择" },
section: { type: "section", name: "分组面板" },
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
splitter: { type: "splitter", name: "分栏面板" },
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
"component-ref": { type: "component-ref", name: "组件引用节点" },
uploader: { type: "uploader", name: "附件上传" },
"page-header": { type: "page-header", name: "页头" },
"page-footer": { type: "page-footer", name: "页脚" },
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
"drawer-toolbar": { type: "drawer-toolbar", name: "抽屉工具栏" },
fieldset: { type: "fieldset", name: "分组" },
"query-solution": { type: "query-solution", name: "筛选方案" },
drawer: { type: "drawer", name: "抽屉" },
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
"list-nav": { type: "list-nav", name: "列表导航" },
nav: { type: "nav", name: "标签类导航" },
"list-view": { type: "list-view", name: "列表" },
"filter-bar": { type: "filter-bar", name: "筛选条" },
"language-textbox": { type: "language-textbox", name: "多语输入框" },
image: { type: "image", name: "图像" },
avatar: { type: "avatar", name: "头像" },
"discussion-editor": { type: "discussion-editor", name: "评论编辑区" },
"discussion-list": { type: "discussion-list", name: "评论列表" },
comment: { type: "comment", name: "评论区" },
"approval-logs": { type: "approval-logs", name: "审批记录" },
"rich-text-editor": { type: "rich-text-editor", name: "富文本", icon: "rich-text-box" },
calendar: { type: "calendar", name: "日历", icon: "date-picker" },
wizard: { type: "wizard", name: "向导", icon: "wizard" },
"wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" },
"wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" },
step: { type: "step", name: "步骤条", icon: "step" },
"dynamic-form": { type: "dynamic-form", name: "动态表单" }
}, Bo = {
convertFrom: (e, t, i) => {
var O;
const a = e.editor && e.editor[t] ? e.editor[t] : e[t];
return ((O = ko[a]) == null ? void 0 : O.name) || a;
}
}, Eo = {
convertTo: (e, t, i, a) => {
e[t] = e[t];
},
convertFrom: (e, t, i) => e.editor ? i.getRealEditorType(e.editor.type) : ""
}, Po = {
convertTo: (e, t, i, a) => {
(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";
}
}, Do = {
convertTo: (e, t, i, a) => {
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 a, O;
if (e.command) {
if (t === "enableType") {
if (e.command.enableType)
return e.command.enableType;
const L = (O = (a = e.command) == null ? void 0 : a.commands) == null ? void 0 : O.find((V) => V.command === "edit" && V.type === "primary");
return e.command.enable ? L ? "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 "";
}
}, Io = {
convertTo: (e, t, i, a) => {
e.column ? e.column[t] = i : e.column = {
[t]: i
}, t === "fitColumns" && i && (e.column.fitMode || (e.column.fitMode = "average"));
},
convertFrom: (e, t, i) => {
if (e.column) {
if (t === "fitColumns")
return e.column.fitColumns;
if (t === "fitMode")
return e.column.fitMode;
}
return "";
}
}, Go = {
convertTo: (e, t, i, a) => {
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 a, O;
return t === "customSummaryStyle" ? e.summary.customSummaryStyle : t === "position" ? ((a = e.summary) == null ? void 0 : a[t]) || "bottom" : t === "customRender" ? ((O = e.summary) == null ? void 0 : O[t]) || "" : e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : "";
}
}, Mo = {
convertTo: (e, t, i, a) => {
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;
}
}
}, Vo = {
convertFrom: (e, t) => e.binding ? e.binding.path : "",
convertTo: (e, t, i) => {
if (i && i.length > 0) {
const a = i[0];
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = a.bindingField, e.binding.field = a.id, e.binding.fullPath = a.path, e.path = a.bindingPath;
}
}
}, jo = {
convertTo: (e, t, i, a) => {
e.pagination || (e.pagination = {}), t === "sizeLimits" ? e.pagination.sizeLimits = i.split(",") : e.pagination[t] = i;
},
convertFrom: (e, t, i) => {
var a;
return e.pagination ? t === "sizeLimits" ? (a = e.pagination.sizeLimits) == null ? void 0 : a.join(",") : e.pagination[t] : e[t];
}
}, No = {
convertTo: (e, t, i, a) => {
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = i;
},
convertFrom: (e, t, i) => e.rowNumber ? e.rowNumber[t] : e[t]
}, Ao = {
convertTo: (e, t, i, a) => {
e.selection || (e.selection = {}), e.selection[t] = i;
},
convertFrom: (e, t, i) => {
if (!e.selection)
return !!e[t];
const a = !!e.selection[t];
return t === "showCheckbox" && a == null && e.selection.multiSelect === !0 ? !0 : a;
}
}, _o = {
convertFrom: (e, t, i) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
}, zo = {
convertFrom: (e, t) => e[t] || "",
convertTo: (e, t, i) => {
e[t] = i;
}
}, Ho = {
convertTo: (e, t, i, a) => {
e.size || (e.size = {}), e.size[t] = i;
},
convertFrom: (e, t, i) => e.size ? e.size[t] : e[t]
}, Wo = {
convertFrom: (e, t, i) => {
var a, O;
return (a = e.formatter) != null && a.data && t === "formatterEnumData" && !e.formatterEnumData ? (O = e.formatter) == null ? void 0 : O.data : e.formatterEnumData;
}
}, Lo = {
convertTo: (e, t, i, a) => {
e.sort || (e.sort = {}), e.sort[t] = i;
},
convertFrom: (e, t, i) => {
var a, O;
if (t === "mode")
return ((a = e.sort) == null ? void 0 : a.mode) || "client";
if (t === "multiSort")
return !!((O = e.sort) != null && O.multiSort);
}
}, Ro = {
convertTo: (e, t, i, a) => {
e.filter || (e.filter = {}), e.filter[t] = i, t === "enable" && (e.enableFilter = !1);
},
convertFrom: (e, t, i) => {
var a, O, L, V;
return t === "mode" ? ((a = e.filter) == null ? void 0 : a.mode) || "server" : t === "filterStyle" ? ((O = e.filter) == null ? void 0 : O.filterStyle) || "filter-column" : t === "enable" ? ((L = e.filter) == null ? void 0 : L.enable) !== void 0 ? !!e.filter.enable : !!e.enableFilter : ((V = e.filter) == null ? void 0 : V[t]) || void 0;
}
}, $o = {
convertTo: (e, t, i, a) => {
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 "";
}
}, Uo = {
convertTo: (e, t, i, a) => {
(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" : ""
}, Yo = {
convertTo: (e, t, i, a) => {
e.hierarchy || (e.hierarchy = {
cascadeOption: {}
}), e.hierarchy.cascadeOption || (e.hierarchy.cascadeOption = {}), e.hierarchy.cascadeOption[t] = i;
},
convertFrom: (e, t, i) => {
var a, O;
return !!((O = (a = e.hierarchy) == null ? void 0 : a.cascadeOption) != null && O[t]);
}
};
function Bt(e, t, i) {
const a = /* @__PURE__ */ new Map([
["/converter/appearance.converter", To],
["/converter/buttons.converter", xo],
["/converter/property-editor.converter", Oo],
["/converter/items-count.converter", _o],
["/converter/type.converter", Bo],
["/converter/change-editor.converter", Eo],
["/converter/change-formatter.converter", Po],
["/converter/column-command.converter", Do],
["/converter/column-option.converter", Io],
["/converter/summary.converter", Go],
["/converter/group.converter", Mo],
["/converter/form-group-label.converter", zo],
["/converter/field-selector.converter", Vo],
["/converter/pagination.converter", jo],
["/converter/row-number.converter", No],
["/converter/grid-selection.converter", Ao],
["/converter/size.converter", Ho],
["/converter/change-formatter-enum.converter", Wo],
["/converter/grid-sort.converter", Lo],
["/converter/grid-filter.converter", Ro],
["/converter/row-option.converter", $o],
["/converter/change-formatter-type.converter", Uo],
["/converter/tree-auto-check.converter", Yo]
]), O = /* @__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" }]
]), L = Fo();
function V(u, c) {
return () => L.parseValueSchema(u, c);
}
function H(u, c, h) {
return u.includes("visible") && c.visible !== void 0 ? typeof c.visible == "boolean" ? () => !!c.visible : c.visible === void 0 ? !0 : V(c.visible, h) : () => !0;
}
function A(u, c, h) {
return u.includes("readonly") && c.readonly !== void 0 ? typeof c.readonly == "boolean" ? () => !!c.readonly : V(c.readonly, h) : () => !1;
}
function F(u, c) {
const h = u.$converter || c;
return typeof h == "string" && h && a.has(h) ? a.get(h) || null : h || null;
}
function b(u, c, h, v, E, U = "", Y = "") {
return Object.keys(u).map((D) => {
const Q = de(1), X = D, P = u[D], s = Object.keys(P), se = P.title, ee = P.type, G = O.get(ee) || { type: "input-group", enableClear: !1 }, oe = P.editor ? Object.assign({}, G, P.editor) : Object.assign({}, G), te = H(s, P, c), re = A(s, P, c);
oe.readonly = oe.readonly === void 0 ? re() : oe.readonly;
const ye = P.type === "cascade" ? b(P.properties, c, h, v, E, U, Y) : [], ve = !0;
let _ = F(P, Y);
const ue = ne({
get() {
if (Q.value) {
if (["class", "style"].find((J) => J === X) && !_ && (_ = a.get("/converter/appearance.converter") || null), _ && _.convertFrom) {
const J = _.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, _ && _.convertTo ? (_.convertTo(v, D, le, E, U), _.convertTo(h, D, le, E, U)) : (v[D] = le, h[D] = le);
}
}), { refreshPanelAfterChanged: ie, description: pe, isExpand: Ie, parentPropertyID: we } = P, K = { propertyID: X, propertyName: se, propertyType: ee, propertyValue: ue, editor: oe, visible: te, readonly: re, cascadeConfig: ye, hideCascadeTitle: ve, refreshPanelAfterChanged: ie, description: pe, isExpand: Ie, parentPropertyID: we };
return c[X] = K, K;
});
}
function d(u, c, h = {}) {
const v = {}, E = e[u];
return E && E.categories ? Object.keys(E.categories).map((Y) => {
const z = E.categories[Y], D = z == null ? void 0 : z.title, Q = b(z.properties || {}, v, {}, h, c);
return { categoryId: Y, categoryName: D, properties: Q };
}) : [];
}
function C(u, c, h, v, E = "") {
const U = c.$ref.schema, Y = c.$ref.converter, z = h[U], D = z.type, Q = i(z), X = {}, P = e[D];
if (P && P.categories) {
const s = P.categories[u], 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, z, v, E);
return { categoryId: u, categoryName: se, properties: G };
}
return { categoryId: u, categoryName: "", properties: [] };
}
function p(u, c, h, v, E) {
const U = u.type, Y = i(u), z = {};
let D = E || e[U];
if (!(D && Object.keys(D).length > 0) && h && h.getPropConfig && (D = h.getPropConfig(v)), 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, u, c, v));
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 || {}, z, Y, u, c, v, s.$converter), { setPropertyRelates: ye } = 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: ye, parentPropertyID: ve });
}), X;
}
return [];
}
return {
getPropertyConfigBySchema: p,
getPropertyConfigByType: d,
propertyConverterMap: a
};
}
const qo = {}, Xo = {};
Bt(qo, Xo, wo);
const Jo = {}, Qo = {}, { resolveSchemaWithDefaultValue: Zo } = kt(Jo, Qo), Ko = {}, er = {};
Bt(Ko, er, Zo);
function tr(e, t) {
if (!e || e.length < 1)
return null;
for (const i of e) {
if (i.id === t)
return i;
if (i.children) {
const a = i.children.find((O) => O.id === t);
if (a)
return a;
}
}
return null;
}
function nr() {
function e(t, i) {
const { name: a } = i;
if (a !== "fieldsClick")
return t[`on${a.charAt(0).toUpperCase()}${a.slice(1)}`] || t[a];
const O = t.cardToolbar;
if (!O || O.length < 1)
return null;
const [L, V] = i.payloads, H = tr(O, V);
return H ? H.onClick || H.click : null;
}
return {
resolve: e
};
}
var or = /* @__PURE__ */ ((e) => (e.AUTO = "auto", e.ALWAYS = "always", e))(or || {});
function rr(e, t) {
return null;
}
const br = {
/** 启用分页 */
enable: { type: Boolean, default: !1 },
/** 当前页码 */
index: { type: Number, default: 1 },
/** 分页交互模式 */
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 }
}, Sr = {
/** 启用排序 */
enable: { type: Boolean, default: !1 },
/** 排序字段集合 */
fields: { type: Array, default: [] },
/** 排序交互模式 */
mode: { type: String, default: "client" },
/** 多列排序 */
multiSort: { type: Boolean, default: !1 }
}, wr = {
/** 自定义分组合计内容 */
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: () => {
} }
}, Fr = {
/** 启用筛选, 总开关 */
enable: { type: Boolean, default: !1 },
/** DataGrid筛选风格 */
filterStyle: { type: String, default: "filter-column" },
/** 筛选交互模式 */
mode: { type: String, default: "server" },
/** 显示过滤条件工具条 */
showSummary: { type: Boolean, default: !0 }
}, Tr = {
/** 允许折行显示列标题 */
wrapHeadings: { type: Boolean, default: !1 }
}, xr = {
/** 显示行号 */
enable: { type: Boolean, default: !1 },
/** 行号列表头标题 */
heading: { type: String, default: "序号" },
/** 行号宽度,默认为 36px */
width: { type: Number, default: 36 },
/** 是否展示省略号 */
showEllipsis: { type: Boolean, default: !0 }
}, Or = {
/** 自定义行样式 */
customRowStyle: { type: Function, default: () => {
} },
/** 自定义单元格样式 */
customCellStyle: { type: Function, default: () => {
} },
/** 自定义行状态 */
customRowStatus: { type: Function, default: () => {
} },
/** 禁止行选中表达式 */
disable: { type: Function, default: () => {
} },
/** 默认行高度为 29px */
height: { type: Number, default: 28 },
/** 鼠标滑过行效果 */
showHovering: { type: Boolean, default: !0 },
/** 禁止数据折行 */
wrapContent: { type: Boolean, default: !1 }
}, kr = {
/** 显示合计信息 */
enable: { type: Boolean, default: !1 },
/** 合计行自定义样式,对启用合计行模板无效 */
customSummaryStyle: { type: Function, default: () => {
} },
/** 分组合计字段 */
groupFields: { type: Array, default: [] },
/** 合计交互模式 */
mode: { type: String, default: "client" },
/** 合计行显示位置, top: 顶部 bottom: 底部, both: 顶部与底部同时显示 */
position: { type: String, default: "bottom" },
/** 自定义分组合行内容 */
customRender: { type: Function, default: () => {
} }
}, Br = {
/** 自动列宽。设为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 Er = {
/** 启用多选且显示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 }
}, Pr = {
/** 编辑时选中文本 */
selectOnEditing: { type: Boolean, default: !1 },
/** 编辑模式; row:整行编辑,cell: 单元格编辑 */
editMode: { type: String, default: "cell" }
}, Dr = {
/** show loading */
show: { type: Boolean, default: !1 },
/** message on display when loading */
message: { type: String, default: "加载中..." }
}, ir = {
/** 自定义样式 */
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 },
/** 高度 */
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: [] },
/** 最小高度 */
minHeight: { type: Number, default: 300 },
/** 最小宽度 */
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 },
/** 显示滚动条 */
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 },
/** 宽度 */
width: { type: Number, default: -1 },
/** 空数据模板 */
emptyTemplate: { type: Object },
beforeUpdate: { type: Function },
/** 绑定动态字段的解析器 */
fieldsResolver: { type: Function, default: rr },
/** 绑定动态字段的值*/
fieldsCallback: { type: Function, default: () => {
} },
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 }
}, Ir = nr();
function lr() {
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 a = i.dataType, O = { type: e.get(a) || "input-group", readonly: !0 };
return {
...i,
type: "form-group",
label: i.title,
editor: O
};
}
return {
...i,
type: "form-group",
label: i.title
};
}
return { transformColumnToField: t };
}
function ar(e, t, i, a, O, L, V, H, A, F, b, d, C, p, u, c, h) {
const {
isNull: v,
isUndefined: E
} = Ft(), {
totalItems: U,
rawView: Y
} = c, {
calculateCellPositionInRow: z,
cellKey: D,
cellPosition: Q,
rowKey: X,
rowPosition: P,
rowSpanCellPosition: s,
groupCellPosition: se,
summaryCellPosition: ee
} = V, {
cellContentClass: G,
cellContentPosition: oe,
cellContentClassWithEllipsis: te
} = L, {
collpaseGroupIconClass: re
} = F, {
gridCellClass: ye,
gridRowClass: ve,
onClickRow: _,
onMouseoverRow: ue,
onMouseoutRow: ie
} = d, {
onClickCell: pe,
showRowEditPanel: Ie
} = A, {
toggleGroupRow: we
} = C, {
columnContext: K,
hasLeftFixedColumn: le,
hasRightFixedColumn: J
} = H, {
navigateOnKeyUp: ge,
navigateOnKeyDown: Re
} = b, Ce = (o) => (o || []).some((S) => dt(S) ? !(S.type === Tt || S.type === ot && !Ce(S.children)) : !0) ? o : null, Ge = (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
});
De([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: Ve,
rightFixedGridDataStyle: Je,
rightFixedGridMergedDataStyle: Qe
} = p;
function Oe(o, S) {
o.stopPropagation(), S.collapse = !S.collapse, u.value = we(S.collapse ? "collapse" : "expand", S, u.value);
}
function je(o, S, n) {
var g, 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: ($) => Oe($, o)
}, [f("span", {
class: re(o)
}, null)]));
n === "primary" && ((g = e.group) != null && g.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 !== Fn && w.field !== Tn).forEach((w) => {
var Z;
const $ = Q(o, w, S);
if (!I) {
const x = (o.layer + 1) * (((Z = T == null ? void 0 : T.parent) == null ? void 0 : Z.height) || 0);
$.left = `${Number($.left.replace("px", "")) + x}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: (g) => _(g, o),
onMouseover: (g) => ue(g, o)
}, [je(o, S, l)]);
}
function Ae(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 ke(o, S, n, l) {
return o.layer > -1 && f("div", {
ref: o.setRef,
key: X(o),
class: ve(o, n),
style: P(o),
onClick: (g) => _(g, o),
onMouseover: (g) => ue(g, o)
}, [Ae(o, S)]);
}
function $e(o, S) {
var n, l, g;
return o.showTips && typeof ((n = o.column) == null ? void 0 : n.formatter) != "function" && ((l = o.column) == null ? void 0 : l.dataType) !== "commands" && ((g = o.column) == null ? void 0 : g.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, [Xe("******")]);
}
function N(o) {
var l, g;
const S = !v(o.data) && !E(o.data) ? o.data.toString() : o.data;
return ((g = (l = o.column) == null ? void 0 : l.editor) == null ? void 0 : g.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: Ge(o)
}, [o.getEditor(o)]) : o.column.columnTemplate ? o.column.columnTemplate(o, S) : o.formatter ? $e(o, S) : N(o);
}
function _e(o, S, n, l, g) {
return f("div", {
ref: o.setRef,
key: X(o),
class: ve(o, n),
style: l,
onClick: (m) => _(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: ye(m, o),
style: Q(o, m, S),
onClick: ($) => {
pe($, 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 Be(o, S, n, l) {
return _e(o, S, n, P(o));
}
const Te = [Be, Ne, ke];
function ce(o, S) {
const n = z(o);
return u.value.map((l, g) => Te[l.type](l, n, g, S));
}
function Ee(o) {
const S = z(o);
return u.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 Pe() {
return f("div", {
ref: a,
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: Ve.value
}, [Ee(K.value.leftColumns.filter((o) => o.visible))])]);
}
function xe() {
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
}, [Ee(K.value.primaryColumns.filter((o) => o.visible))])]);
}
function ze() {
return f("div", {
ref: O,
class: ae
}, [f("div", {
class: "fv-grid-data",
style: Je.value
}, [ce(K.value.rightColumns.filter((o) => o.visible), "right")]), f("div", {
class: "fv-grid-merge-date",
style: Qe.value
}, [Ee(K.value.rightColumns.filter((o) => o.visible))])]);
}
function qe() {
const o = [];
return le.value && o.push(Pe()), o.push(xe()), J.value && o.push(ze()), o;
}
return {
renderDataArea: qe
};
}
const ur = /* @__PURE__ */ xt({
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(yo, {
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 dr(e, t, i, a, O, L, V, H, A, F, b, d, C, p, u, c, h) {
const {
transformColumnToField: v
} = lr(), {
isNull: E,
isUndefined: U
} = Ft(), {
totalItems: Y,
rawView: z
} = c, {
calculateCellPositionInRow: D,
cellKey: Q,
cellPosition: X,
rowKey: P,
rowPosition: s,
rowSpanCellPosition: se,
groupCellPosition: ee,
summaryCellPosition: G
} = V, {
cellContentClass: oe,
cellContentPosition: te,
cellContentClassWithEllipsis: re
} = L, {
collpaseGroupIconClass: ye
} = F, {
gridCellClass: ve,
gridRowClass: _,
onClickRow: ue,
onMouseoverRow: ie,
onMouseoutRow: pe
} = d, {
onClickCell: Ie
} = A, {
toggleGroupRow: we
} = C, {
columnContext: K,
hasLeftFixedColumn: le,
hasRightFixedColumn: J
} = H, 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: Re,
navigateOnKeyDown: Ce
} = b, Ge = (n) => (n || []).some((l) => dt(l) ? !(l.type === Tt || l.type === ot && !Ge(l.children)) : !0) ? n : null, he = (n) => {
var l, g, m;
return ((g = (l = n.column) == null ? void 0 : l.editor) == null ? void 0 : g.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
});
De([Y, z], (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: Ve,
leftFixedGridMergedDataStyle: Je,
rightFixedGridDataStyle: Qe,
rightFixedGridMergedDataStyle: Oe
} = p;
function je(n, l) {
n.stopPropagation(), l.collapse = !l.collapse, u.value = we(l.collapse ? "collapse" : "expand", l, u.value);
}
function Ne(n, l) {
var I;
const g = [];
if (!n.groupField)
return g;
const m = !!l[n.groupField];
for (let T = 0; T <= n.layer; T++)
g.push(f("div", {
class: "fv-grid-group-row-icon",
style: {
position: "relative",
zIndex: 10
},
onClick: (w) => je(w, n)
}, [f("span", {
class: ye(n)
}, null)]));
if ((I = e.group) != null && I.customRender)
g.push(e.group.customRender(n));
else {
const T = n.data[n.groupField];
if (T) {
const w = {
flex: "1",
wordBreak: "break-all",
minWidth: 0
};
g.push(f("div", {
ref: T.setRef,
key: Q(n, n.layer + 1),
class: e.displayType !== "Card" ? "fv-grid-cell" : void 0,
style: e.displayType === "Card" ? w : m ? ee(T, l, n.layer) : {
flex: "1",
minWidth: 0
},
title: T.data
}, [T.data]));
}
Object.values(n.data).filter((w) => w.field !== n.groupField && w.colSpan !== 0).