import {tCascadeHooks} from "./createCascadeHooks"; import {ComponentEvent, ExtractPropTypes, PropType, tScopeSlotsType} from "@peryl/react-compose"; import {TreeEmitOptions, TreePropsOptions} from "../TreeCore/createTreeProps"; import {Input} from "../Input"; import {EditProps, tEditControl} from "../../uses/useEdit"; import {Tree} from "../Tree"; import {tCascadeUtils} from "./createCascadeUtils"; import {TreeScopeSlotsOption} from "../TreeCore/TreeCore.type"; import {CascadePanelCustomPropsOption} from "../CascadePanel/cascade-panel.utils"; import {StyleProps, tStyleComputed} from "../../uses/useStyle"; import {iPopupEditorUseOption} from "../usePopupEditor"; /** * 级联选择组件的属性配置对象 * @author 韦胜健 * @date 2022/10/24 9:13 */ export const CascadePropsOptions = { ...StyleProps, ...EditProps, modelValue: {}, // 级联组件绑定值,单选时如果singleValueType为all则绑定值是对象数组,为父子孙对象数组;当singleValueType为last时,绑定值为最后一个节点的数据对象;多选时为选中节点的对象数组 panel: { type: String as PropType<'tree' | 'cascade' | 'table'>, default: 'cascade' },// 面板类型,cascade级联选择面板,tree树形选择面板 popperAttrs: { type: Object as PropType }, // 给popper传递的属性类型 inputValue: {}, // 输入框输入的文本绑定值 inputAttrs: { type: Object as PropType }, // 输入框传递属性 disableFilter: { type: Boolean }, // 是否禁用搜索 ...CascadePanelCustomPropsOption, /*继承自tree的属性*/ ...TreePropsOptions, plcTreeTitle: { type: String }, } as const; /** * 级联组件派发事件配置对象 * @author 韦胜健 * @date 2022/10/24 9:13 */ export const CascadeEmitOptions = { onFocus: (e: FocusEvent) => true, onBlur: (e: FocusEvent) => true, /** * 继承树组件的派发事件 * @author 韦胜健 * @date 2022/10/24 9:13 */ ...TreeEmitOptions, } as const; /** * 级联组件内部不同形式的公共组合参数 * @author 韦胜健 * @date 2022/10/24 9:14 */ export interface iCascadeCompositionParam { hooks: tCascadeHooks; props: Readonly>, event: ComponentEvent, utils: tCascadeUtils, editControl: tEditControl, getPublicPopperAttrs: () => any, model: { value: any }, treeProps: { value: typeof Tree.use.props }, cascadeProps: { value: any }, classes: { value: any }, scopeSlots: tScopeSlotsType, panelHeight: { value: number | undefined, } styleComputed: tStyleComputed, }