gridular 1.0.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/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/index.d.mts +1493 -0
- package/dist/index.d.ts +1493 -0
- package/dist/index.js +14617 -0
- package/dist/index.mjs +14598 -0
- package/package.json +101 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Gridular Data Grid
|
|
2
|
+
|
|
3
|
+
Gridular is a flexible and customizable data grid component for React applications. It provides features such as sorting, filtering, pagination, and row selection, making it easy to display and manage tabular data.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Sorting**: Easily sort data by clicking on column headers.
|
|
8
|
+
- **Filtering**: Filter data using a user-friendly filter menu for each column.
|
|
9
|
+
- **Pagination**: Navigate through large datasets with pagination controls.
|
|
10
|
+
- **Row Selection**: Select rows for actions or data manipulation.
|
|
11
|
+
- **Column Resizing**: Adjust column widths to fit your data needs.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
To install Gridular, use npm or yarn:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install gridular
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
or
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
yarn add gridular
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
To use the DataGrid component, import it into your React component:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { DataGrid } from 'gridular/components/data-grid';
|
|
33
|
+
|
|
34
|
+
const MyComponent = () => {
|
|
35
|
+
const columns = [
|
|
36
|
+
{ id: 'name', header: 'Name' },
|
|
37
|
+
{ id: 'age', header: 'Age' },
|
|
38
|
+
// Add more columns as needed
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
const data = [
|
|
42
|
+
{ id: 1, name: 'John Doe', age: 28 },
|
|
43
|
+
{ id: 2, name: 'Jane Smith', age: 34 },
|
|
44
|
+
// Add more data as needed
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
return <DataGrid columns={columns} data={data} />;
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Components
|
|
52
|
+
|
|
53
|
+
- **DataGrid**: The main component that renders the grid.
|
|
54
|
+
- **FilterMenu**: A component for filtering data in the grid.
|
|
55
|
+
- **Pagination**: A component for managing pagination controls.
|
|
56
|
+
- **TableBody**: Renders the rows of the data grid.
|
|
57
|
+
- **TableCell**: Represents individual cells in the data grid.
|
|
58
|
+
- **TableHeader**: Renders the header of the data grid.
|
|
59
|
+
- **TableRow**: Represents individual rows in the data grid.
|
|
60
|
+
|
|
61
|
+
## Custom Hooks
|
|
62
|
+
|
|
63
|
+
Gridular also provides custom hooks for managing various functionalities:
|
|
64
|
+
|
|
65
|
+
- **useColumnResize**: For managing column resizing.
|
|
66
|
+
- **useFiltering**: For managing filtering logic.
|
|
67
|
+
- **usePagination**: For managing pagination logic.
|
|
68
|
+
- **useRowSelection**: For managing row selection.
|
|
69
|
+
- **useSorting**: For managing sorting logic.
|
|
70
|
+
|
|
71
|
+
## Contributing
|
|
72
|
+
|
|
73
|
+
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
This project is licensed under the MIT License. See the LICENSE file for details.
|