import { WidgetType } from '../constant'
import { positionConfig } from './base'

export default {
  type: WidgetType.WEATHER,
  label: '天气',
  icon: 'w-weather',
  elementui: true,
  defaults (scale) {
    return {
      top: 0,
      left: 0,
      width: 420 * scale.width | 0,
      height: 80 * scale.height | 0,
      color: '#FFFFFF',
      fontSize: 48 * scale.height | 0,
      fontWeight: 'normal',
      textAlign: 'center'
    }
  },
  transform: {
    color: ['color']
  },
  options: [
    {
      label: '配置',
      list: [
        {
          key: 'color',
          label: '字体颜色',
          type: 'color'
        },
        {
          key: 'fontSize',
          label: '字体大小',
          type: 'number',
          options: {
            min: 12
          }
        },
        {
          key: 'fontWeight',
          label: '字体粗细',
          type: 'select',
          options: {
            options: [
              { value: 'normal', label: '正常' },
              { value: 'bold', label: '粗体' },
              { value: 'bolder', label: '特粗体' },
              { value: 'lighter', label: '细体' }
            ]
          }
        },
        {
          key: 'textAlign',
          label: '对齐方式',
          type: 'select',
          options: {
            options: [
              { value: 'center', label: '居中' },
              { value: 'left', label: '左对齐' },
              { value: 'right', label: '右对齐' }
            ]
          }
        }
      ]
    },
    positionConfig
  ]
}
