• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 8538004962

03 Apr 2024 11:36AM UTC coverage: 18.233% (-3.3%) from 21.535%
8538004962

Pull #528

github

web-flow
Merge c1a248a6f into 45ee7ebb3
Pull Request #528: feat: Kanban view

575 of 1136 branches covered (50.62%)

29 of 2908 new or added lines in 83 files covered. (1.0%)

5 existing lines in 5 files now uncovered.

6439 of 35315 relevant lines covered (18.23%)

3.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/sdk/src/components/cell-value/cell-number/CellNumber.tsx
NEW
1
import { formatNumberToString } from '@teable/core';
×
NEW
2
import type { INumberFormatting } from '@teable/core';
×
NEW
3
import { cn } from '@teable/ui-lib';
×
NEW
4
import { useMemo } from 'react';
×
NEW
5
import type { ICellValue } from '../type';
×
NEW
6

×
NEW
7
interface ICellNumber extends ICellValue<number | number[]> {
×
NEW
8
  formatting?: INumberFormatting;
×
NEW
9
}
×
NEW
10

×
NEW
11
export const CellNumber = (props: ICellNumber) => {
×
NEW
12
  const { value, formatting, className, style } = props;
×
NEW
13

×
NEW
14
  const displayValue = useMemo(() => {
×
NEW
15
    if (value == null) return;
×
NEW
16

×
NEW
17
    if (Array.isArray(value)) {
×
NEW
18
      return value
×
NEW
19
        .map((v) => (formatting ? formatNumberToString(v, formatting) : String(v)))
×
NEW
20
        .join(', ');
×
NEW
21
    }
×
NEW
22
    return formatting ? formatNumberToString(value, formatting) : String(value);
×
NEW
23
  }, [formatting, value]);
×
NEW
24

×
NEW
25
  return (
×
NEW
26
    <div className={cn('w-full text-sm truncate', className)} style={style} title={displayValue}>
×
NEW
27
      {displayValue}
×
NEW
28
    </div>
×
NEW
29
  );
×
NEW
30
};
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc