props.d.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import { IBaseProps } from '../_util/base';
  2. export interface PickerData {
  3. value: PickerValue;
  4. label: string;
  5. }
  6. export declare type PickerValue = string | number | (string | number)[];
  7. /**
  8. * @description 选择器,包括一个或多个不同值的可滚动列表,每个值可以在视图的中心以较暗的文本形式显示。当用户激活 **Picker** 后,将会从底部弹出。
  9. */
  10. export interface IPickerProps extends IBaseProps {
  11. /**
  12. * @desciption 动画类型
  13. * @default "transform"
  14. */
  15. animationType: 'transform' | 'position';
  16. /**
  17. * @description picker 数据
  18. */
  19. value: PickerValue;
  20. /**
  21. * @description 默认picker 数据
  22. */
  23. defaultValue: PickerValue;
  24. /**
  25. * @description 是否禁用
  26. */
  27. disabled: boolean;
  28. /**
  29. * @description 标题
  30. */
  31. title: string;
  32. /**
  33. * @description 确定按钮文案
  34. * @default "确定"
  35. */
  36. okText: string;
  37. /**
  38. * @description 取消文案
  39. * @default "取消"
  40. */
  41. cancelText: string;
  42. /**
  43. * @description 提示文案
  44. * @default '请选择'
  45. */
  46. placeholder: string;
  47. /**
  48. * @description picker 数据
  49. */
  50. options: PickerValue[];
  51. /**
  52. * @description 点击确认回调
  53. */
  54. onOk: (value: PickerValue, column: PickerData, e: Record<string, any>) => void;
  55. /**
  56. * @description 点击取消回调
  57. */
  58. onCancel: (e: Record<string, any>) => void;
  59. /**
  60. * @description 发生滚动即触发, 与 onChange 点击 ok 后触发不同
  61. */
  62. onChange: (value: PickerValue, column: PickerData, e: Record<string, any>) => void;
  63. /**
  64. * @description 选中值的文本显示格式
  65. */
  66. onFormat: (value: PickerValue, column: PickerValue) => string;
  67. /**
  68. * @description 切换显示隐藏
  69. */
  70. onVisibleChange: (visible: boolean, e: Record<string, any>) => void;
  71. /**
  72. * @description 点击蒙层是否可以关闭
  73. * @default false
  74. */
  75. maskClosable: boolean;
  76. /**
  77. * @description 弹出框类名
  78. */
  79. popClassName: string;
  80. /**
  81. * @description 弹出框样式
  82. */
  83. popStyle: string;
  84. }
  85. export declare const PickerDefaultProps: Partial<IPickerProps>;