import snippets from './snippets';


export default {
  snippets,
  componentName: 'PisellCashCounting',
  title: 'PisellCashCounting',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '1.1.558',
    exportName: 'PisellCashCounting',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  props: [
    {
      name: 'currencyCode',
      title: {
        label: { type: 'i18n', 'en-US': 'Currency code', 'zh-CN': '币种代码' },
        tip: 'currencyCode | 如 AUD、JPY、CNY， 默认当前店铺币种',
      },
      propType: 'string',
      setter: ['StringSetter', 'VariableSetter'],
      defaultValue: '',
    },
    {
      name: 'currencySymbol',
      title: {
        label: { type: 'i18n', 'en-US': 'Currency symbol', 'zh-CN': '货币符号' },
        tip: 'currencySymbol | 展示用，如 $、¥，默认当前店铺币种符号',
      },
      propType: 'string',
      setter: ['StringSetter', 'VariableSetter'],
      defaultValue: '',
    },
    {
      name: 'value',
      title: {
        label: { type: 'i18n', 'en-US': 'Amount', 'zh-CN': '金额' },
        tip: 'value | 受控金额',
      },
      propType: 'number',
      setter: ['NumberSetter', 'VariableSetter'],
    },
    {
      name: 'amountPrecision',
      title: {
        label: { type: 'i18n', 'en-US': 'Amount decimals', 'zh-CN': '金额小数位' },
        tip: 'amountPrecision | 主输入与键盘精度，不传则默认取列表的第一个decimal_places值',
      },
      propType: 'number',
      setter: ['NumberSetter', 'VariableSetter'],
    },
    {
      name: 'denominations',
      title: {
        label: { type: 'i18n', 'en-US': 'Denominations List', 'zh-CN': '面额配置列表' },
        tip: 'denominations | 接口返回的币种面额列表',
      },
      propType: 'object',
      setter: ['JsonSetter', 'VariableSetter'],
    },
    {
      name: 'modalWidth',
      title: {
        label: { type: 'i18n', 'en-US': 'Modal width', 'zh-CN': '弹窗宽度' },
      },
      propType: 'oneOfType',
      setter: ['NumberSetter', 'StringSetter', 'VariableSetter'],
    },
    {
      name: 'disabled',
      title: { label: { type: 'i18n', 'en-US': 'Disabled', 'zh-CN': '禁用' } },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: false,
    },
    {
      name: 'countDisabled',
      title: {
        label: { type: 'i18n', 'en-US': 'Disable count button', 'zh-CN': '禁用数钱按钮' },
      },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: false,
    },
    {
      name: 'keyboardShowCurrencySymbol',
      title: {
        label: { type: 'i18n', 'en-US': 'Keyboard show symbol', 'zh-CN': '键盘显示货币符号' },
      },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'keyboardUseThousandsSeparator',
      title: {
        label: { type: 'i18n', 'en-US': 'Keyboard thousands sep.', 'zh-CN': '键盘千分位' },
      },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: false,
    },
    {
      name: 'placeholder',
      title: {
        label: { type: 'i18n', 'en-US': 'Placeholder', 'zh-CN': '占位' },
      },
      propType: 'string',
      setter: ['PisellI18nSetter', 'StringSetter', 'VariableSetter'],
    },
    {
      name: 'layout',
      title: {
        label: { type: 'i18n', 'en-US': 'Field layout', 'zh-CN': '输入区布局' },
        tip: 'layout | vertical 上下（默认）、horizontal 输入框与数钱按钮左右排列',
      },
      propType: { type: 'oneOf', value: ['vertical', 'horizontal'] },
      setter: {
        componentName: 'RadioGroupSetter',
        props: {
          options: [
            { label: '上下', value: 'vertical' },
            { label: '左右', value: 'horizontal' },
          ],
        },
      },
      defaultValue: 'vertical',
    },
    {
      name: 'countCashButtonText',
      title: {
        label: { type: 'i18n', 'en-US': 'Count button text', 'zh-CN': '数钱按钮文案' },
      },
      propType: 'string',
      setter: ['PisellI18nSetter', 'StringSetter', 'VariableSetter'],
    },
  ],
  configure: {
    component: { isContainer: false },
    supports: {
      style: true,
      className: true,
      events: [
        {
          name: 'onChange',
          template:
            "onChange(amount,${extParams}){\nconsole.log('amount', amount);\n}",
        },
        {
          name: 'onCountConfirm',
          template:
            "onCountConfirm(payload,${extParams}){\nconsole.log('cash count', payload);\n}",
        },
        {
          name: 'onCountCancel',
          template: "onCountCancel(${extParams}){\nconsole.log('cancel');\n}",
        },
      ],
    },
  },
};
