vi-grid-builder 1.0.6 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +240 -11
  2. package/ViGridBuilderPlugin.js +35 -36
  3. package/package.json +5 -2
  4. package/playground/.vscode/extensions.json +3 -0
  5. package/playground/README.md +29 -0
  6. package/playground/index.html +13 -0
  7. package/playground/jsconfig.json +8 -0
  8. package/playground/package-lock.json +2524 -0
  9. package/playground/package.json +20 -0
  10. package/playground/public/favicon.ico +0 -0
  11. package/playground/src/App.vue +84 -0
  12. package/playground/src/assets/base.css +86 -0
  13. package/playground/src/assets/logo.svg +1 -0
  14. package/playground/src/assets/main.css +35 -0
  15. package/playground/src/components/ActionsField.vue +99 -0
  16. package/playground/src/components/ClickableRow.vue +68 -0
  17. package/playground/src/components/ClientSideData.vue +86 -0
  18. package/playground/src/components/ColumnVisibility.vue +85 -0
  19. package/playground/src/components/CustomField.vue +64 -0
  20. package/playground/src/components/CustomHeader.vue +85 -0
  21. package/playground/src/components/GlobalOptions.vue +68 -0
  22. package/playground/src/components/LoadingSlot.vue +11 -0
  23. package/playground/src/components/PaginationOptions.vue +130 -0
  24. package/playground/src/components/RowSelect.vue +72 -0
  25. package/playground/src/components/ServerSideData.vue +62 -0
  26. package/playground/src/components/SortableColumnServerSide.vue +73 -0
  27. package/playground/src/components/TableStyle.vue +112 -0
  28. package/playground/src/components/fields/SampleCustomField.vue +24 -0
  29. package/playground/src/components/icons/IconCommunity.vue +7 -0
  30. package/playground/src/components/icons/IconDocumentation.vue +7 -0
  31. package/playground/src/components/icons/IconEcosystem.vue +7 -0
  32. package/playground/src/components/icons/IconSupport.vue +7 -0
  33. package/playground/src/components/icons/IconTooling.vue +19 -0
  34. package/playground/src/main.js +51 -0
  35. package/playground/vite.config.js +17 -0
  36. package/src/ViGridBuilder.scss +157 -58
  37. package/src/ViGridBuilder.vue +367 -207
  38. package/src/ViGridField.scss +1 -2
  39. package/src/ViGridField.vue +13 -6
  40. package/src/ViGridHeadCell.vue +32 -0
  41. package/src/ViGridHeadColumnCell.vue +42 -0
  42. package/src/ViGridHeader.vue +67 -0
  43. package/src/composables/useColumns.js +21 -0
  44. package/src/composables/useGridActions.js +17 -3
  45. package/src/composables/useGridSettings.js +18 -0
  46. package/src/composables/usePagination.js +39 -0
  47. package/src/composables/useRowHelper.js +38 -0
  48. package/src/composables/useRowSelect.js +53 -0
  49. package/src/composables/useSettings.js +29 -0
  50. package/src/composables/useSort.js +103 -0
  51. package/src/fields/ViGridActions.scss +0 -1
  52. package/src/fields/ViGridActions.vue +37 -13
  53. package/src/fields/ViGridCheckbox.vue +31 -0
  54. package/src/fields/ViGridNumber.vue +18 -0
  55. package/src/fields/partials/ViGridKebabMenu.scss +60 -25
  56. package/src/fields/partials/ViGridKebabMenu.vue +75 -54
  57. package/src/fields/partials/{ViGridBuilderActions.vue → ViGridSimpleActions.vue} +3 -3
  58. package/src/settings/GridSettings.js +24 -0
  59. package/vite.config.js +12 -2
  60. package/src/examples/App.vue +0 -123
  61. package/src/examples/components/TableTitle.vue +0 -20
  62. package/src/examples/main.js +0 -11
  63. /package/src/fields/partials/{ViGridBuilderActions.scss → ViGridSimpleActions.scss} +0 -0
@@ -1,230 +1,390 @@
1
1
  <template>
2
- <div class="vi-grid-builder">
3
- <div class="vi-table-container">
4
- <table class="vi-table">
5
- <tr v-if="title">
6
- <th :colspan="columns.length" class="title">
7
- <slot name="title" :title="title">
8
- <component v-if="defaultSlots.title" :is="defaultSlots.title" :title="title"/>
9
- <span v-else>{{title}}</span>
10
- </slot>
11
- </th>
12
- </tr>
13
- <tr class="table-header">
14
- <th v-for="column in columns" :key="column.name">
15
- <slot :name="`vi-header-cell-${column.name}`">{{column.label}}</slot>
16
- </th>
17
- </tr>
18
-
19
- <tbody v-if="!currentVisibleRows.length" class="table-body">
20
- <tr>
21
- <slot name="empty-data">
22
- <component v-if="defaultSlots.noRows" :is="defaultSlots.noRows"/>
23
- <td v-else :colspan="columns.length" align="center">{{noDataLabel}}</td>
24
- </slot>
25
- </tr>
26
- </tbody>
27
- <tbody v-else class="table-body" :class="{'loading':isDataLoading}">
28
- <tr v-if="isDataLoading">
29
- <td :colspan="columns.length" class="loading">
30
- <slot name="loading">
31
- <component v-if="defaultSlots.loading" :is="defaultSlots.loading"/>
32
- <div style="display: flex;align-items: center" v-else>Loading ...</div>
33
- </slot>
34
- </td>
35
- </tr>
36
- <tr v-for="row in currentVisibleRows" :key="row[rowKey]" @click="$ev => onRowClicked(row)" :class="{'clickable': clickableRow}">
37
-
38
- <td v-for="column in columns" :key="column.name">
39
- <vi-grid-field
40
- :field="column"
41
- :field-value="column.field ? column.field(row) : row[column.name]"
42
- :row-value="row"
43
- @actionClicked="$event => $emit($event.action, $event.row)"
44
- >
45
- <template v-slot:custom-field="props">
46
- <component
47
- v-bind:is="column.type"
48
- v-bind="props"
49
- />
50
- </template>
51
- </vi-grid-field>
52
-
53
- </td>
54
- </tr>
55
- </tbody>
56
- </table>
57
- </div>
58
- <div class="footer-container">
59
- <slot name="footer" :pagination="{...pagination, totalRows:totalRows}">
60
- <component v-if="defaultSlots.footer" :is="defaultSlots.footer"
61
- :pagination="{...pagination, totalRows:totalRows}"/>
62
- <vi-pagination v-else-if="!disablePagination"
63
- :rows-per-page="pagination.rowsPerPage"
64
- :current-page="pagination.page"
65
- :total-rows="totalRows"
66
- :max-pages-displayed="3"
67
- @update:currentPage="$ev => onPaginationChange({page:$ev})"
68
- @update:rowsPerPage="$ev => onPaginationChange({rowsPerPage:$ev, page:1})"
2
+ <div class="vi-grid-builder">
3
+ <div class="vi-table-container" :class="{'loading':isDataLoading}">
4
+ <table class="vi-table" :class="{'stripped': settings.stripped, 'bordered': settings.bordered}">
5
+
6
+ <!------------------- TABLE HEADER -------------->
7
+ <thead class="vi-table-head">
8
+ <!------------------- title -------------->
9
+
10
+ <tr v-if="title" class="vi-header-row vi-table-row vi-title-row">
11
+ <vi-grid-head-cell v-if="title" :colspan="visibleColumns.length" :align="settings.align" class="vi-title-cell">
12
+ <template #default>
13
+ <slot name="title" :title="title">
14
+ <span>{{ title }}}</span>
15
+ </slot>
16
+ </template>
17
+ </vi-grid-head-cell>
18
+ </tr>
19
+ <tr class="vi-header-row vi-table-row">
20
+ <!------------------- master select -------------->
21
+
22
+ <vi-grid-head-cell v-if="selectable" class="vi-select-cell" :align="settings.align">
23
+ <template #default>
24
+ <vi-grid-checkbox name="masterSelect"
25
+ :value="areAllRowsSelected"
26
+ @checkboxClicked="toggleMasterSelect($event.value)"
27
+ />
28
+ </template>
29
+ </vi-grid-head-cell>
30
+
31
+
32
+ <!------------------- columns -------------->
33
+ <vi-grid-head-column-cell v-for="column in visibleColumns"
34
+ :key="column.name"
35
+ :column="column"
36
+ :align="settings.align"
37
+ :sortable-state="getSortableState(column)"
38
+ @sort="setSortFields">
39
+ <template #default>
40
+ <slot :name="`vi-header-cell-${column.name}`" :column="column"/>
41
+ </template>
42
+ </vi-grid-head-column-cell>
43
+ </tr>
44
+
45
+ <!------------------- loading row -------------->
46
+ <tr v-if="isDataLoading" class="vi-body-row vi-table-row vi-loading-row">
47
+
48
+ <vi-grid-head-cell :colspan="totalColumns" class="vi-loading-cell">
49
+ <template #default>
50
+ <slot name="loading">
51
+ <component v-if="settings.defaultSlots.loading" :is="settings.defaultSlots.loading"/>
52
+ <div class="loading-bar-container" v-else>
53
+ <div class="loading-bar"></div>
54
+ </div>
55
+ </slot>
56
+ </template>
57
+ </vi-grid-head-cell>
58
+ </tr>
59
+ </thead>
60
+ <!------------------- END TABLE HEADER -------------->
61
+
62
+ <tbody v-if="!currentVisibleRows.length && !isDataLoading" class="vi-table-body">
63
+
64
+ <!------------------- TABLE NO DATA ROW -------------->
65
+
66
+ <tr class="vi-body-row vi-table-row vi-no-data-row">
67
+ <slot name="empty-data">
68
+ <component v-if="settings.defaultSlots.noRows" :is="settings.defaultSlots.noRows"/>
69
+ <td v-else :colspan="totalColumns" class="vi-body-cell vi-cell">
70
+ {{ settings.noDataLabel }}
71
+ </td>
72
+ </slot>
73
+ </tr>
74
+ </tbody>
75
+ <tbody v-else class="vi-table-body">
76
+
77
+
78
+ <!------------------- TABLE DATA ROWS. -------------->
79
+ <tr v-for="row in currentVisibleRows"
80
+ :key="row[rowKey]"
81
+ @click="$ev => onRowClicked(row)"
82
+ :class="{'clickable': clickableRow,'selected':isRowSelected(row) }"
83
+ class="vi-body-row vi-table-row"
84
+ >
85
+
86
+ <!------------------- SELECTABLE CELL -------------->
87
+ <td v-if="selectable" class="vi-cell vi-select-cell">
88
+ <div class="vi-grid-field" :class="settings.align">
89
+ <vi-grid-checkbox
90
+ :row="row"
91
+ :name="rowKey"
92
+ :value="selectedRows.includes(row[rowKey])"
93
+ @checkboxClicked="toggleRowSelect(row, $event.value)"
94
+ />
95
+ </div>
96
+ </td>
97
+
98
+ <td v-for="column in visibleColumns"
99
+ :key="column.name"
100
+ class="vi-body-cell vi-cell">
101
+ <vi-grid-field
102
+ :class="column.align ?? settings.align"
103
+ :field="column"
104
+ :field-value="column.format ? column.format(row) : row[column.name]"
105
+ :row-value="row"
106
+ :row-key="rowKey"
107
+ v-model:row-menu-opened="rowMenuOpened"
108
+ @actionClicked="$event => $emit($event.action, $event.row)"
109
+ @checkboxClicked="toggleRowSelect(row, $event.value)"
110
+ >
111
+ <template v-slot:custom-field="props">
112
+ <component
113
+ v-bind:is="column.type"
114
+ v-bind="props"
69
115
  />
116
+ </template>
117
+ </vi-grid-field>
118
+
119
+ </td>
120
+ </tr>
121
+
122
+ <tr class="vi-body-row vi-table-row vi-footer-row">
123
+ <td :colspan="totalColumns" class="vi-body-cell vi-cell vi-footer-cell">
124
+
125
+ <slot name="footer" :pagination="{...pagination, totalRows:totalRows}">
126
+ <component v-if="settings.defaultSlots.footer" :is="settings.defaultSlots.footer"
127
+ :pagination="{...pagination, totalRows:totalRows}"/>
128
+ <vi-pagination v-if="!settings.disablePagination"
129
+ :rows-per-page="localPagination.rowsPerPage ?? settings.rowsPerPage "
130
+ :current-page="localPagination.page"
131
+ :total-rows="totalRows"
132
+ :max-pages-displayed="3"
133
+ :compact="settings.compactPagination"
134
+ :rows-per-page-options="settings.rowsPerPageOptions"
135
+ @update="onPaginationChange"
136
+ />
70
137
  </slot>
71
- </div>
138
+ </td>
139
+
140
+ </tr>
141
+ </tbody>
142
+ </table>
72
143
  </div>
144
+
145
+ </div>
73
146
  </template>
74
147
 
75
148
  <script>
76
- import ViGridField from "./ViGridField.vue";
77
-
78
- export default {
79
- name: "ViGridBuilder",
80
- components: {ViGridField},
81
- props: {
82
-
83
- rows: {
84
- type: Array,
85
- },
86
- rowKey: {
87
- type: String,
88
- },
89
- columns: {
90
- type: Array,
91
- required: true
92
- },
93
- title: {
94
- type: String
95
- },
96
- pagination: {
97
- type: Object,
98
- default: function () {
99
- return {
100
- page: 1,
101
- rowsPerPage: 10,
102
- }
103
- }
104
- },
105
- rowsNumber:{
106
- type:Number
107
- },
108
- disablePagination: {
109
- type: Boolean,
110
- default: false
111
- },
112
- fetchServerData: {
113
- type: Function
114
- },
115
- fetchOnInit: {
116
- type: Boolean,
117
- default: true
118
- },
119
- filter: {
120
- type: Object
121
- },
122
- loading: {
123
- type: Boolean,
124
- default: false
125
- },
126
- defaultSlots: {
127
- type: Object
128
- },
129
- noDataLabel: {
130
- type: String,
131
- },
132
- noCellDataLabel: {
133
- type: String,
134
- default:'/'
135
- },
136
- clickableRow:{
137
- type: Boolean,
138
- default: false
139
- }
149
+ import ViGridField from "./ViGridField.vue";
150
+ import ViGridCheckbox from "./fields/ViGridCheckbox.vue";
151
+ import {computed, ref, watch} from 'vue'
152
+ import useColumns from "./composables/useColumns.js";
153
+ import useRowHelper from "./composables/useRowHelper.js";
154
+ import useSort from "./composables/useSort.js";
155
+ import usePagination from "./composables/usePagination.js";
156
+ import ViGridHeadCell from "./ViGridHeadCell.vue";
157
+ import useRowSelect from "./composables/useRowSelect.js";
158
+ import ViGridHeadColumnCell from "./ViGridHeadColumnCell.vue";
159
+ import useSettings from "./composables/useSettings.js";
160
+
161
+ export default {
162
+ name: "ViGridBuilder",
163
+ components: {ViGridHeadColumnCell, ViGridHeadCell, ViGridCheckbox, ViGridField},
164
+ props: {
165
+
166
+ rows: {
167
+ type: Array,
168
+ },
169
+ rowKey: {
170
+ type: String,
171
+ },
172
+ columns: {
173
+ type: Array,
174
+ required: true
175
+ },
176
+ title: {
177
+ type: String
178
+ },
179
+ align: {
180
+ type: String,
181
+ },
182
+ pagination: {
183
+ type: Object,
184
+ // default: function () {
185
+ // return {
186
+ // page: 1,
187
+ // rowsPerPage: 10,
188
+ // sortBy: null,
189
+ // // rowsNumber:10
190
+ // }
191
+ // }
140
192
  },
141
- data: () => ({search: null, isFetchingData: false}),
142
- computed: {
143
- isServerSide() {
144
- return this.fetchServerData!==undefined;
145
- },
146
- totalRows() {
147
- return this.rowsNumber ?? this.rows.length;
148
- },
149
- currentVisibleRows() {
150
- if (this.isServerSide || this.disablePagination) {
151
- return this.rows;
152
- }
153
193
 
154
- const startIndex = (this.pagination.page - 1) * this.pagination.rowsPerPage;
155
- const endIndex = startIndex + this.pagination.rowsPerPage;
156
194
 
157
- return this.rows.slice(startIndex, endIndex)
158
- },
159
- isDataLoading() {
160
- return this.loading || this.isFetchingData;
161
- }
195
+ disablePagination: {
196
+ type: Boolean,
197
+ default:undefined
162
198
  },
163
- methods: {
164
- formatPagination(pagination){
165
- return {
166
- page: pagination.page,
167
- rowsPerPage: pagination.rowsPerPage,
168
- sortBy: pagination.sortBy
169
- }
170
- },
171
- fetchData({pagination, filter, search} = {}) {
172
- const paginationData = pagination ?? this.pagination;
173
- this.isFetchingData = true;
174
- return this.fetchServerData({
199
+ fetchServerData: {
200
+ type: Function
201
+ },
202
+ fetchOnInit: {
203
+ type: Boolean,
204
+ default: true
205
+ },
206
+ filter: {
207
+ type: Object
208
+ },
209
+ loading: {
210
+ type: Boolean,
211
+ default: false
212
+ },
213
+ //todo document this
214
+
215
+ noDataLabel: {
216
+ type: String,
217
+ },
218
+ noCellDataLabel: {
219
+ type: String,
220
+ // default: '/'
221
+ },
222
+ //todo document this
223
+ clickableRow: {
224
+ type: Boolean,
225
+ default: false
226
+ },
227
+ selectable: {
228
+ type: Boolean,
229
+ default: false
230
+ },
231
+ serverMode: {
232
+ type: Boolean,
233
+ default: true
234
+ },
235
+
236
+ //STYLE PROPS
237
+ stripped: {
238
+ type: Boolean,
239
+ default:undefined
240
+ },
241
+ bordered: {
242
+ type: Boolean,
243
+ default:undefined
244
+ },
245
+ compactPagination: {
246
+ type: Boolean,
247
+ default: undefined
248
+ },
249
+ rowsPerPageOptions: {
250
+ type: Array
251
+ },
252
+ },
253
+
254
+ setup(props, {emit}) {
255
+ let search = ref(null);
256
+ let rowMenuOpened = ref(null);
257
+
258
+ // FETCH DATA METHODS
259
+ let isFetchingData = ref(false);
260
+ const fetchData = ({pagination, filter, search} = {}) => {
261
+ const paginationData = pagination ?? props.pagination;
262
+ isFetchingData.value = true;
263
+ return props.fetchServerData({
175
264
  ...paginationData && {
176
- pagination: this.formatPagination(paginationData)
265
+ // pagination: this.formatPagination(paginationData)
266
+ pagination: paginationData
177
267
  },
178
268
 
179
- filter: filter ?? this.filter,
180
- search: search ?? this.search,
269
+ filter: filter ?? props.filter,
270
+ search: search ?? props.search,
181
271
  })
182
- .finally(() => this.isFetchingData = false)
183
- },
184
- onPaginationChange(pagination) {
185
- const newPagination = {
186
- ...this.pagination,
187
- ...pagination
188
- };
189
- this.$emit('pagination-change', this.formatPagination(newPagination));
190
- if (this.isServerSide) {
191
- this.fetchData({pagination: newPagination})
192
- }
193
- },
194
- onRowClicked(row){
195
- if (this.clickableRow) {
196
- this.$emit('rowClicked',row)
197
- }
198
- },
199
- refreshData(){
200
- this.fetchData()
201
- },
202
- goToFirstPage(){
203
- this.fetchData({
204
- pagination:{
205
- ...this.pagination,
206
- page:1
272
+ .finally(() => isFetchingData.value = false)
273
+ };
274
+
275
+ //COLUMN COMPUTED VALUES
276
+ const {visibleColumns, totalColumns} = useColumns(props);
277
+
278
+ //SORTING
279
+ const {
280
+ setSortFieldsFromPagination,
281
+ getSortableState,
282
+ clientSort,
283
+ setSortFields,
284
+ sortField,
285
+ sortDirection,
286
+ formatSortFields,
287
+ } = useSort(props);
288
+
289
+ setSortFieldsFromPagination(props.pagination);
290
+
291
+ const {localPagination, onPaginationChange} = usePagination(props, emit, fetchData)
292
+
293
+ watch([sortField, sortDirection], () => {
294
+ if (props.serverMode) {
295
+ fetchData({
296
+ pagination: {
297
+ ...props.pagination,
298
+ page: 1,
299
+ sortBy: formatSortFields(),
207
300
  }
208
301
  })
209
- },
210
-
211
- },
212
- created() {
213
- if (this.isServerSide && this.fetchOnInit) {
214
- this.fetchData()
215
- }
216
- },
217
- watch:{
218
- filter:{
219
- handler: function (newValue, oldValue) {
220
- this.fetchData()
221
- },
222
- deep:true,
302
+ } else {
303
+ localPagination.value = {
304
+ ...localPagination.value,
305
+ page: 1,
306
+ }
223
307
  }
308
+ });
309
+
310
+ //ROW SELECT, CLICK AND COMPUTED VALUES
311
+ const {currentVisibleRows, totalRows, onRowClicked} = useRowHelper(props, emit, clientSort);
312
+ const {
313
+ selectedRows,
314
+ toggleMasterSelect,
315
+ toggleRowSelect,
316
+ areAllRowsSelected,
317
+ isRowSelected
318
+ } = useRowSelect(props, emit);
319
+
320
+
321
+ const isDataLoading = computed(() => {
322
+ return props.loading || isFetchingData.value;
323
+ });
324
+
325
+ if (props.serverMode && props.fetchOnInit) {
326
+ fetchData()
327
+ }
328
+
329
+ const {settings} = useSettings(props)
330
+
331
+ return {
332
+ search,
333
+ isFetchingData,
334
+ totalRows,
335
+ currentVisibleRows,
336
+ visibleColumns,
337
+ totalColumns,
338
+ selectedRows,
339
+ toggleMasterSelect,
340
+ areAllRowsSelected,
341
+ toggleRowSelect,
342
+ setSortFields,
343
+ fetchData,
344
+ isDataLoading,
345
+ onRowClicked,
346
+ isRowSelected,
347
+ getSortableState,
348
+
349
+ localPagination,
350
+ onPaginationChange,
351
+ rowMenuOpened,
352
+ settings
224
353
  }
225
- }
354
+ },
355
+
356
+ // methods: {
357
+ // // formatPagination(pagination) {
358
+ // // return {
359
+ // // page: pagination.page,
360
+ // // rowsPerPage: pagination.rowsPerPage,
361
+ // // sortBy: pagination.sortBy
362
+ // // }
363
+ // // },
364
+ //
365
+ //
366
+ //
367
+
368
+
369
+ //
370
+ //
371
+ //
372
+ // },
373
+
374
+ // watch: {
375
+ // filter: {
376
+ // handler: function (newValue, oldValue) {
377
+ // this.fetchData()
378
+ // },
379
+ // deep: true,
380
+ // }
381
+ // },
382
+
383
+ }
226
384
  </script>
227
385
 
228
386
  <style lang="scss">
229
- @import "./ViGridBuilder.scss";
387
+ @import "./ViGridBuilder.scss";
388
+
389
+
230
390
  </style>
@@ -1,2 +1 @@
1
- .vi-grid-field {
2
- }
1
+
@@ -7,6 +7,9 @@
7
7
  :value="filedValueFormatted"
8
8
  :original-value="fieldValue"
9
9
  :row="rowValue"
10
+ :row-key="rowKey"
11
+ :row-menu-opened="rowMenuOpened"
12
+ @update:rowMenuOpened="$emit('update:rowMenuOpened',$event)"
10
13
  @actionClicked="$action => $emit(`action-clicked`, $action)"
11
14
 
12
15
  />
@@ -14,9 +17,9 @@
14
17
  :field="field"
15
18
  :value="fieldValue"
16
19
  :original-value="fieldValue"
17
- :row="rowValue">
18
- </slot>
19
-
20
+ :row="rowValue"
21
+ :row-key="rowKey"
22
+ />
20
23
  </div>
21
24
  </template>
22
25
 
@@ -54,6 +57,8 @@
54
57
  },
55
58
  fieldValue: {},
56
59
  rowValue: {},
60
+ rowKey: String,
61
+ rowMenuOpened: {},
57
62
  noDataLabel: {
58
63
  type: String,
59
64
  default: '/'
@@ -64,12 +69,14 @@
64
69
  return this.fieldValue ?? this.noDataLabel
65
70
  },
66
71
  fieldComponent() {
67
- let component = uppercaseFirstLetter(snakeToCamel(this.field.type))
72
+ let type = this.field.type ? `vi-grid-${this.field.type}` : 'vi-grid-text'
73
+
74
+ let component = uppercaseFirstLetter(snakeToCamel(type))
68
75
 
69
76
  if (this.$options.components[component]) {
70
- return this.field.type
77
+ return type
71
78
  } else {
72
- return null
79
+ return false;
73
80
  }
74
81
  }
75
82
  },