@cainiaofe/cn-ui-m
Version:
40 lines (39 loc) • 1.75 kB
TypeScript
/// <reference types="react" />
import type { NativeProps } from "../../../utils/with-native-props";
import type { CnPickerActions } from './cn-picker-actions';
import type { CnPickerColumn } from './cn-picker-column';
import type { CnPickerColumnItem } from './cn-picker-column-item';
import type { CnPickerValue } from './cn-picker-value';
import type { CnPickerValueExtend } from './cn-picker-value-extend';
import type { PopupBaseProps } from './popup-base-props';
export type CnPickerProps = {
/**
* 配置每一列的选项
*/
columns: CnPickerColumn[] | ((value: CnPickerColumn[]) => CnPickerColumn[]);
value?: CnPickerValue[];
/**
* 默认选中项
*/
defaultValue?: CnPickerValue[];
loading?: boolean;
loadingContent?: React.ReactNode;
onSelect?: (value: CnPickerValue[], extend: CnPickerValueExtend) => void;
onConfirm?: (value: CnPickerValue[], extend: CnPickerValueExtend) => void;
onCancel?: () => void;
onClose?: () => void;
/** 点击背景蒙层后是否关闭 */
closeOnMaskClick?: boolean;
visible?: boolean;
title?: React.ReactNode;
/**
* 确定按钮的文字
*/
confirmText?: React.ReactNode;
cancelText?: React.ReactNode;
children?: (items: Array<CnPickerColumnItem | null>, actions: CnPickerActions) => React.ReactNode;
renderLabel?: (item: CnPickerColumnItem) => React.ReactNode;
mouseWheel?: boolean;
popupClassName?: string;
popupStyle?: React.CSSProperties;
} & Pick<PopupBaseProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation' | 'forceRender' | 'destroyOnClose'> & NativeProps<'--header-button-font-size' | '--title-font-size' | '--item-font-size' | '--item-height'>;