import snippets from "./snippets";
import baseDatePickerMeta from '../date-picker/meta';

export default {
  snippets,
  componentName: "PisellDatePicker",
  title: "pisell日期选择框",
  category: "表单",
  docUrl: "",
  screenshot: "",
  devMode: "proCode",
  npm: {
    package: "@pisell/materials",
    version: "1.0.1",
    exportName: "PisellDatePicker",
    main: "src/index.tsx",
    destructuring: true,
    subName: "",
  },
  configure: {
    props: [
      {
        name: "type",
        title: {
          label: "选择类型",
          tip: "type | 选择类型",
        },
        propType: {
          type: "oneOf",
          value: ["input", "select", "both"],
        },
        setter: {
          componentName: "RadioGroupSetter",
          props: {
            options: [
              {
                title: "Input",
                value: "input",
              },
              {
                title: "Select",
                value: "select",
              },
              {
                title: "Both",
                value: "both",
              },
            ],
          },
        },
        defaultValue: "both",
      },
      ...baseDatePickerMeta.configure.props,
    ],
    supports: {
      style: true,
      events: [
        {
          name: "onChange",
          template:
            "onChange(date,dateString,${extParams}){\n// 时间发生变化的回调\nconsole.log('onChange',date,dateString);}",
        },
        {
          name: "onOpenChange",
          template:
            "onOpenChange(open,${extParams}){\n// 弹出日历和关闭日历的回调\nconsole.log('onOpenChange',open);}",
        },
        {
          name: "onPanelChange",
          template:
            "onPanelChange(value,mode,${extParams}){\n// 日历面板切换的回调\nconsole.log('onPanelChange',value,mode);}",
        },
      ],
    },
  },
};
