defaults.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // @ts-nocheck
  2. import type { PropType } from 'vue'
  3. import type { Store } from '../store'
  4. import type {
  5. ColumnCls,
  6. ColumnStyle,
  7. DefaultRow,
  8. Table,
  9. } from '../table/defaults'
  10. import type { TableOverflowTooltipOptions } from '../util'
  11. interface TableBodyProps<T> {
  12. store: Store<T>
  13. stripe?: boolean
  14. context: Table<T>
  15. rowClassName: ColumnCls<T>
  16. rowStyle: ColumnStyle<T>
  17. fixed: string
  18. highlight: boolean
  19. tooltipEffect?: string
  20. tooltipOptions?: TableOverflowTooltipOptions
  21. }
  22. const defaultProps = {
  23. store: {
  24. required: true,
  25. type: Object as PropType<TableBodyProps<DefaultRow>['store']>,
  26. },
  27. stripe: Boolean,
  28. tooltipEffect: String,
  29. tooltipOptions: {
  30. type: Object as PropType<TableBodyProps<DefaultRow>['tooltipOptions']>,
  31. },
  32. context: {
  33. default: () => ({}),
  34. type: Object as PropType<TableBodyProps<DefaultRow>['context']>,
  35. },
  36. rowClassName: [String, Function] as PropType<
  37. TableBodyProps<DefaultRow>['rowClassName']
  38. >,
  39. rowStyle: [Object, Function] as PropType<
  40. TableBodyProps<DefaultRow>['rowStyle']
  41. >,
  42. fixed: {
  43. type: String,
  44. default: '',
  45. },
  46. highlight: Boolean,
  47. }
  48. export { TableBodyProps }
  49. export default defaultProps