import { uuid } from "../_utils/utils";

import snippets from "./snippets";

export default {
  snippets,
  componentName: "AutoCompleteNumber",
  title: "辅助提示数字框",
  category: "表单",
  docUrl: "",
  screenshot: "",
  devMode: "proCode",
  npm: {
    package: "@pisell/materials",
    version: "1.0.1",
    exportName: "AutoCompleteNumber",
    main: "src/index.tsx",
    destructuring: true,
    subName: "",
  },
  props: [
    {
      name: "value",
      title: { label: "当前值", tip: "当前选中值" },
      setter: "StringSetter",
    },
    {
      name: "autoCompleteProps",
      title: { label: "辅助提示数字框Props" },
      setter: ["JsonSetter", "VariableSetter"],
    },
    {
      name: "inputNumberProps",
      title: { label: "数字框Props" },
      setter: ["JsonSetter", "VariableSetter"],
    },
  ],
  configure: {
    supports: {
      style: true,
      events: [
        {
          name: "onBlur",
          template:
            "onBlur(${extParams}){\n// 失去焦点时的回调\nconsole.log('onBlur');}",
        },
        {
          name: "onChange",
          template:
            "onChange(value,${extParams}){\n// 选中 option，或 input 的 value 变化时，调用此函数\nconsole.log('onChange', value);}",
        },
        {
          name: "onFocus",
          template:
            "onFocus(${extParams}){\n// 选中 option，或 input 的 value 变化时，调用此函数\nconsole.log('onFocus')}",
        },
        {
          name: "onSearch",
          template:
            "onSearch(value,${extParams}){\n// 搜索补全项的时候调用\nconsole.log('onSearch',value);}",
        },
        {
          name: "onSelect",
          template:
            "onSelect(value,option,${extParams}){\n// 被选中时调用\nconsole.log('onSelect', value, option);}",
        },
        {
          name: "onDropdownVisibleChange",
          template:
            "onDropdownVisibleChange(open,${extParams}){\n// 展开下拉菜单的回调\nconsole.log('onDropdownVisibleChange', open);}",
        },
      ],
    },
  },
};
