import { t } from "../../src/locale";
import loopData from "../_com-props/loopData";
import { CLoopDataSetter } from "../_setters";
import snippets from "./snippets";
import componentKey from "../_com-props/componentKey";
import componentName from "../_com-props/componentName";
import { Mode, Direction } from "../../src/components/carousel-box/type";
import { getFlowEventConfig } from "../_com-props/flowEventConfig";
export default {
  snippets: snippets,
  componentName: 'CarouselBox',
  group: t('carousel-box.group'),
  title: t('carousel-box.title'),
  category: t('carousel-box.category'),
  props: [loopData, componentKey, componentName,
  // 模式：卡点轮播 加速轮播 匀速轮播
  {
    name: 'mode',
    title: t('carousel-box.mode'),
    setter: [{
      componentName: 'SelectSetter',
      initialValue: Mode.accelerate,
      props: {
        options: [{
          title: t('carousel-box.stuckSpot'),
          value: Mode.stuckSpot
        }, {
          title: t('carousel-box.accelerate'),
          value: Mode.accelerate
        }, {
          title: t('carousel-box.uniform'),
          value: Mode.uniform
        }]
      }
    }]
  },
  //方向 四个方向
  {
    name: 'direction',
    title: t('carousel-box.direction'),
    setter: [{
      componentName: 'SelectSetter',
      initialValue: Direction.up,
      props: {
        options: [{
          title: t('carousel-box.down'),
          //上向下
          value: Direction.up
        }, {
          title: t('carousel-box.up'),
          //下向上
          value: Direction.down
        }, {
          title: t('carousel-box.right'),
          //左向右
          value: Direction.left
        }, {
          title: t('carousel-box.left'),
          //右向左
          value: Direction.right
        }]
      }
    }]
  },
  //每次动作的间隔时间
  // {
  //   name: 'awaitTime',
  //   title: t(`carousel-box.minAwaitTime`),
  //   setter: [
  //     {
  //       componentName: 'NumberSetter',
  //       initialValue: 1000,
  //       props: {
  //         min: 1,
  //       }
  //     }
  //   ]
  // },
  {
    name: "noWalletConnect",
    title: {
      label: t("carousel-box.noWalletConnect"),
      tip: t("carousel-box.noWalletConnect")
    },
    propType: "bool",
    setter: "BoolSetter",
    defaultValue: false
  }, {
    name: 'dataSourceConfig',
    title: t('carousel-box.dataSourceConfig'),
    display: 'accordion',
    setter: CLoopDataSetter,
    supportVariable: true
  }, getFlowEventConfig({
    name: "endFlowEvent",
    label: t('carousel-box.endFlowEvent'),
    tip: t('carousel-box.endFlowEventTip'),
    props: {}
  })
  // {
  //   name: 'noDataContent',
  //   title: { label: t('carousel-box.noDataContext'), tip: t('carousel-box.noDataContext') },
  //   isRequired: true,
  //   propType: 'string',
  //   setter: 'StringSetter',
  //   defaultValue: () => {
  //     return `No Data`
  //   },
  //   supportVariable: false,
  // },
  // {
  //   name: 'noDataContentBoxStyle',
  //   title: t('carousel-box.noDataContextBoxStyle'),
  //   type: 'group',
  //   extraProps: {
  //     display: 'entry',
  //   },
  //   items: [
  //     {
  //       name: 'noDataContentBoxStyle',
  //       title: {
  //         label: t('carousel-box.noDataContextBoxStyle'),
  //         tip: 'noDataContextBoxStyle | noDataContextBoxStyle',
  //       },
  //       setter: 'CStyleSetter',
  //       extraProps: {
  //         display: 'block',
  //       },
  //     },
  //   ],
  // },
  ],
  configure: {
    component: {
      isContainer: true,
      nestingRule: {
        descendantBlacklist: ['LoopBox'] //TODO：不生效
        // childWhitelist: ['Image', 'LoopBox']
      }
    },
    supports: {
      events: false,
      style: true,
      "loop": false,
      "condition": false
    }
  }
};