props.d.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import { IBaseProps } from '../../_util/base';
  2. export type PickerValue = [Date, Date];
  3. /**
  4. * @description 对话框
  5. */
  6. export interface IDateRangePickerProps 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: Date;
  21. /**
  22. * @description 最大值
  23. * @default 十年后
  24. */
  25. max: Date;
  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. */
  56. disabled?: boolean;
  57. /**
  58. *@description 选中框样式
  59. * 版本要求: 支付宝小程序基础库 1.10.0 及以上
  60. */
  61. indicatorStyle?: string;
  62. /**
  63. *@description 选中框类名
  64. * 版本要求: 支付宝小程序基础库 1.10.0 及以上
  65. */
  66. indicatorClassName?: string;
  67. /**
  68. * @description 蒙层的样式。
  69. * 版本要求: 支付宝小程序基础库 1.10.0 及以上
  70. */
  71. maskStyle?: string;
  72. /**
  73. * @description 蒙层的类名。
  74. * 版本要求: 支付宝小程序基础库 1.10.0 及以上
  75. */
  76. maskClassName?: string;
  77. /**
  78. * @description 点击确认回调
  79. */
  80. onOk?: (date: PickerValue, dateStr: [string, string], e: Record<string, any>) => void;
  81. /**
  82. * @description 点击取消回调
  83. */
  84. onCancel?: (e: Record<string, any>) => void;
  85. /**
  86. * @description 发生滚动即触发, 与 onChange 点击 ok 后触发不同
  87. */
  88. onPickerChange?: (type: 'start' | 'end', date: Date, dateStr: string, e: Record<string, any>) => void;
  89. /**
  90. * @description 精度
  91. * @default 'day'
  92. */
  93. precision: 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second';
  94. /**
  95. * @description 选中值的文本显示格式
  96. */
  97. onFormat?: (date: PickerValue, dateStr: [string, string]) => string;
  98. /**
  99. * @description 切换显示隐藏
  100. */
  101. onVisibleChange?: (visible: any, e: Record<string, any>) => void;
  102. /**
  103. * @description 显示连接符
  104. * @default '-''
  105. */
  106. splitCharacter: string;
  107. /**
  108. * @description 开始时间提示文案
  109. * @default '未选择'
  110. */
  111. startPlaceholder: string;
  112. /**
  113. * @description 结束时间提示文案
  114. * @default '未选择'
  115. */
  116. endPlaceholder: string;
  117. /**
  118. * @description 点击蒙层是否可以关闭
  119. * @default false
  120. */
  121. maskClosable: boolean;
  122. /**
  123. * @description 弹出框类名
  124. */
  125. popClassName: string;
  126. /**
  127. * @description 弹出框样式
  128. */
  129. popStyle: string;
  130. /**
  131. * 自定义每列展示的内容
  132. * @param type
  133. * @param value
  134. */
  135. onFormatLabel?(type: 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second', value: number): string;
  136. }
  137. export declare const DateRangePickerDefaultProps: Partial<IDateRangePickerProps>;
  138. export declare const DateRangePickerFunctionalProps: Partial<IDateRangePickerProps>;