import snippets from './snippets';

const PisellReservationScheduleBandMeta = {
  componentName: 'PisellReservationScheduleBand',
  title: '预约顶栏时间轴',
  category: '数据录入',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/materials',
    version: '1.0.1',
    exportName: 'PisellReservationScheduleBand',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: { label: '组合状态', tip: '{ date, at } 受控' },
        display: 'block',
        type: 'group',
        items: [
          {
            name: 'value',
            title: {
              label: '值',
              tip: '{ date: dayjs, at: dayjs }，低代码可用变量绑定',
            },
            propType: 'object',
            setter: 'JsonSetter',
          },
          {
            name: 'defaultValue',
            title: {
              label: '默认值',
              tip: '非受控时可传 { date, at } 部分字段',
            },
            propType: 'object',
            setter: 'JsonSetter',
          },
          {
            name: 'scheduleProps',
            title: { label: '日程条 props', tip: '如 minDate / maxDate' },
            propType: 'object',
            setter: 'JsonSetter',
          },
          {
            name: 'timeNavigatorProps',
            title: {
              label: '时间轴 props',
              tip: 'range、stepMinutes 等，不含 value',
            },
            propType: 'object',
            setter: 'JsonSetter',
          },
          {
            name: 'scheduleStartSlot',
            title: {
              label: '日程条左侧插槽',
              tip: 'PisellReservationSchedule 左侧，如标题文案',
            },
            propType: { type: 'oneOfType', value: ['node'] },
            setter: 'SlotSetter',
          },
          {
            name: 'scheduleEndSlot',
            title: {
              label: '日程条右侧插槽',
              tip: 'PisellReservationSchedule 右侧，如状态、新建按钮',
            },
            propType: { type: 'oneOfType', value: ['node'] },
            setter: 'SlotSetter',
          },
        ],
      },
    ],
    supports: {
      style: true,
      events: [
        {
          name: 'onChange',
          template:
            "onChange(next,${extParams}){\n// next: { date, at }\nconsole.log('onChange', next);}",
        },
      ],
    },
    component: {},
  },
};

export default {
  ...PisellReservationScheduleBandMeta,
  snippets,
};
