@vasakgroup/vue-libvasak 0.2.3 → 0.3.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/COPYING +674 -0
- package/dist/vue-libvasak.es.js +451 -2243
- package/dist/vue-libvasak.umd.js +1 -1
- package/package.json +18 -11
- package/readme.md +58 -0
- package/src/index.ts +5 -0
- package/src/shims-vue.d.ts +15 -0
- package/src/sidebar/SideBar.vue +180 -4
- package/src/sidebar/SideButton.vue +109 -12
- package/src/sidebar/SideGroup.vue +46 -0
- package/src/sidebar/tipos.ts +16 -0
- package/src/types/vue-libvasak.d.ts +40 -4
- package/src/window/WindowFrame.vue +12 -11
- package/src/.d.ts +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Un elemento de la barra lateral: un lugar al que se va. */
|
|
2
|
+
export interface SidebarItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** Un nombre del tema de iconos del escritorio, no una ruta. */
|
|
6
|
+
icon?: string;
|
|
7
|
+
badge?: string | number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Un grupo de elementos, con su título plegable. */
|
|
12
|
+
export interface SidebarCategory {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
items: SidebarItem[];
|
|
16
|
+
}
|
|
@@ -10,18 +10,53 @@ declare module "@vasakgroup/vue-libvasak" {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/* Sidebar */
|
|
13
|
+
export interface SidebarItem {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
/** Un nombre del tema de iconos del escritorio, no una ruta. */
|
|
17
|
+
icon?: string;
|
|
18
|
+
badge?: string | number;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SidebarCategory {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
items: SidebarItem[];
|
|
26
|
+
}
|
|
27
|
+
|
|
13
28
|
export interface SideBarProps {
|
|
29
|
+
/** Sin `title` ni `subtitle` no se dibuja el área de título. */
|
|
30
|
+
title?: string;
|
|
31
|
+
subtitle?: string;
|
|
32
|
+
categories?: SidebarCategory[];
|
|
33
|
+
modelValue?: string;
|
|
34
|
+
collapsed?: boolean;
|
|
35
|
+
collapseLabel?: string;
|
|
36
|
+
expandLabel?: string;
|
|
14
37
|
class?: string;
|
|
15
38
|
[key: string]: any;
|
|
16
39
|
}
|
|
17
40
|
|
|
18
41
|
export interface SideButtonProps {
|
|
19
|
-
|
|
20
|
-
|
|
42
|
+
label: string;
|
|
43
|
+
/** Un nombre del tema de iconos, que se vuelve a resolver al cambiar de tema. */
|
|
44
|
+
icon?: string;
|
|
45
|
+
active?: boolean;
|
|
46
|
+
collapsed?: boolean;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
badge?: string | number;
|
|
21
49
|
class?: string;
|
|
22
50
|
[key: string]: any;
|
|
23
51
|
}
|
|
24
52
|
|
|
53
|
+
export interface SideGroupProps {
|
|
54
|
+
title: string;
|
|
55
|
+
collapsed?: boolean;
|
|
56
|
+
defaultOpen?: boolean;
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}
|
|
59
|
+
|
|
25
60
|
/* Controls */
|
|
26
61
|
export interface ActionButtonProps {
|
|
27
62
|
label: string;
|
|
@@ -129,8 +164,9 @@ declare module "@vasakgroup/vue-libvasak" {
|
|
|
129
164
|
|
|
130
165
|
/* Component exports */
|
|
131
166
|
export const WindowFrame: DefineComponent<WindowFrameProps, any, any, {}, {}, {}, {}, {}, string>;
|
|
132
|
-
export const SideBar: DefineComponent<SideBarProps, any, any, {}, {}, {}, {}, {}, string>;
|
|
133
|
-
export const SideButton: DefineComponent<SideButtonProps, any, any, {}, {}, {}, {}, {}, string>;
|
|
167
|
+
export const SideBar: DefineComponent<SideBarProps, any, any, {}, {}, {}, {}, { 'update:modelValue': (value: string) => void; 'update:collapsed': (value: boolean) => void; change: (value: string) => void }, string>;
|
|
168
|
+
export const SideButton: DefineComponent<SideButtonProps, any, any, {}, {}, {}, {}, { click: () => void }, string>;
|
|
169
|
+
export const SideGroup: DefineComponent<SideGroupProps, any, any, {}, {}, {}, {}, {}, string>;
|
|
134
170
|
|
|
135
171
|
export const ActionButton: DefineComponent<ActionButtonProps, any, any, {}, {}, {}, {}, { click: () => void }, string>;
|
|
136
172
|
export const ToggleControl: DefineComponent<ToggleControlProps, any, any, {}, {}, {}, {}, { click: () => void }, string>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* El marco de una ventana: la barra superior y lo que va debajo.
|
|
4
|
+
*
|
|
5
|
+
* `defineProps` es una macro del compilador de componentes, no una función que
|
|
6
|
+
* se importe. Importarla desde `vue` choca con la que el compilador declara, y
|
|
7
|
+
* el typecheck lo decía —sólo que no había ninguno: un `declare module \'*\'`
|
|
8
|
+
* dejaba todos los imports en `any` y este archivo nunca se comprobó.
|
|
9
|
+
*/
|
|
10
|
+
import TopBar from './TopBar.vue';
|
|
4
11
|
|
|
5
|
-
const props = defineProps({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
default: "Vasak",
|
|
9
|
-
},
|
|
10
|
-
image: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: "",
|
|
13
|
-
},
|
|
12
|
+
const props = withDefaults(defineProps<{ title?: string; image?: string }>(), {
|
|
13
|
+
title: 'Vasak',
|
|
14
|
+
image: '',
|
|
14
15
|
});
|
|
15
16
|
</script>
|
|
16
17
|
|
package/src/.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module '*';
|