2020 'frozen-column--last': index === pinnedColumnIndex,
2121 }"
2222 @click =" handleCellClick(col)" >
23- <component :is =" getTableCell(col)"
24- :column =" col"
23+ <TableCell :column =" col "
2524 :row-id =" row .id "
2625 :value =" getCellValue (col )"
2726 :element-id =" elementId "
@@ -68,20 +67,8 @@ import { NcCheckboxRadioSwitch, NcActions, NcActionButton } from '@nextcloud/vue
6867import ContentCopy from ' vue-material-design-icons/ContentCopy.vue'
6968import Pencil from ' vue-material-design-icons/PencilOutline.vue'
7069import TrashCanOutline from ' vue-material-design-icons/TrashCanOutline.vue'
71- import TableCellHtml from ' ./TableCellHtml.vue'
72- import TableCellProgress from ' ./TableCellProgress.vue'
73- import TableCellLink from ' ./TableCellLink.vue'
74- import TableCellNumber from ' ./TableCellNumber.vue'
75- import TableCellStars from ' ./TableCellStars.vue'
76- import TableCellYesNo from ' ./TableCellYesNo.vue'
77- import TableCellDateTime from ' ./TableCellDateTime.vue'
78- import TableCellTextLine from ' ./TableCellTextLine.vue'
79- import TableCellSelection from ' ./TableCellSelection.vue'
80- import TableCellMultiSelection from ' ./TableCellMultiSelection.vue'
81- import TableCellRelation from ' ./TableCellRelation.vue'
82- import TableCellTextRich from ' ./TableCellEditor.vue'
83- import TableCellUsergroup from ' ./TableCellUsergroup.vue'
84- import { ColumnTypes , getColumnWidthStyle , getFrozenColumnStyle } from ' ./../mixins/columnHandler.js'
70+ import TableCell from ' ./TableCell.vue'
71+ import { getColumnWidthStyle , getFrozenColumnStyle } from ' ./../mixins/columnHandler.js'
8572import { translate as t } from ' @nextcloud/l10n'
8673import {
8774 TYPE_META_ID , TYPE_META_CREATED_BY , TYPE_META_CREATED_AT , TYPE_META_UPDATED_BY , TYPE_META_UPDATED_AT ,
@@ -91,25 +78,13 @@ import activityMixin from '../../../mixins/activityMixin.js'
9178export default {
9279 name: ' TableRow' ,
9380 components: {
94- TableCellYesNo,
95- TableCellStars,
96- TableCellNumber,
97- TableCellLink,
98- TableCellProgress,
99- TableCellHtml,
81+ TableCell,
10082 NcActions,
10183 NcActionButton,
10284 ContentCopy,
10385 Pencil,
10486 TrashCanOutline,
10587 NcCheckboxRadioSwitch,
106- TableCellDateTime,
107- TableCellTextLine,
108- TableCellSelection,
109- TableCellMultiSelection,
110- TableCellRelation,
111- TableCellTextRich,
112- TableCellUsergroup,
11388 },
11489
11590 mixins: [activityMixin],
@@ -180,25 +155,6 @@ export default {
180155 this .$emit (' edit-row' , this .row .id )
181156 }
182157 },
183- getTableCell (column ) {
184- switch (column .type ) {
185- case ColumnTypes .TextLine : return ' TableCellTextLine'
186- case ColumnTypes .TextLink : return ' TableCellLink'
187- case ColumnTypes .TextRich :return ' TableCellTextRich'
188- case ColumnTypes .Number : return ' TableCellNumber'
189- case ColumnTypes .NumberStars : return ' TableCellStars'
190- case ColumnTypes .NumberProgress : return ' TableCellProgress'
191- case ColumnTypes .Selection : return ' TableCellSelection'
192- case ColumnTypes .SelectionMulti : return ' TableCellMultiSelection'
193- case ColumnTypes .SelectionCheck : return ' TableCellYesNo'
194- case ColumnTypes .Relation : return ' TableCellRelation'
195- case ColumnTypes .Datetime : return ' TableCellDateTime'
196- case ColumnTypes .DatetimeDate : return ' TableCellDateTime'
197- case ColumnTypes .DatetimeTime : return ' TableCellDateTime'
198- case ColumnTypes .Usergroup : return ' TableCellUsergroup'
199- default : return ' TableCellHtml'
200- }
201- },
202158 getCell (columnId ) {
203159 if (columnId < 0 ) {
204160 // See metaColumns.js for mapping
0 commit comments