# adt-js-components

> JavaScript components for Nette framework

Latest version **2.0.3** (published 2026-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install adt-js-components
pnpm add adt-js-components
yarn add adt-js-components
bun add adt-js-components
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2026-07-16 |
| First published | 2021-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 17 |
| Unpacked size | 72.3 KB |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Apps Dev Team |
| Maintainers | appsdevteam |

## Links

- npm: https://www.npmjs.com/package/adt-js-components
- Repository: https://github.com/AppsDevTeam/js-components
- Homepage: https://github.com/AppsDevTeam/js-components#readme
- Issues: https://github.com/AppsDevTeam/js-components/issues
- npm.io page: https://npm.io/package/adt-js-components

## Dependencies (17)

- [leaflet](https://npm.io/package/leaflet.md) ^1.9.4
- [select2](https://npm.io/package/select2.md) ^4.0.13
- [tinymce](https://npm.io/package/tinymce.md) ^5.7.0
- [firebase](https://npm.io/package/firebase.md) ^12.10.0
- [flatpickr](https://npm.io/package/flatpickr.md) ^4.6.3
- [glightbox](https://npm.io/package/glightbox.md) ^3.0.7
- [timepicker](https://npm.io/package/timepicker.md) ^1.13.4
- [autonumeric](https://npm.io/package/autonumeric.md) ^4.6.0
- [scrollparent](https://npm.io/package/scrollparent.md) ^2.0.1
- [tinymce-i18n](https://npm.io/package/tinymce-i18n.md) ^20.12.25
- [nette.ajax.js](https://npm.io/package/nette.ajax.js.md) ^2.3.0
- [script-loader](https://npm.io/package/script-loader.md) ^0.7.2
- [@here/flexpolyline](https://npm.io/package/@here/flexpolyline.md) ^0.1.0
- [@firebase/messaging](https://npm.io/package/@firebase/messaging.md) ^0.12.24
- [leaflet.markercluster](https://npm.io/package/leaflet.markercluster.md) ^1.5.3
- [@googlemaps/js-api-loader](https://npm.io/package/@googlemaps/js-api-loader.md) ^1.11.1
- [select2-bootstrap-5-theme](https://npm.io/package/select2-bootstrap-5-theme.md) ^1.1.1

## Recent versions

- 2.0.3 (latest) — 2026-07-16
- 2.0.1 — 2026-06-29
- 2.0.0 — 2026-06-27
- 1.11.3 — 2026-04-10
- 1.11.2 — 2026-04-08
- 1.11.1 — 2026-04-08
- 1.11.0 — 2026-04-06
- 1.10.10 — 2026-03-26
- 1.10.9 — 2026-03-26
- 1.10.8 — 2026-03-25
- 1.10.7 — 2026-03-19
- 1.10.6 — 2026-03-18
- 1.10.5 — 2026-03-16
- 1.10.4 — 2026-03-16
- 1.10.3 — 2026-03-16
- … 64 more at https://npm.io/package/adt-js-components/versions

## README

# ADT JS Components

## Installation

```
yarn add adt-js-components
```

## Usage

```
import AdtJsComponents from 'adt-js-components'
```

## Configuration

JsComponentsConfig.php and in config.neon `services.jsComponents`

## Generic component

For example, there's an ExampleForm located in /app/Components/Forms/ExampleForm

1. Create your own data selector, for example `example-form`.
2. Attribute `data-adt-example-form` must be included in your HTML.
3. `path` starts at /app but excludes it, so it will be `Components/Forms/ExampleForm`
4. In `/app/Components/Forms/ExampleForm` create `index.js` with

```
const run = (options) => {
    ... your code ...
};

export default { run };
```

5. In your project JS (`app.js`) add

```
AdtJsComponents.init('example-form', 'Components/Forms/ExampleForm');
```

6. Example of `resolve` in your project `webpack.config.js`, if all applications js modules are relatively to `app`.

```
resolve: {
	modules: ['node_modules'],
	alias: {
		JsComponents: path.resolve(__dirname, 'app')
	}
}
```


## Predefined components

### Currency Input

Attribute `data-adt-currency-input` must be included in your HTML!

```
AdtJsComponents.initCurrencyInput();
```

### Date Input

Attribute `data-adt-date-input` must be included in your HTML!

```
AdtJsComponents.initDateInput();
```

### Recaptcha

Attribute `data-adt-recaptcha` must be included in your HTML!

```
AdtJsComponents.initRecaptcha();
```

### Select 2

Attribute `data-adt-select2` must be included in your HTML!

```
AdtJsComponents.initSelect2();
```

### Submit Form

Attribute `data-adt-submit-form` must be included in your HTML!

```
AdtJsComponents.initSubmitForm();
```

On each submit before and after callback can be added.
Before callback is invoked before submit and form is not submitted if the function return false.
After callback is invoked after successed submit.

```html
<script>
	function myConfirm() {
		return confirm('Do you realy want to submit the form?');
	}
	function myAlert() {
		alert('Data was saved.');
	}
</script>

<button ... data-adt-submit-form-before-callback="myConfirm" data-adt-submit-form-after-callback="myAlert">Submit</button>
```

### Ajax Select

Attribute `data-adt-ajax-select` must be included in your HTML!

```
AdtJsComponents.initAjaxSelect();
```

### Input Clear

Attribute `data-adt-input-clear` must be included in your HTML!

The option `selector` have to be set to select inputs to clear.

The option `confirmMessage` can be set to clear confirmation.

```
AdtJsComponents.initInputClear();
```

```html
<div data-adt-input-clear="{selector: '.input-clear-all', confirmMessage: 'Do you really want to clear all inputs?'}">Clear all</div>
<div data-adt-input-clear="{selector: '.input-clear-special'}">Clear special</div>

<input type="text" name="input1" class="input-clear-all input-clear-special">
<input type="text" name="input2" class="input-clear-all">
<input type="text" name="input3" class="input-clear-all input-clear-special">
```

---
_Source: https://npm.io/package/adt-js-components · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
