react-tailwind-table 1.1.2 → 1.2.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.
- package/README.md +57 -0
- package/dist/index.css +97 -55
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/src/table-sub-components.d.ts +5 -2
- package/dist/src/table-types.d.ts +24 -0
- package/package.json +7 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Icolumn, Irow, renderFunction, IPaginated, IPerPage, stringRenderFunc } from "./table-types";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Icolumn, Irow, renderFunction, IPaginated, IPerPage, stringRenderFunc, IpaginationInfo } from "./table-types";
|
|
3
3
|
export interface ItableRow {
|
|
4
4
|
row: Irow;
|
|
5
5
|
columns: Icolumn[];
|
|
@@ -47,6 +47,7 @@ export declare function TableCaption(props: {
|
|
|
47
47
|
}): JSX.Element;
|
|
48
48
|
export declare function TableSearch(props: {
|
|
49
49
|
onSearch: (text: string) => void;
|
|
50
|
+
placeholder: string;
|
|
50
51
|
style: string;
|
|
51
52
|
}): JSX.Element;
|
|
52
53
|
interface IexportProps {
|
|
@@ -72,6 +73,7 @@ export interface ItableActProps {
|
|
|
72
73
|
dropdown_style: string;
|
|
73
74
|
button_style: string;
|
|
74
75
|
button_text: string;
|
|
76
|
+
placeholder: string;
|
|
75
77
|
}
|
|
76
78
|
export declare function TableBulkAction(props: ItableActProps): JSX.Element;
|
|
77
79
|
interface Ifooter {
|
|
@@ -85,6 +87,7 @@ interface Ifooter {
|
|
|
85
87
|
statistics_main_style: string;
|
|
86
88
|
statistics_number_style: string;
|
|
87
89
|
number_box_Style: string;
|
|
90
|
+
pagination_info?: (info: IpaginationInfo) => ReactNode;
|
|
88
91
|
}
|
|
89
92
|
export declare function Footer(props: Ifooter): JSX.Element | null;
|
|
90
93
|
export interface IPageNumberGroup {
|
|
@@ -38,8 +38,32 @@ export interface Iprop {
|
|
|
38
38
|
*/
|
|
39
39
|
export_modify?: stringRenderFunc;
|
|
40
40
|
on_bulk_action?: (selected_option: string, selected: Irow[]) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Placeholder of the search input. Defaults to "SEARCH"
|
|
43
|
+
*/
|
|
44
|
+
search_placeholder?: string;
|
|
45
|
+
/**
|
|
46
|
+
* First (empty) option of the bulk action dropdown. Defaults to "Select ..."
|
|
47
|
+
*/
|
|
48
|
+
bulk_select_placeholder?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Renders the footer statistics text. Defaults to "Showing {from} to {to} of {total} entries"
|
|
51
|
+
*/
|
|
52
|
+
pagination_info?: (info: IpaginationInfo) => ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Text direction of the table. When not set, the direction is inherited from the page (e.g `<html dir="rtl">`)
|
|
55
|
+
*/
|
|
56
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
41
57
|
styling?: ItableStyle;
|
|
42
58
|
}
|
|
59
|
+
export interface IpaginationInfo {
|
|
60
|
+
/** 1-based index of the first row shown on the current page */
|
|
61
|
+
from: number;
|
|
62
|
+
/** 1-based index of the last row shown on the current page */
|
|
63
|
+
to: number;
|
|
64
|
+
/** Total number of rows (after search filtering) */
|
|
65
|
+
total: number;
|
|
66
|
+
}
|
|
43
67
|
export interface ItableStyle {
|
|
44
68
|
base_bg_color?: string;
|
|
45
69
|
base_text_color?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-tailwind-table",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A Responsive Table component Made with React js and Tailwind Css. Has Pagination and search ability.",
|
|
5
5
|
"author": "mklef121",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"node": ">=10"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "NODE_ENV=production microbundle-crl --css-modules
|
|
17
|
-
"start": "microbundle-crl watch
|
|
18
|
-
"
|
|
19
|
-
"test": "run
|
|
20
|
-
"test:build": "run
|
|
16
|
+
"build": "cross-env NODE_ENV=production microbundle-crl --css-modules false --format modern,cjs",
|
|
17
|
+
"start": "microbundle-crl watch --css-modules false --no-compress --format modern,cjs",
|
|
18
|
+
"prepublishOnly": "npm run build",
|
|
19
|
+
"test": "npm run test:unit && npm run test:build",
|
|
20
|
+
"test:build": "npm run build",
|
|
21
21
|
"test:lint": "eslint . --fix",
|
|
22
22
|
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom --coverage=true",
|
|
23
23
|
"test:watch": "react-scripts test --env=jsdom",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"gh-pages": "^2.2.0",
|
|
52
52
|
"microbundle-crl": "^0.13.10",
|
|
53
53
|
"nan": "^2.14.1",
|
|
54
|
-
"npm-run-all": "^4.1.5",
|
|
55
54
|
"postcss": "^7.0.35",
|
|
56
55
|
"postcss-cli": "^7.1.1",
|
|
57
56
|
"prettier": "^2.0.4",
|
|
@@ -64,6 +63,5 @@
|
|
|
64
63
|
},
|
|
65
64
|
"files": [
|
|
66
65
|
"dist"
|
|
67
|
-
]
|
|
68
|
-
"dependencies": {}
|
|
66
|
+
]
|
|
69
67
|
}
|