@vasakgroup/vue-libvasak 0.2.3 → 0.3.1
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/types/cards/DeviceCard.vue.d.ts +32 -0
- package/dist/types/cards/ListCard.vue.d.ts +24 -0
- package/dist/types/controls/ActionButton.vue.d.ts +35 -0
- package/dist/types/controls/ToggleControl.vue.d.ts +23 -0
- package/dist/types/forms/FormGroup.vue.d.ts +23 -0
- package/dist/types/forms/SliderControl.vue.d.ts +28 -0
- package/dist/types/forms/SwitchToggle.vue.d.ts +21 -0
- package/{src/index.ts → dist/types/index.d.ts} +6 -37
- package/dist/types/layout/ConfigSection.vue.d.ts +21 -0
- package/dist/types/sidebar/SideBar.vue.d.ts +51 -0
- package/dist/types/sidebar/SideButton.vue.d.ts +21 -0
- package/dist/types/sidebar/SideGroup.vue.d.ts +21 -0
- package/dist/types/sidebar/tipos.d.ts +15 -0
- package/dist/types/tray/TrayIconButton.vue.d.ts +37 -0
- package/dist/types/window/TopBar.vue.d.ts +9 -0
- package/dist/types/window/WindowFrame.vue.d.ts +20 -0
- package/dist/vue-libvasak.es.js +451 -2243
- package/dist/vue-libvasak.umd.js +1 -1
- package/package.json +22 -15
- package/readme.md +58 -0
- package/src/.d.ts +0 -1
- package/src/cards/DeviceCard.vue +0 -82
- package/src/cards/ListCard.vue +0 -40
- package/src/controls/ActionButton.vue +0 -85
- package/src/controls/ToggleControl.vue +0 -55
- package/src/forms/FormGroup.vue +0 -27
- package/src/forms/SliderControl.vue +0 -100
- package/src/forms/SwitchToggle.vue +0 -49
- package/src/layout/ConfigSection.vue +0 -28
- package/src/sidebar/SideBar.vue +0 -7
- package/src/sidebar/SideButton.vue +0 -18
- package/src/tray/TrayIconButton.vue +0 -80
- package/src/types/vue-libvasak.d.ts +0 -155
- package/src/window/TopBar.vue +0 -46
- package/src/window/WindowFrame.vue +0 -20
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button
|
|
3
|
-
type="button"
|
|
4
|
-
@click="handleClick"
|
|
5
|
-
:disabled="disabled"
|
|
6
|
-
:class="[
|
|
7
|
-
'relative inline-flex items-center rounded-full transition-colors',
|
|
8
|
-
size === 'small' ? 'h-6 w-11' : 'h-7 w-12',
|
|
9
|
-
isOn ? activeClass : inactiveClass,
|
|
10
|
-
disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer',
|
|
11
|
-
customClass
|
|
12
|
-
]"
|
|
13
|
-
>
|
|
14
|
-
<span
|
|
15
|
-
:class="[
|
|
16
|
-
'inline-block transform rounded-full bg-white shadow transition-transform',
|
|
17
|
-
size === 'small' ? 'h-4 w-4' : 'h-6 w-6',
|
|
18
|
-
isOn ? (size === 'small' ? 'translate-x-6' : 'translate-x-5') : 'translate-x-1'
|
|
19
|
-
]"
|
|
20
|
-
></span>
|
|
21
|
-
</button>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script setup lang="ts">
|
|
25
|
-
interface Props {
|
|
26
|
-
isOn: boolean;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
size?: 'small' | 'medium';
|
|
29
|
-
activeClass?: string;
|
|
30
|
-
inactiveClass?: string;
|
|
31
|
-
customClass?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
35
|
-
disabled: false,
|
|
36
|
-
size: 'small',
|
|
37
|
-
activeClass: 'bg-primary dark:bg-primary-dark',
|
|
38
|
-
inactiveClass: 'background',
|
|
39
|
-
customClass: '',
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const emit = defineEmits<{
|
|
43
|
-
toggle: [value: boolean];
|
|
44
|
-
}>();
|
|
45
|
-
|
|
46
|
-
const handleClick = () => {
|
|
47
|
-
emit('toggle', !props.isOn);
|
|
48
|
-
};
|
|
49
|
-
</script>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
interface Props {
|
|
3
|
-
title: string;
|
|
4
|
-
icon?: string;
|
|
5
|
-
customClass?: string | Record<string, boolean>;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
withDefaults(defineProps<Props>(), {
|
|
9
|
-
icon: '',
|
|
10
|
-
customClass: () => ({}),
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<div
|
|
16
|
-
class="flex flex-col gap-4 p-4 background rounded-corner"
|
|
17
|
-
:class="customClass"
|
|
18
|
-
>
|
|
19
|
-
<h3 class="text-base font-semibold m-0 text-primary dark:text-primary-dark">
|
|
20
|
-
{{ icon ? `${icon} ${title}` : title }}
|
|
21
|
-
</h3>
|
|
22
|
-
<slot />
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<style scoped>
|
|
27
|
-
/* Ningún estilo adicional requerido */
|
|
28
|
-
</style>
|
package/src/sidebar/SideBar.vue
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
title: {
|
|
4
|
-
type: String,
|
|
5
|
-
default: "Link",
|
|
6
|
-
},
|
|
7
|
-
image: {
|
|
8
|
-
type: String,
|
|
9
|
-
default: "",
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<a href="#" class="sidebar-button">
|
|
16
|
-
<img :src="image" :alt="title" class="img-fluid" />
|
|
17
|
-
</a>
|
|
18
|
-
</template>
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="p-1 rounded-corner relative hover:bg-primary dark:hover:bg-primary-dark group transition-all duration-300"
|
|
4
|
-
:class="customClass"
|
|
5
|
-
:title="tooltip"
|
|
6
|
-
@click="handleClick"
|
|
7
|
-
@mouseenter="showTooltip = true"
|
|
8
|
-
@mouseleave="showTooltip = false"
|
|
9
|
-
>
|
|
10
|
-
<img
|
|
11
|
-
:src="icon"
|
|
12
|
-
:alt="alt"
|
|
13
|
-
class="m-auto h-5.5 w-auto transition-all duration-300"
|
|
14
|
-
:class="iconClass"
|
|
15
|
-
/>
|
|
16
|
-
|
|
17
|
-
<!-- Badge/Counter -->
|
|
18
|
-
<div
|
|
19
|
-
v-if="badge !== null && badge > 0"
|
|
20
|
-
class="absolute bottom-1 right-1 bg-primary dark:bg-primary-dark text-white text-xs rounded-full w-4 h-4 flex items-center justify-center font-bold animate-bounce"
|
|
21
|
-
>
|
|
22
|
-
{{ badge }}
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<!-- Tooltip personalizado -->
|
|
26
|
-
<div
|
|
27
|
-
v-if="showCustomTooltip && customTooltipText"
|
|
28
|
-
class="absolute top-1 left-1/2 transform -translate-x-1/2 text-xs font-semibold p-1 rounded-corner transition-all duration-300 pointer-events-none background"
|
|
29
|
-
:class="[
|
|
30
|
-
tooltipClass,
|
|
31
|
-
{
|
|
32
|
-
'opacity-0 -translate-y-2': !showTooltip,
|
|
33
|
-
'opacity-100 translate-y-0': showTooltip
|
|
34
|
-
}
|
|
35
|
-
]"
|
|
36
|
-
>
|
|
37
|
-
{{ customTooltipText }}
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<!-- Slot para contenido adicional personalizado -->
|
|
41
|
-
<slot></slot>
|
|
42
|
-
</div>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script setup lang="ts">
|
|
46
|
-
import { ref } from 'vue';
|
|
47
|
-
|
|
48
|
-
interface Props {
|
|
49
|
-
icon: string;
|
|
50
|
-
alt?: string;
|
|
51
|
-
tooltip?: string;
|
|
52
|
-
badge?: number | null;
|
|
53
|
-
iconClass?: string | Record<string, boolean>;
|
|
54
|
-
customClass?: string | Record<string, boolean>;
|
|
55
|
-
tooltipClass?: string | Record<string, boolean>;
|
|
56
|
-
showCustomTooltip?: boolean;
|
|
57
|
-
customTooltipText?: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
withDefaults(defineProps<Props>(), {
|
|
61
|
-
alt: '',
|
|
62
|
-
tooltip: '',
|
|
63
|
-
badge: null,
|
|
64
|
-
iconClass: () => ({}),
|
|
65
|
-
customClass: '',
|
|
66
|
-
tooltipClass: '',
|
|
67
|
-
showCustomTooltip: false,
|
|
68
|
-
customTooltipText: '',
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const emit = defineEmits<{
|
|
72
|
-
click: [];
|
|
73
|
-
}>();
|
|
74
|
-
|
|
75
|
-
const showTooltip = ref(false);
|
|
76
|
-
|
|
77
|
-
const handleClick = () => {
|
|
78
|
-
emit('click');
|
|
79
|
-
};
|
|
80
|
-
</script>
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
declare module "@vasakgroup/vue-libvasak" {
|
|
2
|
-
import { DefineComponent, App } from "vue";
|
|
3
|
-
|
|
4
|
-
/* Layout */
|
|
5
|
-
export interface WindowFrameProps {
|
|
6
|
-
title?: string;
|
|
7
|
-
image?: string;
|
|
8
|
-
class?: string;
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/* Sidebar */
|
|
13
|
-
export interface SideBarProps {
|
|
14
|
-
class?: string;
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface SideButtonProps {
|
|
19
|
-
title?: string;
|
|
20
|
-
image?: string;
|
|
21
|
-
class?: string;
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* Controls */
|
|
26
|
-
export interface ActionButtonProps {
|
|
27
|
-
label: string;
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
variant?: "primary" | "secondary" | "danger";
|
|
30
|
-
loading?: boolean;
|
|
31
|
-
customClass?: string | Record<string, boolean>;
|
|
32
|
-
size?: "sm" | "md" | "lg";
|
|
33
|
-
fullWidth?: boolean;
|
|
34
|
-
iconSrc?: string;
|
|
35
|
-
iconAlt?: string;
|
|
36
|
-
iconRight?: boolean;
|
|
37
|
-
type?: "button" | "submit" | "reset";
|
|
38
|
-
stopPropagation?: boolean;
|
|
39
|
-
preventDefault?: boolean;
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface ToggleControlProps {
|
|
44
|
-
icon: string;
|
|
45
|
-
alt?: string;
|
|
46
|
-
tooltip?: string;
|
|
47
|
-
isActive?: boolean;
|
|
48
|
-
isLoading?: boolean;
|
|
49
|
-
iconClass?: Record<string, boolean>;
|
|
50
|
-
customClass?: Record<string, boolean>;
|
|
51
|
-
[key: string]: any;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* Layout/Config */
|
|
55
|
-
export interface ConfigSectionProps {
|
|
56
|
-
title: string;
|
|
57
|
-
icon?: string;
|
|
58
|
-
customClass?: string | Record<string, boolean>;
|
|
59
|
-
[key: string]: any;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/* Cards */
|
|
63
|
-
export interface DeviceCardProps {
|
|
64
|
-
icon: string;
|
|
65
|
-
title: string;
|
|
66
|
-
subtitle?: string;
|
|
67
|
-
metadata?: string;
|
|
68
|
-
extraInfo?: string[];
|
|
69
|
-
isConnected?: boolean;
|
|
70
|
-
showActionButton?: boolean;
|
|
71
|
-
actionLabel?: string;
|
|
72
|
-
showStatusIndicator?: boolean;
|
|
73
|
-
customClass?: string;
|
|
74
|
-
clickable?: boolean;
|
|
75
|
-
[key: string]: any;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface ListCardProps {
|
|
79
|
-
clickable?: boolean;
|
|
80
|
-
customClass?: string | Record<string, boolean>;
|
|
81
|
-
[key: string]: any;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* Forms */
|
|
85
|
-
export interface FormGroupProps {
|
|
86
|
-
label: string;
|
|
87
|
-
htmlFor?: string;
|
|
88
|
-
customClass?: string | Record<string, boolean>;
|
|
89
|
-
labelClass?: string | Record<string, boolean>;
|
|
90
|
-
[key: string]: any;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface SliderControlProps {
|
|
94
|
-
icon: string;
|
|
95
|
-
alt?: string;
|
|
96
|
-
tooltip?: string;
|
|
97
|
-
modelValue: number;
|
|
98
|
-
min?: number;
|
|
99
|
-
max?: number;
|
|
100
|
-
showButton?: boolean;
|
|
101
|
-
iconClass?: string | Record<string, boolean>;
|
|
102
|
-
getPercentageClass?: (percentage: number) => string;
|
|
103
|
-
[key: string]: any;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface SwitchToggleProps {
|
|
107
|
-
isOn: boolean;
|
|
108
|
-
disabled?: boolean;
|
|
109
|
-
size?: "small" | "medium";
|
|
110
|
-
activeClass?: string;
|
|
111
|
-
inactiveClass?: string;
|
|
112
|
-
customClass?: string;
|
|
113
|
-
[key: string]: any;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/* Tray */
|
|
117
|
-
export interface TrayIconButtonProps {
|
|
118
|
-
icon: string;
|
|
119
|
-
alt?: string;
|
|
120
|
-
tooltip?: string;
|
|
121
|
-
badge?: number | null;
|
|
122
|
-
iconClass?: string | Record<string, boolean>;
|
|
123
|
-
customClass?: string | Record<string, boolean>;
|
|
124
|
-
tooltipClass?: string | Record<string, boolean>;
|
|
125
|
-
showCustomTooltip?: boolean;
|
|
126
|
-
customTooltipText?: string;
|
|
127
|
-
[key: string]: any;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/* Component exports */
|
|
131
|
-
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>;
|
|
134
|
-
|
|
135
|
-
export const ActionButton: DefineComponent<ActionButtonProps, any, any, {}, {}, {}, {}, { click: () => void }, string>;
|
|
136
|
-
export const ToggleControl: DefineComponent<ToggleControlProps, any, any, {}, {}, {}, {}, { click: () => void }, string>;
|
|
137
|
-
export const ConfigSection: DefineComponent<ConfigSectionProps, any, any, {}, {}, {}, {}, {}, string>;
|
|
138
|
-
|
|
139
|
-
export const DeviceCard: DefineComponent<DeviceCardProps, any, any, {}, {}, {}, {}, { action: () => void; click: () => void }, string>;
|
|
140
|
-
export const ListCard: DefineComponent<ListCardProps, any, any, {}, {}, {}, {}, { click: () => void }, string>;
|
|
141
|
-
|
|
142
|
-
export const FormGroup: DefineComponent<FormGroupProps, any, any, {}, {}, {}, {}, {}, string>;
|
|
143
|
-
export const SliderControl: DefineComponent<SliderControlProps, any, any, {}, {}, {}, {}, { 'update:modelValue': (value: number) => void; buttonClick: () => void }, string>;
|
|
144
|
-
export const SwitchToggle: DefineComponent<SwitchToggleProps, any, any, {}, {}, {}, {}, { toggle: (value: boolean) => void }, string>;
|
|
145
|
-
|
|
146
|
-
export const TrayIconButton: DefineComponent<TrayIconButtonProps, any, any, {}, {}, {}, {}, { click: () => void }, string>;
|
|
147
|
-
|
|
148
|
-
// Plugin de Vue
|
|
149
|
-
export interface VueLibVasakPlugin {
|
|
150
|
-
install(app: App): void;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
declare const plugin: VueLibVasakPlugin;
|
|
154
|
-
export default plugin;
|
|
155
|
-
}
|
package/src/window/TopBar.vue
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { ref, Ref, onMounted } from "vue";
|
|
3
|
-
import { getCurrentWindow } from "@tauri-apps/api/window";
|
|
4
|
-
import { getIconSource } from "@vasakgroup/plugin-vicons";
|
|
5
|
-
|
|
6
|
-
const bar = ref(null);
|
|
7
|
-
const appWindow = getCurrentWindow();
|
|
8
|
-
const closeIcon: Ref<string> = ref("");
|
|
9
|
-
const minimizeIcon: Ref<string> = ref("");
|
|
10
|
-
const maximizeIcon: Ref<string> = ref("");
|
|
11
|
-
|
|
12
|
-
const props = defineProps({
|
|
13
|
-
title: String,
|
|
14
|
-
image: String,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
onMounted(async () => {
|
|
18
|
-
closeIcon.value = await getIconSource("window-close");
|
|
19
|
-
minimizeIcon.value = await getIconSource("window-minimize");
|
|
20
|
-
maximizeIcon.value = await getIconSource("window-maximize");
|
|
21
|
-
});
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<template>
|
|
25
|
-
<div
|
|
26
|
-
data-tauri-drag-region
|
|
27
|
-
class="flex h-8 px-4 py-1 bg-primary dark:bg-primary-dark rounded-t-corner-window justify-between align-center"
|
|
28
|
-
ref="bar"
|
|
29
|
-
>
|
|
30
|
-
<div data-tauri-drag-region>
|
|
31
|
-
<img :src="props.image" data-tauri-drag-region class="h-6 w-auto" :alt="props.title" />
|
|
32
|
-
</div>
|
|
33
|
-
<div data-tauri-drag-region>{{ props.title }}</div>
|
|
34
|
-
<div data-tauri-drag-region>
|
|
35
|
-
<span class="win-button" @click="appWindow.minimize()">
|
|
36
|
-
<img :src="minimizeIcon" class="h-6 w-6 inline-block" alt="Minimize">
|
|
37
|
-
</span>
|
|
38
|
-
<span class="win-button" @click="appWindow.toggleMaximize()">
|
|
39
|
-
<img :src="maximizeIcon" class="h-6 w-6 inline-block" alt="Maximize">
|
|
40
|
-
</span>
|
|
41
|
-
<span class="win-button" @click="appWindow.close()">
|
|
42
|
-
<img :src="closeIcon" class="h-6 w-6 inline-block" alt="Close">
|
|
43
|
-
</span>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</template>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import TopBar from "./TopBar.vue";
|
|
3
|
-
import { defineProps } from "vue";
|
|
4
|
-
|
|
5
|
-
const props = defineProps({
|
|
6
|
-
title: {
|
|
7
|
-
type: String,
|
|
8
|
-
default: "Vasak",
|
|
9
|
-
},
|
|
10
|
-
image: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: "",
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<TopBar :title="props.title" :image="props.image" />
|
|
19
|
-
<slot />
|
|
20
|
-
</template>
|