UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,416 lines 151 kB
var Jt = Object.defineProperty; var Qt = (e, t, n) => t in e ? Jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var me = (e, t, n) => Qt(e, typeof t != "symbol" ? t + "" : t, n); import { useGuid as Zt, useNumberFormat as rt, resolveField as ye, useCommonUtils as at, useDateFormat as Kt, setFieldValue as qe, getCustomClass as Qe, getCustomStyle as Ze, excludeProperties as en, withInstall as tn } from "../../components/common/index.esm.js"; import nn, { listViewProps as on, FListViewTable as rn } from "../../components/list-view/index.esm.js"; import { getSchemaByTypeForDesigner as an, createPropsResolver as sn, createCollectionBindingResolver as ln } from "../../components/dynamic-resolver/index.esm.js"; import { ref as x, createVNode as M, createTextVNode as ke, computed as W, defineComponent as je, watch as Ne, Fragment as xe, reactive as st, createApp as cn, onUnmounted as un, onMounted as Ye, Transition as dn, mergeProps as fn, withModifiers as mn, withDirectives as vn, vModelText as pn, inject as ze } from "vue"; import "../../components/popover/index.esm.js"; import { useI18n as He } from "vue-i18n"; import "../../components/modal/index.esm.js"; import { cloneDeep as $e, isUndefined as Ke, isPlainObject as et } from "lodash-es"; import "../../components/transfer/index.esm.js"; import "../../components/tabs/index.esm.js"; import { FCheckbox as Xe } from "../../components/checkbox/index.esm.js"; import "../../components/filter-bar/index.esm.js"; import "../../components/pagination/index.esm.js"; import tt from "../../components/button/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 "../../components/tags/index.esm.js"; import { LocaleService as gn } from "../../components/locale/index.esm.js"; import { useCondition as hn, CompareType as Ee, ValueType as Be, TextValue as Ge, RadioGroupValue as _n, NumberSpinnerValue as yn, NumberRangeValue as bn, MonthRangeValue as wn, MonthPickerValue as Cn, DateRangeValue as nt, DateTimePickerValue as Sn, DatePickerValue as En, ComboLookupValue as Tn, ComboListValue as kn, CheckBoxValue as Fn } from "../../components/condition/index.esm.js"; import { FDynamicFormInput as Mn } from "../../components/dynamic-form/index.esm.js"; import { DgControl as Re } from "../../components/designer-canvas/index.esm.js"; function Nn(e, t) { function n(a) { const i = []; let c = a.nextNode(); for (; c; ) i.push(c), c = a.nextNode(); return i; } function o(a, i) { const c = document.createTreeWalker(a, NodeFilter.SHOW_TEXT); return n(c).map((s) => ({ textNode: s, text: (s.textContent || "").toLocaleLowerCase() })).map(({ textNode: s, text: l }) => { const g = []; let m = 0; for (; m < l.length; ) { const h = l.indexOf(i, m); if (h === -1) break; g.push(h), m = h + i.length; } return g.map((h) => { const E = new Range(); return E.setStart(s, h), E.setEnd(s, h + i.length), E; }); }).flat(); } function r(a) { if (!CSS.highlights || (CSS.highlights.clear(), !a || !t)) return; const i = o(t.value, a.toLocaleLowerCase()), c = new Highlight(...i); CSS.highlights.set("search-result", c); } return { search: r }; } const Oe = { 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: "列表导航" }, "list-view": { type: "list-view", name: "列表" }, "filter-bar": { type: "filter-bar", name: "筛选条" }, "language-textbox": { type: "language-textbox", name: "多语输入框" } }; function lt(e, t, n) { var U; const o = n && n.getStyles && n.getStyles() || "", r = n && n.getDesignerClass && n.getDesignerClass() || "", a = x(); let i; function c() { return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0; } function f() { return !1; } function d() { return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanDeleteComponent ? n.checkCanDeleteComponent() : !0; } function u() { return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : n && n.hideNestedPaddingInDesginerView ? n.hideNestedPaddingInDesginerView() : !1; } function s(I) { if (!I || !I.value) return null; if (I.value.schema && I.value.schema.type === "component") return I.value; const R = x(I == null ? void 0 : I.value.parent), T = s(R); return T || null; } function l(I = t) { var V; if (n != null && n.getDraggableDesignItemElement) return n.getDraggableDesignItemElement(I); const { componentInstance: R, designerItemElementRef: T } = I; if (!R || !R.value) return null; const { getCustomButtons: k } = R.value; return R.value.canMove || k && ((V = k()) != null && V.length) ? T : l(I.parent); } function g(I) { return !!n && n.canAccepts(I); } function m() { 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 E(I, R) { var T; !I || !R || (n != null && n.onAcceptMovedChildElement && n.onAcceptMovedChildElement(I, R), (T = t == null ? void 0 : t.setupContext) == null || T.emit("dragEnd")); } function F(I, R) { const { componentType: T } = I; let k = an(T, I, R); n && n.onResolveNewComponentSchema && (k = n.onResolveNewComponentSchema(I, k)); const V = T.toLowerCase().replace(/-/g, "_"); return k && !k.id && k.type === T && (k.id = `${V}_${Math.random().toString().slice(2, 6)}`), k; } function S(I) { I && n != null && n.onChildElementMovedOut && n.onChildElementMovedOut(I); } function b(...I) { if (n && n.getPropsConfig) return n.getPropsConfig(...I); } function p(I) { if (!I) return; const R = t == null ? void 0 : t.schema, { formSchemaUtils: T } = I; if (R && T.getExpressions().length) { const k = T.getExpressions().findIndex((V) => V.target === R.id); k > -1 && T.getExpressions().splice(k, 1); } } function _(I) { if (!I || !(t != null && t.schema)) return; const R = t.schema, { formSchemaUtils: T } = I; T.removeCommunicationInComponent(R); } function v(I) { n && n.onRemoveComponent && n.onRemoveComponent(), p(I), _(I), t != null && t.schema.contents && t.schema.contents.map((R) => { let T = R.id; R.type === "component-ref" && (T = R.component); const k = e.value.querySelectorAll(`#${T}-design-item`); k != null && k.length && Array.from(k).map((V) => { var q; (q = V == null ? void 0 : V.componentInstance) != null && q.value.onRemoveComponent && V.componentInstance.value.onRemoveComponent(I); }); }); } function y() { if (n && n.getCustomButtons) return n.getCustomButtons(); } function C(I) { var T, k; if (!((T = t == null ? void 0 : t.schema) != null && T.id)) return; if (!i && I && (i = I.formSchemaUtils), n != null && n.setComponentBasicInfoMap) { n.setComponentBasicInfoMap(); return; } let R = ""; if (n != null && n.getComponentTitle) R = n.getComponentTitle(); else { const { text: V, title: q, label: $, mainTitle: ee, name: ae, type: B } = t.schema; R = V || q || $ || ee || ae || ((k = Oe[B]) == null ? void 0 : k.name); } R && i.getControlBasicInfoMap().set(t.schema.id, { componentTitle: R, parentPathName: R }); } function w(I) { var V; const { changeObject: R } = I, { propertyID: T, propertyValue: k } = R; if (["text", "title", "label", "name", "mainTitle"].includes((V = I == null ? void 0 : I.changeObject) == null ? void 0 : V.propertyID) && T && k && (C(), i)) { const q = i.getControlBasicInfoMap(), $ = q.keys().toArray().filter((ee) => { var ae, B; return ((ae = q.get(ee)) == null ? void 0 : ae.reliedComponentId) === ((B = t == null ? void 0 : t.schema) == null ? void 0 : B.id); }); $ != null && $.length && $.forEach((ee) => { const ae = q.get(ee).parentPathName.split(" > "); ae[0] = k, q.get(ee).parentPathName = ae.join(" > "); }); } } function L(I) { if (w(I), n && n.onPropertyChanged) return n.onPropertyChanged(I); } return a.value = { canMove: c(), canSelectParent: f(), canDelete: d(), canNested: !u(), contents: t == null ? void 0 : t.schema.contents, elementRef: e, parent: (U = t == null ? void 0 : t.parent) == null ? void 0 : U.componentInstance, schema: t == null ? void 0 : t.schema, styles: o, designerClass: r, canAccepts: g, getBelongedComponentInstance: s, getDraggableDesignItemElement: l, getDraggingDisplayText: m, getPropConfig: b, getDragScopeElement: h, onAcceptMovedChildElement: E, onChildElementMovedOut: S, addNewChildComponentSchema: F, triggerBelongedComponentToMoveWhenMoved: !!n && n.triggerBelongedComponentToMoveWhenMoved || x(!1), triggerBelongedComponentToDeleteWhenDeleted: !!n && n.triggerBelongedComponentToDeleteWhenDeleted || x(!1), onRemoveComponent: v, getCustomButtons: y, onPropertyChanged: L, setComponentBasicInfoMap: C, updateContextSchema: t == null ? void 0 : t.updateContextSchema }, a; } var he = /* @__PURE__ */ ((e) => (e[e.readonly = 0] = "readonly", e[e.editable = 1] = "editable", e[e.editing = 2] = "editing", e))(he || {}), Fe = /* @__PURE__ */ ((e) => (e[e.initial = 0] = "initial", e[e.editing = 1] = "editing", e))(Fe || {}), Ve = /* @__PURE__ */ ((e) => (e[e.data = 0] = "data", e[e.group = 1] = "group", e[e.summary = 2] = "summary", e))(Ve || {}), Te = /* @__PURE__ */ ((e) => (e.DATE = "date", e.DATE_TIME = "datetime", e.NUMBER = "number", e.ENUM = "enum", e.IMAGE = "image", e.BOOLEAN = "boolean", e.BOOLEAN2 = "boolean2", e.TIMEAGO = "timeago", e.NONE = "none", e.CUSTOM = "custom", e.MULTI_LINGUAL = "multilingual", e))(Te || {}); function On(e) { const { t } = He(); function n(i, c) { switch (i.command) { case "edit": case "remove": return c.status === Fe.initial; case "accept": case "cancel": return c.status === Fe.editing; default: return !i.hidden; } } function o(i, c, f, d) { var u, s, l, g, m; switch ((u = i.onClick) == null || u.call(i, c, f.dataIndex, f), i.command) { case "edit": f.status, Fe.editing, (l = (s = e.commandOption) == null ? void 0 : s.onClickEditCommand) == null || l.call(s, d, f); break; case "accept": case "cancel": f.status, Fe.initial; break; case "remove": (m = (g = e.commandOption) == null ? void 0 : g.onClickDeleteCommand) == null || m.call(g, d, f); break; } } function r(i) { return i === "编辑" ? t("datagrid.commandColumn.edit") : i === "确定" ? t("datagrid.commandColumn.accept") : i === "取消" ? t("datagrid.commandColumn.cancel") : i === "删除" ? t("datagrid.commandColumn.remove") : i; } function a(i, c) { const { column: f } = i; return f.commands && f.commands.map((d, u) => u ? n(d, c) && M(tt, { class: "ml-1", type: d.type, size: d.size || "small", onClick: (s) => o(d, s, c, i), style: { "margin-bottom": "3px" } }, { default: () => [ke(" "), r(d.text), ke(" ")] }) : n(d, c) && M(tt, { type: d.type, size: d.size || "small", onClick: (s) => o(d, s, c, i), style: { "margin-bottom": "3px" } }, { default: () => [ke(" "), r(d.text), ke(" ")] })); } return { renderCommandColumn: a }; } function ct(e, t) { var S; Zt(); const { idField: n } = t, o = x(e.summary), r = x(e.group), a = x(((S = e.group) == null ? void 0 : S.groupFields) || []), i = W(() => { var b; return (b = e.group) == null ? void 0 : b.enable; }), c = W(() => { var b; return (b = e.group) == null ? void 0 : b.showGroupPanel; }), f = W(() => { const b = o.value; return (b == null ? void 0 : b.groupFields) || []; }), d = W(() => { const b = r.value; return b && b.showSummary; }), u = x(0), s = /* @__PURE__ */ new Map(); let l = []; function g(b, p, _, v, y) { const C = v[_]; C && (p.reduce((w, L, U) => { var T; const I = L[C]; let R = w.get(I); if (!R) { const k = f.value.reduce((V, q) => (V.set(q, 0), V), /* @__PURE__ */ new Map()); R = { field: C, title: ((T = y.get(C)) == null ? void 0 : T.title) || C, value: I, layer: _, details: [], groupSummaries: k }, w.set(I, R); } return f.value && f.value.forEach((k) => { if (R) { const V = R.groupSummaries.get(k) || 0; R.groupSummaries.set(k, V + L[k]); } }), f.value && f.value.forEach((k) => { if (R) { const V = R.groupSummaries.get(k) || 0; R.groupSummaries.set(k, Number(V.toFixed(2))); } }), R.details.push(L), w; }, b), _ < v.length - 1 && b.forEach((w, L) => { w.nestGroup = /* @__PURE__ */ new Map(), g(w.nestGroup, w.details, _ + 1, v, y), w.details = []; })); } function m(b, p) { return e.group && e.group.formatter ? e.group.formatter(b.value, { ...b, total: p }) : `${b.title}:${b.value} (${p})`; } function h(b, p) { const _ = []; return b.forEach((v) => { const y = { // 如果存在二级分组,分组行标识保持唯一 [n.value]: `group_of_${p ? p[n.value] + "_" : ""}${v.field}_${v.value}`, __fv_data_grid_group_collapse__: !1, __fv_data_grid_group_field__: v.field, __fv_data_grid_group_layer__: v.layer, __fv_data_grid_group_row__: !0, __fv_data_grid_group_value__: v.value, groupParents: [] }; p && (y.groupParents = [...p.groupParents, p]); let C = 0; if (_.push(y), v.nestGroup) { const w = h(v.nestGroup, y); _.push(...w), C += w.length; } if (v.details && v.details.length && (_.push(...v.details), C += v.details.length), d.value) { const w = { __fv_data_grid_group_field__: v.field, __fv_data_grid_group_layer__: v.layer, __fv_data_grid_group_summary__: !0 }; w[n.value] = `summary_of_${v.field}_${v.value}`, w[v.field] = Array.from(v.groupSummaries.entries()).reduce( (L, [U, I]) => `${L} ${U} total:${I} `, "" ), _.push(w); } v.groupSummaries && v.groupSummaries.size && v.groupSummaries.forEach((w, L) => { y[L] = w; }), y[v.field] = m(v, C), y.value = v.value; }), _.forEach((v, y) => { v.__fv_data_index__ = y; }), _; } function E(b, p, _) { return !b || b.length === 0 || !p.length ? p : (b.join(","), s.clear(), l = [], p = p.filter((v) => !v.__fv_data_grid_group_row__), g(s, p, 0, b, _), l = h(s), l); } function F(b) { return { "f-icon": !0, "f-icon-arrow-chevron-down": !0, "fv-grid-group-row-icon-collapse": b.collapse }; } return { collpaseGroupIconClass: F, generateGroupData: E, groupFields: a, shouldGroupingData: i, showGroupPanel: c, groupRowSize: u }; } function ut(e) { const t = "parent", n = "layer", o = "hasChildren", r = (i, c = 1, f = [], d = null) => (i = i || [], i.reduce((u, s) => (s.id = s.id || s.data[e.idField], s[t] = d, s[n] = c, s[o] = s[o] === void 0 ? !1 : s[o], s.data && Object.keys(s.data).forEach((l) => { Object.keys(s).includes(l) || (s[l] = s.data[l]); }), f.push(s), s.children && s.children.length && (s[o] = !0, r(s.children, c + 1, f, s.id)), u), f), f); return { flatTreeData: r, isNestedTree: (i) => i.some((c) => Array.isArray(c.children)) }; } function Vn(e, t, n, o) { const r = x(0), a = x(!!e.hierarchy), { idField: i } = o, { collapseField: c, hasChildrenField: f, parentIdField: d } = n, u = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), { flatTreeData: g, isNestedTree: m } = ut(e); function h(D, P) { s.clear(), D.reduce((A, H) => { const Z = H[d.value] !== void 0 ? H[d.value] : ""; if (Z && P.has(Z)) { const ie = P.get(Z), te = isNaN(Number(ie.__fv_layer__)) ? 1 : Number(ie.__fv_layer__); H.__fv_layer__ = te + 1, H.__fv_parent_index__ = ie.__fv_index__, ie.__fv_hasChildren__ = !0; } else H.__fv_layer__ = 1; const re = A.has(Z) ? A.get(Z) : []; return re.push(H), A.set(Z, re), A; }, s); } function E(D) { l.clear(), D.reduce((P, A) => { const H = A[i.value]; return P.set(H, A), P; }, l); } function F(D) { D.forEach((P) => { const A = P[i.value]; P.__fv_children_index__.map((Z) => D[Z]).forEach((Z) => { Z.__fv_parents__ = new Map([ ...P.__fv_parents__.entries(), [A, !0] ]); }); }); } function S(D) { D.forEach((P) => { const A = new Set(P.__fv_children_index__); P.__fv_children_index__ = [...A].sort((H, Z) => H - Z); }); } function b(D) { D.forEach((P) => { const A = P.__fv_parents__; Array.from(A.keys()).map((H) => l.get(H)).forEach((H) => { H.__fv_children_index__.push(P.__fv_index__); }); }), S(D); } function p(D) { D.forEach((P) => { P.__fv_child_with_lines__ = [], P.__fv_child_length__ = P.__fv_descendant_index__.length, P.__fv_descendant_index__.map((A) => D[A]).reduce((A, H) => (A.__fv_child_length__ += H.__fv_children_index__.length, A.__fv_child_with_lines__.push(...H.__fv_children_index__, H.__fv_index__), A), P); }); } function _(D, P) { return { id: D, index: P, parentId: "", parentIndex: -1, parents: /* @__PURE__ */ new Map(), children: /* @__PURE__ */ new Map(), descendant: /* @__PURE__ */ new Map(), collapsed: !1, visibleInHierarchy: !0 }; } function v(D, P, A) { Array.from(P.keys()).forEach((H) => { P.get(H).reduce((re, ie) => { const te = ie[i.value], se = D.get(ie[i.value]), be = D.get(H), ce = A.get(H); return be && ce && (be.children.set(te, se), be.children.set(te, se), se.parentId = H, se.parentIndex = be.index, se.parents.set(H, be)), re; }, D); }); } function y(D) { D.children.forEach((A) => { A.parents = new Map([ ...D.parents.entries(), [D.id, D] ]), y(A); }); } function C(D, P) { D.filter((A) => A[d.value] === void 0 || A[d.value] === "").forEach((A) => { const H = A[i.value], Z = P.get(H); y(Z); }); } function w(D) { Array.from(D.values()).forEach((P) => { Array.from(P.parents.values()).forEach((A) => { A.descendant.set(P.id, P); }); }); } function L(D) { u.clear(), D.forEach((P, A) => { const H = P[i.value]; u.set(H, _(H, A)); }), E(D), h(D, l), v(u, s, l), C(D, u), w(u); } function U(D) { const P = D[i.value], A = u.get(P); return A && A.children.size > 0; } function I(D) { return D[f.value] && !U(D); } function R(D) { const P = D[i.value], A = u.get(P); return A && A.visibleInHierarchy; } function T() { r.value = Date.now(); } function k(D, P) { P.forEach((A) => { const H = u.get(A[i.value]), Z = u.get(D), re = l.get(D); Z && re && (H.visibleInHierarchy = !re[c.value] && Z.visibleInHierarchy); }), T(); } function V(D) { if (s.has(D)) { const A = s.get(D); k(D, A), A.map((H) => H[i.value]).forEach((H) => V(H)); } } function q(D) { const P = D[i.value]; V(P); } function $(D, P, A = 0) { D.forEach((H) => { const Z = I(H), re = H.__fv_layer__ <= A, ie = P === "ToCollapse" ? H.__fv_layer__ <= A : !(H.__fv_layer__ <= A), te = re ? ie : H[c.value]; H[c.value] = Z || te; }); for (const [H, Z] of s.entries()) k(H, Z); return D; } function ee(D, P) { $(D, "ToCollapse", P); } function ae(D, P) { $(D, "ToExpand", P); } function B(D) { D.forEach((P, A) => { var ie; const H = P[i.value], Z = s.has(H) ? (ie = s.get(H)) == null ? void 0 : ie.map((te) => te.__fv_index__) : [], re = _(H, A); P.__fv_graph_node__ = re, P.__fv_children_index__ = Z, P.__fv_descendant_index__ = [...Z], P.__fv_parents__ = /* @__PURE__ */ new Map(), I(P) && (P[c.value] = !0); }); } function G(D) { var H, Z; L(t.value), B(D), F(D), b(D), e.showLines && p(D); const A = ((H = e.hierarchy) == null ? void 0 : H.collapseTo) !== void 0 ? Number((Z = e.hierarchy) == null ? void 0 : Z.collapseTo) : 0; return $(D, "ToCollapse", A), D; } function J(D, P, A) { const Z = A.value[D][i.value], re = u.get(Z); if (re) { const ie = u.get(re.parentId); let te = A.value.length - 1; if (ie) { const se = Array.from(ie.children.keys()).indexOf(re.id); if (se === ie.children.size - 1) { const ce = Array.from(ie.descendant.values())[ie.descendant.size - 1]; te = A.value.findIndex((O) => O[i.value] === ce.id) + 1; } else { const ce = Array.from(ie.children.values())[se + 1]; te = A.value.findIndex((O) => O[i.value] === ce.id); } P[f.value] = !1, P[d.value] = ie.id, A.value.splice(te, 0, P); } } } function Q(D, P, A) { const H = A.value[D], Z = H[i.value]; if (u.get(Z)) { const te = A.value.findIndex((se) => se[i.value] === Z) + 1; H[f.value] = !0, H[c.value] = !1, P[f.value] = !1, P[d.value] = Z, A.value.splice(te, 0, P); } } function oe(D, P, A) { const Z = A.value[D][i.value]; if (u.get(Z)) { const te = A.value.findIndex((be) => be[i.value] === Z) + 1; let se = P; m(P) && (se = g(P)), se.forEach((be) => { be[d.value] = Z; }), A.value.splice(te, 0, ...se); } } function K(D, P) { const A = D[i.value], H = u.get(A), Z = Array.from(H.descendant.keys()); Z.unshift(A); const re = u.get(H.parentId); if (re && (re.children.delete(A), re.children.size === 0)) { const te = P.find((se) => se[i.value] === H.parentId); te[f.value] = !1, te[c.value] = !1; } return P.filter((te) => Z.indexOf(te.id) === -1); } return { checkVisibleInHierarchy: r, collapseTo: ee, expandTo: ae, generateHierarchyData: G, hasRealChildren: U, insertSibling: J, insertChild: Q, insertChildren: oe, isVisibleInTree: R, shouldStratifyData: a, toggleChildrenVisibiltyByCollapseStatus: q, trimmedOriginalData: K }; } const xn = { 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 } }, In = { showCloseButton: { type: Boolean, default: !0 }, animate: { type: String, default: "fadeIn" }, options: { type: Object } }, We = /* @__PURE__ */ je({ name: "Toast", props: In, emits: ["close", "click"], setup: (e, t) => { const { locale: n, t: o } = He(), r = x(e.animate), a = "fadeOut", i = W(() => e.options), c = x(!1), f = W(() => i.value.title && i.value.message), d = W(() => !i.value.title && i.value.message), u = W(() => { const p = { animated: c.value, toast: !0, "toast--only-content": d.value }; return p[e.animate] = !1, p[a] = c.value, p["toasty-type-" + i.value.type] = !0, i.value.theme && (p[i.value.theme] = !0), p; }), s = W(() => { const v = `f-icon-${i.value && i.value.type ? i.value.type.replace("toasty-type-", "") : "default"}`, y = { "f-icon": !0 }; return y[v] = !0, y; }), l = W(() => i.value.title || i.value.message), g = W(() => e.showCloseButton), m = W(() => !!i.value.buttons || !!t.slots.default), h = W(() => n.value === "en" ? { wordBreak: "keep-all", overflowWrap: "break-word" } : {}); function E(p) { p.stopPropagation(), p.preventDefault(), c.value = !1, setTimeout(() => { t.emit("close", i.value); }, 200); } function F(p, _) { } function S(p) { return `f-preten-link ${p.customClass ? p.customClass : ""}`; } Ne(r, () => { r.value; }); const b = () => { var p; return M(xe, null, [M("div", { class: "after-toast-msg text-right" }, [!t.slots.default && ((p = i.value.buttons) == null ? void 0 : p.map((_) => M("span", { class: S(_), onClick: (v) => void 0 }, [_.text]))), t.slots.default && t.slots.default()])]); }; return () => M("div", { class: u.value, style: "min-height:44px" }, [g.value && M("button", { title: o("messageBox.close"), class: "toast-close f-btn-icon f-bare", onClick: E }, [M("span", { class: "f-icon modal_close" }, null)]), l.value && M("section", { class: "modal-tips" }, [M("div", { class: "float-left modal-tips-iconwrap" }, [M("span", { class: s.value }, null)]), M("div", { class: "modal-tips-content" }, [f.value && M(xe, null, [M("h5", { class: "toast-title modal-tips-title", innerHTML: i.value.title }, null), M("p", { class: "toast-msg", innerHTML: i.value.message, style: h.value }, null), m.value && b()]), d.value && (i.value.buttons ? M("div", { class: "toast-title-btns-wrapper d-flex" }, [M("h5", { class: "toast-title modal-tips-title only-toast-msg", style: h.value, innerHTML: i.value.message }, null), M("div", { class: "after-toast-title text-right ml-auto" }, [b()])]) : M("h5", { class: "toast-title modal-tips-title only-toast-msg", style: h.value, innerHTML: i.value.message }, null))])])]); } }), Ae = /* @__PURE__ */ je({ name: "Notify", props: xn, emits: ["close", "empty"], setup(e, t) { const n = W(() => ({ "farris-notify": !0 })), o = { left: 12, right: 12, top: 20, bottom: 12 }, r = x(), a = x(e.options), i = x(e.showCloseButton), c = W(() => e.position || "bottom-right"), f = W(() => e.timeout != null ? e.timeout : 3e3), d = W(() => { const l = e.bottom ? e.bottom : o.bottom, g = e.top ? e.top : o.top, m = { transition: "all 0.2s ease", left: c.value.indexOf("left") > -1 ? `${e.left ? e.left : o.left}px` : "", right: c.value.indexOf("right") > -1 ? `${e.right ? e.right : o.right}px` : "", top: c.value.indexOf("top") > -1 ? `${g}px` : "", bottom: c.value.indexOf("bottom") > -1 ? `${l}px` : "" }; return c.value.indexOf("center") > -1 && (m.left = "50%", m.marginLeft = "calc(-24rem / 2)", c.value === "center-center" && (m.top = "50%", m.transform = "translate(-50%, -50%)")), m; }); function u(l) { t.emit("close"); } f.value && setTimeout(() => { u(); }, f.value), t.expose({ closeToast: u, container: r, notifyPosition: c }); function s(l, g) { u(); } return () => M("div", { class: n.value, style: d.value, ref: r }, [M(We, { options: a.value, showCloseButton: i.value, animate: e.animate, onClose: (l) => s(l, a.value) }, null)]); } }); class dt { constructor() { me(this, "notifyRefs", []); me(this, "globalConfig", st({})); } escapeAllHtml(t) { if (typeof t != "string" || !t) return ""; const n = document.createElement("div"); return n.textContent = t || "", n.innerHTML.replace(/\\n/g, "<br>").replace(/\\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g, ""); } createNotifyInstance(t) { const n = this, r = Object.assign({ timeout: 3e3, position: "bottom-right", showCloseButton: !0, safeHtml: !0 }, this.globalConfig, { ...t }), a = document.createElement("div"); a.style.display = "contents"; const i = cn({ setup() { var d; const c = x(); function f() { c.value.container.style.transform = "scale(0)", setTimeout(() => { n.updateNotifyPositionForClose(r, c), i.unmount(); }, 220); } if (r.position.indexOf("top") > -1) { const u = n.getNotifyInstances(r.position), s = u[u.length - 1]; if (s) { const l = s.value.container.getBoundingClientRect(); r.top = l.bottom; } } return r.safeHtml && ((d = r.options) != null && d.message) && (r.options.message = n.escapeAllHtml(r.options.message)), un(() => { document.body.removeChild(a); }), Ye(() => { n.updateNotifyPositionForCreate(r, c); }), () => M(dn, { mode: "out-in", name: "fade", appear: !0 }, { default: () => [M(Ae, fn({ ref: c }, r, { onClose: f }), null)] }); } }); return i.provide("NotifyService", this), document.body.appendChild(a), i.use(gn.i18n), i.mount(a), i; } getNotifyInstances(t) { return this.notifyRefs.filter((n) => n.value.notifyPosition === t); } updateNotifyPositionForCreate(t, n) { if (this.notifyRefs && this.notifyRefs.length) { const o = window.innerHeight; t.position.indexOf("bottom") > -1 && this.getNotifyInstances(t.position).forEach((r) => { const a = r.value.container.getBoundingClientRect(); r.value.container.style.bottom = a.height + o - a.bottom + "px"; }); } this.notifyRefs = [...this.notifyRefs, n]; } updateNotifyPositionForClose(t, n) { const o = this.notifyRefs.indexOf(n); if (t.position.indexOf("top") > -1) { const r = this.getNotifyInstances(t.position), a = r.indexOf(n); r.slice(a + 1).forEach((i) => { i.value.container.style.top = i.value.container.offsetTop - i.value.container.offsetHeight + "px"; }); } o > -1 && this.notifyRefs.splice(o, 1); } show(t) { return this.createNotifyInstance(t); } buildNotifyProps(t, n) { let o = "", r = "", a, i, c; typeof n == "string" ? o = n : n && (o = n.message || "", r = n.title || "", i = n.position || null, c = n.showCloseButton != null ? n.showCloseButton : null, a = n.timeout != null ? n.timeout : null); const d = { options: { type: t, message: o, title: r } }; return i != null && (d.position = i), c != null && (d.showCloseButton = c), a != null && (d.timeout = a), d; } info(t) { const n = this.buildNotifyProps("info", t); return this.show(n); } success(t) { const n = this.buildNotifyProps("success", t); return this.show(n); } warning(t) { const n = this.buildNotifyProps("warning", t); return this.show(n); } error(t) { const n = this.buildNotifyProps("error", t); return this.show(n); } close(t) { t && t.unmount(); } closeAll() { this.notifyRefs.forEach((t) => { t == null || t.value.closeToast(); }), this.notifyRefs.length = 0; } } const Dn = Symbol("NOTIFY_SERVICE_TOKEN"); Ae.install = (e) => { e.component(Ae.name, Ae), e.component(We.name, We); const t = new dt(); e.provide(Dn, t), e.provide("FNotifyService", t); }; function Pn(e, t, n, o, r) { const { toNumber: a } = rt(), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), s = x([]), l = x([]), g = ct(e, r), { generateGroupData: m, groupFields: h, shouldGroupingData: E } = g, F = x(e.data || []), S = Vn(e, F, o, r), { collapseTo: b, expandTo: p, generateHierarchyData: _, hasRealChildren: v, insertSibling: y, insertChild: C, insertChildren: w, isVisibleInTree: L, shouldStratifyData: U, toggleChildrenVisibiltyByCollapseStatus: I, trimmedOriginalData: R, checkVisibleInHierarchy: T } = S, { idField: k, reviseIdentifyField: V } = r, q = x(e.newDataItem), $ = x(e.data || []), ee = x(e.data), { flatTreeData: ae, isNestedTree: B } = ut(e); if (e.hierarchy && B(e.data)) { const N = ae(e.data); F.value = N, $.value = N, ee.value = N; } const G = x(e.summary), J = W(() => { const N = G.value; return (N == null ? void 0 : N.groupFields) || []; }); let Q = /* @__PURE__ */ new Map(); const oe = x($.value.length), K = x(e.pagination); function D() { return K.value && K.value.enable && K.value.size > 0 ? K.value.size : $.value.length; } const P = x(1), A = W(() => K.value && K.value.enable && K.value.mode !== "server"), H = W(() => K.value && K.value.enable && K.value.mode === "server"), Z = new dt(); function re(N, j) { const X = Math.ceil(N.length / j); let ne = 0; const fe = [], we = [], Se = []; for (; ne < X; ) { const _e = N.slice(ne * j, (ne + 1) * j), le = m(h.value, _e, t); we[ne] = le.filter((ue) => ue.__fv_data_grid_group_row__).length, fe.push(...le), ne++; } return we.reduce((_e, le, ue) => (_e = _e + le, Se.push(_e), _e), 0), { groupData: fe, groupRowSizeList: we, accumulateGroupRowSize: Se }; } function ie() { var le; $.value = F.value, A.value && (oe.value = $.value.length), E.value && !A.value && ($.value = m(h.value, F.value, t)), Q = J.value.reduce((ue, de) => (ue.set(de, 0), ue), Q); const N = 0, j = D(), X = (P.value - 1) * j; let fe = X > $.value.length - 1 || H.value ? N : X, we = H.value ? $.value.length : Math.min(fe + j, $.value.length); if (E.value && A.value) { const { accumulateGroupRowSize: ue, groupData: de, groupRowSizeList: ge } = re(F.value, j); $.value = de; const Me = ge[P.value - 1]; fe += P.value - 2 < 0 ? 0 : ue[P.value - 2], we = fe + j + Me; } let Se = 0; const _e = []; if ($.value.length) { V($.value); const ue = k.value !== e.idField; for (let de = fe; de < we; de++) { const ge = $.value[de]; ge.__fv_data_grid_group_row__ ? (Se = 0, ge.__fv_data_index__ = "") : ge.__fv_data_grid_group_summary__ ? ge.__fv_data_index__ = "" : (Se++, ge.__fv_data_index__ = Se + (P.value - 1) * j), ge.__fv_index__ = de, ge.__fv_visible_index__ = de, e.rowOption && e.rowOption.disabledField && (ge.__fv_disabled__ = ge[(le = e.rowOption) == null ? void 0 : le.disabledField]), ue && (ge[k.value] = de), J.value.forEach((Me) => { const De = Q.get(Me) || 0; Q.set(Me, De + ye(ge, Me)); }), _e.push(ge); } } return U.value && _(_e), J.value.forEach((ue) => { const de = Q.get(ue) || 0; Q.set(ue, a(de.toFixed(2))); }), ee.value = [..._e], _e; } const te = x(ie()), se = W(() => (T.value, te.value.filter((N) => U.value ? N.__fv_visible__ !== !1 && L(N) : N.__fv_visible__ !== !1))); function be() { se.value.forEach((N, j) => (N.__fv_visible_index__ = j, N)); } function ce(N, j, X = !1) { var _e; const ne = X ? ie() : [...ee.value]; let fe = ne; ((_e = e.filter) == null ? void 0 : _e.mode) !== "server" && (fe = ne.filter((le) => n.apply(le))); const we = N && N.length ? fe.filter((le) => N.reduce((ue, de) => ue && de.filter(le), !0)) : fe, Se = j && j.length ? we.sort((le, ue) => { const de = [...j], ge = de.shift(); let Me = ge.compare(le[ge.field], ue[ge.field]); for (; Me === 0 && de.length !== 0; ) { const De = de.shift(); De && (Me = De.compare(le[De.field], ue[De.field])); } return Me; }) : we; return te.value = Se.map((le, ue) => { if (le.__fv_data_grid_group_row__) { const de = `group_of_${le.__fv_data_grid_group_field__}_${le.__fv_data_grid_group_value__}`; le.__fv_data_grid_group_collapse__ = !!i.get(de); } return le.__fv_index__ = ue, le.__fv_visible_index__ = ue, le; }), te.value; } function Pe(N) { return u.clear(), l.value = N, l.value.reduce((j, X) => (j.set(X.field, X), j), u), ce([], l.value); } function O(N, j) { return u.set(N, j), l.value = Array.from(u.values()), ce([], l.value); } function Y(N) { return u.delete(N), l.value = Array.from(u.values()), ce([], l.value); } function z(N, j) { return c.set(N, j), s.value = Array.from(c.values()), ce([], Array.from(u.values())); } function ve(N) { return c.delete(N), s.value = Array.from(c.values()), ce([], Array.from(u.values()), !0); } function pe() { return c.clear(), s.value = [], ce([], Array.from(u.values()), !0); } function Ie(N, j, X) { const ne = `group_of_${N}_${j}`; i.set(ne, !0); const fe = (we) => we[N] === j; return f.set(`collapse_${N}_${j}`, { field: N, fieldName: N, fieldType: "string", filterValue: j, filter: fe }), ce(Array.from(f.values()), Array.from(u.values())); } function Nt(N) { b(te.value, N); } function Ot(N) { p(te.value, N); } function Vt(N, j, X) { const ne = `group_of_${N}_${j}`; return i.set(ne, !1), f.delete(`collapse_${N}_${j}`), ce(Array.from(f.values()), Array.from(u.values()), !0); } function xt(N) { const j = N.raw[k.value], X = (ne) => !ne.__fv_parents__.has(j); d.set(`fold_${j}`, { field: "id", fieldName: "id", fieldType: "string", filterValue: String(j), filter: X }), ce(Array.from(d.values()), Array.from(u.values())), _(te.value); } function Ue(N) { const j = N[k.value]; d.delete(`fold_${j}`); } function It(N) { Ue(N.raw), ce(Array.from(d.values()), Array.from(u.values()), !0), _(te.value); } function Ce() { const N = ie(); te.value = N, e.hierarchy && (ce(Array.from(d.values()), Array.from(u.values())), _(te.value)); } function Dt(N) { const X = e.hierarchy && B(N) ? ae(N) : N; F.value = X, Ce(); } function Pt(N, j, X) { return (N && N.length ? te.value.filter((fe, we) => N.reduce((Se, _e) => Se && _e.filter(fe), !0)) : te.value).slice(j, X); } function Bt(N) { const j = D(), X = Math.ceil(oe.value / j); 0 <= N && N <= X && (P.value = N, Ce()); } function Rt(N) { F.value.push($e(N)), te.value = ie(); } function At(N = 0) { if (!(N > -1)) return !1; const X = q.value(); e.hierarchy ? y(N, X, F) : F.value.splice(N, 0, X), Ce(); } function $t(N = 0) { if (!(N > -1 && e.hierarchy)) return !1; const X = q.value(), ne = F.value[N]; Ue(ne), C(N, X, F), Ce(); } function Lt(N, j = 0) { if (!(j > -1 && e.hierarchy)) return !1; const ne = F.value[j]; Ue(ne), w(j, N, F), Ce(); } function jt(N) { const j = N ? N - 1 : 0; F.value.splice(j, 1), Ce(); } function Ht(N) { const j = F.value.findIndex((X) => X[k.value] === N); j !== -1 && (F.value.splice(j, 1), Ce()); } function Ut(N) { const j = N > -1 ? F.value[N] : null; if (!(j && j.deletable !== !1)) return !1; F.value = R(j, F.value), Ce(); } function Gt() { const N = f.size > 0 ? Array.from(f.values()) : []; return ce(N, Array.from(u.values())); } function Je(N) { K.value.size = N; } function qt(N) { K.value && (Je(N), Ce()); } function zt(N, j) { const X = F.value[Number(N) - 1]; X.editable !== !1 ? (X.name = j, Ce()) : Z.show({ showCloseButton: !1, timeout: 3e3, animate: "fadeIn", toasts: [{ type: "string", title: "提示", msg: "当前节点禁止编辑" }] }); } function Wt(N) { return N.map((X) => { const ne = ee.value.findIndex((fe) => "" + fe[k.value] == "" + X); return ne > -1 ? ee.value[ne] : null; }).filter((X) => X != null); } function Yt() { const N = e.summary.groupFields; Q = N.reduce((j, X) => (j.set(X, 0), j), Q); for (const j of $.value) N.forEach((X) => { const ne = Q.get(X) || 0; Q.set(X, ne + ye(j, X)); }); N.forEach((j) => { const X = Q.get(j) || 0; Q.set(j, a(X.toFixed(2))); }); } function Xt(N) { const j = e.summary.groupFields; Q = j.reduce((X, ne) => (X.set(ne, 0), X), Q); for (const X of N) j.forEach((ne) => { const fe = Q.get(ne) || 0; Q.set(ne, fe + ye(X.raw, ne)); }); j.forEach((X) => { const ne = Q.get(X) || 0; Q.set(X, a(ne.toFixed(2))); }); } return { addFilter: z, addNewDataItem: Rt, addSorter: O, updatePageSize: Je, changePageSizeTo: qt, collapse: Ie, collapseTo: Nt, dataView: te, editDataItem: zt, expand: Vt, expandTo: Ot, filters: s, fold: xt, getRange: Pt, getSelectionItems: Wt, hasRealChildren: v, insertNewChildDataItem: $t, insertNewChildDataItems: Lt, insertNewDataItem: At, isVisibleInTree: L, load: Dt, navigatePageTo: Bt, pageIndex: P, rawView: ee, refresh: Gt, removeAllFilter: pe, removeDataItem: jt, removeDataItemById: Ht, removeFilter: ve, removeHierarchyDataItem: Ut, removeSorter: Y, reOrderVisibleIndex: be, setSorters: Pe, sorters: l, summaries: Q, updateSummary: Yt, toggleChildrenVisibiltyByCollapseStatus: I, totalItems: oe, unFold: It, updateDataView: Ce, visibleDataItems: se, shouldGroupingData: E, pagination: K, updateVisibleDataSummary: Xt }; } const Bn = [ "equal", "notEqual", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "contain", "startWidth", "endWidth", "in", "notIn" ], Rn = { equal: (e, t, n) => e && e[t] === n, notEqual: (e, t, n) => e && e[t] !== n, contain: (e, t, n) => e ? (e[t] || "").indexOf(n) > -1 : !1, startWidth: (e, t, n) => e ? (e[t] || "").startsWith(n) : !1, endWidth: (e, t, n) => e ? (e[t] || "").endsWith(n) : !1 }, An = { equal: (e, t, n) => e && e[t] === n, in: (e, t, n) => { if (e) { const o = e[t]; return n.indexOf(o) > -1; } return !1; }, notEqual: (e, t, n) => e && e[t] !== n }, $n = { equal: (e, t, n) => { if (e) { const o = new Date(new Date(n).toLocaleDateString()).valueOf(); return new Date(new Date(e[t]).toLocaleDateString()).valueOf() === o; } return !1; }, notEqual: (e, t, n) => { if (e) { const o = new Date(new Date(n).toLocaleDateString()).valueOf(); return new Date(new Date(e[t]).toLocaleDateString()).valueOf() !== o; } return !1; }, greaterThan: (e, t, n) => { if (e) { const o = new Date(new Date(n).toLocaleDateString()).valueOf(); return new Date(new Date(e[t]).toLocaleDateString()).valueOf() > o; } return !1; }, greaterThanOrEqual: (e, t, n) => { if (e) { const o = new Date(new Date(n).toLocaleDateString()).valueOf(); return new Date(new Date(e[t]).toLocaleDateString()).valueOf() >= o; } return !1; }, lessThan: (e, t, n) => { if (e) { const o = new Date(new Date(n).toLocaleDateString()).valueOf(); return new Date(new Date(e[t]).toLocaleDateString()).valueOf() < o; } return !1; }, lessThanOrEqual: (e, t, n) => { if (e) { const o = new Date(new Date(n).toLocaleDateString()).valueOf(); return new Date(new Date(e[t]).toLocaleDateString()).valueOf() <= o; } return !1; } }, Ln = { equal: (e, t, n) => e ? String(n).split(",").includes(String(e[t])) : !1, in: (e, t, n) => { if (e) { const o = e[t]; return n.indexOf(o) > -1; } return !1; }, notEqual: (e, t, n) => e ? String(n).split(",").findIndex((r) => r === String(e[t])) === -1 : !1 }, jn = { equal: (e, t, n) => { if (e) { const o = Number.parseFloat(String(n)), r = Number.parseFloat(String(e[t])); return isNaN(o) ? isNaN(r) : o === r; } return !1; }, notEqual: (e, t, n) => { if (e) { const o = Number.parseFloat(String(n)), r = Number.parseFloat(String(e[t])); return isNaN(o) ? !0 : o !== r; } return !1; }, greaterThan: (e, t, n) => { if (e) { const o = Number.parseFloat(String(n)), r = Number.parseFloat(String(e[t])); return isNaN(o) ? isNaN(r) : r > o; } return !1; }, greaterThanOrEqual: (e, t, n) => { if (e) { const o = Number.parseFloat(String(n)), r = Number.parseFloat(String(e[t])); return isNaN(o) ? isNaN(r) : r >= o; } return !1; }, lessThan: (e, t, n) => { if (e) { const o = Number.parseFloat(String(n)), r = Number.parseFloat(String(e[t])); return isNaN(o) ? isNaN(r) : r < o; } return !1; }, lessThanOrEqual: (e, t, n) => { if (e) { const o = Number.parseFloat(String(n)), r = Number.parseFloat(String(e[t])); return isNaN(o) ? isNaN(r) : r <= o; } return !1; } }, Hn = /* @__PURE__ */ new Map([ ["boolean", An], ["datetime", $n], ["enum", Ln], ["number", jn], ["text", Rn] ]); function Un(e, t) { const n = x([]), o = /* @__PURE__ */ new Map(), { loadConditionGroup: r } = hn(); function a(p, _) { switch (p) { case "check-box": return new Fn({ value: _ }); case "combo-list": return new kn({ value: _ }); case "combo-lookup": return new Tn({ value: _ }); case "input-group": return new Ge({ value: _ }); case "date-picker": return new En({ value: _ }); case "date-range": return new nt({ value: _ }); case "datetime-picker": return new Sn({ value: _ }); case "datetime-range": return new nt({ value: _ }); case "lookup": return new Ge({ value: _ }); case "month-picker": return new Cn({ value: _ }); case "month-range": return new wn({ value: _ }); case "number-range": return new bn({ value: _ }); case "number-spinner": return new yn({ value: _ }); case "radio-group": return new _n({ value: _ }); default: return new Ge({ value: _ }); } } const i = /* @__PURE__ */ new Map([ ["boolean", "check-box"], ["date", "date-picker"], ["datetime", "datetime-picker"], ["number", "number-spinner"], ["string", "text"], ["text", "text"], ["enum", "combo-list"], ["reference", "lookup"] ]), c = /* @__PURE__ */ new Map([ ["boolean", Ee.In], ["date", Ee.Equal], ["datetime", Ee.Equal], ["number", Ee.Equal], ["string", Ee.Equal], ["text", Ee.Equal], ["enum", Ee.In], ["reference", Ee.Equal] ]); function f() { return n.value.map((p) => ({ filterField: p.fieldCode, compare: p.compareType || p.compareType === 0 ? p.compareType : Ee.Like, value: p.value.value, relation: p.relation || p.relation === 0 ? p.relation : 1, expresstype: Be.Value, lbracket: p.lBracket || null, rbracket: p.rBracket || null })); } function d(p) { var v; const _ = p.dataType || "string