defaults.mjs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. //#region ../../packages/components/table/src/table-column/defaults.ts
  2. /**
  3. * @deprecated Removed after 3.0.0, Use `TableColumnProps` instead.
  4. */
  5. const tableColumnProps = {
  6. /**
  7. * @description type of the column. If set to `selection`, the column will display checkbox. If set to `index`, the column will display index of the row (staring from 1). If set to `expand`, the column will display expand icon
  8. */
  9. type: {
  10. type: String,
  11. default: "default"
  12. },
  13. /**
  14. * @description column label
  15. */
  16. label: String,
  17. /**
  18. * @description class name of cells in the column
  19. */
  20. className: String,
  21. /**
  22. * @description class name of the label of this column
  23. */
  24. labelClassName: String,
  25. /**
  26. * @description
  27. */
  28. property: String,
  29. /**
  30. * @description field name. You can also use its alias: `property`
  31. */
  32. prop: String,
  33. /**
  34. * @description column width
  35. */
  36. width: {
  37. type: [String, Number],
  38. default: ""
  39. },
  40. /**
  41. * @description column minimum width. Columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion
  42. */
  43. minWidth: {
  44. type: [String, Number],
  45. default: ""
  46. },
  47. /**
  48. * @description render function for table header of this column
  49. */
  50. renderHeader: Function,
  51. /**
  52. * @description whether column can be sorted. Remote sorting can be done by setting this attribute to 'custom' and listening to the `sort-change` event of Table
  53. */
  54. sortable: {
  55. type: [Boolean, String],
  56. default: false
  57. },
  58. /**
  59. * @description sorting method, works when `sortable` is `true`. Should return a number, just like Array.sort
  60. */
  61. sortMethod: Function,
  62. /**
  63. * @description specify which property to sort by, works when `sortable` is `true` and `sort-method` is `undefined`. If set to an Array, the column will sequentially sort by the next property if the previous one is equal
  64. */
  65. sortBy: [
  66. String,
  67. Function,
  68. Array
  69. ],
  70. /**
  71. * @description whether column width can be resized, works when `border` of `el-table` is `true`
  72. */
  73. resizable: {
  74. type: Boolean,
  75. default: true
  76. },
  77. /**
  78. * @description column's key. If you need to use the filter-change event, you need this attribute to identify which column is being filtered
  79. */
  80. columnKey: String,
  81. /**
  82. * @description alignment, the value should be 'left' \/ 'center' \/ 'right'
  83. */
  84. align: String,
  85. /**
  86. * @description alignment of the table header. If omitted, the value of the above `align` attribute will be applied, the value should be 'left' \/ 'center' \/ 'right'
  87. */
  88. headerAlign: String,
  89. /**
  90. * @description whether to hide extra content and show them in a tooltip when hovering on the cell
  91. */
  92. showOverflowTooltip: {
  93. type: [Boolean, Object],
  94. default: void 0
  95. },
  96. /**
  97. * @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`
  98. */
  99. tooltipFormatter: Function,
  100. /**
  101. * @description whether column is fixed at left / right. Will be fixed at left if `true`
  102. */
  103. fixed: [Boolean, String],
  104. /**
  105. * @description function that formats cell content
  106. */
  107. formatter: Function,
  108. /**
  109. * @description function that determines if a certain row can be selected, works when `type` is 'selection'
  110. */
  111. selectable: Function,
  112. /**
  113. * @description whether to reserve selection after data refreshing, works when `type` is 'selection'. Note that `row-key` is required for this to work
  114. */
  115. reserveSelection: Boolean,
  116. /**
  117. * @description data filtering method. If `filter-multiple` is on, this method will be called multiple times for each row, and a row will display if one of the calls returns `true`
  118. */
  119. filterMethod: Function,
  120. /**
  121. * @description filter value for selected data, might be useful when table header is rendered with `render-header`
  122. */
  123. filteredValue: Array,
  124. /**
  125. * @description an array of data filtering options. For each element in this array, `text` and `value` are required
  126. */
  127. filters: Array,
  128. /**
  129. * @description placement for the filter dropdown
  130. */
  131. filterPlacement: String,
  132. /**
  133. * @description whether data filtering supports multiple options
  134. */
  135. filterMultiple: {
  136. type: Boolean,
  137. default: true
  138. },
  139. /**
  140. * @description className for the filter dropdown
  141. */
  142. filterClassName: String,
  143. /**
  144. * @description customize indices for each row, works on columns with `type=index`
  145. */
  146. index: [Number, Function],
  147. /**
  148. * @description the order of the sorting strategies used when sorting the data, works when `sortable` is `true`. Accepts an array, as the user clicks on the header, the column is sorted in order of the elements in the array
  149. */
  150. sortOrders: {
  151. type: Array,
  152. default: () => {
  153. return [
  154. "ascending",
  155. "descending",
  156. null
  157. ];
  158. },
  159. validator: (val) => {
  160. return val.every((order) => [
  161. "ascending",
  162. "descending",
  163. null
  164. ].includes(order));
  165. }
  166. }
  167. };
  168. //#endregion
  169. export { tableColumnProps as default, tableColumnProps };
  170. //# sourceMappingURL=defaults.mjs.map