Skip to content

Commit

Permalink
many optimizations in the project / composer
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwind committed May 30, 2024
1 parent f4b4a2c commit 794f149
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 17 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ Then, include AvalynxTable:

Replace `path/to/avalynx-table.js` and `path/to/avalynx-table.css` with the actual path to the files in your project.

## Installation via jsDelivr
## Installation via jsDelivr ([Link](https://cdn.jsdelivr.net/npm/avalynx-table/))

AvalynxTable is also available via [jsDelivr](https://www.jsdelivr.com/). You can include it in your project like this:

```html
<link href="https://cdn.jsdelivr.net/npm/avalynx-table/dist/avalynx-table.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/avalynx-table/dist/avalynx-table.js"></script>
<link href="https://cdn.jsdelivr.net/npm/avalynx-table@0.0.2/dist/css/avalynx-table.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/avalynx-table@0.0.2/dist/js/avalynx-table.min.js"></script>
```

Make sure to also include Bootstrap's JS/CSS in your project to ensure AvalynxTable displays correctly.

## Installation via NPM
## Installation via NPM ([Link](https://www.npmjs.com/package/avalynx-table))

AvalynxTable is also available as a npm package. You can add it to your project with the following command:

Expand Down Expand Up @@ -79,6 +79,23 @@ import 'avalynx-table/dist/css/avalynx-table.min.css';

Make sure to also include Bootstrap's JS/CSS in your project to ensure AvalynxTable displays correctly.

## Installation via Composer ([Link](https://packagist.org/packages/avalynx/avalynx-table))

AvalynxTable is also available as a Composer package. You can add it to your project with the following command:

```bash
composer require avalynx/avalynx-table
```

After installing, you can import AvalynxTable into your HTML file like this:

```html
<link href="vendor/avalynx/avalynx-table/dist/css/avalynx-table.css" rel="stylesheet">
<script src="vendor/avalynx/avalynx-table/dist/js/avalynx-table.js"></script>
```

Make sure to also include Bootstrap's JS/CSS in your project to ensure AvalynxTable displays correctly.

## Usage

To use AvalynxTable in your project, first ensure you have tables marked up in your HTML. Then, include the AvalynxTable JavaScript file in your project and initialize the class with the appropriate selector.
Expand Down Expand Up @@ -109,7 +126,7 @@ new AvalynxTable('.avalynx-table');

AvalynxTable allows the following options for customization:

- `selector`: (string) The selector to use for targeting tables within the DOM (default: `.avalynx-table`)
- `selector`: (string) The selector to use for targeting tables within the DOM (default: `'.avalynx-table'`).
- `options`: An object containing the following keys: (**coming soon**)

## Contributing
Expand Down
4 changes: 4 additions & 0 deletions __tests__/avalynx-table.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ describe('AvalynxTable', function() {
document.body.appendChild(table);
});

afterEach(() => {
document.body.removeChild(div);
});

it('should initialize with default selector', () => {
const table = new AvalynxTable('.avalynx-table');
console.log(table.tables.length);
Expand Down
30 changes: 30 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "avalynx/avalynx-table",
"description": "AvalynxTable is a simple table system for web applications. Based on Bootstrap >=5.3 without any framework dependencies.",
"keywords": [
"avalynx",
"table",
"bootstrap",
"bootstrap5",
"component",
"stackable",
"responsive"
],
"homepage": "https://github.com/avalynx/avalynx-table",
"license": "MIT",
"authors": [
{
"name": "Juergen Schwind an the AvalynxTable authors",
"homepage": "https://github.com/avalynx/avalynx-table/graphs/contributors"
}
],
"require": {
"twbs/bootstrap": "^5.3"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/avalynx/avalynx-table.git"
}
]
}
5 changes: 3 additions & 2 deletions dist/js/avalynx-table.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* @repository https://github.com/avalynx/avalynx-table.git
* @bugs https://github.com/avalynx/avalynx-table/issues
*
* @param {string} selector - The selector to find the tables
* @param {object} options - The options for the table.
* @param {string} selector - The selector to use for targeting tables within the DOM (default: '.avalynx-table').
* @param {object} options - An object containing the following keys: (*coming soon*)
*
*/

export class AvalynxTable {
Expand Down
5 changes: 3 additions & 2 deletions dist/js/avalynx-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* @repository https://github.com/avalynx/avalynx-table.git
* @bugs https://github.com/avalynx/avalynx-table/issues
*
* @param {string} selector - The selector to find the tables
* @param {object} options - The options for the table.
* @param {string} selector - The selector to use for targeting tables within the DOM (default: '.avalynx-table').
* @param {object} options - An object containing the following keys: (*coming soon*)
*
*/

class AvalynxTable {
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
services:
web:
build: ./docker/web
Expand All @@ -18,4 +17,4 @@ services:
- PHP_MEMORY_LIMIT=512M
- PHP_MAX_EXECUTION_TIME=300
- PHP_POST_MAX_SIZE=100M
- PHP_UPLOAD_MAX_FILESIZE=100M
- PHP_UPLOAD_MAX_FILESIZE=100M
4 changes: 2 additions & 2 deletions examples/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<script>hljs.highlightAll();</script>

<!-- AvalynxTable 0.0.2 -->
<link href="../dist/css/avalynx-table.css" rel="stylesheet">
<script src="../dist/js/avalynx-table.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/avalynx-table.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/avalynx-table.min.js"></script>

<!-- Example helper -->
<link href="./css/helper.css" rel="stylesheet">
Expand Down
5 changes: 3 additions & 2 deletions src/js/avalynx-table.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* @repository https://github.com/avalynx/avalynx-table.git
* @bugs https://github.com/avalynx/avalynx-table/issues
*
* @param {string} selector - The selector to find the tables
* @param {object} options - The options for the table.
* @param {string} selector - The selector to use for targeting tables within the DOM (default: '.avalynx-table').
* @param {object} options - An object containing the following keys: (*coming soon*)
*
*/

export class AvalynxTable {
Expand Down
5 changes: 3 additions & 2 deletions src/js/avalynx-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* @repository https://github.com/avalynx/avalynx-table.git
* @bugs https://github.com/avalynx/avalynx-table/issues
*
* @param {string} selector - The selector to find the tables
* @param {object} options - The options for the table.
* @param {string} selector - The selector to use for targeting tables within the DOM (default: '.avalynx-table').
* @param {object} options - An object containing the following keys: (*coming soon*)
*
*/

class AvalynxTable {
Expand Down

0 comments on commit 794f149

Please sign in to comment.