
import { ComponentMetadata } from '@alilc/lowcode-types';
import snippets from './snippets';

const JsonWrapperMeta: ComponentMetadata = {
  componentName: 'JsonWrapper',
  title: 'JSON包装器',
  category: '表单',
  group: '无代码组件',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/materials',
    version: '1.0.1',
    exportName: 'JsonWrapper',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        name: 'prefix',
        title: {
          label: {
            type: 'i18n',
            'en-US': 'Prefix Path',
            'zh-CN': '前缀路径',
          },
          tip: '用于指定JSON数据的路径前缀',
        },
        propType: {
          type: 'oneOfType',
          value: ['string', 'number', { type: 'arrayOf', value: ['string', 'number'] }]
        },
        setter: ['StringSetter', 'NumberSetter', 'ArraySetter', 'VariableSetter'],
        defaultValue: '',
      },
      {
        name: 'label',
        title: {
          label: {
            type: 'i18n',
            'en-US': 'Label',
            'zh-CN': '标签',
          },
        },
        propType: 'string',
        setter: ['StringSetter', 'PisellI18nSetter'],
      }
    ],
    supports: {
      style: true,
      className: true,
      isContainer: true,
    },
    component: {
        isContainer: true,
      },
  },
  snippets,
};

export default JsonWrapperMeta;
