# j-Notifications

> j-Notifications: fácil de usar; singleton

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: pt
Content-SHA256: cd41b0a5a6020fe0af4c352c36950874b0511ad62e3403519f8b52bf72fcda1e
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- Singularidade

__Configuração__:

- `date` {String} um formato de data (default `yyyy-MM-dd HH:mm`)
- `timeout` {Número} deve conter um tempo (millisecundos) para a expiração da notificação (default: `8000`)
- `native` {Boolean} permite notificações nativas quando a janela não é focada (default: `false`)

__Métodos__
- `component.append(icon, message, [datetime], [callback], [color])` para criar uma nova notificação

Use-o com `<ui-component name="notifications">`Quando o componente ainda não está carregado, jComponent Descarrega-o no primeiro uso do endereço `DEF.fallback` (a partir do Componentator CDN por padrão). autor: Peter Širka. fonte: o Componentator Reserva de componentes, licença MIT.

```html example.html
<style>
	body { font-family: Arial; background-color: #F5F5F5; }
</style>

<ui-component name="notifications" config="date:dd.MM.yyyy HH:mm;native:true"></ui-component>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quia harum accusamus debitis aut sunt, deserunt magni alias neque unde reprehenderit ipsa ea laboriosam eveniet! Distinctio pariatur sed, a aut nobis.

<script>

	FIND('notifications', function(component) {
		component.append('ti-lightbulb', 'This is a new notification component.');
	});

	setTimeout(function() {
		FIND('notifications').append('ti-calendar', 'You have a meeting in the Central Park.', function() {
			alert('You clicked on the notification');
		}, 'red');
	}, 3000);

	setTimeout(function() {
		FIND('notifications').append('ti-github', 'Please support <a href="https://github.com/petersirka/jComponent" target="_blank">jComponent on GitHub</a>.');
	}, 6000);

	setTimeout(function() {
		FIND('notifications').append('ti-link', 'Total.js is node.js web application framework, please support it on social networks.');
	}, 10000);

</script>
```
