@univerjs/sheets-ui 0.7.0-nightly.202505031606 → 0.7.0-nightly.202505051607

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js CHANGED
@@ -134,7 +134,7 @@
134
134
  univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded
135
135
  univer-border-none univer-bg-transparent univer-p-1
136
136
  hover:univer-bg-gray-100
137
- `,type:"button",children:[b.jsx(va,{type:a.BorderStyleTypes.THIN}),b.jsx(gn,{className:"univer-text-gray-400"})]})})})]})]})}const Fl="sheets.component.cell-popup";var xg=Object.getOwnPropertyDescriptor,Og=(n,i,e,t)=>{for(var r=t>1?void 0:t?xg(i,e):i,o=n.length-1,s;o>=0;o--)(s=n[o])&&(r=s(r)||r);return r},wt=(n,i)=>(e,t)=>i(e,t,n);exports.SheetCanvasPopManagerService=class extends a.Disposable{constructor(e,t,r,o,s,l,c){super();E(this,"_popupMenuFeatureMap",new Map);E(this,"_isSelectionMoving",!1);this._globalPopupManagerService=e,this._renderManagerService=t,this._univerInstanceService=r,this._refRangeService=o,this._commandService=s,this._refSelectionsService=l,this._selectionManagerService=c,this._initMoving()}_initMoving(){this.disposeWithMe(this._refSelectionsService.selectionMoving$.subscribe(()=>{this._isSelectionMoving=!0})),this.disposeWithMe(this._refSelectionsService.selectionMoveEnd$.subscribe(()=>{this._isSelectionMoving=!1})),this.disposeWithMe(this._selectionManagerService.selectionMoving$.subscribe(()=>{this._isSelectionMoving=!0})),this.disposeWithMe(this._selectionManagerService.selectionMoveEnd$.subscribe(()=>{this._isSelectionMoving=!1}))}registerFeatureMenu(e,t){this._popupMenuFeatureMap.set(e,t)}getFeatureMenu(e,t,r,o){const s=this._popupMenuFeatureMap.get(o);if(s)return s(e,t,r,o)}dispose(){super.dispose(),this._popupMenuFeatureMap.clear()}_createHiddenRectObserver(e){const{row:t,column:r,worksheet:o,skeleton:s,currentRender:l}=e,c=()=>{var z,F;const g=o.getFreeze(),{startRow:S,startColumn:f,xSplit:p,ySplit:v}=g,C=S-v,I=f-p,{rowHeightAccumulation:R,columnWidthAccumulation:w,rowHeaderWidth:P,columnHeaderHeight:y}=s,M=P+(I===-1?0:w[I+p-1]-((z=w[I-1])!=null?z:0)),x=y+(C===-1?0:R[C+v-1]-((F=R[C])!=null?F:0)),A=l.engine.getCanvasElement(),k=A.getBoundingClientRect(),N=no(A.style.width),D=k.width/N,W=l.scene.getAncestorScale().scaleX,V=M*D*W,U=x*D*W,L={left:-1/0,top:-1/0,right:k.left+V,bottom:k.top+U},j={left:k.left+V,top:-1/0,right:1/0,bottom:k.top+U},B={left:-1/0,top:k.top+U,right:k.left+V,bottom:1/0};return t<S&&r<f?[]:t<S?[L]:r<f?[L]:[L,j,B]},d=c(),u=new O.BehaviorSubject(d),h=new a.DisposableCollection;return h.add(this._commandService.onCommandExecuted(g=>{g.id===m.SetFrozenMutation.id&&u.next(c())})),h.add(a.fromEventSubject(l.engine.onTransformChange$).pipe(O.throttleTime(16)).subscribe(()=>{u.next(c())})),{rects$:u,disposable:h}}_createPositionObserver(e,t,r,o){const s=()=>{const{scene:u}=t,h=gg(e,u,r,o),g=t.engine.getCanvasElement(),S=g.getBoundingClientRect(),f=no(g.style.width),p=S.width/f;return{left:h.left*p+S.left,right:h.right*p+S.left,top:h.top*p+S.top,bottom:h.bottom*p+S.top}},l=s(),c=new O.BehaviorSubject(l),d=new a.DisposableCollection;return d.add(this._commandService.onCommandExecuted(u=>{(u.id===He.id||u.id===Ne.id)&&c.next(s())})),{position:l,position$:c,disposable:d}}attachPopupToObject(e,t){var R;const r=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),o=r.getActiveSheet();if(!o||this._isSelectionMoving&&!t.showOnSelectionMoving)return{dispose:()=>{},canDispose:()=>!0};const s=r.getUnitId(),l=o.getSheetId(),c=(R=this._renderManagerService.getRenderById(s))==null?void 0:R.with(exports.SheetSkeletonManagerService).ensureSkeleton(l),d=this._renderManagerService.getRenderById(s);if(!d||!c)return{dispose:()=>{},canDispose:()=>!0};const{left:u,top:h,width:g,height:S}=e,f={left:u,right:u+g,top:h,bottom:h+S},{position:p,position$:v,disposable:C}=this._createPositionObserver(f,d,c,o),I=this._globalPopupManagerService.addPopup({...t,unitId:s,subUnitId:l,anchorRect:p,anchorRect$:v,canvasElement:d.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(I),v.complete(),C.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==I}}attachPopupByPosition(e,t,r){var C;const o=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),s=o.getActiveSheet();if(!s)return null;const l=o.getUnitId(),c=s.getSheetId();if(l!==r.unitId||r.subUnitId!==c)return null;if(this._isSelectionMoving&&!t.showOnSelectionMoving)return;const d=(C=this._renderManagerService.getRenderById(l))==null?void 0:C.with(exports.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:c}),u=this._renderManagerService.getRenderById(l);if(!u||!d)return null;const{position:h,position$:g,disposable:S}=this._createPositionObserver(e,u,d,s),{rects$:f,disposable:p}=this._createHiddenRectObserver({row:r.row,column:r.col,worksheet:s,skeleton:d,currentRender:u}),v=this._globalPopupManagerService.addPopup({...t,unitId:l,subUnitId:c,anchorRect:h,anchorRect$:g,hiddenRects$:f,canvasElement:u.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(v),g.complete(),S.dispose(),p.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==v}}attachPopupToAbsolutePosition(e,t,r,o){var f;const s=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),l=s.getActiveSheet();if(!l)return null;const c=s.getUnitId(),d=l.getSheetId();if(r&&c!==r||o&&o!==d)return null;const u=(f=this._renderManagerService.getRenderById(c))==null?void 0:f.with(exports.SheetSkeletonManagerService).ensureSkeleton(d),h=this._renderManagerService.getRenderById(c);if(!h||!u)return null;if(this._isSelectionMoving&&!t.showOnSelectionMoving)return;const g=new O.BehaviorSubject(e),S=this._globalPopupManagerService.addPopup({...t,unitId:c,subUnitId:d,anchorRect:e,anchorRect$:g.asObservable(),canvasElement:h.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(S),g.complete()},canDispose:()=>this._globalPopupManagerService.activePopupId!==S}}attachPopupToCell(e,t,r,o,s,l){const c=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),d=c.getActiveSheet();if(!d)return null;const u=c.getUnitId(),h=d.getSheetId();if(o&&u!==o||s&&h!==s)return null;const g=this._renderManagerService.getRenderById(u),S=g==null?void 0:g.with(exports.SheetSkeletonManagerService).ensureSkeleton(h),f=g==null?void 0:g.with(pe);if(!g||!S||!f)return null;if(this._isSelectionMoving&&!r.showOnSelectionMoving)return;const p=l!=null?l:Sa(e,t,g.scene,d);if(!p)return null;const{position:v,position$:C,disposable:I,updateRowCol:R}=this._createCellPositionObserver(e,t,g,S,p),{rects$:w,disposable:P}=this._createHiddenRectObserver({row:e,column:t,worksheet:d,skeleton:S,currentRender:g}),y=this._globalPopupManagerService.addPopup({...r,unitId:u,subUnitId:h,anchorRect:v,anchorRect$:C,canvasElement:g.engine.getCanvasElement(),hiddenRects$:w}),M=new a.DisposableCollection;M.add(I),M.add(a.toDisposable(()=>{this._globalPopupManagerService.removePopup(y),C.complete()})),M.add(P);const x={startRow:e,endRow:e,startColumn:t,endColumn:t};return M.add(this._refRangeService.watchRange(u,h,x,(A,k)=>{k?R(k.startRow,k.startColumn):M.dispose()})),{dispose(){M.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==y}}attachRangePopup(e,t,r,o,s,l=!1){const c=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),d=c.getActiveSheet();if(!d)return null;const u=c.getUnitId(),h=d.getSheetId();if(r&&u!==r||o&&h!==o)return null;const g=this._renderManagerService.getRenderById(u),S=g==null?void 0:g.with(exports.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:h}),f=g==null?void 0:g.with(pe);if(!g||!S||!f)return null;if(f.selectionMoving&&!l)return;const p=s!=null?s:Sa(e.startRow,e.startColumn,g.scene,d);if(!p)return null;const{position:v,position$:C,disposable:I,updateRowCol:R,topLeftPos$:w,rightBottomPos$:P}=this._createRangePositionObserver(e,g,S,p),{rects$:y,disposable:M}=this._createHiddenRectObserver({row:e.startRow,column:e.startColumn,worksheet:d,skeleton:S,currentRender:g}),x=this._globalPopupManagerService.addPopup({...t,unitId:u,subUnitId:h,anchorRect:v,anchorRect$:C,canvasElement:g.engine.getCanvasElement(),hiddenRects$:y}),A=new a.DisposableCollection;A.add(I),A.add(a.toDisposable(()=>{this._globalPopupManagerService.removePopup(x),w.complete(),P.complete()})),A.add(M);const k={...e};return A.add(this._refRangeService.watchRange(u,h,k,(N,D)=>{D?R(D.startRow,D.startColumn):A.dispose()})),{dispose(){A.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==x}}_createCellPositionObserver(e,t,r,o,s){let l=e,c=t;const d=this._calcCellPositionByCell(l,c,r,o,s),u=new O.BehaviorSubject(d),h=()=>u.next(this._calcCellPositionByCell(l,c,r,o,s)),g=new a.DisposableCollection;return g.add(r.engine.clientRect$.subscribe(()=>h())),g.add(a.fromEventSubject(r.engine.onTransformChange$).pipe(O.throttleTime(16)).subscribe(()=>h())),g.add(this._commandService.onCommandExecuted(f=>{if(f.id===m.SetWorksheetRowAutoHeightMutation.id&&f.params.rowsAutoHeightInfo.findIndex(v=>v.row===l)>-1){h();return}(m.COMMAND_LISTENER_SKELETON_CHANGE.indexOf(f.id)>-1||f.id===He.id||f.id===Ne.id)&&h()})),{position$:u,disposable:g,position:d,updateRowCol:(f,p)=>{l=f,c=p,h()}}}_calcCellPositionByCell(e,t,r,o,s){const{scene:l,engine:c}=r,d=o.getCellWithCoordByIndex(e,t),u=d.isMergedMainCell?d.mergeInfo:d,{scaleX:h,scaleY:g}=l.getAncestorScale(),S={x:s.viewportScrollX,y:s.viewportScrollY},f=c.getCanvasElement(),p=f.getBoundingClientRect(),v=no(f.style.width),{top:C,left:I,width:R}=p,w=R/v;return{left:(u.startX-S.x)*w*h+I,right:(u.endX-S.x)*w*h+I,top:(u.startY-S.y)*w*g+C,bottom:(u.endY-S.y)*w*g+C}}_createRangePositionObserver(e,t,r,o){let{startRow:s,startColumn:l}=e;const c=this._calcCellPositionByCell(s,l,t,r,o),d=new O.BehaviorSubject(c),u=this._calcCellPositionByCell(e.endRow,e.endColumn,t,r,o),h=new O.BehaviorSubject(u),g=()=>{const C=this._calcCellPositionByCell(s,l,t,r,o),I=this._calcCellPositionByCell(e.endRow,e.endColumn,t,r,o);d.next(C),h.next(I)},S=new a.DisposableCollection;S.add(t.engine.clientRect$.subscribe(()=>g())),S.add(this._commandService.onCommandExecuted(C=>{if(C.id===m.SetWorksheetRowAutoHeightMutation.id&&C.params.rowsAutoHeightInfo.findIndex(R=>R.row===s)>-1){g();return}(m.COMMAND_LISTENER_SKELETON_CHANGE.indexOf(C.id)>-1||C.id===He.id||C.id===Ne.id)&&g()}));const f=(C,I)=>{s=C,l=I,g()},p=d.pipe(O.map(C=>{const I=this._calcCellPositionByCell(e.endRow,e.endColumn,t,r,o);return{top:C.top,left:C.left,right:I.right,bottom:I.bottom}})),v={top:c.top,left:c.left,right:u.right,bottom:u.bottom};return{position$:p,position:v,updateRowCol:f,topLeftPos$:d,rightBottomPos$:h,disposable:S}}};exports.SheetCanvasPopManagerService=Og([wt(0,a.Inject(_.ICanvasPopupService)),wt(1,T.IRenderManagerService),wt(2,a.IUniverInstanceService),wt(3,a.Inject(m.RefRangeService)),wt(4,a.ICommandService),wt(5,m.IRefSelectionsService),wt(6,a.Inject(m.SheetsSelectionsService))],exports.SheetCanvasPopManagerService);function no(n){return Number.parseInt(n.replace("px",""))}var Ag=Object.getOwnPropertyDescriptor,kg=(n,i,e,t)=>{for(var r=t>1?void 0:t?Ag(i,e):i,o=n.length-1,s;o>=0;o--)(s=n[o])&&(r=s(r)||r);return r},Ng=(n,i)=>(e,t)=>i(e,t,n);exports.CellPopupManagerService=class extends a.Disposable{constructor(e){super();E(this,"_cellPopupMap",new Map);E(this,"_change$",new O.Subject);E(this,"change$",this._change$.asObservable());this._sheetCanvasPopManagerService=e}_ensureCellPopupMap(e,t){let r=this._cellPopupMap.get(e);r||(r=new Map,this._cellPopupMap.set(e,r));let o=r.get(t);return o||(o=new a.ObjectMatrix,r.set(t,o)),o}showPopup(e,t){var g,S;const{direction:r="horizontal"}=t,{unitId:o,subUnitId:s,row:l,col:c}=e,d=this._ensureCellPopupMap(o,s),u=(g=d.getValue(l,c))==null?void 0:g[r];t.id=(S=t.id)!=null?S:a.generateRandomId();const h=()=>{const f=d.getValue(l,c);if(!f)return;const p=f[r];if(!p)return;const v=p==null?void 0:p.popups.findIndex(C=>C.id===t.id&&C.componentKey===t.componentKey);p==null||p.popups.splice(v,1),p.popups.length===0&&(p.disposable.dispose(),f[r]=void 0),this._change$.next({...e,direction:r})};if(u)u.popups.push(t),u.popups.sort((f,p)=>f.priority-p.priority);else{const f=this._sheetCanvasPopManagerService.attachPopupToCell(l,c,{...t,direction:r,componentKey:Fl,extraProps:{...e,direction:r},noPushMinimumGap:!0},o,s);d.setValue(l,c,{...d.getValue(l,c),[r]:{disposable:f,popups:[t]}})}return this._change$.next({...e,direction:r}),a.toDisposable(h)}getPopups(e,t,r,o,s){var c,d;return((d=(c=this._ensureCellPopupMap(e,t).getValue(r,o))==null?void 0:c[s])==null?void 0:d.popups)||[]}};exports.CellPopupManagerService=kg([Ng(0,a.Inject(exports.SheetCanvasPopManagerService))],exports.CellPopupManagerService);const Dg=n=>{const{popup:i}=n,e=i.extraProps,{row:t,col:r,direction:o,unitId:s,subUnitId:l}=e,c=_.useDependency(exports.CellPopupManagerService);_.useObservable(H.useMemo(()=>c.change$.pipe(O.filter(h=>h.row===t&&h.col===r&&h.direction===o)),[c,t,r,o]));const d=c.getPopups(s,l,t,r,o),u=_.useDependency(_.ComponentManager);return b.jsx("div",{className:"univer-cell-popup univer-flex univer-flex-col univer-ml-[1px]",children:d.map(h=>{const g=h,S=u.get(g.componentKey);return S?b.jsx(S,{popup:g}):null})})},Ca=n=>{const{inputId:i,state:e=!1,type:t="range",confirm:r,cancel:o,name:s,formulaOrRefString:l,comment:c="",localSheetId:d=m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,hidden:u=!1,id:h}=n,S=_.useDependency(a.IUniverInstanceService).getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),f=_.useDependency(a.LocaleService),p=_.useDependency(K.IDefinedNamesService),v=_.useDependency(K.IFunctionService),C=_.useDependency(K.LexerTreeBuilder),I=_.useDependency(_.ComponentManager),R=H.useMemo(()=>I.get(Jo),[]),w=H.useMemo(()=>I.get(bi),[]);if(S==null)return;const P=H.useMemo(()=>S.getUnitId(),[]),y=H.useMemo(()=>S.getActiveSheet().getSheetId(),[]),[M,x]=H.useState(s),[A,k]=H.useState(l),[N,D]=H.useState(c),[W,V]=H.useState(d),[U,L]=H.useState(""),[j,B]=H.useState(t),[z,F]=H.useState(!0),Z=[{label:f.t("definedName.scopeWorkbook"),value:m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME}],$=ie=>!K.isReferenceStrings(ie);H.useEffect(()=>{F(!0),x(s),D(c),V(d);let ie=l;l.substring(0,1)===K.operatorToken.EQUALS?B("formula"):$(l)?(B("formula"),ie=K.operatorToken.EQUALS+l):B("range"),k(ie),L("")},[e]),S.getSheetOrders().forEach(ie=>{const oe=S.getSheetBySheetId(ie);Z.push({label:(oe==null?void 0:oe.getName())||"",value:ie})});const Q=ie=>{k(ie)},se=ie=>{k(ie||"")},G=()=>{if(M.length===0){L(f.t("definedName.nameEmpty"));return}if(p.getValueByName(P,M)!=null&&(h==null||h.length===0)){L(f.t("definedName.nameDuplicate"));return}if(!a.Tools.isValidParameter(M)||K.isReferenceStringWithEffectiveColumn(M)||!a.Tools.isStartValidPosition(M)&&!T.hasCJKText(M.substring(0,1))){L(f.t("definedName.nameInvalid"));return}if(S.getSheetOrders().map(ee=>{var me;return((me=S.getSheetBySheetId(ee))==null?void 0:me.getName())||""}).includes(M)){L(f.t("definedName.nameSheetConflict"));return}if(A.length===0){L(f.t("definedName.formulaOrRefStringEmpty"));return}if(!z){L(f.t("definedName.formulaOrRefStringInvalid"));return}if(v.hasExecutor(M.toUpperCase())){L(f.t("definedName.nameConflict"));return}const oe=S.getActiveSheet().getName();r&&r({id:h||"",name:M,formulaOrRefString:C.convertRefersToAbsolute(A,a.AbsoluteRefType.ALL,a.AbsoluteRefType.ALL,oe),comment:N,localSheetId:W})},Y=ie=>{const oe=ie;oe==="formula"?l[0]===K.operatorToken.EQUALS?k(l):k(`${K.operatorToken.EQUALS}`):l[0]===K.operatorToken.EQUALS?k(""):k(l),B(oe)},q=H.useRef(null),[ne,ce]=H.useState(!1);return _.useSidebarClick(ie=>{var ee;((ee=q.current)==null?void 0:ee.isClickOutSide(ie))&&ce(!1)}),b.jsxs("div",{className:X.clsx(`
137
+ `,type:"button",children:[b.jsx(va,{type:a.BorderStyleTypes.THIN}),b.jsx(gn,{className:"univer-text-gray-400"})]})})})]})]})}const Fl="sheets.component.cell-popup";var xg=Object.getOwnPropertyDescriptor,Og=(n,i,e,t)=>{for(var r=t>1?void 0:t?xg(i,e):i,o=n.length-1,s;o>=0;o--)(s=n[o])&&(r=s(r)||r);return r},wt=(n,i)=>(e,t)=>i(e,t,n);exports.SheetCanvasPopManagerService=class extends a.Disposable{constructor(e,t,r,o,s,l,c){super();E(this,"_popupMenuFeatureMap",new Map);E(this,"_isSelectionMoving",!1);this._globalPopupManagerService=e,this._renderManagerService=t,this._univerInstanceService=r,this._refRangeService=o,this._commandService=s,this._refSelectionsService=l,this._selectionManagerService=c,this._initMoving()}_initMoving(){this.disposeWithMe(this._refSelectionsService.selectionMoving$.subscribe(()=>{this._isSelectionMoving=!0})),this.disposeWithMe(this._refSelectionsService.selectionMoveEnd$.subscribe(()=>{this._isSelectionMoving=!1})),this.disposeWithMe(this._selectionManagerService.selectionMoving$.subscribe(()=>{this._isSelectionMoving=!0})),this.disposeWithMe(this._selectionManagerService.selectionMoveEnd$.subscribe(()=>{this._isSelectionMoving=!1}))}registerFeatureMenu(e,t){this._popupMenuFeatureMap.set(e,t)}getFeatureMenu(e,t,r,o){const s=this._popupMenuFeatureMap.get(o);if(s)return s(e,t,r,o)}dispose(){super.dispose(),this._popupMenuFeatureMap.clear()}_createHiddenRectObserver(e){const{row:t,column:r,worksheet:o,skeleton:s,currentRender:l}=e,c=()=>{var z,F;const g=o.getFreeze(),{startRow:S,startColumn:f,xSplit:p,ySplit:v}=g,C=S-v,I=f-p,{rowHeightAccumulation:R,columnWidthAccumulation:w,rowHeaderWidth:P,columnHeaderHeight:y}=s,M=P+(I===-1?0:w[I+p-1]-((z=w[I-1])!=null?z:0)),x=y+(C===-1?0:R[C+v-1]-((F=R[C])!=null?F:0)),A=l.engine.getCanvasElement(),k=A.getBoundingClientRect(),N=no(A.style.width),D=k.width/N,W=l.scene.getAncestorScale().scaleX,V=M*D*W,U=x*D*W,L={left:-1/0,top:-1/0,right:k.left+V,bottom:k.top+U},j={left:k.left+V,top:-1/0,right:1/0,bottom:k.top+U},B={left:-1/0,top:k.top+U,right:k.left+V,bottom:1/0};return t<S&&r<f?[]:t<S?[L]:r<f?[L]:[L,j,B]},d=c(),u=new O.BehaviorSubject(d),h=new a.DisposableCollection;return h.add(this._commandService.onCommandExecuted(g=>{g.id===m.SetFrozenMutation.id&&u.next(c())})),h.add(a.fromEventSubject(l.engine.onTransformChange$).pipe(O.throttleTime(16)).subscribe(()=>{u.next(c())})),{rects$:u,disposable:h}}_createPositionObserver(e,t,r,o){const s=()=>{const{scene:u}=t,h=gg(e,u,r,o),g=t.engine.getCanvasElement(),S=g.getBoundingClientRect(),f=no(g.style.width),p=S.width/f;return{left:h.left*p+S.left,right:h.right*p+S.left,top:h.top*p+S.top,bottom:h.bottom*p+S.top}},l=s(),c=new O.BehaviorSubject(l),d=new a.DisposableCollection;return d.add(this._commandService.onCommandExecuted(u=>{(u.id===He.id||u.id===Ne.id)&&c.next(s())})),{position:l,position$:c,disposable:d}}attachPopupToObject(e,t){var R;const r=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),o=r.getActiveSheet();if(!o||this._isSelectionMoving&&!t.showOnSelectionMoving)return{dispose:()=>{},canDispose:()=>!0};const s=r.getUnitId(),l=o.getSheetId(),c=(R=this._renderManagerService.getRenderById(s))==null?void 0:R.with(exports.SheetSkeletonManagerService).ensureSkeleton(l),d=this._renderManagerService.getRenderById(s);if(!d||!c)return{dispose:()=>{},canDispose:()=>!0};const{left:u,top:h,width:g,height:S}=e,f={left:u,right:u+g,top:h,bottom:h+S},{position:p,position$:v,disposable:C}=this._createPositionObserver(f,d,c,o),I=this._globalPopupManagerService.addPopup({...t,unitId:s,subUnitId:l,anchorRect:p,anchorRect$:v,canvasElement:d.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(I),v.complete(),C.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==I}}attachPopupByPosition(e,t,r){var C;const o=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),s=o.getActiveSheet();if(!s)return null;const l=o.getUnitId(),c=s.getSheetId();if(l!==r.unitId||r.subUnitId!==c)return null;if(this._isSelectionMoving&&!t.showOnSelectionMoving)return;const d=(C=this._renderManagerService.getRenderById(l))==null?void 0:C.with(exports.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:c}),u=this._renderManagerService.getRenderById(l);if(!u||!d)return null;const{position:h,position$:g,disposable:S}=this._createPositionObserver(e,u,d,s),{rects$:f,disposable:p}=this._createHiddenRectObserver({row:r.row,column:r.col,worksheet:s,skeleton:d,currentRender:u}),v=this._globalPopupManagerService.addPopup({...t,unitId:l,subUnitId:c,anchorRect:h,anchorRect$:g,hiddenRects$:f,canvasElement:u.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(v),g.complete(),S.dispose(),p.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==v}}attachPopupToAbsolutePosition(e,t,r,o){var f;const s=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),l=s.getActiveSheet();if(!l)return null;const c=s.getUnitId(),d=l.getSheetId();if(r&&c!==r||o&&o!==d)return null;const u=(f=this._renderManagerService.getRenderById(c))==null?void 0:f.with(exports.SheetSkeletonManagerService).ensureSkeleton(d),h=this._renderManagerService.getRenderById(c);if(!h||!u)return null;if(this._isSelectionMoving&&!t.showOnSelectionMoving)return;const g=new O.BehaviorSubject(e),S=this._globalPopupManagerService.addPopup({...t,unitId:c,subUnitId:d,anchorRect:e,anchorRect$:g.asObservable(),canvasElement:h.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(S),g.complete()},canDispose:()=>this._globalPopupManagerService.activePopupId!==S}}attachPopupToCell(e,t,r,o,s,l){const c=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),d=c.getActiveSheet();if(!d)return null;const u=c.getUnitId(),h=d.getSheetId();if(o&&u!==o||s&&h!==s)return null;const g=this._renderManagerService.getRenderById(u),S=g==null?void 0:g.with(exports.SheetSkeletonManagerService).ensureSkeleton(h),f=g==null?void 0:g.with(pe);if(!g||!S||!f)return null;if(this._isSelectionMoving&&!r.showOnSelectionMoving)return;const p=l!=null?l:Sa(e,t,g.scene,d);if(!p)return null;const{position:v,position$:C,disposable:I,updateRowCol:R}=this._createCellPositionObserver(e,t,g,S,p),{rects$:w,disposable:P}=this._createHiddenRectObserver({row:e,column:t,worksheet:d,skeleton:S,currentRender:g}),y=this._globalPopupManagerService.addPopup({...r,unitId:u,subUnitId:h,anchorRect:v,anchorRect$:C,canvasElement:g.engine.getCanvasElement(),hiddenRects$:w}),M=new a.DisposableCollection;M.add(I),M.add(a.toDisposable(()=>{this._globalPopupManagerService.removePopup(y),C.complete()})),M.add(P);const x={startRow:e,endRow:e,startColumn:t,endColumn:t};return M.add(this._refRangeService.watchRange(u,h,x,(A,k)=>{k?R(k.startRow,k.startColumn):M.dispose()})),{dispose(){M.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==y}}attachRangePopup(e,t,r,o,s,l=!1){const c=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),d=c.getActiveSheet();if(!d)return null;const u=c.getUnitId(),h=d.getSheetId();if(r&&u!==r||o&&h!==o)return null;const g=this._renderManagerService.getRenderById(u),S=g==null?void 0:g.with(exports.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:h}),f=g==null?void 0:g.with(pe);if(!g||!S||!f)return null;if(f.selectionMoving&&!l)return;const p=s!=null?s:Sa(e.startRow,e.startColumn,g.scene,d);if(!p)return null;const{position:v,position$:C,disposable:I,updateRowCol:R,topLeftPos$:w,rightBottomPos$:P}=this._createRangePositionObserver(e,g,S,p),{rects$:y,disposable:M}=this._createHiddenRectObserver({row:e.startRow,column:e.startColumn,worksheet:d,skeleton:S,currentRender:g}),x=this._globalPopupManagerService.addPopup({...t,unitId:u,subUnitId:h,anchorRect:v,anchorRect$:C,canvasElement:g.engine.getCanvasElement(),hiddenRects$:y}),A=new a.DisposableCollection;A.add(I),A.add(a.toDisposable(()=>{this._globalPopupManagerService.removePopup(x),w.complete(),P.complete()})),A.add(M);const k={...e};return A.add(this._refRangeService.watchRange(u,h,k,(N,D)=>{D?R(D.startRow,D.startColumn):A.dispose()})),{dispose(){A.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==x}}_createCellPositionObserver(e,t,r,o,s){let l=e,c=t;const d=this._calcCellPositionByCell(l,c,r,o,s),u=new O.BehaviorSubject(d),h=()=>u.next(this._calcCellPositionByCell(l,c,r,o,s)),g=new a.DisposableCollection;return g.add(r.engine.clientRect$.subscribe(()=>h())),g.add(a.fromEventSubject(r.engine.onTransformChange$).pipe(O.throttleTime(16)).subscribe(()=>h())),g.add(this._commandService.onCommandExecuted(f=>{if(f.id===m.SetWorksheetRowAutoHeightMutation.id&&f.params.rowsAutoHeightInfo.findIndex(v=>v.row===l)>-1){h();return}(m.COMMAND_LISTENER_SKELETON_CHANGE.indexOf(f.id)>-1||f.id===He.id||f.id===Ne.id)&&h()})),{position$:u,disposable:g,position:d,updateRowCol:(f,p)=>{l=f,c=p,h()}}}_calcCellPositionByCell(e,t,r,o,s){const{scene:l,engine:c}=r,d=o.getCellWithCoordByIndex(e,t),u=d.isMergedMainCell?d.mergeInfo:d,{scaleX:h,scaleY:g}=l.getAncestorScale(),S={x:s.viewportScrollX,y:s.viewportScrollY},f=c.getCanvasElement(),p=f.getBoundingClientRect(),v=no(f.style.width),{top:C,left:I,width:R}=p,w=R/v;return{left:(u.startX-S.x)*w*h+I,right:(u.endX-S.x)*w*h+I,top:(u.startY-S.y)*w*g+C,bottom:(u.endY-S.y)*w*g+C}}_createRangePositionObserver(e,t,r,o){let{startRow:s,startColumn:l}=e;const c=this._calcCellPositionByCell(s,l,t,r,o),d=new O.BehaviorSubject(c),u=this._calcCellPositionByCell(e.endRow,e.endColumn,t,r,o),h=new O.BehaviorSubject(u),g=()=>{const C=this._calcCellPositionByCell(s,l,t,r,o),I=this._calcCellPositionByCell(e.endRow,e.endColumn,t,r,o);d.next(C),h.next(I)},S=new a.DisposableCollection;S.add(t.engine.clientRect$.subscribe(()=>g())),S.add(this._commandService.onCommandExecuted(C=>{if(C.id===m.SetWorksheetRowAutoHeightMutation.id&&C.params.rowsAutoHeightInfo.findIndex(R=>R.row===s)>-1){g();return}(m.COMMAND_LISTENER_SKELETON_CHANGE.indexOf(C.id)>-1||C.id===He.id||C.id===Ne.id)&&g()}));const f=(C,I)=>{s=C,l=I,g()},p=d.pipe(O.map(C=>{const I=this._calcCellPositionByCell(e.endRow,e.endColumn,t,r,o);return{top:C.top,left:C.left,right:I.right,bottom:I.bottom}})),v={top:c.top,left:c.left,right:u.right,bottom:u.bottom};return{position$:p,position:v,updateRowCol:f,topLeftPos$:d,rightBottomPos$:h,disposable:S}}};exports.SheetCanvasPopManagerService=Og([wt(0,a.Inject(_.ICanvasPopupService)),wt(1,T.IRenderManagerService),wt(2,a.IUniverInstanceService),wt(3,a.Inject(m.RefRangeService)),wt(4,a.ICommandService),wt(5,m.IRefSelectionsService),wt(6,a.Inject(m.SheetsSelectionsService))],exports.SheetCanvasPopManagerService);function no(n){return Number.parseInt(n.replace("px",""))}var Ag=Object.getOwnPropertyDescriptor,kg=(n,i,e,t)=>{for(var r=t>1?void 0:t?Ag(i,e):i,o=n.length-1,s;o>=0;o--)(s=n[o])&&(r=s(r)||r);return r},Ng=(n,i)=>(e,t)=>i(e,t,n);exports.CellPopupManagerService=class extends a.Disposable{constructor(e){super();E(this,"_cellPopupMap",new Map);E(this,"_change$",new O.Subject);E(this,"change$",this._change$.asObservable());this._sheetCanvasPopManagerService=e}_ensureCellPopupMap(e,t){let r=this._cellPopupMap.get(e);r||(r=new Map,this._cellPopupMap.set(e,r));let o=r.get(t);return o||(o=new a.ObjectMatrix,r.set(t,o)),o}showPopup(e,t){var g,S;const{direction:r="horizontal"}=t,{unitId:o,subUnitId:s,row:l,col:c}=e,d=this._ensureCellPopupMap(o,s),u=(g=d.getValue(l,c))==null?void 0:g[r];t.id=(S=t.id)!=null?S:a.generateRandomId();const h=()=>{const f=d.getValue(l,c);if(!f)return;const p=f[r];if(!p)return;const v=p==null?void 0:p.popups.findIndex(C=>C.id===t.id&&C.componentKey===t.componentKey);p==null||p.popups.splice(v,1),p.popups.length===0&&(p.disposable.dispose(),f[r]=void 0),this._change$.next({...e,direction:r})};if(u)u.popups.push(t),u.popups.sort((f,p)=>f.priority-p.priority);else{const f=this._sheetCanvasPopManagerService.attachPopupToCell(l,c,{...t,direction:r,componentKey:Fl,extraProps:{...e,direction:r},noPushMinimumGap:!0},o,s);d.setValue(l,c,{...d.getValue(l,c),[r]:{disposable:f,popups:[t]}})}return this._change$.next({...e,direction:r}),a.toDisposable(h)}getPopups(e,t,r,o,s){var c,d;return((d=(c=this._ensureCellPopupMap(e,t).getValue(r,o))==null?void 0:c[s])==null?void 0:d.popups)||[]}};exports.CellPopupManagerService=kg([Ng(0,a.Inject(exports.SheetCanvasPopManagerService))],exports.CellPopupManagerService);const Dg=n=>{const{popup:i}=n,e=i.extraProps,{row:t,col:r,direction:o,unitId:s,subUnitId:l}=e,c=_.useDependency(exports.CellPopupManagerService);_.useObservable(H.useMemo(()=>c.change$.pipe(O.filter(h=>h.row===t&&h.col===r&&h.direction===o)),[c,t,r,o]));const d=c.getPopups(s,l,t,r,o),u=_.useDependency(_.ComponentManager);return b.jsx("div",{"data-u-comp":"cell-popup",className:"univer-ml-px univer-flex univer-flex-col",children:d.map(h=>{var S;const g=u.get(h.componentKey);return g?b.jsx(g,{popup:h},(S=h.id)!=null?S:h.componentKey):null})})},Ca=n=>{const{inputId:i,state:e=!1,type:t="range",confirm:r,cancel:o,name:s,formulaOrRefString:l,comment:c="",localSheetId:d=m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,hidden:u=!1,id:h}=n,S=_.useDependency(a.IUniverInstanceService).getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),f=_.useDependency(a.LocaleService),p=_.useDependency(K.IDefinedNamesService),v=_.useDependency(K.IFunctionService),C=_.useDependency(K.LexerTreeBuilder),I=_.useDependency(_.ComponentManager),R=H.useMemo(()=>I.get(Jo),[]),w=H.useMemo(()=>I.get(bi),[]);if(S==null)return;const P=H.useMemo(()=>S.getUnitId(),[]),y=H.useMemo(()=>S.getActiveSheet().getSheetId(),[]),[M,x]=H.useState(s),[A,k]=H.useState(l),[N,D]=H.useState(c),[W,V]=H.useState(d),[U,L]=H.useState(""),[j,B]=H.useState(t),[z,F]=H.useState(!0),Z=[{label:f.t("definedName.scopeWorkbook"),value:m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME}],$=ie=>!K.isReferenceStrings(ie);H.useEffect(()=>{F(!0),x(s),D(c),V(d);let ie=l;l.substring(0,1)===K.operatorToken.EQUALS?B("formula"):$(l)?(B("formula"),ie=K.operatorToken.EQUALS+l):B("range"),k(ie),L("")},[e]),S.getSheetOrders().forEach(ie=>{const oe=S.getSheetBySheetId(ie);Z.push({label:(oe==null?void 0:oe.getName())||"",value:ie})});const Q=ie=>{k(ie)},se=ie=>{k(ie||"")},G=()=>{if(M.length===0){L(f.t("definedName.nameEmpty"));return}if(p.getValueByName(P,M)!=null&&(h==null||h.length===0)){L(f.t("definedName.nameDuplicate"));return}if(!a.Tools.isValidParameter(M)||K.isReferenceStringWithEffectiveColumn(M)||!a.Tools.isStartValidPosition(M)&&!T.hasCJKText(M.substring(0,1))){L(f.t("definedName.nameInvalid"));return}if(S.getSheetOrders().map(ee=>{var me;return((me=S.getSheetBySheetId(ee))==null?void 0:me.getName())||""}).includes(M)){L(f.t("definedName.nameSheetConflict"));return}if(A.length===0){L(f.t("definedName.formulaOrRefStringEmpty"));return}if(!z){L(f.t("definedName.formulaOrRefStringInvalid"));return}if(v.hasExecutor(M.toUpperCase())){L(f.t("definedName.nameConflict"));return}const oe=S.getActiveSheet().getName();r&&r({id:h||"",name:M,formulaOrRefString:C.convertRefersToAbsolute(A,a.AbsoluteRefType.ALL,a.AbsoluteRefType.ALL,oe),comment:N,localSheetId:W})},Y=ie=>{const oe=ie;oe==="formula"?l[0]===K.operatorToken.EQUALS?k(l):k(`${K.operatorToken.EQUALS}`):l[0]===K.operatorToken.EQUALS?k(""):k(l),B(oe)},q=H.useRef(null),[ne,ce]=H.useState(!1);return _.useSidebarClick(ie=>{var ee;((ee=q.current)==null?void 0:ee.isClickOutSide(ie))&&ce(!1)}),b.jsxs("div",{className:X.clsx(`
138
138
  univer-flex univer-flex-col univer-items-center univer-border-0 univer-border-b univer-border-solid
139
139
  univer-border-gray-200 univer-pb-1
140
140
  [&>div]:univer-mt-4 [&>div]:univer-w-full
package/lib/es/index.js CHANGED
@@ -15527,11 +15527,16 @@ fi = Dw([
15527
15527
  ], fi);
15528
15528
  const Ww = (r) => {
15529
15529
  const { popup: e } = r, t = e.extraProps, { row: n, col: i, direction: o, unitId: s, subUnitId: l } = t, a = D(fi);
15530
- ct(_t(() => a.change$.pipe(xo((u) => u.row === n && u.col === i && u.direction === o)), [a, n, i, o]));
15530
+ ct(
15531
+ _t(() => a.change$.pipe(
15532
+ xo((u) => u.row === n && u.col === i && u.direction === o)
15533
+ ), [a, n, i, o])
15534
+ );
15531
15535
  const c = a.getPopups(s, l, n, i, o), d = D(Xt);
15532
- return /* @__PURE__ */ b("div", { className: "univer-cell-popup univer-flex univer-flex-col univer-ml-[1px]", children: c.map((u) => {
15533
- const h = u, g = d.get(h.componentKey);
15534
- return g ? /* @__PURE__ */ b(g, { popup: h }) : null;
15536
+ return /* @__PURE__ */ b("div", { "data-u-comp": "cell-popup", className: "univer-ml-px univer-flex univer-flex-col", children: c.map((u) => {
15537
+ var g;
15538
+ const h = d.get(u.componentKey);
15539
+ return h ? /* @__PURE__ */ b(h, { popup: u }, (g = u.id) != null ? g : u.componentKey) : null;
15535
15540
  }) });
15536
15541
  }, ph = (r) => {
15537
15542
  const {
package/lib/index.css CHANGED
@@ -1 +1 @@
1
- .univer-pointer-events-none{pointer-events:none}.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-inset-0{top:0;right:0;bottom:0;left:0}.-univer-bottom-0\.5{bottom:-2px}.-univer-left-0\.5{left:-2px}.-univer-right-0\.5{right:-2px}.-univer-top-0\.5{top:-2px}.univer-left-0{left:0}.univer-left-1{left:4px}.univer-left-\[100px\]{left:100px}.univer-right-0{right:0}.univer-right-5{right:20px}.univer-right-\[60px\]{right:60px}.univer-top-0{top:0}.univer-top-0\.5{top:2px}.univer-top-5{top:20px}.univer-top-\[200px\]{top:200px}.univer-z-10{z-index:10}.univer-z-\[1001\]{z-index:1001}.univer-z-\[100\]{z-index:100}.univer-m-0{margin:0}.univer-m-\[5px_0\]{margin:5px 0}.univer-mx-1{margin-left:4px;margin-right:4px}.univer-my-1{margin-top:4px;margin-bottom:4px}.univer-my-1\.5{margin-top:6px;margin-bottom:6px}.univer-my-2{margin-top:8px;margin-bottom:8px}.univer-mb-1\.5{margin-bottom:6px}.univer-mb-2{margin-bottom:8px}.univer-mb-3{margin-bottom:12px}.univer-ml-1{margin-left:4px}.univer-ml-1\.5{margin-left:6px}.univer-ml-3{margin-left:12px}.univer-ml-5{margin-left:20px}.univer-ml-\[1px\]{margin-left:1px}.univer-mr-0\.5{margin-right:2px}.univer-mr-1\.5{margin-right:6px}.univer-mr-2{margin-right:8px}.univer-mr-5{margin-right:20px}.univer-mt-1{margin-top:4px}.univer-mt-2{margin-top:8px}.univer-mt-3{margin-top:12px}.univer-mt-4{margin-top:16px}.univer-mt-auto{margin-top:auto}.univer-box-border{box-sizing:border-box}.univer-block{display:block}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-grid{display:grid}.univer-hidden{display:none}.univer-size-0{width:0px;height:0px}.univer-size-10{width:40px;height:40px}.univer-size-4{width:16px;height:16px}.univer-size-6{width:24px;height:24px}.univer-h-0\.5{height:2px}.univer-h-10{height:40px}.univer-h-4{height:16px}.univer-h-5{height:20px}.univer-h-6{height:24px}.univer-h-60{height:240px}.univer-h-7{height:28px}.univer-h-8{height:32px}.univer-h-9{height:36px}.univer-h-\[1px\]{height:1px}.univer-h-\[270px\]{height:270px}.univer-h-\[30px\]{height:30px}.univer-h-\[50px\]{height:50px}.univer-h-\[calc\(100\%-16px\)\]{height:calc(100% - 16px)}.univer-h-\[calc\(100\%-8px\)\]{height:calc(100% - 8px)}.univer-h-full{height:100%}.univer-h-px{height:1px}.univer-max-h-52{max-height:208px}.univer-max-h-\[100px\]{max-height:100px}.univer-max-h-\[360px\]{max-height:360px}.\!univer-w-\[90px\]{width:90px!important}.univer-w-16{width:64px}.univer-w-20{width:80px}.univer-w-24{width:96px}.univer-w-4{width:16px}.univer-w-5{width:20px}.univer-w-6{width:24px}.univer-w-60{width:240px}.univer-w-\[100px\]{width:100px}.univer-w-\[130px\]{width:130px}.univer-w-\[156px\]{width:156px}.univer-w-\[300px\]{width:300px}.univer-w-\[50\%\]{width:50%}.univer-w-\[95\%\]{width:95%}.univer-w-fit{width:-moz-fit-content;width:fit-content}.univer-w-full{width:100%}.univer-min-w-0{min-width:0px}.univer-min-w-12{min-width:48px}.univer-max-w-24{max-width:96px}.univer-max-w-32{max-width:128px}.univer-max-w-64{max-width:256px}.univer-max-w-80{max-width:320px}.univer-max-w-\[120px\]{max-width:120px}.univer-max-w-\[190px\]{max-width:190px}.univer-max-w-\[200px\]{max-width:200px}.univer-max-w-\[calc\(100\%-112px\)\]{max-width:calc(100% - 112px)}.univer-flex-1{flex:1 1 0%}.univer-flex-\[0_1_auto\]{flex:0 1 auto}.univer-flex-shrink-0,.univer-shrink-0{flex-shrink:0}.univer-flex-grow{flex-grow:1}.univer-flex-grow-0{flex-grow:0}.-univer-translate-y-1\/2,.univer-translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),-50%) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.univer-rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(180deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes univer-spin{to{transform:rotate(360deg)}}.univer-animate-spin{animation:univer-spin 1s linear infinite}.univer-cursor-default{cursor:default}.univer-cursor-not-allowed{cursor:not-allowed}.univer-cursor-pointer{cursor:pointer}.univer-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.univer-list-none{list-style-type:none}.univer-appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.univer-grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.univer-flex-row{flex-direction:row}.univer-flex-row-reverse{flex-direction:row-reverse}.univer-flex-col{flex-direction:column}.univer-flex-nowrap{flex-wrap:nowrap}.univer-content-center{align-content:center}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-1{gap:4px}.univer-gap-2{gap:8px}.univer-gap-x-2{-moz-column-gap:8px;column-gap:8px}.univer-justify-self-center{justify-self:center}.univer-overflow-hidden{overflow:hidden}.univer-overflow-y-auto{overflow-y:auto}.univer-overflow-x-scroll{overflow-x:scroll}.univer-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.univer-text-ellipsis{text-overflow:ellipsis}.univer-whitespace-nowrap{white-space:nowrap}.univer-break-words{word-wrap:break-word}.univer-rounded{border-radius:4px}.univer-rounded-\[8px\]{border-radius:8px}.univer-rounded-full{border-radius:9999px}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-rounded-sm{border-radius:2px}.univer-border{border-width:1px}.univer-border-0{border-width:0px}.univer-border-2{border-width:2px}.univer-border-4{border-width:4px}.univer-border-b{border-bottom-width:1px}.univer-border-r{border-right-width:1px}.univer-border-t{border-top-width:1px}.univer-border-solid{border-style:solid}.univer-border-none{border-style:none}.univer-border-gray-100{--tw-border-opacity: 1;border-color:#eeeff1;border-color:rgba(238,239,241,var(--tw-border-opacity, 1))}.univer-border-gray-200{--tw-border-opacity: 1;border-color:#e3e5ea;border-color:rgba(227,229,234,var(--tw-border-opacity, 1))}.univer-border-transparent{border-color:transparent}.univer-border-b-gray-200{--tw-border-opacity: 1;border-bottom-color:#e3e5ea;border-bottom-color:rgba(227,229,234,var(--tw-border-opacity, 1))}.univer-border-r-gray-200{--tw-border-opacity: 1;border-right-color:#e3e5ea;border-right-color:rgba(227,229,234,var(--tw-border-opacity, 1))}.univer-border-t-gray-200{--tw-border-opacity: 1;border-top-color:#e3e5ea;border-top-color:rgba(227,229,234,var(--tw-border-opacity, 1))}.univer-border-t-primary-500{--tw-border-opacity: 1;border-top-color:#466af7;border-top-color:rgba(70,106,247,var(--tw-border-opacity, 1))}.univer-bg-blue-500{--tw-bg-opacity: 1;background-color:#3f83f8;background-color:rgba(63,131,248,var(--tw-bg-opacity, 1))}.univer-bg-gray-100{--tw-bg-opacity: 1;background-color:#eeeff1;background-color:rgba(238,239,241,var(--tw-bg-opacity, 1))}.univer-bg-gray-200{--tw-bg-opacity: 1;background-color:#e3e5ea;background-color:rgba(227,229,234,var(--tw-bg-opacity, 1))}.univer-bg-slate-600{--tw-bg-opacity: 1;background-color:#475569;background-color:rgba(71,85,105,var(--tw-bg-opacity, 1))}.univer-bg-transparent{background-color:transparent}.univer-bg-white{--tw-bg-opacity: 1;background-color:#fff;background-color:rgba(255,255,255,var(--tw-bg-opacity, 1))}.univer-fill-green-500{fill:#0da471}.univer-fill-primary-600{fill:#2c53f1}.univer-p-0{padding:0}.univer-p-1{padding:4px}.univer-p-1\.5{padding:6px}.univer-p-2{padding:8px}.univer-p-3{padding:12px}.univer-p-4{padding:16px}.univer-px-1{padding-left:4px;padding-right:4px}.univer-px-1\.5{padding-left:6px;padding-right:6px}.univer-px-2{padding-left:8px;padding-right:8px}.univer-px-5{padding-left:20px;padding-right:20px}.univer-px-\[14px\]{padding-left:14px;padding-right:14px}.univer-px-\[6px\]{padding-left:6px;padding-right:6px}.univer-py-0{padding-top:0;padding-bottom:0}.univer-py-0\.5{padding-top:2px;padding-bottom:2px}.univer-py-1{padding-top:4px;padding-bottom:4px}.univer-py-1\.5{padding-top:6px;padding-bottom:6px}.univer-py-2{padding-top:8px;padding-bottom:8px}.univer-py-5{padding-top:20px;padding-bottom:20px}.univer-pb-1{padding-bottom:4px}.univer-pl-2{padding-left:8px}.univer-pl-3{padding-left:12px}.univer-pl-6{padding-left:24px}.univer-pt-2{padding-top:8px}.univer-text-center{text-align:center}.univer-text-\[10px\]{font-size:10px}.univer-text-\[13px\]{font-size:13px}.univer-text-base{font-size:16px;line-height:24px}.univer-text-sm{font-size:14px;line-height:20px}.univer-text-xs{font-size:12px;line-height:16px}.univer-font-bold{font-weight:700}.univer-font-medium{font-weight:500}.univer-font-normal{font-weight:400}.univer-font-semibold{font-weight:600}.univer-leading-5{line-height:20px}.univer-leading-6{line-height:24px}.univer-leading-7{line-height:28px}.univer-text-black{--tw-text-opacity: 1;color:#000;color:rgba(0,0,0,var(--tw-text-opacity, 1))}.univer-text-blue-500{--tw-text-opacity: 1;color:#3f83f8;color:rgba(63,131,248,var(--tw-text-opacity, 1))}.univer-text-gray-200{--tw-text-opacity: 1;color:#e3e5ea;color:rgba(227,229,234,var(--tw-text-opacity, 1))}.univer-text-gray-300{--tw-text-opacity: 1;color:#a8b0bd;color:rgba(168,176,189,var(--tw-text-opacity, 1))}.univer-text-gray-400{--tw-text-opacity: 1;color:#7d8698;color:rgba(125,134,152,var(--tw-text-opacity, 1))}.univer-text-gray-500{--tw-text-opacity: 1;color:#4e5565;color:rgba(78,85,101,var(--tw-text-opacity, 1))}.univer-text-gray-600{--tw-text-opacity: 1;color:#31363f;color:rgba(49,54,63,var(--tw-text-opacity, 1))}.univer-text-gray-700{--tw-text-opacity: 1;color:#272a2f;color:rgba(39,42,47,var(--tw-text-opacity, 1))}.univer-text-gray-900{--tw-text-opacity: 1;color:#1b1c1f;color:rgba(27,28,31,var(--tw-text-opacity, 1))}.univer-text-green-600{--tw-text-opacity: 1;color:#057a55;color:rgba(5,122,85,var(--tw-text-opacity, 1))}.univer-text-orange-400{--tw-text-opacity: 1;color:#ff8a4c;color:rgba(255,138,76,var(--tw-text-opacity, 1))}.univer-text-primary-500{--tw-text-opacity: 1;color:#466af7;color:rgba(70,106,247,var(--tw-text-opacity, 1))}.univer-text-primary-600{--tw-text-opacity: 1;color:#2c53f1;color:rgba(44,83,241,var(--tw-text-opacity, 1))}.univer-text-primary-700{--tw-text-opacity: 1;color:#143ee3;color:rgba(20,62,227,var(--tw-text-opacity, 1))}.univer-text-red-400{--tw-text-opacity: 1;color:#f98080;color:rgba(249,128,128,var(--tw-text-opacity, 1))}.univer-text-red-500{--tw-text-opacity: 1;color:#f05252;color:rgba(240,82,82,var(--tw-text-opacity, 1))}.univer-text-red-600{--tw-text-opacity: 1;color:#e02424;color:rgba(224,36,36,var(--tw-text-opacity, 1))}.univer-opacity-100{opacity:1}.univer-shadow{--tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.univer-shadow-lg{--tw-shadow: 0px 4px 6px 0px rgba(30, 40, 77, .05), 0px 10px 15px -3px rgba(30, 40, 77, .1);--tw-shadow-colored: 0px 4px 6px 0px var(--tw-shadow-color), 0px 10px 15px -3px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.univer-shadow-sm{--tw-shadow: 0px 1px 2px 0px rgba(30, 40, 77, .08);--tw-shadow-colored: 0px 1px 2px 0px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 2px #1e284d14;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.univer-outline-none{outline:2px solid transparent;outline-offset:2px}.univer-blur-sm{--tw-blur: blur(4px);filter:blur(4px) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.univer-backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:blur(8px) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:blur(8px) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.univer-transition-\[box-shadow\]{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-transition-\[height\]{transition-property:height;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-duration-150{transition-duration:.15s}.univer-duration-200{transition-duration:.2s}.univer-ease-linear{transition-timing-function:linear}.after\:univer-absolute:after{content:var(--tw-content);position:absolute}.after\:univer-right-0:after{content:var(--tw-content);right:0}.after\:univer-top-1\/2:after{content:var(--tw-content);top:50%}.after\:univer-block:after{content:var(--tw-content);display:block}.after\:univer-h-4:after{content:var(--tw-content);height:16px}.after\:univer-w-px:after{content:var(--tw-content);width:1px}.after\:-univer-translate-y-1\/2:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),-50%) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\:univer-bg-gray-200:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#e3e5ea;background-color:rgba(227,229,234,var(--tw-bg-opacity, 1))}.after\:univer-content-\[\"\"\]:after{--tw-content: "";content:"";content:var(--tw-content)}.last\:univer-mb-0:last-child{margin-bottom:0}.univer-group:hover .group-hover\:univer-block{display:block}.hover\:univer-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:#eeeff1;background-color:rgba(238,239,241,var(--tw-bg-opacity, 1))}.hover\:univer-bg-gray-200:hover{--tw-bg-opacity: 1;background-color:#e3e5ea;background-color:rgba(227,229,234,var(--tw-bg-opacity, 1))}.hover\:univer-bg-gray-50:hover{--tw-bg-opacity: 1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--tw-bg-opacity, 1))}.hover\:univer-bg-neutral-100:hover{--tw-bg-opacity: 1;background-color:#f5f5f5;background-color:rgba(245,245,245,var(--tw-bg-opacity, 1))}.hover\:univer-bg-transparent:hover{background-color:transparent}.focus\:univer-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.dark\:univer-border-gray-700:where(.univer-dark,.univer-dark *){--tw-border-opacity: 1;border-color:#272a2f;border-color:rgba(39,42,47,var(--tw-border-opacity, 1))}.dark\:univer-border-b-gray-700:where(.univer-dark,.univer-dark *){--tw-border-opacity: 1;border-bottom-color:#272a2f;border-bottom-color:rgba(39,42,47,var(--tw-border-opacity, 1))}.dark\:univer-border-r-gray-700:where(.univer-dark,.univer-dark *){--tw-border-opacity: 1;border-right-color:#272a2f;border-right-color:rgba(39,42,47,var(--tw-border-opacity, 1))}.dark\:univer-border-t-gray-700:where(.univer-dark,.univer-dark *){--tw-border-opacity: 1;border-top-color:#272a2f;border-top-color:rgba(39,42,47,var(--tw-border-opacity, 1))}.dark\:univer-bg-black:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#000;background-color:rgba(0,0,0,var(--tw-bg-opacity, 1))}.dark\:univer-bg-gray-700:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#272a2f;background-color:rgba(39,42,47,var(--tw-bg-opacity, 1))}.dark\:univer-bg-gray-900:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#1b1c1f;background-color:rgba(27,28,31,var(--tw-bg-opacity, 1))}.dark\:univer-bg-slate-600:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#475569;background-color:rgba(71,85,105,var(--tw-bg-opacity, 1))}.dark\:univer-text-gray-200:where(.univer-dark,.univer-dark *){--tw-text-opacity: 1;color:#e3e5ea;color:rgba(227,229,234,var(--tw-text-opacity, 1))}.dark\:univer-text-gray-700:where(.univer-dark,.univer-dark *){--tw-text-opacity: 1;color:#272a2f;color:rgba(39,42,47,var(--tw-text-opacity, 1))}.dark\:univer-text-green-400:where(.univer-dark,.univer-dark *){--tw-text-opacity: 1;color:#31c48d;color:rgba(49,196,141,var(--tw-text-opacity, 1))}.dark\:univer-text-red-400:where(.univer-dark,.univer-dark *){--tw-text-opacity: 1;color:#f98080;color:rgba(249,128,128,var(--tw-text-opacity, 1))}.dark\:univer-text-white:where(.univer-dark,.univer-dark *){--tw-text-opacity: 1;color:#fff;color:rgba(255,255,255,var(--tw-text-opacity, 1))}.dark\:hover\:univer-bg-gray-600:hover:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#31363f;background-color:rgba(49,54,63,var(--tw-bg-opacity, 1))}.dark\:hover\:univer-bg-gray-700:hover:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#272a2f;background-color:rgba(39,42,47,var(--tw-bg-opacity, 1))}.dark\:hover\:univer-bg-gray-800:hover:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#1f2124;background-color:rgba(31,33,36,var(--tw-bg-opacity, 1))}.\[\&\>div\]\:univer-mt-4>div{margin-top:16px}.\[\&\>div\]\:univer-w-full>div{width:100%}.\[\&_\*canvas\]\:univer-absolute *canvas{position:absolute}
1
+ .univer-pointer-events-none{pointer-events:none}.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-inset-0{top:0;right:0;bottom:0;left:0}.-univer-bottom-0\.5{bottom:-2px}.-univer-left-0\.5{left:-2px}.-univer-right-0\.5{right:-2px}.-univer-top-0\.5{top:-2px}.univer-left-0{left:0}.univer-left-1{left:4px}.univer-left-\[100px\]{left:100px}.univer-right-0{right:0}.univer-right-5{right:20px}.univer-right-\[60px\]{right:60px}.univer-top-0{top:0}.univer-top-0\.5{top:2px}.univer-top-5{top:20px}.univer-top-\[200px\]{top:200px}.univer-z-10{z-index:10}.univer-z-\[1001\]{z-index:1001}.univer-z-\[100\]{z-index:100}.univer-m-0{margin:0}.univer-m-\[5px_0\]{margin:5px 0}.univer-mx-1{margin-left:4px;margin-right:4px}.univer-my-1{margin-top:4px;margin-bottom:4px}.univer-my-1\.5{margin-top:6px;margin-bottom:6px}.univer-my-2{margin-top:8px;margin-bottom:8px}.univer-mb-1\.5{margin-bottom:6px}.univer-mb-2{margin-bottom:8px}.univer-mb-3{margin-bottom:12px}.univer-ml-1{margin-left:4px}.univer-ml-1\.5{margin-left:6px}.univer-ml-3{margin-left:12px}.univer-ml-5{margin-left:20px}.univer-ml-px{margin-left:1px}.univer-mr-0\.5{margin-right:2px}.univer-mr-1\.5{margin-right:6px}.univer-mr-2{margin-right:8px}.univer-mr-5{margin-right:20px}.univer-mt-1{margin-top:4px}.univer-mt-2{margin-top:8px}.univer-mt-3{margin-top:12px}.univer-mt-4{margin-top:16px}.univer-mt-auto{margin-top:auto}.univer-box-border{box-sizing:border-box}.univer-block{display:block}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-grid{display:grid}.univer-hidden{display:none}.univer-size-0{width:0px;height:0px}.univer-size-10{width:40px;height:40px}.univer-size-4{width:16px;height:16px}.univer-size-6{width:24px;height:24px}.univer-h-0\.5{height:2px}.univer-h-10{height:40px}.univer-h-4{height:16px}.univer-h-5{height:20px}.univer-h-6{height:24px}.univer-h-60{height:240px}.univer-h-7{height:28px}.univer-h-8{height:32px}.univer-h-9{height:36px}.univer-h-\[1px\]{height:1px}.univer-h-\[270px\]{height:270px}.univer-h-\[30px\]{height:30px}.univer-h-\[50px\]{height:50px}.univer-h-\[calc\(100\%-16px\)\]{height:calc(100% - 16px)}.univer-h-\[calc\(100\%-8px\)\]{height:calc(100% - 8px)}.univer-h-full{height:100%}.univer-h-px{height:1px}.univer-max-h-52{max-height:208px}.univer-max-h-\[100px\]{max-height:100px}.univer-max-h-\[360px\]{max-height:360px}.\!univer-w-\[90px\]{width:90px!important}.univer-w-16{width:64px}.univer-w-20{width:80px}.univer-w-24{width:96px}.univer-w-4{width:16px}.univer-w-5{width:20px}.univer-w-6{width:24px}.univer-w-60{width:240px}.univer-w-\[100px\]{width:100px}.univer-w-\[130px\]{width:130px}.univer-w-\[156px\]{width:156px}.univer-w-\[300px\]{width:300px}.univer-w-\[50\%\]{width:50%}.univer-w-\[95\%\]{width:95%}.univer-w-fit{width:-moz-fit-content;width:fit-content}.univer-w-full{width:100%}.univer-min-w-0{min-width:0px}.univer-min-w-12{min-width:48px}.univer-max-w-24{max-width:96px}.univer-max-w-32{max-width:128px}.univer-max-w-64{max-width:256px}.univer-max-w-80{max-width:320px}.univer-max-w-\[120px\]{max-width:120px}.univer-max-w-\[190px\]{max-width:190px}.univer-max-w-\[200px\]{max-width:200px}.univer-max-w-\[calc\(100\%-112px\)\]{max-width:calc(100% - 112px)}.univer-flex-1{flex:1 1 0%}.univer-flex-\[0_1_auto\]{flex:0 1 auto}.univer-flex-shrink-0,.univer-shrink-0{flex-shrink:0}.univer-flex-grow{flex-grow:1}.univer-flex-grow-0{flex-grow:0}.-univer-translate-y-1\/2,.univer-translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),-50%) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.univer-rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(180deg) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes univer-spin{to{transform:rotate(360deg)}}.univer-animate-spin{animation:univer-spin 1s linear infinite}.univer-cursor-default{cursor:default}.univer-cursor-not-allowed{cursor:not-allowed}.univer-cursor-pointer{cursor:pointer}.univer-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.univer-list-none{list-style-type:none}.univer-appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.univer-grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.univer-flex-row{flex-direction:row}.univer-flex-row-reverse{flex-direction:row-reverse}.univer-flex-col{flex-direction:column}.univer-flex-nowrap{flex-wrap:nowrap}.univer-content-center{align-content:center}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-1{gap:4px}.univer-gap-2{gap:8px}.univer-gap-x-2{-moz-column-gap:8px;column-gap:8px}.univer-justify-self-center{justify-self:center}.univer-overflow-hidden{overflow:hidden}.univer-overflow-y-auto{overflow-y:auto}.univer-overflow-x-scroll{overflow-x:scroll}.univer-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.univer-text-ellipsis{text-overflow:ellipsis}.univer-whitespace-nowrap{white-space:nowrap}.univer-break-words{word-wrap:break-word}.univer-rounded{border-radius:4px}.univer-rounded-\[8px\]{border-radius:8px}.univer-rounded-full{border-radius:9999px}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-rounded-sm{border-radius:2px}.univer-border{border-width:1px}.univer-border-0{border-width:0px}.univer-border-2{border-width:2px}.univer-border-4{border-width:4px}.univer-border-b{border-bottom-width:1px}.univer-border-r{border-right-width:1px}.univer-border-t{border-top-width:1px}.univer-border-solid{border-style:solid}.univer-border-none{border-style:none}.univer-border-gray-100{--tw-border-opacity: 1;border-color:#eeeff1;border-color:rgba(238,239,241,var(--tw-border-opacity, 1))}.univer-border-gray-200{--tw-border-opacity: 1;border-color:#e3e5ea;border-color:rgba(227,229,234,var(--tw-border-opacity, 1))}.univer-border-transparent{border-color:transparent}.univer-border-b-gray-200{--tw-border-opacity: 1;border-bottom-color:#e3e5ea;border-bottom-color:rgba(227,229,234,var(--tw-border-opacity, 1))}.univer-border-r-gray-200{--tw-border-opacity: 1;border-right-color:#e3e5ea;border-right-color:rgba(227,229,234,var(--tw-border-opacity, 1))}.univer-border-t-gray-200{--tw-border-opacity: 1;border-top-color:#e3e5ea;border-top-color:rgba(227,229,234,var(--tw-border-opacity, 1))}.univer-border-t-primary-500{--tw-border-opacity: 1;border-top-color:#466af7;border-top-color:rgba(70,106,247,var(--tw-border-opacity, 1))}.univer-bg-blue-500{--tw-bg-opacity: 1;background-color:#3f83f8;background-color:rgba(63,131,248,var(--tw-bg-opacity, 1))}.univer-bg-gray-100{--tw-bg-opacity: 1;background-color:#eeeff1;background-color:rgba(238,239,241,var(--tw-bg-opacity, 1))}.univer-bg-gray-200{--tw-bg-opacity: 1;background-color:#e3e5ea;background-color:rgba(227,229,234,var(--tw-bg-opacity, 1))}.univer-bg-slate-600{--tw-bg-opacity: 1;background-color:#475569;background-color:rgba(71,85,105,var(--tw-bg-opacity, 1))}.univer-bg-transparent{background-color:transparent}.univer-bg-white{--tw-bg-opacity: 1;background-color:#fff;background-color:rgba(255,255,255,var(--tw-bg-opacity, 1))}.univer-fill-green-500{fill:#0da471}.univer-fill-primary-600{fill:#2c53f1}.univer-p-0{padding:0}.univer-p-1{padding:4px}.univer-p-1\.5{padding:6px}.univer-p-2{padding:8px}.univer-p-3{padding:12px}.univer-p-4{padding:16px}.univer-px-1{padding-left:4px;padding-right:4px}.univer-px-1\.5{padding-left:6px;padding-right:6px}.univer-px-2{padding-left:8px;padding-right:8px}.univer-px-5{padding-left:20px;padding-right:20px}.univer-px-\[14px\]{padding-left:14px;padding-right:14px}.univer-px-\[6px\]{padding-left:6px;padding-right:6px}.univer-py-0{padding-top:0;padding-bottom:0}.univer-py-0\.5{padding-top:2px;padding-bottom:2px}.univer-py-1{padding-top:4px;padding-bottom:4px}.univer-py-1\.5{padding-top:6px;padding-bottom:6px}.univer-py-2{padding-top:8px;padding-bottom:8px}.univer-py-5{padding-top:20px;padding-bottom:20px}.univer-pb-1{padding-bottom:4px}.univer-pl-2{padding-left:8px}.univer-pl-3{padding-left:12px}.univer-pl-6{padding-left:24px}.univer-pt-2{padding-top:8px}.univer-text-center{text-align:center}.univer-text-\[10px\]{font-size:10px}.univer-text-\[13px\]{font-size:13px}.univer-text-base{font-size:16px;line-height:24px}.univer-text-sm{font-size:14px;line-height:20px}.univer-text-xs{font-size:12px;line-height:16px}.univer-font-bold{font-weight:700}.univer-font-medium{font-weight:500}.univer-font-normal{font-weight:400}.univer-font-semibold{font-weight:600}.univer-leading-5{line-height:20px}.univer-leading-6{line-height:24px}.univer-leading-7{line-height:28px}.univer-text-black{--tw-text-opacity: 1;color:#000;color:rgba(0,0,0,var(--tw-text-opacity, 1))}.univer-text-blue-500{--tw-text-opacity: 1;color:#3f83f8;color:rgba(63,131,248,var(--tw-text-opacity, 1))}.univer-text-gray-200{--tw-text-opacity: 1;color:#e3e5ea;color:rgba(227,229,234,var(--tw-text-opacity, 1))}.univer-text-gray-300{--tw-text-opacity: 1;color:#a8b0bd;color:rgba(168,176,189,var(--tw-text-opacity, 1))}.univer-text-gray-400{--tw-text-opacity: 1;color:#7d8698;color:rgba(125,134,152,var(--tw-text-opacity, 1))}.univer-text-gray-500{--tw-text-opacity: 1;color:#4e5565;color:rgba(78,85,101,var(--tw-text-opacity, 1))}.univer-text-gray-600{--tw-text-opacity: 1;color:#31363f;color:rgba(49,54,63,var(--tw-text-opacity, 1))}.univer-text-gray-700{--tw-text-opacity: 1;color:#272a2f;color:rgba(39,42,47,var(--tw-text-opacity, 1))}.univer-text-gray-900{--tw-text-opacity: 1;color:#1b1c1f;color:rgba(27,28,31,var(--tw-text-opacity, 1))}.univer-text-green-600{--tw-text-opacity: 1;color:#057a55;color:rgba(5,122,85,var(--tw-text-opacity, 1))}.univer-text-orange-400{--tw-text-opacity: 1;color:#ff8a4c;color:rgba(255,138,76,var(--tw-text-opacity, 1))}.univer-text-primary-500{--tw-text-opacity: 1;color:#466af7;color:rgba(70,106,247,var(--tw-text-opacity, 1))}.univer-text-primary-600{--tw-text-opacity: 1;color:#2c53f1;color:rgba(44,83,241,var(--tw-text-opacity, 1))}.univer-text-primary-700{--tw-text-opacity: 1;color:#143ee3;color:rgba(20,62,227,var(--tw-text-opacity, 1))}.univer-text-red-400{--tw-text-opacity: 1;color:#f98080;color:rgba(249,128,128,var(--tw-text-opacity, 1))}.univer-text-red-500{--tw-text-opacity: 1;color:#f05252;color:rgba(240,82,82,var(--tw-text-opacity, 1))}.univer-text-red-600{--tw-text-opacity: 1;color:#e02424;color:rgba(224,36,36,var(--tw-text-opacity, 1))}.univer-opacity-100{opacity:1}.univer-shadow{--tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.univer-shadow-lg{--tw-shadow: 0px 4px 6px 0px rgba(30, 40, 77, .05), 0px 10px 15px -3px rgba(30, 40, 77, .1);--tw-shadow-colored: 0px 4px 6px 0px var(--tw-shadow-color), 0px 10px 15px -3px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.univer-shadow-sm{--tw-shadow: 0px 1px 2px 0px rgba(30, 40, 77, .08);--tw-shadow-colored: 0px 1px 2px 0px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 2px #1e284d14;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.univer-outline-none{outline:2px solid transparent;outline-offset:2px}.univer-blur-sm{--tw-blur: blur(4px);filter:blur(4px) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.univer-backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:blur(8px) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:blur(8px) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.univer-transition-\[box-shadow\]{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-transition-\[height\]{transition-property:height;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-duration-150{transition-duration:.15s}.univer-duration-200{transition-duration:.2s}.univer-ease-linear{transition-timing-function:linear}.after\:univer-absolute:after{content:var(--tw-content);position:absolute}.after\:univer-right-0:after{content:var(--tw-content);right:0}.after\:univer-top-1\/2:after{content:var(--tw-content);top:50%}.after\:univer-block:after{content:var(--tw-content);display:block}.after\:univer-h-4:after{content:var(--tw-content);height:16px}.after\:univer-w-px:after{content:var(--tw-content);width:1px}.after\:-univer-translate-y-1\/2:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),-50%) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\:univer-bg-gray-200:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:#e3e5ea;background-color:rgba(227,229,234,var(--tw-bg-opacity, 1))}.after\:univer-content-\[\"\"\]:after{--tw-content: "";content:"";content:var(--tw-content)}.last\:univer-mb-0:last-child{margin-bottom:0}.univer-group:hover .group-hover\:univer-block{display:block}.hover\:univer-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:#eeeff1;background-color:rgba(238,239,241,var(--tw-bg-opacity, 1))}.hover\:univer-bg-gray-200:hover{--tw-bg-opacity: 1;background-color:#e3e5ea;background-color:rgba(227,229,234,var(--tw-bg-opacity, 1))}.hover\:univer-bg-gray-50:hover{--tw-bg-opacity: 1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--tw-bg-opacity, 1))}.hover\:univer-bg-neutral-100:hover{--tw-bg-opacity: 1;background-color:#f5f5f5;background-color:rgba(245,245,245,var(--tw-bg-opacity, 1))}.hover\:univer-bg-transparent:hover{background-color:transparent}.focus\:univer-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.dark\:univer-border-gray-700:where(.univer-dark,.univer-dark *){--tw-border-opacity: 1;border-color:#272a2f;border-color:rgba(39,42,47,var(--tw-border-opacity, 1))}.dark\:univer-border-b-gray-700:where(.univer-dark,.univer-dark *){--tw-border-opacity: 1;border-bottom-color:#272a2f;border-bottom-color:rgba(39,42,47,var(--tw-border-opacity, 1))}.dark\:univer-border-r-gray-700:where(.univer-dark,.univer-dark *){--tw-border-opacity: 1;border-right-color:#272a2f;border-right-color:rgba(39,42,47,var(--tw-border-opacity, 1))}.dark\:univer-border-t-gray-700:where(.univer-dark,.univer-dark *){--tw-border-opacity: 1;border-top-color:#272a2f;border-top-color:rgba(39,42,47,var(--tw-border-opacity, 1))}.dark\:univer-bg-black:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#000;background-color:rgba(0,0,0,var(--tw-bg-opacity, 1))}.dark\:univer-bg-gray-700:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#272a2f;background-color:rgba(39,42,47,var(--tw-bg-opacity, 1))}.dark\:univer-bg-gray-900:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#1b1c1f;background-color:rgba(27,28,31,var(--tw-bg-opacity, 1))}.dark\:univer-bg-slate-600:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#475569;background-color:rgba(71,85,105,var(--tw-bg-opacity, 1))}.dark\:univer-text-gray-200:where(.univer-dark,.univer-dark *){--tw-text-opacity: 1;color:#e3e5ea;color:rgba(227,229,234,var(--tw-text-opacity, 1))}.dark\:univer-text-gray-700:where(.univer-dark,.univer-dark *){--tw-text-opacity: 1;color:#272a2f;color:rgba(39,42,47,var(--tw-text-opacity, 1))}.dark\:univer-text-green-400:where(.univer-dark,.univer-dark *){--tw-text-opacity: 1;color:#31c48d;color:rgba(49,196,141,var(--tw-text-opacity, 1))}.dark\:univer-text-red-400:where(.univer-dark,.univer-dark *){--tw-text-opacity: 1;color:#f98080;color:rgba(249,128,128,var(--tw-text-opacity, 1))}.dark\:univer-text-white:where(.univer-dark,.univer-dark *){--tw-text-opacity: 1;color:#fff;color:rgba(255,255,255,var(--tw-text-opacity, 1))}.dark\:hover\:univer-bg-gray-600:hover:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#31363f;background-color:rgba(49,54,63,var(--tw-bg-opacity, 1))}.dark\:hover\:univer-bg-gray-700:hover:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#272a2f;background-color:rgba(39,42,47,var(--tw-bg-opacity, 1))}.dark\:hover\:univer-bg-gray-800:hover:where(.univer-dark,.univer-dark *){--tw-bg-opacity: 1;background-color:#1f2124;background-color:rgba(31,33,36,var(--tw-bg-opacity, 1))}.\[\&\>div\]\:univer-mt-4>div{margin-top:16px}.\[\&\>div\]\:univer-w-full>div{width:100%}.\[\&_\*canvas\]\:univer-absolute *canvas{position:absolute}
package/lib/index.js CHANGED
@@ -15527,11 +15527,16 @@ fi = Dw([
15527
15527
  ], fi);
15528
15528
  const Ww = (r) => {
15529
15529
  const { popup: e } = r, t = e.extraProps, { row: n, col: i, direction: o, unitId: s, subUnitId: l } = t, a = D(fi);
15530
- ct(_t(() => a.change$.pipe(xo((u) => u.row === n && u.col === i && u.direction === o)), [a, n, i, o]));
15530
+ ct(
15531
+ _t(() => a.change$.pipe(
15532
+ xo((u) => u.row === n && u.col === i && u.direction === o)
15533
+ ), [a, n, i, o])
15534
+ );
15531
15535
  const c = a.getPopups(s, l, n, i, o), d = D(Xt);
15532
- return /* @__PURE__ */ b("div", { className: "univer-cell-popup univer-flex univer-flex-col univer-ml-[1px]", children: c.map((u) => {
15533
- const h = u, g = d.get(h.componentKey);
15534
- return g ? /* @__PURE__ */ b(g, { popup: h }) : null;
15536
+ return /* @__PURE__ */ b("div", { "data-u-comp": "cell-popup", className: "univer-ml-px univer-flex univer-flex-col", children: c.map((u) => {
15537
+ var g;
15538
+ const h = d.get(u.componentKey);
15539
+ return h ? /* @__PURE__ */ b(h, { popup: u }, (g = u.id) != null ? g : u.componentKey) : null;
15535
15540
  }) });
15536
15541
  }, ph = (r) => {
15537
15542
  const {
package/lib/umd/index.js CHANGED
@@ -134,7 +134,7 @@
134
134
  univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded
135
135
  univer-border-none univer-bg-transparent univer-p-1
136
136
  hover:univer-bg-gray-100
137
- `,type:"button",children:[b.jsx(Tl,{type:a.BorderStyleTypes.THIN}),b.jsx(sn,{className:"univer-text-gray-400"})]})})})]})]})}const Ml="sheets.component.cell-popup";var Eg=Object.getOwnPropertyDescriptor,Tg=(n,r,e,t)=>{for(var i=t>1?void 0:t?Eg(r,e):r,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i},zt=(n,r)=>(e,t)=>r(e,t,n);y.SheetCanvasPopManagerService=class extends a.Disposable{constructor(e,t,i,o,s,l,c){super();T(this,"_popupMenuFeatureMap",new Map);T(this,"_isSelectionMoving",!1);this._globalPopupManagerService=e,this._renderManagerService=t,this._univerInstanceService=i,this._refRangeService=o,this._commandService=s,this._refSelectionsService=l,this._selectionManagerService=c,this._initMoving()}_initMoving(){this.disposeWithMe(this._refSelectionsService.selectionMoving$.subscribe(()=>{this._isSelectionMoving=!0})),this.disposeWithMe(this._refSelectionsService.selectionMoveEnd$.subscribe(()=>{this._isSelectionMoving=!1})),this.disposeWithMe(this._selectionManagerService.selectionMoving$.subscribe(()=>{this._isSelectionMoving=!0})),this.disposeWithMe(this._selectionManagerService.selectionMoveEnd$.subscribe(()=>{this._isSelectionMoving=!1}))}registerFeatureMenu(e,t){this._popupMenuFeatureMap.set(e,t)}getFeatureMenu(e,t,i,o){const s=this._popupMenuFeatureMap.get(o);if(s)return s(e,t,i,o)}dispose(){super.dispose(),this._popupMenuFeatureMap.clear()}_createHiddenRectObserver(e){const{row:t,column:i,worksheet:o,skeleton:s,currentRender:l}=e,c=()=>{var Y,z;const g=o.getFreeze(),{startRow:S,startColumn:f,xSplit:v,ySplit:p}=g,C=S-p,I=f-v,{rowHeightAccumulation:w,columnWidthAccumulation:E,rowHeaderWidth:O,columnHeaderHeight:M}=s,P=O+(I===-1?0:E[I+v-1]-((Y=E[I-1])!=null?Y:0)),A=M+(C===-1?0:w[C+p-1]-((z=w[C])!=null?z:0)),N=l.engine.getCanvasElement(),D=N.getBoundingClientRect(),V=Qo(N.style.width),H=D.width/V,x=l.scene.getAncestorScale().scaleX,W=P*H*x,L=A*H*x,B={left:-1/0,top:-1/0,right:D.left+W,bottom:D.top+L},X={left:D.left+W,top:-1/0,right:1/0,bottom:D.top+L},F={left:-1/0,top:D.top+L,right:D.left+W,bottom:1/0};return t<S&&i<f?[]:t<S?[B]:i<f?[B]:[B,X,F]},d=c(),u=new k.BehaviorSubject(d),h=new a.DisposableCollection;return h.add(this._commandService.onCommandExecuted(g=>{g.id===m.SetFrozenMutation.id&&u.next(c())})),h.add(a.fromEventSubject(l.engine.onTransformChange$).pipe(k.throttleTime(16)).subscribe(()=>{u.next(c())})),{rects$:u,disposable:h}}_createPositionObserver(e,t,i,o){const s=()=>{const{scene:u}=t,h=lg(e,u,i,o),g=t.engine.getCanvasElement(),S=g.getBoundingClientRect(),f=Qo(g.style.width),v=S.width/f;return{left:h.left*v+S.left,right:h.right*v+S.left,top:h.top*v+S.top,bottom:h.bottom*v+S.top}},l=s(),c=new k.BehaviorSubject(l),d=new a.DisposableCollection;return d.add(this._commandService.onCommandExecuted(u=>{(u.id===xe.id||u.id===De.id)&&c.next(s())})),{position:l,position$:c,disposable:d}}attachPopupToObject(e,t){var w;const i=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),o=i.getActiveSheet();if(!o||this._isSelectionMoving&&!t.showOnSelectionMoving)return{dispose:()=>{},canDispose:()=>!0};const s=i.getUnitId(),l=o.getSheetId(),c=(w=this._renderManagerService.getRenderById(s))==null?void 0:w.with(y.SheetSkeletonManagerService).ensureSkeleton(l),d=this._renderManagerService.getRenderById(s);if(!d||!c)return{dispose:()=>{},canDispose:()=>!0};const{left:u,top:h,width:g,height:S}=e,f={left:u,right:u+g,top:h,bottom:h+S},{position:v,position$:p,disposable:C}=this._createPositionObserver(f,d,c,o),I=this._globalPopupManagerService.addPopup({...t,unitId:s,subUnitId:l,anchorRect:v,anchorRect$:p,canvasElement:d.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(I),p.complete(),C.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==I}}attachPopupByPosition(e,t,i){var C;const o=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),s=o.getActiveSheet();if(!s)return null;const l=o.getUnitId(),c=s.getSheetId();if(l!==i.unitId||i.subUnitId!==c)return null;if(this._isSelectionMoving&&!t.showOnSelectionMoving)return;const d=(C=this._renderManagerService.getRenderById(l))==null?void 0:C.with(y.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:c}),u=this._renderManagerService.getRenderById(l);if(!u||!d)return null;const{position:h,position$:g,disposable:S}=this._createPositionObserver(e,u,d,s),{rects$:f,disposable:v}=this._createHiddenRectObserver({row:i.row,column:i.col,worksheet:s,skeleton:d,currentRender:u}),p=this._globalPopupManagerService.addPopup({...t,unitId:l,subUnitId:c,anchorRect:h,anchorRect$:g,hiddenRects$:f,canvasElement:u.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(p),g.complete(),S.dispose(),v.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==p}}attachPopupToAbsolutePosition(e,t,i,o){var f;const s=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),l=s.getActiveSheet();if(!l)return null;const c=s.getUnitId(),d=l.getSheetId();if(i&&c!==i||o&&o!==d)return null;const u=(f=this._renderManagerService.getRenderById(c))==null?void 0:f.with(y.SheetSkeletonManagerService).ensureSkeleton(d),h=this._renderManagerService.getRenderById(c);if(!h||!u)return null;if(this._isSelectionMoving&&!t.showOnSelectionMoving)return;const g=new k.BehaviorSubject(e),S=this._globalPopupManagerService.addPopup({...t,unitId:c,subUnitId:d,anchorRect:e,anchorRect$:g.asObservable(),canvasElement:h.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(S),g.complete()},canDispose:()=>this._globalPopupManagerService.activePopupId!==S}}attachPopupToCell(e,t,i,o,s,l){const c=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),d=c.getActiveSheet();if(!d)return null;const u=c.getUnitId(),h=d.getSheetId();if(o&&u!==o||s&&h!==s)return null;const g=this._renderManagerService.getRenderById(u),S=g==null?void 0:g.with(y.SheetSkeletonManagerService).ensureSkeleton(h),f=g==null?void 0:g.with(ve);if(!g||!S||!f)return null;if(this._isSelectionMoving&&!i.showOnSelectionMoving)return;const v=l!=null?l:Sl(e,t,g.scene,d);if(!v)return null;const{position:p,position$:C,disposable:I,updateRowCol:w}=this._createCellPositionObserver(e,t,g,S,v),{rects$:E,disposable:O}=this._createHiddenRectObserver({row:e,column:t,worksheet:d,skeleton:S,currentRender:g}),M=this._globalPopupManagerService.addPopup({...i,unitId:u,subUnitId:h,anchorRect:p,anchorRect$:C,canvasElement:g.engine.getCanvasElement(),hiddenRects$:E}),P=new a.DisposableCollection;P.add(I),P.add(a.toDisposable(()=>{this._globalPopupManagerService.removePopup(M),C.complete()})),P.add(O);const A={startRow:e,endRow:e,startColumn:t,endColumn:t};return P.add(this._refRangeService.watchRange(u,h,A,(N,D)=>{D?w(D.startRow,D.startColumn):P.dispose()})),{dispose(){P.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==M}}attachRangePopup(e,t,i,o,s,l=!1){const c=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),d=c.getActiveSheet();if(!d)return null;const u=c.getUnitId(),h=d.getSheetId();if(i&&u!==i||o&&h!==o)return null;const g=this._renderManagerService.getRenderById(u),S=g==null?void 0:g.with(y.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:h}),f=g==null?void 0:g.with(ve);if(!g||!S||!f)return null;if(f.selectionMoving&&!l)return;const v=s!=null?s:Sl(e.startRow,e.startColumn,g.scene,d);if(!v)return null;const{position:p,position$:C,disposable:I,updateRowCol:w,topLeftPos$:E,rightBottomPos$:O}=this._createRangePositionObserver(e,g,S,v),{rects$:M,disposable:P}=this._createHiddenRectObserver({row:e.startRow,column:e.startColumn,worksheet:d,skeleton:S,currentRender:g}),A=this._globalPopupManagerService.addPopup({...t,unitId:u,subUnitId:h,anchorRect:p,anchorRect$:C,canvasElement:g.engine.getCanvasElement(),hiddenRects$:M}),N=new a.DisposableCollection;N.add(I),N.add(a.toDisposable(()=>{this._globalPopupManagerService.removePopup(A),E.complete(),O.complete()})),N.add(P);const D={...e};return N.add(this._refRangeService.watchRange(u,h,D,(V,H)=>{H?w(H.startRow,H.startColumn):N.dispose()})),{dispose(){N.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==A}}_createCellPositionObserver(e,t,i,o,s){let l=e,c=t;const d=this._calcCellPositionByCell(l,c,i,o,s),u=new k.BehaviorSubject(d),h=()=>u.next(this._calcCellPositionByCell(l,c,i,o,s)),g=new a.DisposableCollection;return g.add(i.engine.clientRect$.subscribe(()=>h())),g.add(a.fromEventSubject(i.engine.onTransformChange$).pipe(k.throttleTime(16)).subscribe(()=>h())),g.add(this._commandService.onCommandExecuted(f=>{if(f.id===m.SetWorksheetRowAutoHeightMutation.id&&f.params.rowsAutoHeightInfo.findIndex(p=>p.row===l)>-1){h();return}(m.COMMAND_LISTENER_SKELETON_CHANGE.indexOf(f.id)>-1||f.id===xe.id||f.id===De.id)&&h()})),{position$:u,disposable:g,position:d,updateRowCol:(f,v)=>{l=f,c=v,h()}}}_calcCellPositionByCell(e,t,i,o,s){const{scene:l,engine:c}=i,d=o.getCellWithCoordByIndex(e,t),u=d.isMergedMainCell?d.mergeInfo:d,{scaleX:h,scaleY:g}=l.getAncestorScale(),S={x:s.viewportScrollX,y:s.viewportScrollY},f=c.getCanvasElement(),v=f.getBoundingClientRect(),p=Qo(f.style.width),{top:C,left:I,width:w}=v,E=w/p;return{left:(u.startX-S.x)*E*h+I,right:(u.endX-S.x)*E*h+I,top:(u.startY-S.y)*E*g+C,bottom:(u.endY-S.y)*E*g+C}}_createRangePositionObserver(e,t,i,o){let{startRow:s,startColumn:l}=e;const c=this._calcCellPositionByCell(s,l,t,i,o),d=new k.BehaviorSubject(c),u=this._calcCellPositionByCell(e.endRow,e.endColumn,t,i,o),h=new k.BehaviorSubject(u),g=()=>{const C=this._calcCellPositionByCell(s,l,t,i,o),I=this._calcCellPositionByCell(e.endRow,e.endColumn,t,i,o);d.next(C),h.next(I)},S=new a.DisposableCollection;S.add(t.engine.clientRect$.subscribe(()=>g())),S.add(this._commandService.onCommandExecuted(C=>{if(C.id===m.SetWorksheetRowAutoHeightMutation.id&&C.params.rowsAutoHeightInfo.findIndex(w=>w.row===s)>-1){g();return}(m.COMMAND_LISTENER_SKELETON_CHANGE.indexOf(C.id)>-1||C.id===xe.id||C.id===De.id)&&g()}));const f=(C,I)=>{s=C,l=I,g()},v=d.pipe(k.map(C=>{const I=this._calcCellPositionByCell(e.endRow,e.endColumn,t,i,o);return{top:C.top,left:C.left,right:I.right,bottom:I.bottom}})),p={top:c.top,left:c.left,right:u.right,bottom:u.bottom};return{position$:v,position:p,updateRowCol:f,topLeftPos$:d,rightBottomPos$:h,disposable:S}}},y.SheetCanvasPopManagerService=Tg([zt(0,a.Inject(_.ICanvasPopupService)),zt(1,R.IRenderManagerService),zt(2,a.IUniverInstanceService),zt(3,a.Inject(m.RefRangeService)),zt(4,a.ICommandService),zt(5,m.IRefSelectionsService),zt(6,a.Inject(m.SheetsSelectionsService))],y.SheetCanvasPopManagerService);function Qo(n){return Number.parseInt(n.replace("px",""))}var yg=Object.getOwnPropertyDescriptor,Rg=(n,r,e,t)=>{for(var i=t>1?void 0:t?yg(r,e):r,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i},Mg=(n,r)=>(e,t)=>r(e,t,n);y.CellPopupManagerService=class extends a.Disposable{constructor(e){super();T(this,"_cellPopupMap",new Map);T(this,"_change$",new k.Subject);T(this,"change$",this._change$.asObservable());this._sheetCanvasPopManagerService=e}_ensureCellPopupMap(e,t){let i=this._cellPopupMap.get(e);i||(i=new Map,this._cellPopupMap.set(e,i));let o=i.get(t);return o||(o=new a.ObjectMatrix,i.set(t,o)),o}showPopup(e,t){var g,S;const{direction:i="horizontal"}=t,{unitId:o,subUnitId:s,row:l,col:c}=e,d=this._ensureCellPopupMap(o,s),u=(g=d.getValue(l,c))==null?void 0:g[i];t.id=(S=t.id)!=null?S:a.generateRandomId();const h=()=>{const f=d.getValue(l,c);if(!f)return;const v=f[i];if(!v)return;const p=v==null?void 0:v.popups.findIndex(C=>C.id===t.id&&C.componentKey===t.componentKey);v==null||v.popups.splice(p,1),v.popups.length===0&&(v.disposable.dispose(),f[i]=void 0),this._change$.next({...e,direction:i})};if(u)u.popups.push(t),u.popups.sort((f,v)=>f.priority-v.priority);else{const f=this._sheetCanvasPopManagerService.attachPopupToCell(l,c,{...t,direction:i,componentKey:Ml,extraProps:{...e,direction:i},noPushMinimumGap:!0},o,s);d.setValue(l,c,{...d.getValue(l,c),[i]:{disposable:f,popups:[t]}})}return this._change$.next({...e,direction:i}),a.toDisposable(h)}getPopups(e,t,i,o,s){var c,d;return((d=(c=this._ensureCellPopupMap(e,t).getValue(i,o))==null?void 0:c[s])==null?void 0:d.popups)||[]}},y.CellPopupManagerService=Rg([Mg(0,a.Inject(y.SheetCanvasPopManagerService))],y.CellPopupManagerService);const Pg=n=>{const{popup:r}=n,e=r.extraProps,{row:t,col:i,direction:o,unitId:s,subUnitId:l}=e,c=_.useDependency(y.CellPopupManagerService);_.useObservable(U.useMemo(()=>c.change$.pipe(k.filter(h=>h.row===t&&h.col===i&&h.direction===o)),[c,t,i,o]));const d=c.getPopups(s,l,t,i,o),u=_.useDependency(_.ComponentManager);return b.jsx("div",{className:"univer-cell-popup univer-flex univer-flex-col univer-ml-[1px]",children:d.map(h=>{const g=h,S=u.get(g.componentKey);return S?b.jsx(S,{popup:g}):null})})},Pl=n=>{const{inputId:r,state:e=!1,type:t="range",confirm:i,cancel:o,name:s,formulaOrRefString:l,comment:c="",localSheetId:d=m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,hidden:u=!1,id:h}=n,S=_.useDependency(a.IUniverInstanceService).getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),f=_.useDependency(a.LocaleService),v=_.useDependency(q.IDefinedNamesService),p=_.useDependency(q.IFunctionService),C=_.useDependency(q.LexerTreeBuilder),I=_.useDependency(_.ComponentManager),w=U.useMemo(()=>I.get(xr),[]),E=U.useMemo(()=>I.get(Ni),[]);if(S==null)return;const O=U.useMemo(()=>S.getUnitId(),[]),M=U.useMemo(()=>S.getActiveSheet().getSheetId(),[]),[P,A]=U.useState(s),[N,D]=U.useState(l),[V,H]=U.useState(c),[x,W]=U.useState(d),[L,B]=U.useState(""),[X,F]=U.useState(t),[Y,z]=U.useState(!0),K=[{label:f.t("definedName.scopeWorkbook"),value:m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME}],ee=oe=>!q.isReferenceStrings(oe);U.useEffect(()=>{z(!0),A(s),H(c),W(d);let oe=l;l.substring(0,1)===q.operatorToken.EQUALS?F("formula"):ee(l)?(F("formula"),oe=q.operatorToken.EQUALS+l):F("range"),D(oe),B("")},[e]),S.getSheetOrders().forEach(oe=>{const se=S.getSheetBySheetId(oe);K.push({label:(se==null?void 0:se.getName())||"",value:oe})});const $=oe=>{D(oe)},ae=oe=>{D(oe||"")},Z=()=>{if(P.length===0){B(f.t("definedName.nameEmpty"));return}if(v.getValueByName(O,P)!=null&&(h==null||h.length===0)){B(f.t("definedName.nameDuplicate"));return}if(!a.Tools.isValidParameter(P)||q.isReferenceStringWithEffectiveColumn(P)||!a.Tools.isStartValidPosition(P)&&!R.hasCJKText(P.substring(0,1))){B(f.t("definedName.nameInvalid"));return}if(S.getSheetOrders().map(ne=>{var fe;return((fe=S.getSheetBySheetId(ne))==null?void 0:fe.getName())||""}).includes(P)){B(f.t("definedName.nameSheetConflict"));return}if(N.length===0){B(f.t("definedName.formulaOrRefStringEmpty"));return}if(!Y){B(f.t("definedName.formulaOrRefStringInvalid"));return}if(p.hasExecutor(P.toUpperCase())){B(f.t("definedName.nameConflict"));return}const se=S.getActiveSheet().getName();i&&i({id:h||"",name:P,formulaOrRefString:C.convertRefersToAbsolute(N,a.AbsoluteRefType.ALL,a.AbsoluteRefType.ALL,se),comment:V,localSheetId:x})},G=oe=>{const se=oe;se==="formula"?l[0]===q.operatorToken.EQUALS?D(l):D(`${q.operatorToken.EQUALS}`):l[0]===q.operatorToken.EQUALS?D(""):D(l),F(se)},J=U.useRef(null),[re,de]=U.useState(!1);return _.useSidebarClick(oe=>{var ne;((ne=J.current)==null?void 0:ne.isClickOutSide(oe))&&de(!1)}),b.jsxs("div",{className:j.clsx(`
137
+ `,type:"button",children:[b.jsx(Tl,{type:a.BorderStyleTypes.THIN}),b.jsx(sn,{className:"univer-text-gray-400"})]})})})]})]})}const Ml="sheets.component.cell-popup";var Eg=Object.getOwnPropertyDescriptor,Tg=(n,r,e,t)=>{for(var i=t>1?void 0:t?Eg(r,e):r,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i},zt=(n,r)=>(e,t)=>r(e,t,n);y.SheetCanvasPopManagerService=class extends a.Disposable{constructor(e,t,i,o,s,l,c){super();T(this,"_popupMenuFeatureMap",new Map);T(this,"_isSelectionMoving",!1);this._globalPopupManagerService=e,this._renderManagerService=t,this._univerInstanceService=i,this._refRangeService=o,this._commandService=s,this._refSelectionsService=l,this._selectionManagerService=c,this._initMoving()}_initMoving(){this.disposeWithMe(this._refSelectionsService.selectionMoving$.subscribe(()=>{this._isSelectionMoving=!0})),this.disposeWithMe(this._refSelectionsService.selectionMoveEnd$.subscribe(()=>{this._isSelectionMoving=!1})),this.disposeWithMe(this._selectionManagerService.selectionMoving$.subscribe(()=>{this._isSelectionMoving=!0})),this.disposeWithMe(this._selectionManagerService.selectionMoveEnd$.subscribe(()=>{this._isSelectionMoving=!1}))}registerFeatureMenu(e,t){this._popupMenuFeatureMap.set(e,t)}getFeatureMenu(e,t,i,o){const s=this._popupMenuFeatureMap.get(o);if(s)return s(e,t,i,o)}dispose(){super.dispose(),this._popupMenuFeatureMap.clear()}_createHiddenRectObserver(e){const{row:t,column:i,worksheet:o,skeleton:s,currentRender:l}=e,c=()=>{var Y,z;const g=o.getFreeze(),{startRow:S,startColumn:f,xSplit:v,ySplit:p}=g,C=S-p,I=f-v,{rowHeightAccumulation:w,columnWidthAccumulation:E,rowHeaderWidth:O,columnHeaderHeight:M}=s,P=O+(I===-1?0:E[I+v-1]-((Y=E[I-1])!=null?Y:0)),A=M+(C===-1?0:w[C+p-1]-((z=w[C])!=null?z:0)),N=l.engine.getCanvasElement(),D=N.getBoundingClientRect(),V=Qo(N.style.width),H=D.width/V,x=l.scene.getAncestorScale().scaleX,W=P*H*x,L=A*H*x,B={left:-1/0,top:-1/0,right:D.left+W,bottom:D.top+L},X={left:D.left+W,top:-1/0,right:1/0,bottom:D.top+L},F={left:-1/0,top:D.top+L,right:D.left+W,bottom:1/0};return t<S&&i<f?[]:t<S?[B]:i<f?[B]:[B,X,F]},d=c(),u=new k.BehaviorSubject(d),h=new a.DisposableCollection;return h.add(this._commandService.onCommandExecuted(g=>{g.id===m.SetFrozenMutation.id&&u.next(c())})),h.add(a.fromEventSubject(l.engine.onTransformChange$).pipe(k.throttleTime(16)).subscribe(()=>{u.next(c())})),{rects$:u,disposable:h}}_createPositionObserver(e,t,i,o){const s=()=>{const{scene:u}=t,h=lg(e,u,i,o),g=t.engine.getCanvasElement(),S=g.getBoundingClientRect(),f=Qo(g.style.width),v=S.width/f;return{left:h.left*v+S.left,right:h.right*v+S.left,top:h.top*v+S.top,bottom:h.bottom*v+S.top}},l=s(),c=new k.BehaviorSubject(l),d=new a.DisposableCollection;return d.add(this._commandService.onCommandExecuted(u=>{(u.id===xe.id||u.id===De.id)&&c.next(s())})),{position:l,position$:c,disposable:d}}attachPopupToObject(e,t){var w;const i=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),o=i.getActiveSheet();if(!o||this._isSelectionMoving&&!t.showOnSelectionMoving)return{dispose:()=>{},canDispose:()=>!0};const s=i.getUnitId(),l=o.getSheetId(),c=(w=this._renderManagerService.getRenderById(s))==null?void 0:w.with(y.SheetSkeletonManagerService).ensureSkeleton(l),d=this._renderManagerService.getRenderById(s);if(!d||!c)return{dispose:()=>{},canDispose:()=>!0};const{left:u,top:h,width:g,height:S}=e,f={left:u,right:u+g,top:h,bottom:h+S},{position:v,position$:p,disposable:C}=this._createPositionObserver(f,d,c,o),I=this._globalPopupManagerService.addPopup({...t,unitId:s,subUnitId:l,anchorRect:v,anchorRect$:p,canvasElement:d.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(I),p.complete(),C.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==I}}attachPopupByPosition(e,t,i){var C;const o=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),s=o.getActiveSheet();if(!s)return null;const l=o.getUnitId(),c=s.getSheetId();if(l!==i.unitId||i.subUnitId!==c)return null;if(this._isSelectionMoving&&!t.showOnSelectionMoving)return;const d=(C=this._renderManagerService.getRenderById(l))==null?void 0:C.with(y.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:c}),u=this._renderManagerService.getRenderById(l);if(!u||!d)return null;const{position:h,position$:g,disposable:S}=this._createPositionObserver(e,u,d,s),{rects$:f,disposable:v}=this._createHiddenRectObserver({row:i.row,column:i.col,worksheet:s,skeleton:d,currentRender:u}),p=this._globalPopupManagerService.addPopup({...t,unitId:l,subUnitId:c,anchorRect:h,anchorRect$:g,hiddenRects$:f,canvasElement:u.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(p),g.complete(),S.dispose(),v.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==p}}attachPopupToAbsolutePosition(e,t,i,o){var f;const s=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),l=s.getActiveSheet();if(!l)return null;const c=s.getUnitId(),d=l.getSheetId();if(i&&c!==i||o&&o!==d)return null;const u=(f=this._renderManagerService.getRenderById(c))==null?void 0:f.with(y.SheetSkeletonManagerService).ensureSkeleton(d),h=this._renderManagerService.getRenderById(c);if(!h||!u)return null;if(this._isSelectionMoving&&!t.showOnSelectionMoving)return;const g=new k.BehaviorSubject(e),S=this._globalPopupManagerService.addPopup({...t,unitId:c,subUnitId:d,anchorRect:e,anchorRect$:g.asObservable(),canvasElement:h.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(S),g.complete()},canDispose:()=>this._globalPopupManagerService.activePopupId!==S}}attachPopupToCell(e,t,i,o,s,l){const c=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),d=c.getActiveSheet();if(!d)return null;const u=c.getUnitId(),h=d.getSheetId();if(o&&u!==o||s&&h!==s)return null;const g=this._renderManagerService.getRenderById(u),S=g==null?void 0:g.with(y.SheetSkeletonManagerService).ensureSkeleton(h),f=g==null?void 0:g.with(ve);if(!g||!S||!f)return null;if(this._isSelectionMoving&&!i.showOnSelectionMoving)return;const v=l!=null?l:Sl(e,t,g.scene,d);if(!v)return null;const{position:p,position$:C,disposable:I,updateRowCol:w}=this._createCellPositionObserver(e,t,g,S,v),{rects$:E,disposable:O}=this._createHiddenRectObserver({row:e,column:t,worksheet:d,skeleton:S,currentRender:g}),M=this._globalPopupManagerService.addPopup({...i,unitId:u,subUnitId:h,anchorRect:p,anchorRect$:C,canvasElement:g.engine.getCanvasElement(),hiddenRects$:E}),P=new a.DisposableCollection;P.add(I),P.add(a.toDisposable(()=>{this._globalPopupManagerService.removePopup(M),C.complete()})),P.add(O);const A={startRow:e,endRow:e,startColumn:t,endColumn:t};return P.add(this._refRangeService.watchRange(u,h,A,(N,D)=>{D?w(D.startRow,D.startColumn):P.dispose()})),{dispose(){P.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==M}}attachRangePopup(e,t,i,o,s,l=!1){const c=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),d=c.getActiveSheet();if(!d)return null;const u=c.getUnitId(),h=d.getSheetId();if(i&&u!==i||o&&h!==o)return null;const g=this._renderManagerService.getRenderById(u),S=g==null?void 0:g.with(y.SheetSkeletonManagerService).getOrCreateSkeleton({sheetId:h}),f=g==null?void 0:g.with(ve);if(!g||!S||!f)return null;if(f.selectionMoving&&!l)return;const v=s!=null?s:Sl(e.startRow,e.startColumn,g.scene,d);if(!v)return null;const{position:p,position$:C,disposable:I,updateRowCol:w,topLeftPos$:E,rightBottomPos$:O}=this._createRangePositionObserver(e,g,S,v),{rects$:M,disposable:P}=this._createHiddenRectObserver({row:e.startRow,column:e.startColumn,worksheet:d,skeleton:S,currentRender:g}),A=this._globalPopupManagerService.addPopup({...t,unitId:u,subUnitId:h,anchorRect:p,anchorRect$:C,canvasElement:g.engine.getCanvasElement(),hiddenRects$:M}),N=new a.DisposableCollection;N.add(I),N.add(a.toDisposable(()=>{this._globalPopupManagerService.removePopup(A),E.complete(),O.complete()})),N.add(P);const D={...e};return N.add(this._refRangeService.watchRange(u,h,D,(V,H)=>{H?w(H.startRow,H.startColumn):N.dispose()})),{dispose(){N.dispose()},canDispose:()=>this._globalPopupManagerService.activePopupId!==A}}_createCellPositionObserver(e,t,i,o,s){let l=e,c=t;const d=this._calcCellPositionByCell(l,c,i,o,s),u=new k.BehaviorSubject(d),h=()=>u.next(this._calcCellPositionByCell(l,c,i,o,s)),g=new a.DisposableCollection;return g.add(i.engine.clientRect$.subscribe(()=>h())),g.add(a.fromEventSubject(i.engine.onTransformChange$).pipe(k.throttleTime(16)).subscribe(()=>h())),g.add(this._commandService.onCommandExecuted(f=>{if(f.id===m.SetWorksheetRowAutoHeightMutation.id&&f.params.rowsAutoHeightInfo.findIndex(p=>p.row===l)>-1){h();return}(m.COMMAND_LISTENER_SKELETON_CHANGE.indexOf(f.id)>-1||f.id===xe.id||f.id===De.id)&&h()})),{position$:u,disposable:g,position:d,updateRowCol:(f,v)=>{l=f,c=v,h()}}}_calcCellPositionByCell(e,t,i,o,s){const{scene:l,engine:c}=i,d=o.getCellWithCoordByIndex(e,t),u=d.isMergedMainCell?d.mergeInfo:d,{scaleX:h,scaleY:g}=l.getAncestorScale(),S={x:s.viewportScrollX,y:s.viewportScrollY},f=c.getCanvasElement(),v=f.getBoundingClientRect(),p=Qo(f.style.width),{top:C,left:I,width:w}=v,E=w/p;return{left:(u.startX-S.x)*E*h+I,right:(u.endX-S.x)*E*h+I,top:(u.startY-S.y)*E*g+C,bottom:(u.endY-S.y)*E*g+C}}_createRangePositionObserver(e,t,i,o){let{startRow:s,startColumn:l}=e;const c=this._calcCellPositionByCell(s,l,t,i,o),d=new k.BehaviorSubject(c),u=this._calcCellPositionByCell(e.endRow,e.endColumn,t,i,o),h=new k.BehaviorSubject(u),g=()=>{const C=this._calcCellPositionByCell(s,l,t,i,o),I=this._calcCellPositionByCell(e.endRow,e.endColumn,t,i,o);d.next(C),h.next(I)},S=new a.DisposableCollection;S.add(t.engine.clientRect$.subscribe(()=>g())),S.add(this._commandService.onCommandExecuted(C=>{if(C.id===m.SetWorksheetRowAutoHeightMutation.id&&C.params.rowsAutoHeightInfo.findIndex(w=>w.row===s)>-1){g();return}(m.COMMAND_LISTENER_SKELETON_CHANGE.indexOf(C.id)>-1||C.id===xe.id||C.id===De.id)&&g()}));const f=(C,I)=>{s=C,l=I,g()},v=d.pipe(k.map(C=>{const I=this._calcCellPositionByCell(e.endRow,e.endColumn,t,i,o);return{top:C.top,left:C.left,right:I.right,bottom:I.bottom}})),p={top:c.top,left:c.left,right:u.right,bottom:u.bottom};return{position$:v,position:p,updateRowCol:f,topLeftPos$:d,rightBottomPos$:h,disposable:S}}},y.SheetCanvasPopManagerService=Tg([zt(0,a.Inject(_.ICanvasPopupService)),zt(1,R.IRenderManagerService),zt(2,a.IUniverInstanceService),zt(3,a.Inject(m.RefRangeService)),zt(4,a.ICommandService),zt(5,m.IRefSelectionsService),zt(6,a.Inject(m.SheetsSelectionsService))],y.SheetCanvasPopManagerService);function Qo(n){return Number.parseInt(n.replace("px",""))}var yg=Object.getOwnPropertyDescriptor,Rg=(n,r,e,t)=>{for(var i=t>1?void 0:t?yg(r,e):r,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i},Mg=(n,r)=>(e,t)=>r(e,t,n);y.CellPopupManagerService=class extends a.Disposable{constructor(e){super();T(this,"_cellPopupMap",new Map);T(this,"_change$",new k.Subject);T(this,"change$",this._change$.asObservable());this._sheetCanvasPopManagerService=e}_ensureCellPopupMap(e,t){let i=this._cellPopupMap.get(e);i||(i=new Map,this._cellPopupMap.set(e,i));let o=i.get(t);return o||(o=new a.ObjectMatrix,i.set(t,o)),o}showPopup(e,t){var g,S;const{direction:i="horizontal"}=t,{unitId:o,subUnitId:s,row:l,col:c}=e,d=this._ensureCellPopupMap(o,s),u=(g=d.getValue(l,c))==null?void 0:g[i];t.id=(S=t.id)!=null?S:a.generateRandomId();const h=()=>{const f=d.getValue(l,c);if(!f)return;const v=f[i];if(!v)return;const p=v==null?void 0:v.popups.findIndex(C=>C.id===t.id&&C.componentKey===t.componentKey);v==null||v.popups.splice(p,1),v.popups.length===0&&(v.disposable.dispose(),f[i]=void 0),this._change$.next({...e,direction:i})};if(u)u.popups.push(t),u.popups.sort((f,v)=>f.priority-v.priority);else{const f=this._sheetCanvasPopManagerService.attachPopupToCell(l,c,{...t,direction:i,componentKey:Ml,extraProps:{...e,direction:i},noPushMinimumGap:!0},o,s);d.setValue(l,c,{...d.getValue(l,c),[i]:{disposable:f,popups:[t]}})}return this._change$.next({...e,direction:i}),a.toDisposable(h)}getPopups(e,t,i,o,s){var c,d;return((d=(c=this._ensureCellPopupMap(e,t).getValue(i,o))==null?void 0:c[s])==null?void 0:d.popups)||[]}},y.CellPopupManagerService=Rg([Mg(0,a.Inject(y.SheetCanvasPopManagerService))],y.CellPopupManagerService);const Pg=n=>{const{popup:r}=n,e=r.extraProps,{row:t,col:i,direction:o,unitId:s,subUnitId:l}=e,c=_.useDependency(y.CellPopupManagerService);_.useObservable(U.useMemo(()=>c.change$.pipe(k.filter(h=>h.row===t&&h.col===i&&h.direction===o)),[c,t,i,o]));const d=c.getPopups(s,l,t,i,o),u=_.useDependency(_.ComponentManager);return b.jsx("div",{"data-u-comp":"cell-popup",className:"univer-ml-px univer-flex univer-flex-col",children:d.map(h=>{var S;const g=u.get(h.componentKey);return g?b.jsx(g,{popup:h},(S=h.id)!=null?S:h.componentKey):null})})},Pl=n=>{const{inputId:r,state:e=!1,type:t="range",confirm:i,cancel:o,name:s,formulaOrRefString:l,comment:c="",localSheetId:d=m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME,hidden:u=!1,id:h}=n,S=_.useDependency(a.IUniverInstanceService).getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),f=_.useDependency(a.LocaleService),v=_.useDependency(q.IDefinedNamesService),p=_.useDependency(q.IFunctionService),C=_.useDependency(q.LexerTreeBuilder),I=_.useDependency(_.ComponentManager),w=U.useMemo(()=>I.get(xr),[]),E=U.useMemo(()=>I.get(Ni),[]);if(S==null)return;const O=U.useMemo(()=>S.getUnitId(),[]),M=U.useMemo(()=>S.getActiveSheet().getSheetId(),[]),[P,A]=U.useState(s),[N,D]=U.useState(l),[V,H]=U.useState(c),[x,W]=U.useState(d),[L,B]=U.useState(""),[X,F]=U.useState(t),[Y,z]=U.useState(!0),K=[{label:f.t("definedName.scopeWorkbook"),value:m.SCOPE_WORKBOOK_VALUE_DEFINED_NAME}],ee=oe=>!q.isReferenceStrings(oe);U.useEffect(()=>{z(!0),A(s),H(c),W(d);let oe=l;l.substring(0,1)===q.operatorToken.EQUALS?F("formula"):ee(l)?(F("formula"),oe=q.operatorToken.EQUALS+l):F("range"),D(oe),B("")},[e]),S.getSheetOrders().forEach(oe=>{const se=S.getSheetBySheetId(oe);K.push({label:(se==null?void 0:se.getName())||"",value:oe})});const $=oe=>{D(oe)},ae=oe=>{D(oe||"")},Z=()=>{if(P.length===0){B(f.t("definedName.nameEmpty"));return}if(v.getValueByName(O,P)!=null&&(h==null||h.length===0)){B(f.t("definedName.nameDuplicate"));return}if(!a.Tools.isValidParameter(P)||q.isReferenceStringWithEffectiveColumn(P)||!a.Tools.isStartValidPosition(P)&&!R.hasCJKText(P.substring(0,1))){B(f.t("definedName.nameInvalid"));return}if(S.getSheetOrders().map(ne=>{var fe;return((fe=S.getSheetBySheetId(ne))==null?void 0:fe.getName())||""}).includes(P)){B(f.t("definedName.nameSheetConflict"));return}if(N.length===0){B(f.t("definedName.formulaOrRefStringEmpty"));return}if(!Y){B(f.t("definedName.formulaOrRefStringInvalid"));return}if(p.hasExecutor(P.toUpperCase())){B(f.t("definedName.nameConflict"));return}const se=S.getActiveSheet().getName();i&&i({id:h||"",name:P,formulaOrRefString:C.convertRefersToAbsolute(N,a.AbsoluteRefType.ALL,a.AbsoluteRefType.ALL,se),comment:V,localSheetId:x})},G=oe=>{const se=oe;se==="formula"?l[0]===q.operatorToken.EQUALS?D(l):D(`${q.operatorToken.EQUALS}`):l[0]===q.operatorToken.EQUALS?D(""):D(l),F(se)},J=U.useRef(null),[re,de]=U.useState(!1);return _.useSidebarClick(oe=>{var ne;((ne=J.current)==null?void 0:ne.isClickOutSide(oe))&&de(!1)}),b.jsxs("div",{className:j.clsx(`
138
138
  univer-flex univer-flex-col univer-items-center univer-border-0 univer-border-b univer-border-solid
139
139
  univer-border-gray-200 univer-pb-1
140
140
  [&>div]:univer-mt-4 [&>div]:univer-w-full
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-ui",
3
- "version": "0.7.0-nightly.202505031606",
3
+ "version": "0.7.0-nightly.202505051607",
4
4
  "private": false,
5
5
  "description": "UniverSheet normal ui-plugin-sheets",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -66,16 +66,16 @@
66
66
  "dependencies": {
67
67
  "@univerjs/icons": "^0.3.24",
68
68
  "@univerjs/protocol": "0.1.45",
69
- "@univerjs/core": "0.7.0-nightly.202505031606",
70
- "@univerjs/docs-ui": "0.7.0-nightly.202505031606",
71
- "@univerjs/docs": "0.7.0-nightly.202505031606",
72
- "@univerjs/design": "0.7.0-nightly.202505031606",
73
- "@univerjs/engine-formula": "0.7.0-nightly.202505031606",
74
- "@univerjs/engine-numfmt": "0.7.0-nightly.202505031606",
75
- "@univerjs/engine-render": "0.7.0-nightly.202505031606",
76
- "@univerjs/ui": "0.7.0-nightly.202505031606",
77
- "@univerjs/telemetry": "0.7.0-nightly.202505031606",
78
- "@univerjs/sheets": "0.7.0-nightly.202505031606"
69
+ "@univerjs/core": "0.7.0-nightly.202505051607",
70
+ "@univerjs/design": "0.7.0-nightly.202505051607",
71
+ "@univerjs/docs-ui": "0.7.0-nightly.202505051607",
72
+ "@univerjs/docs": "0.7.0-nightly.202505051607",
73
+ "@univerjs/engine-formula": "0.7.0-nightly.202505051607",
74
+ "@univerjs/engine-numfmt": "0.7.0-nightly.202505051607",
75
+ "@univerjs/sheets": "0.7.0-nightly.202505051607",
76
+ "@univerjs/telemetry": "0.7.0-nightly.202505051607",
77
+ "@univerjs/ui": "0.7.0-nightly.202505051607",
78
+ "@univerjs/engine-render": "0.7.0-nightly.202505051607"
79
79
  },
80
80
  "devDependencies": {
81
81
  "less": "^4.3.0",