@floegence/floe-webapp-core 0.1.7 → 0.1.9
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/index22.js +177 -144
- package/dist/index3.js +69 -62
- package/package.json +1 -1
package/dist/index22.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { delegateEvents as
|
|
2
|
-
import { createUniqueId as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Restore as
|
|
6
|
-
import { lockBodyStyle as
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
const
|
|
1
|
+
import { delegateEvents as Me, createComponent as l, Portal as Se, template as O, insert as b, effect as u, setAttribute as ae, addEventListener as z, className as w, memo as Ie, setStyleProperty as D, use as $e } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as Pe, createSignal as I, onMount as Ce, onCleanup as de, createEffect as he, Show as P } from "solid-js";
|
|
3
|
+
import { cn as j } from "./index62.js";
|
|
4
|
+
import { Button as ce } from "./index19.js";
|
|
5
|
+
import { Restore as Ee, Maximize as We, X as _e } from "./index30.js";
|
|
6
|
+
import { lockBodyStyle as He } from "./index66.js";
|
|
7
|
+
var Xe = /* @__PURE__ */ O('<h2 class="text-sm font-medium truncate select-none">'), De = /* @__PURE__ */ O('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), y = /* @__PURE__ */ O("<div style=touch-action:none>"), Le = /* @__PURE__ */ O('<div role=dialog aria-modal=true><div style=touch-action:none><div class="flex-1 min-w-0"></div><div class="flex items-center gap-0.5 -mr-1"></div></div><div class="flex-1 overflow-auto p-3">');
|
|
8
|
+
function Te(i) {
|
|
9
|
+
const G = () => i.resizable ?? !0, K = () => i.draggable ?? !0, L = () => i.minSize ?? {
|
|
10
10
|
width: 200,
|
|
11
11
|
height: 150
|
|
12
|
-
},
|
|
12
|
+
}, Y = () => i.maxSize ?? {
|
|
13
13
|
width: 1 / 0,
|
|
14
14
|
height: 1 / 0
|
|
15
|
-
},
|
|
15
|
+
}, ue = () => i.zIndex ?? 100, we = Pe(), R = 768, C = 16, [F, ge] = I(typeof window < "u" ? window.innerWidth < R : !1), Z = () => `floating-window-${we}-title`, [E, p] = I(i.defaultPosition ?? {
|
|
16
16
|
x: 0,
|
|
17
17
|
y: 0
|
|
18
|
-
}), [
|
|
18
|
+
}), [M, W] = I(i.defaultSize ?? {
|
|
19
19
|
width: 400,
|
|
20
20
|
height: 300
|
|
21
|
-
}), [
|
|
22
|
-
let
|
|
21
|
+
}), [h, J] = I(!1), [me, Q] = I(!1), [fe, V] = I(!1), [xe, ve] = I(null);
|
|
22
|
+
let T = {
|
|
23
23
|
x: 0,
|
|
24
24
|
y: 0
|
|
25
|
-
},
|
|
25
|
+
}, q = {
|
|
26
26
|
x: 0,
|
|
27
27
|
y: 0
|
|
28
|
-
},
|
|
28
|
+
}, B = {
|
|
29
29
|
x: 0,
|
|
30
30
|
y: 0
|
|
31
|
-
},
|
|
31
|
+
}, S = {
|
|
32
32
|
width: 0,
|
|
33
33
|
height: 0
|
|
34
|
-
},
|
|
34
|
+
}, _ = {
|
|
35
35
|
x: 0,
|
|
36
36
|
y: 0
|
|
37
|
-
},
|
|
37
|
+
}, H = "se", a, g = null, m = null, X = {
|
|
38
38
|
x: 0,
|
|
39
39
|
y: 0
|
|
40
|
-
},
|
|
41
|
-
const
|
|
40
|
+
}, $ = null, f = null;
|
|
41
|
+
const be = {
|
|
42
42
|
n: "ns-resize",
|
|
43
43
|
s: "ns-resize",
|
|
44
44
|
e: "ew-resize",
|
|
@@ -47,122 +47,148 @@ function Fe(i) {
|
|
|
47
47
|
nw: "nwse-resize",
|
|
48
48
|
se: "nwse-resize",
|
|
49
49
|
sw: "nesw-resize"
|
|
50
|
-
},
|
|
50
|
+
}, N = (t, n) => {
|
|
51
51
|
if (!t) {
|
|
52
|
-
|
|
52
|
+
f == null || f(), f = null;
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
f == null || f(), f = He({
|
|
56
56
|
cursor: n,
|
|
57
57
|
"user-select": "none"
|
|
58
58
|
});
|
|
59
|
-
},
|
|
60
|
-
if (
|
|
59
|
+
}, ee = (t) => {
|
|
60
|
+
if ($ !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame($), $ = null), t !== void 0)
|
|
61
61
|
try {
|
|
62
|
-
|
|
62
|
+
a == null || a.releasePointerCapture(t);
|
|
63
63
|
} catch {
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
g = null, m = null, Q(!1), V(!1), N(!1, "");
|
|
66
66
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
Ce(() => {
|
|
68
|
+
const t = () => {
|
|
69
|
+
const n = window.innerWidth < R;
|
|
70
|
+
if (ge(n), n && !h()) {
|
|
71
|
+
const r = window.innerWidth - C * 2;
|
|
72
|
+
W((s) => ({
|
|
73
|
+
...s,
|
|
74
|
+
width: r
|
|
75
|
+
})), p((s) => ({
|
|
76
|
+
...s,
|
|
77
|
+
x: C
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
if (window.addEventListener("resize", t), de(() => window.removeEventListener("resize", t)), !i.defaultPosition) {
|
|
82
|
+
const n = window.innerWidth, r = window.innerHeight;
|
|
83
|
+
if (n < R) {
|
|
84
|
+
const d = n - C * 2, c = M();
|
|
85
|
+
W({
|
|
86
|
+
width: d,
|
|
87
|
+
height: c.height
|
|
88
|
+
}), p({
|
|
89
|
+
x: C,
|
|
90
|
+
y: Math.max(0, (r - c.height) / 2)
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
const d = M();
|
|
94
|
+
p({
|
|
95
|
+
x: Math.max(0, (n - d.width) / 2),
|
|
96
|
+
y: Math.max(0, (r - d.height) / 2)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
74
99
|
}
|
|
75
|
-
}),
|
|
100
|
+
}), he(() => {
|
|
76
101
|
if (!i.open) return;
|
|
77
102
|
const t = (n) => {
|
|
78
103
|
n.key === "Escape" && i.onOpenChange(!1);
|
|
79
104
|
};
|
|
80
|
-
document.addEventListener("keydown", t),
|
|
81
|
-
}),
|
|
82
|
-
i.open ||
|
|
105
|
+
document.addEventListener("keydown", t), de(() => document.removeEventListener("keydown", t));
|
|
106
|
+
}), he(() => {
|
|
107
|
+
i.open || ee(g ?? void 0);
|
|
83
108
|
});
|
|
84
|
-
const
|
|
85
|
-
if (!
|
|
109
|
+
const ze = (t) => {
|
|
110
|
+
if (!K() || h() || t.pointerType === "mouse" && t.button !== 0) return;
|
|
86
111
|
const n = t.target;
|
|
87
|
-
n != null && n.closest('button, input, select, textarea, a, [role="button"]') || (t.preventDefault(),
|
|
112
|
+
n != null && n.closest('button, input, select, textarea, a, [role="button"]') || (t.preventDefault(), g = t.pointerId, m = "drag", Q(!0), T = {
|
|
88
113
|
x: t.clientX,
|
|
89
114
|
y: t.clientY
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
},
|
|
115
|
+
}, q = {
|
|
116
|
+
...E()
|
|
117
|
+
}, X = {
|
|
93
118
|
x: t.clientX,
|
|
94
119
|
y: t.clientY
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
!
|
|
120
|
+
}, N(!0, "grabbing"), a == null || a.setPointerCapture(t.pointerId));
|
|
121
|
+
}, x = (t) => (n) => {
|
|
122
|
+
!G() || h() || n.pointerType === "mouse" && n.button !== 0 || (n.preventDefault(), n.stopPropagation(), g = n.pointerId, m = "resize", V(!0), H = t, B = {
|
|
98
123
|
x: n.clientX,
|
|
99
124
|
y: n.clientY
|
|
100
|
-
},
|
|
101
|
-
...
|
|
102
|
-
}, I = {
|
|
103
|
-
...$()
|
|
125
|
+
}, S = {
|
|
126
|
+
...M()
|
|
104
127
|
}, _ = {
|
|
128
|
+
...E()
|
|
129
|
+
}, X = {
|
|
105
130
|
x: n.clientX,
|
|
106
131
|
y: n.clientY
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
if (
|
|
110
|
-
const t =
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
x:
|
|
115
|
-
y:
|
|
132
|
+
}, N(!0, be[t]), a == null || a.setPointerCapture(n.pointerId));
|
|
133
|
+
}, te = () => {
|
|
134
|
+
if ($ = null, !i.open || g === null || m === null) return;
|
|
135
|
+
const t = X.x - (m === "drag" ? T.x : B.x), n = X.y - (m === "drag" ? T.y : B.y);
|
|
136
|
+
if (m === "drag") {
|
|
137
|
+
const o = M(), k = F() ? C : Math.max(0, Math.min(window.innerWidth - o.width, q.x + t)), A = Math.max(0, Math.min(window.innerHeight - o.height, q.y + n));
|
|
138
|
+
p({
|
|
139
|
+
x: k,
|
|
140
|
+
y: A
|
|
116
141
|
});
|
|
117
142
|
return;
|
|
118
143
|
}
|
|
119
|
-
let
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
144
|
+
let r = S.width, s = S.height, d = _.x, c = _.y;
|
|
145
|
+
const e = F();
|
|
146
|
+
if (!e && H.includes("e") && (r = Math.max(L().width, Math.min(Y().width, S.width + t))), !e && H.includes("w")) {
|
|
147
|
+
const o = S.width - t;
|
|
148
|
+
o >= L().width && o <= Y().width && (r = o, d = _.x + t);
|
|
123
149
|
}
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
|
|
150
|
+
if (H.includes("s") && (s = Math.max(L().height, Math.min(Y().height, S.height + n))), H.includes("n")) {
|
|
151
|
+
const o = S.height - n;
|
|
152
|
+
o >= L().height && o <= Y().height && (s = o, c = _.y + n);
|
|
127
153
|
}
|
|
128
|
-
|
|
129
|
-
width:
|
|
130
|
-
height:
|
|
131
|
-
}),
|
|
132
|
-
x:
|
|
133
|
-
y:
|
|
154
|
+
d = Math.max(0, Math.min(window.innerWidth - r, d)), c = Math.max(0, Math.min(window.innerHeight - s, c)), W({
|
|
155
|
+
width: r,
|
|
156
|
+
height: s
|
|
157
|
+
}), p({
|
|
158
|
+
x: d,
|
|
159
|
+
y: c
|
|
134
160
|
});
|
|
135
|
-
},
|
|
136
|
-
if (!(
|
|
161
|
+
}, ye = (t) => {
|
|
162
|
+
if (!(g === null || t.pointerId !== g) && m !== null && (X = {
|
|
137
163
|
x: t.clientX,
|
|
138
164
|
y: t.clientY
|
|
139
|
-
},
|
|
165
|
+
}, $ === null)) {
|
|
140
166
|
if (typeof requestAnimationFrame > "u") {
|
|
141
|
-
|
|
167
|
+
te();
|
|
142
168
|
return;
|
|
143
169
|
}
|
|
144
|
-
|
|
170
|
+
$ = requestAnimationFrame(te);
|
|
145
171
|
}
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
if (
|
|
150
|
-
const t =
|
|
151
|
-
t && (
|
|
172
|
+
}, ne = (t) => {
|
|
173
|
+
g === null || t.pointerId !== g || ee(t.pointerId);
|
|
174
|
+
}, ie = () => {
|
|
175
|
+
if (h()) {
|
|
176
|
+
const t = xe();
|
|
177
|
+
t && (p(t.position), W(t.size)), J(!1);
|
|
152
178
|
} else
|
|
153
|
-
|
|
154
|
-
position:
|
|
155
|
-
size:
|
|
156
|
-
}),
|
|
179
|
+
ve({
|
|
180
|
+
position: E(),
|
|
181
|
+
size: M()
|
|
182
|
+
}), p({
|
|
157
183
|
x: 0,
|
|
158
184
|
y: 0
|
|
159
|
-
}),
|
|
185
|
+
}), W({
|
|
160
186
|
width: window.innerWidth,
|
|
161
187
|
height: window.innerHeight
|
|
162
|
-
}),
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
},
|
|
188
|
+
}), J(!0);
|
|
189
|
+
}, pe = () => {
|
|
190
|
+
ie();
|
|
191
|
+
}, v = (t) => j("absolute z-10", {
|
|
166
192
|
n: "cursor-ns-resize top-0 left-2 right-2 h-1",
|
|
167
193
|
s: "cursor-ns-resize bottom-0 left-2 right-2 h-1",
|
|
168
194
|
e: "cursor-ew-resize right-0 top-2 bottom-2 w-1",
|
|
@@ -172,52 +198,52 @@ function Fe(i) {
|
|
|
172
198
|
se: "cursor-nwse-resize bottom-0 right-0 w-2 h-2",
|
|
173
199
|
sw: "cursor-nesw-resize bottom-0 left-0 w-2 h-2"
|
|
174
200
|
}[t]);
|
|
175
|
-
return l(
|
|
201
|
+
return l(P, {
|
|
176
202
|
get when() {
|
|
177
203
|
return i.open;
|
|
178
204
|
},
|
|
179
205
|
get children() {
|
|
180
|
-
return l(
|
|
206
|
+
return l(Se, {
|
|
181
207
|
get children() {
|
|
182
|
-
var t =
|
|
183
|
-
t.addEventListener("pointercancel",
|
|
184
|
-
var
|
|
185
|
-
return typeof
|
|
208
|
+
var t = Le(), n = t.firstChild, r = n.firstChild, s = r.nextSibling, d = n.nextSibling;
|
|
209
|
+
t.addEventListener("pointercancel", ne), t.$$pointerup = ne, t.$$pointermove = ye;
|
|
210
|
+
var c = a;
|
|
211
|
+
return typeof c == "function" ? $e(c, t) : a = t, n.$$dblclick = pe, n.$$pointerdown = ze, b(r, l(P, {
|
|
186
212
|
get when() {
|
|
187
213
|
return i.title;
|
|
188
214
|
},
|
|
189
215
|
get children() {
|
|
190
|
-
var e =
|
|
191
|
-
return
|
|
216
|
+
var e = Xe();
|
|
217
|
+
return b(e, () => i.title), u(() => ae(e, "id", Z())), e;
|
|
192
218
|
}
|
|
193
|
-
})),
|
|
219
|
+
})), b(s, l(ce, {
|
|
194
220
|
variant: "ghost",
|
|
195
221
|
size: "icon",
|
|
196
222
|
class: "h-6 w-6",
|
|
197
223
|
onClick: (e) => {
|
|
198
|
-
e.stopPropagation(),
|
|
224
|
+
e.stopPropagation(), ie();
|
|
199
225
|
},
|
|
200
226
|
get "aria-label"() {
|
|
201
|
-
return
|
|
227
|
+
return h() ? "Restore" : "Maximize";
|
|
202
228
|
},
|
|
203
229
|
get children() {
|
|
204
|
-
return l(
|
|
230
|
+
return l(P, {
|
|
205
231
|
get when() {
|
|
206
|
-
return
|
|
232
|
+
return h();
|
|
207
233
|
},
|
|
208
234
|
get fallback() {
|
|
209
|
-
return l(
|
|
235
|
+
return l(We, {
|
|
210
236
|
class: "w-3 h-3"
|
|
211
237
|
});
|
|
212
238
|
},
|
|
213
239
|
get children() {
|
|
214
|
-
return l(
|
|
240
|
+
return l(Ee, {
|
|
215
241
|
class: "w-3 h-3"
|
|
216
242
|
});
|
|
217
243
|
}
|
|
218
244
|
});
|
|
219
245
|
}
|
|
220
|
-
}), null),
|
|
246
|
+
}), null), b(s, l(ce, {
|
|
221
247
|
variant: "ghost",
|
|
222
248
|
size: "icon",
|
|
223
249
|
class: "h-6 w-6 hover:bg-error hover:text-error-foreground",
|
|
@@ -226,52 +252,59 @@ function Fe(i) {
|
|
|
226
252
|
},
|
|
227
253
|
"aria-label": "Close",
|
|
228
254
|
get children() {
|
|
229
|
-
return l(
|
|
255
|
+
return l(_e, {
|
|
230
256
|
class: "w-3.5 h-3.5"
|
|
231
257
|
});
|
|
232
258
|
}
|
|
233
|
-
}), null),
|
|
259
|
+
}), null), b(d, () => i.children), b(t, l(P, {
|
|
234
260
|
get when() {
|
|
235
261
|
return i.footer;
|
|
236
262
|
},
|
|
237
263
|
get children() {
|
|
238
|
-
var e =
|
|
239
|
-
return
|
|
264
|
+
var e = De();
|
|
265
|
+
return b(e, () => i.footer), e;
|
|
240
266
|
}
|
|
241
|
-
}), null),
|
|
267
|
+
}), null), b(t, l(P, {
|
|
242
268
|
get when() {
|
|
243
|
-
return
|
|
269
|
+
return Ie(() => !!G())() && !h();
|
|
244
270
|
},
|
|
245
271
|
get children() {
|
|
246
272
|
return [(() => {
|
|
247
|
-
var e =
|
|
248
|
-
return
|
|
249
|
-
})(), (() => {
|
|
250
|
-
var e = x();
|
|
251
|
-
return m(e, "pointerdown", w("s"), !0), s(() => a(e, g("s"))), e;
|
|
252
|
-
})(), (() => {
|
|
253
|
-
var e = x();
|
|
254
|
-
return m(e, "pointerdown", w("e"), !0), s(() => a(e, g("e"))), e;
|
|
255
|
-
})(), (() => {
|
|
256
|
-
var e = x();
|
|
257
|
-
return m(e, "pointerdown", w("w"), !0), s(() => a(e, g("w"))), e;
|
|
273
|
+
var e = y();
|
|
274
|
+
return z(e, "pointerdown", x("n"), !0), u(() => w(e, v("n"))), e;
|
|
258
275
|
})(), (() => {
|
|
259
|
-
var e =
|
|
260
|
-
return
|
|
261
|
-
})(), (
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
276
|
+
var e = y();
|
|
277
|
+
return z(e, "pointerdown", x("s"), !0), u(() => w(e, v("s"))), e;
|
|
278
|
+
})(), l(P, {
|
|
279
|
+
get when() {
|
|
280
|
+
return !F();
|
|
281
|
+
},
|
|
282
|
+
get children() {
|
|
283
|
+
return [(() => {
|
|
284
|
+
var e = y();
|
|
285
|
+
return z(e, "pointerdown", x("e"), !0), u(() => w(e, v("e"))), e;
|
|
286
|
+
})(), (() => {
|
|
287
|
+
var e = y();
|
|
288
|
+
return z(e, "pointerdown", x("w"), !0), u(() => w(e, v("w"))), e;
|
|
289
|
+
})(), (() => {
|
|
290
|
+
var e = y();
|
|
291
|
+
return z(e, "pointerdown", x("ne"), !0), u(() => w(e, v("ne"))), e;
|
|
292
|
+
})(), (() => {
|
|
293
|
+
var e = y();
|
|
294
|
+
return z(e, "pointerdown", x("nw"), !0), u(() => w(e, v("nw"))), e;
|
|
295
|
+
})(), (() => {
|
|
296
|
+
var e = y();
|
|
297
|
+
return z(e, "pointerdown", x("se"), !0), u(() => w(e, v("se"))), e;
|
|
298
|
+
})(), (() => {
|
|
299
|
+
var e = y();
|
|
300
|
+
return z(e, "pointerdown", x("sw"), !0), u(() => w(e, v("sw"))), e;
|
|
301
|
+
})()];
|
|
302
|
+
}
|
|
303
|
+
})];
|
|
271
304
|
}
|
|
272
|
-
}), null),
|
|
273
|
-
var
|
|
274
|
-
return
|
|
305
|
+
}), null), u((e) => {
|
|
306
|
+
var o = j("fixed bg-card text-card-foreground rounded-md shadow-xl", "border border-border", "flex flex-col", "animate-in fade-in zoom-in-95", h() && "rounded-none", (me() || fe()) && "select-none", i.class), U = `${E().x}px`, k = `${E().y}px`, A = `${M().width}px`, re = `${M().height}px`, oe = ue(), se = i.title ? Z() : void 0, le = j("flex items-center justify-between h-9 px-3", "border-b border-border", "bg-muted/50", h() ? "rounded-none" : "rounded-t-md", K() && !h() && "cursor-move");
|
|
307
|
+
return o !== e.e && w(t, e.e = o), U !== e.t && D(t, "left", e.t = U), k !== e.a && D(t, "top", e.a = k), A !== e.o && D(t, "width", e.o = A), re !== e.i && D(t, "height", e.i = re), oe !== e.n && D(t, "z-index", e.n = oe), se !== e.s && ae(t, "aria-labelledby", e.s = se), le !== e.h && w(n, e.h = le), e;
|
|
275
308
|
}, {
|
|
276
309
|
e: void 0,
|
|
277
310
|
t: void 0,
|
|
@@ -287,7 +320,7 @@ function Fe(i) {
|
|
|
287
320
|
}
|
|
288
321
|
});
|
|
289
322
|
}
|
|
290
|
-
|
|
323
|
+
Me(["pointermove", "pointerup", "pointerdown", "dblclick"]);
|
|
291
324
|
export {
|
|
292
|
-
|
|
325
|
+
Te as FloatingWindow
|
|
293
326
|
};
|
package/dist/index3.js
CHANGED
|
@@ -1,94 +1,101 @@
|
|
|
1
|
-
import { delegateEvents as
|
|
2
|
-
import { For as
|
|
1
|
+
import { delegateEvents as h, template as d, insert as c, createComponent as r, effect as u, className as m, Dynamic as y, memo as x, setAttribute as f } from "solid-js/web";
|
|
2
|
+
import { For as b, Show as v } from "solid-js";
|
|
3
3
|
import { cn as g } from "./index62.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { Tooltip as C } from "./index24.js";
|
|
5
|
+
var w = /* @__PURE__ */ d('<div class="flex flex-col items-center py-1.5 gap-0.5 md:gap-2 md:py-2">'), A = /* @__PURE__ */ d('<div><div class="flex flex-col items-center py-1.5 gap-0.5 md:gap-2 md:py-2">'), $ = /* @__PURE__ */ d('<div class="absolute -left-1.5 md:-left-2.5 top-1/2 -translate-y-1/2 w-1 h-7 bg-primary rounded-r">'), k = /* @__PURE__ */ d("<span>"), _ = /* @__PURE__ */ d("<button type=button>");
|
|
6
|
+
function E(e) {
|
|
6
7
|
const a = (t) => {
|
|
7
|
-
var
|
|
8
|
+
var l, o;
|
|
8
9
|
if (t.onClick) {
|
|
9
10
|
t.onClick();
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
(
|
|
13
|
+
const n = e.activeId === t.id, i = e.collapsed ?? !1;
|
|
14
|
+
if (n && !i) {
|
|
15
|
+
(l = e.onCollapsedChange) == null || l.call(e, !0);
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
e.onActiveChange(t.id), (o = e.onCollapsedChange) == null || o.call(e, !1);
|
|
18
19
|
};
|
|
19
20
|
return (() => {
|
|
20
|
-
var t = A(),
|
|
21
|
-
return c(
|
|
21
|
+
var t = A(), n = t.firstChild;
|
|
22
|
+
return c(n, r(b, {
|
|
22
23
|
get each() {
|
|
23
24
|
return e.items;
|
|
24
25
|
},
|
|
25
|
-
children: (
|
|
26
|
-
item:
|
|
26
|
+
children: (i) => r(s, {
|
|
27
|
+
item: i,
|
|
27
28
|
get isActive() {
|
|
28
|
-
return e.activeId ===
|
|
29
|
+
return e.activeId === i.id;
|
|
29
30
|
},
|
|
30
|
-
onClick: () => a(
|
|
31
|
+
onClick: () => a(i)
|
|
31
32
|
})
|
|
32
|
-
})), c(t,
|
|
33
|
+
})), c(t, r(v, {
|
|
33
34
|
get when() {
|
|
34
|
-
var
|
|
35
|
-
return (
|
|
35
|
+
var i;
|
|
36
|
+
return (i = e.bottomItems) == null ? void 0 : i.length;
|
|
36
37
|
},
|
|
37
38
|
get children() {
|
|
38
|
-
var
|
|
39
|
-
return c(
|
|
39
|
+
var i = w();
|
|
40
|
+
return c(i, r(b, {
|
|
40
41
|
get each() {
|
|
41
42
|
return e.bottomItems;
|
|
42
43
|
},
|
|
43
|
-
children: (
|
|
44
|
-
item:
|
|
44
|
+
children: (l) => r(s, {
|
|
45
|
+
item: l,
|
|
45
46
|
isActive: !1,
|
|
46
|
-
onClick: () => a(
|
|
47
|
+
onClick: () => a(l)
|
|
47
48
|
})
|
|
48
|
-
})),
|
|
49
|
+
})), i;
|
|
49
50
|
}
|
|
50
|
-
}), null),
|
|
51
|
+
}), null), u(() => m(t, g("w-12 md:w-14 flex flex-col justify-between shrink-0 min-h-0", "bg-activity-bar border-r border-border", e.class))), t;
|
|
51
52
|
})();
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function s(e) {
|
|
54
55
|
const a = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
|
|
55
|
-
return (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
56
|
+
return r(C, {
|
|
57
|
+
get content() {
|
|
58
|
+
return e.item.label;
|
|
59
|
+
},
|
|
60
|
+
placement: "right",
|
|
61
|
+
delay: 0,
|
|
62
|
+
get children() {
|
|
63
|
+
var t = _();
|
|
64
|
+
return t.$$click = () => e.onClick(), c(t, r(v, {
|
|
65
|
+
get when() {
|
|
66
|
+
return e.isActive;
|
|
67
|
+
},
|
|
68
|
+
get children() {
|
|
69
|
+
return $();
|
|
70
|
+
}
|
|
71
|
+
}), null), c(t, r(y, {
|
|
72
|
+
get component() {
|
|
73
|
+
return e.item.icon;
|
|
74
|
+
},
|
|
75
|
+
class: "w-5 h-5"
|
|
76
|
+
}), null), c(t, r(v, {
|
|
77
|
+
get when() {
|
|
78
|
+
return a();
|
|
79
|
+
},
|
|
80
|
+
get children() {
|
|
81
|
+
var n = k();
|
|
82
|
+
return c(n, (() => {
|
|
83
|
+
var i = x(() => typeof a() == "number" && a() > 99);
|
|
84
|
+
return () => i() ? "99+" : a();
|
|
85
|
+
})()), u(() => m(n, g("absolute top-0.5 right-0.5 min-w-3.5 h-3.5 px-1", "flex items-center justify-center", "text-[9px] font-medium rounded-full", "bg-activity-bar-badge text-activity-bar-badge-foreground"))), n;
|
|
86
|
+
}
|
|
87
|
+
}), null), u((n) => {
|
|
88
|
+
var i = g("relative w-9 h-9 flex items-center justify-center rounded cursor-pointer", "transition-all duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", e.isActive ? "text-activity-bar-foreground-active bg-accent/80" : "text-activity-bar-foreground hover:text-activity-bar-foreground-active hover:bg-accent/40"), l = e.item.label, o = e.isActive;
|
|
89
|
+
return i !== n.e && m(t, n.e = i), l !== n.t && f(t, "aria-label", n.t = l), o !== n.a && f(t, "aria-pressed", n.a = o), n;
|
|
90
|
+
}, {
|
|
91
|
+
e: void 0,
|
|
92
|
+
t: void 0,
|
|
93
|
+
a: void 0
|
|
94
|
+
}), t;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
90
97
|
}
|
|
91
|
-
|
|
98
|
+
h(["click"]);
|
|
92
99
|
export {
|
|
93
|
-
|
|
100
|
+
E as ActivityBar
|
|
94
101
|
};
|