@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,539 lines (1,538 loc) • 407 kB
JavaScript
var xr = Object.defineProperty;
var Sr = (n, t, e) => t in n ? xr(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
var H = (n, t, e) => Sr(n, typeof t != "symbol" ? t + "" : t, e);
import { ref as S, computed as L, createVNode as k, Fragment as Ft, watch as Fe, withModifiers as Tr, withDirectives as zn, vModelText as kr, defineComponent as Ke, createTextVNode as ct, reactive as wt, createApp as Yn, onUnmounted as ln, onMounted as Ot, Transition as Un, mergeProps as $t, onBeforeUnmount as Xn, resolveDirective as Fr, nextTick as un, inject as kt, provide as Mr, triggerRef as Er, isVNode as Or, onBeforeMount as Ir, Teleport as Dr, shallowRef as Vr, render as mn, h as Pr, cloneVNode as Rr } from "vue";
import { isPlainObject as Dn, cloneDeep as Mt, isUndefined as ut, throttle as Nr } from "lodash-es";
import { getCustomClass as Kt, useGuid as Br, resolveField as rt, FormSchemaEntityFieldTypeName as Vn, withInstall as Hr, useCommonUtils as $r, useDateFormat as Lr, useNumberFormat as Wr, setFieldValue as vn } from "../common/index.esm.js";
import { useFilter as Qn, useIdentify as Kn, useHierarchy as Jn, useGroupData as Zn, useDataView as eo, useSelection as to, useRow as no, useEdit as oo, useVisualDataBound as ro, useVisualDataCell as ao, useVisualDataRow as io, useVisualGroupRow as jr, useVisualSummaryRow as Ar, useVisualData as so, useLoading as Gr, useSelectHierarchyItem as qr, useDataViewContainerStyle as zr, useCommandColumn as Yr, useColumn as Ur, useSort as Xr, useGroupColumn as Qr, useCellPosition as Kr, useSidebar as Jr, useVirtualScroll as Zr, useFitColumn as ea, useFilterHistory as ta, useColumnFilter as na, useDragColumn as oa, getColumnHeader as ra, getSidebar as aa, getDisableMask as ia, getHorizontalScrollbar as sa, getVerticalScrollbar as la, getEmpty as ua } from "../data-view/index.esm.js";
import { FCheckbox as cn } from "../checkbox/index.esm.js";
import "../modal/index.esm.js";
import ca from "../transfer/index.esm.js";
import da from "../tabs/index.esm.js";
import fa from "../order/index.esm.js";
import "../condition/index.esm.js";
import ma from "../filter-bar/index.esm.js";
import Pn from "../tooltip/index.esm.js";
import pa from "../pagination/index.esm.js";
import ha from "../button/index.esm.js";
import va from "../search-box/index.esm.js";
import ga from "../tags/index.esm.js";
import ya, { FDynamicFormGroup as wa, FDynamicFormInput as ba } from "../dynamic-form/index.esm.js";
import { createPropsResolver as Ca } from "../dynamic-resolver/index.esm.js";
import "../designer-canvas/index.esm.js";
import "../property-panel/index.esm.js";
import _a from "../accordion/index.esm.js";
import xa from "../avatar/index.esm.js";
import Sa from "../../designer/button-edit/index.esm.js";
import Ta from "../button-group/index.esm.js";
import ka from "../calendar/index.esm.js";
import Fa from "../capsule/index.esm.js";
import Rn from "../../designer/checkbox/index.esm.js";
import Nn from "../../designer/checkbox-group/index.esm.js";
import gn from "../combo-list/index.esm.js";
import Ma from "../combo-tree/index.esm.js";
import Ea from "../component/index.esm.js";
import Oa from "../color-picker/index.esm.js";
import Ia from "../content-container/index.esm.js";
import Da from "../date-picker/index.esm.js";
import Va from "../../designer/data-grid/index.esm.js";
import Pa from "../dropdown/index.esm.js";
import Ra from "../events-editor/index.esm.js";
import Na from "../field-selector/index.esm.js";
import Ba from "../binding-selector/index.esm.js";
import Ha from "../image-cropper/index.esm.js";
import $a from "../../designer/input-group/index.esm.js";
import La from "../layout/index.esm.js";
import Wa from "../list-nav/index.esm.js";
import ja from "../list-view/index.esm.js";
import Aa from "../lookup/index.esm.js";
import Ga from "../mapping-editor/index.esm.js";
import qa from "../nav/index.esm.js";
import za from "../number-range/index.esm.js";
import Ya from "../number-spinner/index.esm.js";
import Ua from "../page-header/index.esm.js";
import Xa from "../page-footer/index.esm.js";
import Qa from "../progress/index.esm.js";
import Ka from "../query-solution/index.esm.js";
import Ja from "../../designer/radio-group/index.esm.js";
import Za from "../rate/index.esm.js";
import ei from "../response-toolbar/index.esm.js";
import ti from "../response-layout/index.esm.js";
import ni from "../response-layout-editor/index.esm.js";
import oi from "../section/index.esm.js";
import ri from "../smoke-detector/index.esm.js";
import ai from "../splitter/index.esm.js";
import ii from "../step/index.esm.js";
import si from "../switch/index.esm.js";
import li from "../text/index.esm.js";
import ui from "../time-picker/index.esm.js";
import ci from "../tree-view/index.esm.js";
import di from "../uploader/index.esm.js";
import fi from "../verify-detail/index.esm.js";
import mi from "../video/index.esm.js";
import pi from "../textarea/index.esm.js";
import hi from "../schema-selector/index.esm.js";
import vi from "../tree-grid/index.esm.js";
import gi from "../event-parameter/index.esm.js";
import yi from "../filter-condition-editor/index.esm.js";
import wi from "../fieldset/index.esm.js";
import bi from "../sort-condition-editor/index.esm.js";
import Ci from "../menu-lookup/index.esm.js";
import _i from "../drawer/index.esm.js";
import xi from "../json-editor/index.esm.js";
import Si from "../property-editor/index.esm.js";
import Ti from "../expression-editor/index.esm.js";
import ki from "../code-editor/index.esm.js";
import Fi from "../html-template/index.esm.js";
import "../external-container/index.esm.js";
import { useResizeObserver as lo } from "@vueuse/core";
import "../notify/index.esm.js";
const uo = {}, co = {};
function xn(n) {
const { properties: t, title: e, ignore: o } = n, r = o && Array.isArray(o), a = Object.keys(t).reduce((i, s) => ((!r || !o.find((l) => l === s)) && (i[s] = t[s].type === "object" && t[s].properties ? xn(t[s]) : Mt(t[s].default)), i), {});
if (e && (!r || !o.find((i) => i === "id"))) {
const i = e.toLowerCase().replace(/-/g, "_");
a.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return a;
}
function Mi(n) {
const { properties: t, title: e, required: o } = n;
if (o && Array.isArray(o)) {
const r = o.reduce((a, i) => (a[i] = t[i].type === "object" && t[i].properties ? xn(t[i]) : Mt(t[i].default), a), {});
if (e && o.find((a) => a === "id")) {
const a = e.toLowerCase().replace(/-/g, "_");
r.id = `${a}_${Math.random().toString().slice(2, 6)}`;
}
return r;
}
return {
type: e
};
}
function fo(n, t = {}, e) {
const o = uo[n];
if (o) {
let r = Mi(o);
const a = co[n];
return r = a ? a({ getSchemaByType: fo }, r, t, e) : r, r;
}
return null;
}
function Ei(n, t) {
const e = xn(t);
return Object.keys(e).reduce((o, r) => (Object.prototype.hasOwnProperty.call(n, r) && (o[r] && Dn(o[r]) && Dn(n[r] || !n[r]) ? Object.assign(o[r], n[r] || {}) : o[r] = n[r]), o), e), e;
}
function mo(n, t) {
return Object.keys(n).filter((o) => n[o] != null).reduce((o, r) => {
if (t.has(r)) {
const a = t.get(r);
if (typeof a == "string")
o[a] = n[r];
else {
const i = a(r, n[r], n);
Object.assign(o, i);
}
} else
o[r] = n[r];
return o;
}, {});
}
function Oi(n, t, e = /* @__PURE__ */ new Map()) {
const o = Ei(n, t);
return mo(o, e);
}
function Ii(n = {}) {
function t(u, c, d, f) {
if (typeof d == "number")
return f[u].length === d;
if (typeof d == "object") {
const p = Object.keys(d)[0], h = d[p];
if (p === "not")
return Number(f[u].length) !== Number(h);
if (p === "moreThan")
return Number(f[u].length) >= Number(h);
if (p === "lessThan")
return Number(f[u].length) <= Number(h);
}
return !1;
}
function e(u, c, d, f) {
return f[u] && f[u].propertyValue && String(f[u].propertyValue.value) === String(d);
}
const o = /* @__PURE__ */ new Map([
["length", t],
["getProperty", e]
]);
Object.keys(n).reduce((u, c) => (u.set(c, n[c]), u), o);
function r(u, c) {
const d = u;
return typeof c == "number" ? [{ target: d, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: d, operator: "getProperty", param: u, value: !!c }] : typeof c == "object" ? Object.keys(c).map((f) => {
if (f === "length")
return { target: d, operator: "length", param: null, value: c[f] };
const p = f, h = c[f];
return { target: d, operator: "getProperty", param: p, value: h };
}) : [];
}
function a(u) {
return Object.keys(u).reduce((d, f) => {
const p = r(f, u[f]);
return d.push(...p), d;
}, []);
}
function i(u, c) {
if (o.has(u.operator)) {
const d = o.get(u.operator);
return d && d(u.target, u.param, u.value, c) || !1;
}
return !1;
}
function s(u, c) {
return a(u).reduce((p, h) => p && i(h, c), !0);
}
function l(u, c) {
const d = Object.keys(u), f = d.includes("allOf"), p = d.includes("anyOf"), h = f || p, v = (h ? u[h ? f ? "allOf" : "anyOf" : "allOf"] : [u]).map((g) => s(g, c));
return f ? !v.includes(!1) : v.includes(!0);
}
return { parseValueSchema: l };
}
const de = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
"input-group": { type: "input-group", name: "文本" },
textarea: { type: "textarea", name: "多行文本" },
lookup: { type: "lookup", name: "帮助" },
"number-spinner": { type: "number-spinner", name: "数值" },
"date-picker": { type: "date-picker", name: "日期" },
switch: { type: "switch", name: "开关" },
"radio-group": { type: "radio-group", name: "单选组" },
"check-box": { type: "check-box", name: "复选框" },
"check-group": { type: "check-group", name: "复选框组" },
"combo-list": { type: "combo-list", name: "下拉列表" },
"response-form": { type: "response-form", name: "卡片面板" },
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
"tree-grid": { type: "tree-grid", name: "树表格" },
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
"data-grid": { type: "data-grid", name: "表格" },
"data-grid-column": { type: "data-grid-column", name: "表格列" },
module: { type: "Module", name: "模块" },
component: { type: "component", name: "组件" },
tabs: { type: "tabs", name: "标签页" },
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
"html-template": { type: "html-template", name: "模板容器" },
"time-picker": { type: "time-picker", name: "时间选择" },
section: { type: "section", name: "分组面板" },
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
splitter: { type: "splitter", name: "分栏面板" },
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
"component-ref": { type: "component-ref", name: "组件引用节点" },
uploader: { type: "uploader", name: "附件上传" },
"page-header": { type: "page-header", name: "页头" },
"page-footer": { type: "page-footer", name: "页脚" },
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
fieldset: { type: "fieldset", name: "分组" },
"query-solution": { type: "query-solution", name: "筛选方案" },
drawer: { type: "drawer", name: "抽屉" },
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
"list-nav": { type: "list-nav", name: "列表导航" },
"filter-bar": { type: "filter-bar", name: "筛选条" }
}, Di = {}, Vi = {};
Ii();
function It(n, t, e = /* @__PURE__ */ new Map(), o = (i, s, l, u) => s, r = {}, a = (i) => i) {
return uo[t.title] = t, co[t.title] = o, Di[t.title] = r, Vi[t.title] = a, (i = {}, s = !0) => {
if (!s)
return mo(i, e);
const l = Oi(i, t, e), u = Object.keys(n).reduce((c, d) => (c[d] = n[d].default, c), {});
return Object.assign(u, l);
};
}
function dn(n, t) {
return { customClass: t.class, customStyle: t.style };
}
function Pi() {
function n(t, e) {
const { dataSource: o } = t || {};
return o === void 0 ? {} : {};
}
return {
resolve: n
};
}
function Ri() {
function n(t, e) {
return t.selectItemById(e);
}
return {
selectItemById: n
};
}
function Ni() {
function n(t, e) {
const { columns: o } = e;
return t.updateColumns(o);
}
return {
updateColumns: n
};
}
const po = /* @__PURE__ */ new Map([
["appearance", dn]
]);
function ho(n, t, e) {
return t;
}
const Bi = "https://json-schema.org/draft/2020-12/schema", Hi = "https://farris-design.gitee.io/list-view.schema.json", $i = "list-view", Li = "A Farris Component", Wi = "object", ji = {
id: {
description: "The unique identifier for list-view",
type: "string"
},
type: {
description: "The type string of list-view",
type: "string",
default: "list-view"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
binding: {
description: "",
type: "object",
default: {}
},
disable: {
type: "string",
default: !1
},
editable: {
description: "",
type: "boolean",
default: !0
},
placeholder: {
description: "",
type: "string",
default: ""
},
readonly: {
description: "",
type: "boolean",
default: !1
},
require: {
description: "",
type: "boolean",
default: !1
},
tabindex: {
description: "",
type: "number",
default: -1
},
visible: {
description: "",
type: "boolean",
default: !0
}
}, Ai = [
"id",
"type"
], Gi = {
$schema: Bi,
$id: Hi,
title: $i,
description: Li,
type: Wi,
properties: ji,
required: Ai
}, qi = "list-view", zi = "A Farris Component", Yi = "object", Ui = {
basic: {
description: "Basic Infomation",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "waiting for modification",
enum: []
}
}
}
}
}, Xi = {
title: qi,
description: zi,
type: Yi,
categories: Ui
}, fn = {
/** 列集合 */
columns: {
type: Array,
default: [
{ field: "name", title: "", dataType: "string" }
]
},
customClass: { type: String, default: "" },
data: { type: Array, default: [] },
draggable: { type: Boolean, default: !1 },
multiSelect: { Type: Boolean, default: !1 },
multiSelectMode: { Type: String, default: "OnCheck" },
idField: { Type: String, default: "id" },
valueField: { Type: String, default: "id" },
textField: { Type: String, default: "name" },
titleField: { Type: String, default: "name" },
view: { Type: String, default: "ContentView" },
size: { Type: String, default: "default" },
placeholder: { type: String, default: "" },
header: { Type: String, default: "ContentHeader" },
headerClass: { Type: String, default: "" },
itemClass: { Type: String, default: "" },
itemContentClass: { Type: String, default: "" },
selectionValues: { type: Array, default: [] },
/** 分组配置 */
group: { type: Object },
/** 选择配置 */
selection: {
type: Object,
default: {
enableSelectRow: !0,
multiSelect: !1,
multiSelectMode: "DependOnCheck",
showCheckbox: !1,
showSelectAll: !1,
showSelection: !0
}
},
keepOrder: { type: Boolean, default: !1 },
disableField: { type: String, default: "disabled" },
// 搜索启用高亮
enableHighlightSearch: { type: Boolean, default: !0 },
/** 虚拟化渲染数据 */
virtualized: { type: Boolean, default: !0 }
}, vo = It(fn, Gi, po, ho, Xi);
function go(n, t) {
function e(a) {
const i = [];
let s = a.nextNode();
for (; s; )
i.push(s), s = a.nextNode();
return i;
}
function o(a, i) {
const s = document.createTreeWalker(a, NodeFilter.SHOW_TEXT);
return e(s).map((d) => ({ textNode: d, text: (d.textContent || "").toLocaleLowerCase() })).map(({ textNode: d, text: f }) => {
const p = [];
let h = 0;
for (; h < f.length; ) {
const O = f.indexOf(i, h);
if (O === -1)
break;
p.push(O), h = O + i.length;
}
return p.map((O) => {
const _ = new Range();
return _.setStart(d, O), _.setEnd(d, O + i.length), _;
});
}).flat();
}
function r(a) {
if (!CSS.highlights || (CSS.highlights.clear(), !a || !t))
return;
const i = o(t.value, a.toLocaleLowerCase()), s = new Highlight(...i);
CSS.highlights.set("search-result", s);
}
return { search: r };
}
function Bn(n, t, e, o, r, a, i, s, l, u) {
const c = S(n.size), d = S(n.textField), f = S(n.titleField), p = S(n.disableField), h = L(() => {
var C, w;
return ((C = n.selection) == null ? void 0 : C.multiSelect) && ((w = n.selection) == null ? void 0 : w.showCheckbox);
}), {
onMouseenterItem: O,
onMouseoverItem: _,
onMouseoutItem: v
} = a, {
getKey: x,
listViewItemClass: g,
onCheckItem: T,
onClickItem: F
} = i, b = L(() => {
const C = {
"text-overflow": "ellipsis",
overflow: "hidden",
"white-space": "nowrap"
};
return n.itemClass ? C : {
margin: c.value === "small" ? "0.25rem 0" : "8px 0",
...C
};
});
function m(C, w, M) {
return C.checked = s.findIndexInSelectedItems(C) > -1, k("li", {
class: g(C, w),
id: x(C, w),
key: x(C, w),
onClick: (y) => F(y, C, w),
onMouseenter: (y) => O(y, C, w),
onMouseover: (y) => _(y, C, w),
onMouseout: (y) => v(y, C, w)
}, [h.value && k("div", {
class: "f-list-select",
onClick: (y) => y.stopPropagation()
}, [k(cn, {
id: "list-" + x(C, w),
customClass: "listview-checkbox",
disabled: C[p.value],
checked: C.checked,
"onUpdate:checked": (y) => C.checked = y,
onChange: (y) => {
T(C, w, !y.checked);
}
}, null)]), k("div", {
class: "f-list-content"
}, [k("div", {
class: n.itemContentClass,
style: b.value,
title: C.raw[f.value] || C.raw[d.value]
}, [C.raw[d.value]])])]);
}
return {
renderItem: m
};
}
function Qi(n, t, e, o, r, a, i, s, l, u) {
const c = S(n.multiSelect), d = S(n.disableField), f = S(n.textField), {
onMouseenterItem: p,
onMouseoverItem: h,
onMouseoutItem: O
} = a, {
getKey: _,
listViewItemClass: v,
onCheckItem: x,
onClickItem: g
} = i;
function T(b, m, C) {
return t.slots.content ? k(Ft, null, [t.slots.content && t.slots.content({
item: b.raw,
index: m,
selectedItem: C
})]) : k("div", {
style: "margin: 10px 0;"
}, [b.raw[f.value || "name"]]);
}
function F(b, m, C) {
return k("li", {
class: v(b, m),
id: _(b, m),
key: _(b, m),
onClick: (w) => g(w, b, m),
onMouseenter: (w) => p(w, b, m),
onMouseover: (w) => h(w, b, m),
onMouseout: (w) => O(w, b, m)
}, [c.value && k("div", {
class: "f-list-select",
onClick: (w) => w.stopPropagation()
}, [k(cn, {
id: "list-" + _(b, m),
customClass: "listview-checkbox",
disabled: b[d.value] || !b.checked,
checked: b.checked,
"onUpdate:checked": (w) => b.checked = w,
onChange: (w) => x(b, m, !w.checked)
}, null)]), k("div", {
class: "f-list-content"
}, [T(b, m, C)])]);
}
return {
renderItem: F
};
}
function Ki(n, t, e, o, r, a, i, s, l, u) {
const c = S(n.multiSelect), d = S(n.disableField), f = S(n.textField), {
onMouseenterItem: p,
onMouseoverItem: h,
onMouseoutItem: O
} = a, {
getKey: _,
listViewItemClass: v,
onCheckItem: x,
onClickItem: g
} = i, {
dragstart: T,
dragenter: F,
dragover: b,
dragend: m
} = o, {
removeItem: C
} = l, w = L(() => ({
margin: c.value ? "10px 0" : "10px 0px 10px 14px"
}));
function M(I, B = "") {
const $ = I.target;
$.title = $.scrollWidth > $.clientWidth ? B : "";
}
function y(I) {
return k("div", {
style: w.value,
onMouseenter: (B) => M(B, I.raw[f.value || "name"])
}, [I.raw[f.value || "name"]]);
}
function V() {
return t.slots.itemContent ? t.slots.itemContent : y;
}
const P = V();
function E(I, B, $) {
return k("li", {
class: v(I, B),
id: _(I, B),
key: _(I, B),
onClick: (D) => g(D, I, B),
onMouseenter: (D) => p(D, I, B),
onMouseover: (D) => h(D, I, B),
onMouseout: (D) => O(D, I, B),
draggable: "true",
onDragstart: (D) => T(D, I, B),
onDragenter: (D) => F(D, B),
onDragend: (D) => m(D, I),
onDragover: (D) => b(D)
}, [c.value && k("div", {
class: "f-list-select",
onClick: (D) => D.stopPropagation()
}, [k(cn, {
id: "list-" + _(I, B),
customClass: "listview-checkbox",
disabled: I[d.value] || !I.checked,
checked: I.checked,
"onUpdate:checked": (D) => I.checked = D,
onChange: (D) => x(I, B, !D.checked)
}, null)]), k("div", {
class: "f-list-content"
}, [P(I)]), k("div", {
class: "f-list-remove",
onClick: (D) => C(B)
}, [k("div", {
class: "f-list-remove-icon"
}, [k("i", {
class: "f-icon f-icon-remove_face"
}, null)])]), k("div", {
class: "f-list-handle"
}, [k("div", null, [k("i", {
class: "f-icon f-icon-drag-vertical"
}, null)])])]);
}
return {
renderItem: E
};
}
function Ji(n, t, e, o, r, a, i, s, l, u) {
var _;
const c = S(((_ = n.group) == null ? void 0 : _.groupFields) || []), {
collpaseGroupIconClass: d
} = r, {
toggleGroupRow: f
} = u;
function p(v, x) {
x.collapse = !x.collapse, e.value = f(x.collapse ? "collapse" : "expand", x, e.value);
}
function h(v, x, g) {
return t.slots.group ? k(Ft, null, [t.slots.content && t.slots.group({
item: v.raw,
index: x,
selectedItem: g
})]) : k("div", {
class: "f-navlookup-recentHeader",
onClick: (T) => p(T, v)
}, [k("div", {
class: "fv-grid-group-row-icon"
}, [k("span", {
class: d(v)
}, null)]), k("div", {
class: "f-navlookup-recommandLabel"
}, [v.raw[c.value[v.layer]]])]);
}
function O(v, x, g) {
return v.layer > -1 && h(v, x, g);
}
return {
renderItem: O
};
}
function Zi(n, t, e, o) {
const { dataView: r } = e, { updateSelectedItems: a } = o;
function i(s) {
if (s > -1 && s < r.value.length) {
const l = r.value.splice(s, 1);
a(), t.emit("removeItem", l[0]);
}
}
return { removeItem: i };
}
function yo(n, t, e, o, r, a, i, s, l, u) {
const c = S(n.view), d = S(n.view === "CardView"), f = S({}), p = S("暂无数据"), h = Zi(n, t, o, l), O = L(() => ({
"f-list-view-group": !0,
"f-list-view-group-multiselect": n.multiSelect,
"d-flex": d.value,
"flex-wrap": d.value
})), _ = L(() => !!e.value && e.value.length > 0), v = L(() => e.value.length === 0);
L(() => v.value && !t.slots.empty);
function x() {
return c.value === "SingleView" ? Bn : c.value === "DraggableView" ? Ki : (c.value === "ContentView" || c.value === "CardView") && t.slots.content ? Qi : Bn;
}
const g = x(), {
renderItem: T
} = g(n, t, e, u, r, a, l, i, h, s), {
renderItem: F
} = Ji(n, t, e, u, r, a, l, i, h, s), b = [T, F];
function m() {
return e.value.filter((M) => M.visible !== !1).map((M, y) => b[M.type](M, y, f));
}
function C() {
return k("div", {
class: "f-list-view-emptydata",
style: "margin: 0 auto;"
}, [k("p", {
class: "f-empty-title"
}, [t.slots.empty ? t.slots.empty() : p.value])]);
}
function w() {
return k("ul", {
class: O.value,
style: "list-style: none;"
}, [_.value && m(), v.value && C()]);
}
return {
renderListArea: w
};
}
function wo(n, t, e) {
function o() {
return t.slots.header && k("div", {
class: "f-list-view-header"
}, [t.slots.header()]);
}
return {
renderHeader: o
};
}
function tn(n, t, e) {
const o = S(n.headerClass), r = S(n.placeholder), a = S(""), i = L(() => !a.value), s = L(() => !!a.value);
function l(f) {
a.value = "";
}
Fe(a, (f) => {
n.enableHighlightSearch && e.search(f), t.emit("afterSearch", f);
});
const u = L(() => {
const f = {
"form-group": !0,
"farris-form-group": !0
};
return o.value && o.value.split(" ").reduce((h, O) => (h[O] = !0, h), f), f;
});
function c(f) {
}
function d() {
return k("div", {
class: "f-list-view-header",
onClick: Tr(() => c, ["prevent", "stop"])
}, [k("div", {
class: u.value
}, [k("div", {
class: "farris-input-wrap"
}, [k("div", {
class: "f-cmp-inputgroup"
}, [k("div", {
class: "input-group f-state-editable"
}, [zn(k("input", {
class: "form-control f-utils-fill text-left",
"onUpdate:modelValue": (f) => a.value = f,
name: "input-group-value",
type: "text",
placeholder: r.value,
autocomplete: "off"
}, null), [[kr, a.value]]), k("div", {
class: "input-group-append"
}, [s.value && k("span", {
class: "input-group-text input-group-clear",
onClick: (f) => l()
}, [k("i", {
class: "f-icon f-icon-close-circle"
}, null)]), i.value && k("span", {
class: "input-group-text"
}, [k("span", {
class: "f-icon f-icon-search"
}, null)])])])])])])]);
}
return {
renderHeader: d
};
}
function bo() {
const n = S(""), t = S(-1), e = S(""), o = S(-1), r = S(!1);
function a(d, f, p) {
o.value = p;
}
function i(d, f, p) {
r.value || (o.value = p);
}
function s(d, f, p) {
o.value = -1;
}
function l() {
r.value = !0;
}
function u() {
r.value = !1;
}
function c() {
t.value = -1, n.value = "";
}
return {
activeIndex: t,
focusedItemId: e,
hoverIndex: o,
clearActiveItem: c,
onMouseenterItem: a,
onMouseoverItem: i,
onMouseoutItem: s,
resumeHover: u,
suspendHover: l
};
}
function Co(n, t, e, o) {
const r = S(n.idField), { dataView: a } = e, i = S(-1), s = S(!1), { activeIndex: l, focusedItemId: u, hoverIndex: c, resumeHover: d, suspendHover: f } = o;
let p, h = 0, O = 0;
function _(b, m) {
const C = b - h, w = m - O;
p.style.left = parseInt(p.style.left) + C + "px", p.style.top = parseInt(p.style.top) + w + "px", h = b, O = m;
}
function v(b) {
const { left: m, top: C } = b.getBoundingClientRect(), w = b.cloneNode(!0);
return w.style.cssText = `
position:absolute;
left:${m}px;
top:${C}px;
z-index: 999999;
border: 1px solid #e2e3e5;
pointer-events: none;
background-color: #edf5ff;
border-radius: 10px;
margin: 4px 2px;
display: flex;
align-items: center;
float: none;
text-align: initial;
width:${getComputedStyle(b).width};
height:${getComputedStyle(b).height};
`, w.children[0].style.cssText = "overflow: hidden;flex: 1 1 auto;width: 100%;", w.children[0].children[0].style.cssText = `
margin: 10px 0px 10px 14px;
overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
`, w.children[1].style.cssText = "width: 30px;color: #f4625f;padding: 0 14px 0 0", w.children[2].style.cssText = "padding: 0 14px 0 0;", document.body.appendChild(w), w;
}
function x(b, m, C) {
if (b.stopPropagation(), f(), m) {
if (p = v(b.target), b.dataTransfer) {
const w = new Image();
w.src = "", b.dataTransfer.setDragImage(w, 0, 0);
}
h = b.pageX, O = b.pageY, setTimeout(() => {
i.value = C, s.value = !0, m.moving = !0;
});
}
}
function g(b, m) {
if (b.preventDefault(), i.value !== m) {
const C = a.value[i.value], w = a.value;
w.splice(i.value, 1), w.splice(m, 0, C), i.value = m, _(b.pageX, b.pageY);
}
}
function T(b) {
b.preventDefault(), b.dataTransfer && (b.dataTransfer.dropEffect = "move"), _(b.pageX, b.pageY);
}
function F(b, m) {
m && (m.moving = !1, p && (document.body.removeChild(p), p = null)), a.value.forEach((C, w) => {
C.__fv_index__ = w;
}), s.value = !1, d(), c.value = m.raw.__fv_index__, l.value = m.raw.__fv_index__, u.value = m.raw[r.value], t.emit("change", a.value), t.emit("activeChange", [m.raw]);
}
return {
dragstart: x,
dragenter: g,
dragover: T,
dragend: F,
isDragging: s
};
}
function _o(n, t, e, o, r, a) {
const i = S(n.idField), s = S(n.disableField), l = S(n.draggable), u = S(n.itemClass), c = S(n.selection.multiSelect ?? !1), d = S(n.selection.multiSelectMode), { isDragging: f } = o, { activeIndex: p, focusedItemId: h, hoverIndex: O } = r, { clearSelection: _, getSelectedItems: v, toggleSelectItem: x, currentSelectedDataId: g } = a, T = S(v()), F = (E) => T.value.length === 0 ? !1 : T.value.some((I) => {
let B = "";
return I.data ? B = I.data[i.value] : B = I[i.value], B === E;
});
function b() {
T.value = v();
}
function m(E, I) {
return E.raw[i.value] != null ? E.raw[i.value] : "";
}
function C(E, I) {
const B = {
"f-list-view-group-item": !0,
"f-list-view-draggable-item": l.value,
"f-un-click": !E.checked,
"f-un-select": !!E.raw[s.value],
"f-listview-active": (
// 多选
c.value && F(m(E)) || // 单选
E.raw[i.value] === g.value
),
"f-listview-hover": !f.value && I === O.value,
moving: !!E.moving
};
return u.value.split(" ").reduce((D, j) => (D[j] = !0, D), B), B;
}
const w = L(() => !c.value);
function M(E, I, B) {
E.checked = B, !E.raw[s.value] && (w.value && (h.value = E.raw[i.value]), x(E));
}
const y = L(() => c.value && d.value === "OnCheckClearByClick"), V = L(() => !c.value || c.value && (d.value === "OnCheckAndClick" || d.value === "OnClick"));
function P(E, I, B) {
if (I.raw[s.value]) {
E.preventDefault(), E.stopPropagation();
return;
}
h.value = I.raw[i.value], p.value = B, y.value && _(), V.value && (x(I), b()), t.emit("clickItem", { data: T.value, index: B }), t.emit("activeChange", T.value);
}
return {
getKey: m,
selectedItems: T,
listViewItemClass: C,
updateSelectedItems: b,
onCheckItem: M,
onClickItem: P
};
}
const At = /* @__PURE__ */ Ke({
name: "FListView",
props: fn,
emits: ["afterSearch", "checkValuesChange", "clickItem", "selectionChange", "removeItem", "change", "activeChange"],
setup(n, t) {
const e = S(), o = S(!0), r = S(!1), a = S([]), i = 0, s = S(n.columns), l = Qn(), u = Kn(n), c = Jn(n), d = Zn(n, u), f = eo(n, /* @__PURE__ */ new Map(), l, c, u), p = to(n, f, u, a, t), h = go(n, e), O = L(() => f.dataView.value.length), _ = no(n, t, p, u), v = oo(n, t, u, _, a), x = ro(n), g = ao(n, {}, x), T = io(n, f, v, c, u, x, g), F = jr(n, u, g, T), b = Ar(n, u, g, T), m = so(n, s, f, O, i, T, F, b), {
getVisualData: C
} = m;
a.value = C(0, O.value + i - 1);
const w = L(() => {
const U = {
"f-list-view": !0,
"f-list-view-multiple": n.multiSelect
};
return n.size !== "default" && (U[`${n.size}-item`] = !0), Kt(U, n.customClass);
}), M = L(() => !!t.slots.footer || o.value);
function y() {
return n.header === "SearchBar" ? tn : n.header === "ContentHeader" ? wo : tn;
}
const V = y(), {
renderHeader: P
} = V(n, t, h), E = bo(), I = Co(n, t, f, E), B = _o(n, t, a, I, E, p), {
renderListArea: $
} = yo(n, t, a, f, d, E, p, m, B, I);
function D(U) {
h.search(U);
}
function j(U) {
U && (f.load(U), a.value = C(0, O.value + i - 1));
}
function K() {
p.clearSelection(), E.clearActiveItem();
}
function N() {
return B.selectedItems.value;
}
function R() {
return B.selectedItems.value.map((U) => U[u.idField.value]);
}
function Q(U) {
p.selectedValues.value = U, B.updateSelectedItems();
}
function G() {
return p.currentSelectedDataId.value;
}
function A(U) {
_.activeRowById(U);
}
t.expose({
search: D,
updateDataSource: j,
clearSelection: K,
getSelections: N,
updateSelectionByIds: Q,
getSelectionIds: R,
activeRowById: A,
getCurrentRowId: G
});
function z(U) {
n.multiSelect && (U.preventDefault(), U.stopPropagation());
}
return () => k("div", {
class: w.value,
onClick: z
}, [P(), k("div", {
ref: e,
class: "f-list-view-content",
onMouseover: () => {
r.value = !0;
},
onMouseleave: () => {
r.value = !1;
}
}, [$()]), M.value && k("div", {
class: "f-list-view-footer"
}, [t.slots.footer && t.slots.footer()])]);
}
});
function Sn(n, t, e) {
var m;
const o = e && e.getStyles && e.getStyles() || "", r = e && e.getDesignerClass && e.getDesignerClass() || "", a = S();
function i() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanMoveComponent ? e.checkCanMoveComponent() : !0;
}
function s() {
return !1;
}
function l() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanDeleteComponent ? e.checkCanDeleteComponent() : !0;
}
function u() {
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : e && e.hideNestedPaddingInDesginerView ? e.hideNestedPaddingInDesginerView() : !1;
}
function c(C) {
if (!C || !C.value)
return null;
if (C.value.schema && C.value.schema.type === "component")
return C.value;
const w = S(C == null ? void 0 : C.value.parent), M = c(w);
return M || null;
}
function d(C = t) {
var V;
if (e != null && e.getDraggableDesignItemElement)
return e.getDraggableDesignItemElement(C);
const { componentInstance: w, designerItemElementRef: M } = C;
if (!w || !w.value)
return null;
const { getCustomButtons: y } = w.value;
return w.value.canMove || y && ((V = y()) != null && V.length) ? M : d(C.parent);
}
function f(C) {
return !!e && e.canAccepts(C);
}
function p() {
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
}
function h() {
}
function O(C, w) {
var M;
!C || !w || (e != null && e.onAcceptMovedChildElement && e.onAcceptMovedChildElement(C, w), (M = t == null ? void 0 : t.setupContext) == null || M.emit("dragEnd"));
}
function _(C, w) {
const { componentType: M } = C;
let y = fo(M, C, w);
e && e.onResolveNewComponentSchema && (y = e.onResolveNewComponentSchema(C, y));
const V = M.toLowerCase().replace(/-/g, "_");
return y && !y.id && y.type === M && (y.id = `${V}_${Math.random().toString().slice(2, 6)}`), y;
}
function v(C) {
C && e != null && e.onChildElementMovedOut && e.onChildElementMovedOut(C);
}
function x(...C) {
if (e && e.getPropsConfig)
return e.getPropsConfig(...C);
}
function g(C) {
if (!C)
return;
const w = t == null ? void 0 : t.schema, { formSchemaUtils: M } = C;
if (w && M.getExpressions().length) {
const y = M.getExpressions().findIndex((V) => V.target === w.id);
y > -1 && M.getExpressions().splice(y, 1);
}
}
function T(C) {
e && e.onRemoveComponent && e.onRemoveComponent(), g(C), t != null && t.schema.contents && t.schema.contents.map((w) => {
let M = w.id;
w.type === "component-ref" && (M = w.component);
const y = n.value.querySelectorAll(`#${M}-design-item`);
y != null && y.length && Array.from(y).map((V) => {
var P;
(P = V == null ? void 0 : V.componentInstance) != null && P.value.onRemoveComponent && V.componentInstance.value.onRemoveComponent(C);
});
});
}
function F() {
if (e && e.getCustomButtons)
return e.getCustomButtons();
}
function b(C) {
if (e && e.onPropertyChanged)
return e.onPropertyChanged(C);
}
return a.value = {
canMove: i(),
canSelectParent: s(),
canDelete: l(),
canNested: !u(),
contents: t == null ? void 0 : t.schema.contents,
elementRef: n,
parent: (m = t == null ? void 0 : t.parent) == null ? void 0 : m.componentInstance,
schema: t == null ? void 0 : t.schema,
styles: o,
designerClass: r,
canAccepts: f,
getBelongedComponentInstance: c,
getDraggableDesignItemElement: d,
getDraggingDisplayText: p,
getPropConfig: x,
getDragScopeElement: h,
onAcceptMovedChildElement: O,
onChildElementMovedOut: v,
addNewChildComponentSchema: _,
triggerBelongedComponentToMoveWhenMoved: !!e && e.triggerBelongedComponentToMoveWhenMoved || S(!1),
triggerBelongedComponentToDeleteWhenDeleted: !!e && e.triggerBelongedComponentToDeleteWhenDeleted || S(!1),
onRemoveComponent: T,
getCustomButtons: F,
onPropertyChanged: b
}, a;
}
var ze = /* @__PURE__ */ ((n) => (n[n.readonly = 0] = "readonly", n[n.editable = 1] = "editable", n[n.editing = 2] = "editing", n))(ze || {}), ht = /* @__PURE__ */ ((n) => (n[n.initial = 0] = "initial", n[n.editing = 1] = "editing", n))(ht || {}), Lt = /* @__PURE__ */ ((n) => (n[n.data = 0] = "data", n[n.group = 1] = "group", n[n.summary = 2] = "summary", n))(Lt || {}), nt = /* @__PURE__ */ ((n) => (n[n.none = 0] = "none", n[n.filterable = 1] = "filterable", n[n.sortable = 2] = "sortable", n[n.filtered = 4] = "filtered", n[n.sorted = 8] = "sorted", n[n.ascending = 16] = "ascending", n[n.descending = 32] = "descending", n))(nt || {});
function es(n, t) {
var p;
const e = String(Date.now()), o = ((p = n.rowOption) == null ? void 0 : p.height) || 28, r = S(t.value.primaryColumnsWidth);
function a(h) {
const O = {};
return h.reduce(
(_, v, x) => {
const g = x < h.length - 1 ? h[x + 1] : null;
return x === 0 && (_[v.field] = { left: 0 }), v.actualWidth !== void 0 && (_[v.field].width = v.actualWidth), g && (_[g.field] = {
left: _[v.field].left + (v.actualWidth || 0)
}), _;
},
O
), O;
}
function i(h, O, _) {
const v = o * (_ + 1), g = O[h.field].left - v + (O[h.field].width || 0), T = h.parent.height ? `${h.parent.height}px` : "";
return {
left: `${v}px`,
width: `${g}px`,
height: `${T}`
};
}
function s(h, O, _) {
return {
right: "0px",
height: `${h.parent.height ? `${h.parent.height}px` : ""}`
};
}
function l(h, O) {
const _ = h.parent.height ? `${h.parent.height}px` : "";
return {
left: `${O[h.field].left}px`,
height: `${_}`,
width: isNaN(Number(O[h.field].width)) ? "100%" : `${O[h.field].width}px`
};
}
function u(h, O, _) {
const x = (O.spanned || []).reduce((T, F) => T + (F.parent.height || 0), 0) + (h.height || 0);
return {
top: `${h.top}px`,
left: `${_[O.field].left}px`,
width: `${_[O.field].width}px`,
height: `${x}px`,
padding: `calc(${x / 2}px - 1rem) 0`
// height: `calc(${rowHeight}px * ${cell.rowSpan})`,
// padding: `calc(${rowHeight * cell.rowSpan / 2}px - 1rem) 0`
};
}
function c(h, O) {
return `${e}_${h.type}_r_${h.index}_c_${O}_${h.refreshKey || ""}`;
}
function d(h) {
return `${e}_${h.type}_r_${h.index}_${h.refreshKey || ""}`;
}
function f(h) {
const O = h.height ? `${h.height}px` : "";
return {
top: `${h.top}px`,
width: isNaN(r.value) ? "100%" : `${r.value}px`,
height: `${O}`
};
}
return Fe(t, () => {
r.value = t.value.primaryColumnsWidth;
}), {
calculateCellPositionInRow: a,
cellKey: c,
cellPosition: l,
groupCellPosition: i,
rowKey: d,
rowPosition: f,
rowSpanCellPosition: u,
summaryCellPosition: s
};
}
function ts(n, t, e) {
const { hasChildrenField: o } = e, r = S("#9399a0"), a = S(28);
function i() {
return [].concat(
...t.value.filter((f) => f.raw.__fv_descendant_index__.length !== 0).map((f) => [...f.raw.__fv_descendant_index__.slice(-1)]).flat()
).sort((f, p) => Number(f) - Number(p));
}
function s(c) {
const d = new Array(t.value.length).fill(0);
if (n.showLines) {
const f = i();
t.value.forEach((p, h) => {
const O = f.includes(h), _ = p.raw[o.value];
d[h] = `repeating-linear-gradient(90deg, ${r.value} 0 1px, transparent 0px 2px) ${_ ? "-10px" : "0px"} ${a.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[c];
}
function l(c, d, f) {
return f[c].parents.set(c, !0).forEach((h) => {
f[h].childsLength = f[h].childWithLines.filter((O) => d[O].visible).length;
}), d;
}
function u(c) {
const p = c.raw.__fv_parent_index__ === void 0 || c.raw.__fv_parent_index__ === -1 ? 0 : 8, h = 0, O = c.raw[o.value], _ = `${c.layer * 10 + c.layer * p + h}px`, v = c.visible || ut(c.visible) ? {
paddingLeft: `calc(${_} + 0.75rem)`,
// paddingLeft,
background: s(c.index),
display: "flex",
width: "100%",
position: "relative"
} : {
display: "none"
};
return O || (v.paddingLeft = `calc(${_} + 2rem)`), v;
}
return { hierarchyCellContentStyle: u, handleCollapsedPaddingBottom: l };
}
function ns(n, t, e) {
const o = S(n.iconField);
function r(a, i) {
if (o.value)
return a.raw[n.iconField];
let s = "";
return a.raw[e.value] !== !0 ? s = t.value.leafnodes : s = a.collapse ? t.value.fold : t.value.unfold, s;
}
return { treeNodeIconsClass: r };
}
function os(n, t, e, o, r, a, i, s) {
const { dataView: l, hasRealChildren: u, reOrderVisibleIndex: c } = o, { collapseField: d, hasChildrenField: f } = r, { reCalculateVisualDataRows: p, updateVirticalScroll: h } = a;
function O(_) {
if (_.raw[f.value]) {
const x = l.value[_.raw.__fv_index__];
x[d.value] = !x[d.value], o.toggleChildrenVisibiltyByCollapseStatus(x), x[f.value] = u(x), c(), p(), h();
}
t.emit("expandNode", { row: _ });
}
return { toggleTreeNode: O };
}
function rs(n) {
function t(r) {
return {};
}
function e(r) {
const { valign: a, align: i } = r;
return {
"d-flex": !0,
"h-100": !0,
"w-100": !0,
"justify-content-start": i !== "center" && i !== "right",
"justify-content-center": i === "center",
"justify-content-right": i === "right",
"align-items-start": a !== "middle" && a !== "bottom",
"align-items-center": a === "middle",
"align-items-end": a === "bottom"
};
}
function o(r) {
const { align: a, showEllipsis: i } = r;
return {
"w-100": !0,
"text-left": a !== "center" && a !== "right",
"text-center": a === "center",
"text-right": a === "right",
"text-truncate": i
};
}
return { cellContentPosition: t, cellContentClass: e, cellContentClassWithEllipsis: o };
}
function as(n, t, e, o, r, a, i, s, l, u, c, d, f) {
const {
onClickCell: p
} = a, {
gridCellClass: h,
gridHierarchyCellClass: O,
gridRowClass: _,
onClickRow: v,
onMouseoverRow: x,
onMouseoutRow: g
} = s, {
enableMultiSelect: T,
select: F,
unSelect: b,
selectItem: m
} = l;
S(n.cellHeight);
const C = S(n.treeNodeIconsData || {}), {
hasChildrenField: w,
shouldShowCheckBox: M,
shouldShowIcon: y
} = i, {
toggleTreeNode: V
} = os(n, t, o, r, i, c), {
toggleSelectHierarchyItem: P
} = u, {
cellKey: E,
cellPosition: I,
rowKey: B,
rowPosition: $
} = es(n, e), {
cellContentClass: D,
cellContentPosition: j,
cellContentClassWithEllipsis: K
} = rs(), {
hierarchyCellContentStyle: N
} = ts(n, o, i), {
treeNodeIconsClass: R
} = ns(n, C, w);
function Q(q, te) {
const we = q.raw[w.value];
return {
"fv-tree-node-toggle": we && q.collapse,
"fv-tree-node-toggle-minus": we && !q.collapse
};
}
function G(q, te) {
q.stopPropagation(), V(te);
}
function A(q) {
q.stopPropagation();
}
function z(q, te) {
return k("div", {
class: Q(q),
onClick: (we) => G(we, q),
onDblclick: A
}, null);
}
function U(q, te) {
return y.value && k("div", {
id: "treeNodeIcons",
class: R(q, te)
}, null);
}
function ae(q) {
T.value ? (q.checked ? F(q) : b(q), P(q)) : m(q);
}
function Z(q, te) {
return M.value && k(cn, {
id: "checkbox_for_" + E(q, te.index),
indeterminate: q.indeterminate,
disabled: q.disabled,
checked: q.checked,
"onUpdate:checked": (we) => q.checked = we,
onChange: () => ae(q)
}, null);
}
function fe(q, te) {
return k("span", {
title: te.data,
style: "user-select:none"
}, [t.slots.cellTemplate ? t.slots.cellTemplate({
cell: te,
row: q
}) : te.mode === ze.editing ? te.getEditor(te) : te.formatter ? te.formatter(te, q) : te.data != null ? te.data.toString() : te.data]);
}
function ve(q, te) {
return k("div", {
class: K(te)
}, [te.showTips ? k(Pn, null, {
default: () => fe(q, te),
contentTemplate: () => fe(q, te)
}) : fe(q, te)]);
}
function xe(q, te, we) {
const ke = N(q);
return k("div", {
ref: te.setRef,
key: E(q, te.index),
class: "fv-grid-hierarchy-cell",
style: I(te, we)
}, [k("div", {
class: D(te),
style: ke
}, [z(q), U(q, te), Z(q, te), ve(q, te)])]);
}
function Ve(q, te, we) {
return k("div", {
ref: te.setRef,
key: E(q, te.index),
class: h(te),
style: I(te, we),
onClick: (ke) => p(ke, te, q, te.column)
}, [k("div", {
class: D(te)
}, [k("div", {
class: K(te)
}, [te.showTips ? k(Pn, null, {
default: () => fe(q, te),
contentTemplate: () => fe(q, te)
}) : fe(q, te)])])]);
}
function Be(q, te) {
return te === "left" && e.value.leftColumns.length > 0 && e.value.leftColumns[0].field === q.field || te === "primary" && e.value.primaryColumns.length > 0 && e.value.primaryColumns[0].field === q.field;
}
function Y(q, te) {
t.emit("dblclickNode", {
$event: q,
node: te.raw
});
}
function ce(q, te, we = "primary", ke) {
return k("div", {
ref: q.setRef,
key: B(q),
class: _(q, ke),
style: $(q),
onMouseover: (De) => x(De, q),
onMouseout: (De) => g(De, q),
onClick: (De) => v(De, q),
onDblclick: (De) => Y(De, q)
}, [Object.values(q.data).filter((De) => te[De.field] && De.rowSpan === 1).map((De) => Be(De, we) ? xe(q, De, te) : Ve(q, De, te))]);
}
return {
renderDataRow: ce
};
}
function is(n, t, e) {
const {
horizontalScrollThumbStyle: o,
onMouseDownScrollThumb: r,
shouldShowHorizontalScrollbar: a
} = e;
function i() {
return a.value && k("div", {
class: "fv-grid-horizontal-scroll"
}, [k("div", {
class: "fv-grid-horizontal-scroll-thumb",
style: o.value,
onMousedown: (s) => r(s, t, "horizontal")
}, null)]);
}
return {
renderHorizontalScrollbar: i
};
}
function ss() {
function n(o, r) {
switch (o.command) {
case "edit":
case "remove":
return r.status === ht.initial;
case "accept":
case "cancel":
return r.status === ht.editing;
default:
return !o.hidden;
}
}
function t(o, r, a) {
switch (o.onClick(r, a.dataIndex, a), o.command) {
case "edit":
a.status, ht.editing;
break;
case "accept":
case "cancel":
a.status, ht.initial;
break;
}
}
function e(o, r) {
return o.commands && o.commands.map((a) => n(a, r) && k(ha, {
class: "ml-2",
type: a.type,
size: a.size || "small",
onClick: (i) => t(a, i, r),
style: {
"margin-bottom": "3px"
}
}, {
default: () => [ct(" "), a.text, ct(" ")]
}));
}
return {
renderCommandColumn: e
};
}
function ls(n) {
const t = S(n.minHeight), e = S(n.minWidth), o = S(n.height), r = S(n.width), a = L(() => o.value <= 0 ? 0 : Math.max(o.value, t.value)), i = L(() => r.value <= 0 ? 0 : Math.max(r.value, e.value));
return Fe([
() => n.height,
() => n.width,
() => n.minHeight,
() => n.minWidth
], ([l, u, c, d]) => {
t.value = Number(c), e.value = Number(d), o.value = Number(l), r.value = Number(u);
}), { containerStyleObject: L(() => ({
height: a.value > 0 ? `${a.value}px` : n.fit ? "100%" : "",
width: i.value > 0 ? `${i.value}px` : n.fit ? "100%" : "",
flex: "1 1 0"
})) };
}
S([{
name: "七天",
selectable: !0
}, {
name: "一个月",
selectable: !0
}, {
name: "三个月",
selectable: !0
}, {
name: "半年",
selectable: !0
}]);
function us(n) {
const e = S(n.commandOption.enable || !1), o = S(n.commandOption.commands || []);
function r(a) {
if (e.value && !(a.value.findIndex((s) => s.dataType === "commands") > -1)) {
const s = {
field: "__commands__",
title: "操作",
width: 120,
fixed: "right",
dataType: "commands",