@blackcube/aurelia-kit 1.0.0-rc2 → 1.0.0-rc3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/index.es.js +625 -400
- package/dist/index.es.js.map +1 -1
- package/dist/types/attributes/toaster.d.ts +0 -5
- package/dist/types/attributes/toaster.d.ts.map +1 -1
- package/dist/types/components/bleet-toaster.d.ts +43 -0
- package/dist/types/components/bleet-toaster.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/toaster.d.ts +25 -0
- package/dist/types/utils/toaster.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -333,6 +333,39 @@ Publishes one toast on click. Rendered by `Bleet::toast()->…->trigger()` as at
|
|
|
333
333
|
|
|
334
334
|
Options: `id`, `color`, `icon`, `title`, `content`, `duration`.
|
|
335
335
|
|
|
336
|
+
### `<bleet-toaster>` (SPA)
|
|
337
|
+
|
|
338
|
+
The toaster of a SPA, where the application's templates render the markup: the same channel, the same payload and the
|
|
339
|
+
same state classes as the `bleet-toaster` attribute, but each toast is rendered by Aurelia from the markup the
|
|
340
|
+
application projects into the element. The element holds no markup and no class of its own: its template only repeats
|
|
341
|
+
its default slot, once per toast, the toast exposed as `$host`.
|
|
342
|
+
|
|
343
|
+
```html
|
|
344
|
+
<bleet-toaster popover="manual" class="fixed inset-auto top-4 right-0 … flex flex-col gap-4 pointer-events-none">
|
|
345
|
+
<div data-toaster-id.bind="$host.id"
|
|
346
|
+
class="… translate-x-full opacity-0 transition-all duration-500"
|
|
347
|
+
data-toaster-show="translate-x-0 opacity-100"
|
|
348
|
+
data-toaster-hide="translate-x-full opacity-0">
|
|
349
|
+
… ${$host.title} … <div innerhtml.bind="$host.content"></div> …
|
|
350
|
+
<button type="button" click.trigger="$host.close($event)">…</button>
|
|
351
|
+
</div>
|
|
352
|
+
</bleet-toaster>
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
| `$host` (`IToastView`) | Meaning |
|
|
356
|
+
|---|---|
|
|
357
|
+
| `id`, `color`, `icon`, `title`, `content`, `duration` | the published toast, with the defaults of the attribute |
|
|
358
|
+
| `close(event)` | closes the toast (its button) |
|
|
359
|
+
|
|
360
|
+
Behavior:
|
|
361
|
+
|
|
362
|
+
- The root of the projected toast carries `data-toaster-id="${$host.id}"`: once rendered, its hide classes are
|
|
363
|
+
swapped for its show classes; `close()`, `ToasterAction.Remove` or the end of its `duration` swap them back, then the
|
|
364
|
+
toast leaves the list once the transition ends.
|
|
365
|
+
- With `popover="manual"` on the element, it is shown again on each toast and hidden once the last one is gone, as the
|
|
366
|
+
attribute's container.
|
|
367
|
+
- The texts, the icons and the classes are the application's: its i18n, its icon component, its theme.
|
|
368
|
+
|
|
336
369
|
## Alerts
|
|
337
370
|
|
|
338
371
|
### `bleet-alert`
|