@@ -240,168 +240,22 @@ import useRows from '../hooks/useRows';
240240import useServerOptions from ' ../hooks/useServerOptions' ;
241241import useTotalItems from ' ../hooks/useTotalItems' ;
242242
243- import type {
244- SortType , Header , Item , ServerOptions , FilterOption ,
245- HeaderItemClassNameFunction , BodyItemClassNameFunction , BodyRowClassNameFunction ,
246- } from ' ../types/main' ;
247-
243+ import type { Header , Item } from ' ../types/main' ;
248244import type { HeaderForRender } from ' ../types/internal' ;
249245
250246// eslint-disable-next-line import/extensions
251247import { generateColumnContent } from ' ../utils' ;
248+ import withOptionalProps from ' ../withOptionalProps' ;
252249
253250const props = defineProps ({
254- alternating: {
255- type: Boolean ,
256- default: false ,
257- },
258- buttonsPagination: {
259- type: Boolean ,
260- default: false ,
261- },
262- checkboxColumnWidth: {
263- type: Number ,
264- default: null ,
265- },
266- emptyMessage: {
267- type: String ,
268- default: ' No Available Data' ,
269- },
270- expandColumnWidth: {
271- type: Number ,
272- default: 36 ,
273- },
274- filterOptions: {
275- type: Array as PropType <FilterOption []>,
276- default: null ,
277- },
278- fixedExpand: {
279- type: Boolean ,
280- default: false ,
281- },
282- fixedHeader: {
283- type: Boolean ,
284- default: true ,
285- },
286- fixedCheckbox: {
287- type: Boolean ,
288- default: false ,
289- },
290- fixedIndex: {
291- type: Boolean ,
292- default: false ,
293- },
294- headers: {
295- type: Array as PropType <Header []>,
296- required: true ,
297- },
298- hideFooter: {
299- type: Boolean ,
300- default: false ,
301- },
302- hideRowsPerPage: {
303- type: Boolean ,
304- default: false ,
305- },
306- hideHeader: {
307- type: Boolean ,
308- default: false ,
309- },
310- indexColumnWidth: {
311- type: Number ,
312- default: 60 ,
313- },
251+ ... withOptionalProps ,
314252 items: {
315253 type: Array as PropType <Item []>,
316254 required: true ,
317255 },
318- itemsSelected: {
319- type: Array as PropType <Item []> | null ,
320- default: null ,
321- },
322- loading: {
323- type: Boolean ,
324- deault: false ,
325- },
326- rowsPerPage: {
327- type: Number ,
328- default: 25 ,
329- },
330- rowsItems: {
331- type: Array as PropType <number []>,
332- default : () => [25 , 50 , 100 ],
333- },
334- rowsPerPageMessage: {
335- type: String ,
336- default: ' rows per page:' ,
337- },
338- searchField: {
339- type: String ,
340- default: ' ' ,
341- },
342- searchValue: {
343- type: String ,
344- default: ' ' ,
345- },
346- serverOptions: {
347- type: Object as PropType <ServerOptions > | null ,
348- default: null ,
349- },
350- serverItemsLength: {
351- type: Number ,
352- default: 0 ,
353- },
354- showIndex: {
355- type: Boolean ,
356- default: false ,
357- },
358- sortBy: {
359- type: String ,
360- default: ' ' ,
361- },
362- sortType: {
363- type: String as PropType <SortType >,
364- default: ' asc' ,
365- },
366- tableHeight: {
367- type: Number ,
368- default: null ,
369- },
370- themeColor: {
371- type: String ,
372- default: ' #42b883' ,
373- },
374- tableClassName: {
375- type: String ,
376- default: ' ' ,
377- },
378- headerClassName: {
379- type: String ,
380- default: ' ' ,
381- },
382- headerItemClassName: {
383- type: [Function , String ] as PropType <HeaderItemClassNameFunction | string >,
384- default: ' ' ,
385- },
386- bodyRowClassName: {
387- type: [Function , String ] as PropType <BodyRowClassNameFunction | string >,
388- default: ' ' ,
389- },
390- bodyItemClassName: {
391- type: [Function , String ] as PropType <BodyItemClassNameFunction | string >,
392- default: ' ' ,
393- },
394- noHover: {
395- type: Boolean ,
396- default: false ,
397- },
398- borderCell: {
399- type: Boolean ,
400- default: false ,
401- },
402- mustSort: {
403- type: Boolean ,
404- default: false ,
256+ headers: {
257+ type: Array as PropType <Header []>,
258+ required: true ,
405259 },
406260});
407261
0 commit comments