structra-ui 0.1.32 → 0.1.33
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 +11 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,60 +1,35 @@
|
|
|
1
1
|
# structra-ui
|
|
2
2
|
|
|
3
|
-
Biblioteca **Angular 21**
|
|
3
|
+
Biblioteca **Angular 21** (componentes Structra). Exemplos: [StructraLab](https://structralab.com/).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Instalação
|
|
8
|
-
|
|
9
|
-
**Com npm 7 ou superior** (recomendado): um comando instala a lib e, em geral, os **peer dependencies** na raiz do projeto.
|
|
5
|
+
## Instalar
|
|
10
6
|
|
|
11
7
|
```bash
|
|
12
8
|
npm install structra-ui
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
Na maioria dos casos (npm 7+) o npm já instala junto o que a lib pede, **incluindo AG Grid**.
|
|
12
|
+
|
|
13
|
+
Se o grid não instalar ou der erro ao usar tabela: instale explicitamente:
|
|
16
14
|
|
|
17
15
|
```bash
|
|
18
|
-
npm install structra-ui ag-grid-community ag-grid-angular
|
|
16
|
+
npm install structra-ui ag-grid-community ag-grid-angular
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## AG Grid (grelhas)
|
|
24
|
-
|
|
25
|
-
Os componentes de **grelha** da lib dependem de **`ag-grid-community`** e **`ag-grid-angular`**. Sem estes pacotes, o build ou o runtime podem falhar ao usar esses componentes.
|
|
26
|
-
|
|
27
|
-
Além disso, o AG Grid 33+ exige **registar os módulos Community uma vez** na aplicação, antes de montar qualquer grelha. Exemplo mínimo (por exemplo em `main.ts`, antes de `bootstrapApplication`):
|
|
19
|
+
E **uma vez** na aplicação, antes de abrir qualquer grid:
|
|
28
20
|
|
|
29
21
|
```ts
|
|
30
22
|
import { AllCommunityModule, ModuleRegistry } from 'ag-grid-community';
|
|
31
|
-
|
|
32
23
|
ModuleRegistry.registerModules([AllCommunityModule]);
|
|
33
24
|
```
|
|
34
25
|
|
|
35
|
-
## Estilos
|
|
36
|
-
|
|
37
|
-
Ao importar algo de `structra-ui` em runtime (por exemplo `import { TextFieldComponent } from 'structra-ui'`), o tema global (Material, tokens, AG Grid, ícones, Roboto, etc.) entra pelo ficheiro publicado `structra-ui.css`. Não é obrigatório repetir isso no `angular.json` → `styles`.
|
|
38
|
-
|
|
39
|
-
**Nota:** `import type { … } from 'structra-ui'` não carrega o CSS do tema — usa um import de valor ou `import 'structra-ui/styles'`.
|
|
26
|
+
## Estilos
|
|
40
27
|
|
|
41
|
-
|
|
28
|
+
Importe a lib em código (ex.: `import { TextFieldComponent } from 'structra-ui'`). O tema global acompanha — não precisa copiar CSS no `angular.json` por causa disso.
|
|
42
29
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npm run lib:build
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Gera `dist/structra-ui/` pronto para `npm pack` / `npm publish`. Não uses só `ng build structra-ui` para publicar: o tema global completa-se nesse script.
|
|
50
|
-
|
|
51
|
-
## Uso rápido
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
import { TextFieldComponent } from 'structra-ui';
|
|
55
|
-
```
|
|
30
|
+
## Quem publica a lib
|
|
56
31
|
|
|
57
|
-
|
|
32
|
+
Na raiz do monorepo: `npm run lib:build` (não use só `ng build structra-ui`).
|
|
58
33
|
|
|
59
34
|
## Licença
|
|
60
35
|
|