@floegence/floe-webapp-core 0.8.1 → 0.8.2
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.
|
@@ -5,6 +5,8 @@ export interface FileBrowserProviderProps {
|
|
|
5
5
|
files: FileItem[];
|
|
6
6
|
initialPath?: string;
|
|
7
7
|
initialViewMode?: ViewMode;
|
|
8
|
+
/** Label for the root/home directory in breadcrumb (default: 'Root') */
|
|
9
|
+
homeLabel?: string;
|
|
8
10
|
onNavigate?: (path: string) => void;
|
|
9
11
|
onSelect?: (items: FileItem[]) => void;
|
|
10
12
|
onOpen?: (item: FileItem) => void;
|
|
@@ -133,6 +133,7 @@ export interface FileBrowserContextValue {
|
|
|
133
133
|
setCurrentPath: (path: string) => void;
|
|
134
134
|
navigateUp: () => void;
|
|
135
135
|
navigateTo: (item: FileItem) => void;
|
|
136
|
+
homeLabel: Accessor<string>;
|
|
136
137
|
selectedItems: Accessor<Set<string>>;
|
|
137
138
|
selectItem: (id: string, multi?: boolean) => void;
|
|
138
139
|
clearSelection: () => void;
|
package/dist/index41.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createContext as
|
|
1
|
+
import { createComponent as me } from "solid-js/web";
|
|
2
|
+
import { createContext as we, createSignal as a, createMemo as N, useContext as Pe } from "solid-js";
|
|
3
3
|
import { deferNonBlocking as I } from "./index70.js";
|
|
4
|
-
const
|
|
5
|
-
function Q(r,
|
|
6
|
-
if (!
|
|
7
|
-
const x = r.toLowerCase(), w =
|
|
4
|
+
const R = we();
|
|
5
|
+
function Q(r, h) {
|
|
6
|
+
if (!h) return [];
|
|
7
|
+
const x = r.toLowerCase(), w = h.toLowerCase(), p = [];
|
|
8
8
|
let g = 0;
|
|
9
9
|
for (const S of w) {
|
|
10
10
|
const m = x.indexOf(S, g);
|
|
11
11
|
if (m === -1) return null;
|
|
12
|
-
|
|
12
|
+
p.push(m), g = m + 1;
|
|
13
13
|
}
|
|
14
|
-
return
|
|
14
|
+
return p;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const [
|
|
16
|
+
function ye(r) {
|
|
17
|
+
const [h, x] = a(r.initialPath ?? "/"), [w, p] = a(/* @__PURE__ */ new Set()), [g, S] = a(r.initialViewMode ?? "list"), [m, V] = a({
|
|
18
18
|
field: "name",
|
|
19
19
|
direction: "asc"
|
|
20
|
-
}), [M,
|
|
20
|
+
}), [M, b] = a(/* @__PURE__ */ new Set(["/"])), [j, D] = a(!1), [G, O] = a(null), [v, k] = a(""), [H, B] = a(!1), J = () => r.homeLabel ?? "Root", [z, P] = a([]);
|
|
21
21
|
let u = null, C = {
|
|
22
22
|
top: 0,
|
|
23
23
|
left: 0
|
|
@@ -25,12 +25,12 @@ function Ce(r) {
|
|
|
25
25
|
const A = () => r.files, c = (e) => {
|
|
26
26
|
const t = (e ?? "").trim();
|
|
27
27
|
return t === "" ? "/" : t;
|
|
28
|
-
},
|
|
28
|
+
}, L = (e) => {
|
|
29
29
|
const t = c(e);
|
|
30
30
|
if (t === "/") return "/";
|
|
31
31
|
const n = t.split("/").filter(Boolean);
|
|
32
32
|
return n.pop(), n.length ? "/" + n.join("/") : "/";
|
|
33
|
-
},
|
|
33
|
+
}, K = (e, t) => {
|
|
34
34
|
const n = z();
|
|
35
35
|
if (n.length === 0) return e;
|
|
36
36
|
let s = [...e];
|
|
@@ -46,13 +46,13 @@ function Ce(r) {
|
|
|
46
46
|
const l = c(o.oldPath), i = s.findIndex((f) => c(f.path) === l);
|
|
47
47
|
if (i !== -1) {
|
|
48
48
|
const f = o.updates.path ?? s[i].path;
|
|
49
|
-
|
|
49
|
+
L(f) === d ? s[i] = {
|
|
50
50
|
...s[i],
|
|
51
51
|
...o.updates
|
|
52
52
|
} : s.splice(i, 1);
|
|
53
53
|
} else {
|
|
54
54
|
const f = o.updates.path;
|
|
55
|
-
f &&
|
|
55
|
+
f && L(f);
|
|
56
56
|
}
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
@@ -62,17 +62,17 @@ function Ce(r) {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
return s;
|
|
65
|
-
},
|
|
65
|
+
}, W = N(() => {
|
|
66
66
|
const e = /* @__PURE__ */ new Map(), t = (s) => {
|
|
67
67
|
var d;
|
|
68
68
|
for (const o of s)
|
|
69
69
|
o.type === "folder" && (e.set(c(o.path), o.children ?? []), (d = o.children) != null && d.length && t(o.children));
|
|
70
70
|
}, n = A();
|
|
71
71
|
return e.set("/", n), t(n), e;
|
|
72
|
-
}),
|
|
73
|
-
const e = c(
|
|
74
|
-
let t =
|
|
75
|
-
t =
|
|
72
|
+
}), T = N(() => {
|
|
73
|
+
const e = c(h());
|
|
74
|
+
let t = W().get(e) ?? [];
|
|
75
|
+
t = K(t, e);
|
|
76
76
|
const n = v().trim();
|
|
77
77
|
n && (t = t.filter((o) => Q(o.name, n) !== null));
|
|
78
78
|
const s = m();
|
|
@@ -100,69 +100,69 @@ function Ce(r) {
|
|
|
100
100
|
}), y = (e) => {
|
|
101
101
|
var s;
|
|
102
102
|
const t = c(e);
|
|
103
|
-
x(t),
|
|
103
|
+
x(t), p(/* @__PURE__ */ new Set()), k(""), B(!1);
|
|
104
104
|
const n = r.onSelect;
|
|
105
105
|
I(() => n == null ? void 0 : n([])), (s = r.onNavigate) == null || s.call(r, t);
|
|
106
|
-
},
|
|
107
|
-
const e =
|
|
106
|
+
}, X = () => {
|
|
107
|
+
const e = h();
|
|
108
108
|
if (e === "/" || e === "") return;
|
|
109
109
|
const t = e.split("/").filter(Boolean);
|
|
110
110
|
t.pop(), y(t.length ? "/" + t.join("/") : "/");
|
|
111
|
-
},
|
|
112
|
-
e.type === "folder" && (y(e.path),
|
|
111
|
+
}, U = (e) => {
|
|
112
|
+
e.type === "folder" && (y(e.path), b((t) => {
|
|
113
113
|
const n = new Set(t);
|
|
114
114
|
return n.add(e.path), n;
|
|
115
115
|
}));
|
|
116
|
-
},
|
|
116
|
+
}, Y = (e, t = !1) => {
|
|
117
117
|
const n = w(), s = t ? new Set(n) : /* @__PURE__ */ new Set();
|
|
118
|
-
t ? s.has(e) ? s.delete(e) : s.add(e) : (s.clear(), s.add(e)),
|
|
119
|
-
const d =
|
|
118
|
+
t ? s.has(e) ? s.delete(e) : s.add(e) : (s.clear(), s.add(e)), p(s);
|
|
119
|
+
const d = T().filter((l) => s.has(l.id)), o = r.onSelect;
|
|
120
120
|
I(() => o == null ? void 0 : o(d));
|
|
121
|
-
},
|
|
122
|
-
|
|
121
|
+
}, Z = () => {
|
|
122
|
+
p(/* @__PURE__ */ new Set());
|
|
123
123
|
const e = r.onSelect;
|
|
124
124
|
I(() => e == null ? void 0 : e([]));
|
|
125
|
-
},
|
|
126
|
-
|
|
125
|
+
}, _ = (e) => w().has(e), $ = (e) => {
|
|
126
|
+
b((t) => {
|
|
127
127
|
const n = new Set(t);
|
|
128
128
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
129
129
|
});
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
},
|
|
130
|
+
}, ee = (e) => M().has(e), te = () => D((e) => !e), ne = (e) => O(e), oe = () => O(null), se = (e) => {
|
|
131
|
+
k(e);
|
|
132
|
+
}, re = (e) => {
|
|
133
133
|
const t = v().trim();
|
|
134
134
|
if (!t) return null;
|
|
135
135
|
const n = Q(e, t);
|
|
136
136
|
return n ? {
|
|
137
137
|
matchedIndices: n
|
|
138
138
|
} : null;
|
|
139
|
-
}, re = (e) => {
|
|
140
|
-
var t;
|
|
141
|
-
e.type === "folder" ? E(e) : (t = r.onOpen) == null || t.call(r, e);
|
|
142
139
|
}, ie = (e) => {
|
|
140
|
+
var t;
|
|
141
|
+
e.type === "folder" ? U(e) : (t = r.onOpen) == null || t.call(r, e);
|
|
142
|
+
}, ce = (e) => {
|
|
143
143
|
e.length !== 0 && P((t) => [...t, {
|
|
144
144
|
type: "remove",
|
|
145
145
|
paths: e
|
|
146
146
|
}]);
|
|
147
|
-
},
|
|
147
|
+
}, le = (e, t) => {
|
|
148
148
|
P((n) => [...n, {
|
|
149
149
|
type: "update",
|
|
150
150
|
oldPath: e,
|
|
151
151
|
updates: t
|
|
152
152
|
}]);
|
|
153
|
-
},
|
|
153
|
+
}, ae = (e, t) => {
|
|
154
154
|
P((n) => [...n, {
|
|
155
155
|
type: "insert",
|
|
156
156
|
parentPath: e,
|
|
157
157
|
item: t
|
|
158
158
|
}]);
|
|
159
|
-
}, ae = () => {
|
|
160
|
-
P([]);
|
|
161
159
|
}, de = () => {
|
|
162
160
|
P([]);
|
|
163
|
-
}, fe = () =>
|
|
161
|
+
}, fe = () => {
|
|
162
|
+
P([]);
|
|
163
|
+
}, ue = () => z().length > 0, he = (e) => {
|
|
164
164
|
u = e;
|
|
165
|
-
},
|
|
165
|
+
}, E = () => u ? {
|
|
166
166
|
top: u.scrollTop,
|
|
167
167
|
left: u.scrollLeft
|
|
168
168
|
} : {
|
|
@@ -171,66 +171,67 @@ function Ce(r) {
|
|
|
171
171
|
}, q = (e) => {
|
|
172
172
|
u && (u.scrollTop = e.top, u.scrollLeft = e.left);
|
|
173
173
|
}, pe = {
|
|
174
|
-
currentPath:
|
|
174
|
+
currentPath: h,
|
|
175
175
|
setCurrentPath: y,
|
|
176
|
-
navigateUp:
|
|
177
|
-
navigateTo:
|
|
176
|
+
navigateUp: X,
|
|
177
|
+
navigateTo: U,
|
|
178
|
+
homeLabel: J,
|
|
178
179
|
selectedItems: () => w(),
|
|
179
|
-
selectItem:
|
|
180
|
-
clearSelection:
|
|
181
|
-
isSelected:
|
|
180
|
+
selectItem: Y,
|
|
181
|
+
clearSelection: Z,
|
|
182
|
+
isSelected: _,
|
|
182
183
|
viewMode: g,
|
|
183
184
|
setViewMode: S,
|
|
184
185
|
sortConfig: m,
|
|
185
|
-
setSortConfig:
|
|
186
|
+
setSortConfig: V,
|
|
186
187
|
expandedFolders: M,
|
|
187
|
-
toggleFolder:
|
|
188
|
-
isExpanded:
|
|
188
|
+
toggleFolder: $,
|
|
189
|
+
isExpanded: ee,
|
|
189
190
|
files: A,
|
|
190
|
-
currentFiles:
|
|
191
|
+
currentFiles: T,
|
|
191
192
|
filterQuery: v,
|
|
192
|
-
setFilterQuery:
|
|
193
|
+
setFilterQuery: se,
|
|
193
194
|
isFilterActive: H,
|
|
194
195
|
setFilterActive: B,
|
|
195
|
-
getFilterMatch:
|
|
196
|
-
sidebarCollapsed:
|
|
197
|
-
toggleSidebar:
|
|
196
|
+
getFilterMatch: re,
|
|
197
|
+
sidebarCollapsed: j,
|
|
198
|
+
toggleSidebar: te,
|
|
198
199
|
contextMenu: G,
|
|
199
|
-
showContextMenu:
|
|
200
|
-
hideContextMenu:
|
|
201
|
-
openItem:
|
|
200
|
+
showContextMenu: ne,
|
|
201
|
+
hideContextMenu: oe,
|
|
202
|
+
openItem: ie,
|
|
202
203
|
// Optimistic updates
|
|
203
|
-
optimisticRemove:
|
|
204
|
-
optimisticUpdate:
|
|
205
|
-
optimisticInsert:
|
|
206
|
-
clearOptimisticUpdates:
|
|
207
|
-
rollbackOptimisticUpdates:
|
|
208
|
-
hasOptimisticUpdates:
|
|
204
|
+
optimisticRemove: ce,
|
|
205
|
+
optimisticUpdate: le,
|
|
206
|
+
optimisticInsert: ae,
|
|
207
|
+
clearOptimisticUpdates: de,
|
|
208
|
+
rollbackOptimisticUpdates: fe,
|
|
209
|
+
hasOptimisticUpdates: ue,
|
|
209
210
|
// Scroll position management
|
|
210
|
-
setScrollContainer:
|
|
211
|
-
getScrollPosition:
|
|
211
|
+
setScrollContainer: he,
|
|
212
|
+
getScrollPosition: E,
|
|
212
213
|
setScrollPosition: q,
|
|
213
|
-
saveScrollPosition: () => (C =
|
|
214
|
+
saveScrollPosition: () => (C = E(), C),
|
|
214
215
|
restoreScrollPosition: () => {
|
|
215
216
|
requestAnimationFrame(() => {
|
|
216
217
|
q(C);
|
|
217
218
|
});
|
|
218
219
|
}
|
|
219
220
|
};
|
|
220
|
-
return
|
|
221
|
+
return me(R.Provider, {
|
|
221
222
|
value: pe,
|
|
222
223
|
get children() {
|
|
223
224
|
return r.children;
|
|
224
225
|
}
|
|
225
226
|
});
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
-
const r =
|
|
228
|
+
function Fe() {
|
|
229
|
+
const r = Pe(R);
|
|
229
230
|
if (!r)
|
|
230
231
|
throw new Error("useFileBrowser must be used within a FileBrowserProvider");
|
|
231
232
|
return r;
|
|
232
233
|
}
|
|
233
234
|
export {
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
ye as FileBrowserProvider,
|
|
236
|
+
Fe as useFileBrowser
|
|
236
237
|
};
|
package/dist/index46.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { delegateEvents as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { delegateEvents as A, template as b, insert as R, createComponent as a, memo as H, effect as x, className as W, use as P } from "solid-js/web";
|
|
2
|
+
import { createSignal as y, onMount as B, createMemo as M, For as O, Show as T, onCleanup as F } from "solid-js";
|
|
3
|
+
import { cn as C } from "./index69.js";
|
|
4
4
|
import { useFileBrowser as G } from "./index41.js";
|
|
5
|
-
import { ChevronRight as
|
|
5
|
+
import { ChevronRight as E } from "./index34.js";
|
|
6
6
|
import { Dropdown as z } from "./index24.js";
|
|
7
|
-
var X = /* @__PURE__ */
|
|
8
|
-
const
|
|
9
|
-
function V(
|
|
10
|
-
const
|
|
11
|
-
return Math.min(
|
|
7
|
+
var X = /* @__PURE__ */ b("<nav aria-label=Breadcrumb>"), j = /* @__PURE__ */ b('<button type=button title="Show hidden path segments">…'), q = /* @__PURE__ */ b('<button type=button><span class="truncate max-w-[120px] block">');
|
|
8
|
+
const p = 16, J = 28, D = 12, K = 7, Q = 120, U = 100;
|
|
9
|
+
function V(r) {
|
|
10
|
+
const n = r.length * K;
|
|
11
|
+
return Math.min(n + D, Q + D);
|
|
12
12
|
}
|
|
13
|
-
function ce(
|
|
14
|
-
const
|
|
13
|
+
function ce(r) {
|
|
14
|
+
const n = G();
|
|
15
15
|
let s;
|
|
16
|
-
const [t, c] =
|
|
17
|
-
|
|
16
|
+
const [t, c] = y(0);
|
|
17
|
+
B(() => {
|
|
18
18
|
if (!s) return;
|
|
19
19
|
const e = () => {
|
|
20
20
|
s && c(s.offsetWidth);
|
|
@@ -23,25 +23,25 @@ function ce(n) {
|
|
|
23
23
|
const o = new ResizeObserver(e);
|
|
24
24
|
o.observe(s), F(() => o.disconnect());
|
|
25
25
|
});
|
|
26
|
-
const d =
|
|
27
|
-
const e =
|
|
26
|
+
const d = M(() => {
|
|
27
|
+
const e = n.currentPath(), o = n.homeLabel();
|
|
28
28
|
if (e === "/" || e === "")
|
|
29
29
|
return [{
|
|
30
|
-
name:
|
|
30
|
+
name: o,
|
|
31
31
|
path: "/"
|
|
32
32
|
}];
|
|
33
|
-
const
|
|
34
|
-
name:
|
|
33
|
+
const l = e.split("/").filter(Boolean), i = [{
|
|
34
|
+
name: o,
|
|
35
35
|
path: "/"
|
|
36
36
|
}];
|
|
37
|
-
let
|
|
38
|
-
for (const
|
|
39
|
-
|
|
40
|
-
name:
|
|
41
|
-
path:
|
|
37
|
+
let f = "";
|
|
38
|
+
for (const g of l)
|
|
39
|
+
f += "/" + g, i.push({
|
|
40
|
+
name: g,
|
|
41
|
+
path: f
|
|
42
42
|
});
|
|
43
43
|
return i;
|
|
44
|
-
}), m =
|
|
44
|
+
}), m = M(() => {
|
|
45
45
|
const e = d(), o = t();
|
|
46
46
|
if (o < U || e.length <= 2)
|
|
47
47
|
return {
|
|
@@ -49,73 +49,73 @@ function ce(n) {
|
|
|
49
49
|
visible: e,
|
|
50
50
|
shouldCollapse: !1
|
|
51
51
|
};
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
52
|
+
const l = e.map((u) => V(u.name)), i = l[0], f = l[e.length - 1], g = p, $ = e.length > 1 ? p : 0, _ = i + f + g + $;
|
|
53
|
+
if (_ > o && e.length > 2)
|
|
54
54
|
return {
|
|
55
55
|
collapsed: e.slice(1, -1),
|
|
56
56
|
visible: [e[0], e[e.length - 1]],
|
|
57
57
|
shouldCollapse: !0
|
|
58
58
|
};
|
|
59
|
-
const h = e.slice(1, -1),
|
|
60
|
-
let
|
|
61
|
-
const
|
|
59
|
+
const h = e.slice(1, -1), v = [];
|
|
60
|
+
let w = o - _;
|
|
61
|
+
const L = h.length > 0 ? J + p : 0;
|
|
62
62
|
for (let u = h.length - 1; u >= 0; u--) {
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
|
|
63
|
+
const k = l[u + 1] + p, N = u > 0 ? L : 0;
|
|
64
|
+
if (w - N >= k)
|
|
65
|
+
v.unshift(h[u]), w -= k;
|
|
66
66
|
else
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const I = h.slice(0, h.length - v.length);
|
|
70
70
|
return {
|
|
71
|
-
collapsed:
|
|
72
|
-
visible: [e[0], ...
|
|
73
|
-
shouldCollapse:
|
|
71
|
+
collapsed: I,
|
|
72
|
+
visible: [e[0], ...v, e[e.length - 1]],
|
|
73
|
+
shouldCollapse: I.length > 0
|
|
74
74
|
};
|
|
75
|
-
}),
|
|
76
|
-
|
|
75
|
+
}), S = (e) => {
|
|
76
|
+
n.setCurrentPath(e.path);
|
|
77
77
|
};
|
|
78
78
|
return (() => {
|
|
79
79
|
var e = X(), o = s;
|
|
80
|
-
return typeof o == "function" ?
|
|
80
|
+
return typeof o == "function" ? P(o, e) : s = e, R(e, a(O, {
|
|
81
81
|
get each() {
|
|
82
82
|
return m().visible;
|
|
83
83
|
},
|
|
84
|
-
children: (
|
|
84
|
+
children: (l, i) => [a(T, {
|
|
85
85
|
get when() {
|
|
86
|
-
return
|
|
86
|
+
return i() > 0;
|
|
87
87
|
},
|
|
88
88
|
get children() {
|
|
89
|
-
return a(
|
|
89
|
+
return a(E, {
|
|
90
90
|
class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
}), a(
|
|
93
|
+
}), a(T, {
|
|
94
94
|
get when() {
|
|
95
|
-
return
|
|
95
|
+
return H(() => !!m().shouldCollapse)() && i() === 1;
|
|
96
96
|
},
|
|
97
97
|
get children() {
|
|
98
98
|
return [a(Y, {
|
|
99
99
|
get segments() {
|
|
100
100
|
return m().collapsed;
|
|
101
101
|
},
|
|
102
|
-
onSelect:
|
|
103
|
-
}), a(
|
|
102
|
+
onSelect: S
|
|
103
|
+
}), a(E, {
|
|
104
104
|
class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
|
|
105
105
|
})];
|
|
106
106
|
}
|
|
107
107
|
}), a(Z, {
|
|
108
|
-
segment:
|
|
108
|
+
segment: l,
|
|
109
109
|
get isLast() {
|
|
110
|
-
return
|
|
110
|
+
return i() === m().visible.length - 1;
|
|
111
111
|
},
|
|
112
|
-
onClick: () =>
|
|
112
|
+
onClick: () => S(l)
|
|
113
113
|
})]
|
|
114
|
-
})),
|
|
114
|
+
})), x(() => W(e, C("flex items-center gap-1 min-w-0 overflow-hidden", r.class))), e;
|
|
115
115
|
})();
|
|
116
116
|
}
|
|
117
|
-
function Y(
|
|
118
|
-
const
|
|
117
|
+
function Y(r) {
|
|
118
|
+
const n = () => r.segments.map((t) => ({
|
|
119
119
|
id: t.path,
|
|
120
120
|
label: t.name
|
|
121
121
|
}));
|
|
@@ -123,32 +123,32 @@ function Y(n) {
|
|
|
123
123
|
get trigger() {
|
|
124
124
|
return (() => {
|
|
125
125
|
var t = j();
|
|
126
|
-
return
|
|
126
|
+
return x(() => W(t, C("text-xs px-1.5 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-all duration-100", "text-muted-foreground hover:text-foreground hover:bg-muted/50", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"))), t;
|
|
127
127
|
})();
|
|
128
128
|
},
|
|
129
129
|
get items() {
|
|
130
|
-
return
|
|
130
|
+
return n();
|
|
131
131
|
},
|
|
132
132
|
onSelect: (t) => {
|
|
133
|
-
const c =
|
|
134
|
-
c &&
|
|
133
|
+
const c = r.segments.find((d) => d.path === t);
|
|
134
|
+
c && r.onSelect(c);
|
|
135
135
|
},
|
|
136
136
|
align: "start"
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
|
-
function Z(
|
|
139
|
+
function Z(r) {
|
|
140
140
|
return (() => {
|
|
141
|
-
var
|
|
142
|
-
return
|
|
143
|
-
var c =
|
|
144
|
-
return c !== t.e && (
|
|
141
|
+
var n = q(), s = n.firstChild;
|
|
142
|
+
return n.$$click = () => r.onClick(), R(s, () => r.segment.name), x((t) => {
|
|
143
|
+
var c = r.isLast, d = C("text-xs px-1.5 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-all duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", r.isLast ? "font-medium text-foreground cursor-default" : "text-muted-foreground hover:text-foreground hover:bg-muted/50");
|
|
144
|
+
return c !== t.e && (n.disabled = t.e = c), d !== t.t && W(n, t.t = d), t;
|
|
145
145
|
}, {
|
|
146
146
|
e: void 0,
|
|
147
147
|
t: void 0
|
|
148
|
-
}),
|
|
148
|
+
}), n;
|
|
149
149
|
})();
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
A(["click"]);
|
|
152
152
|
export {
|
|
153
153
|
ce as Breadcrumb
|
|
154
154
|
};
|