Skip to content

Commit

Permalink
refactor(c-table): added description on c-table for accessibility (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinTh authored Oct 15, 2023
1 parent 88b8818 commit 95a01d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui/c-table/c-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import _ from 'lodash';
import type { HeaderConfiguration } from './c-table.types';
const props = withDefaults(defineProps<{ data?: Record<string, unknown>[]; headers?: HeaderConfiguration ; hideHeaders?: boolean }>(), { data: () => [], headers: undefined, hideHeaders: false });
const props = withDefaults(defineProps<{ data?: Record<string, unknown>[]; headers?: HeaderConfiguration ; hideHeaders?: boolean; description?: string }>(), { data: () => [], headers: undefined, hideHeaders: false, description: 'Data table' });
const { data, headers: rawHeaders, hideHeaders } = toRefs(props);
const headers = computed(() => {
Expand Down Expand Up @@ -38,7 +38,7 @@ const headers = computed(() => {

<template>
<div class="relative overflow-x-auto rounded">
<table class="w-full border-collapse text-left text-sm text-gray-500 dark:text-gray-400">
<table class="w-full border-collapse text-left text-sm text-gray-500 dark:text-gray-400" :description="description" role="table">
<thead v-if="!hideHeaders" class="bg-#ffffff uppercase text-gray-700 dark:bg-#333333 dark:text-gray-400">
<tr>
<th v-for="header in headers" :key="header.key" scope="col" class="px-6 py-3 text-xs">
Expand Down

1 comment on commit 95a01d4

@vercel
Copy link

@vercel vercel bot commented on 95a01d4 Oct 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

it-tools – ./

it-tools.vercel.app
it-tools.tech
it-tools-git-main-ctmsst.vercel.app
it-tools-ctmsst.vercel.app

Please sign in to comment.