@blackcube/aurelia-kit 1.0.0-rc2 → 1.0.0-rc4
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 +35 -1
- 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
|
@@ -187,7 +187,8 @@ resolve(IEventAggregator).publish(Channels.Modal, <IModal>{ action: ModalAction.
|
|
|
187
187
|
```
|
|
188
188
|
|
|
189
189
|
- `Open` (or `Toggle` when closed) with neither `url` nor `content` opens the dialog on its default slot; its `title`
|
|
190
|
-
and `color` are kept on the element for the frame (`$host.title`, `$host.color`) until it is closed.
|
|
190
|
+
and `color` are kept on the element for the frame (`$host.title`, `$host.color`) until it is closed. The `title` is
|
|
191
|
+
also the accessible name of the `<dialog>` (`aria-label`).
|
|
191
192
|
- A form of the default slot is not posted by the element: it belongs to the page that projects it.
|
|
192
193
|
- `ModalStatus.Closed` with the `id` tells the page the dialog is closed (its route can be left).
|
|
193
194
|
|
|
@@ -333,6 +334,39 @@ Publishes one toast on click. Rendered by `Bleet::toast()->…->trigger()` as at
|
|
|
333
334
|
|
|
334
335
|
Options: `id`, `color`, `icon`, `title`, `content`, `duration`.
|
|
335
336
|
|
|
337
|
+
### `<bleet-toaster>` (SPA)
|
|
338
|
+
|
|
339
|
+
The toaster of a SPA, where the application's templates render the markup: the same channel, the same payload and the
|
|
340
|
+
same state classes as the `bleet-toaster` attribute, but each toast is rendered by Aurelia from the markup the
|
|
341
|
+
application projects into the element. The element holds no markup and no class of its own: its template only repeats
|
|
342
|
+
its default slot, once per toast, the toast exposed as `$host`.
|
|
343
|
+
|
|
344
|
+
```html
|
|
345
|
+
<bleet-toaster popover="manual" class="fixed inset-auto top-4 right-0 … flex flex-col gap-4 pointer-events-none">
|
|
346
|
+
<div data-toaster-id.bind="$host.id"
|
|
347
|
+
class="… translate-x-full opacity-0 transition-all duration-500"
|
|
348
|
+
data-toaster-show="translate-x-0 opacity-100"
|
|
349
|
+
data-toaster-hide="translate-x-full opacity-0">
|
|
350
|
+
… ${$host.title} … <div innerhtml.bind="$host.content"></div> …
|
|
351
|
+
<button type="button" click.trigger="$host.close($event)">…</button>
|
|
352
|
+
</div>
|
|
353
|
+
</bleet-toaster>
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
| `$host` (`IToastView`) | Meaning |
|
|
357
|
+
|---|---|
|
|
358
|
+
| `id`, `color`, `icon`, `title`, `content`, `duration` | the published toast, with the defaults of the attribute |
|
|
359
|
+
| `close(event)` | closes the toast (its button) |
|
|
360
|
+
|
|
361
|
+
Behavior:
|
|
362
|
+
|
|
363
|
+
- The root of the projected toast carries `data-toaster-id="${$host.id}"`: once rendered, its hide classes are
|
|
364
|
+
swapped for its show classes; `close()`, `ToasterAction.Remove` or the end of its `duration` swap them back, then the
|
|
365
|
+
toast leaves the list once the transition ends.
|
|
366
|
+
- With `popover="manual"` on the element, it is shown again on each toast and hidden once the last one is gone, as the
|
|
367
|
+
attribute's container.
|
|
368
|
+
- The texts, the icons and the classes are the application's: its i18n, its icon component, its theme.
|
|
369
|
+
|
|
336
370
|
## Alerts
|
|
337
371
|
|
|
338
372
|
### `bleet-alert`
|