vueless 1.3.6-beta.9 → 1.3.7-beta.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 +2 -2
- package/ui.container-drawer/UDrawer.vue +3 -3
- package/ui.container-grid/config.ts +9 -3
- package/ui.container-grid/tests/UGrid.test.ts +9 -3
- package/ui.container-grid/types.ts +3 -3
- package/ui.container-row/config.ts +3 -1
- package/ui.container-row/tests/URow.test.ts +3 -1
- package/ui.container-row/types.ts +1 -1
- package/ui.data-table/tests/UTableRow.test.ts +2 -2
- package/ui.data-table/types.ts +4 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7-beta.0",
|
|
4
4
|
"description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
|
|
5
5
|
"author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
|
|
6
6
|
"homepage": "https://vueless.com",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
58
58
|
"@vue/test-utils": "^2.4.6",
|
|
59
59
|
"@vue/tsconfig": "^0.7.0",
|
|
60
|
-
"@vueless/storybook": "^1.3.
|
|
60
|
+
"@vueless/storybook": "^1.3.16",
|
|
61
61
|
"eslint": "^9.32.0",
|
|
62
62
|
"eslint-plugin-storybook": "^10.0.2",
|
|
63
63
|
"eslint-plugin-vue": "^10.3.0",
|
|
@@ -197,8 +197,6 @@ function closeDrawer() {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
function onDragStart(e: MouseEvent | TouchEvent) {
|
|
200
|
-
e.preventDefault();
|
|
201
|
-
|
|
202
200
|
const clientX = "touches" in e ? e.touches[0].clientX : e.clientX;
|
|
203
201
|
const clientY = "touches" in e ? e.touches[0].clientY : e.clientY;
|
|
204
202
|
|
|
@@ -211,6 +209,8 @@ function onDragStart(e: MouseEvent | TouchEvent) {
|
|
|
211
209
|
|
|
212
210
|
if (!props.handle || !isDraggingFromHandle.value) return;
|
|
213
211
|
|
|
212
|
+
e.preventDefault();
|
|
213
|
+
|
|
214
214
|
document.addEventListener("mousemove", onDragMove);
|
|
215
215
|
document.addEventListener("mouseup", onDragEnd);
|
|
216
216
|
document.addEventListener("touchmove", onDragMove, { passive: false });
|
|
@@ -294,7 +294,7 @@ const {
|
|
|
294
294
|
titleFallbackAttrs,
|
|
295
295
|
closeButtonAttrs,
|
|
296
296
|
closeIconAttrs,
|
|
297
|
-
} = useUI<Config>(defaultConfig);
|
|
297
|
+
} = useUI<Config>(defaultConfig, undefined, "drawer");
|
|
298
298
|
</script>
|
|
299
299
|
|
|
300
300
|
<template>
|
|
@@ -32,33 +32,39 @@ export default /*tw*/ {
|
|
|
32
32
|
},
|
|
33
33
|
gap: {
|
|
34
34
|
none: "gap-0",
|
|
35
|
+
"3xs": "gap-0.5",
|
|
35
36
|
"2xs": "gap-1",
|
|
36
37
|
xs: "gap-2",
|
|
37
38
|
sm: "gap-3",
|
|
38
39
|
md: "gap-4",
|
|
39
40
|
lg: "gap-5",
|
|
40
41
|
xl: "gap-6",
|
|
41
|
-
"2xl": "gap-
|
|
42
|
+
"2xl": "gap-7",
|
|
43
|
+
"3xl": "gap-8",
|
|
42
44
|
},
|
|
43
45
|
rowGap: {
|
|
44
46
|
none: "gap-y-0",
|
|
47
|
+
"3xs": "gap-y-0.5",
|
|
45
48
|
"2xs": "gap-y-1",
|
|
46
49
|
xs: "gap-y-2",
|
|
47
50
|
sm: "gap-y-3",
|
|
48
51
|
md: "gap-y-4",
|
|
49
52
|
lg: "gap-y-5",
|
|
50
53
|
xl: "gap-y-6",
|
|
51
|
-
"2xl": "gap-y-
|
|
54
|
+
"2xl": "gap-y-7",
|
|
55
|
+
"3xl": "gap-y-8",
|
|
52
56
|
},
|
|
53
57
|
colGap: {
|
|
54
58
|
none: "gap-x-0",
|
|
59
|
+
"3xs": "gap-x-0.5",
|
|
55
60
|
"2xs": "gap-x-1",
|
|
56
61
|
xs: "gap-x-2",
|
|
57
62
|
sm: "gap-x-3",
|
|
58
63
|
md: "gap-x-4",
|
|
59
64
|
lg: "gap-x-5",
|
|
60
65
|
xl: "gap-x-6",
|
|
61
|
-
"2xl": "gap-x-
|
|
66
|
+
"2xl": "gap-x-7",
|
|
67
|
+
"3xl": "gap-x-8",
|
|
62
68
|
},
|
|
63
69
|
align: {
|
|
64
70
|
start: "items-start",
|
|
@@ -64,13 +64,15 @@ describe("UGrid.vue", () => {
|
|
|
64
64
|
it("Gap – applies the correct gap class", () => {
|
|
65
65
|
const gapClasses = {
|
|
66
66
|
none: "gap-0",
|
|
67
|
+
"3xs": "gap-0.5",
|
|
67
68
|
"2xs": "gap-1",
|
|
68
69
|
xs: "gap-2",
|
|
69
70
|
sm: "gap-3",
|
|
70
71
|
md: "gap-4",
|
|
71
72
|
lg: "gap-5",
|
|
72
73
|
xl: "gap-6",
|
|
73
|
-
"2xl": "gap-
|
|
74
|
+
"2xl": "gap-7",
|
|
75
|
+
"3xl": "gap-8",
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
Object.entries(gapClasses).forEach(([gap, classes]) => {
|
|
@@ -87,13 +89,15 @@ describe("UGrid.vue", () => {
|
|
|
87
89
|
it("Row Gap – applies the correct row gap class", () => {
|
|
88
90
|
const rowGapClasses = {
|
|
89
91
|
none: "gap-y-0",
|
|
92
|
+
"3xs": "gap-y-0.5",
|
|
90
93
|
"2xs": "gap-y-1",
|
|
91
94
|
xs: "gap-y-2",
|
|
92
95
|
sm: "gap-y-3",
|
|
93
96
|
md: "gap-y-4",
|
|
94
97
|
lg: "gap-y-5",
|
|
95
98
|
xl: "gap-y-6",
|
|
96
|
-
"2xl": "gap-y-
|
|
99
|
+
"2xl": "gap-y-7",
|
|
100
|
+
"3xl": "gap-y-8",
|
|
97
101
|
};
|
|
98
102
|
|
|
99
103
|
Object.entries(rowGapClasses).forEach(([rowGap, classes]) => {
|
|
@@ -110,13 +114,15 @@ describe("UGrid.vue", () => {
|
|
|
110
114
|
it("Col Gap – applies the correct col gap class", () => {
|
|
111
115
|
const colGapClasses = {
|
|
112
116
|
none: "gap-x-0",
|
|
117
|
+
"3xs": "gap-x-0.5",
|
|
113
118
|
"2xs": "gap-x-1",
|
|
114
119
|
xs: "gap-x-2",
|
|
115
120
|
sm: "gap-x-3",
|
|
116
121
|
md: "gap-x-4",
|
|
117
122
|
lg: "gap-x-5",
|
|
118
123
|
xl: "gap-x-6",
|
|
119
|
-
"2xl": "gap-x-
|
|
124
|
+
"2xl": "gap-x-7",
|
|
125
|
+
"3xl": "gap-x-8",
|
|
120
126
|
};
|
|
121
127
|
|
|
122
128
|
Object.entries(colGapClasses).forEach(([colGap, classes]) => {
|
|
@@ -18,17 +18,17 @@ export interface Props {
|
|
|
18
18
|
/**
|
|
19
19
|
* Gap between items.
|
|
20
20
|
*/
|
|
21
|
-
gap?: "none" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
21
|
+
gap?: "none" | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Vertical gap override.
|
|
25
25
|
*/
|
|
26
|
-
rowGap?: "none" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
26
|
+
rowGap?: "none" | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Horizontal gap override.
|
|
30
30
|
*/
|
|
31
|
-
colGap?: "none" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
31
|
+
colGap?: "none" | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Vertical alignment (align-items).
|
|
@@ -20,13 +20,15 @@ export default /*tw*/ {
|
|
|
20
20
|
},
|
|
21
21
|
gap: {
|
|
22
22
|
none: "gap-0",
|
|
23
|
+
"3xs": "gap-0.5",
|
|
23
24
|
"2xs": "gap-1",
|
|
24
25
|
xs: "gap-2",
|
|
25
26
|
sm: "gap-3",
|
|
26
27
|
md: "gap-4",
|
|
27
28
|
lg: "gap-5",
|
|
28
29
|
xl: "gap-6",
|
|
29
|
-
"2xl": "gap-
|
|
30
|
+
"2xl": "gap-7",
|
|
31
|
+
"3xl": "gap-8",
|
|
30
32
|
},
|
|
31
33
|
align: {
|
|
32
34
|
end: "items-end",
|
|
@@ -10,13 +10,15 @@ describe("URow.vue", () => {
|
|
|
10
10
|
it("Gap – applies the correct gap class", () => {
|
|
11
11
|
const gapClasses = {
|
|
12
12
|
none: "gap-0",
|
|
13
|
+
"3xs": "gap-0.5",
|
|
13
14
|
"2xs": "gap-1",
|
|
14
15
|
xs: "gap-2",
|
|
15
16
|
sm: "gap-3",
|
|
16
17
|
md: "gap-4",
|
|
17
18
|
lg: "gap-5",
|
|
18
19
|
xl: "gap-6",
|
|
19
|
-
"2xl": "gap-
|
|
20
|
+
"2xl": "gap-7",
|
|
21
|
+
"3xl": "gap-8",
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
Object.entries(gapClasses).forEach(([gap, classes]) => {
|
|
@@ -8,7 +8,7 @@ export interface Props {
|
|
|
8
8
|
/**
|
|
9
9
|
* The distance between nested elements.
|
|
10
10
|
*/
|
|
11
|
-
gap?: "none" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
11
|
+
gap?: "none" | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Items vertical align (align-items).
|
|
@@ -6,7 +6,7 @@ import UTableRow from "../UTableRow.vue";
|
|
|
6
6
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
7
7
|
import UCheckbox from "../../ui.form-checkbox/UCheckbox.vue";
|
|
8
8
|
|
|
9
|
-
import type { FlatRow, ColumnObject, UTableRowAttrs, Config } from "../types";
|
|
9
|
+
import type { FlatRow, ColumnObject, UTableRowAttrs, Config, Row } from "../types";
|
|
10
10
|
|
|
11
11
|
describe("UTableRow.vue", () => {
|
|
12
12
|
const defaultColumns: ColumnObject[] = [
|
|
@@ -135,7 +135,7 @@ describe("UTableRow.vue", () => {
|
|
|
135
135
|
...defaultRow,
|
|
136
136
|
name: {
|
|
137
137
|
value: "John Doe",
|
|
138
|
-
class: (value, row) => `dynamic-${row.role}`,
|
|
138
|
+
class: (value: unknown, row: Row) => `dynamic-${row.role}`,
|
|
139
139
|
contentClass: (value: unknown) => `content-${value}`,
|
|
140
140
|
},
|
|
141
141
|
};
|
package/ui.data-table/types.ts
CHANGED
|
@@ -6,16 +6,15 @@ import type { Config as UDividerConfig } from "../ui.container-divider/types";
|
|
|
6
6
|
|
|
7
7
|
export type Config = typeof defaultConfig;
|
|
8
8
|
|
|
9
|
-
type RowKeys = number | string | boolean | undefined | Date | Row | Row[] | ((row: Row) => string);
|
|
10
|
-
|
|
11
9
|
export interface CellObject {
|
|
12
10
|
contentClass?: string | ((value: unknown | string, row: Row) => string);
|
|
13
11
|
class?: string | ((value: unknown | string, row: Row) => string);
|
|
14
|
-
[key: string]: unknown
|
|
12
|
+
[key: string]: unknown;
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
export type RowId = string | number;
|
|
18
|
-
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
export type Cell = CellObject & any;
|
|
19
18
|
|
|
20
19
|
export interface RowData {
|
|
21
20
|
[key: string]: Cell;
|
|
@@ -32,7 +31,7 @@ export interface Row {
|
|
|
32
31
|
rowDate?: string | Date;
|
|
33
32
|
row?: Row | Row[];
|
|
34
33
|
class?: string | ((row: Row) => string);
|
|
35
|
-
[key: string]:
|
|
34
|
+
[key: string]: unknown;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
export interface FlatRow extends Row {
|