props.d.ts 1.6 KB

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