props.d.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import { IBaseProps } from '../_util/base';
  2. export type PickerValue = Date | string | number;
  3. /**
  4. * @description 对话框
  5. */
  6. export interface IDatePickerProps extends IBaseProps {
  7. /**
  8. * @desciption 动画类型
  9. * @default "transform"
  10. */
  11. animationType?: 'transform' | 'position';
  12. /**
  13. * @description 时间格式化显示,例如YYYY-MM-DD
  14. */
  15. format?: string;
  16. /**
  17. * @description 最小值
  18. * @default 十年前
  19. */
  20. min?: PickerValue;
  21. /**
  22. * @description 最大值
  23. * @default 十年后
  24. */
  25. max?: PickerValue;
  26. /**
  27. * @description 当前数据
  28. */
  29. value?: PickerValue;
  30. /**
  31. * @description 默认值
  32. */
  33. defaultValue?: PickerValue;
  34. /**
  35. * @description 标题
  36. */
  37. title?: string;
  38. /**
  39. * @description 确定按钮文案
  40. * @default "确定"
  41. */
  42. okText?: string;
  43. /**
  44. * @description 取消文案
  45. * @default "取消"
  46. */
  47. cancelText?: string;
  48. /**
  49. * @description 提示文案
  50. * @default '请选择'
  51. */
  52. placeholder?: string;
  53. /**
  54. * @description 精度
  55. * @default 'day'
  56. */
  57. precision: 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second';
  58. /**
  59. * @description 点击蒙层是否可以关闭
  60. * @default false
  61. */
  62. maskClosable?: boolean;
  63. /**
  64. * @description 弹出框类名
  65. */
  66. popClassName?: string;
  67. /**
  68. * @description 弹出框样式
  69. */
  70. popStyle?: string;
  71. /**
  72. * @description 是否禁用
  73. */
  74. disabled?: boolean;
  75. /**
  76. *@description 选中框样式
  77. * 版本要求: 支付宝小程序基础库 1.10.0 及以上
  78. */
  79. indicatorStyle?: string;
  80. /**
  81. *@description 选中框类名
  82. * 版本要求: 支付宝小程序基础库 1.10.0 及以上
  83. */
  84. indicatorClassName?: string;
  85. /**
  86. * @description 蒙层的样式。
  87. * 版本要求: 支付宝小程序基础库 1.10.0 及以上
  88. */
  89. maskStyle?: string;
  90. /**
  91. * @description 蒙层的类名。
  92. * 版本要求: 支付宝小程序基础库 1.10.0 及以上
  93. */
  94. maskClassName?: string;
  95. /**
  96. * @description 点击确认回调
  97. */
  98. onOk?: (date: PickerValue, dateStr: string, e: Record<string, any>) => void;
  99. /**
  100. * @description 点击取消回调
  101. */
  102. onCancel?: (e: Record<string, any>) => void;
  103. /**
  104. * @description 发生滚动即触发, 与 onChange 点击 ok 后触发不同
  105. */
  106. onPickerChange?: (date: PickerValue, dateStr: string, e: Record<string, any>) => void;
  107. /**
  108. * @description 选中值的文本显示格式
  109. */
  110. onFormat?: (date: PickerValue, dateStr: string) => string;
  111. /**
  112. * @description 切换显示隐藏
  113. */
  114. onVisibleChange?: (visible: any, e: Record<string, any>) => void;
  115. /**
  116. * 自定义每列展示的内容
  117. * @param type
  118. * @param value
  119. */
  120. onFormatLabel?(type: 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second', value: number): string;
  121. }
  122. export declare const DatePickerDefaultProps: IDatePickerProps;
  123. export declare const DatePickerFunctionalProps: IDatePickerProps;