@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1 lines • 282 kB
JavaScript
(function(X,Ee){typeof exports=="object"&&typeof module<"u"?Ee(exports,require("../common/index.umd.js"),require("vue"),require("@vueuse/core"),require("../modal/index.umd.js"),require("../transfer/index.umd.js"),require("../tabs/index.umd.js"),require("../order/index.umd.js"),require("../condition/index.umd.js"),require("../checkbox/index.umd.js"),require("../filter-bar/index.umd.js"),require("../tooltip/index.umd.js"),require("lodash-es"),require("../pagination/index.umd.js"),require("../button/index.umd.js"),require("../search-box/index.umd.js"),require("../tags/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../events-editor/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../external-container/index.umd.js"),require("../data-view/index.umd.js"),require("../notify/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","../common/index.umd.js","vue","@vueuse/core","../modal/index.umd.js","../transfer/index.umd.js","../tabs/index.umd.js","../order/index.umd.js","../condition/index.umd.js","../checkbox/index.umd.js","../filter-bar/index.umd.js","../tooltip/index.umd.js","lodash-es","../pagination/index.umd.js","../button/index.umd.js","../search-box/index.umd.js","../tags/index.umd.js","../dynamic-form/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../events-editor/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../schema-selector/index.umd.js","../tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../external-container/index.umd.js","../data-view/index.umd.js","../notify/index.umd.js"],Ee):(X=typeof globalThis<"u"?globalThis:X||self,Ee(X["data-grid"]={},X.common,X.Vue,X.VueUseCore,null,X.FTransfer,X.FTabs,X.FOrder,null,X.checkbox,X.FFilterBar,X.FTooltip,X.LodashES,X.FPagination,X.FButton,X.FSearchBox,X.FTags,X.FDynamicForm,X.dynamicResolver,null,null,X.FAccordion,X.FAvatar,X.FButtonEdit,X.FButtonGroup,X.FCalendar,X.FCapsule,X.FCheckbox,X.FCheckboxGroup,X.FComboList,X.FComboTree,X.FComponent,X.FColorPicker,X.FContentContainer,X.FDatePicker,X.FDataGrid$1,X.FDropdown,X.FEventsEditor,X.FFieldSelector,X.FBindingSelector,X.FImageCropper,X.FInputGroup,X.FLayout,X.FListNav,X.FListView,X.FLookup,X.FMappingEditor,X.FNav,X.FNumberRange,X.FNumberSpinner,X.FPageHeader,X.FPageFooter,X.FProgress,X.FQuerySolution,X.FRadioGroup,X.FRate,X.FResponseToolbar,X.FResponseLayout,X.FResponseLayoutEditorSetting,X.FSection,X.FSmokeDetector,X.FSplitter,X.FStep,X.FSwitch,X.FText,X.FTimePicker,X.FTreeview,X.FUploader,X.FVerifyDetail,X.FVideo,X.FTextArea,X.FSchemaSelector,X.FTreeGrid$1,X.FEventParameter,X.FFilterConditionEditor,X.FFieldset,X.FSortConditionEditor,X.FMenuLookup,X.FDrawer,X.FJsonEditor,X.FPropertyEditor,X.FExpressionEditor,X.FCodeEditor,X.FHtmlTemplate,null,X.dataView))})(this,function(X,Ee,i,en,Tc,kr,Fr,Or,kc,Nr,Er,bn,Le,Mr,Vr,Ir,Dr,tn,Pr,Fc,Oc,Br,jr,Rr,Hr,Wr,$r,wn,Cn,nn,Lr,qr,Ar,Gr,zr,Yr,Ur,Xr,Qr,Kr,Jr,Zr,eo,to,no,ro,oo,io,ao,so,lo,co,uo,fo,mo,po,ho,go,yo,vo,bo,wo,Co,xo,_o,So,To,ko,Fo,Oo,No,Eo,Mo,Vo,Io,Do,Po,Bo,jo,Ro,Ho,Wo,$o,Lo,Nc,de){"use strict";var _c=Object.defineProperty;var Sc=(X,Ee,i)=>Ee in X?_c(X,Ee,{enumerable:!0,configurable:!0,writable:!0,value:i}):X[Ee]=i;var j=(X,Ee,i)=>Sc(X,typeof Ee!="symbol"?Ee+"":Ee,i);const qo={enable:{type:Boolean,default:!1},index:{type:Number,default:1},mode:{type:String,default:"client"},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}},Ao={enable:{type:Boolean,default:!1},fields:{type:Array,default:[]},mode:{type:String,default:"client"},multiSort:{type:Boolean,default:!1}},Go={customGroupRow:{type:Function,default:()=>{}},customGroupRowStyle:{type:Function,default:()=>{}},customSummaryStyle:{type:Function,default:()=>{}},enable:{type:Boolean,default:!1},groupColSpan:{type:Number,default:1},groupFields:{type:Array,default:[]},showGroupedColumn:{type:Boolean,default:!0},showGroupPanel:{type:Boolean,default:!1},showSummary:{type:Boolean,default:!1},summaryPosition:{type:String,default:"separate"}},zo={enable:{type:Boolean,default:!1},filterStyle:{type:String,default:"filter-column"},mode:{type:String,default:"server"},showSummary:{type:Boolean,default:!0}},Yo={wrapHeadings:{type:Boolean,default:!1}},Uo={enable:{type:Boolean,default:!1},heading:{type:String,default:"序号"},width:{type:Number,default:36},showEllipsis:{type:Boolean,default:!0}},Xo={customRowStyle:{type:Function,default:()=>{}},customRowStatus:{type:Function,default:()=>{}},disable:{type:Function,default:()=>{}},height:{type:Number,default:28},showHovering:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1}},Qo={enable:{type:Boolean,default:!1},customSummaryStyle:{type:Function,default:()=>{}},groupFields:{type:Array,default:[]},mode:{type:String,default:"client"},position:{type:String,default:"bottom"}},Ko={fitColumns:{type:Boolean,default:!1},fitMode:{type:String,default:"average"},groups:{type:Array,defaut:[]},reorderColumn:{type:Boolean,default:!1},resizeColumn:{type:Boolean,default:!0},resizeColumnOnDoubleClick:{type:Boolean,default:!0}},Jo={checkOnSelect:{type:Boolean,default:!1},clearSelectionOnEmpty:{type:Boolean,default:!0},customSelectionItem:{type:Function,default:()=>{}},enabelSelectRow:{type:Boolean,default:!0},keepSelectingOnClick:{type:Boolean,default:!0},keepSelectingOnPaging:{type:Boolean,default:!0},multiSelect:{type:Boolean,default:!1},focusSelection:{type:String,default:"current"},selectOnCheck:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},showSelectAll:{type:Boolean,default:!1},showSelection:{type:Boolean,default:!1}},Zo={selectOnEditing:{type:Boolean,default:!1},editMode:{type:String,default:"cell"}},ei={show:{type:Boolean,default:!1},message:{type:String,default:"加载中..."}},xn={appendOnEnterAtLastCell:{type:Boolean,default:!1},beforeEditCell:{type:Function,default:n=>!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:[]}},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},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},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,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0,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}};var it=(n=>(n[n.readonly=0]="readonly",n[n.editable=1]="editable",n[n.editing=2]="editing",n))(it||{}),gt=(n=>(n[n.initial=0]="initial",n[n.editing=1]="editing",n))(gt||{}),Ht=(n=>(n[n.data=0]="data",n[n.group=1]="group",n[n.summary=2]="summary",n))(Ht||{}),at=(n=>(n[n.none=0]="none",n[n.filterable=1]="filterable",n[n.sortable=2]="sortable",n[n.filtered=4]="filtered",n[n.sorted=8]="sorted",n[n.ascending=16]="ascending",n[n.descending=32]="descending",n))(at||{});function ti(n,t){var h;const e=String(Date.now()),r=((h=n.rowOption)==null?void 0:h.height)||28,o=i.ref(t.value.primaryColumnsWidth);function a(g){const M={};return g.reduce((_,b,C)=>{const v=C<g.length-1?g[C+1]:null;return C===0&&(_[b.field]={left:0}),b.actualWidth!==void 0&&(_[b.field].width=b.actualWidth),v&&(_[v.field]={left:_[b.field].left+(b.actualWidth||0)}),_},M),M}function s(g,M,_){const b=r*(_+1),v=M[g.field].left-b+(M[g.field].width||0),w=g.parent.height?`${g.parent.height}px`:"";return{left:`${b}px`,width:`${v}px`,height:`${w}`}}function c(g,M,_){return{right:"0px",height:`${g.parent.height?`${g.parent.height}px`:""}`}}function l(g,M){const _=g.parent.height?`${g.parent.height}px`:"";return{left:`${M[g.field].left}px`,height:`${_}`,width:isNaN(Number(M[g.field].width))?"100%":`${M[g.field].width}px`}}function u(g,M,_){const C=(M.spanned||[]).reduce((w,T)=>w+(T.parent.height||0),0)+(g.height||0);return{top:`${g.top}px`,left:`${_[M.field].left}px`,width:`${_[M.field].width}px`,height:`${C}px`,padding:`calc(${C/2}px - 1rem) 0`}}function d(g,M){return`${e}_${g.type}_r_${g.index}_c_${M}_${g.refreshKey||""}`}function f(g){return`${e}_${g.type}_r_${g.index}_${g.refreshKey||""}`}function m(g){const M=g.height?`${g.height}px`:"";return{top:`${g.top}px`,width:isNaN(o.value)?"100%":`${o.value}px`,height:`${M}`}}return i.watch(t,()=>{o.value=t.value.primaryColumnsWidth}),{calculateCellPositionInRow:a,cellKey:d,cellPosition:l,groupCellPosition:s,rowKey:f,rowPosition:m,rowSpanCellPosition:u,summaryCellPosition:c}}function ni(n,t,e){const{hasChildrenField:r}=e,o=i.ref("#9399a0"),a=i.ref(28);function s(){return[].concat(...t.value.filter(m=>m.raw.__fv_descendant_index__.length!==0).map(m=>[...m.raw.__fv_descendant_index__.slice(-1)]).flat()).sort((m,h)=>Number(m)-Number(h))}function c(d){const f=new Array(t.value.length).fill(0);if(n.showLines){const m=s();t.value.forEach((h,g)=>{const M=m.includes(g),_=h.raw[r.value];f[g]=`repeating-linear-gradient(90deg, ${o.value} 0 1px, transparent 0px 2px) ${_?"-10px":"0px"} ${a.value/2}px/20px 1px no-repeat,repeating-linear-gradient(${o.value} 0 1px, transparent 0px 2px) 0px 0px/1px ${M?"50%":"100%"} no-repeat`}),f[0]=""}return f[d]}function l(d,f,m){return m[d].parents.set(d,!0).forEach(g=>{m[g].childsLength=m[g].childWithLines.filter(M=>f[M].visible).length}),f}function u(d){const h=d.raw.__fv_parent_index__===void 0||d.raw.__fv_parent_index__===-1?0:8,g=0,M=d.raw[r.value],_=`${d.layer*10+d.layer*h+g}px`,b=d.visible||Le.isUndefined(d.visible)?{paddingLeft:`calc(${_} + 0.75rem)`,background:c(d.index),display:"flex",width:"100%",position:"relative"}:{display:"none"};return M||(b.paddingLeft=`calc(${_} + 2rem)`),b}return{hierarchyCellContentStyle:u,handleCollapsedPaddingBottom:l}}function ri(n,t,e){const r=i.ref(n.iconField);function o(a,s){if(r.value)return a.raw[n.iconField];let c="";return a.raw[e.value]!==!0?c=t.value.leafnodes:c=a.collapse?t.value.fold:t.value.unfold,c}return{treeNodeIconsClass:o}}function oi(n,t,e,r,o,a,s,c){const{dataView:l,hasRealChildren:u,reOrderVisibleIndex:d}=r,{collapseField:f,hasChildrenField:m}=o,{reCalculateVisualDataRows:h,updateVirticalScroll:g}=a;function M(_){if(_.raw[m.value]){const C=l.value[_.raw.__fv_index__];C[f.value]=!C[f.value],r.toggleChildrenVisibiltyByCollapseStatus(C),C[m.value]=u(C),d(),h(),g()}t.emit("expandNode",{row:_})}return{toggleTreeNode:M}}function ii(n){function t(o){return{}}function e(o){const{valign:a,align:s}=o;return{"d-flex":!0,"h-100":!0,"w-100":!0,"justify-content-start":s!=="center"&&s!=="right","justify-content-center":s==="center","justify-content-right":s==="right","align-items-start":a!=="middle"&&a!=="bottom","align-items-center":a==="middle","align-items-end":a==="bottom"}}function r(o){const{align:a,showEllipsis:s}=o;return{"w-100":!0,"text-left":a!=="center"&&a!=="right","text-center":a==="center","text-right":a==="right","text-truncate":s}}return{cellContentPosition:t,cellContentClass:e,cellContentClassWithEllipsis:r}}function ai(n,t,e,r,o,a,s,c,l,u,d,f,m){const{onClickCell:h}=a,{gridCellClass:g,gridHierarchyCellClass:M,gridRowClass:_,onClickRow:b,onMouseoverRow:C,onMouseoutRow:v}=c,{enableMultiSelect:w,select:T,unSelect:k,selectItem:p}=l;i.ref(n.cellHeight);const S=i.ref(n.treeNodeIconsData||{}),{hasChildrenField:x,shouldShowCheckBox:F,shouldShowIcon:y}=s,{toggleTreeNode:I}=oi(n,t,r,o,s,d),{toggleSelectHierarchyItem:P}=u,{cellKey:O,cellPosition:E,rowKey:G,rowPosition:$}=ti(n,e),{cellContentClass:D,cellContentPosition:W,cellContentClassWithEllipsis:Q}=ii(),{hierarchyCellContentStyle:B}=ni(n,r,s),{treeNodeIconsClass:V}=ri(n,S,x);function U(q,ee){const ve=q.raw[x.value];return{"fv-tree-node-toggle":ve&&q.collapse,"fv-tree-node-toggle-minus":ve&&!q.collapse}}function L(q,ee){q.stopPropagation(),I(ee)}function R(q){q.stopPropagation()}function z(q,ee){return i.createVNode("div",{class:U(q),onClick:ve=>L(ve,q),onDblclick:R},null)}function K(q,ee){return y.value&&i.createVNode("div",{id:"treeNodeIcons",class:V(q,ee)},null)}function ne(q){w.value?(q.checked?T(q):k(q),P(q)):p(q)}function J(q,ee){return F.value&&i.createVNode(Nr.FCheckbox,{id:"checkbox_for_"+O(q,ee.index),indeterminate:q.indeterminate,disabled:q.disabled,checked:q.checked,"onUpdate:checked":ve=>q.checked=ve,onChange:()=>ne(q)},null)}function me(q,ee){return i.createVNode("span",{title:ee.data,style:"user-select:none"},[t.slots.cellTemplate?t.slots.cellTemplate({cell:ee,row:q}):ee.mode===it.editing?ee.getEditor(ee):ee.formatter?ee.formatter(ee,q):ee.data!=null?ee.data.toString():ee.data])}function be(q,ee){return i.createVNode("div",{class:Q(ee)},[ee.showTips?i.createVNode(bn,null,{default:()=>me(q,ee),contentTemplate:()=>me(q,ee)}):me(q,ee)])}function Se(q,ee,ve){const Fe=B(q);return i.createVNode("div",{ref:ee.setRef,key:O(q,ee.index),class:"fv-grid-hierarchy-cell",style:E(ee,ve)},[i.createVNode("div",{class:D(ee),style:Fe},[z(q),K(q,ee),J(q,ee),be(q,ee)])])}function Pe(q,ee,ve){return i.createVNode("div",{ref:ee.setRef,key:O(q,ee.index),class:g(ee),style:E(ee,ve),onClick:Fe=>h(Fe,ee,q,ee.column)},[i.createVNode("div",{class:D(ee)},[i.createVNode("div",{class:Q(ee)},[ee.showTips?i.createVNode(bn,null,{default:()=>me(q,ee),contentTemplate:()=>me(q,ee)}):me(q,ee)])])])}function je(q,ee){return ee==="left"&&e.value.leftColumns.length>0&&e.value.leftColumns[0].field===q.field||ee==="primary"&&e.value.primaryColumns.length>0&&e.value.primaryColumns[0].field===q.field}function A(q,ee){t.emit("dblclickNode",{$event:q,node:ee.raw})}function ae(q,ee,ve="primary",Fe){return i.createVNode("div",{ref:q.setRef,key:G(q),class:_(q,Fe),style:$(q),onMouseover:Ie=>C(Ie,q),onMouseout:Ie=>v(Ie,q),onClick:Ie=>b(Ie,q),onDblclick:Ie=>A(Ie,q)},[Object.values(q.data).filter(Ie=>ee[Ie.field]&&Ie.rowSpan===1).map(Ie=>je(Ie,ve)?Se(q,Ie,ee):Pe(q,Ie,ee))])}return{renderDataRow:ae}}function si(n,t,e){const{horizontalScrollThumbStyle:r,onMouseDownScrollThumb:o,shouldShowHorizontalScrollbar:a}=e;function s(){return a.value&&i.createVNode("div",{class:"fv-grid-horizontal-scroll"},[i.createVNode("div",{class:"fv-grid-horizontal-scroll-thumb",style:r.value,onMousedown:c=>o(c,t,"horizontal")},null)])}return{renderHorizontalScrollbar:s}}function li(){function n(r,o){switch(r.command){case"edit":case"remove":return o.status===gt.initial;case"accept":case"cancel":return o.status===gt.editing;default:return!r.hidden}}function t(r,o,a){switch(r.onClick(o,a.dataIndex,a),r.command){case"edit":a.status,gt.editing;break;case"accept":case"cancel":a.status,gt.initial;break}}function e(r,o){return r.commands&&r.commands.map(a=>n(a,o)&&i.createVNode(Vr,{class:"ml-2",type:a.type,size:a.size||"small",onClick:s=>t(a,s,o),style:{"margin-bottom":"3px"}},{default:()=>[i.createTextVNode(" "),a.text,i.createTextVNode(" ")]}))}return{renderCommandColumn:e}}function ci(n){const t=i.ref(n.minHeight),e=i.ref(n.minWidth),r=i.ref(n.height),o=i.ref(n.width),a=i.computed(()=>r.value<=0?0:Math.max(r.value,t.value)),s=i.computed(()=>o.value<=0?0:Math.max(o.value,e.value));return i.watch([()=>n.height,()=>n.width,()=>n.minHeight,()=>n.minWidth],([l,u,d,f])=>{t.value=Number(d),e.value=Number(f),r.value=Number(l),o.value=Number(u)}),{containerStyleObject:i.computed(()=>({height:a.value>0?`${a.value}px`:n.fit?"100%":"",width:s.value>0?`${s.value}px`:n.fit?"100%":"",flex:"1 1 0"}))}}i.ref([{name:"七天",selectable:!0},{name:"一个月",selectable:!0},{name:"三个月",selectable:!0},{name:"半年",selectable:!0}]);function ui(n){const e=i.ref(n.commandOption.enable||!1),r=i.ref(n.commandOption.commands||[]);function o(a){if(e.value&&!(a.value.findIndex(c=>c.dataType==="commands")>-1)){const c={field:"__commands__",title:"操作",width:120,fixed:"right",dataType:"commands",commands:r.value,visible:!0};a.value.push(c)}}return{applyCommands:o}}function di(n,t){var u;const e=i.ref((u=n.columnOption)==null?void 0:u.groups);function r(d,f,m,h,g){const M={actualWidth:0,children:[],depth:1,field:d.field,layer:1,left:0,parent:m,resizable:!0,title:d.title||"",status:at.none,popoverRef:i.ref(),showPopover:!1,column:null,sortType:"none"},_=h||M;if(d.group){let b=1;d.group.reduce((C,v)=>{if(typeof v=="string"){const w=f.get(v);w&&(g.fieldToRootMap.set(v,_),C.actualWidth+=w.actualWidth,C.children.push(w))}else{const w=r(v,f,C,_,g);b=Math.max(b,w.depth),C.actualWidth+=w.actualWidth,C.children.push(w)}return C},M),M.depth+=b}return t.value.headerDepth=Math.max(t.value.headerDepth,M.depth),M}function o(d){const f={groupedCells:new Map,fieldToRootMap:new Map};return e.value&&e.value.reduce((m,h)=>{const g=r(h,d,null,null,f);return m.groupedCells.set(h.field,g),m},f),f}function a(d){if(!d||d.length===0)return 0;const f=d[0];return f.children&&f.children.length>0&&(f.left=a(f.children)),f.left}function s(d,f){const m=t.value.headerDepth;d.forEach(h=>{h.layer=f?f.layer+1:1;const g=h.children&&h.children.length===0;h.depth=g?m-(h.layer-1):1,h.left=g?h.left:a(h.children),h.children&&s(h.children,h)})}function c(d,f){const m=new Map;return d.forEach(h=>{const g=f.fieldToRootMap.get(h.field),M=g!=null;M&&!m.has(g.field)&&m.set(g.field,g),M||m.set(h.field,h)}),s(Array.from(m.values())),m}function l(d){let f=new Map,m=0;if(d.reduce((h,g)=>{let M=at.none;M=g.filterable?M|at.filterable:M,M=g.sort&&g.sort!=="none"?M|at.sorted|(g.sort==="asc"?at.ascending:at.descending):M;const _=g.field;return h.set(_,{actualWidth:g.actualWidth||0,children:[],depth:1,layer:1,left:m,field:_,parent:null,resizable:g.resizable===void 0?!0:g.resizable,title:g.title,status:M,popoverRef:i.ref(),showPopover:!1,column:g,filterValue:null,sortType:g.sort||"none",showSetting:g.showSetting,draggable:g.draggable}),m+=g.actualWidth||0,h},f),e.value){const h=o(f);f=c(f,h)}return f}return{getGridHeaderCells:l}}function fi(n,t){var C;Ee.useGuid();const{idField:e}=t,r=i.ref(n.summary),o=i.ref(n.group),a=i.ref(((C=n.group)==null?void 0:C.groupFields)||[]),s=i.computed(()=>{var v;return(v=n.group)==null?void 0:v.enable}),c=i.computed(()=>{var v;return(v=n.group)==null?void 0:v.showGroupPanel}),l=i.computed(()=>{const v=r.value;return(v==null?void 0:v.groupFields)||[]}),u=i.computed(()=>{const v=o.value;return v&&v.showSummary}),d=i.ref(0),f=new Map;let m=[];function h(v,w,T,k,p){const S=k[T];S&&(w.reduce((x,F,y)=>{var O;const I=F[S];let P=x.get(I);if(!P){const E=l.value.reduce((G,$)=>(G.set($,0),G),new Map);P={field:S,title:((O=p.get(S))==null?void 0:O.title)||S,value:I,layer:T,details:[],groupSummaries:E},x.set(I,P)}return l.value&&l.value.forEach(E=>{if(P){const G=P.groupSummaries.get(E)||0;P.groupSummaries.set(E,G+F[E])}}),P.details.push(F),x},v),T<k.length-1&&v.forEach((x,F)=>{x.nestGroup=new Map,h(x.nestGroup,x.details,T+1,k,p),x.details=[]}))}function g(v,w){return n.group&&n.group.formatter?n.group.formatter(v.value,{...v,total:w}):`${v.title}:${v.value} (${w})`}function M(v,w){const T=[];return v.forEach(k=>{const p={[e.value]:`group_of_${w?w[e.value]+"_":""}${k.field}_${k.value}`,__fv_data_grid_group_collapse__:!1,__fv_data_grid_group_field__:k.field,__fv_data_grid_group_layer__:k.layer,__fv_data_grid_group_row__:!0,__fv_data_grid_group_value__:k.value};let S=0;if(T.push(p),k.nestGroup){const x=M(k.nestGroup,p);T.push(...x),S+=x.length}if(k.details&&k.details.length&&(T.push(...k.details),S+=k.details.length),u.value){const x={__fv_data_grid_group_field__:k.field,__fv_data_grid_group_layer__:k.layer,__fv_data_grid_group_summary__:!0};x[e.value]=`summary_of_${k.field}_${k.value}`,x[k.field]=Array.from(k.groupSummaries.entries()).reduce((F,[y,I])=>`${F} ${y} total:${I} `,""),T.push(x)}k.groupSummaries&&k.groupSummaries.size&&k.groupSummaries.forEach((x,F)=>{p[F]=x}),p[k.field]=g(k,S),p.value=k.value}),T.forEach((k,p)=>{k.__fv_data_index__=p}),T}function _(v,w,T){return!v||v.length===0||!w.length?w:(v.join(","),f.clear(),m=[],w=w.filter(k=>!k.__fv_data_grid_group_row__),h(f,w,0,v,T),m=M(f),m)}function b(v){return{"f-icon":!0,"f-icon-arrow-chevron-down":!0,"fv-grid-group-row-icon-collapse":v.collapse}}return{collpaseGroupIconClass:b,generateGroupData:_,groupFields:a,shouldGroupingData:s,showGroupPanel:c,groupRowSize:d}}function mi(n,t,e,r){const o=i.ref(0),a=i.ref(!!n.hierarchy),{idField:s}=r,{collapseField:c,hasChildrenField:l,parentIdField:u}=e,d=new Map,f=new Map,m=new Map;function h(L,R){f.clear(),L.reduce((z,K)=>{const ne=K[u.value]!==void 0?K[u.value]:"";if(ne&&R.has(ne)){const me=R.get(ne),be=isNaN(Number(me.__fv_layer__))?1:Number(me.__fv_layer__);K.__fv_layer__=be+1,K.__fv_parent_index__=me.__fv_index__,me.__fv_hasChildren__=!0}else K.__fv_layer__=1;const J=z.has(ne)?z.get(ne):[];return J.push(K),z.set(ne,J),z},f)}function g(L){m.clear(),L.reduce((R,z)=>{const K=z[s.value];return R.set(K,z),R},m)}function M(L){L.forEach(R=>{const z=R[s.value];R.__fv_children_index__.map(ne=>L[ne]).forEach(ne=>{ne.__fv_parents__=new Map([...R.__fv_parents__.entries(),[z,!0]])})})}function _(L){L.forEach(R=>{const z=new Set(R.__fv_children_index__);R.__fv_children_index__=[...z].sort((K,ne)=>K-ne)})}function b(L){L.forEach(R=>{const z=R.__fv_parents__;Array.from(z.keys()).map(K=>m.get(K)).forEach(K=>{K.__fv_children_index__.push(R.__fv_index__)})}),_(L)}function C(L){L.forEach(R=>{R.__fv_child_with_lines__=[],R.__fv_child_length__=R.__fv_descendant_index__.length,R.__fv_descendant_index__.map(z=>L[z]).reduce((z,K)=>(z.__fv_child_length__+=K.__fv_children_index__.length,z.__fv_child_with_lines__.push(...K.__fv_children_index__,K.__fv_index__),z),R)})}function v(L,R){return{id:L,index:R,parentId:"",parentIndex:-1,parents:new Map,children:new Map,descendant:new Map,collapsed:!1,visibleInHierarchy:!0}}function w(L,R,z){Array.from(R.keys()).forEach(K=>{R.get(K).reduce((J,me)=>{const be=me[s.value],Se=L.get(me[s.value]),Pe=L.get(K),je=z.get(K);return Pe&&je&&(Pe.children.set(be,Se),Pe.children.set(be,Se),Se.parentId=K,Se.parentIndex=Pe.index,Se.parents.set(K,Pe)),J},L)})}function T(L){L.children.forEach(z=>{z.parents=new Map([...L.parents.entries(),[L.id,L]]),T(z)})}function k(L,R){L.filter(z=>z[u.value]===void 0||z[u.value]==="").forEach(z=>{const K=z[s.value],ne=R.get(K);T(ne)})}function p(L){Array.from(L.values()).forEach(R=>{Array.from(R.parents.values()).forEach(z=>{z.descendant.set(R.id,R)})})}function S(L){d.clear(),L.forEach((R,z)=>{const K=R[s.value];d.set(K,v(K,z))}),g(L),h(L,m),w(d,f,m),k(L,d),p(d)}function x(L){const R=L[s.value],z=d.get(R);return z&&z.children.size>0}function F(L){return L[l.value]&&!x(L)}function y(L){const R=L[s.value],z=d.get(R);return z&&z.visibleInHierarchy}function I(){o.value=Date.now()}function P(L,R){R.forEach(z=>{const K=d.get(z[s.value]),ne=d.get(L),J=m.get(L);ne&&J&&(K.visibleInHierarchy=!J[c.value]&&ne.visibleInHierarchy)}),I()}function O(L){if(f.has(L)){const z=f.get(L);P(L,z),z.map(K=>K[s.value]).forEach(K=>O(K))}}function E(L){const R=L[s.value];O(R)}function G(L,R,z=0){L.forEach(K=>{const ne=F(K),J=K.__fv_layer__<=z,me=R==="ToCollapse"?K.__fv_layer__<=z:!(K.__fv_layer__<=z),be=J?me:K[c.value];K[c.value]=ne||be});for(const[K,ne]of f.entries())P(K,ne);return L}function $(L,R){G(L,"ToCollapse",R)}function D(L,R){G(L,"ToExpand",R)}function W(L){L.forEach((R,z)=>{var me;const K=R[s.value],ne=f.has(K)?(me=f.get(K))==null?void 0:me.map(be=>be.__fv_index__):[],J=v(K,z);R.__fv_graph_node__=J,R.__fv_children_index__=ne,R.__fv_descendant_index__=[...ne],R.__fv_parents__=new Map,F(R)&&(R[c.value]=!0)})}function Q(L){var K,ne;S(t.value),W(L),M(L),b(L),n.showLines&&C(L);const z=((K=n.hierarchy)==null?void 0:K.collapseTo)!==void 0?Number((ne=n.hierarchy)==null?void 0:ne.collapseTo):0;return G(L,"ToCollapse",z),L}function B(L,R,z){const ne=z.value[L][s.value],J=d.get(ne);if(J){const me=d.get(J.parentId);let be=z.value.length-1;if(me){const Se=Array.from(me.children.keys()).indexOf(J.id);if(Se===me.children.size-1){const je=Array.from(me.descendant.values())[me.descendant.size-1];be=z.value.findIndex(ae=>ae[s.value]===je.id)+1}else{const je=Array.from(me.children.values())[Se+1];be=z.value.findIndex(ae=>ae[s.value]===je.id)}R[l.value]=!1,R[u.value]=me.id,z.value.splice(be,0,R)}}}function V(L,R,z){const K=z.value[L],ne=K[s.value];if(d.get(ne)){const be=z.value.findIndex(Se=>Se[s.value]===ne)+1;K[l.value]=!0,K[c.value]=!1,R[l.value]=!1,R[u.value]=ne,z.value.splice(be,0,R)}}function U(L,R){const z=L[s.value],K=d.get(z),ne=Array.from(K.descendant.keys());ne.unshift(z);const J=d.get(K.parentId);if(J&&(J.children.delete(z),J.children.size===0)){const be=R.find(Se=>Se[s.value]===K.parentId);be[l.value]=!1,be[c.value]=!1}return R.filter(be=>ne.indexOf(be.id)===-1)}return{checkVisibleInHierarchy:o,collapseTo:$,expandTo:D,generateHierarchyData:Q,hasRealChildren:x,insertSibling:B,insertChild:V,isVisibleInTree:y,shouldStratifyData:a,toggleChildrenVisibiltyByCollapseStatus:E,trimmedOriginalData:U}}const pi={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}},hi={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},rn=i.defineComponent({name:"Toast",props:hi,emits:["close","click"],setup:(n,t)=>{const e=i.ref(n.animate),r="fadeOut",o=i.computed(()=>n.options),a=i.ref(!1),s=i.computed(()=>{const b={animated:a.value,toast:!0};return b[n.animate]=!1,b[r]=a.value,b[o.value.type]=!0,o.value.theme&&(b[o.value.theme]=!0),b}),c=i.computed(()=>{const v=`f-icon-${o.value&&o.value.type?o.value.type.replace("toasty-type-",""):"default"}`,w={"f-icon":!0};return w[v]=!0,w}),l=i.computed(()=>o.value.title||o.value.message),u=i.computed(()=>o.value.title&&o.value.message),d=i.computed(()=>!o.value.title&&o.value.message),f=i.computed(()=>n.showCloseButton),m=i.computed(()=>!!o.value.buttons||!!t.slots.default);function h(b){b.stopPropagation(),b.preventDefault(),a.value=!1,setTimeout(()=>{t.emit("close",o.value)},200)}function g(b,C){}function M(b){return`f-preten-link ${b.customClass?b.customClass:""}`}i.watch(e,()=>{e.value});const _=()=>{var b;return i.createVNode(i.Fragment,null,[i.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((b=o.value.buttons)==null?void 0:b.map(C=>i.createVNode("span",{class:M(C),onClick:v=>void 0},[C.text]))),t.slots.default&&t.slots.default()])])};return()=>i.createVNode("div",{class:s.value,style:"min-height:44px"},[f.value&&i.createVNode("button",{title:"关闭",class:"toast-close f-btn-icon f-bare",onClick:h},[i.createVNode("span",{class:"f-icon modal_close"},null)]),l.value&&i.createVNode("section",{class:"modal-tips"},[i.createVNode("div",{class:"float-left modal-tips-iconwrap"},[i.createVNode("span",{class:c.value},null)]),i.createVNode("div",{class:"modal-tips-content"},[u.value&&i.createVNode(i.Fragment,null,[i.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:o.value.title},null),i.createVNode("p",{class:"toast-msg",innerHTML:o.value.message},null),m.value&&_()]),d.value&&(o.value.buttons?i.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[i.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:o.value.message},null),i.createVNode("div",{class:"after-toast-title text-right ml-auto"},[_()])]):i.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:o.value.message},null))])])])}}),Gt=i.defineComponent({name:"Notify",props:pi,emits:["close","empty"],setup(n,t){const e=i.computed(()=>({"farris-notify":!0})),r={left:12,right:12,top:20,bottom:12},o=i.ref(),a=i.ref(n.options),s=i.ref(n.showCloseButton),c=i.computed(()=>n.position||"bottom-right"),l=i.computed(()=>n.timeout!=null?n.timeout:3e3),u=i.computed(()=>{const m=n.bottom?n.bottom:r.bottom,h=n.top?n.top:r.top,g={transition:"all 0.2s ease",left:c.value.indexOf("left")>-1?`${n.left?n.left:r.left}px`:"",right:c.value.indexOf("right")>-1?`${n.right?n.right:r.right}px`:"",top:c.value.indexOf("top")>-1?`${h}px`:"",bottom:c.value.indexOf("bottom")>-1?`${m}px`:""};return c.value.indexOf("center")>-1&&(g.left="50%",g.marginLeft="calc(-24rem / 2)",c.value==="center-center"&&(g.top="50%",g.transform="translate(-50%, -50%)")),g});function d(m){t.emit("close")}l.value&&setTimeout(()=>{d()},l.value),t.expose({closeToast:d,container:o,notifyPosition:c});function f(m,h){d()}return()=>i.createVNode("div",{class:e.value,style:u.value,ref:o},[i.createVNode(rn,{options:a.value,showCloseButton:s.value,animate:n.animate,onClose:m=>f(m,a.value)},null)])}});class _n{constructor(){j(this,"notifyRefs",[]);j(this,"globalConfig",i.reactive({}))}escapeAllHtml(t){if(typeof t!="string"||!t)return"";const e=document.createElement("div");return e.textContent=t||"",e.innerHTML.replace(/ /g," ").replace(/\\n/g,"<br>").replace(/\\t/g," ").replace(/\\r/g,"")}createNotifyInstance(t){const e=this,o=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...t}),a=document.createElement("div");a.style.display="contents";const s=i.createApp({setup(){var u;const c=i.ref();function l(){c.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(o,c),s.unmount()},220)}if(o.position.indexOf("top")>-1){const d=e.getNotifyInstances(o.position),f=d[d.length-1];if(f){const m=f.value.container.getBoundingClientRect();o.top=m.bottom}}return o.safeHtml&&((u=o.options)!=null&&u.message)&&(o.options.message=e.escapeAllHtml(o.options.message)),i.onUnmounted(()=>{document.body.removeChild(a)}),i.onMounted(()=>{e.updateNotifyPositionForCreate(o,c)}),()=>i.createVNode(i.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[i.createVNode(Gt,i.mergeProps({ref:c},o,{onClose:l}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(a),s.mount(a),s}getNotifyInstances(t){return this.notifyRefs.filter(e=>e.value.notifyPosition===t)}updateNotifyPositionForCreate(t,e){if(this.notifyRefs&&this.notifyRefs.length){const r=window.innerHeight;t.position.indexOf("bottom")>-1&&this.getNotifyInstances(t.position).forEach(o=>{const a=o.value.container.getBoundingClientRect();o.value.container.style.bottom=a.height+r-a.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,e]}updateNotifyPositionForClose(t,e){const r=this.notifyRefs.indexOf(e);if(t.position.indexOf("top")>-1){const o=this.getNotifyInstances(t.position),a=o.indexOf(e);o.slice(a+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}r>-1&&this.notifyRefs.splice(r,1)}show(t){return this.createNotifyInstance(t)}buildNotifyProps(t,e){let r="",o="",a,s,c;typeof e=="string"?r=e:e&&(r=e.message||"",o=e.title||"",s=e.position||null,c=e.showCloseButton!=null?e.showCloseButton:null,a=e.timeout!=null?e.timeout:null);const u={options:{type:t,message:r,title:o}};return s!=null&&(u.position=s),c!=null&&(u.showCloseButton=c),a!=null&&(u.timeout=a),u}info(t){const e=this.buildNotifyProps("info",t);return this.show(e)}success(t){const e=this.buildNotifyProps("success",t);return this.show(e)}warning(t){const e=this.buildNotifyProps("warning",t);return this.show(e)}error(t){const e=this.buildNotifyProps("error",t);return this.show(e)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const gi=Symbol("NOTIFY_SERVICE_TOKEN");Gt.install=n=>{n.component(Gt.name,Gt),n.component(rn.name,rn);const t=new _n;n.provide(gi,t),n.provide("FNotifyService",t)};function yi(n,t,e,r,o){var nt;const a=new Map,s=new Map,c=new Map,l=new Map,u=new Map,d=i.ref([]),f=i.ref([]),m=fi(n,o),{generateGroupData:h,groupFields:g,shouldGroupingData:M}=m,_=i.ref(n.data),b=mi(n,_,r,o),{collapseTo:C,expandTo:v,generateHierarchyData:w,hasRealChildren:T,insertSibling:k,insertChild:p,isVisibleInTree:S,shouldStratifyData:x,toggleChildrenVisibiltyByCollapseStatus:F,trimmedOriginalData:y,checkVisibleInHierarchy:I}=b,{idField:P,reviseIdentifyField:O}=o,E=i.ref(n.newDataItem),G=i.ref(n.data||[]),$=i.ref(n.data),{flatTreeData:D}=wc(n);function W(Y){return D(Y)}if(n.hierarchy&&n.data&&((nt=n.data[0])!=null&&nt.children)){const Y=W(n.data);_.value=Y,G.value=Y,$.value=Y}const Q=i.ref(n.summary),B=i.computed(()=>{const Y=Q.value;return(Y==null?void 0:Y.groupFields)||[]});let V=new Map;const U=i.ref(G.value.length),L=i.ref(n.pagination);function R(){return L.value&&L.value.enable&&L.value.size>0?L.value.size:G.value.length}const z=i.ref(1),K=i.computed(()=>L.value&&L.value.enable&&L.value.mode!=="server"),ne=i.computed(()=>L.value&&L.value.enable&&L.value.mode==="server"),J=new _n;function me(Y,ge){const Te=Math.ceil(Y.length/ge);let De=0;const H=[],Z=[],re=[];for(;De<Te;){const te=Y.slice(De*ge,(De+1)*ge),_e=h(g.value,te,t);Z[De]=_e.filter(xe=>xe.__fv_data_grid_group_row__).length,H.push(..._e),De++}return Z.reduce((te,_e,xe)=>(te=te+_e,re.push(te),te),0),{groupData:H,groupRowSizeList:Z,accumulateGroupRowSize:re}}function be(){var _e;G.value=_.value,K.value&&(U.value=G.value.length),M.value&&!K.value&&(G.value=h(g.value,_.value,t)),V=B.value.reduce((xe,He)=>(xe.set(He,0),xe),V);const Y=0,ge=R(),Te=(z.value-1)*ge;let H=Te>G.value.length-1||ne.value?Y:Te,Z=ne.value?G.value.length:Math.min(H+ge,G.value.length);if(M.value&&K.value){const{accumulateGroupRowSize:xe,groupData:He,groupRowSizeList:Me}=me(_.value,ge);G.value=He;const We=Me[z.value-1];H+=z.value-2<0?0:xe[z.value-2],Z=H+ge+We}let re=0;const te=[];if(G.value.length){O(G.value);const xe=P.value!==n.idField;for(let He=H;He<Z;He++){const Me=G.value[He];Me.__fv_data_grid_group_row__?(re=0,Me.__fv_data_index__=""):Me.__fv_data_grid_group_summary__?Me.__fv_data_index__="":(re++,Me.__fv_data_index__=re+(z.value-1)*ge),Me.__fv_index__=He,Me.__fv_visible_index__=He,n.rowOption&&n.rowOption.disabledField&&(Me.__fv_disabled__=Me[(_e=n.rowOption)==null?void 0:_e.disabledField]),xe&&(Me[P.value]=He),B.value.forEach(We=>{const dt=V.get(We)||0;V.set(We,dt+Me[We])}),te.push(Me)}}return x.value&&w(te),$.value=[...te],te}const Se=i.ref(be()),Pe=i.computed(()=>(I.value,Se.value.filter(Y=>x.value?Y.__fv_visible__!==!1&&S(Y):Y.__fv_visible__!==!1)));function je(){Pe.value.forEach((Y,ge)=>(Y.__fv_visible_index__=ge,Y))}function A(Y,ge,Te=!1){const H=(Te?be():[...$.value]).filter(te=>e.apply(te)),Z=Y&&Y.length?H.filter(te=>Y.reduce((_e,xe)=>_e&&xe.filter(te),!0)):H,re=ge&&ge.length?Z.sort((te,_e)=>{const xe=[...ge],He=xe.shift();let Me=He.compare(te[He.field],_e[He.field]);for(;Me===0&&xe.length!==0;){const We=xe.shift();We&&(Me=We.compare(te[We.field],_e[We.field]))}return Me}):Z;return Se.value=re.map((te,_e)=>{if(te.__fv_data_grid_group_row__){const xe=`group_of_${te.__fv_data_grid_group_field__}_${te.__fv_data_grid_group_value__}`;te.__fv_data_grid_group_collapse__=!!a.get(xe)}return te.__fv_index__=_e,te.__fv_visible_index__=_e,te}),Se.value}function ae(Y){return u.clear(),f.value=Y,f.value.reduce((ge,Te)=>(ge.set(Te.field,Te),ge),u),A([],f.value)}function q(Y,ge){return u.set(Y,ge),f.value=Array.from(u.values()),A([],f.value)}function ee(Y){return u.delete(Y),f.value=Array.from(u.values()),A([],f.value)}function ve(Y,ge){return s.set(Y,ge),d.value=Array.from(s.values()),A([],Array.from(u.values()))}function Fe(Y){return s.delete(Y),d.value=Array.from(s.values()),A([],Array.from(u.values()),!0)}function Ie(){return s.clear(),d.value=[],A([],Array.from(u.values()),!0)}function Je(Y,ge){const Te=`group_of_${Y}_${ge}`;a.set(Te,!0);const De=H=>H[Y]!==ge;return c.set(`collapse_${Y}_${ge}`,{field:Y,fieldName:Y,fieldType:"string",filterValue:ge,filter:De}),A(Array.from(c.values()),Array.from(u.values()))}function st(Y){C(Se.value,Y)}function lt(Y){v(Se.value,Y)}function N(Y,ge){const Te=`group_of_${Y}_${ge}`;return a.set(Te,!1),c.delete(`collapse_${Y}_${ge}`),A(Array.from(c.values()),Array.from(u.values()),!0)}function ie(Y){const ge=Y.raw[P.value],Te=De=>!De.__fv_parents__.has(ge);l.set(`fold_${ge}`,{field:"id",fieldName:"id",fieldType:"string",filterValue:String(ge),filter:Te}),A(Array.from(l.values()),Array.from(u.values())),w(Se.value)}function we(Y){const ge=Y[P.value];l.delete(`fold_${ge}`)}function ue(Y){we(Y.raw),A(Array.from(l.values()),Array.from(u.values()),!0),w(Se.value)}function Oe(){const Y=be();Se.value=Y,n.hierarchy&&(A(Array.from(l.values()),Array.from(u.values())),w(Se.value))}function Ze(Y){const Te=n.hierarchy&&Y&&Y.length&&Y[0].children?W(Y):Y;_.value=Te,Oe()}function ct(Y,ge,Te){return(Y&&Y.length?Se.value.filter((H,Z)=>Y.reduce((re,te)=>re&&te.filter(H),!0)):Se.value).slice(ge,Te)}function ut(Y){const ge=R(),Te=Math.ceil(U.value/ge);0<=Y&&Y<=Te&&(z.value=Y,Oe())}function mt(Y){_.value.push(Le.cloneDeep(Y)),Se.value=be()}function Ct(Y=0){if(!(Y>-1))return!1;const Te=E.value();n.hierarchy?k(Y,Te,_):_.value.splice(Y,0,Te),Oe()}function bt(Y=0){if(!(Y>-1&&n.hierarchy))return!1;const Te=E.value(),De=_.value[Y];we(De),p(Y,Te,_),Oe()}function ht(Y){const ge=Y?Y-1:0;_.value.splice(ge,1),Oe()}function xt(Y){const ge=_.value.findIndex(Te=>Te[P.value]===Y);ge!==-1&&(_.value.splice(ge,1),Oe())}function wt(Y){const ge=Y>-1?_.value[Y]:null;if(!(ge&&ge.deletable!==!1))return!1;_.value=y(ge,_.value),Oe()}function oe(){const Y=c.size>0?Array.from(c.values()):[];return A(Y,Array.from(u.values()))}function he(Y){L.value.size=Y}function Ce(Y){L.value&&(he(Y),Oe())}function Re(Y,ge){const Te=_.value[Number(Y)-1];Te.editable!==!1?(Te.name=ge,Oe()):J.show({showCloseButton:!1,timeout:3e3,animate:"fadeIn",toasts:[{type:"string",title:"提示",msg:"当前节点禁止编辑"}]})}function Ge(Y){return Y.map(Te=>{const De=$.value.findIndex(H=>""+H[P.value]==""+Te);return De>-1?$.value[De]:null}).filter(Te=>Te!=null)}return{addFilter:ve,addNewDataItem:mt,addSorter:q,updatePageSize:he,changePageSizeTo:Ce,collapse:Je,collapseTo:st,dataView:Se,editDataItem:Re,expand:N,expandTo:lt,filters:d,fold:ie,getRange:ct,getSelectionItems:Ge,hasRealChildren:T,insertNewChildDataItem:bt,insertNewDataItem:Ct,isVisibleInTree:S,load:Ze,navigatePageTo:ut,pageIndex:z,rawView:$,refresh:oe,removeAllFilter:Ie,removeDataItem:ht,removeDataItemById:xt,removeFilter:Fe,removeHierarchyDataItem:wt,removeSorter:ee,reOrderVisibleIndex:je,setSorters:ae,sorters:f,summaries:V,toggleChildrenVisibiltyByCollapseStatus:F,totalItems:U,unFold:ue,updateDataView:Oe,visibleDataItems:Pe}}const Sn={conditions:{type:Array,default:[]},fields:{type:Array,default:[]},key:{type:String,default:""},isControlInline:{type:Boolean,default:!0}};class Tn{constructor(t={value:[]}){j(this,"editorType","check-box");j(this,"value");j(this,"valueType","boolean");const r=(Array.isArray(t.value)?t.value:typeof t.value=="string"?t.value.split(","):[]).map(o=>JSON.parse(o));this.value=r}clear(){this.value=[]}setValue(t){this.value=t}getValue(){return this.value}getDisplayText(){return this.value.map(t=>t?"是":"否").join(",")}isEmpty(){return this.value.length===0}}class kn{constructor(t={textValue:"",value:"",valueField:""}){j(this,"editorType","combo-lookup");j(this,"textValue");j(this,"value");j(this,"valueField");j(this,"valueType","text");this.textValue=t.textValue,this.value=t.value,this.valueField=t.valueField}clear(){this.value="",this.valueField="",this.textValue=""}getPropValue(t,e){if(e.length>1){const r=e.shift();return t[r]?this.getPropValue(t[r],e):null}return t[e[0]]}getTextValue(t){const e=t.split("."),r=this.value.split(",").map(o=>this.getPropValue(o,Le.cloneDeep(e)));return r&&r.length?r.join(","):""}getValue(){const t=this.valueField.split("."),e=this.value.split(",").map(r=>this.getPropValue(r,Le.cloneDeep(t)));return e&&e.length?e.join(","):""}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.valueField}}function Xe(n){const t=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&t==="[object Date]"?new n.constructor(+n):typeof n=="number"||t==="[object Number]"||typeof n=="string"||t==="[object String]"?new Date(n):new Date(NaN)}function qe(n,t){return n instanceof Date?new n.constructor(t):new Date(t)}function Fn(n,t){const e=Xe(n);return isNaN(t)?qe(n,NaN):(t&&e.setDate(e.getDate()+t),e)}const On=6048e5,vi=864e5,bi=6e4,wi=36e5,Ci=1e3;let xi={};function Dt(){return xi}function kt(n,t){var c,l,u,d;const e=Dt(),r=(t==null?void 0:t.weekStartsOn)??((l=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((d=(u=e.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,o=Xe(n),a=o.getDay(),s=(a<r?7:0)+a-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function Pt(n){return kt(n,{weekStartsOn:1})}function Nn(n){const t=Xe(n),e=t.getFullYear(),r=qe(n,0);r.setFullYear(e+1,0,4),r.setHours(0,0,0,0);const o=Pt(r),a=qe(n,0);a.setFullYear(e,0,4),a.setHours(0,0,0,0);const s=Pt(a);return t.getTime()>=o.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function En(n){const t=Xe(n);return t.setHours(0,0,0,0),t}function zt(n){const t=Xe(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function _i(n,t){const e=En(n),r=En(t),o=+e-zt(e),a=+r-zt(r);return Math.round((o-a)/vi)}function Si(n){const t=Nn(n),e=qe(n,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Pt(e)}function Ti(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ki(n){if(!Ti(n)&&typeof n!="number")return!1;const t=Xe(n);return!isNaN(Number(t))}function Fi(n){const t=Xe(n),e=qe(n,0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Oi={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ni=(n,t,e)=>{let r;const o=Oi[n];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r};function on(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Ei={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Mi={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Vi={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ii={date:on({formats:Ei,defaultWidth:"full"}),time:on({formats:Mi,defaultWidth:"full"}),dateTime:on({formats:Vi,defaultWidth:"full"})},Di={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Pi=(n,t,e,r)=>Di[n];function Wt(n){return(t,e)=>{const r=e!=null&&e.context?String(e.context):"standalone";let o;if(r==="formatting"&&n.formattingValues){const s=n.defaultFormattingWidth||n.defaultWidth,c=e!=null&&e.width?String(e.width):s;o=n.formattingValues[c]||n.formattingValues[s]}else{const s=n.defaultWidth,c=e!=null&&e.width?String(e.width):n.defaultWidth;o=n.values[c]||n.values[s]}const a=n.argumentCallback?n.argumentCallback(t):t;return o[a]}}const Bi={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ji={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ri={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Ju