structra-ui 0.1.25 → 0.1.27
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 +9 -7
- package/package.json +6 -5
- package/structra-ui.scss +2 -0
- package/structra-ui.css +0 -939
package/README.md
CHANGED
|
@@ -21,23 +21,26 @@ 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 inclui **`structra-ui.
|
|
24
|
+
O pacote inclui **só um ficheiro de tema:** **`structra-ui.scss`**. É o resultado de compilar o `styles.scss` do monorepo (tokens, Material, AG Grid, CDK, etc.): por dentro é **CSS já resolvido**, mas a extensão é **`.scss`** para alinhar com projetos que só usam SCSS no `angular.json`. Sem este ficheiro na lista `styles`, a UI fica sem estilos.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
**`angular.json`:** no **início** de `projects.<app>.architect.build.options.styles`:
|
|
27
27
|
|
|
28
28
|
```json
|
|
29
29
|
"styles": [
|
|
30
|
-
"node_modules/structra-ui/structra-ui.
|
|
30
|
+
"node_modules/structra-ui/structra-ui.scss",
|
|
31
|
+
"src/styles.scss"
|
|
31
32
|
]
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
**`main.ts` (alternativa):** antes de `bootstrapApplication`:
|
|
35
36
|
|
|
36
37
|
```ts
|
|
37
38
|
import 'structra-ui/styles';
|
|
38
39
|
```
|
|
39
40
|
|
|
40
|
-
(
|
|
41
|
+
(Exige `moduleResolution` compatível com `exports` do npm, por exemplo `bundler` ou `node16`.)
|
|
42
|
+
|
|
43
|
+
**Se Material ou AG Grid parecerem «sem tema»** num projeto consumidor: confirme que usa uma versão da lib construída com `npm run lib:build`. O ficheiro `structra-ui.scss` tem de trazer **todo** o CSS (incluindo prebuilt Material e folhas AG Grid) **embutido** — versões antigas do bundle deixavam `@import` para pacotes npm, que **não resolvem** dentro de `node_modules/structra-ui/`.
|
|
41
44
|
|
|
42
45
|
**AG Grid 35+:** registe os módulos Community uma vez na app (ex. `ModuleRegistry.registerModules([AllCommunityModule])` em `main.ts`).
|
|
43
46
|
|
|
@@ -49,10 +52,9 @@ A entrada publicada é **`src/structra-public-api.ts`** na raiz do monorepo (ver
|
|
|
49
52
|
|
|
50
53
|
```bash
|
|
51
54
|
npm run lib:build
|
|
52
|
-
# ou: npx ng build structra-ui
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
|
|
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 compila `src/styles.scss` para `structra-ui.scss`.
|
|
56
58
|
|
|
57
59
|
## Uso
|
|
58
60
|
|
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "structra-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
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.
|
|
8
|
+
"structra-ui.scss"
|
|
9
9
|
],
|
|
10
10
|
"files": [
|
|
11
11
|
"fesm2022/",
|
|
12
12
|
"types/",
|
|
13
|
-
"structra-ui.
|
|
13
|
+
"structra-ui.scss",
|
|
14
14
|
"README.md",
|
|
15
15
|
"package.json"
|
|
16
16
|
],
|
|
17
17
|
"exports": {
|
|
18
|
-
"./structra-ui.
|
|
19
|
-
"./styles": "./structra-ui.
|
|
18
|
+
"./structra-ui.scss": "./structra-ui.scss",
|
|
19
|
+
"./styles": "./structra-ui.scss",
|
|
20
|
+
"./global.scss": "./structra-ui.scss",
|
|
20
21
|
"./package.json": {
|
|
21
22
|
"default": "./package.json"
|
|
22
23
|
},
|