UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,828 lines 379 kB
var Bo = Object.defineProperty; var Vo = (n, t, e) => t in n ? Bo(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e; var R = (n, t, e) => Vo(n, typeof t != "symbol" ? t + "" : t, e); import { ref as S, watch as Ee, createVNode as M, createTextVNode as Nt, computed as q, defineComponent as rt, Fragment as Ut, reactive as yt, createApp as Wn, onUnmounted as rn, onMounted as Lt, Transition as Ln, mergeProps as Bt, onBeforeUnmount as $n, withDirectives as Ro, resolveDirective as Ho, inject as Rt, provide as Wo, triggerRef as Lo, isVNode as $o, nextTick as an, onBeforeMount as jo, Teleport as Ao, shallowRef as qo, render as sn, h as zo, cloneVNode as Go } from "vue"; import { useResizeObserver as jn } from "@vueuse/core"; import { isPlainObject as kn, cloneDeep as Tt, isUndefined as ut, throttle as Yo } from "lodash-es"; import { useIdentify as Uo, useGroupData as Xo, useFilter as Qo, useHierarchy as Ko, useLoading as Jo, useDataView as Zo, useSelection as er, useSelectHierarchyItem as tr, useDataViewContainerStyle as nr, useCommandColumn as or, useColumn as rr, useSort as ar, useGroupColumn as ir, useRow as sr, useEdit as lr, useVisualDataBound as ur, useVisualDataCell as cr, useVisualDataRow as dr, useVisualData as fr, useCellPosition as mr, useSidebar as pr, useVirtualScroll as hr, useFitColumn as vr, useFilterHistory as gr, useColumnFilter as yr, useDragColumn as br, getColumnHeader as wr, getSidebar as Cr, getDisableMask as _r, getHorizontalScrollbar as xr, getVerticalScrollbar as Sr, getEmpty as Tr } from "../data-view/index.esm.js"; import "../modal/index.esm.js"; import kr from "../transfer/index.esm.js"; import Er from "../tabs/index.esm.js"; import Fr from "../order/index.esm.js"; import "../condition/index.esm.js"; import { FCheckbox as Mr } from "../checkbox/index.esm.js"; import { useGuid as Or, resolveField as ot, FormSchemaEntityFieldTypeName as En, getCustomClass as ln, useCommonUtils as Ir, useDateFormat as Dr, useNumberFormat as Pr, setFieldValue as dn, withInstall as Nr } from "../common/index.esm.js"; import Br from "../filter-bar/index.esm.js"; import Fn from "../tooltip/index.esm.js"; import Vr from "../pagination/index.esm.js"; import Rr from "../button/index.esm.js"; import Hr from "../search-box/index.esm.js"; import Wr from "../tags/index.esm.js"; import Lr, { FDynamicFormGroup as $r, FDynamicFormInput as jr } from "../dynamic-form/index.esm.js"; import { createPropsResolver as Ar } from "../dynamic-resolver/index.esm.js"; import "../designer-canvas/index.esm.js"; import "../property-panel/index.esm.js"; import qr from "../accordion/index.esm.js"; import zr from "../avatar/index.esm.js"; import Gr from "../../designer/button-edit/index.esm.js"; import Yr from "../button-group/index.esm.js"; import Ur from "../calendar/index.esm.js"; import Xr from "../capsule/index.esm.js"; import Mn from "../../designer/checkbox/index.esm.js"; import On from "../../designer/checkbox-group/index.esm.js"; import fn from "../combo-list/index.esm.js"; import Qr from "../combo-tree/index.esm.js"; import Kr from "../component/index.esm.js"; import Jr from "../color-picker/index.esm.js"; import Zr from "../content-container/index.esm.js"; import ea from "../date-picker/index.esm.js"; import ta from "../../designer/data-grid/index.esm.js"; import na from "../dropdown/index.esm.js"; import oa from "../events-editor/index.esm.js"; import ra from "../field-selector/index.esm.js"; import aa from "../binding-selector/index.esm.js"; import ia from "../image-cropper/index.esm.js"; import sa from "../../designer/input-group/index.esm.js"; import la from "../layout/index.esm.js"; import ua from "../list-nav/index.esm.js"; import ca from "../list-view/index.esm.js"; import da from "../lookup/index.esm.js"; import fa from "../mapping-editor/index.esm.js"; import ma from "../nav/index.esm.js"; import pa from "../number-range/index.esm.js"; import ha from "../number-spinner/index.esm.js"; import va from "../page-header/index.esm.js"; import ga from "../page-footer/index.esm.js"; import ya from "../progress/index.esm.js"; import ba from "../query-solution/index.esm.js"; import wa from "../../designer/radio-group/index.esm.js"; import Ca from "../rate/index.esm.js"; import _a from "../response-toolbar/index.esm.js"; import xa from "../response-layout/index.esm.js"; import Sa from "../response-layout-editor/index.esm.js"; import Ta from "../section/index.esm.js"; import ka from "../smoke-detector/index.esm.js"; import Ea from "../splitter/index.esm.js"; import Fa from "../step/index.esm.js"; import Ma from "../switch/index.esm.js"; import Oa from "../text/index.esm.js"; import Ia from "../time-picker/index.esm.js"; import Da from "../tree-view/index.esm.js"; import Pa from "../uploader/index.esm.js"; import Na from "../verify-detail/index.esm.js"; import Ba from "../video/index.esm.js"; import Va from "../textarea/index.esm.js"; import Ra from "../schema-selector/index.esm.js"; import Ha from "../tree-grid/index.esm.js"; import Wa from "../event-parameter/index.esm.js"; import La from "../filter-condition-editor/index.esm.js"; import $a from "../fieldset/index.esm.js"; import ja from "../sort-condition-editor/index.esm.js"; import Aa from "../menu-lookup/index.esm.js"; import qa from "../drawer/index.esm.js"; import za from "../json-editor/index.esm.js"; import Ga from "../property-editor/index.esm.js"; import Ya from "../expression-editor/index.esm.js"; import Ua from "../code-editor/index.esm.js"; import Xa from "../html-template/index.esm.js"; import "../external-container/index.esm.js"; import "../notify/index.esm.js"; const An = {}, qn = {}; function gn(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 ? gn(t[s]) : Tt(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 Qa(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 ? gn(t[i]) : Tt(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 zn(n, t = {}, e) { const o = An[n]; if (o) { let r = Qa(o); const a = qn[n]; return r = a ? a({ getSchemaByType: zn }, r, t, e) : r, r; } return null; } function Ka(n, t) { const e = gn(t); return Object.keys(e).reduce((o, r) => (Object.prototype.hasOwnProperty.call(n, r) && (o[r] && kn(o[r]) && kn(n[r] || !n[r]) ? Object.assign(o[r], n[r] || {}) : o[r] = n[r]), o), e), e; } function Gn(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 Ja(n, t, e = /* @__PURE__ */ new Map()) { const o = Ka(n, t); return Gn(o, e); } function Za(n = {}) { function t(u, c, d, m) { if (typeof d == "number") return m[u].length === d; if (typeof d == "object") { const p = Object.keys(d)[0], h = d[p]; if (p === "not") return Number(m[u].length) !== Number(h); if (p === "moreThan") return Number(m[u].length) >= Number(h); if (p === "lessThan") return Number(m[u].length) <= Number(h); } return !1; } function e(u, c, d, m) { return m[u] && m[u].propertyValue && String(m[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((m) => { if (m === "length") return { target: d, operator: "length", param: null, value: c[m] }; const p = m, h = c[m]; return { target: d, operator: "getProperty", param: p, value: h }; }) : []; } function a(u) { return Object.keys(u).reduce((d, m) => { const p = r(m, u[m]); 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), m = d.includes("allOf"), p = d.includes("anyOf"), h = m || p, y = (h ? u[h ? m ? "allOf" : "anyOf" : "allOf"] : [u]).map((g) => s(g, c)); return m ? !y.includes(!1) : y.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: "筛选条" } }, ei = {}, ti = {}; Za(); function $t(n, t, e = /* @__PURE__ */ new Map(), o = (i, s, l, u) => s, r = {}, a = (i) => i) { return An[t.title] = t, qn[t.title] = o, ei[t.title] = r, ti[t.title] = a, (i = {}, s = !0) => { if (!s) return Gn(i, e); const l = Ja(i, t, e), u = Object.keys(n).reduce((c, d) => (c[d] = n[d].default, c), {}); return Object.assign(u, l); }; } function yn(n, t) { return { customClass: t.class, customStyle: t.style }; } function ni() { function n(t, e) { const { dataSource: o } = t || {}; return o === void 0 ? {} : {}; } return { resolve: n }; } function oi() { function n(t, e) { return t.selectItemById(e); } return { selectItemById: n }; } function ri() { function n(t, e) { const { columns: o } = e; return t.updateColumns(o); } return { updateColumns: n }; } const Yn = /* @__PURE__ */ new Map([ ["appearance", yn], ["column", "columnOption"] ]); function ai(n, t, e) { var d; const o = e.parentComponentInstance, r = o.schema.type, a = String(((d = o.schema.appearance) == null ? void 0 : d.class) || "").split(" "), i = r === "section" || r === "tab-page", s = a.includes("f-page-content-nav"), l = a.includes("f-page-main"), u = n.getSchemaByType("component"); u.id = `${t.id}-component`, u.componentType = "data-grid"; let c = ""; return c += i ? "f-struct-data-grid-in-card f-struct-is-subgrid" : "", c += s ? "f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column" : "", c += l ? "f-struct-data-grid f-struct-wrapper" : "", u.appearance = { class: c }, u.contents = [t], u; } function ii(n, t, e) { const o = e.parentComponentInstance, r = String(o.schema.appearance.class || "").split(" "), a = r.includes("f-page-content-nav"), i = r.includes("f-page-main"), s = n.getSchemaByType("section"); s.id = `${t.id}-section`; let l = ""; return l += a ? "f-section-in-nav " : "", l += i ? "f-section-in-managelist " : "", l += "f-section-grid", s.appearance = { class: l }, s.contents = [t], s; } function si(n, t, e) { const o = n.getSchemaByType("content-container"); return o.id = `${t.id}-layout`, o.appearance = { class: "f-grid-is-sub f-utils-flex-column" }, o.contents = [t], o; } function Un(n, t, e) { const r = e.parentComponentInstance.schema.type, a = r === "section" || r === "tab-page"; t.appearance = { class: "f-component-grid" }; const s = (a ? si : ii)(n, t, e); return ai(n, s, e); } const li = "https://json-schema.org/draft/2020-12/schema", ui = "https://farris-design.gitee.io/tree-grid.schema.json", ci = "tree-grid", di = "A Farris Data Grid Component", fi = "object", mi = { id: { description: "The unique identifier for a Input Group", type: "string" }, type: { description: "The type string of Input Group component", type: "string", default: "tree-grid" }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} }, fit: { type: "boolean", default: !1 }, showStripe: { type: "boolean", default: !0 }, showBorder: { type: "boolean", default: !1 }, showTreeNodeIcons: { type: "boolean", default: !1 }, showSetting: { type: "boolean", default: !1 }, size: { description: "", type: "object", properties: { width: { type: "number" }, height: { type: "number" } }, default: null }, dataSource: { description: "", type: "string", default: "" }, columns: { description: "", type: "array", default: [] }, identifyField: { description: "", type: "string" }, editable: { description: "", type: "boolean", default: !1 }, disabled: { description: "", type: "boolean", default: !1 }, visible: { description: "", type: "boolean", default: !0 }, cell: { type: "object", properties: { highlightFocusingCell: { description: "", type: "boolean", default: !1 }, mergeCell: { description: "", type: "boolean", default: !1 }, showEditableIcon: { description: "", type: "boolean", default: !1 } } }, column: { type: "object", properties: { fitColumns: { description: "", type: "boolean", default: !1 }, fitMode: { description: "", type: "string", default: "average" }, groups: { description: "", type: "array", default: [] }, reorderColumn: { description: "Enable to drag column to reorder", type: "boolean", default: !1 }, resizeColumn: { type: "boolean", default: !0 }, resizeColumnOnDoubleClick: { description: "", type: "boolean", default: !0 } } }, command: { type: "object", properties: { enable: { description: "", type: "boolean", default: !1 }, commands: { type: "array", default: [] }, commandColumnWidth: { description: "", type: "number", default: 120 }, onClickDeleteCommand: { description: "", type: "string", default: "" }, onClickEditCommand: { description: "", type: "string", default: "" } } }, contextMenu: { description: "", type: "object", properties: { enable: { description: "", type: "boolean", default: !1 } } }, customizaiton: { type: "object", properties: { enableScheme: { description: "", type: "boolean", default: !1 }, enableSetting: { description: "", type: "boolean", default: !1 } } }, edit: { type: "obejct", properties: { mode: { description: "", type: "string", default: "cell", enum: [ "cell", "row", "card" ] }, selectOnEditing: { description: "", type: "boolean", default: !1 }, onAppendRow: { description: "", type: "string", default: "" }, onBeforeEdit: { description: "", type: "string", default: "" } } }, filter: { type: "object", properties: { enable: { description: "", type: "boolean", default: !1 }, filterStyle: { description: "", type: "string", default: "filter-column", enum: [ "filter-column", "filter-row" ] }, mode: { description: "", type: "string", default: "server", enum: [ "client", "server" ] }, showSummary: { description: "", type: "boolean", default: !0 }, onFilterChange: { description: "", type: "string", default: "" } } }, footer: { type: "object", properties: { enable: { description: "", type: "boolean", default: !1 }, customFooterStyle: { description: "", type: "object" }, footerDataCommand: { description: "", type: "string", default: "" }, footerDataFrom: { description: "", type: "string", default: "client" }, footerHeight: { description: "", type: "number", default: 29 }, footerPosition: { description: "", type: "string", default: "bottom" }, footerTemplate: { description: "", type: "string", default: "" } } }, group: { description: "", type: "object", properties: { enable: { description: "", type: "boolean", default: !1 }, customGroupRow: { description: "", type: "object" }, customGroupRowStyle: { description: "", type: "obejct" }, customSummaryStyle: { description: "", type: "obejct" }, groupColSpan: { description: "", type: "number", default: 1 }, groupFields: { description: "", type: "array", default: [] }, showGroupedColumn: { description: "", type: "boolean", default: !0 }, showGroupPanel: { description: "", type: "boolean", default: !1 }, showSummary: { description: "", type: "boolean", default: !1 }, summaryPosition: { description: "", type: "string", default: "separate", enum: [ "separate", "merge-to-group" ] }, disableGroupOnEditing: { description: "", type: "boolean", default: !0 }, expandGroupRows: { description: "", type: "boolean", default: !0 } } }, header: { type: "object", properties: { wrapHeadings: { description: "", type: "boolean", default: !1 } } }, pagination: { type: "object", properties: { enable: { description: "", type: "boolean", default: !1 }, disablePagination: { description: "", type: "string", default: "" }, contentTemplate: { description: "", type: "string", default: "" }, index: { description: "", type: "number", default: 1 }, mode: { description: "", type: "string", default: "server", enum: [ "server", "client" ] }, showGoto: { description: "", type: "boolean", default: !1 }, showIndex: { description: "", type: "boolean", default: !0 }, showLimits: { description: "", type: "boolean", default: !1 }, showPageInfo: { description: "", type: "boolean", default: !0 }, size: { description: "", type: "number", default: 20 }, sizeLimits: { description: "", type: "array", default: [ 10, 20, 30, 50, 100 ] }, onPageChange: { description: "", type: "string", default: "" }, onPageSizeChange: { description: "", type: "string", default: "" } } }, row: { type: "object", properties: { customRowStyle: { description: "", type: "object" }, disable: { description: "", type: "obejct" }, height: { description: "", type: "number", default: 30 }, showHovering: { type: "boolean", default: !0 }, wrapContent: { type: "boolean", default: !1 } } }, rowNumber: { description: "", type: "object", properties: { enable: { description: "", type: "boolean", default: !1 }, heading: { description: "", type: "string", default: "序号" }, width: { description: "", type: "number", default: 36 }, onClickRow: { description: "", type: "string", default: "" }, onDoubleClickRow: { description: "", type: "string", default: "" } } }, selection: { type: "object", properties: { enableSelectRow: { description: "允许选中行", type: "boolean", default: !0 }, enable: { description: "", type: "boolean", default: !0 }, checkOnSelect: { description: "", type: "boolean", default: !1 }, clearSelectionOnEmpty: { description: "", type: "boolean", default: !0 }, customSelectionItem: { description: "", type: "object" }, focusSelection: { description: "", type: "string", default: "current", enum: [ "current", "all" ] }, keepSelectingOnClick: { description: "", type: "boolean", default: !0 }, keepSelectingOnPaging: { description: "", type: "boolean", default: !0 }, multiSelect: { description: "", type: "boolean", default: !1 }, selectionMode: { description: "", type: "string", default: "default" }, selectOnCheck: { description: "", type: "boolean", default: !1 }, selectOnEditing: { description: "", type: "boolean", default: !1 }, showCheckbox: { description: "", type: "boolean", default: !1 }, showCheckAll: { description: "", type: "boolean", default: !1 }, showSelection: { description: "", type: "boolean", default: !1 }, onBeforeSelect: { description: "", type: "string", default: "" }, onBeforeUnCheck: { description: "", type: "", default: "" }, onBeforeUnSelect: { description: "", type: "string", default: "" }, onCheckAll: { description: "", type: "string", default: "" }, onChecked: { description: "", type: "string", default: "" }, onSelectionChange: { description: "", type: "string", default: "" }, onUnCheckAll: { description: "", type: "string", default: "" }, onUnChecked: { description: "", type: "string", default: "" }, onCheckedChange: { description: "", type: "string" } } }, sort: { type: "object", properties: { enable: { description: "", type: "boolean", default: !1 }, fields: { description: "", type: "array", default: [] }, mode: { description: "", type: "string", default: "client", enum: [ "client", "server" ] }, multiSort: { description: "", type: "boolean", default: !1 } } }, summary: { description: "", type: "object", properties: { enable: { description: "", type: "boolean", default: !1 }, customSummaryStyle: { description: "", type: "object" }, groupFields: { description: "", type: "array", default: [] }, mode: { description: "", type: "string", default: "client", enum: [ "client", "server" ] }, position: { description: "", type: "boolean", default: "bottom", enum: [ "bottom", "top", "both" ] } } }, toolbar: { description: "", type: "object", properties: { enable: { description: "", type: "boolean", default: !1 } } }, visualization: { autoHeight: { description: "", type: "boolean", default: !1 }, emptyDataHeight: { description: "", type: "number", default: 36 }, emptyTemplate: { description: "", type: "string", default: "" }, maxHeight: { description: "", type: "number", default: 300 }, scrollBarShowMode: { description: "", type: "string", default: "auto" }, showBorder: { description: "", type: "boolean", default: !1 }, showScrollArrow: { description: "", type: "boolean", default: !1 }, striped: { description: "", type: "boolean", default: !0 }, useBlankWhenDataIsEmpty: { description: "", type: "boolean", default: !1 } }, onSelectionChange: { description: "行切换事件", type: "string", default: "" } }, pi = [ "id", "type", "columns" ], hi = { onSelectionChange: "行切换事件", onClickRow: "行点击事件" }, Xn = { $schema: li, $id: ui, title: ci, description: di, type: fi, properties: mi, required: pi, events: hi }, qf = { /** 启用分页 */ 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 } }, zf = { /** 启用排序 */ enable: { type: Boolean, default: !1 }, /** 排序字段集合 */ fields: { type: Array, default: [] }, /** 排序交互模式 */ mode: { type: String, default: "client" }, /** 多列排序 */ multiSort: { type: Boolean, default: !1 } }, Gf = { /** 自定义分组合计内容 */ 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" } }, Yf = { /** 启用筛选 */ enable: { type: Boolean, default: !1 }, /** DataGrid筛选风格 */ filterStyle: { type: String, default: "filter-column" }, /** 筛选交互模式 */ mode: { type: String, default: "server" }, /** 显示过滤条件工具条 */ showSummary: { type: Boolean, default: !0 } }, Uf = { /** 允许折行显示列标题 */ wrapHeadings: { type: Boolean, default: !1 } }, Xf = { /** 自定义行样式 */ customRowStyle: { type: Function, default: () => { } }, /** 禁止行选中表达式 */ disable: { type: Function, default: () => { } }, /** 默认行高度为 29px */ height: { type: Number, default: 28 }, /** 鼠标滑过行效果 */ showHovering: { type: Boolean, default: !0 }, /** 禁止数据折行 */ wrapContent: { type: Boolean, default: !1 } }, Qf = { /** 显示合计信息 */ 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" } }, Kf = { /** 自动列宽。设为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 } }, Jf = { /** 编辑时选中文本 */ selectOnEditing: { type: Boolean, default: !1 }, /** 编辑模式; row:整行编辑,cell: 单元格编辑 */ editMode: { type: String, default: "cell" } }, Zf = { /** show loading */ show: { type: Boolean, default: !1 }, /** message on display when loading */ message: { type: String, default: "加载中..." } }, bn = { /** 自动勾选子节点 */ 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 }, // 是否展示 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: 32, heading: "序号" } }, /** 行配置 */ rowOption: { type: Object, default: { wrapContent: !1 } }, /** 选择配置 */ selection: { type: Object, default: { enableSelectRow: !0, multiSelect: !1, multiSelectMode: "DependOnCheck", showCheckbox: !1, showSelectAll: !1, showSelection: !0 } }, /** 已选数据标识 */ 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 } }, vi = $t(bn, Xn, Yn, Un), gi = oi(), yi = ni(), Qn = Object.assign({}, bn, { componentId: { type: String, default: "" } }), bi = $t(Qn, Xn, Yn, Un), wi = ri(); var tt = /* @__PURE__ */ ((n) => (n[n.readonly = 0] = "readonly", n[n.editable = 1] = "editable", n[n.editing = 2] = "editing", n))(tt || {}), pt = /* @__PURE__ */ ((n) => (n[n.initial = 0] = "initial", n[n.editing = 1] = "editing", n))(pt || {}), zt = /* @__PURE__ */ ((n) => (n[n.data = 0] = "data", n[n.group = 1] = "group", n[n.summary = 2] = "summary", n))(zt || {}), et = /* @__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))(et || {}); function Ci(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( (x, y, b) => { const g = b < h.length - 1 ? h[b + 1] : null; return b === 0 && (x[y.field] = { left: 0 }), y.actualWidth !== void 0 && (x[y.field].width = y.actualWidth), g && (x[g.field] = { left: x[y.field].left + (y.actualWidth || 0) }), x; }, O ), O; } function i(h, O, x) { const y = o * (x + 1), g = O[h.field].left - y + (O[h.field].width || 0), _ = h.parent.height ? `${h.parent.height}px` : ""; return { left: `${y}px`, width: `${g}px`, height: `${_}` }; } function s(h, O, x) { return { right: "0px", height: `${h.parent.height ? `${h.parent.height}px` : ""}` }; } function l(h, O) { const x = h.parent.height ? `${h.parent.height}px` : ""; return { left: `${O[h.field].left}px`, height: `${x}`, width: isNaN(Number(O[h.field].width)) ? "100%" : `${O[h.field].width}px` }; } function u(h, O, x) { const b = (O.spanned || []).reduce((_, T) => _ + (T.parent.height || 0), 0) + (h.height || 0); return { top: `${h.top}px`, left: `${x[O.field].left}px`, width: `${x[O.field].width}px`, height: `${b}px`, padding: `calc(${b / 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 m(h) { const O = h.height ? `${h.height}px` : ""; return { top: `${h.top}px`, width: isNaN(r.value) ? "100%" : `${r.value}px`, height: `${O}` }; } return Ee(t, () => { r.value = t.value.primaryColumnsWidth; }), { calculateCellPositionInRow: a, cellKey: c, cellPosition: l, groupCellPosition: i, rowKey: d, rowPosition: m, rowSpanCellPosition: u, summaryCellPosition: s }; } function _i(n, t, e) { const { hasChildrenField: o } = e, r = S("#9399a0"), a = S(28); function i() { return [].concat( ...t.value.filter((m) => m.raw.__fv_descendant_index__.length !== 0).map((m) => [...m.raw.__fv_descendant_index__.slice(-1)]).flat() ).sort((m, p) => Number(m) - Number(p)); } function s(c) { const d = new Array(t.value.length).fill(0); if (n.showLines) { const m = i(); t.value.forEach((p, h) => { const O = m.includes(h), x = p.raw[o.value]; d[h] = `repeating-linear-gradient(90deg, ${r.value} 0 1px, transparent 0px 2px) ${x ? "-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, m) { return m[c].parents.set(c, !0).forEach((h) => { m[h].childsLength = m[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], x = `${c.layer * 10 + c.layer * p + h}px`, y = c.visible || ut(c.visible) ? { paddingLeft: `calc(${x} + 0.75rem)`, // paddingLeft, background: s(c.index), display: "flex", width: "100%", position: "relative" } : { display: "none" }; return O || (y.paddingLeft = `calc(${x} + 2rem)`), y; } return { hierarchyCellContentStyle: u, handleCollapsedPaddingBottom: l }; } function xi(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 Si(n, t, e, o, r, a, i, s) { const { dataView: l, hasRealChildren: u, reOrderVisibleIndex: c } = o, { collapseField: d, hasChildrenField: m } = r, { reCalculateVisualDataRows: p, updateVirticalScroll: h } = a; function O(x) { if (x.raw[m.value]) { const b = l.value[x.raw.__fv_index__]; b[d.value] = !b[d.value], o.toggleChildrenVisibiltyByCollapseStatus(b), b[m.value] = u(b), c(), p(), h(); } t.emit("expandNode", { row: x }); } return { toggleTreeNode: O }; } function Ti(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 ki(n, t, e, o, r, a, i, s, l, u, c, d, m) { const { onClickCell: p } = a, { gridCellClass: h, gridHierarchyCellClass: O, gridRowClass: x, onClickRow: y, onMouseoverRow: b, onMouseoutRow: g } = s, { enableMultiSelect: _, select: T, unSelect: k, selectItem: f } = l; S(n.cellHeight); const C = S(n.treeNodeIconsData || {}), { hasChildrenField: w, shouldShowCheckBox: E, shouldShowIcon: v } = i, { toggleTreeNode: D } = Si(n, t, o, r, i, c), { toggleSelectHierarchyItem: P } = u, { cellKey: F, cellPosition: I, rowKey: z, rowPosition: $ } = Ci(n, e), { cellContentClass: V, cellContentPosition: L, cellContentClassWithEllipsis: Q } = Ti(), { hierarchyCellContentStyle: B } = _i(n, o, i), { treeNodeIconsClass: N } = xi(n, C, w); function X(A, te) { const be = A.raw[w.value]; return { "fv-tree-node-toggle": be && A.collapse, "fv-tree-node-toggle-minus": be && !A.collapse }; } function j(A, te) { A.stopPropagation(), D(te); } function W(A) { A.stopPropagation(); } function G(A, te) { return M("div", { class: X(A), onClick: (be) => j(be, A), onDblclick: W }, null); } function K(A, te) { return v.value && M("div", { id: "treeNodeIcons", class: N(A, te) }, null); } function ae(A) { _.value ? (A.checked ? T(A) : k(A), P(A)) : f(A); } function Z(A, te) { return E.value && M(Mr, { id: "checkbox_for_" + F(A, te.index), indeterminate: A.indeterminate, disabled: A.disabled, checked: A.checked, "onUpdate:checked": (be) => A.checked = be, onChange: () => ae(A) }, null); } function fe(A, te) { return M("span", { title: te.data, style: "user-select:none" }, [t.slots.cellTemplate ? t.slots.cellTemplate({ cell: te, row: A }) : te.mode === tt.editing ? te.getEditor(te) : te.formatter ? te.formatter(te, A) : te.data != null ? te.data.toString() : te.data]); } function ve(A, te) { return M("div", { class: Q(te) }, [te.showTips ? M(Fn, null, { default: () => fe(A, te), contentTemplate: () => fe(A, te) }) : fe(A, te)]); } function xe(A, te, be) { const ke = B(A); return M("div", { ref: te.setRef, key: F(A, te.index), class: "fv-grid-hierarchy-cell", style: I(te, be) }, [M("div", { class: V(te), style: ke }, [G(A), K(A, te), Z(A, te), ve(A, te)])]); } function Pe(A, te, be) { return M("div", { ref: te.setRef, key: F(A, te.index), class: h(te), style: I(te, be), onClick: (ke) => p(ke, te, A, te.column) }, [M("div", { class: V(te) }, [M("div", { class: Q(te) }, [te.showTips ? M(Fn, null, { default: () => fe(A, te), contentTemplate: () => fe(A, te) }) : fe(A, te)])])]); } function Re(A, te) { return te === "left" && e.value.leftColumns.length > 0 && e.value.leftColumns[0].field === A.field || te === "primary" && e.value.primaryColumns.length > 0 && e.value.primaryColumns[0].field === A.field; } function Y(A, te) { t.emit("dblclickNode", { $event: A, node: te.raw }); } function ce(A, te, be = "primary", ke) { return M("div", { ref: A.setRef, key: z(A), class: x(A, ke), style: $(A), onMouseover: (De) => b(De, A), onMouseout: (De) => g(De, A), onClick: (De) => y(De, A), onDblclick: (De) => Y(De, A) }, [Object.values(A.data).filter((De) => te[De.field] && De.rowSpan === 1).map((De) => Re(De, be) ? xe(A, De, te) : Pe(A, De, te))]); } return { renderDataRow: ce }; } function Ei(n, t, e) { const { horizontalScrollThumbStyle: o, onMouseDownScrollThumb: r, shouldShowHorizontalScrollbar: a } = e; function i() { return a.value && M("div", { class: "fv-grid-horizontal-scroll" }, [M("div", { class: "fv-grid-horizontal-scroll-thumb", style: o.value, onMousedown: (s) => r(s, t, "horizontal") }, null)]); } return { renderHorizontalScrollbar: i }; } function Fi() { function n(o, r) { switch (o.command) { case "edit": case "remove": return r.status === pt.initial; case "accept": case "cancel": return r.status === pt.editing; default: return !o.hidden; } } function t(o, r, a) { switch (o.onClick(r, a.dataIndex, a), o.command) { case "edit": a.status, pt.editing; break; case "accept": case "cancel": a.status, pt.initial; break; } } function e(o, r) { return o.commands && o.commands.map((a) => n(a, r) && M(Rr, { class: "ml-2", type: a.type, size: a.size || "small", onClick: (i) => t(a, i, r), style: { "margin-bottom": "3px" } }, { default: () => [Nt(" "), a.text, Nt(" ")] })); } return { renderCommandColumn: e }; } function Mi(n) { const t = S(n.minHeight), e = S(n.minWidth), o = S(n.height), r = S(n.width), a = q(() => o.value <= 0 ? 0 : Math.max(o.value, t.value)), i = q(() => r.value <= 0 ? 0 : Math.max(r.value, e.value)); return Ee([ () => 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: q(() => ({ 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 Oi(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", commands: o.value, visible: !0 }; a.value.push(s); } } return { applyCommands: r }; } function Ii(n, t) { var u; const e = S((u = n.columnOption) == null ? void 0 : u.groups); function o(c, d, m, p, h) { const O = { actualWidth: 0, children: [], depth: 1, field: c.field, layer: 1, left: 0, parent: m, resizable: !0, title: c.title || "", status: et.none, popoverRef: S(), showPopover: !1, column: null, sortType: "none" }, x = p || O; if (c.group) { let y = 1; c.group.reduce((b, g) => { if (typeof g == "string") { const _ = d.get(g); _ && (h.fieldToRootMap.set(g, x), b.actualWidth += _.actualWidth, b.children.push(_)); } else { const _ = o(g, d, b, x, h); y = Math.max(y, _.depth), b.actualWidth += _.actualWidth, b.children.push(_); } return b; }, O), O.depth += y; } return t.value.headerDepth = Math.max(t.value.headerDepth, O.depth), O; } function r(c) { const d = { groupedCells: /* @__PURE__ */ new Map(), fieldToRootMap: /* @__PURE__ */ new Map() }; return e.value && e.value.reduce((m, p) => { const h = o(p, c, null, null, d); return m.groupedCells.set(p.field, h), m; }, d), d; } function a(c) { if (!c || c.length === 0) return 0; const d = c[0]; return d.children && d.children.length > 0 && (d.left = a(d.children)), d.left; } function i(c, d) { const m = t.value.headerDepth; c.forEach((p) => { p.layer = d ? d.layer + 1 : 1; const h = p.children && p.children.length === 0; p.depth = h ? m - (p.layer - 1) : 1, p.left = h ? p.left : a(p.children), p.children && i(p.children, p); }); } function s(c, d) { const m = /* @__PURE__ */ new Map(); return c.forEach((p) => { const h = d.fieldToRootMap.get(p.field), O = h != null; O && !m.has(h.field) && m.set(h.field, h), O || m.set(p.field, p); }), i