@@ -243,12 +243,17 @@ import {
243243 Column ,
244244 DrilldownEvent ,
245245 LoadedDrilldown ,
246+ SearchProps ,
247+ SearchPropCols ,
246248 SortItem ,
247249} from ' @/types/types' ;
248250import {
249251 HeadersSlot ,
250252 TfootSlot ,
251253} from ' ./components' ;
254+ import {
255+ DataTableItem ,
256+ } from ' vuetify/dist/vuetify-labs.esm' ;
252257
253258
254259
@@ -262,58 +267,18 @@ const props = defineProps({ ...AllProps });
262267
263268// -------------------------------------------------- Table Settings (WIP) //
264269// Custom Default Props/Options //
265- const customOptions = {
266- // calculateWidths: true,
267- // className: '',
268- // colors: {
269- // body: {
270- // base: '--v-theme-surface',
271- // bg: '--v-theme-surface',
272- // text: '--v-theme-on-surface',
273- // },
274- // default: {
275- // base: 'primary',
276- // bg: 'primary',
277- // border: null,
278- // text: 'on-primary',
279- // },
280- // footer: {
281- // bg: '--v-theme-surface',
282- // text: '--v-theme-on-surface',
283- // },
284- // header: {
285- // bg: 'primary',
286- // text: 'on-primary',
287- // },
288- // percentageChange: 25,
289- // percentageDirection: 'desc',
290- // },
291- debounceDelay: 750 ,
292- // drilldownKey: false,
293- elevation: 1 , // * Works
294- // expandIcon: 'plus-circle',
295- // expandIconType: 'fas',
296- // footerRow: false,
297- // matchHeaderColumnWidths: true,
298- // parentTableRef: '',
299- // ref: 'drilldown',
300- // searchProps: {
301- // cols: {
302- // lg: 3,
303- // md: 6,
304- // sm: 12,
305- // xl: 3,
306- // xs: 12,
307- // xxl: 2,
308- // },
309- // density: 'compact',
310- // variant: 'underlined',
311- // },
312- showSearch: false ,
313- };
270+ // const customOptions = {
271+ // calculateWidths: true,
272+ // className: '',
273+ // expandIcon: 'plus-circle',
274+ // expandIconType: 'fas',
275+ // footerRow: false,
276+ // matchHeaderColumnWidths: true,
277+ // parentTableRef: '',
278+ // ref: 'drilldown',
279+ // };
314280
315281const loadedDrilldown = ref <LoadedDrilldown >({
316- ... customOptions , // * Custom Props
317282 colors: {
318283 body: {
319284 base: ' --v-theme-surface' ,
@@ -339,8 +304,11 @@ const loadedDrilldown = ref<LoadedDrilldown>({
339304 },
340305 customFilter : () => { }, // ? Needs Testing
341306 customKeyFilter: [], // ? Needs Testing
307+ debounceDelay: 750 , // * Custom Prop
342308 // dense: false, // ? Missing in Docs, but is in code base
343- density: ' compact' , // * Works - Missing in Docs
309+ density: ' comfortable' , // * Works - Missing in Docs
310+ drilldownKey: ' ' , // * Custom Prop
311+ elevation: 1 , // * Custom Prop
344312 expandOnClick: false , // * Works
345313 expanded: [], // ? Needs Testing
346314 // filterKeys: [], // ? Needs Testing
@@ -388,6 +356,7 @@ const loadedDrilldown = ref<LoadedDrilldown>({
388356 },
389357 server: false , // ? Needs Testing. This requires v-data-table-server
390358 showExpand: true , // * Works
359+ showSearch: false , // * Custom Prop
391360 showSelect: false , // * Works
392361 sortBy: [], // * Works
393362 width: ' 100%' , // ! Failed
@@ -423,14 +392,13 @@ onMounted(() => {
423392
424393// -------------------------------------------------- Table #
425394const tableClasses = computed <object >(() => {
426- const baseClass = componentName ;
427- const elevation = loadedDrilldown .value .elevation as string ;
395+ const elevation = loadedDrilldown .value .elevation ;
428396
429397 const classes = {
430- [baseClass ]: true ,
431- [` ${baseClass }--level-${loadedDrilldown .value .level } ` ]: true ,
432- [` ${baseClass }--child ` ]: props .isDrilldown ,
433- [` elevation-${elevation } ` ]: parseInt (elevation ) > 0 ,
398+ [` ${ componentName } ` ]: true ,
399+ [` ${componentName }--level-${loadedDrilldown .value .level } ` ]: true ,
400+ [` ${componentName }--child ` ]: props .isDrilldown ,
401+ [` elevation-${elevation } ` ]: parseInt (elevation as string ) > 0 ,
434402 ' pb-2' : true ,
435403 };
436404
@@ -454,7 +422,8 @@ const tableStyles = computed<StyleValue>(() => {
454422
455423// -------------------------------------------------- Top #
456424const searchFieldClasses = computed <object >(() => {
457- const searchCols = loadedDrilldown .value .searchProps .cols ;
425+ const searchProps = loadedDrilldown .value .searchProps as SearchProps ;
426+ const searchCols = searchProps .cols as SearchPropCols ;
458427
459428 const classes = {
460429 [` ${componentName }--search-field ` ]: true ,
@@ -501,7 +470,7 @@ function setLoadedDrilldown(): void {
501470 loadedDrilldown .value = useMergeDeep (loadedDrilldown .value , props );
502471}
503472
504- function renderCellItem(item : object , column : Column , index : number ): unknown {
473+ function renderCellItem(item : DataTableItem , column : Column , index : number ): unknown {
505474 return useRenderCellItem (item .raw , column , index );
506475}
507476
@@ -526,7 +495,7 @@ function drilldownEvent(data: DrilldownEvent): void {
526495// }
527496
528497// ? Probably more useful when using server side
529- function updateItemsPerPage(itemsCount ) {
498+ function updateItemsPerPage(itemsCount : number ) {
530499 loadedDrilldown .value .itemsPerPage = itemsCount ;
531500
532501 return true ;
0 commit comments