@smurfox/proxy-ui 0.1.34 → 0.2.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/dist/module.json +1 -1
- package/dist/module.mjs +3 -2
- package/dist/runtime/components/Avatar.d.vue.ts +1 -1
- package/dist/runtime/components/Avatar.vue +18 -13
- package/dist/runtime/components/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/Button.d.vue.ts +1 -1
- package/dist/runtime/components/Button.vue +30 -12
- package/dist/runtime/components/Button.vue.d.ts +1 -1
- package/dist/runtime/components/Card.d.vue.ts +1 -1
- package/dist/runtime/components/Card.vue.d.ts +1 -1
- package/dist/runtime/components/Chip.d.vue.ts +1 -1
- package/dist/runtime/components/Chip.vue +22 -10
- package/dist/runtime/components/Chip.vue.d.ts +1 -1
- package/dist/runtime/components/Dropdown.d.vue.ts +12 -0
- package/dist/runtime/components/Dropdown.vue +51 -0
- package/dist/runtime/components/Dropdown.vue.d.ts +12 -0
- package/dist/runtime/components/Input.d.vue.ts +2 -2
- package/dist/runtime/components/Input.vue +25 -13
- package/dist/runtime/components/Input.vue.d.ts +2 -2
- package/dist/runtime/components/Select.d.vue.ts +37 -0
- package/dist/runtime/components/Select.vue +224 -0
- package/dist/runtime/components/Select.vue.d.ts +37 -0
- package/dist/runtime/components/Table.d.vue.ts +79 -0
- package/dist/runtime/components/Table.vue +178 -0
- package/dist/runtime/components/Table.vue.d.ts +79 -0
- package/dist/runtime/components/Tabs.d.vue.ts +2 -2
- package/dist/runtime/components/Tabs.vue +8 -8
- package/dist/runtime/components/Tabs.vue.d.ts +2 -2
- package/dist/runtime/components/TextArea.d.vue.ts +43 -0
- package/dist/runtime/components/TextArea.vue +106 -0
- package/dist/runtime/components/TextArea.vue.d.ts +43 -0
- package/dist/runtime/types/index.d.ts +15 -14
- package/package.json +1 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-1">
|
|
3
|
+
<div
|
|
4
|
+
v-if="label"
|
|
5
|
+
class="flex items-start gap-1"
|
|
6
|
+
>
|
|
7
|
+
<label
|
|
8
|
+
class="dark:text-white"
|
|
9
|
+
:class="[labelClass]"
|
|
10
|
+
>{{ label }} </label>
|
|
11
|
+
<span
|
|
12
|
+
v-if="props.required"
|
|
13
|
+
class="text-danger"
|
|
14
|
+
>*</span>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
ref="selectRef"
|
|
19
|
+
class="relative w-full text-left"
|
|
20
|
+
>
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
class="w-full p-3 text-sm text-left transition-colors flex items-center justify-between gap-3"
|
|
24
|
+
:class="[
|
|
25
|
+
roundedVariants[props.rounded],
|
|
26
|
+
props.error ? errorVariants[props.variant] : variants[props.variant],
|
|
27
|
+
props.disabled ? 'opacity-70 cursor-not-allowed' : 'cursor-pointer',
|
|
28
|
+
!selectedOption ? 'text-gray-500 dark:text-white/50' : ''
|
|
29
|
+
]"
|
|
30
|
+
:disabled="props.disabled"
|
|
31
|
+
@click.stop="toggle"
|
|
32
|
+
>
|
|
33
|
+
<span class="truncate">
|
|
34
|
+
{{ displayText }}
|
|
35
|
+
</span>
|
|
36
|
+
<Icon
|
|
37
|
+
name="mdi:chevron-down"
|
|
38
|
+
class="text-gray-400 transition-transform duration-200 shrink-0"
|
|
39
|
+
:class="{ 'rotate-180': isOpen && !props.disabled }"
|
|
40
|
+
/>
|
|
41
|
+
</button>
|
|
42
|
+
|
|
43
|
+
<Teleport
|
|
44
|
+
v-if="isOpen && !props.disabled"
|
|
45
|
+
to="body"
|
|
46
|
+
>
|
|
47
|
+
<AnimatePresence>
|
|
48
|
+
<motion.div
|
|
49
|
+
v-if="isOpen && !props.disabled"
|
|
50
|
+
:initial="{ scale: 0.96, opacity: 0, y: -6 }"
|
|
51
|
+
:animate="{ scale: 1, opacity: 1, y: 0 }"
|
|
52
|
+
:exit="{ scale: 0.96, opacity: 0, y: -6 }"
|
|
53
|
+
class="fixed p-2 max-h-56 overflow-y-auto origin-top border rounded-xl shadow-xl"
|
|
54
|
+
:class="
|
|
55
|
+
isDarkMode ? 'bg-[#212123] border-white/10 text-white' : 'bg-white border-gray-100'
|
|
56
|
+
"
|
|
57
|
+
:style="dropdownStyle"
|
|
58
|
+
@click.stop
|
|
59
|
+
>
|
|
60
|
+
<div
|
|
61
|
+
v-if="props.options.length === 0"
|
|
62
|
+
class="px-4 py-2 text-sm text-center"
|
|
63
|
+
:class="isDarkMode ? 'text-white/60' : 'text-black/50'"
|
|
64
|
+
>
|
|
65
|
+
No available options
|
|
66
|
+
</div>
|
|
67
|
+
<template v-else>
|
|
68
|
+
<button
|
|
69
|
+
v-for="option in props.options"
|
|
70
|
+
:key="String(option.value)"
|
|
71
|
+
type="button"
|
|
72
|
+
class="w-full flex items-center justify-between gap-3 px-3 py-2 mb-1 text-left cursor-pointer rounded-lg transition-colors"
|
|
73
|
+
:class="[
|
|
74
|
+
isDarkMode ? 'hover:bg-white/10' : 'hover:bg-gray-100',
|
|
75
|
+
option.value === props.modelValue ? selectedOptionClass : ''
|
|
76
|
+
]"
|
|
77
|
+
@click.stop="selectOption(option)"
|
|
78
|
+
>
|
|
79
|
+
<span
|
|
80
|
+
class="text-sm truncate"
|
|
81
|
+
:class="
|
|
82
|
+
option.value === props.modelValue ? 'text-primary' : unselectedOptionClass
|
|
83
|
+
"
|
|
84
|
+
>
|
|
85
|
+
{{ option.label }}
|
|
86
|
+
</span>
|
|
87
|
+
<Icon
|
|
88
|
+
v-if="option.value === props.modelValue"
|
|
89
|
+
name="mdi:check"
|
|
90
|
+
class="text-primary text-sm shrink-0"
|
|
91
|
+
/>
|
|
92
|
+
</button>
|
|
93
|
+
</template>
|
|
94
|
+
</motion.div>
|
|
95
|
+
</AnimatePresence>
|
|
96
|
+
</Teleport>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<p
|
|
100
|
+
v-if="description && !props.error"
|
|
101
|
+
class="text-gray-600 dark:text-white/60 text-xs"
|
|
102
|
+
>
|
|
103
|
+
{{ description }}
|
|
104
|
+
</p>
|
|
105
|
+
<p
|
|
106
|
+
v-if="props.error"
|
|
107
|
+
class="text-danger text-xs mt-1"
|
|
108
|
+
>
|
|
109
|
+
{{ props.error }}
|
|
110
|
+
</p>
|
|
111
|
+
</div>
|
|
112
|
+
</template>
|
|
113
|
+
|
|
114
|
+
<script setup>
|
|
115
|
+
import { AnimatePresence, motion } from "motion-v";
|
|
116
|
+
import { computed, nextTick, onMounted, onUnmounted, ref } from "vue";
|
|
117
|
+
const roundedVariants = {
|
|
118
|
+
"none": "rounded-none",
|
|
119
|
+
"sm": "rounded-sm",
|
|
120
|
+
"md": "rounded-md",
|
|
121
|
+
"lg": "rounded-lg",
|
|
122
|
+
"xl": "rounded-xl",
|
|
123
|
+
"2xl": "rounded-2xl",
|
|
124
|
+
"full": "rounded-full"
|
|
125
|
+
};
|
|
126
|
+
const variants = {
|
|
127
|
+
default: "border border-gray-200 dark:border-white/10 bg-white dark:bg-white/10 enabled:hover:bg-gray-100 dark:enabled:hover:bg-white/20 dark:text-white focus:bg-white dark:focus:bg-white/10 focus:ring-2 focus:ring-primary focus:outline-none",
|
|
128
|
+
secondary: "border border-gray-200 dark:border-white/10 bg-[#EBEBEC] dark:bg-white/20 dark:text-white enabled:hover:bg-[#E0E0E1] dark:enabled:hover:bg-white/30 focus:bg-[#EBEBEC] dark:focus:bg-white/20 focus:ring-2 focus:ring-primary focus:outline-none"
|
|
129
|
+
};
|
|
130
|
+
const errorVariants = {
|
|
131
|
+
default: "border border-danger bg-danger/10 dark:bg-danger/20 text-black dark:text-white enabled:hover:bg-white/20 dark:enabled:hover:bg-white/20 focus:bg-white dark:focus:bg-white/10 focus:ring-2 focus:ring-danger focus:outline-none",
|
|
132
|
+
secondary: "border border-danger bg-danger/22 dark:bg-danger/10 text-black dark:text-white enabled:hover:bg-[#E0E0E1] dark:enabled:hover:bg-white/30 focus:bg-[#EBEBEC] dark:focus:bg-white/20 focus:ring-2 focus:ring-danger focus:outline-none"
|
|
133
|
+
};
|
|
134
|
+
const props = defineProps({
|
|
135
|
+
modelValue: { type: [String, Number, null], required: false, default: null },
|
|
136
|
+
options: { type: Array, required: false, default: () => [] },
|
|
137
|
+
label: { type: String, required: false },
|
|
138
|
+
labelClass: { type: String, required: false, default: "text-sm font-semibold" },
|
|
139
|
+
placeholder: { type: String, required: false, default: "Seleccionar" },
|
|
140
|
+
description: { type: String, required: false },
|
|
141
|
+
rounded: { type: String, required: false, default: "xl" },
|
|
142
|
+
variant: { type: String, required: false, default: "default" },
|
|
143
|
+
required: { type: Boolean, required: false, default: false },
|
|
144
|
+
error: { type: String, required: false, default: "" },
|
|
145
|
+
disabled: { type: Boolean, required: false, default: false }
|
|
146
|
+
});
|
|
147
|
+
const emit = defineEmits(["update:modelValue", "change"]);
|
|
148
|
+
const selectRef = ref(null);
|
|
149
|
+
const isOpen = ref(false);
|
|
150
|
+
const isDarkMode = ref(false);
|
|
151
|
+
const dropdownPosition = ref({ top: 0, left: 0, width: 0 });
|
|
152
|
+
const selectedOption = computed(() => {
|
|
153
|
+
return props.options.find((option) => option.value === props.modelValue);
|
|
154
|
+
});
|
|
155
|
+
const displayText = computed(() => {
|
|
156
|
+
return selectedOption.value?.label || props.placeholder;
|
|
157
|
+
});
|
|
158
|
+
const dropdownStyle = computed(() => ({
|
|
159
|
+
top: `${dropdownPosition.value.top}px`,
|
|
160
|
+
left: `${dropdownPosition.value.left}px`,
|
|
161
|
+
width: `${dropdownPosition.value.width}px`,
|
|
162
|
+
zIndex: 9999
|
|
163
|
+
}));
|
|
164
|
+
const selectedOptionClass = computed(() => {
|
|
165
|
+
return isDarkMode.value ? "bg-white/10" : "bg-primary/10";
|
|
166
|
+
});
|
|
167
|
+
const unselectedOptionClass = computed(() => {
|
|
168
|
+
return isDarkMode.value ? "text-white" : "text-black";
|
|
169
|
+
});
|
|
170
|
+
function syncDarkMode() {
|
|
171
|
+
isDarkMode.value = Boolean(selectRef.value?.closest(".dark"));
|
|
172
|
+
}
|
|
173
|
+
function calculateDropdownPosition() {
|
|
174
|
+
if (!selectRef.value) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
syncDarkMode();
|
|
178
|
+
const rect = selectRef.value.getBoundingClientRect();
|
|
179
|
+
dropdownPosition.value = {
|
|
180
|
+
top: rect.bottom + window.scrollY + 8,
|
|
181
|
+
left: rect.left + window.scrollX,
|
|
182
|
+
width: rect.width
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
async function toggle() {
|
|
186
|
+
if (props.disabled) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (!isOpen.value) {
|
|
190
|
+
await nextTick();
|
|
191
|
+
calculateDropdownPosition();
|
|
192
|
+
}
|
|
193
|
+
isOpen.value = !isOpen.value;
|
|
194
|
+
}
|
|
195
|
+
function close() {
|
|
196
|
+
isOpen.value = false;
|
|
197
|
+
}
|
|
198
|
+
function selectOption(option) {
|
|
199
|
+
emit("update:modelValue", option.value);
|
|
200
|
+
emit("change", option.value);
|
|
201
|
+
close();
|
|
202
|
+
}
|
|
203
|
+
function onClickOutside(event) {
|
|
204
|
+
if (selectRef.value && !selectRef.value.contains(event.target)) {
|
|
205
|
+
close();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function onScroll() {
|
|
209
|
+
if (isOpen.value) {
|
|
210
|
+
calculateDropdownPosition();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
onMounted(() => {
|
|
214
|
+
syncDarkMode();
|
|
215
|
+
document.addEventListener("click", onClickOutside);
|
|
216
|
+
window.addEventListener("scroll", onScroll, true);
|
|
217
|
+
window.addEventListener("resize", onScroll);
|
|
218
|
+
});
|
|
219
|
+
onUnmounted(() => {
|
|
220
|
+
document.removeEventListener("click", onClickOutside);
|
|
221
|
+
window.removeEventListener("scroll", onScroll, true);
|
|
222
|
+
window.removeEventListener("resize", onScroll);
|
|
223
|
+
});
|
|
224
|
+
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { InputRounded, InputVariant } from '../types/index.js';
|
|
2
|
+
interface SelectOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string | number;
|
|
5
|
+
}
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
modelValue?: string | number | null;
|
|
8
|
+
options?: SelectOption[];
|
|
9
|
+
label?: string;
|
|
10
|
+
labelClass?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
rounded?: InputRounded;
|
|
14
|
+
variant?: InputVariant;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
change: (value: string | number) => any;
|
|
21
|
+
"update:modelValue": (value: string | number) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
onChange?: ((value: string | number) => any) | undefined;
|
|
24
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
rounded: InputRounded;
|
|
27
|
+
error: string;
|
|
28
|
+
variant: InputVariant;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
placeholder: string;
|
|
31
|
+
required: boolean;
|
|
32
|
+
modelValue: string | number | null;
|
|
33
|
+
labelClass: string;
|
|
34
|
+
options: SelectOption[];
|
|
35
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
declare const roundedClasses: {
|
|
2
|
+
readonly none: "rounded-none";
|
|
3
|
+
readonly xs: "rounded-xs";
|
|
4
|
+
readonly sm: "rounded-sm";
|
|
5
|
+
readonly md: "rounded-md";
|
|
6
|
+
readonly lg: "rounded-lg";
|
|
7
|
+
readonly xl: "rounded-xl";
|
|
8
|
+
readonly '2xl': "rounded-2xl";
|
|
9
|
+
readonly '3xl': "rounded-3xl";
|
|
10
|
+
readonly full: "rounded-full";
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
items?: Array<{
|
|
14
|
+
id: string | number;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}>;
|
|
17
|
+
columns?: {
|
|
18
|
+
name: string;
|
|
19
|
+
id: string;
|
|
20
|
+
width?: string;
|
|
21
|
+
}[];
|
|
22
|
+
rounded?: keyof typeof roundedClasses;
|
|
23
|
+
isBordered?: boolean;
|
|
24
|
+
headerColor?: string;
|
|
25
|
+
bodyColor?: string;
|
|
26
|
+
};
|
|
27
|
+
declare var __VLS_2: `cell-${string}`, __VLS_3: {
|
|
28
|
+
item: {
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
id: string | number;
|
|
31
|
+
};
|
|
32
|
+
value: unknown;
|
|
33
|
+
}, __VLS_5: {
|
|
34
|
+
item: {
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
id: string | number;
|
|
37
|
+
};
|
|
38
|
+
columns: {
|
|
39
|
+
name: string;
|
|
40
|
+
id: string;
|
|
41
|
+
width?: string;
|
|
42
|
+
}[];
|
|
43
|
+
}, __VLS_8: `cell-${string}`, __VLS_9: {
|
|
44
|
+
item: {
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
id: string | number;
|
|
47
|
+
};
|
|
48
|
+
value: unknown;
|
|
49
|
+
};
|
|
50
|
+
type __VLS_Slots = {} & {
|
|
51
|
+
[K in NonNullable<typeof __VLS_2>]?: (props: typeof __VLS_3) => any;
|
|
52
|
+
} & {
|
|
53
|
+
[K in NonNullable<typeof __VLS_8>]?: (props: typeof __VLS_9) => any;
|
|
54
|
+
} & {
|
|
55
|
+
'mobile-card'?: (props: typeof __VLS_5) => any;
|
|
56
|
+
};
|
|
57
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
58
|
+
rounded: keyof typeof roundedClasses;
|
|
59
|
+
columns: {
|
|
60
|
+
name: string;
|
|
61
|
+
id: string;
|
|
62
|
+
width?: string;
|
|
63
|
+
}[];
|
|
64
|
+
isBordered: boolean;
|
|
65
|
+
items: Array<{
|
|
66
|
+
id: string | number;
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
}>;
|
|
69
|
+
headerColor: string;
|
|
70
|
+
bodyColor: string;
|
|
71
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
72
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
73
|
+
declare const _default: typeof __VLS_export;
|
|
74
|
+
export default _default;
|
|
75
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
76
|
+
new (): {
|
|
77
|
+
$slots: S;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="relative w-full">
|
|
3
|
+
<!-- Vista de tabla para pantallas medianas y grandes -->
|
|
4
|
+
<div
|
|
5
|
+
class="hidden md:block overflow-x-auto"
|
|
6
|
+
:class="[
|
|
7
|
+
roundedClasses[props.rounded],
|
|
8
|
+
isBordered ? 'border border-gray-200 dark:border-white/10 ' : ''
|
|
9
|
+
]"
|
|
10
|
+
>
|
|
11
|
+
<table class="w-full text-sm text-left rtl:text-right table-fixed">
|
|
12
|
+
<thead :class="props.headerColor">
|
|
13
|
+
<tr>
|
|
14
|
+
<th
|
|
15
|
+
v-for="(column, index) in props.columns"
|
|
16
|
+
:key="column.id"
|
|
17
|
+
scope="col"
|
|
18
|
+
:style="{ width: column.width || 'auto' }"
|
|
19
|
+
:class="[
|
|
20
|
+
'px-4 py-3 font-bold text-xs uppercase',
|
|
21
|
+
index === 0 ? isBordered ? roundedTopStartClasses[props.rounded] : roundedStartClasses[props.rounded] : '',
|
|
22
|
+
index === props.columns.length - 1 ? isBordered ? roundedTopEndClasses[props.rounded] : roundedEndClasses[props.rounded] : ''
|
|
23
|
+
]"
|
|
24
|
+
>
|
|
25
|
+
{{ column.name }}
|
|
26
|
+
</th>
|
|
27
|
+
</tr>
|
|
28
|
+
</thead>
|
|
29
|
+
|
|
30
|
+
<tbody :class="props.bodyColor">
|
|
31
|
+
<template v-if="items.length > 0">
|
|
32
|
+
<tr
|
|
33
|
+
v-for="item in items"
|
|
34
|
+
:key="item.id"
|
|
35
|
+
>
|
|
36
|
+
<td
|
|
37
|
+
v-for="column in columns"
|
|
38
|
+
:key="column.id"
|
|
39
|
+
:style="{ width: column.width || 'auto' }"
|
|
40
|
+
class="px-4 py-2 text-gray-900 dark:text-white break-words"
|
|
41
|
+
>
|
|
42
|
+
<slot
|
|
43
|
+
:name="`cell-${column.id}`"
|
|
44
|
+
:item="item"
|
|
45
|
+
:value="item[column.id]"
|
|
46
|
+
>
|
|
47
|
+
{{ item[column.id] }}
|
|
48
|
+
</slot>
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<tr v-else>
|
|
54
|
+
<td
|
|
55
|
+
:colspan="columns.length"
|
|
56
|
+
class="text-lg text-center py-20 text-black/50 dark:text-white/50"
|
|
57
|
+
>
|
|
58
|
+
No se encontraron resultados
|
|
59
|
+
</td>
|
|
60
|
+
</tr>
|
|
61
|
+
</tbody>
|
|
62
|
+
</table>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<!-- Vista de tarjetas para dispositivos móviles -->
|
|
66
|
+
<div class="block md:hidden space-y-4 p-1">
|
|
67
|
+
<div
|
|
68
|
+
v-for="item in items"
|
|
69
|
+
:key="item.id"
|
|
70
|
+
class="bg-white dark:bg-[#18181B] border border-gray-200 dark:border-white/10 rounded-lg p-4 shadow-sm"
|
|
71
|
+
>
|
|
72
|
+
<slot
|
|
73
|
+
name="mobile-card"
|
|
74
|
+
:item="item"
|
|
75
|
+
:columns="columns"
|
|
76
|
+
>
|
|
77
|
+
<!-- Contenido por defecto si no se proporciona slot personalizado -->
|
|
78
|
+
<div class="space-y-2">
|
|
79
|
+
<div
|
|
80
|
+
v-for="column in columns"
|
|
81
|
+
:key="column.id"
|
|
82
|
+
class="flex justify-between items-center"
|
|
83
|
+
>
|
|
84
|
+
<span
|
|
85
|
+
class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase"
|
|
86
|
+
>
|
|
87
|
+
{{ column.name }}
|
|
88
|
+
</span>
|
|
89
|
+
<div class="text-sm">
|
|
90
|
+
<slot
|
|
91
|
+
:name="`cell-${column.id}`"
|
|
92
|
+
:item="item"
|
|
93
|
+
:value="item[column.id]"
|
|
94
|
+
>
|
|
95
|
+
{{ item[column.id] }}
|
|
96
|
+
</slot>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</slot>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<!-- Mensaje cuando no hay items -->
|
|
104
|
+
<div
|
|
105
|
+
v-if="items.length === 0"
|
|
106
|
+
class="text-lg text-center py-20 text-black/50 dark:text-white/50"
|
|
107
|
+
>
|
|
108
|
+
No se encontraron resultados
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</template>
|
|
113
|
+
|
|
114
|
+
<script setup>
|
|
115
|
+
const roundedClasses = {
|
|
116
|
+
"none": "rounded-none",
|
|
117
|
+
"xs": "rounded-xs",
|
|
118
|
+
"sm": "rounded-sm",
|
|
119
|
+
"md": "rounded-md",
|
|
120
|
+
"lg": "rounded-lg",
|
|
121
|
+
"xl": "rounded-xl",
|
|
122
|
+
"2xl": "rounded-2xl",
|
|
123
|
+
"3xl": "rounded-3xl",
|
|
124
|
+
"full": "rounded-full"
|
|
125
|
+
};
|
|
126
|
+
const roundedStartClasses = {
|
|
127
|
+
"none": "rounded-s-none",
|
|
128
|
+
"xs": "rounded-s-xs",
|
|
129
|
+
"sm": "rounded-s-sm",
|
|
130
|
+
"md": "rounded-s-md",
|
|
131
|
+
"lg": "rounded-s-lg",
|
|
132
|
+
"xl": "rounded-s-xl",
|
|
133
|
+
"2xl": "rounded-s-2xl",
|
|
134
|
+
"3xl": "rounded-s-3xl",
|
|
135
|
+
"full": "rounded-s-full"
|
|
136
|
+
};
|
|
137
|
+
const roundedEndClasses = {
|
|
138
|
+
"none": "rounded-e-none",
|
|
139
|
+
"xs": "rounded-e-xs",
|
|
140
|
+
"sm": "rounded-e-sm",
|
|
141
|
+
"md": "rounded-e-md",
|
|
142
|
+
"lg": "rounded-e-lg",
|
|
143
|
+
"xl": "rounded-e-xl",
|
|
144
|
+
"2xl": "rounded-e-2xl",
|
|
145
|
+
"3xl": "rounded-e-3xl",
|
|
146
|
+
"full": "rounded-e-full"
|
|
147
|
+
};
|
|
148
|
+
const roundedTopStartClasses = {
|
|
149
|
+
"none": "rounded-ss-none",
|
|
150
|
+
"xs": "rounded-ss-xs",
|
|
151
|
+
"sm": "rounded-ss-sm",
|
|
152
|
+
"md": "rounded-ss-md",
|
|
153
|
+
"lg": "rounded-ss-lg",
|
|
154
|
+
"xl": "rounded-ss-xl",
|
|
155
|
+
"2xl": "rounded-ss-2xl",
|
|
156
|
+
"3xl": "rounded-ss-3xl",
|
|
157
|
+
"full": "rounded-ss-full"
|
|
158
|
+
};
|
|
159
|
+
const roundedTopEndClasses = {
|
|
160
|
+
"none": "rounded-se-none",
|
|
161
|
+
"xs": "rounded-se-xs",
|
|
162
|
+
"sm": "rounded-se-sm",
|
|
163
|
+
"md": "rounded-se-md",
|
|
164
|
+
"lg": "rounded-se-lg",
|
|
165
|
+
"xl": "rounded-se-xl",
|
|
166
|
+
"2xl": "rounded-se-2xl",
|
|
167
|
+
"3xl": "rounded-se-3xl",
|
|
168
|
+
"full": "rounded-se-full"
|
|
169
|
+
};
|
|
170
|
+
const props = defineProps({
|
|
171
|
+
items: { type: Array, required: false, default: () => [] },
|
|
172
|
+
columns: { type: Array, required: false, default: () => [] },
|
|
173
|
+
rounded: { type: null, required: false, default: "lg" },
|
|
174
|
+
isBordered: { type: Boolean, required: false, default: false },
|
|
175
|
+
headerColor: { type: String, required: false, default: "bg-[#F4F4F5] text-[#71717A] dark:bg-[#27272A] dark:text-[#A1A1AA]" },
|
|
176
|
+
bodyColor: { type: String, required: false, default: "" }
|
|
177
|
+
});
|
|
178
|
+
</script>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
declare const roundedClasses: {
|
|
2
|
+
readonly none: "rounded-none";
|
|
3
|
+
readonly xs: "rounded-xs";
|
|
4
|
+
readonly sm: "rounded-sm";
|
|
5
|
+
readonly md: "rounded-md";
|
|
6
|
+
readonly lg: "rounded-lg";
|
|
7
|
+
readonly xl: "rounded-xl";
|
|
8
|
+
readonly '2xl': "rounded-2xl";
|
|
9
|
+
readonly '3xl': "rounded-3xl";
|
|
10
|
+
readonly full: "rounded-full";
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
items?: Array<{
|
|
14
|
+
id: string | number;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}>;
|
|
17
|
+
columns?: {
|
|
18
|
+
name: string;
|
|
19
|
+
id: string;
|
|
20
|
+
width?: string;
|
|
21
|
+
}[];
|
|
22
|
+
rounded?: keyof typeof roundedClasses;
|
|
23
|
+
isBordered?: boolean;
|
|
24
|
+
headerColor?: string;
|
|
25
|
+
bodyColor?: string;
|
|
26
|
+
};
|
|
27
|
+
declare var __VLS_2: `cell-${string}`, __VLS_3: {
|
|
28
|
+
item: {
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
id: string | number;
|
|
31
|
+
};
|
|
32
|
+
value: unknown;
|
|
33
|
+
}, __VLS_5: {
|
|
34
|
+
item: {
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
id: string | number;
|
|
37
|
+
};
|
|
38
|
+
columns: {
|
|
39
|
+
name: string;
|
|
40
|
+
id: string;
|
|
41
|
+
width?: string;
|
|
42
|
+
}[];
|
|
43
|
+
}, __VLS_8: `cell-${string}`, __VLS_9: {
|
|
44
|
+
item: {
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
id: string | number;
|
|
47
|
+
};
|
|
48
|
+
value: unknown;
|
|
49
|
+
};
|
|
50
|
+
type __VLS_Slots = {} & {
|
|
51
|
+
[K in NonNullable<typeof __VLS_2>]?: (props: typeof __VLS_3) => any;
|
|
52
|
+
} & {
|
|
53
|
+
[K in NonNullable<typeof __VLS_8>]?: (props: typeof __VLS_9) => any;
|
|
54
|
+
} & {
|
|
55
|
+
'mobile-card'?: (props: typeof __VLS_5) => any;
|
|
56
|
+
};
|
|
57
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
58
|
+
rounded: keyof typeof roundedClasses;
|
|
59
|
+
columns: {
|
|
60
|
+
name: string;
|
|
61
|
+
id: string;
|
|
62
|
+
width?: string;
|
|
63
|
+
}[];
|
|
64
|
+
isBordered: boolean;
|
|
65
|
+
items: Array<{
|
|
66
|
+
id: string | number;
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
}>;
|
|
69
|
+
headerColor: string;
|
|
70
|
+
bodyColor: string;
|
|
71
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
72
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
73
|
+
declare const _default: typeof __VLS_export;
|
|
74
|
+
export default _default;
|
|
75
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
76
|
+
new (): {
|
|
77
|
+
$slots: S;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TabsProps } from '../types/index.js';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<TabsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
3
|
"update:modelValue": (value: string) => any;
|
|
4
4
|
}, string, import("vue").PublicProps, Readonly<TabsProps> & Readonly<{
|
|
5
5
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
6
6
|
}>, {
|
|
7
|
-
rounded: TabsRounded;
|
|
7
|
+
rounded: import("../types/index.js").TabsRounded;
|
|
8
8
|
iconSize: number;
|
|
9
9
|
modelValue: string;
|
|
10
10
|
bgColor: string;
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
<script setup>
|
|
43
43
|
import { motion } from "motion-v";
|
|
44
44
|
const roundedClasses = {
|
|
45
|
-
none: "rounded-none",
|
|
46
|
-
xs: "rounded-xs",
|
|
47
|
-
sm: "rounded-sm",
|
|
48
|
-
md: "rounded-md",
|
|
49
|
-
lg: "rounded-lg",
|
|
50
|
-
xl: "rounded-xl",
|
|
45
|
+
"none": "rounded-none",
|
|
46
|
+
"xs": "rounded-xs",
|
|
47
|
+
"sm": "rounded-sm",
|
|
48
|
+
"md": "rounded-md",
|
|
49
|
+
"lg": "rounded-lg",
|
|
50
|
+
"xl": "rounded-xl",
|
|
51
51
|
"2xl": "rounded-2xl",
|
|
52
|
-
full: "rounded-full"
|
|
52
|
+
"full": "rounded-full"
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
defineProps({
|
|
55
55
|
modelValue: { type: String, required: true, default: "" },
|
|
56
56
|
tabs: { type: Array, required: true },
|
|
57
57
|
iconSize: { type: Number, required: false, default: 15 },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TabsProps } from '../types/index.js';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<TabsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
3
|
"update:modelValue": (value: string) => any;
|
|
4
4
|
}, string, import("vue").PublicProps, Readonly<TabsProps> & Readonly<{
|
|
5
5
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
6
6
|
}>, {
|
|
7
|
-
rounded: TabsRounded;
|
|
7
|
+
rounded: import("../types/index.js").TabsRounded;
|
|
8
8
|
iconSize: number;
|
|
9
9
|
modelValue: string;
|
|
10
10
|
bgColor: string;
|