Skip to content

Commit

Permalink
fix(sheet): add number cell intercptor
Browse files Browse the repository at this point in the history
  • Loading branch information
VicKun4937 committed Sep 25, 2024
1 parent fb9b8c4 commit c10f7cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/sheets/src/controllers/number-cell.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

import { CellValueType, Disposable, Inject, LifecycleStages, OnLifecycle } from '@univerjs/core';
import { CellValueType, Disposable, Inject, InterceptorEffectEnum, LifecycleStages, OnLifecycle } from '@univerjs/core';
import { stripErrorMargin } from '@univerjs/engine-formula';
import { SheetInterceptorService } from '../services/sheet-interceptor/sheet-interceptor.service';
import { INTERCEPTOR_POINT } from '../services/sheet-interceptor/interceptor-const';
import { SheetInterceptorService } from '../services/sheet-interceptor/sheet-interceptor.service';

@OnLifecycle(LifecycleStages.Ready, NumberCellDisplayController)
export class NumberCellDisplayController extends Disposable {
Expand All @@ -36,6 +36,7 @@ export class NumberCellDisplayController extends Disposable {
this.disposeWithMe(
this._sheetInterceptorService.intercept(INTERCEPTOR_POINT.CELL_CONTENT, {
priority: 11,
effect: InterceptorEffectEnum.Value | InterceptorEffectEnum.Style,
handler: (cell, location, next) => {
// Skip if the cell contains a numfmt pattern
const style = location.workbook.getStyles().getStyleByCell(cell);
Expand Down

0 comments on commit c10f7cd

Please sign in to comment.