import { t } from "../../src/locale";
import { uuid } from "../_utils/utils";
import snippets from "./snippets";
export default {
  snippets: snippets,
  componentName: 'Select',
  "group": t('select.key_tczvVbJep8lf'),
  title: t('select.key_SjqWAToclMqf'),
  category: t('select.key_3NwhTd8QULP0'),
  props: [{
    name: 'defaultValue',
    title: {
      label: t('select.key_QPUwq0kEOb3p'),
      tip: t('select.key_J2Eccikjcap7')
    },
    propType: {
      type: 'oneOfType',
      value: ['string', {
        type: 'arrayOf',
        value: 'string'
      }, 'number', {
        type: 'arrayOf',
        value: 'number'
      }]
    }
  }, {
    name: 'value',
    title: {
      label: t('select.key_IPAm6sM8qt63'),
      tip: t('select.key_1AMYfAP95QhX')
    },
    propType: {
      type: 'oneOfType',
      value: ['string', {
        type: 'arrayOf',
        value: 'string'
      }, 'number', {
        type: 'arrayOf',
        value: 'number'
      }]
    }
  }, {
    name: 'options',
    title: {
      label: t('select.key_QWujAvWALLkM'),
      tip: t('select.key_qvB3UwQcXTlW')
    },
    propType: {
      type: 'arrayOf',
      value: {
        type: 'shape',
        value: [{
          name: 'label',
          propType: 'string',
          description: t('select.key_z1HEHMaspai2'),
          defaultValue: t('select.key_Ojzs53xymMfx')
        }, {
          name: 'value',
          propType: ['string', 'number'],
          description: t('select.key_OKgk5MyeZ4E1'),
          defaultValue: t('select.key_9rJIzY0SBiv0')
        }, {
          name: 'disabled',
          propType: 'bool',
          description: t('select.key_dnbbvY6ozIDI'),
          defaultValue: false
        }]
      }
    },
    setter: {
      componentName: 'ArraySetter',
      props: {
        itemSetter: {
          componentName: 'ObjectSetter',
          props: {
            config: {
              items: [{
                name: 'label',
                title: t('select.key_OvDpT2QHV0lV'),
                setter: ['StringSetter', 'VariableSetter'],
                isRequired: true
              }, {
                name: 'value',
                title: t('select.key_jG3yga4RMdNZ'),
                setter: ['StringSetter', 'NumberSetter', 'VariableSetter'],
                isRequired: true
              }, {
                name: 'disabled',
                title: t('select.key_q6sgXtoE5i6Z'),
                setter: ['BoolSetter', 'VariableSetter']
              }]
            }
          },
          initialValue: function initialValue() {
            return {
              label: t('select.key_0xKoXuK1th5Q'),
              value: uuid(),
              disabled: false
            };
          }
        }
      }
    }
  }, {
    name: 'allowClear',
    title: {
      label: t('select.key_fNRLiFoNLzA9'),
      tip: t('select.key_54gP2edZFu8N')
    },
    propType: 'bool',
    defaultValue: false,
    setter: 'BoolSetter'
  }, {
    name: 'autoFocus',
    title: {
      label: t('select.key_2uLYV9f0WHhK'),
      tip: t('select.key_yA6Nc3SX9dFQ')
    },
    propType: 'bool',
    defaultValue: false,
    setter: 'BoolSetter'
  }, {
    name: 'defaultActiveFirstOption',
    title: {
      label: t('select.key_UlvSY9CISi5W'),
      tip: t('select.key_MxKhcNwuFqKk')
    },
    propType: 'bool',
    defaultValue: true,
    setter: 'BoolSetter'
  }, {
    name: 'disabled',
    title: {
      label: t('select.key_Tc15nCswCDGy'),
      tip: t('select.key_xiS4nKy5yTfR')
    },
    propType: 'bool',
    defaultValue: false,
    setter: 'BoolSetter'
  }, {
    name: 'labelInValue',
    title: {
      label: t('select.key_yVvsfWTCHQMe'),
      tip: t('select.key_gTeLSZnI1c5w')
    },
    propType: 'bool',
    defaultValue: false,
    setter: 'BoolSetter'
  }, {
    name: 'mode',
    title: {
      label: t('select.key_0uSFW0lREOu3'),
      tip: t('select.key_JFGzTmXpIBsW')
    },
    setter: {
      componentName: 'RadioGroupSetter',
      props: {
        options: [{
          title: t('select.key_1wXkfpbrYjv2'),
          value: 'single'
        }, {
          title: t('select.key_kgQIXYEGCmMm'),
          value: 'multiple'
        }, {
          title: t('select.key_UN6mGmjXZizx'),
          value: 'tags'
        }]
      }
    },
    propType: {
      type: 'oneOf',
      value: ['single', 'multiple', 'tags']
    }
  }, {
    name: 'maxTagCount',
    title: {
      label: t('select.key_4iFPhjmgPqi0'),
      tip: t('select.key_SScIVCzgPxPj')
    },
    condition: function condition(target) {
      return target.getProps().getPropValue('mode') === 'tags';
    },
    propType: 'number'
  }, {
    name: 'maxTagTextLength',
    title: {
      label: t('select.key_xGTe6rmzhbNY'),
      tip: t('select.key_Rx4nfLOrUcIX')
    },
    condition: function condition(target) {
      return target.getProps().getPropValue('mode') === 'tags';
    },
    propType: 'number'
  }, {
    name: 'notFoundContent',
    title: {
      label: t('select.key_TC6edXfFymBn'),
      tip: t('select.key_poouTlk6L6uy')
    },
    propType: 'string',
    setter: 'StringSetter'
  }, {
    name: 'placeholder',
    title: {
      label: t('select.key_T23Q5ky0E977'),
      tip: t('select.key_6vpvvqnVhUh3')
    },
    propType: 'string',
    setter: 'StringSetter'
  }, {
    name: 'showArrow',
    title: {
      label: t('select.key_7GSAstpyNOot'),
      tip: t('select.key_7K44eb1kFKtp')
    },
    propType: 'bool',
    setter: 'BoolSetter'
  }, {
    name: 'showSearch',
    title: {
      label: t('select.key_BgQFDOPlTNMu'),
      tip: t('select.key_3oELURClU3wz')
    },
    propType: 'bool',
    defaultValue: false,
    setter: 'BoolSetter'
  }, {
    name: 'size',
    title: {
      label: t('select.key_sSibSKljNIbL'),
      tip: t('select.key_Iu3WZsTkn5OU')
    },
    setter: {
      componentName: 'RadioGroupSetter',
      props: {
        options: [{
          title: t('select.key_ZcGLJPmhwV0B'),
          value: 'large'
        }, {
          title: t('select.key_BFddGtWRDfWF'),
          value: 'middle'
        }, {
          title: t('select.key_iSqRMAyh5xsL'),
          value: 'small'
        }]
      }
    },
    propType: {
      type: 'oneOf',
      value: ['large', 'middle', 'small']
    },
    defaultValue: 'middle'
  }, {
    name: 'loading',
    title: {
      label: t('select.key_qB1gHtVRdoyF'),
      tip: t('select.key_vbMeLA5M5cZ7')
    },
    propType: 'bool',
    defaultValue: false,
    setter: 'BoolSetter'
  }, {
    name: 'bordered',
    title: {
      label: t('select.key_ZCOyuQERto7d'),
      tip: t('select.key_kIZxe6H9Vc7l')
    },
    propType: 'bool',
    defaultValue: true,
    setter: 'BoolSetter'
  }, {
    name: 'filterOption',
    title: {
      label: t('select.key_g4tHdIODi5pC'),
      tip: t('select.key_yi54HZ4Krs3n')
    },
    propType: {
      type: 'oneOfType',
      value: ['bool', 'func']
    },
    defaultValue: true
  }, {
    name: 'optionFilterProp',
    title: {
      label: t('select.key_yPcQlkJHTE8K'),
      tip: t('select.key_wXwfCbIwaG2O')
    },
    propType: {
      type: 'oneOf',
      value: ['value', 'label']
    },
    defaultValue: 'value'
  }, {
    name: 'tokenSeparators',
    title: {
      label: t('select.key_NblUxVJYm9xP'),
      tip: t('select.key_MeyXxnmES0ka')
    },
    propType: {
      type: 'arrayOf',
      value: 'string'
    }
  }, {
    name: 'onBlur',
    title: {
      label: t('select.key_WAPAThIQp7Ih'),
      tip: t('select.key_kYRGr7wwcioK')
    },
    propType: 'func'
  }, {
    name: 'onChange',
    title: {
      label: t('select.key_0oU6gshckVP1'),
      tip: t('select.key_VQU8kd8BiJHT')
    },
    propType: 'func'
  }, {
    name: 'onDeselect',
    title: {
      label: t('select.key_g9jFP2iSCaWK'),
      tip: t('select.key_H72CdAZQg6iC')
    },
    propType: 'func'
  }, {
    name: 'onFocus',
    title: {
      label: t('select.key_wZvES7XTjpOQ'),
      tip: t('select.key_b6kCQtSC3ib5')
    },
    propType: 'func'
  }, {
    name: 'onInputKeyDown',
    title: {
      label: t('select.key_r2onrS5M9Pqm'),
      tip: t('select.key_vlYz7O6YZppE')
    },
    propType: 'func'
  }, {
    name: 'onMouseEnter',
    title: {
      label: t('select.key_xiiJtK0pb1jP'),
      tip: t('select.key_wXncFqWc6JiB')
    },
    propType: 'func'
  }, {
    name: 'onMouseLeave',
    title: {
      label: t('select.key_6BAA1aasd7K3'),
      tip: t('select.key_CmPbtfF9lRH4')
    },
    propType: 'func'
  }, {
    name: 'onPopupScroll',
    title: {
      label: t('select.key_gsB8TjVS5jDQ'),
      tip: t('select.key_XkoTQbTs75fv')
    },
    propType: 'func'
  }, {
    name: 'onSearch',
    title: {
      label: t('select.key_3L6MOSxb5CEd'),
      tip: t('select.key_wofCN0YZdUgU')
    },
    propType: 'func'
  }, {
    name: 'onSelect',
    title: {
      label: t('select.key_CserYiPuEipp'),
      tip: t('select.key_mCMxcHTUv5wH')
    },
    propType: 'func'
  }, {
    name: 'onDropdownVisibleChange',
    title: {
      label: t('select.key_HLcwLcJhALFk'),
      tip: t('select.key_7LYGlziBwaTh')
    },
    propType: 'func'
  }],
  configure: {
    supports: {
      style: true,
      events: false
    }
  }
};