{"version":3,"file":"tree-search.mjs","sources":["../../../../../../../packages/components/tree-search/src/config/tree-search.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\r\nimport { THROTTLE_TIME } from '@ll-plus/constant'\r\n\r\nimport type { ExtractPropTypes } from 'vue'\r\nimport type TreeSearch from '../tree-search.vue'\r\nimport {\r\n  ModalProps,\r\n  DrawerProps,\r\n  IOperateTreeFieldNames\r\n} from '@ll-plus/components'\r\n\r\nexport const treeSearchOperateWayType = ['modal', 'drawer', 'none'] as const\r\n\r\nexport const treeSearchProps = buildProps({\r\n  /**\r\n   * @description input的value\r\n   */\r\n  searchValue: {\r\n    type: String\r\n  },\r\n  /**\r\n   * @description tree-operate操作栏的下拉菜单是否打开(用于如果展开的话，tree-operate不用隐藏)\r\n   */\r\n  operateDropdownOpen: {\r\n    type: Boolean,\r\n    default: false\r\n  },\r\n  /**\r\n   * @description loading\r\n   */\r\n  loading: {\r\n    type: Boolean,\r\n    default: false\r\n  },\r\n  /**\r\n   * @description 节流延时\r\n   */\r\n  throttleTime: {\r\n    type: Number,\r\n    default: THROTTLE_TIME\r\n  },\r\n  /**\r\n   * @description 是否显示头部add按钮\r\n   */\r\n  isShowAddBtn: {\r\n    type: Boolean,\r\n    default: true\r\n  },\r\n  /**\r\n   * @description tree的数据\r\n   */\r\n  treeData: {\r\n    type: definePropType<any[]>(Array),\r\n    default: () => []\r\n  },\r\n  /**\r\n   * @description 替换 treeNode 中 title,key,children 字段为 treeData 中对应的字段\r\n   */\r\n  fieldNames: {\r\n    type: definePropType<IOperateTreeFieldNames>(Object),\r\n    default: () => ({ children: 'children', title: 'title', key: 'key' })\r\n  },\r\n  /**\r\n   * @description  弹窗是否可见\r\n   */\r\n  open: {\r\n    type: Boolean,\r\n    default: false\r\n  },\r\n  /**\r\n   * @description 新增和编辑显示哪种弹窗（模态框/抽屉/自定义）\r\n   */\r\n  operateWay: {\r\n    type: String,\r\n    values: treeSearchOperateWayType,\r\n    default: 'modal'\r\n  },\r\n  /**\r\n   * @description LlModal的组件配置\r\n   */\r\n  modalConfigProps: {\r\n    type: definePropType<ModalProps>(Object)\r\n  },\r\n  /**\r\n   * @description LlDrawer的组件配置\r\n   */\r\n  drawerConfigProps: {\r\n    type: definePropType<DrawerProps>(Object)\r\n  },\r\n  /**\r\n   * @description tree展开的key\r\n   */\r\n  expandedKeys: {\r\n    type: definePropType<string[]>(Array)\r\n  },\r\n  /**\r\n   * @description 头部搜索change\r\n   */\r\n  onSearchInputChange: {\r\n    type: Function,\r\n    default: (v: string) => !!v\r\n  }\r\n} as const)\r\n\r\n// 正确\r\nexport const treeSearchEmits = {\r\n  clickAdd: () => true, // 点击头部新增按钮\r\n  cancel: () => true, // 弹窗取消按钮事件\r\n  ok: () => true, // 弹窗确定按钮事件\r\n  close: () => true, // 弹窗的close\r\n  expand: (expandedKeys: string[], data: any) => expandedKeys || data, // tree的expand\r\n  select: (selectedKeys: string[], e: Event) => selectedKeys || e // tree的select\r\n}\r\n\r\nexport const treeSearchEmits1 = [\r\n  'cancel',\r\n  'cancel',\r\n  'ok',\r\n  'close',\r\n  'expand',\r\n  'select'\r\n]\r\n\r\n// props\r\nexport type TreeSearchOperateWayType = typeof treeSearchOperateWayType\r\nexport type TreeSearchProps = ExtractPropTypes<typeof treeSearchProps>\r\n\r\n// emits\r\nexport type TreeSearchEmits = typeof treeSearchEmits\r\n\r\n// instance\r\nexport type TreeSearchInstance = InstanceType<typeof TreeSearch>\r\n"],"names":[],"mappings":";;;;;AAWO,MAAM,wBAAA,GAA2B,CAAC,OAAA,EAAS,QAAA,EAAU,MAAM;AAE3D,MAAM,kBAAkB,UAAA,CAAW;AAAA;AAAA;AAAA;AAAA,EAIxC,WAAA,EAAa;AAAA,IACX,IAAA,EAAM;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,mBAAA,EAAqB;AAAA,IACnB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAA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