@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,298 lines • 2.16 MB
JavaScript
var Qg = Object.defineProperty;
var Xg = (e, t, n) => t in e ? Qg(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var J = (e, t, n) => Xg(e, typeof t != "symbol" ? t + "" : t, n);
import { ref as w, watch as Z, computed as V, createVNode as s, resolveComponent as Wn, isVNode as Pn, nextTick as St, inject as je, Fragment as ht, defineComponent as fe, createTextVNode as Me, withDirectives as Ut, vModelCheckbox as Ir, shallowRef as Nl, onMounted as Ke, onUnmounted as Jt, provide as rn, Teleport as hl, createApp as Zl, onBeforeMount as eo, watchEffect as Er, Transition as Xi, render as is, h as Sf, cloneVNode as Jg, mergeProps as sn, vShow as $a, onUpdated as Zg, onBeforeUnmount as xf, withModifiers as nn, vModelText as qa, toRef as ey, reactive as wt, resolveDirective as aa, Comment as Tf, getCurrentInstance as Or, toRefs as to, toRaw as ty, vModelSelect as ny } from "vue";
import gu, { FCheckbox as ja } from "../checkbox/index.esm.js";
import Oa from "../popover/index.esm.js";
import { LocaleService as ye } from "../locale/index.esm.js";
import { useCommonUtils as Xn, useNumberFormat as Uo, useFarrisConfig as kf, useGuid as Fn, getCustomClass as kt, isMobilePhone as Xt, withInstall as Nt, isImageUrl as ay, urlPrependBasePath as Ol, isBase64ImageUrl as ly, getCustomStyle as gn, FormSchemaEntityField$Type as Yl, FormSchemaEntityFieldType$Type as Eo, EVENT_PROPERTY_TAB_IDS as Ia, getMaxZIndex as _o, resolveField as pt, useDateFormat as Jn, useResizeObserver as Is, CHECKBOX_CONTEXT as yu, useCheck as bu, radioCheckboxCommonProps as Ff, useTouchMomentum as oy, useTouch as iy, useBem as In, useThirdComponent as Pf, FormSchemaEntityFieldTypeName as Vo, formatTime as ry, getDateObject as Na, isLeapYear as sy, compareDate as Ji, getDaysInMonth as uy, useTextBox as Mf, useClear as If, encrypt as cy, useDelayedRef as dy, RADIOGROUP_CONTEXT as Ef, useReqAnimationFrame as fy, getTimeObject as rs, formatObjecTime as py, useArrayProcessor as Of, setFieldValue as Es, useNativeBack as my } from "../common/index.esm.js";
import { F_MODAL_SERVICE_TOKEN as no } from "../modal/index.esm.js";
import { cloneDeep as bt, isUndefined as Nn, isPlainObject as Qc, debounce as Ua, isFunction as ss, mergeWith as Zi, merge as $o, isNil as vy, isNaN as hy, flatten as Bf, get as nl, isEmpty as gy, throttle as Xc } from "lodash-es";
import Df from "../transfer/index.esm.js";
import Af, { FTabPage as Vf } from "../tabs/index.esm.js";
import yy, { FFilterBar as by } from "../filter-bar/index.esm.js";
import { CompareType as He, useConditionValue as Cy, useConditionUtils as Cu, FConditionFields as Jc, FConditionFieldsDesign as Zc, useCondition as wy, ValueType as un, TextValue as Lf, CheckBoxValue as Sy, ComboListValue as xy, ComboLookupValue as Ty, FilterDatePickerValue as ky, FilterDateTimePickerValue as Fy, MonthPickerValue as Py, MonthRangeValue as My, FilterNumberSpinnerValue as Iy, RadioGroupValue as Ey, FilterInputGroupValue as Oy, FilterDateRangeValue as By, NumberRangeValue as Dy } from "../condition/index.esm.js";
import Br, { FInputGroup as er } from "../input-group/index.esm.js";
import fl, { FComboList as gl, FTouchComboListContainer as Nf, useDataSource as Ay, FComboListContainer as Vy } from "../combo-list/index.esm.js";
import Qn, { FButton as pl } from "../button/index.esm.js";
import Rl, { useNumber as Ly, useFormat as Ny, useSpinner as Ry, useTextBox as _y, getSpinnerRender as $y, getNumberTextBoxRender as jy, FNumberSpinner as Bi, useNumberLocales as Hy } from "../number-spinner/index.esm.js";
import ol from "../date-picker/index.esm.js";
import wu from "../pagination/index.esm.js";
import { useScreen as Dr, useFilter as Go, useIdentify as Yo, useHierarchy as Ko, useGroupData as Su, useDataView as Qo, useSelection as Xo, usePagination as xu, useRow as Jo, useEdit as Zo, useVisualDataBound as ei, useVisualDataCell as ti, useVisualDataRow as ni, useVisualGroupRow as Rf, useVisualSummaryRow as _f, useVisualData as ai, useSidebar as Ar, useColumn as li, useVirtualScroll as oi, getHierarchyRow as $f, useLoading as jf, useSelectHierarchyItem as Tu, useDataViewContainerStyle as Vr, useCommandColumn as Hf, useSettingColumn as zf, useSort as Wf, useGroupColumn as ku, useCellPosition as Lr, useFitColumn as Fu, useFilterHistory as qf, useColumnFilter as Uf, useDragColumn as Gf, getColumnHeader as Yf, getSidebar as Pu, getDisableMask as Kf, getHorizontalScrollbar as Mu, getVerticalScrollbar as Iu, getEmpty as Eu, getPagination as Qf, getSummary as Xf, ColumnSettingSolution as Jf, COMMAND_COLUMN_DATA_TYPE as Fa, SETTING_COLUMN_DATA_TYPE as Pa, SETTING_COLUMN_FIELD as zy, COMMAND_COLUMN_FIELD as Wy, CellMode as Zf, useCellContentStyle as qy, getFilterPanel as Uy, getGroupPanel as Gy, useAdapt as Yy, useNavigation as Ky } from "../data-view/index.esm.js";
import Ou from "../button-group/index.esm.js";
import Nr from "../drawer/index.esm.js";
import { FNotifyService as ya, F_NOTIFY_SERVICE_TOKEN as yl } from "../notify/index.esm.js";
import Qy, { FDataGrid as ao } from "../data-grid/index.esm.js";
import { FSwitch as ep } from "../switch/index.esm.js";
import Xy, { FLanguageTextbox as Jy } from "../language-textbox/index.esm.js";
import Zy, { FRadioGroup as tp, radioGroupProps as eb } from "../radio-group/index.esm.js";
import ii from "../list-view/index.esm.js";
import { resolveAppearance as Ot, createPropsResolver as mt, getPropsResolverGenerator as Dn, getSchemaByTypeForDesigner as tb, schemaResolverMap as nb, propertyEffectMap as ab, propertyConfigSchemaMap as lb, schemaMap as ob, getSchemaByType as jo, resolveToolbar as np, createPageHeaderEventHandlerResolver as ap, createEventsResolver as lp, createFormBindingResolver as ib } from "../dynamic-resolver/index.esm.js";
import { useDesignerComponent as fn, DgControl as Ue, canvasChanged as Di, refreshCanvas as rb, setPositionOfButtonGroup as op, useDragulaCommonRule as ip, UseTemplateDragAndDropRules as rp } from "../designer-canvas/index.esm.js";
import sp from "../color-picker/index.esm.js";
import { BaseControlProperty as up, InputBaseProperty as Bu, ExpressionProperty as sb, FormBindingType as xo, SchemaDOMMapping as ub } from "../property-panel/index.esm.js";
import cb, { FieldSelectorRepositoryToken as Ai } from "../field-selector/index.esm.js";
import "../collection-property-editor/index.esm.js/src/use-button-items.designer";
import db from "../tags/index.esm.js";
import { useInputExpand as Du } from "../common/index.esm.js/text-box/use-input-expand";
import Ga, { FButtonEdit as ri } from "../button-edit/index.esm.js";
import Yt from "bignumber.js";
import Au from "../../designer/button-edit/index.esm.js";
import il from "../tree-view/index.esm.js";
import { useResizeObserver as Vu } from "@vueuse/core";
import fb from "../binding-selector/index.esm.js";
import pb from "../accordion/index.esm.js";
import mb from "../../designer/avatar/index.esm.js";
import vb from "../../designer/approval-logs/index.esm.js";
import hb from "../calendar/index.esm.js";
import gb from "../../designer/capsule/index.esm.js";
import ed from "../../designer/checkbox/index.esm.js";
import td from "../../designer/checkbox-group/index.esm.js";
import yb from "../content-container/index.esm.js";
import bb from "../../designer/data-grid/index.esm.js";
import Cb from "../../designer/date-picker/index.esm.js";
import wb from "../dropdown/index.esm.js";
import Sb from "../../designer/dynamic-form/index.esm.js";
import xb from "../external-container/index.esm.js";
import Tb from "../image-cropper/index.esm.js";
import kb from "../../designer/input-group/index.esm.js";
import Lu, { FLayout as Fb, FLayoutPane as Kl } from "../layout/index.esm.js";
import Pb from "../list-nav/index.esm.js";
import Mb from "../../designer/list-view/index.esm.js";
import cp from "../lookup/index.esm.js";
import Ib from "../../designer/nav/index.esm.js";
import Eb from "../../designer/number-spinner/index.esm.js";
import Ob from "../number-range/index.esm.js";
import Bb from "../order/index.esm.js";
import Db from "../page-header/index.esm.js";
import Ab from "../page-footer/index.esm.js";
import Vb from "../progress/index.esm.js";
import Lb, { useCondition as Nb, useSolutionUtils as dp } from "../query-solution/index.esm.js";
import Rb from "../../designer/radio-group/index.esm.js";
import _b from "../../designer/rate/index.esm.js";
import $b, { commonToolbarItemDesignProps as jb } from "../../designer/response-toolbar/index.esm.js";
import Hb from "../response-layout/index.esm.js";
import zb from "../../designer/response-layout-editor/index.esm.js";
import Wb, { FSearchBox as qb } from "../search-box/index.esm.js";
import Ub from "../../designer/section/index.esm.js";
import Gb from "../smoke-detector/index.esm.js";
import Yb from "../splitter/index.esm.js";
import fp from "../step/index.esm.js";
import Kb from "../../designer/switch/index.esm.js";
import Qb from "../../designer/tabs/index.esm.js";
import Xb from "../../designer/tags/index.esm.js";
import Jb from "../text/index.esm.js";
import Zb from "../../designer/time-picker/index.esm.js";
import eC from "../uploader/index.esm.js";
import tC from "../verify-detail/index.esm.js";
import nC from "../component/index.esm.js";
import aC from "../video/index.esm.js";
import lC from "../../designer/textarea/index.esm.js";
import oC from "../../designer/tree-grid/index.esm.js";
import iC from "../fieldset/index.esm.js";
import rC from "../../designer/drawer/index.esm.js";
import sC from "../html-template/index.esm.js";
import uC from "../image/index.esm.js";
import cC from "../comment/index.esm.js";
import dC from "../../designer/wizard/index.esm.js";
import { loadRegister as fC, useComponentManager as pC, useEntityState as mC, useDynamicViewUtils as vC, componentMap as us, resolverMap as hC, componentPropsConverter as gC } from "../dynamic-view/index.esm.js";
import Os from "../section/index.esm.js";
import yC from "../combo-tree/index.esm.js";
import bC from "../events-editor/index.esm.js";
import CC from "../mapping-editor/index.esm.js";
import wC from "../schema-selector/index.esm.js";
import pp, { EditorType as SC } from "../event-parameter/index.esm.js";
import xC from "../filter-condition-editor/index.esm.js";
import TC from "../sort-condition-editor/index.esm.js";
import kC from "../menu-lookup/index.esm.js";
import FC from "../json-editor/index.esm.js";
import PC from "../property-editor/index.esm.js";
import MC, { FExpressionTextbox as IC } from "../expression-editor/index.esm.js";
import EC from "../code-editor/index.esm.js";
import OC from "../collection-property-editor/index.esm.js";
import BC from "../../designer/modal/index.esm.js";
import DC from "../tooltip/index.esm.js";
import AC, { FTreeGrid as Nu } from "../tree-grid/index.esm.js";
import VC, { FDynamicForm as LC, FDynamicFormLabel as NC, FDynamicFormGroup as tr, useTypeResolver as mp, FDynamicFormInput as RC } from "../dynamic-form/index.esm.js";
import _C, { FTimePickerTimeView as nd, convertToDate as $C, FTouchTimePickerTimeView as jC } from "../time-picker/index.esm.js";
import Ru from "../capsule/index.esm.js";
import { createI18n as HC, useI18n as zC } from "vue-i18n";
import { DgControl as WC } from "../designer-canvas/index.esm.js/";
import { FDatePicker as ad } from "../components/index.esm.js";
import { FCheckboxGroup as qC } from "../checkbox-group/index.esm.js";
import { SearchRelation as UC, SearchComparisonOperator as GC } from "../field-search-box/index.esm.js";
import lo from "../scroll-list/index.esm.js";
import _u from "../response-toolbar/index.esm.js";
import YC, { FLoadingService as KC } from "../loading/index.esm.js";
import { FMessageBoxService as QC } from "../message-box/index.esm.js";
import XC from "../textarea/index.esm.js";
var hn = /* @__PURE__ */ ((e) => (e[e.readonly = 0] = "readonly", e[e.editable = 1] = "editable", e[e.editing = 2] = "editing", e))(hn || {}), la = /* @__PURE__ */ ((e) => (e[e.initial = 0] = "initial", e[e.editing = 1] = "editing", e))(la || {}), Qt = /* @__PURE__ */ ((e) => (e[e.data = 0] = "data", e[e.group = 1] = "group", e[e.summary = 2] = "summary", e))(Qt || {});
const UG = {
/** 显示行号 */
enable: { type: Boolean, default: !1 },
/** 行号列表头标题 */
heading: { type: String, default: "序号" },
/** 行号宽度,默认为 36px */
width: { type: Number, default: 36 }
}, GG = {
/** 启用分页 */
enable: { type: Boolean, default: !1 },
/** 当前页码 */
index: { type: Number, default: 1 },
/** 分页交互模式 */
mode: { type: String, default: "server" },
/** 显示页码输入框 */
showGoto: { type: Boolean, default: !1 },
/** 显示页码 */
showIndex: { type: Boolean, default: !0 },
/** 显示每页记录数 */
showLimits: { type: Boolean, default: !1 },
/** 显示分页汇总信息 */
showPageInfo: { type: Boolean, default: !0 },
/** 默认每页记录数 */
size: { type: Number, default: 20 },
/** 可选择的没有记录数据 */
sizeLimits: { type: Array, default: [10, 20, 30, 50, 100] },
/** 总记录数 */
total: { type: Number, default: 0 },
/** 禁用分页 */
disabled: { type: Boolean, default: !1 }
};
var Ee = /* @__PURE__ */ ((e) => (e[e.none = 0] = "none", e[e.filterable = 1] = "filterable", e[e.sortable = 2] = "sortable", e[e.filtered = 4] = "filtered", e[e.sorted = 8] = "sorted", e[e.ascending = 16] = "ascending", e[e.descending = 32] = "descending", e))(Ee || {}), JC = /* @__PURE__ */ ((e) => (e.NONE = "none", e.NUMBER = "number", e.DATE = "date", e.TEXT = "boolean", e.IMAGE = "boolean2", e.ENUM = "enum", e.CUSTOM = "custom", e))(JC || {}), ta = /* @__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))(ta || {}), ZC = /* @__PURE__ */ ((e) => (e.Column = "column", e.Group = "group", e))(ZC || {});
function ew(e, t) {
var C, y, g, b, T, S, P, k, x;
const { isUndefined: n } = Xn(), { pageIndex: a, totalItems: l, pagination: o } = t, i = w((C = e.pagination) == null ? void 0 : C.enable), r = w(((y = e.pagination) == null ? void 0 : y.disabled) || !1), c = w((g = e.pagination) == null ? void 0 : g.size), f = w((b = e.pagination) == null ? void 0 : b.sizeLimits), d = w((T = e.pagination) == null ? void 0 : T.mode), u = w((S = e.pagination) == null ? void 0 : S.showIndex), p = w((P = e.pagination) == null ? void 0 : P.showLimits), v = w(((k = e.pagination) == null ? void 0 : k.showGoto) || !1), m = w(((x = e.pagination) == null ? void 0 : x.showPageInfo) || !0);
Z(() => {
var I;
return (I = e.pagination) == null ? void 0 : I.disabled;
}, (I, F) => {
I !== F && (r.value = I);
}), Z(() => {
var I;
return (I = e.pagination) == null ? void 0 : I.sizeLimits;
}, (I, F) => {
f.value = I;
}), Z(() => {
var I;
return (I = e.pagination) == null ? void 0 : I.showIndex;
}, (I, F) => {
I !== F && (u.value = I);
}), Z(() => {
var I;
return (I = e.pagination) == null ? void 0 : I.showLimits;
}, (I, F) => {
I !== F && (p.value = I);
}), Z(() => {
var I;
return (I = e.pagination) == null ? void 0 : I.total;
}, (I, F) => {
I !== F && (l.value = I);
}), Z(() => {
var I;
return (I = e.pagination) == null ? void 0 : I.enable;
}, (I, F) => {
I !== F && (i.value = I);
}), Z(() => {
var I;
return (I = e.pagination) == null ? void 0 : I.showGoto;
}, (I, F) => {
I !== F && (v.value = I);
}), Z(() => {
var I;
return (I = e.pagination) == null ? void 0 : I.showPageInfo;
}, (I, F) => {
I !== F && (m.value = I);
}), Z(() => {
var I;
return (I = e.pagination) == null ? void 0 : I.index;
}, (I, F) => {
I !== F && (a.value = I);
}), Z(() => {
var I;
return (I = e.pagination) == null ? void 0 : I.size;
}, (I, F) => {
I !== F && (c.value = I);
});
const h = (I) => {
if (!I)
return;
const { enable: F, total: E, size: M, index: O, sizeLimits: B, showGoto: A, showIndex: D, showLimits: N, mode: _, disabled: $ } = I;
n(F) || (i.value = F), n(O) || (a.value = O), n(M) || (c.value = M), n(B) || (f.value = B), n(A) || (v.value = A), n(D) || (u.value = D), n(N) || (p.value = N), n(_) || (d.value = _), n(E) || (l.value = E), n($) || (r.value = $);
};
return Z(() => e.pagination, (I, F) => {
I !== F && (o.value = I, h(I));
}), {
disabled: r,
pageSize: c,
pageList: f,
shouldRenderPagination: i,
showGotoPage: v,
showPageIndex: u,
showPageList: p,
showPageInfo: m,
mode: d,
updatePagination: h
};
}
function ld(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Pn(e);
}
function tw(e, t, n, a, l, o, i, r, c, f, d) {
const {
updatePagination: u
} = ew(e, n), {
showSidebarCheckBox: p
} = f, {
showSelectAll: v,
showSelection: m,
selectedValues: h,
updateSelectAllStatus: C,
keepSelectingOnPaging: y,
clearSelection: g
} = c, b = w([]), T = w([]), S = [{
name: ye.getLocaleValue("datagrid.settings.asc"),
value: "asc",
icon: "f-icon f-icon-col-ascendingorder"
}, {
name: ye.getLocaleValue("datagrid.settings.summaryNone"),
value: "none"
}, {
name: ye.getLocaleValue("datagrid.settings.desc"),
value: "desc",
icon: "f-icon f-icon-col-descendingorder"
}], P = V(() => {
var G, U;
return ((G = e.filter) == null ? void 0 : G.mode) === "server" || ((U = e.sort) == null ? void 0 : U.mode) === "server";
}), {
addColumnFilter: k,
removeColumnFilter: x,
createFilterConditions: I,
filterFromServer: F
} = l;
function E() {
y.value || g(), n.updateVisibleDataSummary(d.value);
}
function M(G) {
T.value = G;
}
function O(G) {
b.value = G;
}
function B(G) {
const U = G.status, W = (U & Ee.sorted) === Ee.sorted, Y = (U & Ee.ascending) === Ee.ascending, Q = (U & Ee.descending) === Ee.descending;
let K = W ? U ^ Ee.sorted : U;
return K = Y ? K ^ Ee.ascending : K, K = Q ? K ^ Ee.descending : K, K;
}
function A(G) {
G.sortType = "none", G.status = B(G);
const U = G.column;
U && (U.sort = "none", U.sortOrder = 0, t.applyColumnSorter(n, i));
}
function D(G, U) {
U.column && (U.column.filter = null), x(U), n.refresh(), A(U), U.filterHistory && U.filterHistory.forEach((W) => {
W.checked = !1;
});
}
function N(G, U) {
var Y;
const W = G.filter((Q) => Q.field !== U.field);
(Y = e.sort) != null && Y.multiSort || W.forEach((Q) => {
const K = Q.status, q = (K & Ee.sortable) === Ee.sortable, L = (K & Ee.sorted) === Ee.sorted, R = (K & Ee.filtered) === Ee.filtered;
q && L && (Q.status = K & Ee.sortable, Q.column.sort = "none", Q.column.sortOrder = 0), R && (Q.status = K & Ee.filtered);
});
}
function _(G) {
var Q;
const U = B(G), W = G.sortType === "none" ? U : G.sortType === "asc" ? U | Ee.sorted | Ee.ascending : U | Ee.sorted | Ee.descending;
G.status = W;
const Y = G.column;
Y && (Y.sort = G.sortType, Y.sortOrder = G.sortType !== "none" ? Y.sortOrder : 0, G.status = W, O(t.createSortConditions(i)), ((Q = e.sort) == null ? void 0 : Q.mode) !== "server" && (t.applyColumnSorter(n, i), r.reCalculateVisualDataRows(), E()));
}
function $(G) {
var Y, Q;
const U = (G.status & Ee.filtered) === Ee.filtered;
G.status = U ? G.status ^ Ee.filtered : G.status | Ee.filtered, ((Y = G.column) == null ? void 0 : Y.filter) != null && G.column.filter !== "" && G.filter ? k(G) : x(G), M(I()), ((Q = e.filter) == null ? void 0 : Q.mode) !== "server" && (n.refresh(), r.reCalculateVisualDataRows(), E());
}
function H(G, U) {
var W;
U.showPopover = !1, U.filterHistory = void 0, o.updateFilterHistory(U, (W = U.column) == null ? void 0 : W.filter), $(U), N(G, U), _(U), P.value && F({
filterConditions: T.value,
sortConditions: b.value
});
}
function j(G, U) {
var Q, K;
let W, Y;
return s("div", {
class: "fv-column-sort-filter-container"
}, [((Q = U.column) == null ? void 0 : Q.sortable) && s("div", {
class: "fv-column-sort-section"
}, [s(Wn("f-capsule"), {
items: S,
modelValue: U.sortType,
"onUpdate:modelValue": (q) => U.sortType = q,
type: "secondary"
}, null)]), s("div", {
class: "fv-column-filter-section"
}, [s("div", {
class: "fv-column-filter-section-title"
}, [ye.getLocaleValue("datagrid.filter.title")]), s("div", {
class: "fv-column-filter-section-editor"
}, [a.getFilterEditor(U)])]), s("div", {
class: "fv-column-sort-filter-footer"
}, [((K = U.column) == null ? void 0 : K.dataType) !== "enum" && s("div", {
class: "fv-column-clear-section"
}, [s(Wn("f-button"), {
style: "margin: 4px 0;padding-left: 0;",
type: "link",
onClick: (q) => D(q, U)
}, ld(W = ye.getLocaleValue("datagrid.filter.clear")) ? W : {
default: () => [W]
})]), s("div", {
class: "fv-column-confirm-section"
}, [s(Wn("f-button"), {
customClass: {
"f-btn-ml": !0
},
size: "small",
onClick: (q) => H(G, U)
}, ld(Y = ye.getLocaleValue("datagrid.filter.ok")) ? Y : {
default: () => [Y]
})])])]);
}
return {
renderFilterContainer: j,
onConfirm: H
};
}
function nw(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Pn(e);
}
function aw(e, t, n, a, l, o, i, r, c, f, d, u, p, v, m) {
const h = V(() => {
var $;
return (($ = e.filter) == null ? void 0 : $.filterStyle) !== "filter-row" && e.displayType !== "Card";
});
function C($) {
const H = $.status;
return {
"fv-column-handler": !0,
"fv-column-handler-active": (H & Ee.filtered) === Ee.filtered || (H & Ee.sorted) === Ee.sorted || $.showPopover
};
}
function y($) {
return ($.status & Ee.sortable) === Ee.sortable && (h.value ? ($.status & Ee.filterable) === Ee.none : !0) && ($.status & Ee.sorted) === Ee.none;
}
function g($) {
return ($.status & Ee.sortable) === Ee.sortable && (h.value ? ($.status & Ee.filterable) === Ee.none : !0) && ($.status & Ee.sorted) === Ee.sorted && ($.status & Ee.ascending) === Ee.ascending;
}
function b($) {
return ($.status & Ee.sortable) === Ee.sortable && (h.value ? ($.status & Ee.filterable) === Ee.none : !0) && ($.status & Ee.sorted) === Ee.sorted && ($.status & Ee.descending) === Ee.descending;
}
function T($) {
return ($.status & Ee.sortable) === Ee.none && ($.status & Ee.filterable) === Ee.filterable && ($.status & Ee.sorted) === Ee.none;
}
function S($) {
return ($.status & Ee.sortable) === Ee.sortable && ($.status & Ee.filterable) === Ee.filterable && ($.status & Ee.sorted) === Ee.none;
}
function P($) {
return ($.status & Ee.sortable) === Ee.sortable && ($.status & Ee.filterable) === Ee.filterable && ($.status & Ee.sorted) === Ee.sorted && ($.status & Ee.ascending) === Ee.ascending;
}
function k($) {
return ($.status & Ee.sortable) === Ee.sortable && ($.status & Ee.filterable) === Ee.filterable && ($.status & Ee.sorted) === Ee.sorted && ($.status & Ee.descending) === Ee.descending;
}
const x = function($) {
return {
"f-icon": !0,
"f-icon-col-defaultsort": y($),
"f-icon-col-ascending": g($),
"f-icon-col-descending": b($),
"f-icon-col-filter": h.value && T($),
"f-icon-col-defaultfilterandsort": h.value && S($),
"f-icon-col-filterandascending": h.value && P($),
"f-icon-col-filteranddescending": h.value && k($)
};
}, I = /* @__PURE__ */ new Map([[Ee.sortable, Ee.sortable | Ee.sorted | Ee.ascending], [Ee.sortable | Ee.sorted | Ee.ascending, Ee.sortable | Ee.sorted | Ee.descending], [Ee.sortable | Ee.sorted | Ee.descending, Ee.sortable]]), {
renderFilterContainer: F
} = tw(e, o, i, r, c, f, d, u, p, v, m), E = w();
function M($, H) {
H.filter((j) => j !== $ && j.showPopover).forEach((j) => {
j.showPopover = !1;
});
}
function O($, H) {
let j;
return s(Oa, {
ref: E,
class: "fv-column-handler-popover",
"z-index": 1050,
"right-boundary": l.value,
offsetX: -u.offsetX,
placement: "auto",
visible: !0,
onHidden: () => {
H.showPopover = !1;
}
}, nw(j = F($, H)) ? j : {
default: () => [j]
});
}
async function B($, H) {
H.showPopover = !H.showPopover, await St();
const j = E.value;
j && j.show($.target);
}
function A($, H) {
var G;
const j = $.filter((U) => U.field !== H.field);
(G = e.sort) != null && G.multiSort || j.forEach((U) => {
const W = U.status, Y = (W & Ee.sortable) === Ee.sortable, Q = (W & Ee.sorted) === Ee.sorted;
Y && Q && (U.status = W & ~(Ee.sorted | Ee.ascending | Ee.descending) | Ee.sortable, U.status = W & ~(Ee.sorted | Ee.ascending | Ee.descending), U.column.sort = "none", U.column.sortOrder = 0);
});
}
function D($) {
var U;
const H = $.status;
if ((H & Ee.sortable) === Ee.sortable && (h.value ? (H & Ee.filterable) === Ee.none : !0)) {
const W = H & ~Ee.filterable & ~Ee.filtered, Y = I.get(W);
if (Y !== void 0) {
const Q = H & (Ee.filterable | Ee.filtered), K = Y & ~Q | Q, q = (K & Ee.sorted) === Ee.sorted, L = (K & Ee.ascending) === Ee.ascending, R = (K & Ee.descending) === Ee.descending, z = $.column;
z && (z.sort = L ? "asc" : R ? "desc" : "none", z.sortOrder = q ? z.sortOrder : 0, $.sortType = z.sort, $.status = K, ((U = e.sort) == null ? void 0 : U.mode) === "server" ? t.emit("sortChanged", {
filterConditions: c.createFilterConditions(),
sortConditions: o.createSortConditions(d)
}) : (o.applyColumnSorter(i, d), u.reCalculateVisualDataRows()));
}
}
}
function N($, H, j) {
A(j, H), D(H), M(H, j), h.value && (H.status & Ee.filterable) === Ee.filterable && B($, H);
}
function _($, H, j) {
return [s("span", {
class: C($),
onClick: (U) => N(U, $, j)
}, [s("i", {
class: x($)
}, null), $ && $.column && $.sortType !== "none" && ($.column.sortOrder || "") && s("span", {
class: "fv-column-sort-number"
}, [$.column.sortOrder]), $.showPopover && h.value && O(j, $)])];
}
return {
renderHeaderCellHandler: _
};
}
const vp = "__setting__", YG = "设置", lw = 30, ow = "right", ha = "setting", hp = "__command__", KG = "操作", iw = 150, rw = "right", Ea = "commands";
function sw(e, t, n, a, l, o, i) {
const r = "id", c = w();
let f;
const {
applySortableColumns: d,
collectionFilterableColumns: u,
collectionSortableColumns: p,
columnContext: v,
updateColumnSettingIcon: m
} = e, {
conditions: h
} = n, {
calculateColumnsSize: C
} = a, {
fitHorizontalScroll: y
} = o, g = w([]), b = V(() => !!g.value.length), T = V(() => v.value.primaryColumns.filter((j) => j.dataType !== Ea && j.dataType !== ha));
let S = [];
const P = w(T.value.map((j) => ({
id: j.field,
name: j.title
}))), k = V(() => T.value.filter((j) => j.visible).map((j) => ({
id: j.field,
name: j.title
})));
V(() => p().map((j) => ({
id: j.field,
name: j.title,
order: j.sort
}))), V(() => u().map((j) => ({
id: j.field,
code: j.field,
controlType: "",
labelCode: j.field,
name: j.title,
editor: j.editor,
// || ({ type: useFilterComposition.getFilterEditorType(filterableColumn) } as EditorConfig),
value: {},
visible: !0
})));
function x() {
const j = /* @__PURE__ */ new Map();
return T.value.reduce((G, U) => (U.visible = !1, G.set(U.field, U), G), j), j;
}
function I(j, G) {
return j.map(({
id: W
}) => {
const Y = G.get(W);
return Y.visible = !0, G.delete(W), Y;
});
}
function F(j) {
const G = v.value.primaryColumns.filter((Q) => Q.dataType === Ea), U = v.value.primaryColumns.filter((Q) => Q.dataType === ha), W = x(), Y = I(j, W);
G.length || U.length ? v.value.primaryColumns = [...Y, ...Array.from(W.values()), ...G, ...U] : v.value.primaryColumns = [...Y, ...Array.from(W.values())], m(), C(), St(() => {
y();
});
}
function E() {
F(S), f == null || f.destroy();
}
function M(j) {
return s("div", {
class: "fv-grid-settings"
}, [s(Af, {
"tab-type": "pills",
"justify-content": "center"
}, {
headerPrefix: () => s("div", {
class: "modal-title"
}, [s("span", {
class: "modal-title-label"
}, [ye.getLocaleValue("datagrid.settings.title")])]),
default: () => [
s(Vf, {
id: "display-columns",
title: ye.getLocaleValue("datagrid.settings.visible"),
class: "container"
}, {
default: () => [s(Df, {
style: "height: 480px",
displayType: "Tree",
"identify-field": r,
"data-source": P.value,
selections: k.value,
onChange: F
}, null)]
})
// <FTabPage id="column-order" title="列排序" class="container">
// <FOrder
// style="height: 480px"
// data-source={dataSoruce.value}
// items={sortedColumns.value}
// onChange={onSortedColumnsChange}></FOrder>
// </FTabPage>
// FConditionList组件功能不完善,先把表格筛选特性隐藏掉
// <FTabPage id="column-filter" title="筛选" class="container">
// <FConditionList
// ref={conditionListRef}
// style="height: 480px"
// fields={filterableColumns.value}
// conditions={conditions.value}></FConditionList>
// </FTabPage>
],
headerSuffix: () => s("div", {
class: "f-btn-icon f-bare",
onClick: (G) => E()
}, [s("span", {
class: "f-icon modal_close"
}, null)])
})]);
}
function O() {
const j = /* @__PURE__ */ new Map();
return p().reduce((G, U) => (U.sort = "none", U.sortOrder = 0, G.set(U.field, U), G), j), j;
}
function B(j) {
return g.value.filter((U) => U.id && U.order).map((U, W) => {
const Y = W + 1, Q = j.get(U.id);
return Q && (Q.sort = U.order, Q.sortOrder = Y), Q;
});
}
function A() {
if (b.value) {
const j = O(), G = B(j);
d(G, t, l), o.reCalculateVisualDataRows(), C();
}
}
function D() {
c.value && (h.value = c.value.getConditions(), t.refresh(), o.reCalculateVisualDataRows());
}
function N() {
A(), D();
}
function _() {
S = bt(k.value);
}
function $() {
F(S);
}
function H() {
f = i.open({
title: "",
width: 800,
showButtons: !0,
showHeader: !1,
dragHandle: ".farris-tabs-header",
draggable: !0,
render: M,
acceptCallback: N,
rejectCallback: $
}), _();
}
return {
acceptCallback: N,
rejectCallback: $,
renderSettingsPanel: M,
openSettingPanel: H
};
}
function uw(e, t, n, a, l, o, i, r) {
const c = je(no), f = V(() => ({
margin: "0px"
}));
function d(p) {
if (p.stopPropagation(), e.showSetting && e.enableColumnSettingSolution && (r.value = !0), e.showSetting && !e.enableColumnSettingSolution) {
const {
openSettingPanel: v
} = sw(t, n, a, l, o, i, c);
v();
}
}
function u() {
return s("span", {
class: "fv-grid-settings-icon",
style: f.value,
onClick: d
}, [s("i", {
class: "f-icon f-icon-home-setup"
}, null)]);
}
return {
renderGridSettingsIcon: u
};
}
function cw(e, t, n, a) {
const o = w(-1), i = w(0), r = w(!1);
let c = "";
const f = V(() => ({
display: r.value ? "block" : "none",
left: `${i.value}px`
})), d = V(() => ({
display: r.value ? "block" : "none"
}));
function u(m) {
const h = m.target.parentElement;
if (h) {
const { left: C } = h.getBoundingClientRect();
i.value = m.clientX - C;
}
}
function p(m) {
const h = t.value.primaryColumns.filter((y) => y.visible).find((y) => y.field === c) || t.value.leftColumns.filter((y) => y.visible).find((y) => y.field === c) || t.value.rightColumns.filter((y) => y.visible).find((y) => y.field === c), C = m.target.parentElement;
if (h && C) {
const { left: y } = C.getBoundingClientRect(), g = m.clientX - y, b = (h.actualWidth || 0) + (g - o.value);
h.actualWidth = Math.max(40, b), n.calculateColumnsSize();
}
i.value = 0, r.value = !1, document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", p), document.body.style.userSelect = "", c = "";
}
function v(m, h) {
c = h, r.value = !0;
const y = m.composedPath().find((g) => g.className.split(" ")[0] === "fv-grid");
if (y) {
const { left: g } = y.getBoundingClientRect();
i.value = m.clientX - g, o.value = m.clientX - g, document.addEventListener("mousemove", u), document.addEventListener("mouseup", p), document.body.style.userSelect = "none";
}
}
return { onClickColumnResizeBar: v, resizeHandleStyle: f, resizeOverlayStyle: d };
}
function QG(e, t, n, a, l, o, i, r, c, f, d, u, p, v, m, h, C, y, g, b) {
const {
showSelectAll: T,
selectAll: S,
unSelectAll: P,
selectedValues: k,
selectAllStatus: x,
indeterminateStatus: I,
emitSelectionChanged: F
} = v, {
showRowNumer: E,
showSidebarCheckBox: M,
sidebarTitle: O,
sidebarCornerCellStyle: B
} = m, {
columnContext: A,
hasLeftFixedColumn: D,
hasRightFixedColumn: N
} = o, {
onClickColumnResizeBar: _,
resizeHandleStyle: $,
resizeOverlayStyle: H
} = cw(e, A, u), {
gridHeaderColumnsStyle: j,
leftFixedGridHeaderColumnsStyle: G,
rightFixedGridHeaderColumnsStyle: U
} = C, {
dragstart: W,
dragenter: Y,
dragover: Q,
dragend: K
} = r, q = V(() => T.value || M.value || E.value), L = A.value.defaultColumnWidth, {
shouldShowFilterRow: R,
renderHeaderFilterStrip: z,
renderActiveFilterPopover: X,
gridHeaderFilterStripHeight: ee
} = Pw(e, o, i, f, h, C, l), ae = V(() => e.displayType === "Card" ? 30 : 35), ne = V(() => A.value.headerDepth * ae.value + ee.value), te = /* @__PURE__ */ new Map([[0, 0]]), re = V(() => e.showHeader);
function ge(Ve, se) {
var Ge;
const Ne = ((Ge = Ve.column) == null ? void 0 : Ge.dataType) === "setting", ce = te.get(se) || 0, Ce = ae.value, Ze = ee.value, Qe = {
height: `${Ve.depth * Ce + Ze}px`,
left: `${Ve.left}px`,
top: `${(Ve.layer - 1) * Ce}px`,
width: `${Ve.actualWidth}px`
};
return A.value.headerDepth > 1 && !R.value && (Qe["line-height"] = `${Ve.depth * Ce}px`), Ne && (Qe.paddingLeft = "2px"), e.showBorder && (Qe.border = "1px solid #e6e9f0"), te.set(se + 1, ce + (Ve.actualWidth || L)), Qe;
}
function Be(Ve, se) {
var ce;
const Ne = ge(Ve, se);
return e.displayType === "Card" && (Ne.position = "relative", Ne.overflow = "visible", delete Ne.left, (ce = e.columnOption) != null && ce.fitColumns && e.fit ? (Ne.flex = "1", Ne.overflow = "hidden", Ne.textOverflow = "ellipsis", Ne.whiteSpace = "nowrap", delete Ne.width) : Ne.flexShrink = "0"), Ne;
}
const Je = V(() => {
var se;
return {
"fv-grid-header": !0,
"fv-grid-header-group-columns": A.value.headerDepth > 1,
"fv-grid-scrollbar-visible": C.shouldShowVirticalScrollbar.value && ((se = C.mouseInContent) == null ? void 0 : se.value)
};
}), Ie = V(() => {
var se;
const Ve = {
height: `${ne.value}px`
};
return C.shouldShowVirticalScrollbar.value && ((se = C.mouseInContent) != null && se.value), e.displayType === "Card" && (Ve.overflow = "visible", Ve.position = "sticky", Ve.flexShrink = "0", Ve.left = "0", Ve.top = "0", Ve.zIndex = "3", Ve.width = "100%"), Ve;
});
V(() => {
var Ve;
return {
width: `${Number((Ve = e.rowNumber) == null ? void 0 : Ve.width)}px`
};
});
const oe = function(Ve) {
const se = (Ve.status & Ee.sortable) === Ee.sortable, Ne = (Ve.status & Ee.filterable) === Ee.filterable;
return R.value ? se : se || Ne;
}, {
renderHeaderCellHandler: pe
} = aw(e, t, n, a, l, o, i, c, f, d, h, C, v, m, g), {
renderGridSettingsIcon: ue
} = uw(e, o, i, f, u, h, C, b);
function we(Ve) {
var Ne;
const se = {
"fv-grid-header-cell": !0,
"fv-grid-header-cell-border": e.showBorder,
"fv-grid-header-cell--filter-row": R.value
};
return se["text-" + (((Ne = Ve.column) == null ? void 0 : Ne.halign) || "left")] = !0, se;
}
function ve(Ve) {
if (I.value = !1, Ve) {
if (S(), e.displayType === "Card")
return;
t.emit("selectAll", Ve);
} else {
if (P(), e.displayType === "Card")
return;
t.emit("unSelectAll", Ve);
}
F();
}
function De(Ve) {
return s("span", {
class: "fv-column-title",
title: Ve.title
}, [Ve.title]);
}
function dt(Ve, se, Ne) {
var ce, Ce, Ze, Qe, Ge, rt, ft;
return s(ht, null, [e.hierarchy && Ne === 0 && ((ce = Ve.column) == null ? void 0 : ce.dataType) !== ha && ((Ce = Ve.column) == null ? void 0 : Ce.dataType) !== Ea && T.value && s("span", {
style: "margin-left: .75rem; margin-right: .5rem"
}, [s(ja, {
id: "checkbox_for_select_all",
checked: x.value,
"onUpdate:checked": (We) => x.value = We,
indeterminate: I.value,
onChangeValue: ve
}, null)]), ((Ze = Ve.column) == null ? void 0 : Ze.dataType) === "setting" && e.showSetting && e.displayType !== "Card" ? ue() : t.slots.headerCellTemplate ? t.slots.headerCellTemplate({
headerCell: Ve,
headerCells: se,
columnIndex: Ne
}) : (Qe = Ve.column) != null && Qe.headerFormatter ? (rt = (Ge = Ve.column).headerFormatter) == null ? void 0 : rt.call(Ge, {
headerCell: Ve,
headerCells: se,
columnIndex: Ne
}) : (ft = Ve.column) != null && ft.showTips ? De(Ve) : s("span", {
class: "fv-column-title"
}, [Ve.title]), oe(Ve) && pe(Ve, Ne, se)]);
}
function Tt(Ve, se, Ne) {
var Qe;
const ce = Ve.depth * ae.value, Ce = R.value ? {
height: `${ce}px`
} : void 0, Ze = R.value && A.value.headerDepth > 1 && ((Qe = Ve.children) != null && Qe.length) ? {
lineHeight: `${ce}px`
} : void 0;
if (R.value) {
const Ge = {
display: "flex",
flexDirection: "column",
alignItems: "stretch",
padding: 0,
whiteSpace: "normal"
};
return s("div", {
class: we(Ve),
style: {
...Be(Ve, Ne),
...Ge
},
draggable: Ve.draggable,
onDragstart: (rt) => W(rt, Ve, Ne),
onDragenter: (rt) => Y(rt, Ne),
onDragend: (rt) => K(rt, Ve),
onDragover: (rt) => Q(rt, Ne)
}, [s("div", {
class: "fv-grid-header-title",
style: {
...Ce,
...Ze
}
}, [dt(Ve, se, Ne)]), s("div", {
class: "fv-grid-header-filter"
}, [z(Ve) ?? s("div", {
class: "fv-grid-header-filter-placeholder"
}, null)]), Ve.resizable && s("span", {
class: "fv-column-resize-bar",
onMousedown: (rt) => _(rt, Ve.field)
}, null)]);
}
return s("div", {
class: we(Ve),
style: Be(Ve, Ne),
draggable: Ve.draggable,
onDragstart: (Ge) => W(Ge, Ve, Ne),
onDragenter: (Ge) => Y(Ge, Ne),
onDragend: (Ge) => K(Ge, Ve),
onDragover: (Ge) => Q(Ge, Ne)
}, [dt(Ve, se, Ne), Ve.resizable && s("span", {
class: "fv-column-resize-bar",
onMousedown: (Ge) => _(Ge, Ve.field)
}, null)]);
}
const gt = 10;
function Bt(Ve, se = 0) {
return se >= gt ? [] : (te.clear(), te.set(0, 0), Ve.map((Ne, ce) => {
const Ce = [];
if (Ce.push(Tt(Ne, Ve, ce)), Ne.children && Ne.children.length) {
const Ze = Bt(Ne.children, se + 1);
Ce.push(...Ze);
}
return Ce;
}));
}
function ke() {
return s("div", {
class: "fv-grid-header-left-fixed"
}, [s("div", {
class: "fv-grid-header-columns",
style: G.value
}, [Bt(A.value.leftHeaderColumns)])]);
}
function lt() {
return s("div", {
class: "fv-grid-header-right-fixed"
}, [s("div", {
class: "fv-grid-header-columns",
style: U.value
}, [Bt(A.value.rightHeaderColumns)])]);
}
V(() => k.value.length > 0 && g.value.length !== k.value.length);
function Ct() {
const Ve = {
...B.value,
...R.value ? {
height: `${ne.value}px`
} : {}
};
return s("div", {
class: "fv-grid-header-corner d-flex",
style: Ve
}, [M.value && T.value && !e.hierarchy && s("div", {
class: "d-inline-flex align-items-center flex-shrink-0"
}, [s(ja, {
id: "checkbox_for_select_all",
checked: x.value,
"onUpdate:checked": (se) => x.value = se,
indeterminate: I.value,
onChangeValue: ve
}, null)]), M.value && !T.value && !e.hierarchy && s("div", {
class: "d-inline-flex align-items-center flex-shrink-0",
style: {
opacity: "0"
}
}, [s(ja, {
disabled: !0
}, null)]), E.value && s("div", {
class: "d-flex align-items-center justify-content-center flex-fill fv-grid-sidebar-row-number",
style: {
width: "auto"
}
}, [s("div", {
title: O.value,
class: {
"text-center": !0,
"text-truncate": !0,
"w-100": !0
}
}, [O.value])])]);
}
function ze() {
return s(ht, null, [s("div", {
class: Je.value,
style: Ie.value
}, [q.value && e.displayType !== "Card" && Ct(), D.value && ke(), s("div", {
class: "fv-grid-header-primary",
style: e.displayType === "Card" ? {
overflow: "visible"
} : void 0
}, [s("div", {
class: "fv-grid-header-columns",
style: j.value
}, [Bt(A.value.primaryHeaderColumns)])]), N.value && lt()]), R.value && X()]);
}
function $e() {
return s(ht, null, [s("div", {
class: "fv-datagrid-resize-overlay",
style: H.value
}, null), s("div", {
class: "fv-datagrid-resize-proxy",
style: $.value
}, null)]);
}
return {
renderGridHeader: ze,
renderGridColumnResizeOverlay: $e,
shouldShowHeader: re
};
}
function XG() {
function e() {
return s("div", {
class: "fv-grid-disable"
}, null);
}
return {
renderDisableMask: e
};
}
function JG(e, t, n, a, l, o) {
const {
columnContext: i
} = t, {
conditions: r,
clearCondition: c,
removeCondition: f,
filterFromServer: d,
createFilterConditions: u
} = a, p = w([]);
function v(b) {
return b.reduce((T, S) => {
var P;
return (P = S.children) != null && P.length ? T.push(...v(S.children)) : T.push(S), T;
}, []);
}
function m() {
const b = [];
Array.from(r.value).forEach((T, S) => {
var k;
const P = {
id: T.id,
code: T.fieldCode,
labelCode: T.fieldCode,
name: T.fieldName,
editor: {
type: (k = T.value) == null ? void 0 : k.editorType
}
};
b.push(P);
}), p.value = b;
}
Z(r, () => m());
function h(b) {
if (b && b.column) {
b.column.filter = null;
let T = b.status;
T = (T & Ee.filtered) === Ee.filtered ? T ^ Ee.filtered : T, b.status = T;
}
}
function C(b) {
var P;
f(`field_filter_${b}`);
const S = v([...i.value.leftHeaderColumns, ...i.value.primaryHeaderColumns, ...i.value.rightHeaderColumns]).find((k) => k.field === b);
h(S), ((P = e.filter) == null ? void 0 : P.mode) === "server" ? d({
filterConditions: u(),
sortConditions: t.createSortConditions(l)
}) : (n.refresh(), o.reCalculateVisualDataRows());
}
function y() {
var b;
c(), v([...i.value.leftHeaderColumns, ...i.value.primaryHeaderColumns, ...i.value.rightHeaderColumns]).forEach((T) => h(T)), ((b = e.filter) == null ? void 0 : b.mode) === "server" ? d({
filterConditions: [],
sortConditions: t.createSortConditions(l)
}) : (n.refresh(), o.reCalculateVisualDataRows());
}
function g() {
return s("div", {
class: "fv-grid-filter-panel"
}, [s(by, {
data: r.value,
fields: p.value,
mode: "display-only",
"show-reset": !0,
onRemove: C,
onReset: y
}, null)]);
}
return {
renderFilterPanel: g
};
}
const gp = [{
id: String(He.Equal),
name: "等于",
value: String(He.Equal)
}, {
id: String(He.NotEqual),
name: "不等于",
value: String(He.NotEqual)
}, {
id: String(He.Like),
name: "包含",
value: String(He.Like)
}, {
id: String(He.LikeStartWith),
name: "开始是",
value: String(He.LikeStartWith)
}, {
id: String(He.LikeEndWith),
name: "结束是",
value: String(He.LikeEndWith)
}, {
id: String(He.Is),
name: "为空",
value: String(He.Is)
}, {
id: String(He.IsNot),
name: "非空",
value: String(He.IsNot)
}], dw = new Set(gp.map((e) => e.value));
function yp(e) {
return dw.has(e) ? e : String(He.Like);
}
function fw(e) {
var n;
const t = (n = e.column) == null ? void 0 : n.filter;
return t && typeof t == "object" && "compareType" in t ? {
compareType: String(yp(String(t.compareType))),
value: t.value || ""
} : typeof t == "string" ? {
compareType: String(He.Like),
value: t
} : {
compareType: String(He.Like),
value: ""
};
}
const pw = /* @__PURE__ */ fe({
name: "TextFilterRow",
props: {
headerCell: {
type: Object,
required: !0
},
onChange: {
type: Function,
required: !0
},
onClear: {
type: Function,
required: !0
},
onConfirm: {
type: Function,
default: void 0
}
},
setup(e) {
const t = fw(e.headerCell), n = w(t.compareType), a = w(t.value), l = V(() => n.value === String(He.Is) || n.value === String(He.IsNot));
function o() {
var c;
const r = {
compareType: yp(n.value),
value: a.value
};
e.onChange(r), (c = e.onConfirm) == null || c.call(e);
}
function i() {
var r;
n.value = String(He.Like), a.value = "", e.onClear(), (r = e.onConfirm) == null || r.call(e);
}
return () => s("div", {
style: {
display: "flex",
flexDirection: "column",
width: "100%",
boxSizing: "border-box",
gap: "16px"
}
}, [s("div", {
style: {
display: "flex",
alignItems: "center",
gap: "8px",
width: "100%"
}
}, [s(fl, {
modelValue: n.value,
data: gp,
valueField: "value",
textField: "name",
placeholder: "请选择",
style: {
width: "100px",
flexShrink: 0
},
enableClear: !1,
"onUpdate:modelValue": (r) => {
n.value = r;
}
}, null), l.value ? s("div", {
style: {
flex: 1,
minWidth: "100px"
}
}, null) : s(Br, {
modelValue: a.value,
updateOn: "change",
enableClear: !0,
placeholder: ye.getLocaleValue("datagrid.filter.searchBoxPlaceholder"),
style: {
flex: 1,
minWidth: "100px"
},
"onUpdate:modelValue": (r) => {
a.value = r;
}
}, null)]), s("div", {
style: {
display: "flex",
justifyContent: "flex-end",
alignItems: "center",
gap: "8px",
paddingTop: "4px",
borderTop: "1px solid var(--f-border-color, #e6e9f0)"
}
}, [s(Qn, {
type: "primary",
size: "small",
onClick: o
}, {
default: () => [Me("确定")]
}), s(Qn, {
type: "default",
size: "small",
onClick: i
}, {
default: () => [Me("重置")]
})])]);
}
}), bp = [{
id: String(He.Equal),
name: "等于",
value: String(He.Equal)
}, {
id: String(He.NotEqual),
name: "不等于",
value: String(He.NotEqual)
}, {
id: String(He.Greater),
name: "大于",
value: String(He.Greater)
}, {
id: String(He.GreaterOrEqual),
name: "大于等于",
value: String(He.GreaterOrEqual)
}, {
id: String(He.Less),
name: "小于",
value: String(He.Less)
}, {
id: String(He.LessOrEqual),
name: "小于等于",
value: String(He.LessOrEqual)
}, {
id: String(He.Is),
name: "为空",
value: String(He.Is)
}, {
id: String(He.IsNot),
name: "非空",
value: String(He.IsNot)
}, {
id: "range",
name: "范围",
value: "range"
}], Cp = new Set(bp.map((e) => e.value));
function mw(e) {
var n, a, l;
const t = (n = e.column) == null ? void 0 : n.filter;
if (t && typeof t == "object" && "compareType" in t) {
const o = String(t.compareType);
return {
compareType: Cp.has(o) ? o : He.Equal,
singleValue: t.value ?? null,
rangeBegin: ((a = t.range) == null ? void 0 : a.begin) ?? null,
rangeEnd: ((l = t.range) == null ? void 0 : l.end) ?? null
};
}
return {
compareType: He.Equal,
singleValue: null,
rangeBegin: null,
rangeEnd: null
};
}
const vw = /* @__PURE__ */ fe({
name: "NumericFilterRow",
props: {
headerCell: {
type: Object,
required: !0
},
onChange: {
type: Function,
required: !0
},
onClear: {
type: Function,
required: !0
},
onConfirm: {
type: Function,
default: void 0
}
},
setup(e) {
const t = mw(e.headerCell), n = w(t.compareType), a = w(t.singleValue), l = w(t.rangeBegin), o = w(t.rangeEnd), i = V(() => {
var u, p;
return ((p = (u = e.headerCell.column) == null ? void 0 : u.editor) == null ? void 0 : p.precision) ?? 2;
}), r = V(() => n.value === "range"), c = V(() => n.value === "12" || n.value === "13");
function f() {
var m;
const u = n.value, p = Cp.has(u) ? u : He.Equal, v = {
compareType: u === "range" ? "range" : p,
value: a.