structra-ui 0.1.32 → 0.1.34
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 +12 -35
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,60 +1,37 @@
|
|
|
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
|
-
Com **npm
|
|
11
|
+
Com **npm 7+**, em geral o npm já traz os **peer dependencies** (incluindo AG Grid) junto.
|
|
12
|
+
|
|
13
|
+
Se for usar **grid** e quiser instalar a lib + AG Grid explicitamente (sempre a última versão que o npm resolver):
|
|
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)
|
|
19
|
+
## AG Grid (grid)
|
|
24
20
|
|
|
25
|
-
|
|
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`):
|
|
21
|
+
Registre os módulos Community **uma vez** na app, antes de abrir qualquer grid (exemplo no `main.ts`):
|
|
28
22
|
|
|
29
23
|
```ts
|
|
30
24
|
import { AllCommunityModule, ModuleRegistry } from 'ag-grid-community';
|
|
31
|
-
|
|
32
25
|
ModuleRegistry.registerModules([AllCommunityModule]);
|
|
33
26
|
```
|
|
34
27
|
|
|
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'`.
|
|
40
|
-
|
|
41
|
-
## Build do pacote (mantenedores do monorepo)
|
|
42
|
-
|
|
43
|
-
Na raiz do repositório `web-components`:
|
|
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.
|
|
28
|
+
## Estilos
|
|
50
29
|
|
|
51
|
-
|
|
30
|
+
Importe a lib em código (ex.: `import { TextFieldComponent } from 'structra-ui'`). O tema global acompanha; não precisa repetir CSS no `angular.json` por causa disso.
|
|
52
31
|
|
|
53
|
-
|
|
54
|
-
import { TextFieldComponent } from 'structra-ui';
|
|
55
|
-
```
|
|
32
|
+
## Publicar a lib (monorepo `web-components`)
|
|
56
33
|
|
|
57
|
-
|
|
34
|
+
Na raiz do repositório: `npm run lib:build` (não use só `ng build structra-ui`).
|
|
58
35
|
|
|
59
36
|
## Licença
|
|
60
37
|
|