@tooark/angular 1.0.0 → 1.1.0
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/.npmignore +2 -0
- package/README.md +12 -9
- package/README.pt-BR.md +12 -9
- package/fesm2022/tooark-angular.mjs +236 -199
- package/fesm2022/tooark-angular.mjs.map +1 -1
- package/package.json +3 -3
- package/types/tooark-angular.d.ts +69 -45
package/.npmignore
ADDED
package/README.md
CHANGED
|
@@ -27,19 +27,22 @@ Standalone Angular wrappers for the Tooark Web Components: `@Input()`s for the a
|
|
|
27
27
|
The `@tooark/angular` package provides:
|
|
28
28
|
|
|
29
29
|
- one standalone component per element (`ArkButtonComponent`, `ArkInputComponent`, `ArkDialogComponent`, …) with the `<ark-*-wrapper>` selector and `CUSTOM_ELEMENTS_SCHEMA`;
|
|
30
|
-
- `@Input()`s bound to the element's attributes (`[attr.*]`), object inputs serialized for you (`events`, `
|
|
31
|
-
- `@Output()`s re-emitting the custom events (`
|
|
30
|
+
- `@Input()`s bound to the element's attributes (`[attr.*]`), object inputs serialized for you (`events`, `options`, and `localeJson` on the calendar and datepicker; elsewhere `localeJson` is a JSON string), and the key/value editor's `rows` assigned as a property;
|
|
31
|
+
- `@Output()`s re-emitting the custom events (`arkClose`, `arkSelect`, `changed`, …) as the original `CustomEvent` or, on the calendar, clock, datepicker, carousel and scheduler (`arkChange`, `arkSlideChange`, `arkEventClick`, …), its `detail`;
|
|
32
32
|
- registration in each wrapper constructor, skipped without `customElements` — SSR and Angular Universal safe;
|
|
33
|
-
- built with ng-packagr in partial Ivy: works in AOT production builds
|
|
33
|
+
- built with ng-packagr in partial Ivy: works in AOT production builds;
|
|
34
|
+
- `toast`, `showToast`, `dismissToast` re-exported from `@tooark/core`.
|
|
34
35
|
|
|
35
36
|
---
|
|
36
37
|
|
|
37
38
|
## 🔧 Installation
|
|
38
39
|
|
|
39
40
|
```bash
|
|
40
|
-
pnpm add @tooark/angular
|
|
41
|
+
pnpm add @tooark/angular @tooark/web-components
|
|
41
42
|
```
|
|
42
43
|
|
|
44
|
+
`@tooark/angular` already brings `@tooark/web-components`, `@tooark/core` and `@tooark/tokens`; add `@tooark/web-components` to your own dependencies as well, because `angular.json` points at its stylesheet and package managers with isolated dependencies (pnpm) do not place transitive packages at the root of your `node_modules`.
|
|
45
|
+
|
|
43
46
|
Peer dependencies: `@angular/core` and `@angular/common` ≥ 21.2.19 (the workspace's security floor).
|
|
44
47
|
|
|
45
48
|
---
|
|
@@ -59,8 +62,8 @@ Add the stylesheet to `angular.json` (or import it from your global `styles.css`
|
|
|
59
62
|
|
|
60
63
|
One standalone component per element: `ark-button` → `ArkButtonComponent` (`<ark-button-wrapper>`), `ark-kv-editor` → `ArkKvEditorComponent` (`<ark-kv-editor-wrapper>`), and so on.
|
|
61
64
|
|
|
62
|
-
- Inputs: the element's attributes in camelCase (`iconOnly`, `stepMinutes`, `localeJson`) plus `ariaLabel
|
|
63
|
-
- Outputs: the custom events in camelCase (`(arkClose)` on the dialog and drawer, `(arkSelect)` on the menu and palette, `(changed)` on the select and the key/value editor, `(arkEventClick)`/`(arkSlotClick)`/`(arkViewChange)`/`(arkRangeChange)` on the scheduler
|
|
65
|
+
- Inputs: the element's attributes in camelCase (`iconOnly`, `stepMinutes`, `localeJson`) plus `ariaLabel` on the input, textarea, select, checkbox, radio, switch, toggle, color-swatches, shape-picker, button, copy-button, avatar, dialog, drawer, command palette and menu; object inputs where they matter (`events`, `rows`, `options`).
|
|
66
|
+
- Outputs: the custom events in camelCase (`(arkClose)` on the dialog and drawer, `(arkSelect)` on the menu and palette, `(changed)` on the select and the key/value editor, …) delivering the `CustomEvent`; `(arkChange)` on the calendar, clock and datepicker, `(arkSlideChange)` on the carousel and `(arkEventClick)`/`(arkSlotClick)`/`(arkViewChange)`/`(arkRangeChange)` on the scheduler deliver the `detail` itself; native events bubble from the inner control (`(input)` on the input: read `$any($event.target).value`).
|
|
64
67
|
- State: attributes like `open` are the source of truth (`[open]="bool"` + `(arkClose)`).
|
|
65
68
|
- Raw `ark-*` tags (side packages): add `schemas: [CUSTOM_ELEMENTS_SCHEMA]` to your component and call the `registerTooark*()` function in the browser.
|
|
66
69
|
|
|
@@ -80,8 +83,8 @@ import {
|
|
|
80
83
|
ArkInputComponent,
|
|
81
84
|
ArkSelectComponent,
|
|
82
85
|
ArkToasterComponent,
|
|
86
|
+
toast,
|
|
83
87
|
} from "@tooark/angular";
|
|
84
|
-
import { toast } from "@tooark/core";
|
|
85
88
|
|
|
86
89
|
@Component({
|
|
87
90
|
selector: "app-profile-form",
|
|
@@ -161,8 +164,8 @@ Installed automatically unless marked as peer; peer dependencies are yours to in
|
|
|
161
164
|
|
|
162
165
|
| Package | Version | Description |
|
|
163
166
|
| -------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------- |
|
|
164
|
-
| [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.
|
|
165
|
-
| [`@tooark/web-components`](https://www.npmjs.com/package/@tooark/web-components) | ^1.
|
|
167
|
+
| [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.1.0 | Types, i18n, toast/announce services, motion and overlay helpers |
|
|
168
|
+
| [`@tooark/web-components`](https://www.npmjs.com/package/@tooark/web-components) | ^1.1.0 | The `ark-*` Custom Elements and their stylesheet |
|
|
166
169
|
| [`tslib`](https://www.npmjs.com/package/tslib) | ^2.8.1 | TypeScript runtime helpers |
|
|
167
170
|
| [`@angular/common`](https://www.npmjs.com/package/@angular/common) | >=21.2.19 (peer) | Angular common |
|
|
168
171
|
| [`@angular/core`](https://www.npmjs.com/package/@angular/core) | >=21.2.19 (peer) | Angular core (security floor of the workspace) |
|
package/README.pt-BR.md
CHANGED
|
@@ -27,19 +27,22 @@ Wrappers Angular standalone dos Tooark Web Components: `@Input()` para os atribu
|
|
|
27
27
|
O pacote `@tooark/angular` fornece:
|
|
28
28
|
|
|
29
29
|
- um componente standalone por elemento (`ArkButtonComponent`, `ArkInputComponent`, `ArkDialogComponent`, …) com o seletor `<ark-*-wrapper>` e `CUSTOM_ELEMENTS_SCHEMA`;
|
|
30
|
-
- `@Input()` ligados aos atributos do elemento (`[attr.*]`), inputs de objeto serializados
|
|
31
|
-
- `@Output()` reemitindo os eventos customizados (`
|
|
30
|
+
- `@Input()` ligados aos atributos do elemento (`[attr.*]`), inputs de objeto serializados para você (`events`, `options` e o `localeJson` do calendário e do datepicker; nos demais o `localeJson` é uma string JSON), e as `rows` do editor chave/valor atribuídas como propriedade;
|
|
31
|
+
- `@Output()` reemitindo os eventos customizados (`arkClose`, `arkSelect`, `changed`, …) como o `CustomEvent` original ou, no calendário, relógio, datepicker, carrossel e agenda (`arkChange`, `arkSlideChange`, `arkEventClick`, …), o `detail` dele;
|
|
32
32
|
- registro no construtor de cada wrapper, pulado sem `customElements` — seguro para SSR e Angular Universal;
|
|
33
|
-
- compilado com ng-packagr em Ivy parcial: funciona em builds AOT de produção
|
|
33
|
+
- compilado com ng-packagr em Ivy parcial: funciona em builds AOT de produção;
|
|
34
|
+
- `toast`, `showToast`, `dismissToast` reexportados do `@tooark/core`.
|
|
34
35
|
|
|
35
36
|
---
|
|
36
37
|
|
|
37
38
|
## 🔧 Instalação
|
|
38
39
|
|
|
39
40
|
```bash
|
|
40
|
-
pnpm add @tooark/angular
|
|
41
|
+
pnpm add @tooark/angular @tooark/web-components
|
|
41
42
|
```
|
|
42
43
|
|
|
44
|
+
O `@tooark/angular` já traz `@tooark/web-components`, `@tooark/core` e `@tooark/tokens`; adicione o `@tooark/web-components` também às suas dependências, porque o `angular.json` aponta para a folha de estilo dele e gerenciadores com dependências isoladas (pnpm) não colocam pacotes transitivos na raiz do seu `node_modules`.
|
|
45
|
+
|
|
43
46
|
Peer dependencies: `@angular/core` e `@angular/common` ≥ 21.2.19 (o piso de segurança do workspace).
|
|
44
47
|
|
|
45
48
|
---
|
|
@@ -59,8 +62,8 @@ Adicione a folha de estilo ao `angular.json` (ou importe-a do seu `styles.css` g
|
|
|
59
62
|
|
|
60
63
|
Um componente standalone por elemento: `ark-button` → `ArkButtonComponent` (`<ark-button-wrapper>`), `ark-kv-editor` → `ArkKvEditorComponent` (`<ark-kv-editor-wrapper>`), e assim por diante.
|
|
61
64
|
|
|
62
|
-
- Inputs: os atributos do elemento em camelCase (`iconOnly`, `stepMinutes`, `localeJson`) mais `ariaLabel
|
|
63
|
-
- Outputs: os eventos customizados em camelCase (`(arkClose)` no dialog e no drawer, `(arkSelect)` no menu e na paleta, `(changed)` no select e no editor chave/valor, `(arkEventClick)`/`(arkSlotClick)`/`(arkViewChange)`/`(arkRangeChange)` na agenda
|
|
65
|
+
- Inputs: os atributos do elemento em camelCase (`iconOnly`, `stepMinutes`, `localeJson`) mais `ariaLabel` no input, textarea, select, checkbox, radio, switch, toggle, color-swatches, shape-picker, button, copy-button, avatar, dialog, drawer, paleta de comandos e menu; inputs de objeto onde importam (`events`, `rows`, `options`).
|
|
66
|
+
- Outputs: os eventos customizados em camelCase (`(arkClose)` no dialog e no drawer, `(arkSelect)` no menu e na paleta, `(changed)` no select e no editor chave/valor, …) entregando o `CustomEvent`; `(arkChange)` no calendário, no relógio e no datepicker, `(arkSlideChange)` no carrossel e `(arkEventClick)`/`(arkSlotClick)`/`(arkViewChange)`/`(arkRangeChange)` na agenda entregam o próprio `detail`; eventos nativos sobem do controle interno (`(input)` no input: leia `$any($event.target).value`).
|
|
64
67
|
- Estado: atributos como `open` são a fonte da verdade (`[open]="bool"` + `(arkClose)`).
|
|
65
68
|
- Tags `ark-*` cruas (pacotes laterais): adicione `schemas: [CUSTOM_ELEMENTS_SCHEMA]` ao seu componente e chame a função `registerTooark*()` no navegador.
|
|
66
69
|
|
|
@@ -80,8 +83,8 @@ import {
|
|
|
80
83
|
ArkInputComponent,
|
|
81
84
|
ArkSelectComponent,
|
|
82
85
|
ArkToasterComponent,
|
|
86
|
+
toast,
|
|
83
87
|
} from "@tooark/angular";
|
|
84
|
-
import { toast } from "@tooark/core";
|
|
85
88
|
|
|
86
89
|
@Component({
|
|
87
90
|
selector: "app-formulario-perfil",
|
|
@@ -161,8 +164,8 @@ Instaladas automaticamente, salvo as marcadas como peer, que ficam por sua conta
|
|
|
161
164
|
|
|
162
165
|
| Pacote | Versão | Descrição |
|
|
163
166
|
| -------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------- |
|
|
164
|
-
| [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.
|
|
165
|
-
| [`@tooark/web-components`](https://www.npmjs.com/package/@tooark/web-components) | ^1.
|
|
167
|
+
| [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.1.0 | Tipos, i18n, serviços de toast/announce, motion e helpers de overlay |
|
|
168
|
+
| [`@tooark/web-components`](https://www.npmjs.com/package/@tooark/web-components) | ^1.1.0 | Os Custom Elements `ark-*` e a folha de estilo deles |
|
|
166
169
|
| [`tslib`](https://www.npmjs.com/package/tslib) | ^2.8.1 | Helpers de runtime do TypeScript |
|
|
167
170
|
| [`@angular/common`](https://www.npmjs.com/package/@angular/common) | >=21.2.19 (peer) | Angular common |
|
|
168
171
|
| [`@angular/core`](https://www.npmjs.com/package/@angular/core) | >=21.2.19 (peer) | Núcleo do Angular (piso de segurança do workspace) |
|