@1doc/1ds-vue 2.12.1 → 2.13.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/CHANGELOG.md +29 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.mjs +5588 -5565
- package/dist/index.umd.js +4 -4
- package/package.json +2 -2
- package/src/teste/breadcrumb-truncado.test.mjs +46 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1doc/1ds-vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"main": "dist/index.umd.js",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"vue": "^3.0.0",
|
|
32
32
|
"vue-tsc": "^2.0.0",
|
|
33
33
|
"@1doc/1ds-tokens": "0.7.0",
|
|
34
|
-
"@1doc/1ds-core": "2.
|
|
34
|
+
"@1doc/1ds-core": "2.13.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@1doc/1ds-tokens": ">=0.1.0",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Breadcrumb truncate, conferido no HTML que o Vue GERADO escreve e no CSS da fonte. */
|
|
2
|
+
import { test, before, after } from "node:test";
|
|
3
|
+
import assert from "node:assert/strict";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
import { abrir, fechar, carregar, renderizar } from "./renderizar.mjs";
|
|
7
|
+
|
|
8
|
+
let Breadcrumb;
|
|
9
|
+
|
|
10
|
+
before(async () => {
|
|
11
|
+
await abrir();
|
|
12
|
+
Breadcrumb = await carregar("Breadcrumb/Breadcrumb.vue");
|
|
13
|
+
});
|
|
14
|
+
after(fechar);
|
|
15
|
+
|
|
16
|
+
const ITENS = [
|
|
17
|
+
{ label: "1Doc", href: "#" },
|
|
18
|
+
{ label: "Proc. Administrativo 412/2026", onClick: () => {} },
|
|
19
|
+
{ label: "Reforma da cobertura do Ginásio Poliesportivo Municipal" },
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
test("truncate escreve a classe na raiz; sem a prop, não", async () => {
|
|
23
|
+
assert.match(await renderizar(Breadcrumb, { items: ITENS, truncate: true }), /class="umds-breadcrumb umds-breadcrumb--truncate"/);
|
|
24
|
+
assert.doesNotMatch(await renderizar(Breadcrumb, { items: ITENS }), /umds-breadcrumb--truncate/);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test("com truncate, o rótulo inteiro vai no title de cada item; sem, nenhum title", async () => {
|
|
28
|
+
const com = await renderizar(Breadcrumb, { items: ITENS, truncate: true });
|
|
29
|
+
assert.match(com, /title="1Doc"/);
|
|
30
|
+
assert.match(com, /title="Proc\. Administrativo 412\/2026"/);
|
|
31
|
+
assert.match(com, /title="Reforma da cobertura do Ginásio Poliesportivo Municipal"/);
|
|
32
|
+
assert.doesNotMatch(await renderizar(Breadcrumb, { items: ITENS }), /title=/);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("Breadcrumb CSS: uma linha; a página atual encolhe primeiro até 80px; o padrão segue quebrando linha", () => {
|
|
36
|
+
const t = readFileSync(resolve(process.cwd(), "../core/src/components/Breadcrumb/Breadcrumb.css"), "utf8").replace(/\r\n/g, "\n");
|
|
37
|
+
const bloco = (seletor) => {
|
|
38
|
+
const inicio = t.indexOf(seletor + " {");
|
|
39
|
+
assert.ok(inicio >= 0, seletor);
|
|
40
|
+
return t.slice(inicio, t.indexOf("}", inicio));
|
|
41
|
+
};
|
|
42
|
+
assert.match(bloco(".umds-breadcrumb--truncate .umds-breadcrumb__list"), /flex-wrap:\s*nowrap/);
|
|
43
|
+
assert.match(bloco(".umds-breadcrumb--truncate .umds-breadcrumb__item:last-child"), /flex-shrink:\s*100000;/);
|
|
44
|
+
assert.match(bloco(".umds-breadcrumb--truncate .umds-breadcrumb__item:last-child"), /min-width:\s*var\(--umds-primitive-spacing-xxl\)/);
|
|
45
|
+
assert.match(bloco(".umds-breadcrumb__list"), /flex-wrap:\s*wrap/);
|
|
46
|
+
});
|