@univerjs/sheets-ui 0.7.0-nightly.202505061607 → 0.7.0-nightly.202505081607
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 +27 -23
- package/lib/es/index.js +50 -51
- package/lib/index.css +1 -1
- package/lib/index.js +50 -51
- package/lib/umd/index.js +27 -23
- package/package.json +12 -12
package/lib/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
univer-flex univer-items-center univer-gap-2 univer-rounded univer-border univer-border-solid
|
|
3
3
|
univer-border-gray-200 univer-p-1
|
|
4
4
|
hover:univer-bg-gray-100
|
|
5
|
-
`,{"univer-bg-gray-100":l,"univer-bg-white":!l}),children:[b.jsx(Fa,{className:"univer-fill-
|
|
5
|
+
`,{"univer-bg-gray-100":l,"univer-bg-white":!l}),children:[b.jsx(Fa,{className:"univer-fill-primary-600 univer-text-gray-900"}),B&&b.jsx(gn,{})]})})})})};function hs(n,i){const e=_.useDependency(he),t=_.useDependency(a.ICommandService);return H.useMemo(()=>({keyCodes:[{keyCode:_.KeyCode.ENTER},{keyCode:_.KeyCode.ESC},{keyCode:_.KeyCode.TAB}],handler:o=>{(o===_.KeyCode.ENTER||o===_.KeyCode.ESC||o===_.KeyCode.TAB)&&(e.disableForceKeepVisible(),t.executeCommand(Se.id,{visible:!1,eventType:T.DeviceInputEventType.Keyboard,keycode:o,unitId:i}))}}),[t,e,i])}const Zr=-1e3,zs={width:0,height:0,top:Zr,left:Zr},Lu=()=>{const[n,i]=H.useState({...zs}),e=_.useDependency(ar),t=_.useDependency(J.IEditorService),r=_.useDependency(a.IContextService),o=_.useDependency(_.ComponentManager),s=_.useDependency(he),l=_.useObservable(s.visible$),c=_.useDependency(a.ICommandService),d=H.useRef(0),u=_.useObservable(()=>r.subscribeContextValue$(_.DISABLE_AUTO_FOCUS_KEY),!1,void 0,[r,_.DISABLE_AUTO_FOCUS_KEY]),h=o.get(bi),g=s.getEditLocation();H.useEffect(()=>{const v=e.state$.subscribe(C=>{if(C==null)return;const{startX:I=Zr,startY:R=Zr,endX:w=0,endY:P=0,show:y=!1}=C;if(!y)i({...zs});else{i({width:w-I,height:P-R,left:I,top:R});const M=t.getEditor(a.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);if(M==null)return;const{left:x,top:A,width:k,height:N}=M.getBoundingClientRect();e.setRect({left:x,top:A,width:k,height:N})}});return()=>{v.unsubscribe()}},[]),H.useEffect(()=>{u||e.setFocus(!0)},[u,n]);const S=_.useEvent(()=>{s.isVisible().visible&&c.executeCommand(Se.id,{visible:!1,eventType:T.DeviceInputEventType.PointerUp,unitId:g==null?void 0:g.unitId})});_.useSidebarClick(S);const f=hs(d,g==null?void 0:g.unitId),p=_.useEvent((v,C)=>{c.executeCommand(Vt.id,{keycode:v,visible:!1,eventType:T.DeviceInputEventType.Keyboard,isShift:C===_.MetaKeys.SHIFT||C===(_.MetaKeys.CTRL_COMMAND|_.MetaKeys.SHIFT),unitId:g==null?void 0:g.unitId})});return b.jsx("div",{className:`
|
|
6
6
|
univer-absolute univer-left-[100px] univer-top-[200px] univer-z-10 univer-flex univer-h-[50px]
|
|
7
7
|
univer-w-[100px] univer-border univer-border-solid univer-border-gray-100
|
|
8
8
|
dark:univer-bg-gray-700
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded
|
|
129
129
|
univer-border-none univer-bg-transparent univer-p-1
|
|
130
130
|
hover:univer-bg-gray-100
|
|
131
|
-
`,type:"button",children:[b.jsx(Ka,{className:"univer-fill-primary-600",extend:{colorChannel1:(l=r==null?void 0:r.color)!=null?l:""}}),b.jsx(gn,{
|
|
131
|
+
`,type:"button",children:[b.jsx(Ka,{className:"univer-fill-primary-600",extend:{colorChannel1:(l=r==null?void 0:r.color)!=null?l:""}}),b.jsx(gn,{})]})})}),b.jsx("div",{children:b.jsx(X.Dropdown,{overlay:b.jsx("section",{className:"univer-rounded-lg univer-p-1.5",children:b.jsx("ul",{className:"univer-m-0 univer-grid univer-list-none univer-gap-1 univer-p-0",children:Og.map(c=>b.jsx("li",{className:`
|
|
132
132
|
univer-flex univer-cursor-pointer univer-items-center
|
|
133
133
|
univer-justify-center univer-rounded univer-px-1 univer-py-2
|
|
134
134
|
hover:univer-bg-gray-100
|
|
@@ -136,16 +136,21 @@
|
|
|
136
136
|
univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded
|
|
137
137
|
univer-border-none univer-bg-transparent univer-p-1
|
|
138
138
|
hover:univer-bg-gray-100
|
|
139
|
-
`,type:"button",children:[b.jsx(pa,{type:a.BorderStyleTypes.THIN}),b.jsx(gn,{className:"univer-text-gray-400"})]})})})]})]})}const jl="sheets.component.cell-popup";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},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=fg(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:ga(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:ga(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=kg([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 Ng=Object.getOwnPropertyDescriptor,Dg=(n,i,e,t)=>{for(var r=t>1?void 0:t?Ng(i,e):i,o=n.length-1,s;o>=0;o--)(s=n[o])&&(r=s(r)||r);return r},Vg=(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:jl,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=Dg([Vg(0,a.Inject(exports.SheetCanvasPopManagerService))],exports.CellPopupManagerService);const Hg=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})})},va=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(Qo),[]),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(`
|
|
139
|
+
`,type:"button",children:[b.jsx(pa,{type:a.BorderStyleTypes.THIN}),b.jsx(gn,{})]})})})]})]})}const jl="sheets.component.cell-popup";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},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=fg(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:ga(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:ga(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=kg([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 Ng=Object.getOwnPropertyDescriptor,Dg=(n,i,e,t)=>{for(var r=t>1?void 0:t?Ng(i,e):i,o=n.length-1,s;o>=0;o--)(s=n[o])&&(r=s(r)||r);return r},Vg=(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:jl,extraProps:{...e,direction:r},noPushMinimumGap:!0,autoRelayout:!1},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=Dg([Vg(0,a.Inject(exports.SheetCanvasPopManagerService))],exports.CellPopupManagerService);const Hg=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})})},va=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(Qo),[]),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(`
|
|
140
140
|
univer-flex univer-flex-col univer-items-center univer-border-0 univer-border-b univer-border-solid
|
|
141
141
|
univer-border-gray-200 univer-pb-1
|
|
142
142
|
[&>div]:univer-mt-4 [&>div]:univer-w-full
|
|
143
143
|
`,{"univer-hidden":!e}),children:[b.jsx("div",{children:b.jsx(X.Input,{className:"univer-w-full",placeholder:f.t("definedName.inputNamePlaceholder"),value:M,allowClear:!0,onChange:x})}),b.jsx("div",{children:b.jsxs(X.RadioGroup,{value:j,onChange:Y,children:[b.jsx(X.Radio,{value:"range",children:f.t("definedName.ratioRange")}),b.jsx(X.Radio,{value:"formula",children:f.t("definedName.ratioFormula")})]})}),j==="range"?R&&b.jsx(R,{unitId:P,subUnitId:y,initialValue:A,onChange:(ie,oe)=>Q(oe),supportAcrossSheet:!0}):w&&b.jsx("div",{className:`
|
|
144
|
-
univer-relative univer-mt-4 univer-h-full univer-rounded univer-
|
|
145
|
-
univer-
|
|
144
|
+
univer-relative univer-mt-4 univer-h-full univer-rounded univer-px-1.5 univer-transition-all
|
|
145
|
+
univer-duration-150
|
|
146
146
|
`,children:b.jsx("div",{className:"univer-relative univer-h-8 univer-select-none",children:b.jsx(w,{ref:q,className:`
|
|
147
|
-
univer-h-full
|
|
148
|
-
|
|
147
|
+
univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center
|
|
148
|
+
univer-rounded-lg univer-border univer-border-solid univer-border-gray-200
|
|
149
|
+
univer-bg-white univer-pt-2 univer-transition-colors
|
|
150
|
+
[&>div:first-child]:univer-px-2.5
|
|
151
|
+
[&>div]:univer-h-5 [&>div]:univer-ring-transparent
|
|
152
|
+
dark:univer-border-gray-600 dark:univer-bg-gray-700 dark:univer-text-white
|
|
153
|
+
hover:univer-border-primary-600
|
|
149
154
|
`,initValue:A,unitId:P,subUnitId:y,isFocus:ne,isSupportAcrossSheet:!0,onChange:(ie="")=>{se(ie||"")},onVerify:ie=>{F(ie)},onFocus:()=>ce(!0)})})}),b.jsx("div",{children:b.jsx(X.Select,{className:"univer-w-full",value:W,options:Z,onChange:V})}),b.jsx("div",{children:b.jsx(X.Input,{className:"univer-w-full",placeholder:f.t("definedName.inputCommentPlaceholder"),value:N,onChange:D})}),b.jsxs("div",{className:X.clsx("univer-items-center univer-text-[13px] univer-text-red-500",{"univer-hidden":U.length===0,"univer-flex":U.length!==0}),children:[b.jsx("span",{className:"univer-mr-0.5",children:U}),b.jsx(ls,{})]}),b.jsxs("div",{children:[b.jsx(X.Button,{onClick:()=>{o==null||o()},children:f.t("definedName.cancel")}),b.jsx(X.Button,{style:{marginLeft:15},variant:"primary",onClick:G,children:f.t("definedName.confirm")})]})]})},zl=()=>{const n=_.useDependency(a.ICommandService),e=_.useDependency(a.IUniverInstanceService).getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),t=_.useDependency(a.LocaleService),r=_.useDependency(K.IDefinedNamesService),o=_.useDependency(m.SheetsSelectionsService);if(e==null)return;const s=e.getUnitId(),l=()=>{const N=r.getDefinedNameMap(s);return N?Array.from(Object.values(N)):[]},[c,d]=H.useState(!1),[u,h]=H.useState(l()),[g,S]=H.useState(null),[f,p]=H.useState();H.useEffect(()=>{const N=r.update$.subscribe(()=>{h(l())});return()=>{N.unsubscribe()}},[]);const v=N=>{const{name:D,formulaOrRefString:W,comment:V,localSheetId:U,hidden:L}=N;let j=N.id;if(j==null||j.length===0)j=a.Tools.generateRandomId(10),n.executeCommand(m.InsertDefinedNameCommand.id,{id:j,unitId:s,name:D,formulaOrRefString:W,comment:V,localSheetId:U,hidden:L});else{const B={id:j,unitId:s,name:D,formulaOrRefString:W,comment:V,localSheetId:U,hidden:L};n.executeCommand(m.SetDefinedNameCommand.id,B)}d(!1),S(null)},C=N=>{p(N)};function I(){p(null)}function R(N){const D=r.getValueById(s,N);n.executeCommand(m.RemoveDefinedNameCommand.id,{...D,unitId:s}),p(null)}const w=async N=>{const{formulaOrRefString:D,id:W}=N,V=r.getWorksheetByRef(s,D);if(!V)return;V.isSheetHidden()&&await n.executeCommand(m.SetWorksheetShowCommand.id,{unitId:s,subUnitId:V.getSheetId()}),r.focusRange(s,W)},P=()=>{const N=u.length+1,D=t.t("definedName.defaultName")+N;if(r.getValueByName(s,D)==null)return D;let W=N+1;for(;;){const V=t.t("definedName.defaultName")+W;if(r.getValueByName(s,V)==null)return V;W++}},y=()=>{var V;const N=(V=e.getActiveSheet())==null?void 0:V.getName();if(!N)return"";const D=o.getCurrentSelections();return D==null?"":D.map(U=>K.serializeRangeWithSheet(N,U.range)).join(",")},M=()=>{d(!1),S(null)},x=()=>{d(!0),S(null)},A=N=>{d(!1),S(N)},k=N=>{const D=e.getSheetBySheetId(N);return D==null?"":D.getName()};return b.jsx("div",{className:"univer-relative univer-w-full",children:b.jsxs("div",{className:"univer-absolute univer-w-full univer-overflow-hidden univer-overflow-y-auto",children:[b.jsxs("div",{children:[b.jsxs("div",{onClick:x,className:X.clsx(`
|
|
150
155
|
univer-flex univer-h-10 univer-w-full univer-items-center univer-justify-center
|
|
151
156
|
univer-border-0 univer-border-b univer-border-t univer-border-solid univer-border-gray-200
|
|
@@ -182,25 +187,24 @@
|
|
|
182
187
|
univer-mb-1.5 univer-flex univer-h-5 univer-flex-row univer-items-center univer-text-sm
|
|
183
188
|
univer-font-medium
|
|
184
189
|
`,children:[e?o[e]:null,t]}),b.jsx("div",{className:"univer-text-sm",children:r})]})}const Oc="univer.sheet.cell-alert";var OS=Object.getOwnPropertyDescriptor,AS=(n,i,e,t)=>{for(var r=t>1?void 0:t?OS(i,e):i,o=n.length-1,s;o>=0;o--)(s=n[o])&&(r=s(r)||r);return r},kS=(n,i)=>(e,t)=>i(e,t,n);let ni=class extends a.Disposable{constructor(n,i){super(),this._context=n,this._componentManager=i,this._initComponent()}_initComponent(){this._componentManager.register(Oc,xS)}};ni=AS([kS(1,a.Inject(_.ComponentManager))],ni);const Ra=2,NS=[{value:"DEFAULT_PASTE",label:"rightClick.paste"},{value:"SPECIAL_PASTE_VALUE",label:"rightClick.pasteValue"},{value:"SPECIAL_PASTE_FORMAT",label:"rightClick.pasteFormat"},{value:"SPECIAL_PASTE_COL_WIDTH",label:"rightClick.pasteColWidth"},{value:"SPECIAL_PASTE_BESIDES_BORDER",label:"rightClick.pasteBesidesBorder"},{value:"SPECIAL_PASTE_FORMULA",label:"formula.operation.pasteFormula"}],DS=n=>{var N,D,W,V,U;const i=_.useDependency(a.IUniverInstanceService),e=_.useDependency(T.IRenderManagerService),t=St();if(!n||!t)return null;const r={startRow:n.rows[0],startCol:n.cols[0],endRow:n.rows[n.rows.length-1],endCol:n.cols[n.cols.length-1]};if(r.endRow<0||r.endCol<0)return null;const o=e.getRenderById(t.getUnitId()),s=o==null?void 0:o.with(exports.SheetSkeletonManagerService),l=o==null?void 0:o.with(pe),c=De(i,e);if(!c||!l)return null;const{scene:d}=c,u=s==null?void 0:s.getCurrentSkeleton(),h=l.getViewPort(),g=d==null?void 0:d.scaleX,S=d==null?void 0:d.scaleY,f=d==null?void 0:d.getViewportScrollXY(h),p=(N=d.getEngine())==null?void 0:N.getCanvas();if(!g||!d||!g||!S||!f)return null;const v=u==null?void 0:u.getNoMergeCellPositionByIndex(r.endRow,r.endCol),C=(D=v==null?void 0:v.endX)!=null?D:0,I=(W=v==null?void 0:v.endY)!=null?W:0,R=(V=T.convertTransformToOffsetX(C,g,f))!=null?V:-9999,w=(U=T.convertTransformToOffsetY(I,S,f))!=null?U:-9999,P=p==null?void 0:p.getWidth(),y=p==null?void 0:p.getHeight();if(!P||!y)return null;const M=R+50<=P,x=w+50<=y;let A=R,k=w;return M||(A=P-100),x||(k=y-100),{positionX:A,positionY:k}},VS=()=>{const n=_.useDependency(Ve),i=_.useObservable(n.showMenu$,!1),e=_.useObservable(n.pasteOptionsCache$,null),t=_.useDependency(a.LocaleService),r=_.useDependency(a.ICommandService),[o,s]=H.useState(!1),[l,c]=H.useState(!1),d=e==null?void 0:e.target.pastedRange,u=DS(d);if(!u||!i||u.positionX<50||u.positionY<30)return null;const h=o||l,g=S=>{c(!1),r.executeCommand(Rl.id,{type:S})};return b.jsx("div",{className:`
|
|
185
|
-
univer-absolute univer-
|
|
186
|
-
univer-border univer-border-solid univer-border-gray-200
|
|
190
|
+
univer-absolute univer-z-[1080] univer-flex univer-cursor-pointer univer-items-center
|
|
191
|
+
univer-justify-center univer-gap-2 univer-rounded univer-border univer-border-solid univer-border-gray-200
|
|
192
|
+
univer-bg-white univer-p-1
|
|
187
193
|
dark:univer-border-gray-700
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
dark:univer-text-white
|
|
199
|
-
`,children:t.t(S.label)})]},S.value)})})}),open:l,onOpenChange:c,children:b.jsxs("div",{className:`
|
|
194
|
+
hover:univer-bg-gray-100
|
|
195
|
+
`,style:{left:u.positionX+Ra,top:u.positionY+Ra},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:b.jsx(X.Dropdown,{align:"start",overlay:b.jsx("ul",{className:"univer-m-0 univer-list-none univer-p-1.5",children:NS.map(S=>{const f=ge[S.value],p=(e==null?void 0:e.pasteType)===f;return b.jsxs("li",{className:`
|
|
196
|
+
univer-cursor-pointer univer-rounded univer-px-2 univer-py-1.5
|
|
197
|
+
univer-transition-colors
|
|
198
|
+
dark:univer-border-gray-700
|
|
199
|
+
hover:univer-bg-gray-100
|
|
200
|
+
`,onClick:()=>g(S.value),children:[b.jsx("span",{children:p&&b.jsx(pt,{className:"univer-absolute",style:{color:"rgb(var(--green-700, #409f11))"}})}),b.jsx("div",{className:`
|
|
201
|
+
univer-ml-5 univer-text-sm univer-text-gray-700
|
|
202
|
+
dark:univer-text-white
|
|
203
|
+
`,children:t.t(S.label)})]},S.value)})}),open:l,onOpenChange:c,children:b.jsxs("div",{className:`
|
|
200
204
|
univer-flex univer-cursor-pointer univer-content-center univer-items-center univer-rounded
|
|
201
|
-
univer-
|
|
205
|
+
univer-py-1
|
|
202
206
|
dark:univer-border-gray-700
|
|
203
|
-
`,onClick:()=>{c(!l)},children:[b.jsx(qa,{
|
|
207
|
+
`,onClick:()=>{c(!l)},children:[b.jsx(qa,{className:"univer-fill-primary-600 univer-text-gray-900"}),h&&b.jsx(gn,{})]})})})},HS=[Se.id,m.SetRangeValuesCommand.id,Ne.id,m.MoveRangeMutation.id,m.RemoveRowMutation.id,m.RemoveColMutation.id,m.InsertRowMutation.id,m.InsertColMutation.id,m.MoveRowsMutation.id,m.MoveColsMutation.id,m.SetWorksheetColWidthMutation.id,m.SetWorksheetRowHeightMutation.id,m.SetSelectionsOperation.id,a.UndoCommandId];function WS(n,i,e,t,r){const o=[],s=[];if(t.copyType===tt.CUT){const{undos:l,redos:c}=US(n,i,r);o.push(...c),s.push(...l)}else{const{undos:l,redos:c}=Nc(i,e,r);o.push(...c),s.push(...l);const{undos:d,redos:u}=LS(i,e,r);o.push(...u),s.push(...d);const{undos:h,redos:g}=Ac(i,n,e,r);o.push(...g),s.push(...h);const{undos:S,redos:f}=kc(i,n,e,r,!0);o.push(...f),s.push(...S);const{undos:p,redos:v}=Lo(i,e,r);o.push(...v),s.push(...p)}return{undos:s,redos:o}}function US(n,i,e){let t=[],r=[];const{range:o,subUnitId:s,unitId:l}=n,{range:c,subUnitId:d}=i,u=c?gt(c):null,h=o?gt(o):null;if(h&&u){const g=e.get(a.IUniverInstanceService),S=e.get(m.SheetInterceptorService),f=g.getUniverSheetInstance(l),p=f==null?void 0:f.getSheetBySheetId(s),v=f==null?void 0:f.getSheetBySheetId(d);if(p&&v){const C=new a.ObjectMatrix,I=new a.ObjectMatrix,R=p.getCellMatrix(),w=v.getCellMatrix();a.Range.foreach(h,(B,z)=>{C.setValue(B,z,a.Tools.deepClone(R.getValue(B,z))),I.setValue(B,z,null)});const P=new a.ObjectMatrix;a.Range.foreach(u,(B,z)=>{P.setValue(B,z,a.Tools.deepClone(w.getValue(B,z)))});const y=new a.ObjectMatrix;a.Range.foreach(h,(B,z)=>{const F=a.cellToRange(B,z),Z=a.Rectangle.getRelativeRange(F,h),$=a.Rectangle.getPositionRange(Z,u);y.setValue($.startRow,$.startColumn,R.getValue(B,z))});const M={fromRange:h,toRange:u,from:{value:I.getMatrix(),subUnitId:s},to:{value:y.getMatrix(),subUnitId:d},unitId:l},x={fromRange:u,toRange:h,from:{value:C.getMatrix(),subUnitId:s},to:{value:P.getMatrix(),subUnitId:d},unitId:l},A=S.onCommandExecute({id:m.MoveRangeCommand.id,params:{toRange:u,fromRange:h}}),k=p.getMergeData(),N=v.getMergeData(),D=k.filter(B=>a.Rectangle.intersects(B,h)),W=N.filter(B=>a.Rectangle.intersects(B,u)),V=D.map(B=>a.Rectangle.getRelativeRange(B,h)).map(B=>a.Rectangle.getPositionRange(B,u)),U=m.getAddMergeMutationRangeByType(V),L=[{id:m.RemoveWorksheetMergeMutation.id,params:{unitId:l,subUnitId:s,ranges:D}},{id:m.RemoveWorksheetMergeMutation.id,params:{unitId:l,subUnitId:s,ranges:W}},{id:m.AddWorksheetMergeMutation.id,params:{unitId:l,subUnitId:d,ranges:U}}],j=[{id:m.RemoveWorksheetMergeMutation.id,params:{unitId:l,subUnitId:d,ranges:U}},{id:m.AddWorksheetMergeMutation.id,params:{unitId:l,subUnitId:d,ranges:W}},{id:m.AddWorksheetMergeMutation.id,params:{unitId:l,subUnitId:s,ranges:D}}];t=[{id:m.MoveRangeMutation.id,params:M},...A.redos,...L,{id:m.SetSelectionsOperation.id,params:{unitId:l,subUnitId:d,selections:[{range:u}],type:m.SelectionMoveType.MOVE_END}}],r=[{id:m.MoveRangeMutation.id,params:x},...A.undos,...j,{id:m.SetSelectionsOperation.id,params:{unitId:l,subUnitId:s,type:m.SelectionMoveType.MOVE_END,selections:[{range:h}]}}]}}return{undos:r,redos:t}}function Ac(n,i,e,t){var f;const{unitId:r,subUnitId:o,range:s}=n,l=(f=t.get(a.IUniverInstanceService).getUniverSheetInstance(r))==null?void 0:f.getSheetBySheetId(o),c=[],d=[],{mapFunc:u}=Ut([s]),h=new a.ObjectMatrix;e.forValue((p,v,C)=>{var P,y;const{row:I,col:R}=u(p,v),w={v:C.v,t:C.t};if(!C.p&&C.v&&!i){const M=l==null?void 0:l.getCellStyle(I,R);if(Ci.isTextFormat((P=M==null?void 0:M.n)==null?void 0:P.pattern))w.t=a.CellValueType.STRING;else{const x=String(C.v),A=a.numfmt.parseValue(x);(A==null?void 0:A.v)!==void 0&&typeof A.v=="number"&&(w.v=A.v)}}if((y=C.p)!=null&&y.body&&Do(C.p.body)){const M=a.Tools.deepClone({p:C.p,v:C.v});h.setValue(I,R,M)}else h.setValue(I,R,a.Tools.deepClone(w))});const g={unitId:r,subUnitId:o,cellValue:a.Tools.deepClone(h.getMatrix())};c.push({id:m.SetRangeValuesMutation.id,params:g});const S=m.SetRangeValuesUndoMutationFactory(t,g);return d.push({id:m.SetRangeValuesMutation.id,params:S}),{undos:d,redos:c}}function kc(n,i,e,t,r=!1){var p;const o=[],s=[],{unitId:l,subUnitId:c,range:d}=n,u=(p=t.get(a.IUniverInstanceService).getUniverSheetInstance(l))==null?void 0:p.getSheetBySheetId(c),h=new a.ObjectMatrix,{mapFunc:g}=Ut([d]);e.forValue((v,C,I)=>{var x,A;const R={s:Object.assign({},{...a.DEFAULT_STYLES,pd:T.DEFAULT_PADDING_DATA,bg:null,cl:null},I.s)},w=R.s.bd;w&&(Object.keys(w).length>0||(R.s.bd={b:null,l:null,r:null,t:null}));const{row:P,col:y}=g(v,C),M=u==null?void 0:u.getCellStyle(P,y);if(I.v&&!i&&Ci.isTextFormat((x=M==null?void 0:M.n)==null?void 0:x.pattern))R.s||(R.s={}),R.s.n=M==null?void 0:M.n;else{const k=String(I.v),N=a.numfmt.parseValue(k);N!=null&&N.z&&(R.s||(R.s={}),typeof R.s=="object"&&((A=R.s)!=null&&A.n?R.s.n.pattern=N.z:R.s.n={pattern:N.z}))}h.setValue(P,y,R)});const S={unitId:l,subUnitId:c,cellValue:a.Tools.deepClone(h.getMatrix())};o.push({id:m.SetRangeValuesMutation.id,params:S});const f=m.SetRangeValuesUndoMutationFactory(t,S);return s.push({id:m.SetRangeValuesMutation.id,params:f}),{undos:s,redos:o}}function Nc(n,i,e){const t=[],r=[],o=new a.ObjectMatrix,{unitId:s,subUnitId:l,range:c}=n,{mapFunc:d}=Ut([c]);if(i.forEach((u,h)=>{Object.keys(h).forEach(g=>{const S=Number(g),{row:f,col:p}=d(u,S);o.setValue(f,p,{s:null})})}),o.getLength()>0){const u={subUnitId:l,unitId:s,cellValue:a.Tools.deepClone(o.getMatrix())};t.push({id:m.SetRangeValuesMutation.id,params:u});const h=m.SetRangeValuesUndoMutationFactory(e,u);r.push({id:m.SetRangeValuesMutation.id,params:h})}return{undos:r,redos:t}}function LS(n,i,e){const t=[],r=[],o=new a.ObjectMatrix,{unitId:s,subUnitId:l,range:c}=n,{mapFunc:d}=Ut([c]);if(i.forValue((u,h,g)=>{const{row:S,col:f}=d(u,h);o.setValue(S,f,{v:null,p:null})}),o.getLength()>0){const u={subUnitId:l,unitId:s,cellValue:a.Tools.deepClone(o.getMatrix())};t.push({id:m.SetRangeValuesMutation.id,params:u});const h=m.SetRangeValuesUndoMutationFactory(e,u);r.push({id:m.SetRangeValuesMutation.id,params:h})}return{undos:r,redos:t}}function Lo(n,i,e){const t=[],r=[],{unitId:o,subUnitId:s,range:l}=n,{startColumn:c,startRow:d,endColumn:u,endRow:h}=gt(l),g=[];i.forValue((I,R,w)=>{if(w.rowSpan&&w.rowSpan>1){const P=w.colSpan||1,y={startRow:d+I,endRow:d+I+w.rowSpan-1,startColumn:c+R,endColumn:c+R+P-1};g.push(y)}else if(w.colSpan&&w.colSpan>1){const P=w.rowSpan||1,y={startRow:d+I,endRow:d+I+P-1,startColumn:c+R,endColumn:c+R+w.colSpan-1};g.push(y)}});const f=e.get(a.IUniverInstanceService).getUniverSheetInstance(o),p=f==null?void 0:f.getSheetBySheetId(s);if(f&&p){const R=p.getMergeData().filter(y=>a.Rectangle.intersects({startRow:d,startColumn:c,endRow:h,endColumn:u},y)),w={unitId:o,subUnitId:s,ranges:R};t.push({id:m.RemoveWorksheetMergeMutation.id,params:w});const P=m.RemoveMergeUndoMutationFactory(e,w);r.push({id:m.AddWorksheetMergeMutation.id,params:P})}const v={unitId:o,subUnitId:s,ranges:g};g.length>0&&t.push({id:m.AddWorksheetMergeMutation.id,params:v});const C=m.AddMergeUndoMutationFactory(e,v);return g.length>0&&r.push({id:m.RemoveWorksheetMergeMutation.id,params:C}),{undos:r,redos:t}}function BS(n){if(!n.includes("\r")&&a.Tools.isLegalUrl(n)){const t=a.generateRandomId(),r=`${n}`,o={startIndex:0,endIndex:r.length-1,rangeId:t,rangeType:a.CustomRangeType.HYPERLINK,properties:{url:n}};return{dataStream:`${r}\r
|
|
204
208
|
`,paragraphs:[{startIndex:r.length}],customRanges:[o]}}let i=n.replace(/(\r\n|\n)/g,"\r");i.endsWith(`\r
|
|
205
209
|
`)||(i+=`\r
|
|
206
210
|
`);const e=[];for(let t=0;t<i.length;t++)i[t]==="\r"&&e.push({startIndex:t});return{dataStream:i,paragraphs:e,sectionBreaks:[{startIndex:i.indexOf(`
|
package/lib/es/index.js
CHANGED
|
@@ -5794,8 +5794,8 @@ const V1 = () => {
|
|
|
5794
5794
|
"univer-bg-white": !l
|
|
5795
5795
|
}),
|
|
5796
5796
|
children: [
|
|
5797
|
-
/* @__PURE__ */ b(mf, { className: "univer-fill-
|
|
5798
|
-
B && /* @__PURE__ */ b(ai, {
|
|
5797
|
+
/* @__PURE__ */ b(mf, { className: "univer-fill-primary-600 univer-text-gray-900" }),
|
|
5798
|
+
B && /* @__PURE__ */ b(ai, {})
|
|
5799
5799
|
]
|
|
5800
5800
|
}
|
|
5801
5801
|
)
|
|
@@ -14991,7 +14991,7 @@ function dm(r) {
|
|
|
14991
14991
|
type: "button",
|
|
14992
14992
|
children: [
|
|
14993
14993
|
/* @__PURE__ */ b(wf, { className: "univer-fill-primary-600", extend: { colorChannel1: (l = i == null ? void 0 : i.color) != null ? l : "" } }),
|
|
14994
|
-
/* @__PURE__ */ b(ai, {
|
|
14994
|
+
/* @__PURE__ */ b(ai, {})
|
|
14995
14995
|
]
|
|
14996
14996
|
}
|
|
14997
14997
|
)
|
|
@@ -15024,7 +15024,7 @@ function dm(r) {
|
|
|
15024
15024
|
type: "button",
|
|
15025
15025
|
children: [
|
|
15026
15026
|
/* @__PURE__ */ b(mh, { type: ke.THIN }),
|
|
15027
|
-
/* @__PURE__ */ b(ai, {
|
|
15027
|
+
/* @__PURE__ */ b(ai, {})
|
|
15028
15028
|
]
|
|
15029
15029
|
}
|
|
15030
15030
|
)
|
|
@@ -15512,7 +15512,8 @@ let fi = class extends ae {
|
|
|
15512
15512
|
...e,
|
|
15513
15513
|
direction: n
|
|
15514
15514
|
},
|
|
15515
|
-
noPushMinimumGap: !0
|
|
15515
|
+
noPushMinimumGap: !0,
|
|
15516
|
+
autoRelayout: !1
|
|
15516
15517
|
},
|
|
15517
15518
|
i,
|
|
15518
15519
|
o
|
|
@@ -15672,16 +15673,21 @@ const z0 = (r) => {
|
|
|
15672
15673
|
"div",
|
|
15673
15674
|
{
|
|
15674
15675
|
className: `
|
|
15675
|
-
univer-relative univer-mt-4 univer-h-full univer-rounded univer-
|
|
15676
|
-
univer-
|
|
15676
|
+
univer-relative univer-mt-4 univer-h-full univer-rounded univer-px-1.5 univer-transition-all
|
|
15677
|
+
univer-duration-150
|
|
15677
15678
|
`,
|
|
15678
15679
|
children: /* @__PURE__ */ b("div", { className: "univer-relative univer-h-8 univer-select-none", children: /* @__PURE__ */ b(
|
|
15679
15680
|
S,
|
|
15680
15681
|
{
|
|
15681
15682
|
ref: ne,
|
|
15682
15683
|
className: `
|
|
15683
|
-
univer-h-full
|
|
15684
|
-
|
|
15684
|
+
univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center
|
|
15685
|
+
univer-rounded-lg univer-border univer-border-solid univer-border-gray-200
|
|
15686
|
+
univer-bg-white univer-pt-2 univer-transition-colors
|
|
15687
|
+
[&>div:first-child]:univer-px-2.5
|
|
15688
|
+
[&>div]:univer-h-5 [&>div]:univer-ring-transparent
|
|
15689
|
+
dark:univer-border-gray-600 dark:univer-bg-gray-700 dark:univer-text-white
|
|
15690
|
+
hover:univer-border-primary-600
|
|
15685
15691
|
`,
|
|
15686
15692
|
initValue: M,
|
|
15687
15693
|
unitId: I,
|
|
@@ -18113,9 +18119,11 @@ const _h = 2, Uw = [
|
|
|
18113
18119
|
"div",
|
|
18114
18120
|
{
|
|
18115
18121
|
className: `
|
|
18116
|
-
univer-absolute univer-
|
|
18117
|
-
univer-border univer-border-solid univer-border-gray-200
|
|
18122
|
+
univer-absolute univer-z-[1080] univer-flex univer-cursor-pointer univer-items-center
|
|
18123
|
+
univer-justify-center univer-gap-2 univer-rounded univer-border univer-border-solid univer-border-gray-200
|
|
18124
|
+
univer-bg-white univer-p-1
|
|
18118
18125
|
dark:univer-border-gray-700
|
|
18126
|
+
hover:univer-bg-gray-100
|
|
18119
18127
|
`,
|
|
18120
18128
|
style: {
|
|
18121
18129
|
left: d.positionX + _h,
|
|
@@ -18126,44 +18134,36 @@ const _h = 2, Uw = [
|
|
|
18126
18134
|
children: /* @__PURE__ */ b(
|
|
18127
18135
|
xs,
|
|
18128
18136
|
{
|
|
18129
|
-
|
|
18130
|
-
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
|
|
18139
|
-
|
|
18140
|
-
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
|
|
18144
|
-
|
|
18145
|
-
|
|
18137
|
+
align: "start",
|
|
18138
|
+
overlay: /* @__PURE__ */ b("ul", { className: "univer-m-0 univer-list-none univer-p-1.5", children: Uw.map((g) => {
|
|
18139
|
+
const f = $e[g.value], m = (t == null ? void 0 : t.pasteType) === f;
|
|
18140
|
+
return /* @__PURE__ */ q(
|
|
18141
|
+
"li",
|
|
18142
|
+
{
|
|
18143
|
+
className: `
|
|
18144
|
+
univer-cursor-pointer univer-rounded univer-px-2 univer-py-1.5
|
|
18145
|
+
univer-transition-colors
|
|
18146
|
+
dark:univer-border-gray-700
|
|
18147
|
+
hover:univer-bg-gray-100
|
|
18148
|
+
`,
|
|
18149
|
+
onClick: () => h(g.value),
|
|
18150
|
+
children: [
|
|
18151
|
+
/* @__PURE__ */ b("span", { children: m && /* @__PURE__ */ b(rr, { className: "univer-absolute", style: { color: "rgb(var(--green-700, #409f11))" } }) }),
|
|
18152
|
+
/* @__PURE__ */ b(
|
|
18153
|
+
"div",
|
|
18154
|
+
{
|
|
18155
|
+
className: `
|
|
18156
|
+
univer-ml-5 univer-text-sm univer-text-gray-700
|
|
18157
|
+
dark:univer-text-white
|
|
18146
18158
|
`,
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
dark:univer-text-white
|
|
18156
|
-
`,
|
|
18157
|
-
children: n.t(g.label)
|
|
18158
|
-
}
|
|
18159
|
-
)
|
|
18160
|
-
]
|
|
18161
|
-
},
|
|
18162
|
-
g.value
|
|
18163
|
-
);
|
|
18164
|
-
}) })
|
|
18165
|
-
}
|
|
18166
|
-
),
|
|
18159
|
+
children: n.t(g.label)
|
|
18160
|
+
}
|
|
18161
|
+
)
|
|
18162
|
+
]
|
|
18163
|
+
},
|
|
18164
|
+
g.value
|
|
18165
|
+
);
|
|
18166
|
+
}) }),
|
|
18167
18167
|
open: l,
|
|
18168
18168
|
onOpenChange: a,
|
|
18169
18169
|
children: /* @__PURE__ */ q(
|
|
@@ -18171,7 +18171,7 @@ const _h = 2, Uw = [
|
|
|
18171
18171
|
{
|
|
18172
18172
|
className: `
|
|
18173
18173
|
univer-flex univer-cursor-pointer univer-content-center univer-items-center univer-rounded
|
|
18174
|
-
univer-
|
|
18174
|
+
univer-py-1
|
|
18175
18175
|
dark:univer-border-gray-700
|
|
18176
18176
|
`,
|
|
18177
18177
|
onClick: () => {
|
|
@@ -18181,8 +18181,7 @@ const _h = 2, Uw = [
|
|
|
18181
18181
|
/* @__PURE__ */ b(
|
|
18182
18182
|
Rf,
|
|
18183
18183
|
{
|
|
18184
|
-
|
|
18185
|
-
extend: { colorChannel1: "rgb(var(--green-700))" }
|
|
18184
|
+
className: "univer-fill-primary-600 univer-text-gray-900"
|
|
18186
18185
|
}
|
|
18187
18186
|
),
|
|
18188
18187
|
u && /* @__PURE__ */ b(ai, {})
|
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-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-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-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-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-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-text-yellow-500{--tw-text-opacity: 1;color:#d49d0f;color:rgba(212,157,15,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}.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}.univer-group:hover .group-hover\:univer-block{display:block}.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%}.\[\&\>div\]\:univer-ring-transparent>div{--tw-ring-color: transparent }.\[\&_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-z-\[1080\]{z-index:1080}.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-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{border-color:var(--univer-gray-100)}.univer-border-gray-200{border-color:var(--univer-gray-200)}.univer-border-transparent{border-color:transparent}.univer-border-b-gray-200{border-bottom-color:var(--univer-gray-200)}.univer-border-r-gray-200{border-right-color:var(--univer-gray-200)}.univer-border-t-gray-200{border-top-color:var(--univer-gray-200)}.univer-border-t-primary-500{border-top-color:var(--univer-primary-500)}.univer-bg-blue-500{background-color:var(--univer-blue-500)}.univer-bg-gray-100{background-color:var(--univer-gray-100)}.univer-bg-gray-200{background-color:var(--univer-gray-200)}.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{background-color:var(--univer-white)}.univer-fill-primary-600{fill:var(--univer-primary-600)}.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-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-\[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{color:var(--univer-black)}.univer-text-blue-500{color:var(--univer-blue-500)}.univer-text-gray-200{color:var(--univer-gray-200)}.univer-text-gray-300{color:var(--univer-gray-300)}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-gray-500{color:var(--univer-gray-500)}.univer-text-gray-600{color:var(--univer-gray-600)}.univer-text-gray-700{color:var(--univer-gray-700)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-green-600{color:var(--univer-green-600)}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-text-primary-600{color:var(--univer-primary-600)}.univer-text-primary-700{color:var(--univer-primary-700)}.univer-text-red-500{color:var(--univer-red-500)}.univer-text-red-600{color:var(--univer-red-600)}.univer-text-yellow-500{color:var(--univer-yellow-500)}.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);background-color:var(--univer-gray-200)}.after\:univer-content-\[\"\"\]:after{--tw-content: "";content:"";content:var(--tw-content)}.last\:univer-mb-0:last-child{margin-bottom:0}.hover\:univer-border-primary-600:hover{border-color:var(--univer-primary-600)}.hover\:univer-bg-gray-100:hover{background-color:var(--univer-gray-100)}.hover\:univer-bg-gray-200:hover{background-color:var(--univer-gray-200)}.hover\:univer-bg-gray-50:hover{background-color:var(--univer-gray-50)}.hover\:univer-bg-transparent:hover{background-color:transparent}.focus\:univer-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.univer-group:hover .group-hover\:univer-block{display:block}.dark\:univer-border-gray-600:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)}.dark\:univer-border-gray-700:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-700)}.dark\:univer-border-b-gray-700:where(.univer-dark,.univer-dark *){border-bottom-color:var(--univer-gray-700)}.dark\:univer-border-r-gray-700:where(.univer-dark,.univer-dark *){border-right-color:var(--univer-gray-700)}.dark\:univer-border-t-gray-700:where(.univer-dark,.univer-dark *){border-top-color:var(--univer-gray-700)}.dark\:univer-bg-black:where(.univer-dark,.univer-dark *){background-color:var(--univer-black)}.dark\:univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)}.dark\:univer-bg-gray-900:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)}.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 *){color:var(--univer-gray-200)}.dark\:univer-text-gray-700:where(.univer-dark,.univer-dark *){color:var(--univer-gray-700)}.dark\:univer-text-green-400:where(.univer-dark,.univer-dark *){color:var(--univer-green-400)}.dark\:univer-text-red-400:where(.univer-dark,.univer-dark *){color:var(--univer-red-400)}.dark\:univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)}.dark\:hover\:univer-bg-gray-600:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)}.dark\:hover\:univer-bg-gray-700:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)}.dark\:hover\:univer-bg-gray-800:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)}.\[\&\>div\:first-child\]\:univer-px-2\.5>div:first-child{padding-left:10px;padding-right:10px}.\[\&\>div\]\:univer-mt-4>div{margin-top:16px}.\[\&\>div\]\:univer-h-5>div{height:20px}.\[\&\>div\]\:univer-w-full>div{width:100%}.\[\&\>div\]\:univer-ring-transparent>div{--tw-ring-color: transparent }.\[\&_canvas\]\:univer-absolute canvas{position:absolute}
|
package/lib/index.js
CHANGED
|
@@ -5794,8 +5794,8 @@ const V1 = () => {
|
|
|
5794
5794
|
"univer-bg-white": !l
|
|
5795
5795
|
}),
|
|
5796
5796
|
children: [
|
|
5797
|
-
/* @__PURE__ */ b(mf, { className: "univer-fill-
|
|
5798
|
-
B && /* @__PURE__ */ b(ai, {
|
|
5797
|
+
/* @__PURE__ */ b(mf, { className: "univer-fill-primary-600 univer-text-gray-900" }),
|
|
5798
|
+
B && /* @__PURE__ */ b(ai, {})
|
|
5799
5799
|
]
|
|
5800
5800
|
}
|
|
5801
5801
|
)
|
|
@@ -14991,7 +14991,7 @@ function dm(r) {
|
|
|
14991
14991
|
type: "button",
|
|
14992
14992
|
children: [
|
|
14993
14993
|
/* @__PURE__ */ b(wf, { className: "univer-fill-primary-600", extend: { colorChannel1: (l = i == null ? void 0 : i.color) != null ? l : "" } }),
|
|
14994
|
-
/* @__PURE__ */ b(ai, {
|
|
14994
|
+
/* @__PURE__ */ b(ai, {})
|
|
14995
14995
|
]
|
|
14996
14996
|
}
|
|
14997
14997
|
)
|
|
@@ -15024,7 +15024,7 @@ function dm(r) {
|
|
|
15024
15024
|
type: "button",
|
|
15025
15025
|
children: [
|
|
15026
15026
|
/* @__PURE__ */ b(mh, { type: ke.THIN }),
|
|
15027
|
-
/* @__PURE__ */ b(ai, {
|
|
15027
|
+
/* @__PURE__ */ b(ai, {})
|
|
15028
15028
|
]
|
|
15029
15029
|
}
|
|
15030
15030
|
)
|
|
@@ -15512,7 +15512,8 @@ let fi = class extends ae {
|
|
|
15512
15512
|
...e,
|
|
15513
15513
|
direction: n
|
|
15514
15514
|
},
|
|
15515
|
-
noPushMinimumGap: !0
|
|
15515
|
+
noPushMinimumGap: !0,
|
|
15516
|
+
autoRelayout: !1
|
|
15516
15517
|
},
|
|
15517
15518
|
i,
|
|
15518
15519
|
o
|
|
@@ -15672,16 +15673,21 @@ const z0 = (r) => {
|
|
|
15672
15673
|
"div",
|
|
15673
15674
|
{
|
|
15674
15675
|
className: `
|
|
15675
|
-
univer-relative univer-mt-4 univer-h-full univer-rounded univer-
|
|
15676
|
-
univer-
|
|
15676
|
+
univer-relative univer-mt-4 univer-h-full univer-rounded univer-px-1.5 univer-transition-all
|
|
15677
|
+
univer-duration-150
|
|
15677
15678
|
`,
|
|
15678
15679
|
children: /* @__PURE__ */ b("div", { className: "univer-relative univer-h-8 univer-select-none", children: /* @__PURE__ */ b(
|
|
15679
15680
|
S,
|
|
15680
15681
|
{
|
|
15681
15682
|
ref: ne,
|
|
15682
15683
|
className: `
|
|
15683
|
-
univer-h-full
|
|
15684
|
-
|
|
15684
|
+
univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center
|
|
15685
|
+
univer-rounded-lg univer-border univer-border-solid univer-border-gray-200
|
|
15686
|
+
univer-bg-white univer-pt-2 univer-transition-colors
|
|
15687
|
+
[&>div:first-child]:univer-px-2.5
|
|
15688
|
+
[&>div]:univer-h-5 [&>div]:univer-ring-transparent
|
|
15689
|
+
dark:univer-border-gray-600 dark:univer-bg-gray-700 dark:univer-text-white
|
|
15690
|
+
hover:univer-border-primary-600
|
|
15685
15691
|
`,
|
|
15686
15692
|
initValue: M,
|
|
15687
15693
|
unitId: I,
|
|
@@ -18113,9 +18119,11 @@ const _h = 2, Uw = [
|
|
|
18113
18119
|
"div",
|
|
18114
18120
|
{
|
|
18115
18121
|
className: `
|
|
18116
|
-
univer-absolute univer-
|
|
18117
|
-
univer-border univer-border-solid univer-border-gray-200
|
|
18122
|
+
univer-absolute univer-z-[1080] univer-flex univer-cursor-pointer univer-items-center
|
|
18123
|
+
univer-justify-center univer-gap-2 univer-rounded univer-border univer-border-solid univer-border-gray-200
|
|
18124
|
+
univer-bg-white univer-p-1
|
|
18118
18125
|
dark:univer-border-gray-700
|
|
18126
|
+
hover:univer-bg-gray-100
|
|
18119
18127
|
`,
|
|
18120
18128
|
style: {
|
|
18121
18129
|
left: d.positionX + _h,
|
|
@@ -18126,44 +18134,36 @@ const _h = 2, Uw = [
|
|
|
18126
18134
|
children: /* @__PURE__ */ b(
|
|
18127
18135
|
xs,
|
|
18128
18136
|
{
|
|
18129
|
-
|
|
18130
|
-
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
|
|
18139
|
-
|
|
18140
|
-
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
|
|
18144
|
-
|
|
18145
|
-
|
|
18137
|
+
align: "start",
|
|
18138
|
+
overlay: /* @__PURE__ */ b("ul", { className: "univer-m-0 univer-list-none univer-p-1.5", children: Uw.map((g) => {
|
|
18139
|
+
const f = $e[g.value], m = (t == null ? void 0 : t.pasteType) === f;
|
|
18140
|
+
return /* @__PURE__ */ q(
|
|
18141
|
+
"li",
|
|
18142
|
+
{
|
|
18143
|
+
className: `
|
|
18144
|
+
univer-cursor-pointer univer-rounded univer-px-2 univer-py-1.5
|
|
18145
|
+
univer-transition-colors
|
|
18146
|
+
dark:univer-border-gray-700
|
|
18147
|
+
hover:univer-bg-gray-100
|
|
18148
|
+
`,
|
|
18149
|
+
onClick: () => h(g.value),
|
|
18150
|
+
children: [
|
|
18151
|
+
/* @__PURE__ */ b("span", { children: m && /* @__PURE__ */ b(rr, { className: "univer-absolute", style: { color: "rgb(var(--green-700, #409f11))" } }) }),
|
|
18152
|
+
/* @__PURE__ */ b(
|
|
18153
|
+
"div",
|
|
18154
|
+
{
|
|
18155
|
+
className: `
|
|
18156
|
+
univer-ml-5 univer-text-sm univer-text-gray-700
|
|
18157
|
+
dark:univer-text-white
|
|
18146
18158
|
`,
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
dark:univer-text-white
|
|
18156
|
-
`,
|
|
18157
|
-
children: n.t(g.label)
|
|
18158
|
-
}
|
|
18159
|
-
)
|
|
18160
|
-
]
|
|
18161
|
-
},
|
|
18162
|
-
g.value
|
|
18163
|
-
);
|
|
18164
|
-
}) })
|
|
18165
|
-
}
|
|
18166
|
-
),
|
|
18159
|
+
children: n.t(g.label)
|
|
18160
|
+
}
|
|
18161
|
+
)
|
|
18162
|
+
]
|
|
18163
|
+
},
|
|
18164
|
+
g.value
|
|
18165
|
+
);
|
|
18166
|
+
}) }),
|
|
18167
18167
|
open: l,
|
|
18168
18168
|
onOpenChange: a,
|
|
18169
18169
|
children: /* @__PURE__ */ q(
|
|
@@ -18171,7 +18171,7 @@ const _h = 2, Uw = [
|
|
|
18171
18171
|
{
|
|
18172
18172
|
className: `
|
|
18173
18173
|
univer-flex univer-cursor-pointer univer-content-center univer-items-center univer-rounded
|
|
18174
|
-
univer-
|
|
18174
|
+
univer-py-1
|
|
18175
18175
|
dark:univer-border-gray-700
|
|
18176
18176
|
`,
|
|
18177
18177
|
onClick: () => {
|
|
@@ -18181,8 +18181,7 @@ const _h = 2, Uw = [
|
|
|
18181
18181
|
/* @__PURE__ */ b(
|
|
18182
18182
|
Rf,
|
|
18183
18183
|
{
|
|
18184
|
-
|
|
18185
|
-
extend: { colorChannel1: "rgb(var(--green-700))" }
|
|
18184
|
+
className: "univer-fill-primary-600 univer-text-gray-900"
|
|
18186
18185
|
}
|
|
18187
18186
|
),
|
|
18188
18187
|
u && /* @__PURE__ */ b(ai, {})
|
package/lib/umd/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
univer-flex univer-items-center univer-gap-2 univer-rounded univer-border univer-border-solid
|
|
3
3
|
univer-border-gray-200 univer-p-1
|
|
4
4
|
hover:univer-bg-gray-100
|
|
5
|
-
`,{"univer-bg-gray-100":l,"univer-bg-white":!l}),children:[b.jsx(ea,{className:"univer-fill-
|
|
5
|
+
`,{"univer-bg-gray-100":l,"univer-bg-white":!l}),children:[b.jsx(ea,{className:"univer-fill-primary-600 univer-text-gray-900"}),F&&b.jsx(sn,{})]})})})})};function ho(n,r){const e=_.useDependency(me),t=_.useDependency(a.ICommandService);return U.useMemo(()=>({keyCodes:[{keyCode:_.KeyCode.ENTER},{keyCode:_.KeyCode.ESC},{keyCode:_.KeyCode.TAB}],handler:o=>{(o===_.KeyCode.ENTER||o===_.KeyCode.ESC||o===_.KeyCode.TAB)&&(e.disableForceKeepVisible(),t.executeCommand(ge.id,{visible:!1,eventType:R.DeviceInputEventType.Keyboard,keycode:o,unitId:r}))}}),[t,e,r])}const Yi=-1e3,ua={width:0,height:0,top:Yi,left:Yi},Du=()=>{const[n,r]=U.useState({...ua}),e=_.useDependency(Xn),t=_.useDependency(Q.IEditorService),i=_.useDependency(a.IContextService),o=_.useDependency(_.ComponentManager),s=_.useDependency(me),l=_.useObservable(s.visible$),c=_.useDependency(a.ICommandService),d=U.useRef(0),u=_.useObservable(()=>i.subscribeContextValue$(_.DISABLE_AUTO_FOCUS_KEY),!1,void 0,[i,_.DISABLE_AUTO_FOCUS_KEY]),h=o.get(Ni),g=s.getEditLocation();U.useEffect(()=>{const p=e.state$.subscribe(C=>{if(C==null)return;const{startX:I=Yi,startY:w=Yi,endX:E=0,endY:O=0,show:M=!1}=C;if(!M)r({...ua});else{r({width:E-I,height:O-w,left:I,top:w});const P=t.getEditor(a.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);if(P==null)return;const{left:A,top:N,width:D,height:V}=P.getBoundingClientRect();e.setRect({left:A,top:N,width:D,height:V})}});return()=>{p.unsubscribe()}},[]),U.useEffect(()=>{u||e.setFocus(!0)},[u,n]);const S=_.useEvent(()=>{s.isVisible().visible&&c.executeCommand(ge.id,{visible:!1,eventType:R.DeviceInputEventType.PointerUp,unitId:g==null?void 0:g.unitId})});_.useSidebarClick(S);const f=ho(d,g==null?void 0:g.unitId),v=_.useEvent((p,C)=>{c.executeCommand(Et.id,{keycode:p,visible:!1,eventType:R.DeviceInputEventType.Keyboard,isShift:C===_.MetaKeys.SHIFT||C===(_.MetaKeys.CTRL_COMMAND|_.MetaKeys.SHIFT),unitId:g==null?void 0:g.unitId})});return b.jsx("div",{className:`
|
|
6
6
|
univer-absolute univer-left-[100px] univer-top-[200px] univer-z-10 univer-flex univer-h-[50px]
|
|
7
7
|
univer-w-[100px] univer-border univer-border-solid univer-border-gray-100
|
|
8
8
|
dark:univer-bg-gray-700
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded
|
|
129
129
|
univer-border-none univer-bg-transparent univer-p-1
|
|
130
130
|
hover:univer-bg-gray-100
|
|
131
|
-
`,type:"button",children:[b.jsx(aa,{className:"univer-fill-primary-600",extend:{colorChannel1:(l=i==null?void 0:i.color)!=null?l:""}}),b.jsx(sn,{
|
|
131
|
+
`,type:"button",children:[b.jsx(aa,{className:"univer-fill-primary-600",extend:{colorChannel1:(l=i==null?void 0:i.color)!=null?l:""}}),b.jsx(sn,{})]})})}),b.jsx("div",{children:b.jsx(j.Dropdown,{overlay:b.jsx("section",{className:"univer-rounded-lg univer-p-1.5",children:b.jsx("ul",{className:"univer-m-0 univer-grid univer-list-none univer-gap-1 univer-p-0",children:Tg.map(c=>b.jsx("li",{className:`
|
|
132
132
|
univer-flex univer-cursor-pointer univer-items-center
|
|
133
133
|
univer-justify-center univer-rounded univer-px-1 univer-py-2
|
|
134
134
|
hover:univer-bg-gray-100
|
|
@@ -136,16 +136,21 @@
|
|
|
136
136
|
univer-flex univer-cursor-pointer univer-items-center univer-gap-2 univer-rounded
|
|
137
137
|
univer-border-none univer-bg-transparent univer-p-1
|
|
138
138
|
hover:univer-bg-gray-100
|
|
139
|
-
`,type:"button",children:[b.jsx(yl,{type:a.BorderStyleTypes.THIN}),b.jsx(sn,{className:"univer-text-gray-400"})]})})})]})]})}const Pl="sheets.component.cell-popup";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},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=dg(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:fl(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:fl(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=Rg([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 Mg=Object.getOwnPropertyDescriptor,Pg=(n,r,e,t)=>{for(var i=t>1?void 0:t?Mg(r,e):r,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i},Og=(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:Pl,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=Pg([Og(0,a.Inject(y.SheetCanvasPopManagerService))],y.CellPopupManagerService);const Ag=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})})},Ol=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(`
|
|
139
|
+
`,type:"button",children:[b.jsx(yl,{type:a.BorderStyleTypes.THIN}),b.jsx(sn,{})]})})})]})]})}const Pl="sheets.component.cell-popup";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},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=dg(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:fl(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:fl(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=Rg([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 Mg=Object.getOwnPropertyDescriptor,Pg=(n,r,e,t)=>{for(var i=t>1?void 0:t?Mg(r,e):r,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i},Og=(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:Pl,extraProps:{...e,direction:i},noPushMinimumGap:!0,autoRelayout:!1},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=Pg([Og(0,a.Inject(y.SheetCanvasPopManagerService))],y.CellPopupManagerService);const Ag=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})})},Ol=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(`
|
|
140
140
|
univer-flex univer-flex-col univer-items-center univer-border-0 univer-border-b univer-border-solid
|
|
141
141
|
univer-border-gray-200 univer-pb-1
|
|
142
142
|
[&>div]:univer-mt-4 [&>div]:univer-w-full
|
|
143
143
|
`,{"univer-hidden":!e}),children:[b.jsx("div",{children:b.jsx(j.Input,{className:"univer-w-full",placeholder:f.t("definedName.inputNamePlaceholder"),value:P,allowClear:!0,onChange:A})}),b.jsx("div",{children:b.jsxs(j.RadioGroup,{value:X,onChange:G,children:[b.jsx(j.Radio,{value:"range",children:f.t("definedName.ratioRange")}),b.jsx(j.Radio,{value:"formula",children:f.t("definedName.ratioFormula")})]})}),X==="range"?w&&b.jsx(w,{unitId:O,subUnitId:M,initialValue:N,onChange:(oe,se)=>$(se),supportAcrossSheet:!0}):E&&b.jsx("div",{className:`
|
|
144
|
-
univer-relative univer-mt-4 univer-h-full univer-rounded univer-
|
|
145
|
-
univer-
|
|
144
|
+
univer-relative univer-mt-4 univer-h-full univer-rounded univer-px-1.5 univer-transition-all
|
|
145
|
+
univer-duration-150
|
|
146
146
|
`,children:b.jsx("div",{className:"univer-relative univer-h-8 univer-select-none",children:b.jsx(E,{ref:J,className:`
|
|
147
|
-
univer-h-full
|
|
148
|
-
|
|
147
|
+
univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center
|
|
148
|
+
univer-rounded-lg univer-border univer-border-solid univer-border-gray-200
|
|
149
|
+
univer-bg-white univer-pt-2 univer-transition-colors
|
|
150
|
+
[&>div:first-child]:univer-px-2.5
|
|
151
|
+
[&>div]:univer-h-5 [&>div]:univer-ring-transparent
|
|
152
|
+
dark:univer-border-gray-600 dark:univer-bg-gray-700 dark:univer-text-white
|
|
153
|
+
hover:univer-border-primary-600
|
|
149
154
|
`,initValue:N,unitId:O,subUnitId:M,isFocus:re,isSupportAcrossSheet:!0,onChange:(oe="")=>{ae(oe||"")},onVerify:oe=>{z(oe)},onFocus:()=>de(!0)})})}),b.jsx("div",{children:b.jsx(j.Select,{className:"univer-w-full",value:x,options:K,onChange:W})}),b.jsx("div",{children:b.jsx(j.Input,{className:"univer-w-full",placeholder:f.t("definedName.inputCommentPlaceholder"),value:V,onChange:H})}),b.jsxs("div",{className:j.clsx("univer-items-center univer-text-[13px] univer-text-red-500",{"univer-hidden":L.length===0,"univer-flex":L.length!==0}),children:[b.jsx("span",{className:"univer-mr-0.5",children:L}),b.jsx(so,{})]}),b.jsxs("div",{children:[b.jsx(j.Button,{onClick:()=>{o==null||o()},children:f.t("definedName.cancel")}),b.jsx(j.Button,{style:{marginLeft:15},variant:"primary",onClick:Z,children:f.t("definedName.confirm")})]})]})},Al=()=>{const n=_.useDependency(a.ICommandService),e=_.useDependency(a.IUniverInstanceService).getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),t=_.useDependency(a.LocaleService),i=_.useDependency(q.IDefinedNamesService),o=_.useDependency(m.SheetsSelectionsService);if(e==null)return;const s=e.getUnitId(),l=()=>{const V=i.getDefinedNameMap(s);return V?Array.from(Object.values(V)):[]},[c,d]=U.useState(!1),[u,h]=U.useState(l()),[g,S]=U.useState(null),[f,v]=U.useState();U.useEffect(()=>{const V=i.update$.subscribe(()=>{h(l())});return()=>{V.unsubscribe()}},[]);const p=V=>{const{name:H,formulaOrRefString:x,comment:W,localSheetId:L,hidden:B}=V;let X=V.id;if(X==null||X.length===0)X=a.Tools.generateRandomId(10),n.executeCommand(m.InsertDefinedNameCommand.id,{id:X,unitId:s,name:H,formulaOrRefString:x,comment:W,localSheetId:L,hidden:B});else{const F={id:X,unitId:s,name:H,formulaOrRefString:x,comment:W,localSheetId:L,hidden:B};n.executeCommand(m.SetDefinedNameCommand.id,F)}d(!1),S(null)},C=V=>{v(V)};function I(){v(null)}function w(V){const H=i.getValueById(s,V);n.executeCommand(m.RemoveDefinedNameCommand.id,{...H,unitId:s}),v(null)}const E=async V=>{const{formulaOrRefString:H,id:x}=V,W=i.getWorksheetByRef(s,H);if(!W)return;W.isSheetHidden()&&await n.executeCommand(m.SetWorksheetShowCommand.id,{unitId:s,subUnitId:W.getSheetId()}),i.focusRange(s,x)},O=()=>{const V=u.length+1,H=t.t("definedName.defaultName")+V;if(i.getValueByName(s,H)==null)return H;let x=V+1;for(;;){const W=t.t("definedName.defaultName")+x;if(i.getValueByName(s,W)==null)return W;x++}},M=()=>{var W;const V=(W=e.getActiveSheet())==null?void 0:W.getName();if(!V)return"";const H=o.getCurrentSelections();return H==null?"":H.map(L=>q.serializeRangeWithSheet(V,L.range)).join(",")},P=()=>{d(!1),S(null)},A=()=>{d(!0),S(null)},N=V=>{d(!1),S(V)},D=V=>{const H=e.getSheetBySheetId(V);return H==null?"":H.getName()};return b.jsx("div",{className:"univer-relative univer-w-full",children:b.jsxs("div",{className:"univer-absolute univer-w-full univer-overflow-hidden univer-overflow-y-auto",children:[b.jsxs("div",{children:[b.jsxs("div",{onClick:A,className:j.clsx(`
|
|
150
155
|
univer-flex univer-h-10 univer-w-full univer-items-center univer-justify-center
|
|
151
156
|
univer-border-0 univer-border-b univer-border-t univer-border-solid univer-border-gray-200
|
|
@@ -182,25 +187,24 @@
|
|
|
182
187
|
univer-mb-1.5 univer-flex univer-h-5 univer-flex-row univer-items-center univer-text-sm
|
|
183
188
|
univer-font-medium
|
|
184
189
|
`,children:[e?o[e]:null,t]}),b.jsx("div",{className:"univer-text-sm",children:i})]})}const Ic="univer.sheet.cell-alert";var TS=Object.getOwnPropertyDescriptor,yS=(n,r,e,t)=>{for(var i=t>1?void 0:t?TS(r,e):r,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i},RS=(n,r)=>(e,t)=>r(e,t,n);let gr=class extends a.Disposable{constructor(n,r){super(),this._context=n,this._componentManager=r,this._initComponent()}_initComponent(){this._componentManager.register(Ic,ES)}};gr=yS([RS(1,a.Inject(_.ComponentManager))],gr);const wc=2,MS=[{value:"DEFAULT_PASTE",label:"rightClick.paste"},{value:"SPECIAL_PASTE_VALUE",label:"rightClick.pasteValue"},{value:"SPECIAL_PASTE_FORMAT",label:"rightClick.pasteFormat"},{value:"SPECIAL_PASTE_COL_WIDTH",label:"rightClick.pasteColWidth"},{value:"SPECIAL_PASTE_BESIDES_BORDER",label:"rightClick.pasteBesidesBorder"},{value:"SPECIAL_PASTE_FORMULA",label:"formula.operation.pasteFormula"}],PS=n=>{var V,H,x,W,L;const r=_.useDependency(a.IUniverInstanceService),e=_.useDependency(R.IRenderManagerService),t=lt();if(!n||!t)return null;const i={startRow:n.rows[0],startCol:n.cols[0],endRow:n.rows[n.rows.length-1],endCol:n.cols[n.cols.length-1]};if(i.endRow<0||i.endCol<0)return null;const o=e.getRenderById(t.getUnitId()),s=o==null?void 0:o.with(y.SheetSkeletonManagerService),l=o==null?void 0:o.with(ve),c=Ne(r,e);if(!c||!l)return null;const{scene:d}=c,u=s==null?void 0:s.getCurrentSkeleton(),h=l.getViewPort(),g=d==null?void 0:d.scaleX,S=d==null?void 0:d.scaleY,f=d==null?void 0:d.getViewportScrollXY(h),v=(V=d.getEngine())==null?void 0:V.getCanvas();if(!g||!d||!g||!S||!f)return null;const p=u==null?void 0:u.getNoMergeCellPositionByIndex(i.endRow,i.endCol),C=(H=p==null?void 0:p.endX)!=null?H:0,I=(x=p==null?void 0:p.endY)!=null?x:0,w=(W=R.convertTransformToOffsetX(C,g,f))!=null?W:-9999,E=(L=R.convertTransformToOffsetY(I,S,f))!=null?L:-9999,O=v==null?void 0:v.getWidth(),M=v==null?void 0:v.getHeight();if(!O||!M)return null;const P=w+50<=O,A=E+50<=M;let N=w,D=E;return P||(N=O-100),A||(D=M-100),{positionX:N,positionY:D}},OS=()=>{const n=_.useDependency(He),r=_.useObservable(n.showMenu$,!1),e=_.useObservable(n.pasteOptionsCache$,null),t=_.useDependency(a.LocaleService),i=_.useDependency(a.ICommandService),[o,s]=U.useState(!1),[l,c]=U.useState(!1),d=e==null?void 0:e.target.pastedRange,u=PS(d);if(!u||!r||u.positionX<50||u.positionY<30)return null;const h=o||l,g=S=>{c(!1),i.executeCommand(qa.id,{type:S})};return b.jsx("div",{className:`
|
|
185
|
-
univer-absolute univer-
|
|
186
|
-
univer-border univer-border-solid univer-border-gray-200
|
|
190
|
+
univer-absolute univer-z-[1080] univer-flex univer-cursor-pointer univer-items-center
|
|
191
|
+
univer-justify-center univer-gap-2 univer-rounded univer-border univer-border-solid univer-border-gray-200
|
|
192
|
+
univer-bg-white univer-p-1
|
|
187
193
|
dark:univer-border-gray-700
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
dark:univer-text-white
|
|
199
|
-
`,children:t.t(S.label)})]},S.value)})})}),open:l,onOpenChange:c,children:b.jsxs("div",{className:`
|
|
194
|
+
hover:univer-bg-gray-100
|
|
195
|
+
`,style:{left:u.positionX+wc,top:u.positionY+wc},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:b.jsx(j.Dropdown,{align:"start",overlay:b.jsx("ul",{className:"univer-m-0 univer-list-none univer-p-1.5",children:MS.map(S=>{const f=Se[S.value],v=(e==null?void 0:e.pasteType)===f;return b.jsxs("li",{className:`
|
|
196
|
+
univer-cursor-pointer univer-rounded univer-px-2 univer-py-1.5
|
|
197
|
+
univer-transition-colors
|
|
198
|
+
dark:univer-border-gray-700
|
|
199
|
+
hover:univer-bg-gray-100
|
|
200
|
+
`,onClick:()=>g(S.value),children:[b.jsx("span",{children:v&&b.jsx(mt,{className:"univer-absolute",style:{color:"rgb(var(--green-700, #409f11))"}})}),b.jsx("div",{className:`
|
|
201
|
+
univer-ml-5 univer-text-sm univer-text-gray-700
|
|
202
|
+
dark:univer-text-white
|
|
203
|
+
`,children:t.t(S.label)})]},S.value)})}),open:l,onOpenChange:c,children:b.jsxs("div",{className:`
|
|
200
204
|
univer-flex univer-cursor-pointer univer-content-center univer-items-center univer-rounded
|
|
201
|
-
univer-
|
|
205
|
+
univer-py-1
|
|
202
206
|
dark:univer-border-gray-700
|
|
203
|
-
`,onClick:()=>{c(!l)},children:[b.jsx(la,{
|
|
207
|
+
`,onClick:()=>{c(!l)},children:[b.jsx(la,{className:"univer-fill-primary-600 univer-text-gray-900"}),h&&b.jsx(sn,{})]})})})},AS=[ge.id,m.SetRangeValuesCommand.id,De.id,m.MoveRangeMutation.id,m.RemoveRowMutation.id,m.RemoveColMutation.id,m.InsertRowMutation.id,m.InsertColMutation.id,m.MoveRowsMutation.id,m.MoveColsMutation.id,m.SetWorksheetColWidthMutation.id,m.SetWorksheetRowHeightMutation.id,m.SetSelectionsOperation.id,a.UndoCommandId];function kS(n,r,e,t,i){const o=[],s=[];if(t.copyType===Je.CUT){const{undos:l,redos:c}=NS(n,r,i);o.push(...c),s.push(...l)}else{const{undos:l,redos:c}=yc(r,e,i);o.push(...c),s.push(...l);const{undos:d,redos:u}=DS(r,e,i);o.push(...u),s.push(...d);const{undos:h,redos:g}=Ec(r,n,e,i);o.push(...g),s.push(...h);const{undos:S,redos:f}=Tc(r,n,e,i,!0);o.push(...f),s.push(...S);const{undos:v,redos:p}=as(r,e,i);o.push(...p),s.push(...v)}return{undos:s,redos:o}}function NS(n,r,e){let t=[],i=[];const{range:o,subUnitId:s,unitId:l}=n,{range:c,subUnitId:d}=r,u=c?ct(c):null,h=o?ct(o):null;if(h&&u){const g=e.get(a.IUniverInstanceService),S=e.get(m.SheetInterceptorService),f=g.getUniverSheetInstance(l),v=f==null?void 0:f.getSheetBySheetId(s),p=f==null?void 0:f.getSheetBySheetId(d);if(v&&p){const C=new a.ObjectMatrix,I=new a.ObjectMatrix,w=v.getCellMatrix(),E=p.getCellMatrix();a.Range.foreach(h,(F,Y)=>{C.setValue(F,Y,a.Tools.deepClone(w.getValue(F,Y))),I.setValue(F,Y,null)});const O=new a.ObjectMatrix;a.Range.foreach(u,(F,Y)=>{O.setValue(F,Y,a.Tools.deepClone(E.getValue(F,Y)))});const M=new a.ObjectMatrix;a.Range.foreach(h,(F,Y)=>{const z=a.cellToRange(F,Y),K=a.Rectangle.getRelativeRange(z,h),ee=a.Rectangle.getPositionRange(K,u);M.setValue(ee.startRow,ee.startColumn,w.getValue(F,Y))});const P={fromRange:h,toRange:u,from:{value:I.getMatrix(),subUnitId:s},to:{value:M.getMatrix(),subUnitId:d},unitId:l},A={fromRange:u,toRange:h,from:{value:C.getMatrix(),subUnitId:s},to:{value:O.getMatrix(),subUnitId:d},unitId:l},N=S.onCommandExecute({id:m.MoveRangeCommand.id,params:{toRange:u,fromRange:h}}),D=v.getMergeData(),V=p.getMergeData(),H=D.filter(F=>a.Rectangle.intersects(F,h)),x=V.filter(F=>a.Rectangle.intersects(F,u)),W=H.map(F=>a.Rectangle.getRelativeRange(F,h)).map(F=>a.Rectangle.getPositionRange(F,u)),L=m.getAddMergeMutationRangeByType(W),B=[{id:m.RemoveWorksheetMergeMutation.id,params:{unitId:l,subUnitId:s,ranges:H}},{id:m.RemoveWorksheetMergeMutation.id,params:{unitId:l,subUnitId:s,ranges:x}},{id:m.AddWorksheetMergeMutation.id,params:{unitId:l,subUnitId:d,ranges:L}}],X=[{id:m.RemoveWorksheetMergeMutation.id,params:{unitId:l,subUnitId:d,ranges:L}},{id:m.AddWorksheetMergeMutation.id,params:{unitId:l,subUnitId:d,ranges:x}},{id:m.AddWorksheetMergeMutation.id,params:{unitId:l,subUnitId:s,ranges:H}}];t=[{id:m.MoveRangeMutation.id,params:P},...N.redos,...B,{id:m.SetSelectionsOperation.id,params:{unitId:l,subUnitId:d,selections:[{range:u}],type:m.SelectionMoveType.MOVE_END}}],i=[{id:m.MoveRangeMutation.id,params:A},...N.undos,...X,{id:m.SetSelectionsOperation.id,params:{unitId:l,subUnitId:s,type:m.SelectionMoveType.MOVE_END,selections:[{range:h}]}}]}}return{undos:i,redos:t}}function Ec(n,r,e,t){var f;const{unitId:i,subUnitId:o,range:s}=n,l=(f=t.get(a.IUniverInstanceService).getUniverSheetInstance(i))==null?void 0:f.getSheetBySheetId(o),c=[],d=[],{mapFunc:u}=bt([s]),h=new a.ObjectMatrix;e.forValue((v,p,C)=>{var O,M;const{row:I,col:w}=u(v,p),E={v:C.v,t:C.t};if(!C.p&&C.v&&!r){const P=l==null?void 0:l.getCellStyle(I,w);if(Ai.isTextFormat((O=P==null?void 0:P.n)==null?void 0:O.pattern))E.t=a.CellValueType.STRING;else{const A=String(C.v),N=a.numfmt.parseValue(A);(N==null?void 0:N.v)!==void 0&&typeof N.v=="number"&&(E.v=N.v)}}if((M=C.p)!=null&&M.body&&vo(C.p.body)){const P=a.Tools.deepClone({p:C.p,v:C.v});h.setValue(I,w,P)}else h.setValue(I,w,a.Tools.deepClone(E))});const g={unitId:i,subUnitId:o,cellValue:a.Tools.deepClone(h.getMatrix())};c.push({id:m.SetRangeValuesMutation.id,params:g});const S=m.SetRangeValuesUndoMutationFactory(t,g);return d.push({id:m.SetRangeValuesMutation.id,params:S}),{undos:d,redos:c}}function Tc(n,r,e,t,i=!1){var v;const o=[],s=[],{unitId:l,subUnitId:c,range:d}=n,u=(v=t.get(a.IUniverInstanceService).getUniverSheetInstance(l))==null?void 0:v.getSheetBySheetId(c),h=new a.ObjectMatrix,{mapFunc:g}=bt([d]);e.forValue((p,C,I)=>{var A,N;const w={s:Object.assign({},{...a.DEFAULT_STYLES,pd:R.DEFAULT_PADDING_DATA,bg:null,cl:null},I.s)},E=w.s.bd;E&&(Object.keys(E).length>0||(w.s.bd={b:null,l:null,r:null,t:null}));const{row:O,col:M}=g(p,C),P=u==null?void 0:u.getCellStyle(O,M);if(I.v&&!r&&Ai.isTextFormat((A=P==null?void 0:P.n)==null?void 0:A.pattern))w.s||(w.s={}),w.s.n=P==null?void 0:P.n;else{const D=String(I.v),V=a.numfmt.parseValue(D);V!=null&&V.z&&(w.s||(w.s={}),typeof w.s=="object"&&((N=w.s)!=null&&N.n?w.s.n.pattern=V.z:w.s.n={pattern:V.z}))}h.setValue(O,M,w)});const S={unitId:l,subUnitId:c,cellValue:a.Tools.deepClone(h.getMatrix())};o.push({id:m.SetRangeValuesMutation.id,params:S});const f=m.SetRangeValuesUndoMutationFactory(t,S);return s.push({id:m.SetRangeValuesMutation.id,params:f}),{undos:s,redos:o}}function yc(n,r,e){const t=[],i=[],o=new a.ObjectMatrix,{unitId:s,subUnitId:l,range:c}=n,{mapFunc:d}=bt([c]);if(r.forEach((u,h)=>{Object.keys(h).forEach(g=>{const S=Number(g),{row:f,col:v}=d(u,S);o.setValue(f,v,{s:null})})}),o.getLength()>0){const u={subUnitId:l,unitId:s,cellValue:a.Tools.deepClone(o.getMatrix())};t.push({id:m.SetRangeValuesMutation.id,params:u});const h=m.SetRangeValuesUndoMutationFactory(e,u);i.push({id:m.SetRangeValuesMutation.id,params:h})}return{undos:i,redos:t}}function DS(n,r,e){const t=[],i=[],o=new a.ObjectMatrix,{unitId:s,subUnitId:l,range:c}=n,{mapFunc:d}=bt([c]);if(r.forValue((u,h,g)=>{const{row:S,col:f}=d(u,h);o.setValue(S,f,{v:null,p:null})}),o.getLength()>0){const u={subUnitId:l,unitId:s,cellValue:a.Tools.deepClone(o.getMatrix())};t.push({id:m.SetRangeValuesMutation.id,params:u});const h=m.SetRangeValuesUndoMutationFactory(e,u);i.push({id:m.SetRangeValuesMutation.id,params:h})}return{undos:i,redos:t}}function as(n,r,e){const t=[],i=[],{unitId:o,subUnitId:s,range:l}=n,{startColumn:c,startRow:d,endColumn:u,endRow:h}=ct(l),g=[];r.forValue((I,w,E)=>{if(E.rowSpan&&E.rowSpan>1){const O=E.colSpan||1,M={startRow:d+I,endRow:d+I+E.rowSpan-1,startColumn:c+w,endColumn:c+w+O-1};g.push(M)}else if(E.colSpan&&E.colSpan>1){const O=E.rowSpan||1,M={startRow:d+I,endRow:d+I+O-1,startColumn:c+w,endColumn:c+w+E.colSpan-1};g.push(M)}});const f=e.get(a.IUniverInstanceService).getUniverSheetInstance(o),v=f==null?void 0:f.getSheetBySheetId(s);if(f&&v){const w=v.getMergeData().filter(M=>a.Rectangle.intersects({startRow:d,startColumn:c,endRow:h,endColumn:u},M)),E={unitId:o,subUnitId:s,ranges:w};t.push({id:m.RemoveWorksheetMergeMutation.id,params:E});const O=m.RemoveMergeUndoMutationFactory(e,E);i.push({id:m.AddWorksheetMergeMutation.id,params:O})}const p={unitId:o,subUnitId:s,ranges:g};g.length>0&&t.push({id:m.AddWorksheetMergeMutation.id,params:p});const C=m.AddMergeUndoMutationFactory(e,p);return g.length>0&&i.push({id:m.RemoveWorksheetMergeMutation.id,params:C}),{undos:i,redos:t}}function VS(n){if(!n.includes("\r")&&a.Tools.isLegalUrl(n)){const t=a.generateRandomId(),i=`${n}`,o={startIndex:0,endIndex:i.length-1,rangeId:t,rangeType:a.CustomRangeType.HYPERLINK,properties:{url:n}};return{dataStream:`${i}\r
|
|
204
208
|
`,paragraphs:[{startIndex:i.length}],customRanges:[o]}}let r=n.replace(/(\r\n|\n)/g,"\r");r.endsWith(`\r
|
|
205
209
|
`)||(r+=`\r
|
|
206
210
|
`);const e=[];for(let t=0;t<r.length;t++)r[t]==="\r"&&e.push({startIndex:t});return{dataStream:r,paragraphs:e,sectionBreaks:[{startIndex:r.indexOf(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-ui",
|
|
3
|
-
"version": "0.7.0-nightly.
|
|
3
|
+
"version": "0.7.0-nightly.202505081607",
|
|
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/
|
|
70
|
-
"@univerjs/design": "0.7.0-nightly.
|
|
71
|
-
"@univerjs/
|
|
72
|
-
"@univerjs/
|
|
73
|
-
"@univerjs/
|
|
74
|
-
"@univerjs/engine-
|
|
75
|
-
"@univerjs/
|
|
76
|
-
"@univerjs/
|
|
77
|
-
"@univerjs/
|
|
78
|
-
"@univerjs/ui": "0.7.0-nightly.
|
|
69
|
+
"@univerjs/docs": "0.7.0-nightly.202505081607",
|
|
70
|
+
"@univerjs/design": "0.7.0-nightly.202505081607",
|
|
71
|
+
"@univerjs/engine-formula": "0.7.0-nightly.202505081607",
|
|
72
|
+
"@univerjs/engine-numfmt": "0.7.0-nightly.202505081607",
|
|
73
|
+
"@univerjs/sheets": "0.7.0-nightly.202505081607",
|
|
74
|
+
"@univerjs/engine-render": "0.7.0-nightly.202505081607",
|
|
75
|
+
"@univerjs/core": "0.7.0-nightly.202505081607",
|
|
76
|
+
"@univerjs/docs-ui": "0.7.0-nightly.202505081607",
|
|
77
|
+
"@univerjs/telemetry": "0.7.0-nightly.202505081607",
|
|
78
|
+
"@univerjs/ui": "0.7.0-nightly.202505081607"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"postcss": "^8.5.3",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"vite": "^6.3.5",
|
|
87
87
|
"vitest": "^3.1.3",
|
|
88
88
|
"@univerjs-infra/shared": "0.7.0-beta.0",
|
|
89
|
-
"@univerjs/themes": "0.7.0-nightly.
|
|
89
|
+
"@univerjs/themes": "0.7.0-nightly.202505081607"
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
92
92
|
"test": "vitest run",
|