Options.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * <<
  3. * Davinci
  4. * ==
  5. * Copyright (C) 2016 - 2017 EDP
  6. * ==
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. * >>
  19. */
  20. import React from 'react'
  21. import { Select } from 'antd'
  22. import {
  23. ReferenceValueTypeLabels,
  24. ReferenceLabelPositionLabels
  25. } from '../constants'
  26. import {
  27. PIVOT_CHART_FONT_FAMILIES,
  28. PIVOT_CHART_FONT_SIZES,
  29. PIVOT_CHART_LINE_STYLES,
  30. CHART_LABEL_POSITIONS
  31. } from 'app/globalConstants'
  32. const Option = Select.Option
  33. export const referenceValueTypeSelectOptions = Object.entries(
  34. ReferenceValueTypeLabels
  35. ).map(([value, label]) => (
  36. <Option key={value} value={value}>
  37. {label}
  38. </Option>
  39. ))
  40. export const lineLabelPositionOptions = Object.entries(
  41. ReferenceLabelPositionLabels
  42. ).map(([value, label]) => (
  43. <Option key={value} value={value}>
  44. {label}
  45. </Option>
  46. ))
  47. export const bandLabelPositionOptions = CHART_LABEL_POSITIONS.map(
  48. ({ name, value }) => (
  49. <Option key={value} value={value}>
  50. {name}
  51. </Option>
  52. )
  53. )
  54. export const fontFamilyOptions = PIVOT_CHART_FONT_FAMILIES.map(
  55. ({ name, value }) => (
  56. <Option key={value} value={value}>
  57. {name}
  58. </Option>
  59. )
  60. )
  61. export const fontSizeOptions = PIVOT_CHART_FONT_SIZES.map((size) => (
  62. <Option key={`${size}`} value={`${size}`}>
  63. {size}
  64. </Option>
  65. ))
  66. export const lineStyleOptions = PIVOT_CHART_LINE_STYLES.map(
  67. ({ name, value }) => (
  68. <Option key={value} value={value}>
  69. {name}
  70. </Option>
  71. )
  72. )