@greenborn/vue-greenborn-file-explorer 0.0.0-stage → 0.1.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/README.md +40 -2
- package/dist/vue-greenborn-file-explorer.css +1 -0
- package/dist/vue-greenborn-file-explorer.js +195 -0
- package/dist/vue-greenborn-file-explorer.js.map +1 -0
- package/dist/vue-greenborn-file-explorer.umd.cjs +3 -0
- package/dist/vue-greenborn-file-explorer.umd.cjs.map +1 -0
- package/package.json +58 -4
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @greenborn/vue-greenborn-file-explorer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Explorador de archivos para Vue 3: árbol de carpetas, grilla con miniaturas, ruta navegable,
|
|
4
|
+
buscador y teclado (flechas izquierda/derecha, Enter, Backspace, Escape). No asume backend:
|
|
5
|
+
el consumidor provee los datos y resuelve las acciones.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @greenborn/vue-greenborn-file-explorer @greenborn/vue-greenborn-tree-view
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```vue
|
|
12
|
+
<GbFileExplorer :carpetas="carpetas" :archivos="archivos" :carpeta-actual="carpetaId"
|
|
13
|
+
@navegar="cargar" @seleccionar="item => seleccionado = item" @abrir="ver" />
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import { GbFileExplorer } from '@greenborn/vue-greenborn-file-explorer'
|
|
18
|
+
import '@greenborn/vue-greenborn-file-explorer/style.css'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Default | Descripción |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| `carpetas` | `[]` | Todas las carpetas `{ id, padre_id, nombre }`; raíz con `padre_id: null` |
|
|
26
|
+
| `archivos` | `[]` | Archivos de la carpeta actual `{ id, nombre, miniatura?, detalle? }` |
|
|
27
|
+
| `carpetaActual` | `null` | Id de la carpeta mostrada |
|
|
28
|
+
| `nombreRaiz` | `'Inicio'` | Nombre de la raíz en la ruta |
|
|
29
|
+
| `mostrarArbol` | `true` | Panel lateral (se oculta en pantallas angostas) |
|
|
30
|
+
| `cargando` | `false` | Muestra el aviso de carga |
|
|
31
|
+
| `textoVacio` | `'Esta carpeta está vacía'` | Aviso de carpeta vacía |
|
|
32
|
+
| `ayuda` | `{}` | Atributos `data-help`: `{ ruta, buscador, arbol, listado }` |
|
|
33
|
+
|
|
34
|
+
## Eventos
|
|
35
|
+
|
|
36
|
+
- `navegar(id)`: el consumidor carga la carpeta y actualiza `carpetaActual`.
|
|
37
|
+
- `seleccionar(item | null)`: `item = { tipo: 'carpeta' | 'archivo', id, nombre, dato, ... }`.
|
|
38
|
+
- `abrir(item)`: doble clic o Enter sobre un archivo.
|
|
39
|
+
|
|
40
|
+
La selección es simple y se limpia al cambiar los datos. Colores y medidas se ajustan con las
|
|
41
|
+
variables CSS `--gb-fe-*`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gb-tree-view__nodo[data-v-c5a2f299]{list-style:none}.gb-tree-view__hijos[data-v-c5a2f299]{list-style:none;margin:0;padding-left:1.25rem}.gb-tree-view__fila[data-v-c5a2f299]{display:flex;align-items:center;padding:.2rem .35rem;border-radius:.25rem;cursor:pointer}.gb-tree-view__fila[data-v-c5a2f299]:hover{background-color:var(--gb-tree-view-hover-bg, #f1f3f5)}.gb-tree-view__fila--seleccionado[data-v-c5a2f299]{background-color:var(--gb-tree-view-selected-bg, #cfe2ff)}.gb-tree-view__toggle[data-v-c5a2f299]{width:1.25rem;display:inline-flex;justify-content:center;color:var(--gb-tree-view-toggle-color, #6c757d)}.gb-tree-view__icono[data-v-c5a2f299]:before{content:"";display:inline-block;width:.55rem;height:.55rem;border-right:2px solid currentColor;border-bottom:2px solid currentColor}.gb-tree-view__icono--cerrado[data-v-c5a2f299]:before{transform:rotate(-45deg) translate(-1px,-1px)}.gb-tree-view__icono--abierto[data-v-c5a2f299]:before{transform:rotate(45deg)}.gb-tree-view__icono--hoja[data-v-c5a2f299]:before{width:.3rem;height:.3rem;border-radius:50%;border:none;background:currentColor;transform:none}.gb-tree-view__contenido[data-v-c5a2f299]{flex:1}.gb-tree-view__estado[data-v-c5a2f299]{color:var(--gb-tree-view-muted-color, #6c757d);font-size:.875rem;padding:.35rem .5rem}.gb-tree-view__estado--hijo[data-v-c5a2f299]{padding-left:1.25rem}.gb-tree-view__estado--error[data-v-c5a2f299]{color:var(--gb-tree-view-error-color, #dc3545)}.gb-tree-view[data-v-fa1bb57c]{display:block}.gb-tree-view__raiz[data-v-fa1bb57c]{list-style:none;margin:0;padding-left:0}.gb-tree-view__estado[data-v-fa1bb57c]{color:var(--gb-tree-view-muted-color, #6c757d);font-size:.875rem;padding:.5rem}.gb-tree-view__estado--error[data-v-fa1bb57c]{color:var(--gb-tree-view-error-color, #dc3545)}.gb-fe{display:flex;flex-direction:column;border:1px solid var(--gb-fe-borde, #dee2e6);border-radius:.375rem;background:var(--gb-fe-fondo, #fff);color:var(--gb-fe-texto, #212529)}.gb-fe__barra{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.5rem;border-bottom:1px solid var(--gb-fe-borde, #dee2e6)}.gb-fe__subir,.gb-fe__miga{background:none;border:0;color:inherit;font:inherit;cursor:pointer;padding:.15rem .4rem;border-radius:.25rem}.gb-fe__subir:disabled{opacity:.35;cursor:default}.gb-fe__miga:disabled{font-weight:600;cursor:default}.gb-fe__subir:hover:enabled,.gb-fe__miga:hover:enabled{background:var(--gb-fe-hover, #f1f3f5)}.gb-fe__ruta{display:flex;flex-wrap:wrap;align-items:center;flex:1}.gb-fe__buscar{font:inherit;color:inherit;background:transparent;border:1px solid var(--gb-fe-borde, #dee2e6);border-radius:.25rem;padding:.25rem .5rem;max-width:100%}.gb-fe__cuerpo{display:flex;height:var(--gb-fe-alto, 60vh);min-height:240px}.gb-fe__arbol{width:var(--gb-fe-ancho-arbol, 220px);flex-shrink:0;overflow:auto;padding:.5rem;border-right:1px solid var(--gb-fe-borde, #dee2e6)}.gb-fe__nodo--actual{font-weight:600}.gb-fe__grilla{flex:1;overflow:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--gb-fe-tamano, 120px),1fr));grid-auto-rows:max-content;align-content:start;gap:.5rem;padding:.75rem}.gb-fe__item{display:flex;flex-direction:column;align-items:center;gap:.35rem;min-width:0;padding:.5rem;background:none;border:1px solid transparent;border-radius:.25rem;color:inherit;font:inherit;cursor:pointer;-webkit-user-select:none;user-select:none}.gb-fe__item:hover{background:var(--gb-fe-hover, #f1f3f5)}.gb-fe__item--sel,.gb-fe__item--sel:hover{background:var(--gb-fe-seleccion, #cfe2ff);border-color:var(--gb-fe-seleccion-borde, #6ea8fe)}.gb-fe__miniatura{display:flex;align-items:center;justify-content:center;width:100%;height:88px}.gb-fe__miniatura img{max-width:100%;max-height:100%;object-fit:contain}.gb-fe__icono{width:64px;height:64px;fill:var(--gb-fe-archivo, #adb5bd)}.gb-fe__icono--carpeta{fill:var(--gb-fe-carpeta, #ffc107)}.gb-fe__nombre{width:100%;font-size:.85rem;text-align:center;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word}.gb-fe__aviso{grid-column:1 / -1;text-align:center;padding:2rem;opacity:.65}.gb-fe__estado{display:flex;flex-wrap:wrap;gap:1rem;padding:.35rem .75rem;font-size:.8rem;opacity:.75;border-top:1px solid var(--gb-fe-borde, #dee2e6)}@media (max-width: 640px){.gb-fe__arbol{display:none}}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { ref as B, computed as v, watch as $, openBlock as n, createElementBlock as r, createElementVNode as o, Fragment as k, renderList as z, createCommentVNode as x, toDisplayString as f, withDirectives as j, vModelText as F, createBlock as H, unref as L, withCtx as G, normalizeClass as D, withModifiers as O, nextTick as R } from "vue";
|
|
2
|
+
import { GbTreeView as I } from "@greenborn/vue-greenborn-tree-view";
|
|
3
|
+
const q = { class: "gb-fe" }, J = { class: "gb-fe__barra" }, K = ["disabled"], U = ["data-help"], P = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "gb-fe__sep"
|
|
6
|
+
}, Q = ["disabled", "onClick"], W = ["data-help"], X = { class: "gb-fe__cuerpo" }, Y = ["data-help"], Z = ["data-help"], ee = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "gb-fe__aviso"
|
|
9
|
+
}, ae = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "gb-fe__aviso"
|
|
12
|
+
}, te = ["aria-selected", "tabindex", "title", "onClick", "onDblclick"], le = { class: "gb-fe__miniatura" }, ne = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "gb-fe__icono gb-fe__icono--carpeta",
|
|
15
|
+
viewBox: "0 0 24 24",
|
|
16
|
+
"aria-hidden": "true"
|
|
17
|
+
}, oe = ["src"], re = {
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "gb-fe__icono",
|
|
20
|
+
viewBox: "0 0 24 24",
|
|
21
|
+
"aria-hidden": "true"
|
|
22
|
+
}, ie = { class: "gb-fe__nombre" }, se = { class: "gb-fe__estado" }, ce = { key: 0 }, be = {
|
|
23
|
+
__name: "GbFileExplorer",
|
|
24
|
+
props: {
|
|
25
|
+
// Todas las carpetas: [{ id, padre_id, nombre }]. La raíz es padre_id null.
|
|
26
|
+
carpetas: { type: Array, default: () => [] },
|
|
27
|
+
// Archivos de la carpeta actual: [{ id, nombre, miniatura?, detalle? }].
|
|
28
|
+
archivos: { type: Array, default: () => [] },
|
|
29
|
+
carpetaActual: { type: [Number, String], default: null },
|
|
30
|
+
nombreRaiz: { type: String, default: "Inicio" },
|
|
31
|
+
mostrarArbol: { type: Boolean, default: !0 },
|
|
32
|
+
cargando: { type: Boolean, default: !1 },
|
|
33
|
+
textoVacio: { type: String, default: "Esta carpeta está vacía" },
|
|
34
|
+
// Valores data-help opcionales: { ruta, buscador, arbol, listado }.
|
|
35
|
+
ayuda: { type: Object, default: () => ({}) }
|
|
36
|
+
},
|
|
37
|
+
emits: ["navegar", "seleccionar", "abrir"],
|
|
38
|
+
setup(s, { emit: E }) {
|
|
39
|
+
const l = s, y = E, u = B(""), _ = B(null), g = (e) => `${e.tipo}-${e.id}`, A = v(() => [
|
|
40
|
+
...l.carpetas.filter((e) => e.padre_id === l.carpetaActual).map((e) => ({ tipo: "carpeta", id: e.id, nombre: e.nombre, dato: e })),
|
|
41
|
+
...l.archivos.map((e) => ({ tipo: "archivo", id: e.id, nombre: e.nombre, detalle: e.detalle, miniatura: e.miniatura, dato: e }))
|
|
42
|
+
]), c = v(() => {
|
|
43
|
+
const e = u.value.trim().toLowerCase();
|
|
44
|
+
return e ? A.value.filter((t) => t.nombre.toLowerCase().includes(e)) : A.value;
|
|
45
|
+
}), b = v(() => c.value.find((e) => g(e) === _.value) || null), w = v(() => Math.max(0, c.value.indexOf(b.value))), p = v(() => {
|
|
46
|
+
const e = [], t = /* @__PURE__ */ new Set();
|
|
47
|
+
let a = l.carpetas.find((i) => i.id === l.carpetaActual);
|
|
48
|
+
for (; a && !t.has(a.id); ) {
|
|
49
|
+
t.add(a.id), e.unshift(a);
|
|
50
|
+
const i = a.padre_id;
|
|
51
|
+
a = l.carpetas.find((d) => d.id === i);
|
|
52
|
+
}
|
|
53
|
+
return [{ id: null, nombre: l.nombreRaiz }, ...e];
|
|
54
|
+
}), M = v(() => JSON.stringify(l.carpetas.map((e) => [e.id, e.padre_id, e.nombre]))), V = (e) => l.carpetas.some((t) => t.padre_id === e);
|
|
55
|
+
async function N(e) {
|
|
56
|
+
const t = e ? e.id : null;
|
|
57
|
+
return l.carpetas.filter((a) => a.padre_id === t).map((a) => ({ id: a.id, nombre: a.nombre, tieneHijos: V(a.id) }));
|
|
58
|
+
}
|
|
59
|
+
function h(e) {
|
|
60
|
+
_.value = e ? g(e) : null, y("seleccionar", e);
|
|
61
|
+
}
|
|
62
|
+
function m(e) {
|
|
63
|
+
e !== l.carpetaActual && y("navegar", e);
|
|
64
|
+
}
|
|
65
|
+
function S(e) {
|
|
66
|
+
e.tipo === "carpeta" ? m(e.id) : y("abrir", e);
|
|
67
|
+
}
|
|
68
|
+
function C() {
|
|
69
|
+
p.value.length > 1 && m(p.value[p.value.length - 2].id);
|
|
70
|
+
}
|
|
71
|
+
function T(e) {
|
|
72
|
+
if (e.key === "Backspace")
|
|
73
|
+
return e.preventDefault(), C();
|
|
74
|
+
if (e.key === "Escape") return h(null);
|
|
75
|
+
if (e.key === "Enter" && b.value)
|
|
76
|
+
return e.preventDefault(), S(b.value);
|
|
77
|
+
const t = { ArrowLeft: -1, ArrowRight: 1 }[e.key];
|
|
78
|
+
if (!t || !c.value.length) return;
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
const a = Math.min(c.value.length - 1, Math.max(0, w.value + t));
|
|
81
|
+
h(c.value[a]);
|
|
82
|
+
const i = e.currentTarget;
|
|
83
|
+
R(() => {
|
|
84
|
+
var d;
|
|
85
|
+
return (d = i.querySelectorAll(".gb-fe__item")[a]) == null ? void 0 : d.focus();
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return $(() => l.carpetaActual, () => {
|
|
89
|
+
u.value = "";
|
|
90
|
+
}), $([() => l.carpetaActual, () => l.carpetas, () => l.archivos, u], () => {
|
|
91
|
+
_.value && h(null);
|
|
92
|
+
}), (e, t) => (n(), r("div", q, [
|
|
93
|
+
o("div", J, [
|
|
94
|
+
o("button", {
|
|
95
|
+
type: "button",
|
|
96
|
+
class: "gb-fe__subir",
|
|
97
|
+
disabled: p.value.length < 2,
|
|
98
|
+
title: "Subir un nivel",
|
|
99
|
+
"aria-label": "Subir un nivel",
|
|
100
|
+
onClick: C
|
|
101
|
+
}, "↑", 8, K),
|
|
102
|
+
o("nav", {
|
|
103
|
+
class: "gb-fe__ruta",
|
|
104
|
+
"data-help": s.ayuda.ruta
|
|
105
|
+
}, [
|
|
106
|
+
(n(!0), r(k, null, z(p.value, (a, i) => (n(), r(k, {
|
|
107
|
+
key: a.id ?? "raiz"
|
|
108
|
+
}, [
|
|
109
|
+
i ? (n(), r("span", P, "›")) : x("", !0),
|
|
110
|
+
o("button", {
|
|
111
|
+
type: "button",
|
|
112
|
+
class: "gb-fe__miga",
|
|
113
|
+
disabled: i === p.value.length - 1,
|
|
114
|
+
onClick: (d) => m(a.id)
|
|
115
|
+
}, f(a.nombre), 9, Q)
|
|
116
|
+
], 64))), 128))
|
|
117
|
+
], 8, U),
|
|
118
|
+
j(o("input", {
|
|
119
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => u.value = a),
|
|
120
|
+
type: "search",
|
|
121
|
+
class: "gb-fe__buscar",
|
|
122
|
+
placeholder: "Buscar en esta carpeta",
|
|
123
|
+
"aria-label": "Buscar en esta carpeta",
|
|
124
|
+
"data-help": s.ayuda.buscador
|
|
125
|
+
}, null, 8, W), [
|
|
126
|
+
[F, u.value]
|
|
127
|
+
])
|
|
128
|
+
]),
|
|
129
|
+
o("div", X, [
|
|
130
|
+
s.mostrarArbol ? (n(), r("aside", {
|
|
131
|
+
key: 0,
|
|
132
|
+
class: "gb-fe__arbol",
|
|
133
|
+
"data-help": s.ayuda.arbol
|
|
134
|
+
}, [
|
|
135
|
+
(n(), H(L(I), {
|
|
136
|
+
key: M.value,
|
|
137
|
+
"cargar-nodos": N,
|
|
138
|
+
onSeleccionar: t[1] || (t[1] = (a) => m(a.id))
|
|
139
|
+
}, {
|
|
140
|
+
nodo: G(({ nodo: a }) => [
|
|
141
|
+
o("span", {
|
|
142
|
+
class: D({ "gb-fe__nodo--actual": a.id === s.carpetaActual })
|
|
143
|
+
}, f(a.nombre), 3)
|
|
144
|
+
]),
|
|
145
|
+
_: 1
|
|
146
|
+
}))
|
|
147
|
+
], 8, Y)) : x("", !0),
|
|
148
|
+
o("div", {
|
|
149
|
+
class: "gb-fe__grilla",
|
|
150
|
+
role: "listbox",
|
|
151
|
+
"data-help": s.ayuda.listado,
|
|
152
|
+
onClick: t[2] || (t[2] = O((a) => h(null), ["self"])),
|
|
153
|
+
onKeydown: T
|
|
154
|
+
}, [
|
|
155
|
+
s.cargando ? (n(), r("div", ee, "Cargando...")) : c.value.length ? (n(!0), r(k, { key: 2 }, z(c.value, (a, i) => (n(), r("button", {
|
|
156
|
+
key: g(a),
|
|
157
|
+
type: "button",
|
|
158
|
+
role: "option",
|
|
159
|
+
class: D(["gb-fe__item", { "gb-fe__item--sel": g(a) === _.value }]),
|
|
160
|
+
"aria-selected": g(a) === _.value,
|
|
161
|
+
tabindex: i === w.value ? 0 : -1,
|
|
162
|
+
title: a.detalle ? `${a.nombre}
|
|
163
|
+
${a.detalle}` : a.nombre,
|
|
164
|
+
onClick: (d) => h(a),
|
|
165
|
+
onDblclick: (d) => S(a)
|
|
166
|
+
}, [
|
|
167
|
+
o("span", le, [
|
|
168
|
+
a.tipo === "carpeta" ? (n(), r("svg", ne, [...t[3] || (t[3] = [
|
|
169
|
+
o("path", { d: "M2 5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2z" }, null, -1)
|
|
170
|
+
])])) : a.miniatura ? (n(), r("img", {
|
|
171
|
+
key: 1,
|
|
172
|
+
src: a.miniatura,
|
|
173
|
+
alt: "",
|
|
174
|
+
loading: "lazy",
|
|
175
|
+
draggable: "false"
|
|
176
|
+
}, null, 8, oe)) : (n(), r("svg", re, [...t[4] || (t[4] = [
|
|
177
|
+
o("path", { d: "M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z" }, null, -1)
|
|
178
|
+
])]))
|
|
179
|
+
]),
|
|
180
|
+
o("span", ie, f(a.nombre), 1)
|
|
181
|
+
], 42, te))), 128)) : (n(), r("div", ae, f(u.value ? "Sin resultados" : s.textoVacio), 1))
|
|
182
|
+
], 40, Z)
|
|
183
|
+
]),
|
|
184
|
+
o("div", se, [
|
|
185
|
+
o("span", null, f(c.value.length) + " elemento(s)", 1),
|
|
186
|
+
b.value ? (n(), r("span", ce, f([b.value.nombre, b.value.detalle].filter(Boolean).join(" · ")), 1)) : x("", !0)
|
|
187
|
+
])
|
|
188
|
+
]));
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
export {
|
|
192
|
+
be as GbFileExplorer,
|
|
193
|
+
be as default
|
|
194
|
+
};
|
|
195
|
+
//# sourceMappingURL=vue-greenborn-file-explorer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-greenborn-file-explorer.js","sources":["../src/components/GbFileExplorer.vue"],"sourcesContent":["<template>\n <div class=\"gb-fe\">\n <div class=\"gb-fe__barra\">\n <button type=\"button\" class=\"gb-fe__subir\" :disabled=\"ruta.length < 2\" title=\"Subir un nivel\" aria-label=\"Subir un nivel\" @click=\"subir\">↑</button>\n <nav class=\"gb-fe__ruta\" :data-help=\"ayuda.ruta\">\n <template v-for=\"(c, i) in ruta\" :key=\"c.id ?? 'raiz'\">\n <span v-if=\"i\" class=\"gb-fe__sep\">›</span>\n <button type=\"button\" class=\"gb-fe__miga\" :disabled=\"i === ruta.length - 1\" @click=\"navegar(c.id)\">{{ c.nombre }}</button>\n </template>\n </nav>\n <input v-model=\"filtro\" type=\"search\" class=\"gb-fe__buscar\" placeholder=\"Buscar en esta carpeta\" aria-label=\"Buscar en esta carpeta\" :data-help=\"ayuda.buscador\">\n </div>\n\n <div class=\"gb-fe__cuerpo\">\n <aside v-if=\"mostrarArbol\" class=\"gb-fe__arbol\" :data-help=\"ayuda.arbol\">\n <!-- La key vuelve a montar el árbol cuando cambian las carpetas (GbTreeView cachea los nodos). -->\n <GbTreeView :key=\"firmaArbol\" :cargar-nodos=\"cargarNodos\" @seleccionar=\"(n) => navegar(n.id)\">\n <template #nodo=\"{ nodo }\">\n <span :class=\"{ 'gb-fe__nodo--actual': nodo.id === carpetaActual }\">{{ nodo.nombre }}</span>\n </template>\n </GbTreeView>\n </aside>\n\n <div class=\"gb-fe__grilla\" role=\"listbox\" :data-help=\"ayuda.listado\" @click.self=\"seleccionar(null)\" @keydown=\"onTecla\">\n <div v-if=\"cargando\" class=\"gb-fe__aviso\">Cargando...</div>\n <div v-else-if=\"!visibles.length\" class=\"gb-fe__aviso\">{{ filtro ? 'Sin resultados' : textoVacio }}</div>\n <template v-else>\n <button v-for=\"(item, i) in visibles\" :key=\"clave(item)\" type=\"button\" role=\"option\" class=\"gb-fe__item\"\n :class=\"{ 'gb-fe__item--sel': clave(item) === claveSeleccion }\" :aria-selected=\"clave(item) === claveSeleccion\"\n :tabindex=\"i === indiceFoco ? 0 : -1\" :title=\"item.detalle ? `${item.nombre}\\n${item.detalle}` : item.nombre\"\n @click=\"seleccionar(item)\" @dblclick=\"abrir(item)\">\n <span class=\"gb-fe__miniatura\">\n <svg v-if=\"item.tipo === 'carpeta'\" class=\"gb-fe__icono gb-fe__icono--carpeta\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M2 5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2z\"/></svg>\n <img v-else-if=\"item.miniatura\" :src=\"item.miniatura\" alt=\"\" loading=\"lazy\" draggable=\"false\">\n <svg v-else class=\"gb-fe__icono\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z\"/></svg>\n </span>\n <span class=\"gb-fe__nombre\">{{ item.nombre }}</span>\n </button>\n </template>\n </div>\n </div>\n\n <div class=\"gb-fe__estado\">\n <span>{{ visibles.length }} elemento(s)</span>\n <span v-if=\"itemSeleccionado\">{{ [itemSeleccionado.nombre, itemSeleccionado.detalle].filter(Boolean).join(' · ') }}</span>\n </div>\n </div>\n</template>\n\n<script setup>\n import { computed, nextTick, ref, watch } from 'vue'\n import { GbTreeView } from '@greenborn/vue-greenborn-tree-view'\n import '@greenborn/vue-greenborn-tree-view/style.css'\n\n const props = defineProps({\n // Todas las carpetas: [{ id, padre_id, nombre }]. La raíz es padre_id null.\n carpetas: { type: Array, default: () => [] },\n // Archivos de la carpeta actual: [{ id, nombre, miniatura?, detalle? }].\n archivos: { type: Array, default: () => [] },\n carpetaActual: { type: [Number, String], default: null },\n nombreRaiz: { type: String, default: 'Inicio' },\n mostrarArbol: { type: Boolean, default: true },\n cargando: { type: Boolean, default: false },\n textoVacio: { type: String, default: 'Esta carpeta está vacía' },\n // Valores data-help opcionales: { ruta, buscador, arbol, listado }.\n ayuda: { type: Object, default: () => ({}) },\n })\n // seleccionar: item | null. Un item es { tipo: 'carpeta' | 'archivo', id, nombre, detalle, miniatura, dato }.\n const emit = defineEmits(['navegar', 'seleccionar', 'abrir'])\n\n const filtro = ref('')\n const claveSeleccion = ref(null)\n const clave = (item) => `${item.tipo}-${item.id}`\n\n const items = computed(() => [\n ...props.carpetas.filter((c) => c.padre_id === props.carpetaActual)\n .map((c) => ({ tipo: 'carpeta', id: c.id, nombre: c.nombre, dato: c })),\n ...props.archivos.map((a) => ({ tipo: 'archivo', id: a.id, nombre: a.nombre, detalle: a.detalle, miniatura: a.miniatura, dato: a })),\n ])\n const visibles = computed(() => {\n const texto = filtro.value.trim().toLowerCase()\n return texto ? items.value.filter((i) => i.nombre.toLowerCase().includes(texto)) : items.value\n })\n const itemSeleccionado = computed(() => visibles.value.find((i) => clave(i) === claveSeleccion.value) || null)\n const indiceFoco = computed(() => Math.max(0, visibles.value.indexOf(itemSeleccionado.value)))\n\n const ruta = computed(() => {\n const partes = []\n const vistos = new Set()\n let actual = props.carpetas.find((c) => c.id === props.carpetaActual)\n while (actual && !vistos.has(actual.id)) {\n vistos.add(actual.id)\n partes.unshift(actual)\n const padre = actual.padre_id\n actual = props.carpetas.find((c) => c.id === padre)\n }\n return [{ id: null, nombre: props.nombreRaiz }, ...partes]\n })\n\n const firmaArbol = computed(() => JSON.stringify(props.carpetas.map((c) => [c.id, c.padre_id, c.nombre])))\n const conHijas = (id) => props.carpetas.some((c) => c.padre_id === id)\n async function cargarNodos(padre) {\n const padreId = padre ? padre.id : null\n return props.carpetas.filter((c) => c.padre_id === padreId)\n .map((c) => ({ id: c.id, nombre: c.nombre, tieneHijos: conHijas(c.id) }))\n }\n\n function seleccionar(item) {\n claveSeleccion.value = item ? clave(item) : null\n emit('seleccionar', item)\n }\n function navegar(id) {\n if (id !== props.carpetaActual) emit('navegar', id)\n }\n function abrir(item) {\n if (item.tipo === 'carpeta') navegar(item.id)\n else emit('abrir', item)\n }\n function subir() {\n if (ruta.value.length > 1) navegar(ruta.value[ruta.value.length - 2].id)\n }\n function onTecla(e) {\n if (e.key === 'Backspace') { e.preventDefault(); return subir() }\n if (e.key === 'Escape') return seleccionar(null)\n if (e.key === 'Enter' && itemSeleccionado.value) { e.preventDefault(); return abrir(itemSeleccionado.value) }\n const paso = { ArrowLeft: -1, ArrowRight: 1 }[e.key]\n if (!paso || !visibles.value.length) return\n e.preventDefault()\n const i = Math.min(visibles.value.length - 1, Math.max(0, indiceFoco.value + paso))\n seleccionar(visibles.value[i])\n const grilla = e.currentTarget\n nextTick(() => grilla.querySelectorAll('.gb-fe__item')[i]?.focus())\n }\n\n // Al cambiar de carpeta o recargar los datos, la selección anterior deja de ser válida.\n watch(() => props.carpetaActual, () => { filtro.value = '' })\n watch([() => props.carpetaActual, () => props.carpetas, () => props.archivos, filtro], () => {\n if (claveSeleccion.value) seleccionar(null)\n })\n</script>\n"],"names":["props","__props","emit","__emit","filtro","ref","claveSeleccion","clave","item","items","computed","c","a","visibles","texto","i","itemSeleccionado","indiceFoco","ruta","partes","vistos","actual","padre","firmaArbol","conHijas","id","cargarNodos","padreId","seleccionar","navegar","abrir","subir","onTecla","paso","grilla","nextTick","_a","watch","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_Fragment","_renderList","_hoisted_5","$event","_toDisplayString","_hoisted_6","_hoisted_8","_createBlock","_unref","GbTreeView","n","_withCtx","nodo","_normalizeClass","_hoisted_11","_hoisted_14","_hoisted_15","_cache","_hoisted_17","_hoisted_18","_hoisted_12","_hoisted_19","_hoisted_20"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDE,UAAMA,IAAQC,GAcRC,IAAOC,GAEPC,IAASC,EAAI,EAAE,GACfC,IAAiBD,EAAI,IAAI,GACzBE,IAAQ,CAACC,MAAS,GAAGA,EAAK,IAAI,IAAIA,EAAK,EAAE,IAEzCC,IAAQC,EAAS,MAAM;AAAA,MAC3B,GAAGV,EAAM,SAAS,OAAO,CAACW,MAAMA,EAAE,aAAaX,EAAM,aAAa,EAC/D,IAAI,CAACW,OAAO,EAAE,MAAM,WAAW,IAAIA,EAAE,IAAI,QAAQA,EAAE,QAAQ,MAAMA,EAAC,EAAG;AAAA,MACxE,GAAGX,EAAM,SAAS,IAAI,CAACY,OAAO,EAAE,MAAM,WAAW,IAAIA,EAAE,IAAI,QAAQA,EAAE,QAAQ,SAASA,EAAE,SAAS,WAAWA,EAAE,WAAW,MAAMA,EAAC,EAAG;AAAA,IACvI,CAAG,GACKC,IAAWH,EAAS,MAAM;AAC9B,YAAMI,IAAQV,EAAO,MAAM,KAAI,EAAG,YAAW;AAC7C,aAAOU,IAAQL,EAAM,MAAM,OAAO,CAACM,MAAMA,EAAE,OAAO,YAAW,EAAG,SAASD,CAAK,CAAC,IAAIL,EAAM;AAAA,IAC3F,CAAC,GACKO,IAAmBN,EAAS,MAAMG,EAAS,MAAM,KAAK,CAACE,MAAMR,EAAMQ,CAAC,MAAMT,EAAe,KAAK,KAAK,IAAI,GACvGW,IAAaP,EAAS,MAAM,KAAK,IAAI,GAAGG,EAAS,MAAM,QAAQG,EAAiB,KAAK,CAAC,CAAC,GAEvFE,IAAOR,EAAS,MAAM;AAC1B,YAAMS,IAAS,CAAA,GACTC,IAAS,oBAAI,IAAG;AACtB,UAAIC,IAASr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AE,+DAA8D,GAAA,MAAA,EAAA;AAAA;;YAEhJA,EAAoD,QAApDsB,IAAoDf,EAArBxC,EAAK,MAAM,GAAA,CAAA;AAAA,iCAX9C8B,KAAAC,EAAyG,OAAzGyB,IAAyGhB,EAA/C5C,EAAA,2BAA4BH,EAAA,UAAU,GAAA,CAAA;AAAA;;MAiBpGwC,EAGM,OAHNwB,IAGM;AAAA,QAFJxB,EAA8C,QAAA,MAAAO,EAArCnC,EAAA,MAAS,MAAM,IAAG,gBAAY,CAAA;AAAA,QAC3BG,EAAA,SAAZsB,EAAA,GAAAC,EAA0H,QAAA2B,IAAAlB,EAAA,CAAxFhC,EAAA,MAAiB,QAAQA,EAAA,MAAiB,OAAO,EAAE,OAAO,OAAO,EAAE,KAAI,KAAA,CAAA,GAAA,CAAA;;;;;"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@greenborn/vue-greenborn-tree-view")):typeof define=="function"&&define.amd?define(["exports","vue","@greenborn/vue-greenborn-tree-view"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.VueGreenbornFileExplorer={},r.Vue,r.VueGreenbornTreeView))})(this,function(r,e,V){"use strict";const N={class:"gb-fe"},S={class:"gb-fe__barra"},x=["disabled"],w=["data-help"],A={key:0,class:"gb-fe__sep"},C=["disabled","onClick"],D=["data-help"],v={class:"gb-fe__cuerpo"},M=["data-help"],T=["data-help"],z={key:0,class:"gb-fe__aviso"},$={key:1,class:"gb-fe__aviso"},F=["aria-selected","tabindex","title","onClick","onDblclick"],j={class:"gb-fe__miniatura"},G={key:0,class:"gb-fe__icono gb-fe__icono--carpeta",viewBox:"0 0 24 24","aria-hidden":"true"},L=["src"],H={key:2,class:"gb-fe__icono",viewBox:"0 0 24 24","aria-hidden":"true"},O={class:"gb-fe__nombre"},q={class:"gb-fe__estado"},R={key:0},h={__name:"GbFileExplorer",props:{carpetas:{type:Array,default:()=>[]},archivos:{type:Array,default:()=>[]},carpetaActual:{type:[Number,String],default:null},nombreRaiz:{type:String,default:"Inicio"},mostrarArbol:{type:Boolean,default:!0},cargando:{type:Boolean,default:!1},textoVacio:{type:String,default:"Esta carpeta está vacía"},ayuda:{type:Object,default:()=>({})}},emits:["navegar","seleccionar","abrir"],setup(i,{emit:I}){const l=i,g=I,d=e.ref(""),b=e.ref(null),f=t=>`${t.tipo}-${t.id}`,k=e.computed(()=>[...l.carpetas.filter(t=>t.padre_id===l.carpetaActual).map(t=>({tipo:"carpeta",id:t.id,nombre:t.nombre,dato:t})),...l.archivos.map(t=>({tipo:"archivo",id:t.id,nombre:t.nombre,detalle:t.detalle,miniatura:t.miniatura,dato:t}))]),c=e.computed(()=>{const t=d.value.trim().toLowerCase();return t?k.value.filter(n=>n.nombre.toLowerCase().includes(t)):k.value}),p=e.computed(()=>c.value.find(t=>f(t)===b.value)||null),y=e.computed(()=>Math.max(0,c.value.indexOf(p.value))),u=e.computed(()=>{const t=[],n=new Set;let a=l.carpetas.find(o=>o.id===l.carpetaActual);for(;a&&!n.has(a.id);){n.add(a.id),t.unshift(a);const o=a.padre_id;a=l.carpetas.find(s=>s.id===o)}return[{id:null,nombre:l.nombreRaiz},...t]}),J=e.computed(()=>JSON.stringify(l.carpetas.map(t=>[t.id,t.padre_id,t.nombre]))),K=t=>l.carpetas.some(n=>n.padre_id===t);async function P(t){const n=t?t.id:null;return l.carpetas.filter(a=>a.padre_id===n).map(a=>({id:a.id,nombre:a.nombre,tieneHijos:K(a.id)}))}function m(t){b.value=t?f(t):null,g("seleccionar",t)}function _(t){t!==l.carpetaActual&&g("navegar",t)}function B(t){t.tipo==="carpeta"?_(t.id):g("abrir",t)}function E(){u.value.length>1&&_(u.value[u.value.length-2].id)}function U(t){if(t.key==="Backspace")return t.preventDefault(),E();if(t.key==="Escape")return m(null);if(t.key==="Enter"&&p.value)return t.preventDefault(),B(p.value);const n={ArrowLeft:-1,ArrowRight:1}[t.key];if(!n||!c.value.length)return;t.preventDefault();const a=Math.min(c.value.length-1,Math.max(0,y.value+n));m(c.value[a]);const o=t.currentTarget;e.nextTick(()=>{var s;return(s=o.querySelectorAll(".gb-fe__item")[a])==null?void 0:s.focus()})}return e.watch(()=>l.carpetaActual,()=>{d.value=""}),e.watch([()=>l.carpetaActual,()=>l.carpetas,()=>l.archivos,d],()=>{b.value&&m(null)}),(t,n)=>(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",S,[e.createElementVNode("button",{type:"button",class:"gb-fe__subir",disabled:u.value.length<2,title:"Subir un nivel","aria-label":"Subir un nivel",onClick:E},"↑",8,x),e.createElementVNode("nav",{class:"gb-fe__ruta","data-help":i.ayuda.ruta},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.id??"raiz"},[o?(e.openBlock(),e.createElementBlock("span",A,"›")):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"gb-fe__miga",disabled:o===u.value.length-1,onClick:s=>_(a.id)},e.toDisplayString(a.nombre),9,C)],64))),128))],8,w),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=a=>d.value=a),type:"search",class:"gb-fe__buscar",placeholder:"Buscar en esta carpeta","aria-label":"Buscar en esta carpeta","data-help":i.ayuda.buscador},null,8,D),[[e.vModelText,d.value]])]),e.createElementVNode("div",v,[i.mostrarArbol?(e.openBlock(),e.createElementBlock("aside",{key:0,class:"gb-fe__arbol","data-help":i.ayuda.arbol},[(e.openBlock(),e.createBlock(e.unref(V.GbTreeView),{key:J.value,"cargar-nodos":P,onSeleccionar:n[1]||(n[1]=a=>_(a.id))},{nodo:e.withCtx(({nodo:a})=>[e.createElementVNode("span",{class:e.normalizeClass({"gb-fe__nodo--actual":a.id===i.carpetaActual})},e.toDisplayString(a.nombre),3)]),_:1}))],8,M)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"gb-fe__grilla",role:"listbox","data-help":i.ayuda.listado,onClick:n[2]||(n[2]=e.withModifiers(a=>m(null),["self"])),onKeydown:U},[i.cargando?(e.openBlock(),e.createElementBlock("div",z,"Cargando...")):c.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(c.value,(a,o)=>(e.openBlock(),e.createElementBlock("button",{key:f(a),type:"button",role:"option",class:e.normalizeClass(["gb-fe__item",{"gb-fe__item--sel":f(a)===b.value}]),"aria-selected":f(a)===b.value,tabindex:o===y.value?0:-1,title:a.detalle?`${a.nombre}
|
|
2
|
+
${a.detalle}`:a.nombre,onClick:s=>m(a),onDblclick:s=>B(a)},[e.createElementVNode("span",j,[a.tipo==="carpeta"?(e.openBlock(),e.createElementBlock("svg",G,[...n[3]||(n[3]=[e.createElementVNode("path",{d:"M2 5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2z"},null,-1)])])):a.miniatura?(e.openBlock(),e.createElementBlock("img",{key:1,src:a.miniatura,alt:"",loading:"lazy",draggable:"false"},null,8,L)):(e.openBlock(),e.createElementBlock("svg",H,[...n[4]||(n[4]=[e.createElementVNode("path",{d:"M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"},null,-1)])]))]),e.createElementVNode("span",O,e.toDisplayString(a.nombre),1)],42,F))),128)):(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(d.value?"Sin resultados":i.textoVacio),1))],40,T)]),e.createElementVNode("div",q,[e.createElementVNode("span",null,e.toDisplayString(c.value.length)+" elemento(s)",1),p.value?(e.openBlock(),e.createElementBlock("span",R,e.toDisplayString([p.value.nombre,p.value.detalle].filter(Boolean).join(" · ")),1)):e.createCommentVNode("",!0)])]))}};r.GbFileExplorer=h,r.default=h,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
3
|
+
//# sourceMappingURL=vue-greenborn-file-explorer.umd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-greenborn-file-explorer.umd.cjs","sources":["../src/components/GbFileExplorer.vue"],"sourcesContent":["<template>\n <div class=\"gb-fe\">\n <div class=\"gb-fe__barra\">\n <button type=\"button\" class=\"gb-fe__subir\" :disabled=\"ruta.length < 2\" title=\"Subir un nivel\" aria-label=\"Subir un nivel\" @click=\"subir\">↑</button>\n <nav class=\"gb-fe__ruta\" :data-help=\"ayuda.ruta\">\n <template v-for=\"(c, i) in ruta\" :key=\"c.id ?? 'raiz'\">\n <span v-if=\"i\" class=\"gb-fe__sep\">›</span>\n <button type=\"button\" class=\"gb-fe__miga\" :disabled=\"i === ruta.length - 1\" @click=\"navegar(c.id)\">{{ c.nombre }}</button>\n </template>\n </nav>\n <input v-model=\"filtro\" type=\"search\" class=\"gb-fe__buscar\" placeholder=\"Buscar en esta carpeta\" aria-label=\"Buscar en esta carpeta\" :data-help=\"ayuda.buscador\">\n </div>\n\n <div class=\"gb-fe__cuerpo\">\n <aside v-if=\"mostrarArbol\" class=\"gb-fe__arbol\" :data-help=\"ayuda.arbol\">\n <!-- La key vuelve a montar el árbol cuando cambian las carpetas (GbTreeView cachea los nodos). -->\n <GbTreeView :key=\"firmaArbol\" :cargar-nodos=\"cargarNodos\" @seleccionar=\"(n) => navegar(n.id)\">\n <template #nodo=\"{ nodo }\">\n <span :class=\"{ 'gb-fe__nodo--actual': nodo.id === carpetaActual }\">{{ nodo.nombre }}</span>\n </template>\n </GbTreeView>\n </aside>\n\n <div class=\"gb-fe__grilla\" role=\"listbox\" :data-help=\"ayuda.listado\" @click.self=\"seleccionar(null)\" @keydown=\"onTecla\">\n <div v-if=\"cargando\" class=\"gb-fe__aviso\">Cargando...</div>\n <div v-else-if=\"!visibles.length\" class=\"gb-fe__aviso\">{{ filtro ? 'Sin resultados' : textoVacio }}</div>\n <template v-else>\n <button v-for=\"(item, i) in visibles\" :key=\"clave(item)\" type=\"button\" role=\"option\" class=\"gb-fe__item\"\n :class=\"{ 'gb-fe__item--sel': clave(item) === claveSeleccion }\" :aria-selected=\"clave(item) === claveSeleccion\"\n :tabindex=\"i === indiceFoco ? 0 : -1\" :title=\"item.detalle ? `${item.nombre}\\n${item.detalle}` : item.nombre\"\n @click=\"seleccionar(item)\" @dblclick=\"abrir(item)\">\n <span class=\"gb-fe__miniatura\">\n <svg v-if=\"item.tipo === 'carpeta'\" class=\"gb-fe__icono gb-fe__icono--carpeta\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M2 5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2z\"/></svg>\n <img v-else-if=\"item.miniatura\" :src=\"item.miniatura\" alt=\"\" loading=\"lazy\" draggable=\"false\">\n <svg v-else class=\"gb-fe__icono\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z\"/></svg>\n </span>\n <span class=\"gb-fe__nombre\">{{ item.nombre }}</span>\n </button>\n </template>\n </div>\n </div>\n\n <div class=\"gb-fe__estado\">\n <span>{{ visibles.length }} elemento(s)</span>\n <span v-if=\"itemSeleccionado\">{{ [itemSeleccionado.nombre, itemSeleccionado.detalle].filter(Boolean).join(' · ') }}</span>\n </div>\n </div>\n</template>\n\n<script setup>\n import { computed, nextTick, ref, watch } from 'vue'\n import { GbTreeView } from '@greenborn/vue-greenborn-tree-view'\n import '@greenborn/vue-greenborn-tree-view/style.css'\n\n const props = defineProps({\n // Todas las carpetas: [{ id, padre_id, nombre }]. La raíz es padre_id null.\n carpetas: { type: Array, default: () => [] },\n // Archivos de la carpeta actual: [{ id, nombre, miniatura?, detalle? }].\n archivos: { type: Array, default: () => [] },\n carpetaActual: { type: [Number, String], default: null },\n nombreRaiz: { type: String, default: 'Inicio' },\n mostrarArbol: { type: Boolean, default: true },\n cargando: { type: Boolean, default: false },\n textoVacio: { type: String, default: 'Esta carpeta está vacía' },\n // Valores data-help opcionales: { ruta, buscador, arbol, listado }.\n ayuda: { type: Object, default: () => ({}) },\n })\n // seleccionar: item | null. Un item es { tipo: 'carpeta' | 'archivo', id, nombre, detalle, miniatura, dato }.\n const emit = defineEmits(['navegar', 'seleccionar', 'abrir'])\n\n const filtro = ref('')\n const claveSeleccion = ref(null)\n const clave = (item) => `${item.tipo}-${item.id}`\n\n const items = computed(() => [\n ...props.carpetas.filter((c) => c.padre_id === props.carpetaActual)\n .map((c) => ({ tipo: 'carpeta', id: c.id, nombre: c.nombre, dato: c })),\n ...props.archivos.map((a) => ({ tipo: 'archivo', id: a.id, nombre: a.nombre, detalle: a.detalle, miniatura: a.miniatura, dato: a })),\n ])\n const visibles = computed(() => {\n const texto = filtro.value.trim().toLowerCase()\n return texto ? items.value.filter((i) => i.nombre.toLowerCase().includes(texto)) : items.value\n })\n const itemSeleccionado = computed(() => visibles.value.find((i) => clave(i) === claveSeleccion.value) || null)\n const indiceFoco = computed(() => Math.max(0, visibles.value.indexOf(itemSeleccionado.value)))\n\n const ruta = computed(() => {\n const partes = []\n const vistos = new Set()\n let actual = props.carpetas.find((c) => c.id === props.carpetaActual)\n while (actual && !vistos.has(actual.id)) {\n vistos.add(actual.id)\n partes.unshift(actual)\n const padre = actual.padre_id\n actual = props.carpetas.find((c) => c.id === padre)\n }\n return [{ id: null, nombre: props.nombreRaiz }, ...partes]\n })\n\n const firmaArbol = computed(() => JSON.stringify(props.carpetas.map((c) => [c.id, c.padre_id, c.nombre])))\n const conHijas = (id) => props.carpetas.some((c) => c.padre_id === id)\n async function cargarNodos(padre) {\n const padreId = padre ? padre.id : null\n return props.carpetas.filter((c) => c.padre_id === padreId)\n .map((c) => ({ id: c.id, nombre: c.nombre, tieneHijos: conHijas(c.id) }))\n }\n\n function seleccionar(item) {\n claveSeleccion.value = item ? clave(item) : null\n emit('seleccionar', item)\n }\n function navegar(id) {\n if (id !== props.carpetaActual) emit('navegar', id)\n }\n function abrir(item) {\n if (item.tipo === 'carpeta') navegar(item.id)\n else emit('abrir', item)\n }\n function subir() {\n if (ruta.value.length > 1) navegar(ruta.value[ruta.value.length - 2].id)\n }\n function onTecla(e) {\n if (e.key === 'Backspace') { e.preventDefault(); return subir() }\n if (e.key === 'Escape') return seleccionar(null)\n if (e.key === 'Enter' && itemSeleccionado.value) { e.preventDefault(); return abrir(itemSeleccionado.value) }\n const paso = { ArrowLeft: -1, ArrowRight: 1 }[e.key]\n if (!paso || !visibles.value.length) return\n e.preventDefault()\n const i = Math.min(visibles.value.length - 1, Math.max(0, indiceFoco.value + paso))\n seleccionar(visibles.value[i])\n const grilla = e.currentTarget\n nextTick(() => grilla.querySelectorAll('.gb-fe__item')[i]?.focus())\n }\n\n // Al cambiar de carpeta o recargar los datos, la selección anterior deja de ser válida.\n watch(() => props.carpetaActual, () => { filtro.value = '' })\n watch([() => props.carpetaActual, () => props.carpetas, () => props.archivos, filtro], () => {\n if (claveSeleccion.value) seleccionar(null)\n })\n</script>\n"],"names":["props","__props","emit","__emit","filtro","ref","claveSeleccion","clave","item","items","computed","c","a","visibles","texto","i","itemSeleccionado","indiceFoco","ruta","partes","vistos","actual","padre","firmaArbol","conHijas","id","cargarNodos","padreId","seleccionar","navegar","abrir","subir","onTecla","e","paso","grilla","nextTick","_a","watch","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_Fragment","_renderList","_hoisted_5","$event","_toDisplayString","_hoisted_6","_hoisted_8","_createBlock","_unref","GbTreeView","n","_withCtx","nodo","_normalizeClass","_hoisted_11","_hoisted_14","_hoisted_15","_cache","_hoisted_17","_hoisted_18","_hoisted_12","_hoisted_19","_hoisted_20"],"mappings":"63CAsDE,MAAMA,EAAQC,EAcRC,EAAOC,EAEPC,EAASC,EAAAA,IAAI,EAAE,EACfC,EAAiBD,EAAAA,IAAI,IAAI,EACzBE,EAASC,GAAS,GAAGA,EAAK,IAAI,IA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n/vue-greenborn-file-explorer",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Explorador de archivos para Vue 3 (carpetas y miniaturas, árbol lateral, ruta, buscador y teclado). Sin backend: el consumidor provee los datos.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"main": "./dist/vue-greenborn-file-explorer.umd.cjs",
|
|
10
|
+
"module": "./dist/vue-greenborn-file-explorer.js",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/vue-greenborn-file-explorer.js",
|
|
14
|
+
"require": "./dist/vue-greenborn-file-explorer.umd.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./style.css": "./dist/vue-greenborn-file-explorer.css",
|
|
17
|
+
"./dist/style.css": "./dist/vue-greenborn-file-explorer.css"
|
|
18
|
+
},
|
|
19
|
+
"style": "./dist/vue-greenborn-file-explorer.css",
|
|
20
|
+
"sideEffects": [
|
|
21
|
+
"*.css"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"build": "vite build",
|
|
26
|
+
"prepublishOnly": "npm run build",
|
|
27
|
+
"preview": "vite preview"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"vue",
|
|
31
|
+
"vue3",
|
|
32
|
+
"file-explorer",
|
|
33
|
+
"thumbnails",
|
|
34
|
+
"folders",
|
|
35
|
+
"greenborn"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"author": {
|
|
39
|
+
"name": "2012lucho",
|
|
40
|
+
"email": "lucho.2012.tandil@gmail.com"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/Greenborn/opencode_dev/tree/main/vue-greenborn-file-explorer",
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/Greenborn/opencode_dev.git"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"vue": "^3.3.0",
|
|
52
|
+
"@greenborn/vue-greenborn-tree-view": "^1.0.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
56
|
+
"vite": "^5.2.0",
|
|
57
|
+
"vue": "^3.4.0",
|
|
58
|
+
"@greenborn/vue-greenborn-tree-view": "^1.0.0"
|
|
59
|
+
}
|
|
60
|
+
}
|