UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,325 lines 503 kB
var ei = Object.defineProperty; var ti = (t, e, n) => e in t ? ei(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; var se = (t, e, n) => ti(t, typeof e != "symbol" ? e + "" : e, n); import { excludeProperties as ni, useGuid as en, useNumberFormat as $n, resolveField as qe, useCommonUtils as An, useDateFormat as oi, setFieldValue as cn, getCustomClass as ht, withInstall as Ln, FormSchemaEntityField$Type as gt, FormSchemaEntityFieldTypeName as mt, FormSchemaEntityFieldType$Type as on, getCustomStyle as Mn } from "../../components/common/index.esm.js"; import ii, { dataGridProps as ri } from "../../components/data-grid/index.esm.js"; import { getSchemaByTypeForDesigner as ai, resolveAppearance as li, createPropsResolver as mn, createCollectionBindingResolver as si, createDataGridSelectionItemResolver as ui, createDataViewUpdateColumnsResolver as ci } from "../../components/dynamic-resolver/index.esm.js"; import { computed as A, watch as we, ref as S, createVNode as I, createTextVNode as dt, defineComponent as Ue, Fragment as it, reactive as vt, createApp as pn, onUnmounted as Yt, onMounted as Ke, Transition as Hn, mergeProps as Nt, inject as Le, provide as jn, triggerRef as di, onBeforeUnmount as Dn, isVNode as fi, nextTick as Tt, Teleport as Wn, onBeforeMount as mi, shallowRef as pi, render as ln, h as vi, cloneVNode as hi, withDirectives as zn, vShow as gi, onUpdated as yi, withModifiers as bi, vModelText as Ci } from "vue"; import { useResizeObserver as Gn } from "@vueuse/core"; import wi from "../../components/popover/index.esm.js"; import { useI18n as yt } from "vue-i18n"; import "../../components/modal/index.esm.js"; import { cloneDeep as Lt, throttle as Si, isUndefined as ut, isPlainObject as Fn, debounce as Ti } from "lodash-es"; import "../../components/transfer/index.esm.js"; import "../../components/tabs/index.esm.js"; import { FCheckbox as vn } from "../../components/checkbox/index.esm.js"; import "../../components/filter-bar/index.esm.js"; import "../../components/pagination/index.esm.js"; import xn from "../../components/button/index.esm.js"; import "../../components/list-view/index.esm.js"; import "../../components/date-picker/index.esm.js"; import "../../components/number-spinner/index.esm.js"; import "../../components/search-box/index.esm.js"; import Mi from "../../components/tags/index.esm.js"; import { LocaleService as rn } from "../../components/locale/index.esm.js"; import { useCondition as Fi, CompareType as at, ValueType as Xt, TextValue as sn, RadioGroupValue as xi, NumberSpinnerValue as _i, NumberRangeValue as Ei, MonthRangeValue as ki, MonthPickerValue as Ii, DateRangeValue as _n, DateTimePickerValue as Pi, DatePickerValue as Bi, ComboLookupValue as Vi, ComboListValue as Oi, CheckBoxValue as Ni } from "../../components/condition/index.esm.js"; import { FDynamicFormInput as Ri } from "../../components/dynamic-form/index.esm.js"; import "../../components/accordion/index.esm.js"; import "../../components/avatar/index.esm.js"; import "../button-edit/index.esm.js"; import "../../components/button-group/index.esm.js"; import "../../components/calendar/index.esm.js"; import "../../components/capsule/index.esm.js"; import "../checkbox/index.esm.js"; import "../checkbox-group/index.esm.js"; import "../../components/color-picker/index.esm.js"; import "../../components/combo-list/index.esm.js"; import "../../components/content-container/index.esm.js"; import "../data-grid/index.esm.js"; import "../../components/dropdown/index.esm.js"; import "../../components/external-container/index.esm.js"; import "../../components/image-cropper/index.esm.js"; import "../input-group/index.esm.js"; import "../../components/layout/index.esm.js"; import "../../components/list-nav/index.esm.js"; import "../list-view/index.esm.js"; import "../../components/lookup/index.esm.js"; import "../../components/language-textbox/index.esm.js"; import "../../components/nav/index.esm.js"; import "../../components/number-range/index.esm.js"; import "../../components/order/index.esm.js"; import "../../components/page-header/index.esm.js"; import "../../components/page-footer/index.esm.js"; import "../../components/progress/index.esm.js"; import "../../components/query-solution/index.esm.js"; import "../radio-group/index.esm.js"; import "../../components/rate/index.esm.js"; import "../../components/response-toolbar/index.esm.js"; import "../../components/response-layout/index.esm.js"; import "../../components/response-layout-editor/index.esm.js"; import "../../components/section/index.esm.js"; import "../../components/smoke-detector/index.esm.js"; import "../../components/splitter/index.esm.js"; import "../../components/step/index.esm.js"; import "../../components/switch/index.esm.js"; import "../../components/text/index.esm.js"; import "../../components/time-picker/index.esm.js"; import $i from "../../components/tree-view/index.esm.js"; import "../../components/uploader/index.esm.js"; import "../../components/verify-detail/index.esm.js"; import "../../components/component/index.esm.js"; import "../../components/video/index.esm.js"; import "../../components/textarea/index.esm.js"; import "../tree-grid/index.esm.js"; import "../../components/fieldset/index.esm.js"; import "../drawer/index.esm.js"; import "../../components/html-template/index.esm.js"; import { useCommandOption as Ai, useColumnOption as Li, useRowOption as Hi, useSummary as ji, useSort as Di, useFilter as Wi, useAppearance as zi, useSelection as Gi, useRowNumber as Ui, usePagination as qi, useDataGridEvent as Yi } from "../data-view/index.esm.js"; import { BaseControlProperty as Xi, InputBaseProperty as Ft, ExpressionProperty as En } from "../../components/property-panel/index.esm.js"; import "../../components/combo-tree/index.esm.js"; import "../../components/events-editor/index.esm.js"; import { FieldSelectorRepositoryToken as Jt } from "../../components/field-selector/index.esm.js"; import "../../components/binding-selector/index.esm.js"; import "../../components/mapping-editor/index.esm.js"; import "../../components/schema-selector/index.esm.js"; import "../../components/event-parameter/index.esm.js"; import "../../components/filter-condition-editor/index.esm.js"; import "../../components/sort-condition-editor/index.esm.js"; import "../../components/menu-lookup/index.esm.js"; import "../../components/json-editor/index.esm.js"; import "../../components/property-editor/index.esm.js"; import "../../components/expression-editor/index.esm.js"; import "../../components/code-editor/index.esm.js"; import "../../components/collection-property-editor/index.esm.js"; import { DgControl as St } from "../../components/designer-canvas/index.esm.js"; import { getHierarchyRow as Zi, useIdentify as Un, useGroupData as qn, useFilter as Yn, useHierarchy as Xn, useLoading as Ji, useDataView as Zn, useSelection as Jn, useSelectHierarchyItem as Qi, usePagination as Qn, useDataViewContainerStyle as Ki, useCommandColumn as er, useSettingColumn as tr, useColumn as Kn, useSort as nr, useGroupColumn as or, useRow as eo, useEdit as to, useVisualDataBound as no, useVisualDataCell as oo, useVisualDataRow as io, useVisualData as ro, useCellPosition as ir, useSidebar as ao, useVirtualScroll as lo, useFitColumn as rr, useFilterHistory as ar, useColumnFilter as lr, useDragColumn as sr, getColumnHeader as ur, getSidebar as cr, getDisableMask as dr, getHorizontalScrollbar as fr, getVerticalScrollbar as mr, getEmpty as pr, getPagination as so, getSummary as vr, useVisualGroupRow as hr, useVisualSummaryRow as gr } from "../../components/data-view/index.esm.js"; import { FNotifyService as uo } from "../../components/notify/index.esm.js"; const yr = { /** 自定义样式 */ customClass: { type: String, default: "" }, /** 允许在最后一个单元回车新增一行 */ appendOnEnterAtLastCell: { type: Boolean, default: !1 }, /** 编辑单元格前事件 */ beforeEditCell: { type: Function, default: (t) => !0 }, /** 结束编辑前校验 */ beforeEndEditCell: { type: Function, default: () => !0 }, /** 变更策略 默认主动更新 */ changePolicy: { type: String, default: "push" }, /** 列集合 */ columns: { type: Array, default: [] }, /** 列配置 */ columnOption: { type: Object }, /** 列配置 */ commandOption: { type: Object, default: { enable: !1, commands: [], halign: "center" } }, /** 被绑定数据 */ data: { type: Array, default: [] }, /** 禁用组件 */ disabled: { type: Boolean, default: !1 }, /** 行数据禁用属性 */ disabledField: { type: String, default: "disabled" }, /** 允许编辑 */ editable: { type: Boolean, default: !1 }, /** 编辑配置 */ editOption: { type: Object, default: { selectOnEditing: !1, editMode: "cell" } }, enableCommands: { type: Boolean, default: !1 }, /** 表格启用过滤 */ enableFilter: { type: Boolean, default: !1 }, /** 筛选配置 */ filter: { type: Object }, /** 适配父组件尺寸 ---此属性没有实际效用*/ fit: { type: Boolean, default: !1 }, /** 编辑单元格时默认获得焦点 */ focusOnEditingCell: { type: Boolean, default: !0 }, /** 分组配置 */ group: { type: Object }, /** 列标题配置 */ header: { type: Object }, /** 高度 */ height: { type: Number, default: -1 }, /** DataGrid组件唯一标识 */ id: { type: String, default: "" }, /** 被绑定数据的标识字段 */ idField: { type: String, default: "id", require: !0 }, /** 展示loading */ loading: { type: Boolean, default: !1 }, /** 纵向合并具有相同值的单元格 */ mergeCell: { type: Boolean, default: !1 }, /** 最小高度 */ minHeight: { type: Number, default: 300 }, /** 最小宽度 */ minWidth: { type: Number, default: 400 }, /** 新建数据 */ newDataItem: { type: Function, default: () => { } }, /** 分页配置 */ pagination: { type: Object, default: { enable: !1, size: 20 } }, /** 行号配置 */ rowNumber: { type: Object, default: { enable: !0, width: 32, showEllipsis: !0, heading: "序号" } }, /** 行配置 */ rowOption: { type: Object, default: { wrapContent: !1 } }, /** 选择配置 */ selection: { type: Object, default: { enableSelectRow: !0, multiSelect: !1, multiSelectMode: "DependOnCheck", showCheckbox: !1, showSelectAll: !1, showSelection: !1, keepSelectingOnClick: !0 } }, /** 已选数据标识 */ selectionValues: { type: Array, default: [] }, /** 编辑单元格时默认选中单元格文本 */ selectOnEditingCell: { type: Boolean, default: !1 }, /** 显示边框 */ showBorder: { type: Boolean, default: !1 }, /** 显示底部面板 */ showFooter: { type: Boolean, default: !1 }, /** 显示顶部面板 */ showHeader: { type: Boolean, default: !0 }, /** 显示横向行分割线 */ showHorizontalLines: { type: Boolean, default: !0 }, /** 显示滚动条 */ showScrollBar: { type: String, default: "auto" }, /** 显示设置按钮 */ showSetting: { type: Boolean, default: !1 }, /** 显示条纹 */ showStripe: { type: Boolean, default: !0 }, /** 显示纵向列分割线 */ showVerticallLines: { type: Boolean, default: !1 }, /** 排序配置 */ sort: { type: Object }, /** 合计配置 */ summary: { type: Object, default: { // 默认合计行开启后,后面不展示值,所以默认不开启 enable: !1, groupFields: ["numericField1", "numericField2"] } }, /** 启用虚拟渲染 */ virtualized: { type: Boolean, default: !0 }, /** 宽度 */ width: { type: Number, default: -1 }, /** 空数据模板 */ emptyTemplate: { type: Object } }, br = ni(Object.assign({}, yr, { disabled: {}, editable: {}, componentId: { type: String, default: "" } }), "columnOption", "commandOption"); function Cr(t, e, n, o, i) { const { getGridHeaderCells: a } = i, r = 120, l = 50, c = A(() => { var v; return ((v = t.rowNumber) == null ? void 0 : v.enable) || !1; }), u = A(() => { var v, b; return ((v = t.selection) == null ? void 0 : v.multiSelect) || ((b = t.selection) == null ? void 0 : b.showCheckbox) || !1; }), d = A( () => { var v; return 0 + (c.value ? ((v = t.rowNumber) == null ? void 0 : v.width) || 32 : 0) + (u.value ? l : 0); } ), s = A(() => { var v; return (v = t.columnOption) == null ? void 0 : v.fitColumns; }), f = A(() => { var v; return s.value && ((v = t.columnOption) == null ? void 0 : v.fitMode) || "none"; }); function m(v, b, _) { const V = parseInt(v.width, 10) / 100; return _ * V; } function p(v, b, _) { return typeof v.width == "string" ? m(v, b, _) : v.width || r; } function g(v, b) { const _ = [], V = []; let k = 0; v.value.primaryColumns.forEach((x) => { typeof x.width == "string" ? V.push(x) : (x.width = x.width || r, k += x.width, _.push(x)); }); const R = b * (_.length / v.value.primaryColumns.length); _.forEach((x) => { const F = R * (x.width / k); x.actualWidth = F, v.value.primaryColumnsWidth += x.actualWidth; }); const B = b - R; V.forEach((x) => { const F = m(x, v.value, B); x.actualWidth = F, v.value.primaryColumnsWidth += x.actualWidth; }); } function M(v, b) { const _ = [], V = [], k = /* @__PURE__ */ new WeakMap(); let R = 0, B = 0; if (v.value.primaryColumns.forEach((F) => { if (typeof F.width == "string") { const $ = m(F, v.value, b); k.set(F, $), R += $, V.push(F); } else F.width = F.width || r, B += F.width, _.push(F); }), b - R > B) { const F = b - R; V.forEach(($) => { $.actualWidth = k.get($) || r, v.value.primaryColumnsWidth += $.actualWidth; }), _.forEach(($) => { $.actualWidth = F * ($.width / B), v.value.primaryColumnsWidth += $.actualWidth; }); } else g(v, b); } function E(v, b) { v.value.primaryColumns.forEach((_) => { _.actualWidth = p(_, v.value, b), v.value.primaryColumnsWidth += _.actualWidth; }); } const T = { expand: M, none: E, percentage: g }; function w(v) { v.value.leftHeaderColumns = Array.from(a(v.value.leftColumns).values()), v.value.primaryHeaderColumns = Array.from(a(v.value.primaryColumns).values()), v.value.rightHeaderColumns = Array.from(a(v.value.rightColumns).values()); } function C(v) { v.value.leftColumnsWidth = 0, v.value.primaryColumnsWidth = 0, v.value.rightColumnsWidth = 0, v.value.leftColumns.forEach((b) => { v.value.leftColumnsWidth += b.actualWidth || 0; }), v.value.primaryColumns.forEach((b) => { v.value.primaryColumnsWidth += b.actualWidth || 0; }), v.value.rightColumns.forEach((b) => { v.value.rightColumnsWidth += b.actualWidth || 0; }), v.value = Object.assign({}, v.value); } function h(v, b, _) { var $; let V = 0; const k = v.value.primaryColumns, R = v.value.rightColumns; v.value.rightColumns.forEach((G) => { G.actualWidth = p(G, v.value, b), V += G.actualWidth; }); const B = _ - V, x = T[f.value]; if (x && x(v, B), v.value.primaryColumnsWidth + V <= _) return v.value.primaryColumns = [...k, ...R], v.value.primaryColumnsWidth += V, v.value.rightColumns = [], v.value.rightColumnsWidth = 0, !0; const F = /* @__PURE__ */ new Map(); return F.set("primary", []), F.set("right", []), v.value.primaryColumns.reduce((G, O) => { var H, j; return O.fixed === "right" ? (H = G.get("right")) == null || H.push(O) : (j = G.get("primary")) == null || j.push(O), G; }, F), ($ = F.get("right")) != null && $.length && (v.value.primaryColumns = [...F.get("primary") || []], v.value.rightColumns = [...F.get("right") || []]), v.value.primaryColumnsWidth = 0, v.value.rightColumnsWidth = 0, !1; } function y() { if (n.value) { e.value.leftColumnsWidth = 0, e.value.primaryColumnsWidth = 0, e.value.rightColumnsWidth = 0; const v = n.value.clientWidth - d.value; e.value.leftColumns.forEach((_) => { _.actualWidth = p(_, e.value, v), e.value.leftColumnsWidth += _.actualWidth; }); const b = v - e.value.leftColumnsWidth; if (h(e, v, b)) o.value = b; else { e.value.rightColumns.forEach((k) => { k.actualWidth = p(k, e.value, v), e.value.rightColumnsWidth += k.actualWidth; }); const _ = v - e.value.leftColumnsWidth - e.value.rightColumnsWidth, V = T[f.value]; V && V(e, _), o.value = _; } w(e), e.value = Object.assign({}, e.value); } } return we(() => { var v; return (v = t.columnOption) == null ? void 0 : v.fitColumns; }, (v, b) => { v !== b && v && y(); }), we(f, (v, b) => { v !== b && s.value && y(); }), { calculateColumnHeaders: w, calculateColumnsSize: y, calculateColumnsWidth: C }; } const wr = ""; function Sr(t) { const o = S({ 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 i() { 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 a = S(t.summary), r = A(() => { const h = a.value; return (h == null ? void 0 : h.groupFields) || []; }); function l() { o.value.rightColumns.forEach((v) => { v.showSetting = !1; }), o.value.primaryColumns.forEach((v) => { v.showSetting = !1; }); const h = o.value.rightColumns, y = o.value.primaryColumns; h.length > 0 ? h[h.length - 1].showSetting = !0 : y.length > 0 && (y[y.length - 1].showSetting = !0); } function c(h) { i(); const y = /* @__PURE__ */ new Map(); return r.value && r.value.reduce((v, b) => (v.set(b, !0), v), y), h.reduce((v, b) => (b.filter = b.filter || wr, b.fixed === "left" ? (o.value.leftColumns.push(b), o.value.leftColumnsMap.set(b.field, b), o.value.leftColumnsWidth += b.actualWidth) : b.fixed === "right" ? (o.value.rightColumns.push(b), o.value.rightColumnsMap.set(b.field, b), o.value.rightColumnsWidth += b.actualWidth) : (o.value.primaryColumns.push(b), o.value.primaryColumnsMap.set(b.field, b), o.value.primaryColumnsWidth += b.actualWidth), y.has(b.field) && o.value.summaryColumns.push(b), v), o), l(), o; } c(t.columns); const u = A(() => o.value.leftColumns.length > 0), d = A(() => o.value.rightColumns.length > 0); function s(h, y) { return y.sortable && y.sort && y.sort !== "none" && h.push(y), h; } function f(h, y) { return h.sortOrder = h.sortOrder || 0, y.sortOrder = y.sortOrder || 0, h.sortOrder === y.sortOrder ? 0 : h.sortOrder < y.sortOrder ? -1 : 1; } function m(h, y) { return h.sortOrder = h.sortOrder || 0, y.sortOrder = y.sortOrder || 0, h.sortOrder === y.sortOrder ? 0 : h.sortOrder < y.sortOrder ? 1 : -1; } function p(h, y) { return y.filterable && h.push(y), h; } function g() { const h = []; return o.value.leftColumns.reduce(p, h), o.value.primaryColumns.reduce(p, h), o.value.rightColumns.reduce(p, h), h; } function M() { const h = []; o.value.leftColumns.reduce(s, h), o.value.primaryColumns.reduce(s, h), o.value.rightColumns.reduce(s, h); const y = Math.max(...h.map((v) => v.sortOrder || 0)); return h.sort(m).map((v) => { const b = v.sortOrder || y + 1; return v.sortOrder = b, v; }).sort(f).map((v, b) => { const _ = b + 1; return v.sortOrder = _, v; }); } function E(h, y, v) { const b = h.map((_) => { const V = v.getSorterByColumn(_), k = _.sort === "asc", R = _.sort === "desc", B = k ? V.ascend : R ? V.decend : void 0; return { field: _.field, compare: B }; }); y.setSorters(b); } function T(h, y) { const v = M(); E(v, h, y); } function w(h) { } function C(h) { } return { applyColumnSorter: T, collectionFilterableColumns: g, applySortableColumns: E, collectionSortableColumns: M, columnContext: o, hasLeftFixedColumn: u, hasRightFixedColumn: d, updateColumnRenderContext: c, updateColumnSettingIcon: l, sortFromServer: w, createSortConditions: C }; } function Tr(t, e, n, o, i, a, r, l) { const c = S(o.value - 1 + i), u = S(0), { renderDataRow: d } = a, s = r ? r.renderGroupRow : d, f = l ? l.renderSummaryRow : d; function m(M) { let E = d; return M.__fv_data_grid_group_row__ && (E = s), M.__fv_data_grid_group_summary__ && (E = f), E; } function p(M, E, T, w) { const { dataView: C } = n, h = []; if (C.value.length > 0) { const y = w ? Date.now().toString() : ""; let v = M, b = 0; const _ = E - M + 1; for (; h.length < _ && v < C.value.length; ) { const V = C.value[v], k = C.value[v - 1] || T, R = h[b - 1], B = k ? (k.__fv_data_position__ || 0) + (k.__fv_data_height__ || 0) : 0, F = m(V)(V, k, R, v, B, e.value, h); F.refreshKey = y, h.push(F), b++, v++; } } return u.value = h.length > 0 ? h[0].index : 0, c.value = h.length > 0 ? h[h.length - 1].index : 0, h; } function g(M, E, T) { const w = E.groupField || "", { groupValue: C, raw: h } = E; n[M](w, C, h.groupParents || []); const { dataView: y } = n, v = T[0].index, b = Math.min(v + o.value + i + 1, y.value.length - 1); return p(v, b); } return { getVisualData: p, maxVisibleRowIndex: c, minVisibleRowIndex: u, toggleGroupRow: g }; } var Ae = /* @__PURE__ */ ((t) => (t[t.readonly = 0] = "readonly", t[t.editable = 1] = "editable", t[t.editing = 2] = "editing", t))(Ae || {}), ft = /* @__PURE__ */ ((t) => (t[t.initial = 0] = "initial", t[t.editing = 1] = "editing", t))(ft || {}), Rt = /* @__PURE__ */ ((t) => (t[t.data = 0] = "data", t[t.group = 1] = "group", t[t.summary = 2] = "summary", t))(Rt || {}), Ge = /* @__PURE__ */ ((t) => (t[t.none = 0] = "none", t[t.filterable = 1] = "filterable", t[t.sortable = 2] = "sortable", t[t.filtered = 4] = "filtered", t[t.sorted = 8] = "sorted", t[t.ascending = 16] = "ascending", t[t.descending = 32] = "descending", t))(Ge || {}), lt = /* @__PURE__ */ ((t) => (t.DATE = "date", t.DATE_TIME = "datetime", t.NUMBER = "number", t.ENUM = "enum", t.IMAGE = "image", t.BOOLEAN = "boolean", t.BOOLEAN2 = "boolean2", t.TIMEAGO = "timeago", t.NONE = "none", t.CUSTOM = "custom", t.MULTI_LINGUAL = "multilingual", t))(lt || {}); const Mr = "__command__", Fr = 150, xr = "right", kn = "commands"; function _r(t, e, n) { const { horizontalScrollThumbStyle: o, onMouseDownScrollThumb: i, shouldShowHorizontalScrollbar: a } = n; function r() { return a.value && I("div", { class: "fv-grid-horizontal-scroll" }, [I("div", { class: "fv-grid-horizontal-scroll-thumb", style: o.value, onMousedown: (l) => i(l, e, "horizontal") }, null)]); } return { renderHorizontalScrollbar: r }; } function Er(t) { const { t: e } = yt(); function n(r, l) { switch (r.command) { case "edit": case "remove": return l.status === ft.initial; case "accept": case "cancel": return l.status === ft.editing; default: return !r.hidden; } } function o(r, l, c, u) { var d, s, f, m, p; switch ((d = r.onClick) == null || d.call(r, l, c.dataIndex, c), r.command) { case "edit": c.status, ft.editing, (f = (s = t.commandOption) == null ? void 0 : s.onClickEditCommand) == null || f.call(s, u, c); break; case "accept": case "cancel": c.status, ft.initial; break; case "remove": (p = (m = t.commandOption) == null ? void 0 : m.onClickDeleteCommand) == null || p.call(m, u, c); break; } } function i(r) { return r === "编辑" ? e("datagrid.commandColumn.edit") : r === "确定" ? e("datagrid.commandColumn.accept") : r === "取消" ? e("datagrid.commandColumn.cancel") : r === "删除" ? e("datagrid.commandColumn.remove") : r; } function a(r, l) { const { column: c } = r; return c.commands && c.commands.map((u, d) => d ? n(u, l) && I(xn, { class: "ml-1", type: u.type, size: u.size || "small", onClick: (s) => o(u, s, l, r), style: { "margin-bottom": "3px" } }, { default: () => [dt(" "), i(u.text), dt(" ")] }) : n(u, l) && I(xn, { type: u.type, size: u.size || "small", onClick: (s) => o(u, s, l, r), style: { "margin-bottom": "3px" } }, { default: () => [dt(" "), i(u.text), dt(" ")] })); } return { renderCommandColumn: a }; } function kr(t) { const e = S(t.minHeight), n = S(t.minWidth), o = S(t.height), i = S(t.width), a = A(() => o.value <= 0 ? 0 : Math.max(o.value, e.value)), r = A(() => i.value <= 0 ? 0 : Math.max(i.value, n.value)); return we([ () => t.height, () => t.width, () => t.minHeight, () => t.minWidth ], ([c, u, d, s]) => { e.value = Number(d), n.value = Number(s), o.value = Number(c), i.value = Number(u); }), { containerStyleObject: A(() => ({ height: a.value > 0 ? `${a.value}px` : t.fit ? "100%" : "", width: r.value > 0 ? `${r.value}px` : t.fit ? "100%" : "", flex: "1 1 0" })) }; } function Ir(t) { var a, r; const { t: e } = yt(), n = S(((a = t.commandOption) == null ? void 0 : a.enable) || !1), o = S(((r = t.commandOption) == null ? void 0 : r.commands) || []); function i(l) { var c; if (n.value && !(l.value.findIndex((d) => d.dataType === kn) > -1)) { const d = { field: Mr, title: e("datagrid.commandColumn.title"), width: Fr, fixed: xr, dataType: kn, commands: o.value, resizable: !1, halign: ((c = t.commandOption) == null ? void 0 : c.halign) || "left", visible: !0, formatter: t.commandOption.formatter ? (s, f) => t.commandOption.formatter(s, f) : null }; l.value.push(d); } } return { applyCommands: i }; } function Pr(t, e) { var u; const n = S((u = t.columnOption) == null ? void 0 : u.groups); function o(d, s, f, m, p) { const g = { actualWidth: 0, children: [], depth: 1, field: d.field, layer: 1, left: 0, parent: f, resizable: !0, title: d.title || "", status: Ge.none, popoverRef: S(), showPopover: !1, column: null, sortType: "none" }, M = m || g; if (d.group) { let E = 1; d.group.reduce((T, w) => { if (typeof w == "string") { const C = s.get(w); C && (p.fieldToRootMap.set(w, M), T.actualWidth += C.actualWidth, T.children.push(C)); } else { const C = o(w, s, T, M, p); E = Math.max(E, C.depth), T.actualWidth += C.actualWidth, T.children.push(C); } return T; }, g), g.depth += E; } return e.value.headerDepth = Math.max(e.value.headerDepth, g.depth), g; } function i(d) { const s = { groupedCells: /* @__PURE__ */ new Map(), fieldToRootMap: /* @__PURE__ */ new Map() }; return n.value && n.value.reduce((f, m) => { const p = o(m, d, null, null, s); return f.groupedCells.set(m.field, p), f; }, s), s; } function a(d) { if (!d || d.length === 0) return 0; const s = d[0]; return s.children && s.children.length > 0 && (s.left = a(s.children)), s.left; } function r(d, s) { const f = e.value.headerDepth; d.forEach((m) => { m.layer = s ? s.layer + 1 : 1; const p = m.children && m.children.length === 0; m.depth = p ? f - (m.layer - 1) : 1, m.left = p ? m.left : a(m.children), m.children && r(m.children, m); }); } function l(d, s) { const f = /* @__PURE__ */ new Map(); return d.forEach((m) => { const p = s.fieldToRootMap.get(m.field), g = p != null; g && !f.has(p.field) && f.set(p.field, p), g || f.set(m.field, m); }), r(Array.from(f.values())), f; } function c(d) { let s = /* @__PURE__ */ new Map(), f = 0; if (d.reduce((m, p) => { let g = Ge.none; g = p.sortable ? g | Ge.sortable : g, g = p.filterable ? g | Ge.filterable : g, g = p.sort && p.sort !== "none" ? g | Ge.sorted | (p.sort === "asc" ? Ge.ascending : Ge.descending) : g; const M = p.field; return m.set(M, { actualWidth: p.actualWidth || 0, children: [], depth: 1, layer: 1, left: f, field: M, parent: null, resizable: p.resizable === void 0 ? !0 : p.resizable, title: p.title, status: g, popoverRef: S(), showPopover: !1, column: p, filterValue: null, sortType: p.sort || "none", showSetting: p.showSetting, draggable: p.draggable }), f += p.actualWidth || 0, m; }, s), n.value) { const m = i(s); s = l(s, m); } return s; } return { getGridHeaderCells: c }; } function Br(t, e) { var T; en(); const { idField: n } = e, o = S(t.summary), i = S(t.group), a = S(((T = t.group) == null ? void 0 : T.groupFields) || []), r = A(() => { var w; return (w = t.group) == null ? void 0 : w.enable; }), l = A(() => { var w; return (w = t.group) == null ? void 0 : w.showGroupPanel; }), c = A(() => { const w = o.value; return (w == null ? void 0 : w.groupFields) || []; }), u = A(() => { const w = i.value; return w && w.showSummary; }), d = S(0), s = /* @__PURE__ */ new Map(); let f = []; function m(w, C, h, y, v) { const b = y[h]; b && (C.reduce((_, V, k) => { var x; const R = V[b]; let B = _.get(R); if (!B) { const F = c.value.reduce(($, G) => ($.set(G, 0), $), /* @__PURE__ */ new Map()); B = { field: b, title: ((x = v.get(b)) == null ? void 0 : x.title) || b, value: R, layer: h, details: [], groupSummaries: F }, _.set(R, B); } return c.value && c.value.forEach((F) => { if (B) { const $ = B.groupSummaries.get(F) || 0; B.groupSummaries.set(F, $ + V[F]); } }), c.value && c.value.forEach((F) => { if (B) { const $ = B.groupSummaries.get(F) || 0; B.groupSummaries.set(F, Number($.toFixed(2))); } }), B.details.push(V), _; }, w), h < y.length - 1 && w.forEach((_, V) => { _.nestGroup = /* @__PURE__ */ new Map(), m(_.nestGroup, _.details, h + 1, y, v), _.details = []; })); } function p(w, C) { return t.group && t.group.formatter ? t.group.formatter(w.value, { ...w, total: C }) : `${w.title}:${w.value} (${C})`; } function g(w, C) { const h = []; return w.forEach((y) => { const v = { // 如果存在二级分组,分组行标识保持唯一 [n.value]: `group_of_${C ? C[n.value] + "_" : ""}${y.field}_${y.value}`, __fv_data_grid_group_collapse__: !1, __fv_data_grid_group_field__: y.field, __fv_data_grid_group_layer__: y.layer, __fv_data_grid_group_row__: !0, __fv_data_grid_group_value__: y.value, groupParents: [] }; C && (v.groupParents = [...C.groupParents, C]); let b = 0; if (h.push(v), y.nestGroup) { const _ = g(y.nestGroup, v); h.push(..._), b += _.length; } if (y.details && y.details.length && (h.push(...y.details), b += y.details.length), u.value) { const _ = { __fv_data_grid_group_field__: y.field, __fv_data_grid_group_layer__: y.layer, __fv_data_grid_group_summary__: !0 }; _[n.value] = `summary_of_${y.field}_${y.value}`, _[y.field] = Array.from(y.groupSummaries.entries()).reduce( (V, [k, R]) => `${V} ${k} total:${R} `, "" ), h.push(_); } y.groupSummaries && y.groupSummaries.size && y.groupSummaries.forEach((_, V) => { v[V] = _; }), v[y.field] = p(y, b), v.value = y.value; }), h.forEach((y, v) => { y.__fv_data_index__ = v; }), h; } function M(w, C, h) { return !w || w.length === 0 || !C.length ? C : (w.join(","), s.clear(), f = [], C = C.filter((y) => !y.__fv_data_grid_group_row__), m(s, C, 0, w, h), f = g(s), f); } function E(w) { return { "f-icon": !0, "f-icon-arrow-chevron-down": !0, "fv-grid-group-row-icon-collapse": w.collapse }; } return { collpaseGroupIconClass: E, generateGroupData: M, groupFields: a, shouldGroupingData: r, showGroupPanel: l, groupRowSize: d }; } function co(t) { const e = "parent", n = "layer", o = "hasChildren", i = (r, l = 1, c = [], u = null) => (r = r || [], r.reduce((d, s) => (s.id = s.id || s.data[t.idField], s[e] = u, s[n] = l, s[o] = s[o] === void 0 ? !1 : s[o], s.data && Object.keys(s.data).forEach((f) => { Object.keys(s).includes(f) || (s[f] = s.data[f]); }), c.push(s), s.children && s.children.length && (s[o] = !0, i(s.children, l + 1, c, s.id)), d), c), c); return { flatTreeData: i, isNestedTree: (r) => r.some((l) => Array.isArray(l.children)) }; } function Vr(t, e, n, o) { const i = S(0), a = S(!!t.hierarchy), { idField: r } = o, { collapseField: l, hasChildrenField: c, parentIdField: u } = n, d = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), { flatTreeData: m, isNestedTree: p } = co(t); function g(q, U) { s.clear(), q.reduce((D, X) => { const ue = X[u.value] !== void 0 ? X[u.value] : ""; if (ue && U.has(ue)) { const me = U.get(ue), ce = isNaN(Number(me.__fv_layer__)) ? 1 : Number(me.__fv_layer__); X.__fv_layer__ = ce + 1, X.__fv_parent_index__ = me.__fv_index__, me.__fv_hasChildren__ = !0; } else X.__fv_layer__ = 1; const ve = D.has(ue) ? D.get(ue) : []; return ve.push(X), D.set(ue, ve), D; }, s); } function M(q) { f.clear(), q.reduce((U, D) => { const X = D[r.value]; return U.set(X, D), U; }, f); } function E(q) { q.forEach((U) => { const D = U[r.value]; U.__fv_children_index__.map((ue) => q[ue]).forEach((ue) => { ue.__fv_parents__ = new Map([ ...U.__fv_parents__.entries(), [D, !0] ]); }); }); } function T(q) { q.forEach((U) => { const D = new Set(U.__fv_children_index__); U.__fv_children_index__ = [...D].sort((X, ue) => X - ue); }); } function w(q) { q.forEach((U) => { const D = U.__fv_parents__; Array.from(D.keys()).map((X) => f.get(X)).forEach((X) => { X.__fv_children_index__.push(U.__fv_index__); }); }), T(q); } function C(q) { q.forEach((U) => { U.__fv_child_with_lines__ = [], U.__fv_child_length__ = U.__fv_descendant_index__.length, U.__fv_descendant_index__.map((D) => q[D]).reduce((D, X) => (D.__fv_child_length__ += X.__fv_children_index__.length, D.__fv_child_with_lines__.push(...X.__fv_children_index__, X.__fv_index__), D), U); }); } function h(q, U) { return { id: q, index: U, parentId: "", parentIndex: -1, parents: /* @__PURE__ */ new Map(), children: /* @__PURE__ */ new Map(), descendant: /* @__PURE__ */ new Map(), collapsed: !1, visibleInHierarchy: !0 }; } function y(q, U, D) { Array.from(U.keys()).forEach((X) => { U.get(X).reduce((ve, me) => { const ce = me[r.value], Se = q.get(me[r.value]), Ie = q.get(X), he = D.get(X); return Ie && he && (Ie.children.set(ce, Se), Ie.children.set(ce, Se), Se.parentId = X, Se.parentIndex = Ie.index, Se.parents.set(X, Ie)), ve; }, q); }); } function v(q) { q.children.forEach((D) => { D.parents = new Map([ ...q.parents.entries(), [q.id, q] ]), v(D); }); } function b(q, U) { q.filter((D) => D[u.value] === void 0 || D[u.value] === "").forEach((D) => { const X = D[r.value], ue = U.get(X); v(ue); }); } function _(q) { Array.from(q.values()).forEach((U) => { Array.from(U.parents.values()).forEach((D) => { D.descendant.set(U.id, U); }); }); } function V(q) { d.clear(), q.forEach((U, D) => { const X = U[r.value]; d.set(X, h(X, D)); }), M(q), g(q, f), y(d, s, f), b(q, d), _(d); } function k(q) { const U = q[r.value], D = d.get(U); return D && D.children.size > 0; } function R(q) { return q[c.value] && !k(q); } function B(q) { const U = q[r.value], D = d.get(U); return D && D.visibleInHierarchy; } function x() { i.value = Date.now(); } function F(q, U) { U.forEach((D) => { const X = d.get(D[r.value]), ue = d.get(q), ve = f.get(q); ue && ve && (X.visibleInHierarchy = !ve[l.value] && ue.visibleInHierarchy); }), x(); } function $(q) { if (s.has(q)) { const D = s.get(q); F(q, D), D.map((X) => X[r.value]).forEach((X) => $(X)); } } function G(q) { const U = q[r.value]; $(U); } function O(q, U, D = 0) { q.forEach((X) => { const ue = R(X), ve = X.__fv_layer__ <= D, me = U === "ToCollapse" ? X.__fv_layer__ <= D : !(X.__fv_layer__ <= D), ce = ve ? me : X[l.value]; X[l.value] = ue || ce; }); for (const [X, ue] of s.entries()) F(X, ue); return q; } function H(q, U) { O(q, "ToCollapse", U); } function j(q, U) { O(q, "ToExpand", U); } function N(q) { q.forEach((U, D) => { var me; const X = U[r.value], ue = s.has(X) ? (me = s.get(X)) == null ? void 0 : me.map((ce) => ce.__fv_index__) : [], ve = h(X, D); U.__fv_graph_node__ = ve, U.__fv_children_index__ = ue, U.__fv_descendant_index__ = [...ue], U.__fv_parents__ = /* @__PURE__ */ new Map(), R(U) && (U[l.value] = !0); }); } function z(q) { var X, ue; V(e.value), N(q), E(q), w(q), t.showLines && C(q); const D = ((X = t.hierarchy) == null ? void 0 : X.collapseTo) !== void 0 ? Number((ue = t.hierarchy) == null ? void 0 : ue.collapseTo) : 0; return O(q, "ToCollapse", D), q; } function Q(q, U, D) { const ue = D.value[q][r.value], ve = d.get(ue); if (ve) { const me = d.get(ve.parentId); let ce = D.value.length - 1; if (me) { const Se = Array.from(me.children.keys()).indexOf(ve.id); if (Se === me.children.size - 1) { const he = Array.from(me.descendant.values())[me.descendant.size - 1]; ce = D.value.findIndex((W) => W[r.value] === he.id) + 1; } else { const he = Array.from(me.children.values())[Se + 1]; ce = D.value.findIndex((W) => W[r.value] === he.id); } U[c.value] = !1, U[u.value] = me.id, D.value.splice(ce, 0, U); } } } function ne(q, U, D) { const X = D.value[q], ue = X[r.value]; if (d.get(ue)) { const ce = D.value.findIndex((Se) => Se[r.value] === ue) + 1; X[c.value] = !0, X[l.value] = !1, U[c.value] = !1, U[u.value] = ue, D.value.splice(ce, 0, U); } } function Z(q, U, D) { const ue = D.value[q][r.value]; if (d.get(ue)) { const ce = D.value.findIndex((Ie) => Ie[r.value] === ue) + 1; let Se = U; p(U) && (Se = m(U)), Se.forEach((Ie) => { Ie[u.value] = ue; }), D.value.splice(ce, 0, ...Se); } } function re(q, U) { const D = q[r.value], X = d.get(D), ue = Array.from(X.descendant.keys()); ue.unshift(D); const ve = d.get(X.parentId); if (ve && (ve.children.delete(D), ve.children.size === 0)) { const ce = U.find((Se) => Se[r.value] === X.parentId); ce[c.value] = !1, ce[l.value] = !1; } return U.filter((ce) => ue.indexOf(ce.id) === -1); } return { checkVisibleInHierarchy: i, collapseTo: H, expandTo: j, generateHierarchyData: z, hasRealChildren: k, insertSibling: Q, insertChild: ne, insertChildren: Z, isVisibleInTree: B, shouldStratifyData: a, toggleChildrenVisibiltyByCollapseStatus: G, trimmedOriginalData: re }; } const Or = { showCloseButton: { type: Boolean, default: !0 }, position: { type: String, default: "top-center" }, timeout: { type: Number, default: 3e3 }, theme: { type: String, default: "bootstrap" }, left: { type: Number }, right: { type: Number }, top: { type: Number }, bottom: { type: Number }, id: { type: String }, animate: { type: String, default: "fadeIn" }, options: { type: Object }, safeHtml: { type: Boolean, default: !0 } }, Nr = { showCloseButton: { type: Boolean, default: !0 }, animate: { type: String, default: "fadeIn" }, options: { type: Object } }, dn = /* @__PURE__ */ Ue({ name: "Toast", props: Nr, emits: ["close", "click"], setup: (t, e) => { const { locale: n, t: o } = yt(), i = S(t.animate), a = "fadeOut", r = A(() => t.options), l = S(!1), c = A(() => r.value.title && r.value.message), u = A(() => !r.value.title && r.value.message), d = A(() => { const C = { animated: l.value, toast: !0, "toast--only-content": u.value }; return C[t.animate] = !1, C[a] = l.value, C["toasty-type-" + r.value.type] = !0, r.value.theme && (C[r.value.theme] = !0), C; }), s = A(() => { const y = `f-icon-${r.value && r.value.type ? r.value.type.replace("toasty-type-", "") : "default"}`, v = { "f-icon": !0 }; return v[y] = !0, v; }), f = A(() => r.value.title || r.value.message), m = A(() => t.showCloseButton), p = A(() => !!r.value.buttons || !!e.slots.default), g = A(() => n.value === "en" ? { wordBreak: "keep-all", overflowWrap: "break-word" } : {}); function M(C) { C.stopPropagation(), C.preventDefault(), l.value = !1, setTimeout(() => { e.emit("close", r.value); }, 200); } function E(C, h) { } function T(C) { return `f-preten-link ${C.customClass ? C.customClass : ""}`; } we(i, () => { i.value; }); const w = () => { var C; return I(it, null, [I("div", { class: "after-toast-msg text-right" }, [!e.slots.default && ((C = r.value.buttons) == null ? void 0 : C.map((h) => I("span", { class: T(h), onClick: (y) => void 0 }, [h.text]))), e.slots.default && e.slots.default()])]); }; return () => I("div", { class: d.value, style: "min-height:44px" }, [m.value && I("button", { title: o("messageBox.close"), class: "toast-close f-btn-icon f-bare", onClick: M }, [I("span", { class: "f-icon modal_close" }, null)]), f.value && I("section", { class: "modal-tips" }, [I("div", { class: "float-left modal-tips-iconwrap" }, [I("span", { class: s.value }, null)]), I("div", { class: "modal-tips-content" }, [c.value && I(it, null, [I("h5", { class: "toast-title modal-tips-title", innerHTML: r.value.title }, null), I("p", { class: "toast-msg", innerHTML: r.value.message, style: g.value }, null), p.value && w()]), u.value && (r.value.buttons ? I("div", { class: "toast-title-btns-wrapper d-flex" }, [I("h5", { class: "toast-title modal-tips-title only-toast-msg", style: g.value, innerHTML: r.value.message }, null), I("div", { class: "after-toast-title text-right ml-auto" }, [w()])]) : I("h5", { class: "toast-title modal-tips-title only-toast-msg", style: g.value, innerHTML: r.value.message }, null))])])]); } }), Qt = /* @__PURE__ */ Ue({ name: "Notify", props: Or, emits: ["close", "empty"], setup(t, e) { const n = A(() => ({ "farris-notify": !0 })), o = { left: 12, right: 12, top: 20, bottom: 12 }, i = S(), a = S(t.options), r = S(t.showCloseButton), l = A(() => t.position || "bottom-right"), c = A(() => t.timeout != null ? t.timeout : 3e3), u = A(() => { const f = t.bottom ? t.bottom : o.bottom, m = t.top ? t.top : o.top, p = { transition: "all 0.2s ease", left: l.value.indexOf("left") > -1 ? `${t.left ? t.left : o.left}px` : "", right: l.value.indexOf("right") > -1 ? `${t.right ? t.right : o.right}px` : "", top: l.value.indexOf("top") > -1 ? `${m}px` : "", bottom: l.value.indexOf("bottom") > -1 ? `${f}px` : "" }; return l.value.indexOf("center") > -1 && (p.left = "50%", p.marginLeft = "calc(-24rem / 2)", l.value === "center-center" && (p.top = "50%", p.transform = "translate(-50%, -50%)")), p; }); function d(f) { e.emit("close"); } c.value && setTimeout(() => { d(); }, c.value), e.expose({ closeToast: d, container: i, notifyPosition: l }); function s(f, m) { d(); } return () => I("div", { class: n.value, style: u.value, ref: i }, [I(dn, { options: a.value, showCloseButton: r.value, animate: t.animate, onClose: (f) => s(f, a.value) }, null)]); } }); class fo { constructor() { se(this, "notifyRefs", []); se(this, "globalConfig", vt({})); } escapeAllHtml(e) { if (typeof e != "string" || !e) return ""; const n = document.createElement("div"); return n.textContent = e || "", n.innerHTML.replace(/\\n/g, "<br>").replace(/\\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g, ""); } createNotifyInstance(e) { const n = this, i = Object.assign({ timeout: 3e3, position: "bottom-right", showCloseButton: !0, safeHtml: !0 }, this.globalConfig, { ...e }), a = document.createElement("div"); a.style.display = "contents"; const r = pn({ setup() { var u; const l = S(); function c() { l.value.container.style.transform = "scale(0)", setTimeout(() => { n.updateNotifyPositionForClose(i, l), r.unmount(); }, 220); } if (i.position.indexOf("top") > -1) { const d = n.getNotifyInstances(i.position), s = d[d.length - 1]; if (s) { const f = s.value.container.getBoundingClientRect(); i.top = f.bottom; } } return i.safeHtml && ((u = i.options) != null && u.message) && (i.options.message = n.escapeAllHtml(i.options.message)), Yt(() => { document.body.removeChild(a); }), Ke(() => { n.updateNotifyPositionForCreate(i, l); }), () => I(Hn, { mode: "out-in", name: "fade", appear: !0 }, { default: () => [I(Qt, Nt({ ref: l }, i, { onClose: c }), null)] }); } }); return r.provide("NotifyService", this), document.body.appendChild(a), r.use(rn.i18n), r.mount(a), r; } getNotifyInstances(e) { return this.notifyRefs.filter((n) => n.value.notifyPosition === e); } updateNotifyPositionForCreate(e, n) { if (this.notifyRefs && this.notifyRefs.length) { const o = window.innerHeight; e.position.indexOf("bottom") > -1 && this.getNotifyInstances(e.position).forEach((i) => { const a = i.value.container.getBoundingClientRect(); i.value.container.style.bottom = a.height + o - a.bottom + "px"; }); } this.notifyRefs = [...this.notifyRefs, n]; } updateNotifyPositionForClose(e, n) { const o = this.notifyRefs.indexOf(n); if (e.position.indexOf("top") > -1) { const i = this.getNotifyInstances(e.position), a = i.indexOf(n); i.slice(a + 1).forEach((r) => { r.value.container.style.top = r.value.container.offsetTop - r.value.container.offsetHeight + "px"; }); } o > -1 && this.notifyRefs.splice(o, 1); } show(e) { return this.createNotifyInstance(e); } buildNotifyProps(e, n) { let o = "", i = "", a, r, l; typeof n == "string" ? o = n : n && (o = n.message || "", i = n.title || "", r = n.position || null, l = n.showCloseButton != null ? n.showCloseButton : null, a = n.timeout != null ? n.timeout : null); const u = { options: { type: e, message: o, title: i } }; return r != null && (u.position = r), l != null && (u.showCloseButton = l), a != null && (u.timeout = a), u; } info(e) { const n = this.buildNotifyProps("info", e); return this.show(n); } success(e) { const n = this.buildNotifyProps("success", e); return this.show(n); } warning(e) { const n = this.buildNotifyProps("warning", e); return this.show(n); } error(e) { const n = this.buildNotifyProps("error", e); return this.show(n); } close(e) { e && e.unmount(); } closeAll() { this.notifyRefs.forEach((e) => { e == null || e.value.closeToast(); }), this.notifyRefs.length = 0; } } const Rr = Symbol("NOTIFY_SERVICE_TOKEN"); Qt.install = (t) => { t.component(Qt.name, Qt), t.component(dn.name, dn); const e = new fo(); t.provide(Rr, e), t.provide("FNotifyService", e); }; function $r(t, e, n, o, i) { const { toNumber: a } = $n(), r = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), s = S([]), f = S([]), m = Br(t, i), { generateGroupData: p, groupFields: g, shouldGroupingData: M } = m, E = S(t.data || []), T = Vr(t, E, o, i), { collapseTo: w, expandTo: C, generateHierarchyData: h, hasRealChildren: y, insertSibling: v, insertChild: b, insertChildren: _, isVisibleInTree: V, shouldStratifyData: k, toggleChildrenVisibiltyByCollapseStatus: R, trimmedOriginalData: B, checkVisibleInHierarchy: x } = T, { idField: F, reviseIdentifyField: $ } = i, G = S(t.newDataItem), O = S(t.da