constants.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React from 'react'
  2. import { Select } from 'antd'
  3. const { Option } = Select
  4. import {
  5. PIVOT_CHART_FONT_FAMILIES,
  6. PIVOT_CHART_FONT_SIZES,
  7. PIVOT_CHART_FONT_WEIGHTS,
  8. PIVOT_CHART_FONT_STYLE,
  9. PIVOT_DEFAULT_FONT_COLOR,
  10. DEFAULT_FONT_STYLE} from 'app/globalConstants'
  11. import { ITableCellStyle } from './types'
  12. export const DEFAULT_TABLE_FIXED_WIDTH = 100
  13. export const fontWeightOptions = PIVOT_CHART_FONT_WEIGHTS.map((w) => (
  14. <Option value={w} key={w}>{w}</Option>
  15. ))
  16. export const fontStyleOptions = PIVOT_CHART_FONT_STYLE.map((s) => (
  17. <Option value={s.value} key={s.value}>{s.name}</Option>
  18. ))
  19. export const fontFamilyOptions = PIVOT_CHART_FONT_FAMILIES.map((f) => (
  20. <Option value={f.value} key={f.value}>{f.name}</Option>
  21. ))
  22. export const fontSizeOptions = PIVOT_CHART_FONT_SIZES.map((s) => (
  23. <Option value={s.toString()} key={`${s}`}>{s}</Option>
  24. ))
  25. export const DefaultTableCellStyle: ITableCellStyle = {
  26. fontSize: '12',
  27. fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  28. fontWeight: PIVOT_CHART_FONT_WEIGHTS[0],
  29. fontColor: PIVOT_DEFAULT_FONT_COLOR,
  30. fontStyle: DEFAULT_FONT_STYLE,
  31. backgroundColor: 'transparent',
  32. justifyContent: 'flex-start',
  33. inflexible: false,
  34. width: DEFAULT_TABLE_FIXED_WIDTH
  35. }