@1doc/1ds-vue 2.22.0 → 2.24.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1doc/1ds-vue",
3
- "version": "2.22.0",
3
+ "version": "2.24.0",
4
4
  "main": "dist/index.umd.js",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -34,7 +34,7 @@
34
34
  "vue": "^3.0.0",
35
35
  "vue-tsc": "^2.0.0",
36
36
  "@1doc/1ds-tokens": "0.9.0",
37
- "@1doc/1ds-core": "2.22.0"
37
+ "@1doc/1ds-core": "2.24.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@1doc/1ds-tokens": ">=0.8.0",
package/src/index.ts CHANGED
@@ -31,6 +31,7 @@ export { default as AttachmentCard } from "./components/AttachmentCard/Attachmen
31
31
  export { default as Avatar } from "./components/Avatar/Avatar.vue";
32
32
  export { default as AvatarGroup } from "./components/Avatar/AvatarGroup.vue";
33
33
  export { default as Badge } from "./components/Badge/Badge.vue";
34
+ export { default as BadgeGroup } from "./components/Badge/BadgeGroup.vue";
34
35
  export { default as BarChart } from "./components/Chart/BarChart.vue";
35
36
  export { default as BottomNavigation } from "./components/BottomNavigation/BottomNavigation.vue";
36
37
  export { default as BottomSheet } from "./components/BottomSheet/BottomSheet.vue";
@@ -38,6 +39,8 @@ export { default as Box } from "./components/Box/Box.vue";
38
39
  export { default as Breadcrumb } from "./components/Breadcrumb/Breadcrumb.vue";
39
40
  export { default as Button } from "./components/Button/Button.vue";
40
41
  export { default as Card } from "./components/Card/Card.vue";
42
+ export { default as CardList } from "./components/CardList/CardList.vue";
43
+ export { default as CardListRow } from "./components/CardList/CardListRow.vue";
41
44
  export { default as Checkbox } from "./components/Checkbox/Checkbox.vue";
42
45
  export { default as Chips } from "./components/Chips/Chips.vue";
43
46
  export { default as ColorPicker } from "./components/ColorPicker/ColorPicker.vue";
@@ -52,6 +55,8 @@ export { default as DonutChart } from "./components/Chart/DonutChart.vue";
52
55
  export { default as Drawer } from "./components/Drawer/Drawer.vue";
53
56
  export { default as Dropdown } from "./components/Dropdown/Dropdown.vue";
54
57
  export { default as EmptyState } from "./components/EmptyState/EmptyState.vue";
58
+ export { default as FieldGroup } from "./components/FieldGroup/FieldGroup.vue";
59
+ export { default as FieldGroupItem } from "./components/FieldGroup/FieldGroupItem.vue";
55
60
  export { default as FileInput } from "./components/FileInput/FileInput.vue";
56
61
  export { default as Grid } from "./components/Grid/Grid.vue";
57
62
  export { default as Icon } from "./components/Icon/Icon.vue";
@@ -129,6 +134,7 @@ export type * from "./components/AttachmentCard/AttachmentCard.vue";
129
134
  export type * from "./components/Avatar/Avatar.vue";
130
135
  export type * from "./components/Avatar/AvatarGroup.vue";
131
136
  export type * from "./components/Badge/Badge.vue";
137
+ export type * from "./components/Badge/BadgeGroup.vue";
132
138
  export type * from "./components/Chart/BarChart.vue";
133
139
  export type * from "./components/BottomNavigation/BottomNavigation.vue";
134
140
  export type * from "./components/BottomSheet/BottomSheet.vue";
@@ -136,6 +142,8 @@ export type * from "./components/Box/Box.vue";
136
142
  export type * from "./components/Breadcrumb/Breadcrumb.vue";
137
143
  export type * from "./components/Button/Button.vue";
138
144
  export type * from "./components/Card/Card.vue";
145
+ export type * from "./components/CardList/CardList.vue";
146
+ export type * from "./components/CardList/CardListRow.vue";
139
147
  export type * from "./components/Checkbox/Checkbox.vue";
140
148
  export type * from "./components/Chips/Chips.vue";
141
149
  export type * from "./components/ColorPicker/ColorPicker.vue";
@@ -150,6 +158,8 @@ export type * from "./components/Chart/DonutChart.vue";
150
158
  export type * from "./components/Drawer/Drawer.vue";
151
159
  export type * from "./components/Dropdown/Dropdown.vue";
152
160
  export type * from "./components/EmptyState/EmptyState.vue";
161
+ export type * from "./components/FieldGroup/FieldGroup.vue";
162
+ export type * from "./components/FieldGroup/FieldGroupItem.vue";
153
163
  export type * from "./components/FileInput/FileInput.vue";
154
164
  export type * from "./components/Grid/Grid.vue";
155
165
  export type * from "./components/Icon/Icon.vue";
@@ -0,0 +1,30 @@
1
+ /** Chips: color e startIcon (slot #start-icon) no Vue GERADO. */
2
+ import { test, before, after } from "node:test";
3
+ import assert from "node:assert/strict";
4
+ import { abrir, fechar, carregar, renderizar } from "./renderizar.mjs";
5
+
6
+ let Chips;
7
+
8
+ before(async () => {
9
+ await abrir();
10
+ Chips = await carregar("Chips/Chips.vue");
11
+ });
12
+ after(fechar);
13
+
14
+ test("Chips: color escreve a custom property e a classe; sem color, nada", async () => {
15
+ const comCor = await renderizar(Chips, { label: "Marcador", color: "#7B2CBF" });
16
+ assert.match(comCor, /umds-chip--cor-livre/);
17
+ assert.match(comCor, /--umds-chips-cor:\s*#7B2CBF/);
18
+ const semCor = await renderizar(Chips, { label: "Marcador" });
19
+ assert.doesNotMatch(semCor, /umds-chip--cor-livre|--umds-chips-cor/);
20
+ });
21
+
22
+ test("Chips: startIcon por string vira Icon; slot #start-icon sem a prop também entra", async () => {
23
+ const porProp = await renderizar(Chips, { label: "x", startIcon: ["fas", "tag"], size: "lg" });
24
+ assert.match(porProp, /umds-chip__start/);
25
+ assert.match(porProp, /font-size:\s*14px/);
26
+ const porSlot = await renderizar(Chips, { label: "x" }, { "start-icon": "<b>•</b>" });
27
+ assert.match(porSlot, /umds-chip__start/);
28
+ const sem = await renderizar(Chips, { label: "x" });
29
+ assert.doesNotMatch(sem, /umds-chip__start/);
30
+ });
@@ -0,0 +1,44 @@
1
+ /** Pagination: hasNext, loadingTotal, from/to e o total vindo de totalItems no Vue GERADO. */
2
+ import { test, before, after } from "node:test";
3
+ import assert from "node:assert/strict";
4
+ import { abrir, fechar, carregar, renderizar } from "./renderizar.mjs";
5
+
6
+ let Pagination;
7
+
8
+ before(async () => {
9
+ await abrir();
10
+ Pagination = await carregar("Pagination/Pagination.vue");
11
+ });
12
+ after(fechar);
13
+
14
+ test("Pagination: sem hasNext e sem total, continua 'de 1' (hasNext ausente não vira false)", async () => {
15
+ const html = await renderizar(Pagination, { page: 1 });
16
+ assert.match(html, /umds-pagination__total">1</);
17
+ });
18
+
19
+ test("Pagination: hasNext some com o 'de N' e libera o próximo", async () => {
20
+ const html = await renderizar(Pagination, { variant: "alternative", page: 2, hasNext: true });
21
+ assert.doesNotMatch(html, /umds-pagination__of/);
22
+ const botoes = html.match(/<button[^>]*>/g);
23
+ assert.equal(botoes.filter((b) => / disabled/.test(b)).length, 0);
24
+ });
25
+
26
+ test("Pagination: só totalItems libera o próximo e a última página mostra 41-45", async () => {
27
+ const primeira = await renderizar(Pagination, { variant: "resumed", page: 1, pageSize: 20, totalItems: 45 });
28
+ assert.equal((primeira.match(/<button[^>]* disabled/g) || []).length, 1); // só o anterior
29
+ const ultima = await renderizar(Pagination, { variant: "resumed", page: 3, pageSize: 20, totalItems: 45 });
30
+ assert.match(ultima, /41-45 de 45/);
31
+ });
32
+
33
+ test("Pagination: loadingTotal põe o Skeleton com aria-busy e rótulo", async () => {
34
+ const html = await renderizar(Pagination, { variant: "resumed", page: 2, hasNext: true, loadingTotal: true });
35
+ assert.match(html, /21-40 de</);
36
+ assert.match(html, /aria-busy="true"/);
37
+ assert.match(html, /umds-skeleton/);
38
+ assert.match(html, /Carregando total/);
39
+ });
40
+
41
+ test("Pagination: from/to vencem o calculado", async () => {
42
+ const html = await renderizar(Pagination, { variant: "resumed", page: 3, hasNext: false, from: 41, to: 45 });
43
+ assert.match(html, /umds-pagination__range">41-45</);
44
+ });