props.ts 913 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import type { FormProps } from '../Form/types/form';
  2. import type { tableProp } from './types';
  3. export const basicProps = {
  4. showTableAction: {
  5. type: Boolean,
  6. default: true
  7. },
  8. api: {
  9. type: Function as PropType<tableProp['api']>,
  10. default: () => Promise.resolve()
  11. },
  12. columns: {
  13. type: Array as PropType<tableProp['columns']>,
  14. default: () => []
  15. },
  16. searchFormConfig: {
  17. type: Object as PropType<FormProps>,
  18. default: {
  19. labelWidth: 120,
  20. layout: 'horizontal',
  21. gridProps: {
  22. cols: '1 xl:4 s:1 l:3',
  23. itemResponsive: true
  24. },
  25. collapsedRows: 1
  26. }
  27. },
  28. tableConfig: {
  29. type: Object as PropType<tableProp>,
  30. default: {
  31. opWdith: 130,
  32. title: '',
  33. showDeleteButton: false,
  34. showAddButton: true,
  35. keyField: 'id',
  36. scrollX: 1000,
  37. showTableHeaderAction: true,
  38. showSearch: true
  39. }
  40. }
  41. };