tanstack-shadcn-table
Version:
A powerful, feature-rich React table component built on top of TanStack Table v8 with shadcn/ui styling. Optimized bundle size with 55% reduction through peer dependencies.
123 lines (122 loc) • 3.48 kB
TypeScript
/**
* Internationalization (i18n) support for the table library
*/
export interface TableTranslations {
pagination: {
previous: string;
next: string;
first: string;
last: string;
page: string;
of: string;
rowsPerPage: string;
goToPage: string;
totalRecords: string;
showingXtoYofZ: string;
noData: string;
};
filters: {
search: string;
searchAllColumns: string;
showFilter: string;
hideFilter: string;
clearFilter: string;
clearAllFilters: string;
filterBy: string;
all: string;
true: string;
false: string;
min: string;
max: string;
from: string;
to: string;
selectOption: string;
noOptionsFound: string;
};
sorting: {
sortAscending: string;
sortDescending: string;
clearSort: string;
sortBy: string;
};
columns: {
hide: string;
show: string;
toggleVisibility: string;
resetColumns: string;
reorderColumns: string;
resizeColumn: string;
};
selection: {
selectAll: string;
selectRow: string;
deselectAll: string;
selectedCount: string;
selectAllOnPage: string;
selectAllRows: string;
};
status: {
loading: string;
error: string;
noResults: string;
retry: string;
loadMore: string;
};
security: {
rateLimitExceeded: string;
invalidInput: string;
fileSizeExceeded: string;
fileTypeNotAllowed: string;
inputTooLong: string;
};
accessibility: {
sortColumn: string;
filterColumn: string;
selectAllRows: string;
selectRow: string;
columnHeader: string;
tableCaption: string;
resizeHandle: string;
dragHandle: string;
};
}
export declare const defaultTranslations: TableTranslations;
export declare const turkishTranslations: TableTranslations;
export declare const spanishTranslations: TableTranslations;
export declare const frenchTranslations: TableTranslations;
export declare const germanTranslations: TableTranslations;
export declare const availableLanguages: {
readonly en: {
readonly name: "English";
readonly translations: TableTranslations;
};
readonly tr: {
readonly name: "Türkçe";
readonly translations: TableTranslations;
};
readonly es: {
readonly name: "Español";
readonly translations: TableTranslations;
};
readonly fr: {
readonly name: "Français";
readonly translations: TableTranslations;
};
readonly de: {
readonly name: "Deutsch";
readonly translations: TableTranslations;
};
};
export type SupportedLanguage = keyof typeof availableLanguages;
/**
* Simple template string replacement
*/
export declare function interpolate(template: string, values: Record<string, string | number>): string;
/**
* Get translation with interpolation support
*/
export declare function t(translations: TableTranslations, path: string, values?: Record<string, string | number>): string;
/**
* Create a translation function bound to specific translations
*/
export declare function createTranslator(translations: TableTranslations): (path: string, values?: Record<string, string | number>) => string;