Skip to content

Commit e93166b

Browse files
authored
Feature table responsive (#2)
* Update JavaScript core logic for modularity, optimize DOM interactions, ensure better parameter validation, and streamline loader/spinner handling. Update examples to reference latest script and stylesheet internally. * Add AvalynxTable integration for responsive table features, enhance DOM updates, expand Jest coverage, and bump version to 1.0.2 * Add badges to README, extend examples and language options, increase test coverage to 100%, configure CI with GitHub Actions, and bump version to 1.0.2
1 parent bdd65b5 commit e93166b

18 files changed

Lines changed: 8908 additions & 723 deletions

.github/workflows/tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Use Node.js 20.x
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run tests with coverage
27+
run: npm test -- --coverage
28+
29+
- name: Upload coverage to Codecov
30+
uses: codecov/codecov-action@v4
31+
with:
32+
files: ./coverage/lcov.info
33+
flags: unittests
34+
fail_ci_if_error: true
35+
env:
36+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/.idea/
2-
/node_modules/
2+
/ai.txt
3+
/coverage/
34
/examples/php/demo.db
45
/examples/php/demo2.db
5-
/package-lock.json
6-
/ai.txt
6+
/node_modules/

README.de.md

Lines changed: 316 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# AvalynxDataTable
22

3+
[![npm version](https://img.shields.io/npm/v/avalynx-datatable)](https://www.npmjs.com/package/avalynx-datatable)
4+
[![npm downloads](https://img.shields.io/npm/dt/avalynx-datatable)](https://www.npmjs.com/package/avalynx-datatable)
5+
[![jsDelivr](https://img.shields.io/jsdelivr/npm/hm/avalynx-datatable)](https://www.jsdelivr.com/package/npm/avalynx-datatable)
6+
[![License](https://img.shields.io/npm/l/avalynx-datatable)](LICENSE)
7+
[![Tests](https://github.com/avalynx/avalynx-datatable/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/avalynx/avalynx-datatable/actions/workflows/tests.yml)
8+
[![codecov](https://codecov.io/gh/avalynx/avalynx-datatable/branch/main/graph/badge.svg)](https://codecov.io/gh/avalynx/avalynx-datatable)
9+
[![GitHub stars](https://img.shields.io/github/stars/avalynx/avalynx-datatable?style=flat&logo=github)](https://github.com/avalynx/avalynx-datatable)
10+
311
AvalynxDataTable is a simple, lightweight, and customizable data table component for web applications. It is designed to be used with Bootstrap version 5.3 or higher and does not require any framework dependencies.
412

513
## Features
@@ -19,6 +27,7 @@ Here's a simple example of how to use AvalynxDataTable in your project:
1927
* [DataTable](https://avalynx-datatable.jbs-newmedia.de/examples/datatable.html)
2028
* [DataTable with slow response](https://avalynx-datatable.jbs-newmedia.de/examples/datatable-slow-response.html)
2129
* [DataTable multiple instances](https://avalynx-datatable.jbs-newmedia.de/examples/datatable-multiple-instances.html)
30+
* [DataTable with AvalynxLoader & AvalynxTable Integration](https://avalynx-datatable.jbs-newmedia.de/examples/datatable-loader-table-integration.html)
2231

2332
## Installation
2433

@@ -46,8 +55,8 @@ Replace `path/to/avalynx-datatable.js` and `path/to/avalynx-datatable.css` with
4655
AvalynxDataTable is also available via [jsDelivr](https://www.jsdelivr.com/). You can include it in your project like this:
4756

4857
```html
49-
<link href="https://cdn.jsdelivr.net/npm/avalynx-datatable@1.0.1/dist/css/avalynx-datatable.min.css" rel="stylesheet">
50-
<script src="https://cdn.jsdelivr.net/npm/avalynx-datatable@1.0.1/dist/js/avalynx-datatable.min.js"></script>
58+
<link href="https://cdn.jsdelivr.net/npm/avalynx-datatable@1.0.2/dist/css/avalynx-datatable.min.css" rel="stylesheet">
59+
<script src="https://cdn.jsdelivr.net/npm/avalynx-datatable@1.0.2/dist/js/avalynx-datatable.min.js"></script>
5160
```
5261

5362
Make sure to also include Bootstrap's JS/CSS in your project to ensure AvalynxDataTable displays correctly.
@@ -130,16 +139,38 @@ new AvalynxDataTable("avalynx-datatable", {
130139
"age": "desc"
131140
}
132141
}, {
133-
showLabel: "Zeige",
134-
entriesLabel: "Einträge",
135-
searchLabel: "Suche",
136-
previousLabel: "Zurück",
137-
nextLabel: "Weiter",
138-
showingEntries: (start, end, total) => `Zeige ${start} bis ${end} von ${total} Einträgen`,
139-
showingFilteredEntries: (start, end, filtered, total) => `Zeige ${start} bis ${end} von ${filtered} Einträgen (gefiltert von ${total} Einträgen)`
142+
showLabel: "Show",
143+
entriesLabel: "entries",
144+
searchLabel: "Search",
145+
previousLabel: "Previous",
146+
nextLabel: "Next",
147+
showingEntries: (start, end, total) => `Showing ${start} to ${end} of ${total} entries`,
148+
showingFilteredEntries: (start, end, filtered, total) => `Showing ${start} to ${end} of ${filtered} entries (filtered from ${total} total entries)`
140149
});
141150
```
142151

152+
## Language Reference
153+
154+
The default English labels are:
155+
156+
- `showLabel`: `'Show'`
157+
- `entriesLabel`: `'entries'`
158+
- `searchLabel`: `'Search'`
159+
- `previousLabel`: `'Previous'`
160+
- `nextLabel`: `'Next'`
161+
- `showingEntries`: `(start, end, total) => 'Showing ${start} to ${end} of ${total} entries'`
162+
- `showingFilteredEntries`: `(start, end, filtered, total) => 'Showing ${start} to ${end} of ${filtered} entries (filtered from ${total} total entries)'`
163+
164+
For German, you can use:
165+
166+
- `showLabel`: `'Zeige'`
167+
- `entriesLabel`: `'Einträge'`
168+
- `searchLabel`: `'Suche'`
169+
- `previousLabel`: `'Zurück'`
170+
- `nextLabel`: `'Weiter'`
171+
- `showingEntries`: `(start, end, total) => 'Zeige ${start} bis ${end} von ${total} Einträgen'`
172+
- `showingFilteredEntries`: `(start, end, filtered, total) => 'Zeige ${start} bis ${end} von ${filtered} Einträgen (gefiltert von ${total} Einträgen)'`
173+
143174
## JSON Data Structure
144175

145176
AvalynxDataTable expects data in a specific JSON format to render the table correctly. The JSON object should contain the following fields:

0 commit comments

Comments
 (0)