@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
769 lines (768 loc) • 25.9 kB
JavaScript
import { getCustomClass as Mt, withInstall as Lt } from "../common/index.esm.js";
import { createVNode as v, defineComponent as zt, ref as y, computed as w, onMounted as Wt, nextTick as Ce, onUnmounted as Ut, watch as pe, Fragment as Kt, createTextVNode as Yt } from "vue";
import { useResizeObserver as qt } from "@vueuse/core";
import { isUndefined as F } from "lodash-es";
import { LocaleService as $t } from "../locale/index.esm.js";
import { getHierarchyRow as Jt, useIdentify as Qt, useGroupData as Xt, useFilter as Zt, useHierarchy as el, useLoading as tl, useDataView as ll, useSelection as al, useSelectHierarchyItem as nl, usePagination as il, useDataViewContainerStyle as ol, useCommandColumn as ul, useSettingColumn as sl, useColumn as rl, useSort as dl, useGroupColumn as cl, useRow as fl, useEdit as ml, useVisualDataBound as vl, useVisualDataCell as yl, useVisualDataRow as hl, useVisualData as gl, useCellPosition as Cl, useSidebar as pl, useVirtualScroll as Sl, useFitColumn as wl, useFilterHistory as bl, useColumnFilter as Il, useDragColumn as Bl, getColumnHeader as Dl, getSidebar as Fl, getDisableMask as xl, getHorizontalScrollbar as Rl, getVerticalScrollbar as Ol, getEmpty as Tl, getPagination as Vl, getSummary as Gl, ColumnSettingSolution as Hl, COMMAND_COLUMN_DATA_TYPE as Se, SETTING_COLUMN_DATA_TYPE as we } from "../data-view/index.esm.js";
import Nl from "../input-group/index.esm.js";
import Pl from "../button/index.esm.js";
const ql = {
/** 启用分页 */
enable: { type: Boolean, default: !1 },
/** 当前页码 */
index: { type: Number, default: 1 },
/** 分页交互模式 */
mode: { type: String, default: "server" },
/** 显示页码输入框 */
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 }
}, $l = {
/** 启用排序 */
enable: { type: Boolean, default: !1 },
/** 排序字段集合 */
fields: { type: Array, default: [] },
/** 排序交互模式 */
mode: { type: String, default: "client" },
/** 多列排序 */
multiSort: { type: Boolean, default: !1 }
}, Jl = {
/** 自定义分组合计内容 */
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" }
}, Ql = {
/** 启用筛选 */
enable: { type: Boolean, default: !1 },
/** DataGrid筛选风格 */
filterStyle: { type: String, default: "filter-column" },
/** 筛选交互模式 */
mode: { type: String, default: "server" },
/** 显示过滤条件工具条 */
showSummary: { type: Boolean, default: !0 }
}, Xl = {
/** 允许折行显示列标题 */
wrapHeadings: { type: Boolean, default: !1 }
}, Zl = {
/** 自定义行样式 */
customRowStyle: { type: Function, default: () => {
} },
customCellStyle: { type: Function, default: () => {
} },
/** 禁止行选中表达式 */
disable: { type: Function, default: () => {
} },
/** 默认行高度为 29px */
height: { type: Number, default: 28 },
/** 鼠标滑过行效果 */
showHovering: { type: Boolean, default: !0 },
/** 禁止数据折行 */
wrapContent: { type: Boolean, default: !1 }
}, ea = {
/** 显示合计信息 */
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" }
}, ta = {
/** 自动列宽。设为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 }
}, la = {
/** 编辑时选中文本 */
selectOnEditing: { type: Boolean, default: !1 },
/** 编辑模式; row:整行编辑,cell: 单元格编辑 */
editMode: { type: String, default: "cell" }
}, aa = {
/** show loading */
show: { type: Boolean, default: !1 },
/** message on display when loading */
message: { type: String, default: `${$t.getLocaleValue("datagrid.loadingMessage")}...` }
}, kl = {
/** 自定义样式 */
customClass: { type: String, default: "" },
/** 排序配置 */
sort: { type: Object },
/** 筛选配置 */
filter: { type: Object },
/** 自动勾选子节点 */
autoCheckChildren: { type: Boolean, default: !1 },
/** 列集合 */
columns: { type: Array, default: [] },
/** 列配置 */
columnOption: { type: Object },
/** 命令列配置选项 */
commandOption: {
type: Object,
default: {
enable: !1,
commands: []
}
},
/** 被绑定数据 */
data: { type: Array, default: [] },
/** 禁用组件 */
disabled: { type: Boolean, default: !1 },
/** 用于控制节点禁用状态的字段 */
disabledField: { type: String, default: "disabled" },
/** 用于显示信息的字段 */
displayField: { type: String, default: "name" },
/** 允许编辑 */
editable: { type: Boolean, default: !1 },
/** 编辑配置 */
editOption: { type: Object, default: { selectOnEditing: !1, editMode: "cell" } },
/** 适配父组件尺寸 */
fit: { type: Boolean, default: !1 },
/** 列标题配置 */
header: { type: Object },
/** 高度 */
height: { type: Number, default: -1 },
/** 层级关系配置对象 */
hierarchy: {
type: Object,
default: {
cascadeOption: {
autoCancelParent: !0,
autoCheckChildren: !1,
autoCheckParent: !1,
selectionRange: "All"
},
parentIdField: "parent"
}
},
/** DataGrid组件唯一标识 */
id: { type: String, default: "" },
/** 被绑定数据的标识字段 */
idField: { type: String, default: "id", require: !0 },
/** async loading data */
loadData: { type: Function },
// 是否展示 loading
loading: {
type: Boolean,
default: !1
},
/** 最小高度 */
minHeight: { type: Number, default: 300 },
/** 最小宽度 */
minWidth: { type: Number, default: 400 },
/** 新建数据 */
newDataItem: {
type: Function,
default: () => {
}
},
/** 分页配置 */
pagination: {
type: Object,
default: {
enable: !1,
size: -1
}
},
/** 行号配置 */
rowNumber: {
type: Object,
default: {
enable: !0,
width: 36,
heading: "序号"
}
},
/** 行配置 */
rowOption: {
type: Object,
default: {
wrapContent: !1
}
},
/** 选择配置 */
selection: {
type: Object,
default: {
enableSelectRow: !0,
multiSelect: !1,
multiSelectMode: "DependOnCheck",
showCheckbox: !1,
showSelectAll: !1,
showSelection: !1
}
},
/** 已选数据标识 */
selectionValues: { type: Array, default: [] },
/** 显示边框 */
showBorder: { type: Boolean, default: !1 },
/** 显示列头 */
showHeader: { type: Boolean, default: !0 },
/** 显示横向行分割线 */
showHorizontalLines: { type: Boolean, default: !0 },
/** 显示节点连接线 */
showLines: { type: Boolean, default: !1 },
/** 显示配置按钮 */
showOptions: { type: Boolean, default: !1 },
/** 显示滚动条 */
showScrollBar: { type: String, default: "auto" },
/** 显示设置按钮 */
showSetting: { type: Boolean, default: !1 },
/** 显示条纹 */
showStripe: { type: Boolean, default: !0 },
/** 显示树节点图标 */
showTreeNodeIcons: { type: Boolean, default: !1 },
/** 显示纵向列分割线 */
showVerticallLines: { type: Boolean, default: !1 },
/** 树节点图标数据 */
treeNodeIconsData: { type: [Object, String], default: {} },
/** 宽度 */
width: { type: Number, default: -1 },
/** 启用虚拟渲染 */
virtualized: { type: Boolean, default: !1 },
/** 空数据模板 */
emptyTemplate: { type: Object },
/** 合计配置 */
summary: {
type: Object,
default: {
// 默认合计行开启后,后面不展示值,所以默认不开启
enable: !1,
groupFields: ["numericField1", "numericField2"]
}
},
/** 自动高度 **/
autoHeight: { type: Boolean, default: !1 },
/** 是否可见, 为了适配低代码表单,该属性不应该属于表格组件的行为 */
/** 复选框位置 */
checkboxPosition: { type: String, default: "after-expand" },
enableColumnSettingSolution: { type: Boolean, default: !1 },
/** 搜索配置 */
searchable: {
type: Boolean,
default: !1
},
customSearch: { type: Function }
};
function _l(l, C, A, E, B, b, M, K, x, h, f, R, Y, o, O, q, V, d, T) {
const {
calculateCellPositionInRow: le
} = b, {
columnContext: G,
hasLeftFixedColumn: $,
hasRightFixedColumn: H
} = M, {
gridDataStyle: J,
leftFixedGridDataStyle: ae,
rightFixedGridDataStyle: ne
} = o, {
renderDataRow: a
} = Jt(l, C, G, V, K, x, h, f, R, Y, o, O, q, d, T), ie = [a];
function c(m, Q) {
const X = le(m);
return V.value.filter((P) => P.visible !== !1).map((P, k) => ie[P.type](P, X, Q, k));
}
function N() {
return v("div", {
ref: E,
class: "fv-grid-content-left-fixed"
}, [v("div", {
class: "fv-grid-data",
style: ae.value
}, [c(G.value.leftColumns.filter((m) => m.visible), "left")])]);
}
function oe() {
return v("div", {
ref: A,
class: "fv-grid-content-primary"
}, [v("div", {
class: "fv-grid-data",
style: J.value
}, [c(G.value.primaryColumns.filter((m) => m.visible), "primary")])]);
}
function D() {
return v("div", {
ref: B,
class: "fv-grid-content-right-fixed"
}, [v("div", {
class: "fv-grid-data",
style: ne.value
}, [c(G.value.rightColumns.filter((m) => m.visible), "right")])]);
}
function ue() {
const m = [];
return $.value && m.push(N()), m.push(oe()), H.value && m.push(D()), m;
}
return {
renderDataArea: ue
};
}
const jl = /* @__PURE__ */ zt({
name: "FTreeGrid",
props: kl,
emits: ["selectionChange", "clickRow", "expandNode", "unSelectItem", "dblclickNode", "doubleClickRow", "unSelectItem", "selectItem", "filterChanged", "unSelectAll", "selectAll", "sortChanged", "selectionUpdate", "endEditCell"],
setup(l, C) {
var Ve, Ge;
const A = y(!1), E = y(!1), B = 0, b = y(((Ve = l.rowOption) == null ? void 0 : Ve.height) || 28);
let M = [], K = [];
const x = y(20), h = y(l.columns), f = Qt(l), {
idField: R
} = f, Y = y(), o = y(), O = y(), q = y(), V = y(), d = y([]), T = y(!1), le = y(((Ge = l.rowOption) == null ? void 0 : Ge.wrapContent) || !1), G = Xt(l, f), $ = Zt(l, C), H = el(l), {
collapseField: J
} = H, {
showLoading: ae,
renderLoading: ne
} = tl(l, Y), a = ll(l, /* @__PURE__ */ new Map(), $, H, f), {
dataView: ie
} = a, c = al(l, a, f, d, C), {
showSelection: N,
selectedValues: oe
} = c, D = nl(l, d, a, f, c, C), ue = w(() => l.disabled), m = w(() => l.virtualized ? Math.min(a.dataView.value.length, x.value) : a.dataView.value.length), Q = il(l, a), {
shouldRenderPagination: X
} = Q, {
containerStyleObject: P
} = ol(l, d), k = y(""), se = y([]), He = w(() => l.searchable || !1), L = y(0), Ne = ul(l), {
applyCommands: be
} = Ne;
be(h);
const {
applyColumnSetting: re,
removeColumnSetting: Pe
} = sl(l);
l.showSetting && re(h);
const z = rl(l, C), de = dl(l), {
applyColumnSorter: Ie,
columnContext: Z,
updateColumnRenderContext: ke
} = z;
Ie(a, de);
const ce = cl(l, Z), _ = fl(l, C, c, f), j = ml(l, C, f, _, d), fe = vl(l, a, b), _e = yl(l, j, fe), je = hl(l, a, j, H, f, fe, _e, b), me = gl(l, h, a, m, B, je), {
getVisualData: ee
} = me, Ae = Cl(l, Z, b, A), ve = pl(l, c), {
sidebarWidth: Ee
} = ve, g = Sl(l, a, d, Z, me, m, B, Ee, b, A), {
onWheel: Me,
dataGridWidth: Be,
viewPortHeight: De,
viewPortWidth: te,
resetScroll: ye,
updateVisibleRowsOnLatestVisibleScope: Le
} = g, Fe = wl(l, Z, o, te, ce), {
calculateColumnsSize: W
} = Fe, xe = bl(), ze = Il(o, V, a, xe, g), We = Bl(l, C, z, a, ce, G, g), Ue = w(() => {
const e = {
"fv-grid": !0,
"fv-grid-bordered": l.showBorder,
"fv-grid-horizontal-bordered": l.showHorizontalLines,
"fv-datagrid-strip": l.showStripe
};
return Mt(e, l.customClass);
}), Ke = w(() => ({
"fv-grid-content": !0,
"fv-grid-content-hover": T.value,
"fv-grid-wrap-content": le.value
})), {
renderDataArea: Ye
} = _l(l, C, O, q, V, Ae, z, a, j, H, _, c, D, g, me, fe, d, b, A), {
renderGridHeader: qe,
renderGridColumnResizeOverlay: $e,
shouldShowHeader: Je
} = Dl(l, C, o, q, V, z, a, We, ze, $, xe, Fe, ce, c, ve, de, g, te, d, E), {
renderDataGridSidebar: Qe
} = Fl(l, _, c, ve, g), {
renderDisableMask: Xe
} = xl(), {
renderHorizontalScrollbar: Ze
} = Rl(l, o, g), {
renderVerticalScrollbar: et
} = Ol(l, o, g);
function tt() {
var e, t, u;
if (o.value && o.value.clientHeight > 0 && ((e = o.value) == null ? void 0 : e.clientWidth) > 0) {
const i = Math.ceil(o.value.clientHeight / b.value);
i > x.value && (x.value = i, Le()), De.value = ((t = O.value) == null ? void 0 : t.clientHeight) || 0, Be.value = ((u = o.value) == null ? void 0 : u.clientWidth) || 0;
}
o.value && (o.value.clientHeight > 0 || o.value.clientWidth > 0) && W();
}
Wt(() => {
o.value && (x.value = Math.max(Math.ceil(o.value.clientHeight / b.value), x.value), d.value = ee(0, m.value + B - 1), qt(o.value, tt), W(), Ce(() => {
o.value && (Be.value = o.value.clientWidth), O.value && (te.value = O.value.clientWidth, De.value = O.value.clientHeight);
})), ae.value && ne();
}), Ut(() => {
}), pe(te, () => {
o.value && W();
});
function lt(e) {
a.collapseTo(e), a.reOrderVisibleIndex(), ye();
}
function at(e) {
a.expandTo(e), a.reOrderVisibleIndex(), ye();
}
function he() {
const e = c.getSelectionRow();
return e ? e.dataIndex - 1 : -1;
}
function nt(e) {
const t = e !== void 0 ? e : he(), u = a.insertNewDataItem(t === -1 ? 0 : t);
return d.value = ee(0, m.value + B - 1), u;
}
function it() {
const e = he();
a.insertNewChildDataItem(e), d.value = ee(0, m.value + B - 1);
}
function ot(e, t) {
const u = d.value.find((s) => s.raw[R.value] === t), i = u ? u.dataIndex - 1 : -1;
a.insertNewChildDataItems(e, i);
}
function ut() {
const e = he(), t = D.getNextSelectableHierarchyItemId(e);
a.removeHierarchyDataItem(e), d.value = ee(0, m.value + B - 1), t && D.selectItemById(t);
}
function st(e) {
j.onEditingRow(e);
}
function rt(e) {
j.acceptEditingRow(e);
}
function dt(e) {
j.cancelEditingRow(e);
}
function U(e) {
e && (h.value = e, be(h), l.showSetting && re(h), ke(h.value), Ie(a, de), W());
}
pe(() => l.columns, (e) => {
if (l.showSetting && l.enableColumnSettingSolution) {
U(h.value);
return;
}
U(e);
});
function ct(e, t) {
e && (a.load(e), a.reOrderVisibleIndex(), t != null && t.keepScrollPosition ? g.scrollTo(g.offsetY.value) : ye());
}
function ge(e) {
_.activeRowById(e);
}
function ft(e, t = {
isCurrent: !0
}) {
t != null && t.isCurrent && ge(e), D.selectItemById(e);
}
function mt(e) {
const t = d.value.find((u) => u.raw[f.idField.value] === e);
t && _.clickRowItem(t);
}
function vt(e) {
D.selectItemByIds(e);
}
function yt() {
return c.getSelectedItems();
}
function Re() {
c.clearSelection();
}
function ht() {
c.emptyCurrentRowId();
}
const gt = w(() => !d.value || !d.value.length), {
renderEmpty: Ct
} = Tl(l, C);
function pt() {
return c.getSelectionRow();
}
function St(e, t = {
clearCurrent: !0
}) {
t != null && t.clearCurrent && ge(""), D.unSelectItemByIds(e);
}
function wt() {
return c.currentSelectedDataId.value;
}
function bt(e, t, u) {
const i = ie.value.find((s) => s[R.value] === e);
if (i) {
if (Object.keys(i).forEach((r) => {
Object.prototype.hasOwnProperty.call(t, r) && (i[r] = t[r]);
}), u) {
const {
collapseField: r,
disabledField: p,
checkedField: I,
visibleField: S
} = u;
r && !F(t[r]) && (i.__fv_collapse__ = t[r]), I && !F(t[I]) && (i.__fv_checked__ = t[I]), p && !F(t[p]) && (i.__fv_disabled__ = t[p]), S && !F(t[S]) && (i.__fv_visible__ = t[S]);
}
const s = d.value.find((r) => r.raw[R.value] === e), n = d.value.findIndex((r) => r.raw[R.value] === e);
if (s) {
if (s.raw = i, Object.keys(s.data).forEach((r) => {
s.data[r].updateData(i);
}), u) {
const {
collapseField: r,
disabledField: p,
checkedField: I,
visibleField: S
} = u;
r && !F(t[r]) && (s.collapse = t[r]), I && !F(t[I]) && (s.checked = t[I]), p && !F(t[p]) && (s.disabled = t[p]), S && !F(t[S]) && (s.visible = t[S]);
}
d.value = [...d.value.slice(0, n), s, ...d.value.slice(n + 1)], a.updateSummary();
}
}
}
function It(e) {
return Object.prototype.hasOwnProperty.call(e, "raw") ? a.hasRealChildren(e.raw) : a.hasRealChildren(e);
}
function Bt(e) {
const t = a.dataView.value.find((u) => u[R.value] === e);
return t ? t[J.value] : "";
}
function Dt() {
return J.value;
}
pe(() => l.showSetting, (e, t) => {
e !== t && (e ? re(h) : Pe(h), U(h.value));
});
function Ft(e) {
return d.value.filter((t) => e.includes(t.raw[l.idField]));
}
function Oe(e) {
const t = f.idField.value, u = d.value.find((i) => i.raw[t] === e);
u && _.changeRow(u);
}
function xt() {
c.keepSelectingOnPaging.value || Re(), a.updateVisibleDataSummary(d.value);
}
function Rt(e) {
c.updateSelectedValues(e);
}
function Ot(e) {
c.removeSelectedValues(e);
}
function Tt(e) {
Ce(() => {
g.scrollToRowByIndex(e.dataIndex - 1);
});
}
function Vt(e) {
let t = e;
for (; t.parentId; ) {
const u = a.dataView.value.find((i) => i[f.idField.value] === t.parentId);
if (u)
u[f.idField.value], a.unFold({
raw: u
}), t = u;
else
break;
}
}
function Gt(e, t) {
if (e.length !== t.length)
return !1;
const u = e.map((s) => s[f.idField.value]).sort(), i = t.map((s) => s[f.idField.value]).sort();
return u.every((s, n) => s === i[n]);
}
function Te() {
if (!k.value.trim()) {
se.value = [], L.value = 0;
return;
}
const e = [], t = k.value.toLowerCase().trim();
a.dataView.value.forEach((i) => {
var n;
let s = !1;
(n = l.search) != null && n.customSearch ? s = l.search.customSearch(t, i, l.columns) : l.columns.forEach((r) => {
!s && r.field && i[r.field] !== void 0 && String(i[r.field]).toLowerCase().includes(t) && (s = !0);
}), s && (e.push(i), Vt(i));
}), !Gt(e, se.value) ? (se.value = e, L.value = 0) : e.length > 0 && (L.value = (L.value + 1) % e.length), e.length > 0 && Ce(() => {
const i = e[L.value];
Oe(i[f.idField.value]);
const s = d.value.find((n) => n.raw[f.idField.value] === i[f.idField.value]);
s && Tt(s);
});
}
function Ht(e) {
e.key === "Enter" && Te();
}
function Nt() {
Te();
}
C.expose({
activeRowById: ge,
addNewDataItem: nt,
addNewChildDataItem: it,
addChildrenToNode: ot,
collapseTo: lt,
expandTo: at,
removeDataItem: ut,
editDataItem: st,
acceptDataItem: rt,
cancelDataItem: dt,
updateColumns: U,
updateDataSource: ct,
selectItemById: ft,
selectItemByIds: vt,
getSelectedItems: yt,
clearSelection: Re,
getSelectionRow: pt,
clickRowItemById: mt,
unSelectItemByIds: St,
getCurrentRowId: wt,
reassignRowData: bt,
hasChildren: It,
getCollapseField: Dt,
getCollapseStatusById: Bt,
getVisibleDataByIds: Ft,
selectRowById: Oe,
updateDerivedData: xt,
emptyCurrentRowId: ht,
calculateColumnsSize: W,
updateSelectedValues: Rt,
removeSelectedValues: Ot
});
const Pt = w(() => {
const e = {};
return g.shouldShowHorizontalScrollbar.value && (e.paddingBottom = "10px"), g.shouldShowVirticalScrollbar.value && (e.paddingRight = "10px"), e;
}), kt = w(() => ({
...P.value,
borderRadius: "5px"
})), {
renderDataGridPagination: Al
} = Vl(l, C, a, g, Q, c), _t = w(() => ({
"d-flex": !0,
"justify-content-between": X.value && N.value,
"justify-content-end": X.value && !N.value,
"position-relative": !0
})), jt = w(() => ({
"d-flex": !0,
"align-items-center": !0
}));
function At(e) {
const t = e.map((n) => n.id), u = [...h.value, ...M, ...K];
u.filter((n) => n.dataType !== Se && n.dataType !== we).forEach((n) => {
const r = e.find((p) => p.id === n.id);
r && (n.width = r.actualWidth || n.width || 120, n.title = r.title, n.halign = r.halign, n.align = r.align, n.fixed = r.fixed);
}), K = u.filter((n) => n.dataType === Se || n.dataType === we);
const i = u.filter((n) => n.dataType !== Se && n.dataType !== we), s = i.filter((n) => t.includes(n.id));
M = i.filter((n) => !t.includes(n.id)), s.sort((n, r) => {
const p = e.findIndex((S) => S.id === n.id), I = e.findIndex((S) => S.id === r.id);
return p - I;
}), U(s);
}
const {
renderDataGridSummary: Et
} = Gl(l, a, z);
return () => v(Kt, null, [He.value && v("div", {
class: "fv-grid-search",
style: {
padding: "8px 12px",
border: "1px solid #e0e0e0",
borderBottom: "none",
borderRadius: "4px 4px 0 0"
}
}, [v("div", {
style: {
display: "flex",
alignItems: "center"
}
}, [v(Nl, {
value: k.value,
onInput: (e) => k.value = e,
onKeydown: Ht,
placeholder: "搜索数据...",
style: {
flex: 1
}
}, null), v(Pl, {
type: "link",
onClick: Nt,
style: {
cursor: "pointer",
marginLeft: "8px"
}
}, {
default: () => [v("i", {
class: "f-icon f-icon-search"
}, null)]
})])]), v("div", {
ref: Y,
class: Ue.value,
style: kt.value,
onWheel: Me
}, [o.value && Je.value && qe(), v("div", {
ref: o,
class: Ke.value,
onMouseover: () => T.value = !0,
onMouseleave: () => T.value = !1,
onTouchstart: (e) => {
e.stopPropagation(), T.value = !0, g.onTouchstartScrollThumb(e, o);
},
onTouchend: (e) => {
T.value = !1;
},
style: Pt.value
}, [o.value && Qe(d), o.value && Ye(), o.value && gt.value && Ct(), o.value && Ze(), o.value && et()]), o.value && Et(), N.value && v("div", {
class: _t.value
}, [N.value && v("div", {
class: jt.value
}, [v("div", null, ["已选:" + oe.value.length, Yt(" 条")])])]), $e(), ue.value && Xe()]), l.enableColumnSettingSolution && v(Hl, {
columns: [...h.value, ...M],
componentId: l.id,
modelValue: E.value,
"onUpdate:modelValue": (e) => E.value = e,
onChangeColumnSetting: At
}, null)]);
}
}), na = Lt(jl);
export {
jl as FTreeGrid,
ta as columnOptions,
na as default,
la as editOptions,
Ql as filterOptions,
Jl as groupOptions,
Xl as headerOptions,
aa as loadingOptions,
ql as paginationOptions,
Zl as rowOptions,
$l as sortOptions,
ea as summaryOptions,
kl as treeGridProps
};