@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,593 lines • 343 kB
JavaScript
var zn = Object.defineProperty;
var Gn = (e, t, n) => t in e ? zn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var re = (e, t, n) => Gn(e, typeof t != "symbol" ? t + "" : t, n);
import { createVNode as F, resolveComponent as Xe, createTextVNode as He, ref as I, isVNode as rn, nextTick as Tt, computed as H, inject as ht, Fragment as _t, watch as Ce, onMounted as bt, withDirectives as an, vModelCheckbox as qn, defineComponent as et, reactive as ut, createApp as ln, onUnmounted as Bt, Transition as sn, mergeProps as gt, onBeforeUnmount as un, resolveDirective as Un, provide as Yn, triggerRef as Xn, onBeforeMount as Kn, Teleport as Jn, shallowRef as Qn, render as Ht, h as Zn, cloneVNode as eo } from "vue";
import { F_MODAL_SERVICE_TOKEN as to } from "../modal/index.esm.js";
import cn from "../transfer/index.esm.js";
import dn, { FTabPage as Wt } from "../tabs/index.esm.js";
import no, { FOrder as oo } from "../order/index.esm.js";
import ro from "../condition/index.esm.js";
import ao, { FCheckbox as Lt } from "../checkbox/index.esm.js";
import io, { FFilterBar as lo } from "../filter-bar/index.esm.js";
import Qt from "../tooltip/index.esm.js";
import fn from "../pagination/index.esm.js";
import so from "../button/index.esm.js";
import uo, { FSearchBox as co } from "../search-box/index.esm.js";
import fo, { FTags as po } from "../tags/index.esm.js";
import { cloneDeep as mt, isPlainObject as Zt, isUndefined as en } from "lodash-es";
import mo, { FDynamicFormGroup as vo, FDynamicFormInput as ho } from "../dynamic-form/index.esm.js";
import "../designer-canvas/index.esm.js";
import { useResizeObserver as pn } from "@vueuse/core";
import { useIdentify as go, useGroupData as yo, useFilter as bo, useHierarchy as wo, useLoading as Co, useDataView as _o, useSelection as So, useSelectHierarchyItem as xo, useDataViewContainerStyle as To, useCommandColumn as Fo, useColumn as ko, useSort as Eo, useGroupColumn as Oo, useRow as Io, useEdit as Mo, useVisualDataBound as Vo, useVisualDataCell as Bo, useVisualDataRow as No, useVisualData as Ro, useCellPosition as Do, useSidebar as Po, useVirtualScroll as Ho, useFitColumn as Wo, useFilterHistory as $o, useColumnFilter as jo, useDragColumn as Lo, getColumnHeader as Ao, getSidebar as zo, getDisableMask as Go, getHorizontalScrollbar as qo, getVerticalScrollbar as Uo, getEmpty as Yo } from "../data-view/index.esm.js";
import { getCustomClass as $t, withInstall as Xo, useDateFormat as Ko, useNumberFormat as Jo, resolveField as Ze, setFieldValue as At } from "../common/index.esm.js";
import Qo from "../accordion/index.esm.js";
import Zo from "../avatar/index.esm.js";
import er from "../button-edit/index.esm.js";
import tr from "../button-group/index.esm.js";
import nr from "../calendar/index.esm.js";
import or from "../capsule/index.esm.js";
import rr from "../color-picker/index.esm.js";
import zt from "../combo-list/index.esm.js";
import ar from "../content-container/index.esm.js";
import ir from "../data-grid/index.esm.js";
import lr from "../date-picker/index.esm.js";
import sr from "../dropdown/index.esm.js";
import "../external-container/index.esm.js";
import ur from "../events-editor/index.esm.js";
import cr from "../image-cropper/index.esm.js";
import dr from "../input-group/index.esm.js";
import fr from "../layout/index.esm.js";
import pr from "../list-nav/index.esm.js";
import mr from "../list-view/index.esm.js";
import vr from "../lookup/index.esm.js";
import hr from "../nav/index.esm.js";
import gr from "../number-spinner/index.esm.js";
import yr from "../number-range/index.esm.js";
import br from "../page-header/index.esm.js";
import wr from "../page-footer/index.esm.js";
import Cr from "../progress/index.esm.js";
import _r from "../query-solution/index.esm.js";
import Sr from "../radio-group/index.esm.js";
import xr from "../rate/index.esm.js";
import Tr from "../response-toolbar/index.esm.js";
import Fr from "../response-layout/index.esm.js";
import kr from "../response-layout-editor/index.esm.js";
import Er from "../section/index.esm.js";
import Or from "../smoke-detector/index.esm.js";
import Ir from "../splitter/index.esm.js";
import Mr from "../step/index.esm.js";
import Vr from "../switch/index.esm.js";
import Br from "../text/index.esm.js";
import Nr from "../time-picker/index.esm.js";
import Rr from "../tree-view/index.esm.js";
import Dr from "../uploader/index.esm.js";
import Pr from "../verify-detail/index.esm.js";
import Hr from "../component/index.esm.js";
import Wr from "../video/index.esm.js";
import $r from "../textarea/index.esm.js";
import jr from "../tree-grid/index.esm.js";
import Lr from "../fieldset/index.esm.js";
import Ar from "../drawer/index.esm.js";
import zr from "../binding-selector/index.esm.js";
import "../notify/index.esm.js";
import Gr from "../combo-tree/index.esm.js";
import qr from "../field-selector/index.esm.js";
import Ur from "../mapping-editor/index.esm.js";
import Yr from "../schema-selector/index.esm.js";
import Xr from "../event-parameter/index.esm.js";
import Kr from "../filter-condition-editor/index.esm.js";
import Jr from "../sort-condition-editor/index.esm.js";
import Qr from "../menu-lookup/index.esm.js";
import { createPropsResolver as Zr } from "../dynamic-resolver/index.esm.js";
var je = /* @__PURE__ */ ((e) => (e[e.readonly = 0] = "readonly", e[e.editable = 1] = "editable", e[e.editing = 2] = "editing", e))(je || {}), st = /* @__PURE__ */ ((e) => (e[e.initial = 0] = "initial", e[e.editing = 1] = "editing", e))(st || {}), yt = /* @__PURE__ */ ((e) => (e[e.data = 0] = "data", e[e.group = 1] = "group", e[e.summary = 2] = "summary", e))(yt || {});
const dc = {
/** 显示行号 */
enable: { type: Boolean, default: !1 },
/** 行号列表头标题 */
heading: { type: String, default: "序号" },
/** 行号宽度,默认为 36px */
width: { type: Number, default: 36 }
}, fc = {
/** 启用分页 */
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 },
/** 禁用分页 */
disabled: { type: Boolean, default: !1 }
};
var z = /* @__PURE__ */ ((e) => (e[e.none = 0] = "none", e[e.filterable = 1] = "filterable", e[e.sortable = 2] = "sortable", e[e.filtered = 4] = "filtered", e[e.sorted = 8] = "sorted", e[e.ascending = 16] = "ascending", e[e.descending = 32] = "descending", e))(z || {}), ea = /* @__PURE__ */ ((e) => (e.NONE = "none", e.NUMBER = "number", e.DATE = "date", e.TEXT = "boolean", e.IMAGE = "boolean2", e.ENUM = "enum", e.CUSTOM = "custom", e))(ea || {});
function ta(e, t, n, o, r, i, a) {
const l = [{
name: "升序",
value: "asc",
icon: "f-icon f-icon-col-ascendingorder"
}, {
name: "无",
value: "none"
}, {
name: "降序",
value: "desc",
icon: "f-icon f-icon-col-descendingorder"
}];
function s(c) {
const m = c.status, S = (m & z.sorted) === z.sorted, y = (m & z.ascending) === z.ascending, h = (m & z.descending) === z.descending;
let k = S ? m ^ z.sorted : m;
return k = y ? k ^ z.ascending : k, k = h ? k ^ z.descending : k, k;
}
function g(c) {
c.sortType = "none", c.status = s(c);
const m = c.column;
m && (m.sort = "none", m.sortOrder = 0, e.applyColumnSorter(t, i));
}
function f(c, m) {
m.column && (m.column.filter = null), t.removeFilter(`field_filter_${m.field}`), g(m);
}
function d(c) {
const m = s(c), S = c.sortType === "none" ? m : c.sortType === "asc" ? m | z.sorted | z.ascending : m | z.sorted | z.descending;
c.status = S;
const y = c.column;
y && (y.sort = c.sortType, y.sortOrder = c.sortType !== "none" ? y.sortOrder : 0, c.status = S, e.applyColumnSorter(t, i));
}
function v(c) {
var y;
const m = (c.status & z.filtered) === z.filtered;
c.status = m ? c.status ^ z.filtered : c.status | z.filtered, ((y = c.column) == null ? void 0 : y.filter) != null && c.column.filter !== "" && c.filter ? (o.addColumnFilter(c), t.refresh()) : (o.removeColumnFilter(c), t.refresh());
}
function x(c, m) {
var S;
m.showPopover = !1, m.filterHistory = void 0, r.updateFilterHistory(m, (S = m.column) == null ? void 0 : S.filter), v(m), d(m), a.reCalculateVisualDataRows();
}
function w(c) {
const m = c.status, S = (m & z.sorted) === z.sorted, y = S && (m & z.ascending) === z.ascending;
c.sortType = S ? y ? "asc" : "desc" : "none", i.updateSorter(c, t);
}
function O(c, m) {
m.showPopover = !1, m.filterHistory = void 0, w(m);
}
function C(c) {
return F("div", {
class: "fv-column-sort-filter-container"
}, [F("div", {
class: "fv-column-sort-section"
}, [F(Xe("f-capsule"), {
items: l,
modelValue: c.sortType,
"onUpdate:modelValue": (m) => c.sortType = m,
type: "secondary"
}, null)]), F("div", {
class: "fv-column-filter-section"
}, [F("div", {
class: "fv-column-filter-section-title"
}, [He("筛选")]), F("div", {
class: "fv-column-filter-section-editor"
}, [n.getFilterEditor(c)])]), F("div", {
class: "fv-column-sort-filter-footer"
}, [F("div", {
class: "fv-column-clear-section"
}, [F(Xe("f-button"), {
style: "margin: 5px 0;padding-left: 0;",
type: "link",
onClick: (m) => f(m, c)
}, {
default: () => [He("清空")]
})]), F("div", {
class: "fv-column-confirm-section"
}, [F(Xe("f-button"), {
customClass: {
"f-btn-ml": !0
},
size: "small",
onClick: (m) => x(m, c)
}, {
default: () => [He("确定")]
}), F(Xe("f-button"), {
size: "small",
type: "secondary",
onClick: (m) => O(m, c)
}, {
default: () => [He("取消")]
})])])]);
}
return {
renderFilterContainer: C
};
}
function na(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !rn(e);
}
function oa(e, t, n, o, r, i, a, l, s, g, f) {
function d(E) {
const N = E.status;
return {
"fv-column-handler": !0,
"fv-column-handler-active": (N & z.filtered) === z.filtered || (N & z.sorted) === z.sorted || E.showPopover
};
}
function v(E) {
return (E.status & z.sortable) === z.sortable && (E.status & z.filterable) === z.none && (E.status & z.sorted) === z.none;
}
function x(E) {
return (E.status & z.sortable) === z.sortable && (E.status & z.filterable) === z.none && (E.status & z.sorted) === z.sorted && (E.status & z.ascending) === z.ascending;
}
function w(E) {
return (E.status & z.sortable) === z.sortable && (E.status & z.filterable) === z.none && (E.status & z.sorted) === z.sorted && (E.status & z.descending) === z.descending;
}
function O(E) {
return (E.status & z.sortable) === z.none && (E.status & z.filterable) === z.filterable && (E.status & z.sorted) === z.none;
}
function C(E) {
return (E.status & z.sortable) === z.sortable && (E.status & z.filterable) === z.filterable && (E.status & z.sorted) === z.none;
}
function c(E) {
return (E.status & z.sortable) === z.sortable && (E.status & z.filterable) === z.filterable && (E.status & z.sorted) === z.sorted && (E.status & z.ascending) === z.ascending;
}
function m(E) {
return (E.status & z.sortable) === z.sortable && (E.status & z.filterable) === z.filterable && (E.status & z.sorted) === z.sorted && (E.status & z.descending) === z.descending;
}
const S = function(E) {
return {
"f-icon": !0,
"f-icon-col-defaultsort": v(E),
"f-icon-col-ascending": x(E),
"f-icon-col-descending": w(E),
"f-icon-col-filter": O(E),
"f-icon-col-defaultfilterandsort": C(E),
"f-icon-col-filterandascending": c(E),
"f-icon-col-filteranddescending": m(E)
};
}, y = /* @__PURE__ */ new Map([[z.sortable, z.sortable | z.sorted | z.ascending], [z.sortable | z.sorted | z.ascending, z.sortable | z.sorted | z.descending], [z.sortable | z.sorted | z.descending, z.sortable]]), {
renderFilterContainer: h
} = ta(r, i, a, l, s, g, f), k = I();
function u(E, N) {
N.filter((M) => M !== E && M.showPopover).forEach((M) => {
M.showPopover = !1;
});
}
function p(E) {
let N;
return F(Xe("f-popover"), {
ref: k,
class: "fv-column-handler-popover",
host: t.value,
"z-index": 0,
"right-boundary": o.value,
offsetX: f.offsetX,
visible: !0,
onHidden: () => {
E.showPopover = !1;
}
}, na(N = h(E)) ? N : {
default: () => [N]
});
}
async function b(E, N) {
N.showPopover = !N.showPopover, await Tt();
const M = k.value;
M && M.show(E.target);
}
function T(E) {
const N = E.status;
if ((N & z.sortable) === z.sortable && (N & z.filterable) === z.none && y.has(N)) {
const B = y.get(N), D = (B & z.sorted) === z.sorted, j = (B & z.ascending) === z.ascending, G = (B & z.descending) === z.descending, Q = E.column;
Q && (Q.sort = j ? "asc" : G ? "desc" : "none", Q.sortOrder = D ? Q.sortOrder : 0, E.status = B, r.applyColumnSorter(i, g), f.reCalculateVisualDataRows());
}
}
function _(E, N, M) {
T(N), u(N, M), (N.status & z.filterable) === z.filterable && b(E, N);
}
function R(E, N, M) {
return [F("span", {
class: d(E),
onClick: (B) => _(B, E, M)
}, [F("i", {
class: S(E)
}, null), E && E.column && E.sortType !== "none" && (E.column.sortOrder || ""), E.showPopover && p(E)])];
}
return {
renderHeaderCellHandler: R
};
}
function ra(e, t, n, o, r, i, a, l, s, g) {
const f = "id", d = I();
let v;
const {
applySortableColumns: x,
collectionFilterableColumns: w,
collectionSortableColumns: O,
columnContext: C,
updateColumnSettingIcon: c
} = o, {
conditions: m
} = i, {
calculateColumnsSize: S
} = a, {
fitHorizontalScroll: y
} = s, h = I([]), k = H(() => !!h.value.length), u = H(() => C.value.primaryColumns.map((P) => ({
id: P.field,
name: P.title
}))), p = H(() => C.value.primaryColumns.filter((P) => P.visible).map((P) => ({
id: P.field,
name: P.title
}))), b = H(() => O().map((P) => ({
id: P.field,
name: P.title,
order: P.sort
}))), T = H(() => w().map((P) => ({
id: P.field,
code: P.field,
controlType: "",
labelCode: P.field,
name: P.title,
editor: P.editor,
// || ({ type: useFilterComposition.getFilterEditorType(filterableColumn) } as EditorConfig),
value: {},
visible: !0
})));
function _() {
v == null || v.destroy();
}
function R() {
const P = /* @__PURE__ */ new Map();
return C.value.primaryColumns.reduce((W, A) => (A.visible = !1, W.set(A.field, A), W), P), P;
}
function E(P, W) {
return P.map(({
id: Y
}) => {
const J = W.get(Y);
return J.visible = !0, W.delete(Y), J;
});
}
function N(P) {
const W = R(), A = E(P, W);
C.value.primaryColumns = [...A, ...Array.from(W.values())], c(), S(), Tt(() => {
y();
});
}
function M(P) {
h.value = P;
}
function V(P) {
return F("div", {
class: "fv-grid-settings"
}, [F(dn, {
"tab-type": "pills",
"justify-content": "center"
}, {
headerPrefix: () => F("div", {
class: "modal-title"
}, [F("span", {
class: "modal-title-label"
}, [He("列配置")])]),
default: () => [F(Wt, {
id: "display-columns",
title: "显示列",
class: "container"
}, {
default: () => [F(cn, {
style: "height: 480px",
"identify-field": f,
"data-source": u.value,
selections: p.value,
onChange: N
}, null)]
}), F(Wt, {
id: "column-order",
title: "列排序",
class: "container"
}, {
default: () => [F(oo, {
style: "height: 480px",
"data-source": u.value,
items: b.value,
onChange: M
}, null)]
}), F(Wt, {
id: "column-filter",
title: "筛选",
class: "container"
}, {
default: () => [F(ro, {
ref: d,
style: "height: 480px",
fields: T.value,
conditions: m.value
}, null)]
})],
headerSuffix: () => F("div", {
class: "f-btn-icon f-bare",
onClick: (W) => _()
}, [F("span", {
class: "f-icon modal_close"
}, null)])
})]);
}
function B() {
const P = /* @__PURE__ */ new Map();
return O().reduce((W, A) => (A.sort = "none", A.sortOrder = 0, W.set(A.field, A), W), P), P;
}
function D(P) {
return h.value.filter((A) => A.id && A.order).map((A, Y) => {
const J = Y + 1, X = P.get(A.id);
return X && (X.sort = A.order, X.sortOrder = J), X;
});
}
function j() {
if (k.value) {
const P = B(), W = D(P);
x(W, r, l), s.reCalculateVisualDataRows(), S();
}
}
function G() {
d.value && (m.value = d.value.getConditions(), r.refresh(), s.reCalculateVisualDataRows());
}
function Q() {
j(), G();
}
function K() {
}
function de() {
v = g.open({
title: "",
width: 800,
showButtons: !0,
showHeader: !1,
render: V,
acceptCallback: Q,
rejectCallback: K
});
}
return {
acceptCallback: Q,
rejectCallback: K,
renderSettingsPanel: V,
openSettingPanel: de
};
}
function aa(e, t, n, o, r, i, a, l, s) {
const g = ht(to);
function f(v) {
const {
openSettingPanel: x
} = ra(e, t, n, o, r, i, a, l, s, g);
x();
}
function d() {
return F("span", {
class: "fv-grid-settings-icon",
onClick: f
}, [F("i", {
class: "f-icon f-icon-home-setup"
}, null)]);
}
return {
renderGridSettingsIcon: d
};
}
function ia(e, t, n, o) {
const i = I(-1), a = I(0), l = I(!1);
let s = "";
const g = H(() => ({
display: l.value ? "block" : "none",
left: `${a.value}px`
})), f = H(() => ({
display: l.value ? "block" : "none"
}));
function d(w) {
const O = w.target.parentElement;
if (O) {
const { left: C } = O.getBoundingClientRect();
a.value = w.clientX - C;
}
}
function v(w) {
const O = t.value.primaryColumns.filter((c) => c.visible).find((c) => c.field === s) || t.value.leftColumns.filter((c) => c.visible).find((c) => c.field === s) || t.value.rightColumns.filter((c) => c.visible).find((c) => c.field === s), C = w.target.parentElement;
if (O && C) {
const { left: c } = C.getBoundingClientRect(), m = w.clientX - c, S = (O.actualWidth || 0) + (m - i.value);
O.actualWidth = Math.max(40, S), n.calculateColumnsSize();
}
a.value = 0, l.value = !1, document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", v), document.body.style.userSelect = "", s = "";
}
function x(w, O) {
s = O, l.value = !0;
const c = w.composedPath().find((m) => m.className.split(" ")[0] === "fv-grid");
if (c) {
const { left: m } = c.getBoundingClientRect();
a.value = w.clientX - m, i.value = w.clientX - m, document.addEventListener("mousemove", d), document.addEventListener("mouseup", v), document.body.style.userSelect = "none";
}
}
return { onClickColumnResizeBar: x, resizeHandleStyle: g, resizeOverlayStyle: f };
}
function pc(e, t, n, o, r, i, a, l, s, g, f, d, v, x, w, O, C, c, m) {
const {
showSelectAll: S,
selectAll: y,
unSelectAll: h,
selectedValues: k,
selectAllStatus: u,
indeterminateStatus: p
} = x, {
showRowNumer: b,
showSidebarCheckBox: T,
sidebarTitle: _,
sidebarCornerCellStyle: R
} = w, {
columnContext: E,
hasLeftFixedColumn: N,
hasRightFixedColumn: M
} = i, {
onClickColumnResizeBar: V,
resizeHandleStyle: B,
resizeOverlayStyle: D
} = ia(e, E, d), {
gridHeaderColumnsStyle: j,
leftFixedGridHeaderColumnsStyle: G,
rightFixedGridHeaderColumnsStyle: Q
} = C, {
dragstart: K,
dragenter: de,
dragover: P,
dragend: W
} = l, A = H(() => S.value || T.value || b.value), Y = E.value.defaultColumnWidth, J = 32, X = /* @__PURE__ */ new Map([[0, 0]]), $ = H(() => e.showHeader);
function q(he, xe) {
const Ve = X.get(xe) || 0, Oe = {
height: `${he.depth * J}px`,
left: `${he.left}px`,
top: `${(he.layer - 1) * J}px`,
width: `${he.actualWidth}px`
};
return E.value.headerDepth > 1 && (Oe["line-height"] = `${he.depth * J}px`), X.set(xe + 1, Ve + (he.actualWidth || Y)), Oe;
}
const ie = H(() => ({
"fv-grid-header": !0,
"fv-grid-header-group-columns": E.value.headerDepth > 1
})), ee = H(() => ({
height: `${E.value.headerDepth * J}px`
})), te = function(he) {
return (he.status & z.sortable) === z.sortable || (he.status & z.filterable) === z.filterable;
}, {
renderHeaderCellHandler: ke
} = oa(e, n, o, r, i, a, s, g, f, O, C), Ie = function(he) {
return e.showSetting && !!he.showSetting;
}, {
renderGridSettingsIcon: Ee
} = aa(e, n, c, i, a, g, d, O, C);
function $e(he) {
var Ve;
const xe = {
"fv-grid-header-cell": !0
};
return xe["text-" + (((Ve = he.column) == null ? void 0 : Ve.halign) || "left")] = !0, xe;
}
function De(he, xe, Ve) {
return F("div", {
class: $e(he),
style: q(he, Ve),
draggable: he.draggable,
onDragstart: (Oe) => K(Oe, he, Ve),
onDragenter: (Oe) => de(Oe, Ve),
onDragend: (Oe) => W(Oe, he),
onDragover: (Oe) => P(Oe, Ve)
}, [t.slots.headerCellTemplate ? t.slots.headerCellTemplate({
headerCell: he,
headerCells: xe,
columnIndex: Ve
}) : F("span", {
class: "fv-column-title"
}, [he.title]), te(he) && ke(he, Ve, xe), Ie(he) && Ee(), he.resizable && F("span", {
class: "fv-column-resize-bar",
onMousedown: (Oe) => V(Oe, he.field)
}, null)]);
}
function Me(he) {
return he.map((xe, Ve) => {
const Oe = [];
if (Oe.push(De(xe, he, Ve)), xe.children && xe.children.length) {
const Ke = Me(xe.children);
Oe.push(...Ke);
}
return Oe;
});
}
function qe() {
return F("div", {
class: "fv-grid-header-left-fixed"
}, [F("div", {
class: "fv-grid-header-columns",
style: G.value
}, [Me(E.value.leftHeaderColumns)])]);
}
function Le() {
return F("div", {
class: "fv-grid-header-right-fixed"
}, [F("div", {
class: "fv-grid-header-columns",
style: Q.value
}, [Me(E.value.rightHeaderColumns)])]);
}
function tt(he) {
p.value = !1, he ? y() : h();
}
H(() => k.value.length > 0 && m.value.length !== k.value.length);
function oe() {
return F("div", {
class: "fv-grid-header-corner d-flex",
style: R.value
}, [T.value && S.value && !e.hierarchy && F("div", {
class: "d-inline-flex align-items-center"
}, [F(Lt, {
id: "checkbox_for_select_all",
checked: u.value,
"onUpdate:checked": (he) => u.value = he,
indeterminate: p.value,
onChangeValue: tt
}, null)]), T.value && !S.value && !e.hierarchy && F("div", {
class: "d-inline-flex align-items-center",
style: {
opacity: "0"
}
}, [F(Lt, {
disabled: !0
}, null)]), b.value && F("div", {
class: "d-inline-flex align-items-center"
}, [F("div", {
class: {
"text-center": !0,
"text-truncate": e.rowNumber.showEllipsis,
"w-100": e.rowNumber.showEllipsis
}
}, [_.value])])]);
}
function _e() {
return F("div", {
class: ie.value,
style: ee.value
}, [A.value && oe(), N.value && qe(), F("div", {
class: "fv-grid-header-primary"
}, [F("div", {
class: "fv-grid-header-columns",
style: j.value
}, [Me(E.value.primaryHeaderColumns)])]), M.value && Le()]);
}
function Be() {
return F(_t, null, [F("div", {
class: "fv-datagrid-resize-overlay",
style: D.value
}, null), F("div", {
class: "fv-datagrid-resize-proxy",
style: B.value
}, null)]);
}
return {
renderGridHeader: _e,
renderGridColumnResizeOverlay: Be,
shouldShowHeader: $
};
}
function mc() {
function e() {
return F("div", {
class: "fv-grid-disable"
}, null);
}
return {
renderDisableMask: e
};
}
function vc(e, t, n, o, r) {
const {
columnContext: i
} = t, {
conditions: a,
clearCondition: l,
removeCondition: s
} = o, g = I([]);
function f() {
const O = [];
Array.from(a.value).forEach((C, c) => {
var S;
const m = {
id: C.id,
code: C.fieldCode,
labelCode: C.fieldCode,
name: C.fieldName,
editor: {
type: (S = C.value) == null ? void 0 : S.editorType
}
};
O.push(m);
}), g.value = O;
}
Ce(a, () => f());
function d(O) {
if (O && O.column) {
O.column.filter = null;
let C = O.status;
C = (C & z.filtered) === z.filtered ? C ^ z.filtered : C, O.status = C;
}
}
function v(O) {
s(`field_filter_${O}`);
const C = i.value.primaryHeaderColumns.find((c) => c.field === O);
d(C), n.refresh(), r.reCalculateVisualDataRows();
}
function x() {
l(), i.value.primaryHeaderColumns.forEach((O) => d(O)), n.refresh(), r.reCalculateVisualDataRows();
}
function w() {
return F("div", {
class: "fv-grid-filter-panel"
}, [F(lo, {
data: a.value,
fields: g.value,
mode: "display-only",
"show-reset": !0,
onRemove: v,
onReset: x
}, null)]);
}
return {
renderFilterPanel: w
};
}
function hc(e, t, n, o, r) {
const {
dropOnGroupPanel: i,
groupColumnItems: a
} = n, {
groupFields: l,
shouldGroupingData: s,
showGroupPanel: g
} = o, f = I();
function d(w) {
l.value = w.map((O) => O.value), t.updateDataView(), r.reCalculateVisualDataRows();
}
function v(w) {
w.preventDefault();
}
function x() {
return s.value && g.value && F("div", {
class: "fv-grid-group-panel",
onDrop: i,
onDragover: v
}, [a.value && F(Xe("f-tags"), {
ref: f,
style: "margin:0.375rem",
"tag-type": "default",
data: a.value,
"tag-style": "capsule",
"show-close": !0,
onChange: d
}, null)]);
}
return {
renderGroupPanel: x
};
}
function la(e, t) {
var x;
const n = String(Date.now()), o = ((x = e.rowOption) == null ? void 0 : x.height) || 28, r = I(t.value.primaryColumnsWidth);
function i(w) {
const O = {};
return w.reduce(
(C, c, m) => {
const S = m < w.length - 1 ? w[m + 1] : null;
return m === 0 && (C[c.field] = { left: 0 }), c.actualWidth !== void 0 && (C[c.field].width = c.actualWidth), S && (C[S.field] = {
left: C[c.field].left + (c.actualWidth || 0)
}), C;
},
O
), O;
}
function a(w, O, C) {
const c = o * (C + 1), S = O[w.field].left - c + (O[w.field].width || 0), y = w.parent.height ? `${w.parent.height}px` : "";
return {
left: `${c}px`,
width: `${S}px`,
height: `${y}`
};
}
function l(w, O, C) {
return {
right: "0px",
height: `${w.parent.height ? `${w.parent.height}px` : ""}`
};
}
function s(w, O) {
const C = w.parent.height ? `${w.parent.height}px` : "";
return {
left: `${O[w.field].left}px`,
height: `${C}`,
width: isNaN(Number(O[w.field].width)) ? "100%" : `${O[w.field].width}px`
};
}
function g(w, O, C) {
const m = (O.spanned || []).reduce((y, h) => y + (h.parent.height || 0), 0) + (w.height || 0);
return {
top: `${w.top}px`,
left: `${C[O.field].left}px`,
width: `${C[O.field].width}px`,
height: `${m}px`,
padding: `calc(${m / 2}px - 1rem) 0`
// height: `calc(${rowHeight}px * ${cell.rowSpan})`,
// padding: `calc(${rowHeight * cell.rowSpan / 2}px - 1rem) 0`
};
}
function f(w, O) {
return `${n}_${w.type}_r_${w.index}_c_${O}_${w.refreshKey || ""}`;
}
function d(w) {
return `${n}_${w.type}_r_${w.index}_${w.refreshKey || ""}`;
}
function v(w) {
const O = w.height ? `${w.height}px` : "";
return {
top: `${w.top}px`,
width: isNaN(r.value) ? "100%" : `${r.value}px`,
height: `${O}`
};
}
return Ce(t, () => {
r.value = t.value.primaryColumnsWidth;
}), {
calculateCellPositionInRow: i,
cellKey: f,
cellPosition: s,
groupCellPosition: a,
rowKey: d,
rowPosition: v,
rowSpanCellPosition: g,
summaryCellPosition: l
};
}
function sa(e, t, n) {
const { hasChildrenField: o } = n, r = I("#9399a0"), i = I(28);
function a() {
return [].concat(
...t.value.filter((v) => v.raw.__fv_descendant_index__.length !== 0).map((v) => [...v.raw.__fv_descendant_index__.slice(-1)]).flat()
).sort((v, x) => Number(v) - Number(x));
}
function l(f) {
const d = new Array(t.value.length).fill(0);
if (e.showLines) {
const v = a();
t.value.forEach((x, w) => {
const O = v.includes(w), C = x.raw[o.value];
d[w] = `repeating-linear-gradient(90deg, ${r.value} 0 1px, transparent 0px 2px) ${C ? "-10px" : "0px"} ${i.value / 2}px/20px 1px no-repeat,repeating-linear-gradient(${r.value} 0 1px, transparent 0px 2px) 0px 0px/1px ${O ? "50%" : "100%"} no-repeat`;
}), d[0] = "";
}
return d[f];
}
function s(f, d, v) {
return v[f].parents.set(f, !0).forEach((w) => {
v[w].childsLength = v[w].childWithLines.filter((O) => d[O].visible).length;
}), d;
}
function g(f) {
const x = f.raw.__fv_parent_index__ === void 0 || f.raw.__fv_parent_index__ === -1 ? 0 : 8, w = 0, O = f.raw[o.value], C = f.visible ? {
left: `${f.layer * 10 + f.layer * x + w}px`,
// paddingBottom: handlePaddingBottomReturnValue(visualTreeNode.index),
background: l(f.index),
display: "flex",
width: "100%",
position: "relative",
paddingLeft: "0.75rem"
} : {
display: "none"
};
return O || (C.paddingLeft = "2rem"), C;
}
return { hierarchyCellContentStyle: g, handleCollapsedPaddingBottom: s };
}
function ua(e, t, n) {
const o = I(e.iconField);
function r(i, a) {
if (o.value)
return i.raw[e.iconField];
let l = "";
return i.raw[n.value] !== !0 ? l = t.value.leafnodes : l = i.collapse ? t.value.fold : t.value.unfold, l;
}
return { treeNodeIconsClass: r };
}
function ca(e, t, n, o, r, i, a, l) {
const { dataView: s, fold: g, hasRealChildren: f, unFold: d, reOrderVisibleIndex: v } = o, { collapseField: x, hasChildrenField: w } = r, { reCalculateVisualDataRows: O, updateVirticalScroll: C } = i;
function c(m) {
if (m.raw[w.value]) {
const y = s.value[m.raw.__fv_index__];
y[x.value] = !y[x.value], o.toggleChildrenVisibiltyByCollapseStatus(y), y[w.value] = f(y), v(), O(), C();
}
t.emit("expandNode", { row: m });
}
return { toggleTreeNode: c };
}
function da(e) {
function t(r) {
return {};
}
function n(r) {
const { valign: i, align: a } = r;
return {
"d-flex": !0,
"h-100": !0,
"w-100": !0,
"justify-content-start": a !== "center" && a !== "right",
"justify-content-center": a === "center",
"justify-content-right": a === "right",
"align-items-start": i !== "middle" && i !== "bottom",
"align-items-center": i === "middle",
"align-items-end": i === "bottom"
};
}
function o(r) {
const { align: i, showEllipsis: a } = r;
return {
"w-100": !0,
"text-left": i !== "center" && i !== "right",
"text-center": i === "center",
"text-right": i === "right",
"text-truncate": a
};
}
return { cellContentPosition: t, cellContentClass: n, cellContentClassWithEllipsis: o };
}
function fa(e, t, n, o, r, i, a, l, s, g, f, d, v) {
const {
onClickCell: x
} = i, {
gridRowClass: w,
onClickRow: O,
onMouseoverRow: C,
onMouseoutRow: c
} = l, {
enableMultiSelect: m,
select: S,
unSelect: y,
selectItem: h
} = s;
I(e.cellHeight);
const k = I(e.treeNodeIconsData || {}), {
hasChildrenField: u,
shouldShowCheckBox: p,
shouldShowIcon: b
} = a, {
toggleTreeNode: T
} = ca(e, t, o, r, a, f), {
toggleSelectHierarchyItem: _
} = g, {
cellKey: R,
cellPosition: E,
rowKey: N,
rowPosition: M
} = la(e, n), {
cellContentClass: V,
cellContentPosition: B,
cellContentClassWithEllipsis: D
} = da(), {
hierarchyCellContentStyle: j
} = sa(e, o, a), {
treeNodeIconsClass: G
} = ua(e, k, u);
function Q(ee, te) {
const ke = ee.raw[u.value];
return {
"fv-tree-node-toggle": ke && ee.collapse,
"fv-tree-node-toggle-minus": ke && !ee.collapse
};
}
function K(ee, te) {
ee.stopPropagation(), T(te);
}
function de(ee, te) {
return F("div", {
class: Q(ee),
onClick: (ke) => K(ke, ee)
}, null);
}
function P(ee, te) {
return b.value && F("div", {
id: "treeNodeIcons",
class: G(ee, te)
}, null);
}
function W(ee) {
m.value ? (ee.checked ? S(ee) : y(ee), _(ee)) : h(ee);
}
function A(ee, te) {
return p.value && F(Lt, {
id: "checkbox_for_" + R(ee, te.index),
indeterminate: ee.indeterminate,
disabled: ee.disabled,
checked: ee.checked,
"onUpdate:checked": (ke) => ee.checked = ke,
onChange: () => W(ee)
}, null);
}
function Y(ee, te) {
return F("span", {
title: te.data,
style: "user-select:none"
}, [t.slots.cellTemplate ? t.slots.cellTemplate({
cell: te,
row: ee
}) : te.mode === je.editing ? te.getEditor(te) : te.formatter ? te.formatter(te, ee) : te.data != null ? te.data.toString() : te.data]);
}
function J(ee, te) {
return F("div", {
class: V(te),
style: B(te)
}, [F("div", {
class: D(te)
}, [te.showTips ? F(Qt, null, {
default: () => Y(ee, te),
contentTemplate: () => Y(ee, te)
}) : Y(ee, te)])]);
}
function X(ee, te, ke) {
return F("div", {
ref: te.setRef,
key: R(ee, te.index),
class: "fv-grid-hierarchy-cell",
style: E(te, ke)
}, [F("div", {
style: j(ee)
}, [de(ee), P(ee, te), A(ee, te), J(ee, te)])]);
}
function $(ee, te, ke) {
return F("div", {
ref: te.setRef,
key: R(ee, te.index),
class: "fv-grid-cell",
style: E(te, ke),
onClick: (Ie) => x(Ie, te, ee, te.column)
}, [F("div", {
class: V(te),
style: B(te)
}, [F("div", {
class: D(te)
}, [te.showTips ? F(Qt, null, {
default: () => Y(ee, te),
contentTemplate: () => Y(ee, te)
}) : Y(ee, te)])])]);
}
function q(ee, te) {
return te === "left" && n.value.leftColumns.length > 0 && n.value.leftColumns[0].field === ee.field || te === "primary" && n.value.primaryColumns.length > 0 && n.value.primaryColumns[0].field === ee.field;
}
function ie(ee, te, ke = "primary", Ie) {
return F("div", {
ref: ee.setRef,
key: N(ee),
class: w(ee, Ie),
style: M(ee),
onMouseover: (Ee) => C(Ee, ee),
onMouseout: (Ee) => c(Ee, ee),
onClick: (Ee) => O(Ee, ee)
}, [Object.values(ee.data).filter((Ee) => te[Ee.field] && Ee.rowSpan === 1).map((Ee) => q(Ee, ke) ? X(ee, Ee, te) : $(ee, Ee, te))]);
}
return {
renderDataRow: ie
};
}
function pa(e, t, n) {
const {
horizontalScrollThumbStyle: o,
onMouseDownScrollThumb: r,
shouldShowHorizontalScrollbar: i
} = n;
function a() {
return i.value && F("div", {
class: "fv-grid-horizontal-scroll"
}, [F("div", {
class: "fv-grid-horizontal-scroll-thumb",
style: o.value,
onMousedown: (l) => r(l, t, "horizontal")
}, null)]);
}
return {
renderHorizontalScrollbar: a
};
}
function gc(e, t, n, o, r) {
const {
pageIndex: i,
totalItems: a,
updatePageSize: l
} = n, s = I(), {
pageSize: g,
pageList: f,
showGotoPage: d,
showPageIndex: v,
showPageList: x,
mode: w,
disabled: O,
shouldRenderPagination: C
} = r;
function c(h) {
const {
pageIndex: k,
pageSize: u
} = h;
C.value && w.value !== "server" && (n.navigatePageTo(k), o.resetScroll()), t.emit("pageIndexChanged", {
pageIndex: k,
pageSize: u
});
}
function m(h) {
const {
pageIndex: k,
pageSize: u
} = h;
C.value && w.value !== "server" ? (n.changePageSizeTo(u), o.resetScroll()) : l(u), t.emit("pageSizeChanged", {
pageIndex: k,
pageSize: u
});
}
function S(h) {
const {
pageIndex: k,
pageSize: u
} = h;
C.value && w.value !== "server" ? (n.navigatePageTo(k), o.resetScroll()) : l(u), t.emit("changed", {
pageIndex: k,
pageSize: u
});
}
bt(() => {
C.value && w.value !== "server" && c({
pageIndex: i.value,
pageSize: g.value
});
});
function y() {
return F("div", {
class: "fv-datagrid-pagination position-relative"
}, [F(fn, {
ref: s,
mode: "default",
disabled: O.value,
currentPage: i.value,
"onUpdate:currentPage": (h) => i.value = h,
pageSize: g.value,
"onUpdate:pageSize": (h) => g.value = h,
showGoButton: d.value,
showPageList: x.value,
showPageNumbers: v.value,
totalItems: a.value,
pageList: f.value,
onPageIndexChanged: c,
onPageSizeChanged: m,
onChanged: S
}, null)]);
}
return {
renderDataGridPagination: y
};
}
function yc(e, t, n, o, r) {
const {
isSelectingHirarchyItem: i,
multiSelectOnClickRow: a,
multiSelectOnlyOnCheck: l,
updateSelectStatus: s,
selectItem: g,
toggleSelectItem: f,
toggleSelectItemWithoutRow: d
} = n, {
onMouseoverRow: v,
sidebarRowClass: x
} = t, {
showRowNumer: w,
showSidebarCheckBox: O,
sidebarCellPosition: C,
rowKey: c,
cellKey: m
} = o, {
gridSideStyle: S
} = r;
function y(T) {
T.stopPropagation();
}
function h(T) {
return F("div", {
class: "d-inline-flex "
}, [F("div", {
class: "custom-control custom-checkbox f-checkradio-single",
style: "margin:0;padding-left:0.5rem"
}, [an(F("input", {
id: m(T),
title: m(T),
type: "checkbox",
indeterminate: T.indeterminate,
disabled: T.disabled,
"onUpdate:modelValue": (_) => T.checked = _,
class: "custom-control-input"
}, null), [[qn, T.checked]]), F("label", {
class: "custom-control-label",
for: m(T),
onClick: y
}, null)])]);
}
function k(T) {
return F("div", {
class: "fv-grid-sidebar-row-number justify-content-center",
style: "padding:0",
onMouseover: (_) => v(_, T)
}, [F("div", {
title: T.dataIndex,
class: {
"text-center": !0,
"text-truncate": e.rowNumber.showEllipsis,
"w-100": e.rowNumber.showEllipsis
}
}, [T.dataIndex])]);
}
function u(T, _, R) {
i.value ? a.value ? f(R) : g(R) : a.value ? f(R) : l.value ? d(R) : g(R), s();
}
function p(T) {
return (O.value || w.value) && T.value.map((_, R) => F("div", {
key: c(_),
class: x(_, R),
style: C(_),
onClick: (E) => u(E, T, _)
}, [O.value && !e.hierarchy && h(_), w.value && k(_)]));
}
function b(T) {
return F("div", {
class: "fv-grid-content-side"
}, [F("div", {
class: "fv-grid-side",
style: S.value
}, [p(T)])]);
}
return {
renderDataGridSidebar: b
};
}
function bc(e, t, n) {
const {
columnContext: o
} = n, r = I(e.summary), i = H(() => {
const l = r.value;
return l && l.enable && l.groupFields && l.groupFields.length > 0;
});
function a() {
return i.value && F("div", {
class: "fv-datagrid-summary"
}, [F("div", {
class: "fv-datagird-summary-panel"
}, [F("span", {
class: "fv-datagrid-summary-title"
}, [He("当页合计")]), F("div", {
class: "fv-datagrid-summary-content"
}, [o.value.summaryColumns.map((l) => F("div", {
class: "fv-datagrid-summary-field"
}, [F("span", {
class: "fv-datagrid-summary-field-title"
}, [`${l.title}:`]), F("span", {
class: "fv-datagrid-summary-field-value"
}, [t.summaries.get(l.field)])]))])])]);
}
return {
renderDataGridSummery: a
};
}
function wc(e, t, n) {
const {
verticalScrollThumbStyle: o,
onMouseDownScrollThumb: r,
shouldShowVirticalScrollbar: i
} = n;
function a() {
return i.value && F("div", {
class: "fv-grid-vertical-scroll"
}, [F("div", {
class: "fv-grid-vertical-scroll-thumb",
style: o.value,
onMousedown: (l) => r(l, t, "vertical")
}, null)]);
}
return {
renderVerticalScrollbar: a
};
}
function ma() {
function e(o, r) {
switch (o.command) {
case "edit":
case "remove":
return r.status === st.initial;
case "accept":
case "cancel":
return r.status === st.editing;
default:
return !o.hidden;
}
}
function t(o, r, i) {
switch (o.onClick(r, i.dataIndex, i), o.command) {
case "edit":
i.status, st.editing;
break;
case "accept":
case "cancel":
i.status, st.initial;
break;
}
}
function n(o, r) {
return o.commands && o.commands.map((i) => e(i, r) && F(so, {
class: "ml-2",
type: i.type,
size: i.size || "small",
onClick: (a) => t(i, a, r),
style: {
"margin-bottom": "3px"
}
}, {
default: () => [He(" "), i.text, He(" ")]
}));
}
return {
renderCommandColumn: n
};
}
function Cc(e) {
function t() {
return F("div", {
class: "f-datagrid-norecords"
}, [F("div", {
class: "f-datagrid-norecords-content",
style: "margin: 0;width: 100%;position: absolute; top: 50%; transform:translateY(-50%);user-select:none"
}, [He(" "), e.slots.empty && e.slots.empty() || "暂无数据"])]);
}
return {
renderEmpty: t
};
}
function va(e) {
const t = I(e.minHeight), n = I(e.minWidth), o = I(e.height), r = I(e.width), i = H(() => o.value <= 0 ? 0 : Math.max(o.value, t.value)), a = H(() => r.value <= 0 ? 0 : Math.max(r.value, n.value));
return Ce([
() => e.height,
() => e.width,
() => e.minHeight,
() => e.minWidth
], ([s, g, f, d]) => {
t.value = Number(f), n.value = Number(d), o.value = Number(s), r.value = Number(g);
}), { containerStyleObject: H(() => ({
height: i.value > 0 ? `${i.value}px` : e.fit ? "100%" : "",
width: a.value > 0 ? `${a.value}px` : e.fit ? "100%" : "",
flex: "1 1 0"
})) };
}
const ha = "";
function ga(e) {
const o = I({
defaultColumnWidth: 120,
headerDepth: 1,
leftColumns: [],
leftColumnsMap: /* @__PURE__ */ new Map(),
leftColumnsWidth: 0,
leftHeaderColumns: [],
primaryColumns: [],
primaryColumnsMap: /* @__PURE__ */ new Map(),
primaryColumnsWidth: 0,
primaryHeaderColumns: [],
rightColumns: [],
rightColumnsMap: /* @__PURE__ */ new Map(),
rightColumnsWidth: 0,
rightHeaderColumns: [],
summaryColumns: []
});
function r() {
o.value = {
defaultColumnWidth: 120,
headerDepth: 1,
leftColumns: [],
leftColumnsMap: /* @__PURE__ */ new Map(),
leftColumnsWidth: 0,
leftHeaderColumns: [],
primaryColumns: [],
primaryColumnsMap: /* @__PURE__ */ new Map(),
primaryColumnsWidth: 0,
primaryHeaderColumns: [],
rightColumns: [],
rightColumnsMap: /* @__PURE__ */ new Map(),
rightColumnsWidth: 0,
rightHeaderColumns: [],
summaryColumns: []
};
}
const i = I(e.summary), a = H(() => {
const S = i.value;
return (S == null ? void 0 : S.groupFields) || [];
});
function l() {
o.value.rightColumns.forEach((h) => {
h.showSetting = !1;
}), o.value.primaryColumns.forEach((h) => {
h.showSetting = !1;
});
const S = o.value.rightColumns.filter((h) => h.visible), y = o.value.primaryColumns.filter((h) => h.visible);
S.length > 0 ? S[S.length - 1].showSetting = !0 : y.length > 0 && (y[y.length - 1].showSetting = !0);
}
function s(S) {
r();
const y = /* @__PURE__ */ new Map();
return a.value && a.value.reduce((h, k) => (h.set(k, !0), h), y), S.reduce((h, k) => (k.visible = k.visible !== !1, k.filter = k.filter || ha, k.fixed === "left" ? (o.value.leftColumns.push(k), o.value.leftColumnsMap.set(k.field, k), o.value.leftColumnsWidth += k.actualWidth) : k.fixed === "right" ? (o.value.rightColumns.push(k), o.value.rightColumnsMap.set(k.field, k), o.value.rightColumnsWidth += k.actualWidth) : (o.value.primaryColumns.push(k), o.value.primaryColumnsMap.set(k.field, k), o.value.primaryColumnsWidth += k.actualWidth), y.has(k.field) && o.value.summaryColumns.push(k), h), o), l(), o;
}
s(e.columns);
const g = H(() => o.value.leftColumns.length > 0), f = H(() => o.value.rightColumns.length > 0);
function d(S, y) {
return y.sortable && y.sort && y.sort !== "none" && S.push(y), S;
}
function v(S, y) {
return S.sortOrder = S.sortOrder || 0, y.sortOrder = y.sortOrder || 0, S.sortOrder === y.sortOrder ? 0 : S.sortOrder < y.sortOrder ? -1 : 1;
}
function x(S, y) {
return S.sortOrder = S.sortOrder || 0, y.sortOrder = y.sortOrder || 0, S.sortOrder === y.sortOrder ? 0 : S.sortOrder < y.sortOrder ? 1 : -1;
}
function w(S, y) {
return y.filterable && S.push(y), S;
}
function O() {
const S = [];
return o.value.leftColumns.reduce(w, S), o.value.primaryColumns.reduce(w, S), o.value.rightColumns.reduce(w, S), S;
}
function C() {
const S = [];
o.value.leftColumns.reduce(d, S), o.value.primaryColumns.reduce(d, S), o.value.rightColumns.reduce(d, S);
const y = Math.max(...S.map((h) => h.sortOrder || 0));
return S.sort(x).map((h) => {
const k = h.sortOrder || y + 1;
return h.sortOrder = k, h;
}).sort(v).map((h, k) => {
const u = k + 1;
return h.sortOrder = u, h;
});
}
function c(S, y, h) {
const k = S.map((u) => {
const p = h.getSorterByColumn(u), b = u.sort === "asc", T = u.sort === "desc", _ = b ? p.ascend : T ? p.decend : void 0;
return { field: u.field, compare: _ };
});
y.setSorters(k);
}
function m(S, y) {
const h = C();
c(h, S, y);
}
return {
applyColumnSorter: m,
collectionFilterableColumns: O,
applySortableColumns: c,
collectionSortableColumns: C,
columnContext: o,
hasLeftFixedColumn: g,
hasRightFixedColumn: f,
updateColumnRenderContext: s,
updateColumnSettingIcon: l
};
}
const ya = [{
name: "是",
value: !0
}, {
name: "否",
value: !1
}];
function ba(e) {
var a, l;
I(((a = e.column) == null ? void 0 : a.filter) || !1), e.filter = e.filter || function(s) {
var f;
return String(((f = e.column) == null ? void 0 : f.filter) || "").split(",").includes(String(s[e.field]));
};
const t = ",", n = {
multiSelect: !0,
multiSelectMode: "OnCheckAndClick",
showCheckbox: !0
};
function o(s) {
return (s == null ? void 0 : s.split(t).filter((g) => g !== "").map((g) => g.toLowerCase() === "true")) || [];
}
function r(s) {
return s.map((f) => f.value).join(t);
}
function i(s) {
e.column && (e.column.filter = r(s));
}
return F(Xe("f-list-view"), {
data: ya,
"multi-select": !0,
"id-field": "value",
"value-field": "value",
view: "SingleView",
size: "Small",
selection: n,
"selection-values": o(((l = e.column) == null ? void 0 : l.filter) || ""),
onSelectionChange: (s) => i(s)
}, {
default: () => [He(" ")]
});
}
const wa = I([{
name: "七天",
selectable: !0
}, {
name: "一个月",
selectable: !0
}, {
name: "三个月",
selectable: !0
}, {
name: "半年",
selectable: !0
}]);
function Ca(e) {
var r;
const t = I(!1), n = I(((r = e.column) == null ? void 0 : r.filter) || "");
e.filter = e.filter || function(i) {
var l;
const a = new Date(new Date((l = e.column) == null ? void 0 : l.filter).toLocaleDateString()).valueOf();
return new Date(new Date(i[e.field]).toLocaleDateString()).valueOf() === a;
};
function o(i) {
e.column && (e.column.filter = i);
}
return F("div", {
style: "display:flex;flex-direction:column;"
}, [F("div", {
style: "display:flex;margin-bottom:6px;"
}, [F("label", {
style: "margin-right:8px"
}, [He("按区间筛选")]), F(Xe("f-switch"), {
modelValue: t.value,
"onUpdate:modelValue": (i) => t.value = i,
size: "small"
}, null)]), F(Xe("f-date-picker"), {
modelValue: n.value,
"onUpdate:modelValue": (i) => n.value = i,
onDatePicked: o
}, null), F(Xe("f-tags"), {
style: "margin-top:10px",
data: wa.value,
selectable: !0,
"tag-style": "capsule"
}, null)]);
}
function _a(e) {
var o;
const t = I(((o = e.column) == null ? void 0 : o.filter) || null);
e.filter = e.filter || function(r) {
const i = Number.parseFloat(String(t.value)), a = Number.parseFloat(r[e.field]);
return isNaN(i) ? isNaN(a) : i === a;
};
function n(r) {
e.column && (e.column.filter = r), t.value = r;
}
return F("div", null, [F(Xe("f-number-spinner"), {
modelValue: t.value,
"onUpdate:modelValue": (r) => t.value = r,
"can-null": !0,
precision: 2,
onValueChange: n
}, null)]);
}
function Sa(e, t, n, o, r, i) {
var w;
const a = I((