structra-ui 0.1.27 → 0.1.28
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 +14 -5
- package/package.json +5 -2
- package/structra-ui.css +2 -0
- package/structra-ui.scss +4 -2
package/README.md
CHANGED
|
@@ -21,9 +21,9 @@ Se usar **npm 6 ou anterior**, instale explicitamente os mesmos pacotes e versõ
|
|
|
21
21
|
|
|
22
22
|
## Estilos globais (obrigatório)
|
|
23
23
|
|
|
24
|
-
O pacote
|
|
24
|
+
O pacote publica **`structra-ui.css`** (tema completo: tokens, Material, AG Grid, CDK, etc.) e **`structra-ui.scss`**, que só faz `@include meta.load-css('structra-ui.css')` — **o mesmo ficheiro CSS na pasta do pacote**. Isto evita colocar centenas de KB de CSS comprimido num único `.scss`, situação em que alguns builds do Angular no projeto consumidor **deixam de aplicar** os estilos globais.
|
|
25
25
|
|
|
26
|
-
**`angular.json`:** no **início** de `projects.<app>.architect.build.options.styles
|
|
26
|
+
**`angular.json`:** no **início** de `projects.<app>.architect.build.options.styles`, use **uma** destas entradas (ambas válidas):
|
|
27
27
|
|
|
28
28
|
```json
|
|
29
29
|
"styles": [
|
|
@@ -32,15 +32,24 @@ O pacote inclui **só um ficheiro de tema:** **`structra-ui.scss`**. É o result
|
|
|
32
32
|
]
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
ou, se o projeto aceitar `.css` na lista:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
"styles": [
|
|
39
|
+
"node_modules/structra-ui/structra-ui.css",
|
|
40
|
+
"src/styles.scss"
|
|
41
|
+
]
|
|
42
|
+
```
|
|
43
|
+
|
|
35
44
|
**`main.ts` (alternativa):** antes de `bootstrapApplication`:
|
|
36
45
|
|
|
37
46
|
```ts
|
|
38
47
|
import 'structra-ui/styles';
|
|
39
48
|
```
|
|
40
49
|
|
|
41
|
-
(
|
|
50
|
+
(isso resolve para `structra-ui.css` via `exports` do pacote. Exige `moduleResolution` compatível, por exemplo `bundler` ou `node16`.)
|
|
42
51
|
|
|
43
|
-
**
|
|
52
|
+
**Checklist se «não há estilos nenhuns»:** (1) linha acima no **início** de `styles`; (2) pacote instalado com **`npm run lib:build`** antes de publicar (não publique só `ng build structra-ui`); (3) **duas** entradas no npm — `structra-ui.css` e `structra-ui.scss` — têm de existir lado a lado em `node_modules/structra-ui/` (o `.scss` não funciona sem o `.css`).
|
|
44
53
|
|
|
45
54
|
**AG Grid 35+:** registe os módulos Community uma vez na app (ex. `ModuleRegistry.registerModules([AllCommunityModule])` em `main.ts`).
|
|
46
55
|
|
|
@@ -54,7 +63,7 @@ A entrada publicada é **`src/structra-public-api.ts`** na raiz do monorepo (ver
|
|
|
54
63
|
npm run lib:build
|
|
55
64
|
```
|
|
56
65
|
|
|
57
|
-
Gera `dist/structra-ui/` (JavaScript + tipos + **`structra-ui.scss`**). **Não use só `ng build structra-ui`** para publicar: esse comando **não** gera o tema global; o `npm run lib:build` corre o ng-packagr e depois
|
|
66
|
+
Gera `dist/structra-ui/` (JavaScript + tipos + **`structra-ui.css`** + **`structra-ui.scss`** ponte). **Não use só `ng build structra-ui`** para publicar: esse comando **não** gera o tema global; o `npm run lib:build` corre o ng-packagr e depois gera o CSS e a ponte SCSS.
|
|
58
67
|
|
|
59
68
|
## Uso
|
|
60
69
|
|
package/package.json
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "structra-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
4
4
|
"description": "Biblioteca de componentes Angular da StructraLab (UI reutilizável).",
|
|
5
5
|
"homepage": "https://structralab.com/",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"sideEffects": [
|
|
8
|
+
"structra-ui.css",
|
|
8
9
|
"structra-ui.scss"
|
|
9
10
|
],
|
|
10
11
|
"files": [
|
|
11
12
|
"fesm2022/",
|
|
12
13
|
"types/",
|
|
14
|
+
"structra-ui.css",
|
|
13
15
|
"structra-ui.scss",
|
|
14
16
|
"README.md",
|
|
15
17
|
"package.json"
|
|
16
18
|
],
|
|
17
19
|
"exports": {
|
|
20
|
+
"./structra-ui.css": "./structra-ui.css",
|
|
18
21
|
"./structra-ui.scss": "./structra-ui.scss",
|
|
19
|
-
"./styles": "./structra-ui.
|
|
22
|
+
"./styles": "./structra-ui.css",
|
|
20
23
|
"./global.scss": "./structra-ui.scss",
|
|
21
24
|
"./package.json": {
|
|
22
25
|
"default": "./package.json"
|