props.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { IBaseProps } from '../_util/base';
  2. interface SwipeButton {
  3. text: string;
  4. width?: number;
  5. bgColor?: string;
  6. color?: string;
  7. confirmType?: '' | 'move' | 'tap';
  8. confirmText?: string;
  9. }
  10. interface SwipeData {
  11. direction: 'right' | 'left' | '';
  12. btnIdx?: number;
  13. swiped?: boolean;
  14. }
  15. interface ISwipeActionProps extends IBaseProps {
  16. /**
  17. * @description 左侧滑出事件
  18. * @default []
  19. */
  20. leftButtons: SwipeButton[];
  21. /**
  22. * @description 右侧滑出事件
  23. * @default []
  24. */
  25. rightButtons: SwipeButton[];
  26. /**
  27. * @description 滑动速度
  28. * @default 70
  29. */
  30. damping: number;
  31. /**
  32. * @description 禁止滑动
  33. * @default false
  34. */
  35. disabled: boolean;
  36. /**
  37. * @description 禁止滑动
  38. * @default ''
  39. */
  40. swiped: '' | 'left' | 'right';
  41. /**
  42. * @description 禁止滑动
  43. * @default ''
  44. */
  45. defaultSwiped: '' | 'left' | 'right';
  46. /**
  47. * @description 弹性超出最大滑动距离自动弹回
  48. * @default true
  49. */
  50. elasticity: boolean;
  51. /**
  52. * @description 滑动结束
  53. */
  54. onSwipeEnd: (data: SwipeData, e: Record<string, any>) => void;
  55. /**
  56. * @description 滑动、触摸开始
  57. */
  58. onSwipeStart: (data: SwipeData, e: Record<string, any>) => void;
  59. /**
  60. * @description 右侧滑动按钮的点击事件回调
  61. */
  62. onButtonTap: (data: SwipeData, e: Record<string, any>) => void;
  63. }
  64. export declare const SwipeActionDefaultProps: Partial<ISwipeActionProps>;
  65. export {};