1.18.0 • Published 3 years ago
@hundh/contao-utils-bundle v1.18.0
Contao Utils Bundle Assets
This package contains the frontend assets of the composer bundle heimrichhannot/contao-utils-bundle.
Install
yarn add @hundh/contao-utils-bundle
Usage
Ajax Util
import AjaxUtil from "@hundh/contao-utils-bundle/js/ajax-util";
let config = {
headers: {'X-Requested-With': 'XMLHttpRequest'},
responseType: undefined, // set XMLHttpRequest.responseType
onSuccess: undefined, //on success callback
onError: undefined, // on error callback
beforeSubmit: undefined, //before submit callback
afterSubmit: undefined // after submit callback
};
/**
* @var {string} url
* @var {FormData|object} data
* @var {Object} config
*/
AjaxUtil.get(url, data, config);
AjaxUtil.post(url, data, config);
Webpack/Encore
Usage example:
import { DomUtil, ArrayUtil } from '@hundh/contao-utils-bundle';
DomUtil.scrollTo(myNode, 100);
Following imports possible:
- ArrayUtil
- DomUtil
- EventUtil
- GeneralUtil
- UrlUtil
- UtilsBundle
UtilsBundle
holds all utilities classes:
- array
- dom
- event
- url
- util
Example usage: UtilsBundle.util.isTruthy(value)
Legacy libraries
If you run the package code at least once, the UtilsBundle
object will be written to window.utilsBundle;
.
Usage example:
let UtilsBundle = window.utilsBundle;
1.18.0
3 years ago
1.17.1
3 years ago
1.17.0
4 years ago
1.16.0
4 years ago
1.15.0
5 years ago
1.14.0
5 years ago
1.13.1
5 years ago
1.13.0
5 years ago
1.12.0
5 years ago
1.11.0
5 years ago
1.10.0
5 years ago
1.9.0
5 years ago
1.8.0
5 years ago
1.7.0
5 years ago
1.6.1
5 years ago
1.6.0
5 years ago
1.5.5
5 years ago
1.5.4
5 years ago
1.5.3
5 years ago
1.5.2
5 years ago
1.5.0
5 years ago