@floegence/floe-webapp-core 0.14.0 → 0.14.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.
- package/dist/components/file-browser/FileBrowserContext.d.ts +3 -3
- package/dist/index21.js +157 -148
- package/dist/index24.js +142 -135
- package/dist/index28.js +24 -24
- package/dist/index34.js +253 -245
- package/dist/index41.js +78 -57
- package/dist/index47.js +54 -47
- package/dist/index95.js +51 -38
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -15,9 +15,9 @@ export interface FileBrowserProviderProps {
|
|
|
15
15
|
*/
|
|
16
16
|
sidebarWidthStorageKey?: string;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Persistence key prefix to isolate per-instance state.
|
|
19
|
+
* When provided, we persist viewMode, sortConfig, expandedFolders, and sidebarCollapsed.
|
|
20
|
+
* When omitted, these states are not persisted.
|
|
21
21
|
*/
|
|
22
22
|
persistenceKey?: string;
|
|
23
23
|
/** Label for the root/home directory in breadcrumb (default: 'Root') */
|
package/dist/index21.js
CHANGED
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import { delegateEvents as oe, insert as
|
|
1
|
+
import { delegateEvents as oe, insert as l, createComponent as c, effect as y, className as C, memo as _, spread as R, mergeProps as B, setAttribute as p, template as z, Portal as le, setStyleProperty as ee, use as te } from "solid-js/web";
|
|
2
2
|
import { splitProps as N, createUniqueId as E, Show as w, createSignal as re, For as de } from "solid-js";
|
|
3
3
|
import { cn as $ } from "./index110.js";
|
|
4
4
|
import { Minus as se, Plus as ue, ChevronDown as ae } from "./index40.js";
|
|
5
|
-
var ce = /* @__PURE__ */
|
|
5
|
+
var ce = /* @__PURE__ */ z('<div class="absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), fe = /* @__PURE__ */ z('<div class="absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), L = /* @__PURE__ */ z('<p class="mt-1 text-[11px] text-error"role=alert>'), M = /* @__PURE__ */ z('<p class="mt-1 text-[11px] text-muted-foreground">'), he = /* @__PURE__ */ z("<div class=relative><input>"), ge = /* @__PURE__ */ z("<div><textarea>"), xe = /* @__PURE__ */ z('<div><div><button type=button aria-label="Decrease value"></button><input type=number><button type=button aria-label="Increase value">'), ve = /* @__PURE__ */ z("<div><div><input>"), ne = /* @__PURE__ */ z("<span>"), be = /* @__PURE__ */ z("<button type=button><span>"), me = /* @__PURE__ */ z("<div role=listbox>"), pe = /* @__PURE__ */ z("<button type=button role=option>");
|
|
6
6
|
const we = {
|
|
7
7
|
sm: "h-7 text-xs px-2",
|
|
8
8
|
md: "h-8 text-xs px-2.5",
|
|
9
9
|
lg: "h-9 text-sm px-3"
|
|
10
10
|
};
|
|
11
|
-
function ze(
|
|
12
|
-
const [e, b] = N(
|
|
13
|
-
const
|
|
14
|
-
return e.error &&
|
|
11
|
+
function ze(r) {
|
|
12
|
+
const [e, b] = N(r, ["size", "error", "helperText", "leftIcon", "rightIcon", "class", "id"]), S = E(), m = () => e.id ?? S, f = () => `${m()}-error`, x = () => `${m()}-helper`, I = () => {
|
|
13
|
+
const o = [];
|
|
14
|
+
return e.error && o.push(f()), e.helperText && !e.error && o.push(x()), o.length > 0 ? o.join(" ") : void 0;
|
|
15
15
|
};
|
|
16
16
|
return (() => {
|
|
17
|
-
var
|
|
18
|
-
return
|
|
17
|
+
var o = he(), g = o.firstChild;
|
|
18
|
+
return l(o, c(w, {
|
|
19
19
|
get when() {
|
|
20
20
|
return e.leftIcon;
|
|
21
21
|
},
|
|
22
22
|
get children() {
|
|
23
|
-
var
|
|
24
|
-
return
|
|
23
|
+
var s = ce();
|
|
24
|
+
return l(s, () => e.leftIcon), s;
|
|
25
25
|
}
|
|
26
|
-
}),
|
|
26
|
+
}), g), R(g, B({
|
|
27
|
+
get id() {
|
|
28
|
+
return m();
|
|
29
|
+
},
|
|
27
30
|
get "aria-invalid"() {
|
|
28
31
|
return e.error ? !0 : void 0;
|
|
29
32
|
},
|
|
30
33
|
get "aria-describedby"() {
|
|
31
|
-
return
|
|
34
|
+
return I();
|
|
32
35
|
},
|
|
33
36
|
get class() {
|
|
34
37
|
return $(
|
|
@@ -45,84 +48,87 @@ function ze(t) {
|
|
|
45
48
|
e.class
|
|
46
49
|
);
|
|
47
50
|
}
|
|
48
|
-
}, b), !1, !1),
|
|
51
|
+
}, b), !1, !1), l(o, c(w, {
|
|
49
52
|
get when() {
|
|
50
53
|
return e.rightIcon;
|
|
51
54
|
},
|
|
52
55
|
get children() {
|
|
53
|
-
var
|
|
54
|
-
return
|
|
56
|
+
var s = fe();
|
|
57
|
+
return l(s, () => e.rightIcon), s;
|
|
55
58
|
}
|
|
56
|
-
}), null),
|
|
59
|
+
}), null), l(o, c(w, {
|
|
57
60
|
get when() {
|
|
58
61
|
return e.error;
|
|
59
62
|
},
|
|
60
63
|
get children() {
|
|
61
|
-
var
|
|
62
|
-
return
|
|
64
|
+
var s = L();
|
|
65
|
+
return l(s, () => e.error), y(() => p(s, "id", f())), s;
|
|
63
66
|
}
|
|
64
|
-
}), null),
|
|
67
|
+
}), null), l(o, c(w, {
|
|
65
68
|
get when() {
|
|
66
|
-
return
|
|
69
|
+
return _(() => !!e.helperText)() && !e.error;
|
|
67
70
|
},
|
|
68
71
|
get children() {
|
|
69
|
-
var
|
|
70
|
-
return
|
|
72
|
+
var s = M();
|
|
73
|
+
return l(s, () => e.helperText), y(() => p(s, "id", x())), s;
|
|
71
74
|
}
|
|
72
|
-
}), null),
|
|
75
|
+
}), null), o;
|
|
73
76
|
})();
|
|
74
77
|
}
|
|
75
|
-
function Se(
|
|
76
|
-
const [e, b] = N(
|
|
77
|
-
const
|
|
78
|
-
return e.error &&
|
|
78
|
+
function Se(r) {
|
|
79
|
+
const [e, b] = N(r, ["error", "helperText", "class", "id"]), S = E(), m = () => e.id ?? S, f = () => `${m()}-error`, x = () => `${m()}-helper`, I = () => {
|
|
80
|
+
const o = [];
|
|
81
|
+
return e.error && o.push(f()), e.helperText && !e.error && o.push(x()), o.length > 0 ? o.join(" ") : void 0;
|
|
79
82
|
};
|
|
80
83
|
return (() => {
|
|
81
|
-
var
|
|
82
|
-
return
|
|
84
|
+
var o = ge(), g = o.firstChild;
|
|
85
|
+
return R(g, B({
|
|
86
|
+
get id() {
|
|
87
|
+
return m();
|
|
88
|
+
},
|
|
83
89
|
get "aria-invalid"() {
|
|
84
90
|
return e.error ? !0 : void 0;
|
|
85
91
|
},
|
|
86
92
|
get "aria-describedby"() {
|
|
87
|
-
return
|
|
93
|
+
return I();
|
|
88
94
|
},
|
|
89
95
|
get class() {
|
|
90
96
|
return $("w-full min-h-16 rounded border border-input bg-background p-2.5 text-xs shadow-sm", "placeholder:text-muted-foreground/60", "transition-colors duration-100", "focus:outline-none focus:ring-1 focus:ring-ring focus:border-ring", "disabled:cursor-not-allowed disabled:opacity-50", "resize-y", e.error && "border-error focus:ring-error", e.class);
|
|
91
97
|
}
|
|
92
|
-
}, b), !1, !1),
|
|
98
|
+
}, b), !1, !1), l(o, c(w, {
|
|
93
99
|
get when() {
|
|
94
100
|
return e.error;
|
|
95
101
|
},
|
|
96
102
|
get children() {
|
|
97
|
-
var
|
|
98
|
-
return
|
|
103
|
+
var s = L();
|
|
104
|
+
return l(s, () => e.error), y(() => p(s, "id", f())), s;
|
|
99
105
|
}
|
|
100
|
-
}), null),
|
|
106
|
+
}), null), l(o, c(w, {
|
|
101
107
|
get when() {
|
|
102
|
-
return
|
|
108
|
+
return _(() => !!e.helperText)() && !e.error;
|
|
103
109
|
},
|
|
104
110
|
get children() {
|
|
105
|
-
var
|
|
106
|
-
return
|
|
111
|
+
var s = M();
|
|
112
|
+
return l(s, () => e.helperText), y(() => p(s, "id", x())), s;
|
|
107
113
|
}
|
|
108
|
-
}), null),
|
|
114
|
+
}), null), o;
|
|
109
115
|
})();
|
|
110
116
|
}
|
|
111
|
-
function
|
|
112
|
-
const e = E(), b = `${e}-error`,
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
const
|
|
118
|
-
isNaN(
|
|
119
|
-
},
|
|
120
|
-
const
|
|
121
|
-
isNaN(
|
|
122
|
-
},
|
|
123
|
-
const
|
|
124
|
-
return
|
|
125
|
-
},
|
|
117
|
+
function ke(r) {
|
|
118
|
+
const e = E(), b = `${e}-error`, S = `${e}-helper`, m = () => r.step ?? 1, f = () => r.min ?? -1 / 0, x = () => r.max ?? 1 / 0, I = (t) => Math.min(x(), Math.max(f(), t)), o = () => !r.disabled && r.value > f(), g = () => !r.disabled && r.value < x(), s = () => {
|
|
119
|
+
o() && r.onChange(I(r.value - m()));
|
|
120
|
+
}, O = () => {
|
|
121
|
+
g() && r.onChange(I(r.value + m()));
|
|
122
|
+
}, T = (t) => {
|
|
123
|
+
const u = parseFloat(t.currentTarget.value);
|
|
124
|
+
isNaN(u) || r.onChange(I(u));
|
|
125
|
+
}, P = (t) => {
|
|
126
|
+
const u = parseFloat(t.currentTarget.value);
|
|
127
|
+
isNaN(u) ? r.onChange(f() === -1 / 0 ? 0 : f()) : r.onChange(I(u));
|
|
128
|
+
}, v = () => {
|
|
129
|
+
const t = [];
|
|
130
|
+
return r.error && t.push(b), r.helperText && !r.error && t.push(S), t.length > 0 ? t.join(" ") : void 0;
|
|
131
|
+
}, i = {
|
|
126
132
|
sm: {
|
|
127
133
|
height: "h-7",
|
|
128
134
|
btnSize: "w-7",
|
|
@@ -138,36 +144,36 @@ function Oe(t) {
|
|
|
138
144
|
btnSize: "w-9",
|
|
139
145
|
iconSize: "w-4 h-4"
|
|
140
146
|
}
|
|
141
|
-
},
|
|
147
|
+
}, h = () => i[r.size ?? "md"];
|
|
142
148
|
return (() => {
|
|
143
|
-
var
|
|
144
|
-
return
|
|
149
|
+
var t = xe(), u = t.firstChild, a = u.firstChild, d = a.nextSibling, k = d.nextSibling;
|
|
150
|
+
return a.$$click = s, l(a, c(se, {
|
|
145
151
|
get class() {
|
|
146
|
-
return
|
|
152
|
+
return h().iconSize;
|
|
147
153
|
}
|
|
148
|
-
})),
|
|
154
|
+
})), d.addEventListener("blur", P), d.$$input = T, p(d, "id", e), k.$$click = O, l(k, c(ue, {
|
|
149
155
|
get class() {
|
|
150
|
-
return
|
|
156
|
+
return h().iconSize;
|
|
151
157
|
}
|
|
152
|
-
})),
|
|
158
|
+
})), l(t, c(w, {
|
|
153
159
|
get when() {
|
|
154
|
-
return
|
|
160
|
+
return r.error;
|
|
155
161
|
},
|
|
156
162
|
get children() {
|
|
157
163
|
var n = L();
|
|
158
|
-
return
|
|
164
|
+
return p(n, "id", b), l(n, () => r.error), n;
|
|
159
165
|
}
|
|
160
|
-
}), null),
|
|
166
|
+
}), null), l(t, c(w, {
|
|
161
167
|
get when() {
|
|
162
|
-
return
|
|
168
|
+
return _(() => !!r.helperText)() && !r.error;
|
|
163
169
|
},
|
|
164
170
|
get children() {
|
|
165
171
|
var n = M();
|
|
166
|
-
return
|
|
172
|
+
return p(n, "id", S), l(n, () => r.helperText), n;
|
|
167
173
|
}
|
|
168
|
-
}), null),
|
|
169
|
-
var V =
|
|
170
|
-
return V !== n.e &&
|
|
174
|
+
}), null), y((n) => {
|
|
175
|
+
var V = r.class, j = $("inline-flex items-center rounded border border-input bg-background shadow-sm", "transition-colors duration-100", "focus-within:ring-1 focus-within:ring-ring focus-within:border-ring", r.disabled && "opacity-50 cursor-not-allowed", r.error && "border-error focus-within:ring-error", h().height), A = !o(), F = $("flex items-center justify-center border-r border-input", "text-muted-foreground transition-colors", "hover:bg-accent hover:text-foreground", "focus:outline-none", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-muted-foreground", h().btnSize, h().height), W = r.min, q = r.max, H = r.step, G = r.disabled, U = r.inputDisabled, X = r.placeholder, J = r.error ? !0 : void 0, K = v(), Q = $("w-16 text-center text-xs bg-transparent border-none", "outline-none focus:outline-none focus:ring-0", "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none", r.inputDisabled && "cursor-default"), Y = !g(), Z = $("flex items-center justify-center border-l border-input", "text-muted-foreground transition-colors", "hover:bg-accent hover:text-foreground", "focus:outline-none", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-muted-foreground", h().btnSize, h().height);
|
|
176
|
+
return V !== n.e && C(t, n.e = V), j !== n.t && C(u, n.t = j), A !== n.a && (a.disabled = n.a = A), F !== n.o && C(a, n.o = F), W !== n.i && p(d, "min", n.i = W), q !== n.n && p(d, "max", n.n = q), H !== n.s && p(d, "step", n.s = H), G !== n.h && (d.disabled = n.h = G), U !== n.r && (d.readOnly = n.r = U), X !== n.d && p(d, "placeholder", n.d = X), J !== n.l && p(d, "aria-invalid", n.l = J), K !== n.u && p(d, "aria-describedby", n.u = K), Q !== n.c && C(d, n.c = Q), Y !== n.w && (k.disabled = n.w = Y), Z !== n.m && C(k, n.m = Z), n;
|
|
171
177
|
}, {
|
|
172
178
|
e: void 0,
|
|
173
179
|
t: void 0,
|
|
@@ -184,15 +190,15 @@ function Oe(t) {
|
|
|
184
190
|
c: void 0,
|
|
185
191
|
w: void 0,
|
|
186
192
|
m: void 0
|
|
187
|
-
}),
|
|
193
|
+
}), y(() => d.value = r.value), t;
|
|
188
194
|
})();
|
|
189
195
|
}
|
|
190
196
|
const D = 8;
|
|
191
|
-
function
|
|
192
|
-
const [e, b] = N(
|
|
197
|
+
function Oe(r) {
|
|
198
|
+
const [e, b] = N(r, ["size", "error", "helperText", "prefix", "suffix", "prefixOptions", "prefixValue", "onPrefixChange", "suffixOptions", "suffixValue", "onSuffixChange", "class", "id"]), S = E(), m = () => e.id ?? S, f = () => `${m()}-error`, x = () => `${m()}-helper`, I = () => {
|
|
193
199
|
const v = [];
|
|
194
|
-
return e.error && v.push(
|
|
195
|
-
},
|
|
200
|
+
return e.error && v.push(f()), e.helperText && !e.error && v.push(x()), v.length > 0 ? v.join(" ") : void 0;
|
|
201
|
+
}, o = {
|
|
196
202
|
sm: {
|
|
197
203
|
height: "h-7",
|
|
198
204
|
text: "text-xs",
|
|
@@ -208,26 +214,26 @@ function _e(t) {
|
|
|
208
214
|
text: "text-sm",
|
|
209
215
|
px: "px-3"
|
|
210
216
|
}
|
|
211
|
-
},
|
|
217
|
+
}, g = () => o[e.size ?? "md"], s = () => !!e.prefix || e.prefixOptions && e.prefixOptions.length > 0, O = () => !!e.suffix || e.suffixOptions && e.suffixOptions.length > 0, T = () => e.prefix ? e.prefix : e.prefixOptions?.find((v) => v.value === e.prefixValue)?.label ?? e.prefixOptions?.[0]?.label, P = () => e.suffix ? e.suffix : e.suffixOptions?.find((v) => v.value === e.suffixValue)?.label ?? e.suffixOptions?.[0]?.label;
|
|
212
218
|
return (() => {
|
|
213
|
-
var v = ve(),
|
|
214
|
-
return
|
|
219
|
+
var v = ve(), i = v.firstChild, h = i.firstChild;
|
|
220
|
+
return l(i, c(w, {
|
|
215
221
|
get when() {
|
|
216
|
-
return
|
|
222
|
+
return s();
|
|
217
223
|
},
|
|
218
224
|
get children() {
|
|
219
|
-
return
|
|
225
|
+
return c(w, {
|
|
220
226
|
get when() {
|
|
221
|
-
return
|
|
227
|
+
return _(() => !!e.prefixOptions)() && e.prefixOptions.length > 0;
|
|
222
228
|
},
|
|
223
229
|
get fallback() {
|
|
224
230
|
return (() => {
|
|
225
|
-
var
|
|
226
|
-
return
|
|
231
|
+
var t = ne();
|
|
232
|
+
return l(t, () => e.prefix), y(() => C(t, $("flex items-center border-r border-input bg-muted/50 text-muted-foreground", g().text, g().px, g().height))), t;
|
|
227
233
|
})();
|
|
228
234
|
},
|
|
229
235
|
get children() {
|
|
230
|
-
return
|
|
236
|
+
return c(ie, {
|
|
231
237
|
get options() {
|
|
232
238
|
return e.prefixOptions;
|
|
233
239
|
},
|
|
@@ -251,33 +257,36 @@ function _e(t) {
|
|
|
251
257
|
}
|
|
252
258
|
});
|
|
253
259
|
}
|
|
254
|
-
}),
|
|
260
|
+
}), h), R(h, B({
|
|
261
|
+
get id() {
|
|
262
|
+
return m();
|
|
263
|
+
},
|
|
255
264
|
get "aria-invalid"() {
|
|
256
265
|
return e.error ? !0 : void 0;
|
|
257
266
|
},
|
|
258
267
|
get "aria-describedby"() {
|
|
259
|
-
return
|
|
268
|
+
return I();
|
|
260
269
|
},
|
|
261
270
|
get class() {
|
|
262
|
-
return $("flex-1 min-w-0 bg-transparent border-none", "placeholder:text-muted-foreground/60", "outline-none focus:outline-none focus:ring-0", "disabled:cursor-not-allowed",
|
|
271
|
+
return $("flex-1 min-w-0 bg-transparent border-none", "placeholder:text-muted-foreground/60", "outline-none focus:outline-none focus:ring-0", "disabled:cursor-not-allowed", g().text, g().px);
|
|
263
272
|
}
|
|
264
|
-
}, b), !1, !1),
|
|
273
|
+
}, b), !1, !1), l(i, c(w, {
|
|
265
274
|
get when() {
|
|
266
|
-
return
|
|
275
|
+
return O();
|
|
267
276
|
},
|
|
268
277
|
get children() {
|
|
269
|
-
return
|
|
278
|
+
return c(w, {
|
|
270
279
|
get when() {
|
|
271
|
-
return
|
|
280
|
+
return _(() => !!e.suffixOptions)() && e.suffixOptions.length > 0;
|
|
272
281
|
},
|
|
273
282
|
get fallback() {
|
|
274
283
|
return (() => {
|
|
275
|
-
var
|
|
276
|
-
return
|
|
284
|
+
var t = ne();
|
|
285
|
+
return l(t, () => e.suffix), y(() => C(t, $("flex items-center border-l border-input bg-muted/50 text-muted-foreground", g().text, g().px, g().height))), t;
|
|
277
286
|
})();
|
|
278
287
|
},
|
|
279
288
|
get children() {
|
|
280
|
-
return
|
|
289
|
+
return c(ie, {
|
|
281
290
|
get options() {
|
|
282
291
|
return e.suffixOptions;
|
|
283
292
|
},
|
|
@@ -301,38 +310,38 @@ function _e(t) {
|
|
|
301
310
|
}
|
|
302
311
|
});
|
|
303
312
|
}
|
|
304
|
-
}), null),
|
|
313
|
+
}), null), l(v, c(w, {
|
|
305
314
|
get when() {
|
|
306
315
|
return e.error;
|
|
307
316
|
},
|
|
308
317
|
get children() {
|
|
309
|
-
var
|
|
310
|
-
return
|
|
318
|
+
var t = L();
|
|
319
|
+
return l(t, () => e.error), y(() => p(t, "id", f())), t;
|
|
311
320
|
}
|
|
312
|
-
}), null),
|
|
321
|
+
}), null), l(v, c(w, {
|
|
313
322
|
get when() {
|
|
314
|
-
return
|
|
323
|
+
return _(() => !!e.helperText)() && !e.error;
|
|
315
324
|
},
|
|
316
325
|
get children() {
|
|
317
|
-
var
|
|
318
|
-
return
|
|
326
|
+
var t = M();
|
|
327
|
+
return l(t, () => e.helperText), y(() => p(t, "id", x())), t;
|
|
319
328
|
}
|
|
320
|
-
}), null),
|
|
321
|
-
var
|
|
322
|
-
return
|
|
329
|
+
}), null), y((t) => {
|
|
330
|
+
var u = e.class, a = $("inline-flex items-center rounded border border-input bg-background shadow-sm", "transition-colors duration-100", "focus-within:ring-1 focus-within:ring-ring focus-within:border-ring", b.disabled && "opacity-50 cursor-not-allowed", e.error && "border-error focus-within:ring-error", g().height);
|
|
331
|
+
return u !== t.e && C(v, t.e = u), a !== t.t && C(i, t.t = a), t;
|
|
323
332
|
}, {
|
|
324
333
|
e: void 0,
|
|
325
334
|
t: void 0
|
|
326
335
|
}), v;
|
|
327
336
|
})();
|
|
328
337
|
}
|
|
329
|
-
function ie(
|
|
330
|
-
const [e, b] = re(!1), [
|
|
338
|
+
function ie(r) {
|
|
339
|
+
const [e, b] = re(!1), [S, m] = re({
|
|
331
340
|
x: -9999,
|
|
332
341
|
y: -9999
|
|
333
342
|
});
|
|
334
|
-
let
|
|
335
|
-
const
|
|
343
|
+
let f, x;
|
|
344
|
+
const I = {
|
|
336
345
|
sm: {
|
|
337
346
|
height: "h-7",
|
|
338
347
|
text: "text-xs",
|
|
@@ -348,70 +357,70 @@ function ie(t) {
|
|
|
348
357
|
text: "text-sm",
|
|
349
358
|
px: "px-3"
|
|
350
359
|
}
|
|
351
|
-
},
|
|
352
|
-
if (!
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
|
|
356
|
-
x:
|
|
357
|
-
y:
|
|
360
|
+
}, o = () => I[r.size ?? "md"], g = () => {
|
|
361
|
+
if (!f || !x) return;
|
|
362
|
+
const i = f.getBoundingClientRect(), h = x.getBoundingClientRect(), t = window.innerWidth, u = window.innerHeight;
|
|
363
|
+
let a = i.left, d = i.bottom + 2;
|
|
364
|
+
a + h.width > t - D && (a = i.right - h.width), a = Math.max(D, a), d + h.height > u - D && (d = i.top - h.height - 2), d = Math.max(D, d), m({
|
|
365
|
+
x: a,
|
|
366
|
+
y: d
|
|
358
367
|
});
|
|
359
|
-
},
|
|
360
|
-
|
|
361
|
-
},
|
|
362
|
-
|
|
363
|
-
},
|
|
364
|
-
|
|
368
|
+
}, s = (i) => {
|
|
369
|
+
f && !f.contains(i.target) && x && !x.contains(i.target) && b(!1);
|
|
370
|
+
}, O = (i) => {
|
|
371
|
+
i.key === "Escape" && b(!1);
|
|
372
|
+
}, T = (i) => {
|
|
373
|
+
r.onChange?.(i), b(!1);
|
|
374
|
+
}, P = () => {
|
|
375
|
+
document.addEventListener("mousedown", s), document.addEventListener("keydown", O), requestAnimationFrame(g);
|
|
365
376
|
}, v = () => {
|
|
366
|
-
document.
|
|
367
|
-
}, z = () => {
|
|
368
|
-
document.removeEventListener("mousedown", _), document.removeEventListener("keydown", T);
|
|
377
|
+
document.removeEventListener("mousedown", s), document.removeEventListener("keydown", O);
|
|
369
378
|
};
|
|
370
379
|
return [(() => {
|
|
371
|
-
var
|
|
372
|
-
|
|
373
|
-
e() ? (b(!1),
|
|
380
|
+
var i = be(), h = i.firstChild;
|
|
381
|
+
i.$$click = () => {
|
|
382
|
+
e() ? (b(!1), v()) : (b(!0), P());
|
|
374
383
|
};
|
|
375
|
-
var
|
|
376
|
-
return typeof
|
|
384
|
+
var t = f;
|
|
385
|
+
return typeof t == "function" ? te(t, i) : f = i, l(h, () => r.label), l(i, c(ae, {
|
|
377
386
|
class: "w-3 h-3 opacity-60"
|
|
378
|
-
}), null),
|
|
379
|
-
var
|
|
380
|
-
return
|
|
387
|
+
}), null), y((u) => {
|
|
388
|
+
var a = r.disabled, d = $("flex items-center gap-1 bg-muted/50 text-muted-foreground", "hover:bg-muted hover:text-foreground transition-colors", "focus:outline-none", "disabled:cursor-not-allowed disabled:hover:bg-muted/50 disabled:hover:text-muted-foreground", r.position === "prefix" ? "border-r border-input" : "border-l border-input", o().text, o().px, o().height);
|
|
389
|
+
return a !== u.e && (i.disabled = u.e = a), d !== u.t && C(i, u.t = d), u;
|
|
381
390
|
}, {
|
|
382
391
|
e: void 0,
|
|
383
392
|
t: void 0
|
|
384
|
-
}),
|
|
385
|
-
})(),
|
|
393
|
+
}), i;
|
|
394
|
+
})(), c(w, {
|
|
386
395
|
get when() {
|
|
387
396
|
return e();
|
|
388
397
|
},
|
|
389
398
|
get children() {
|
|
390
|
-
return
|
|
399
|
+
return c(le, {
|
|
391
400
|
get children() {
|
|
392
|
-
var
|
|
393
|
-
return typeof
|
|
401
|
+
var i = me(), h = x;
|
|
402
|
+
return typeof h == "function" ? te(h, i) : x = i, l(i, c(de, {
|
|
394
403
|
get each() {
|
|
395
|
-
return
|
|
404
|
+
return r.options;
|
|
396
405
|
},
|
|
397
|
-
children: (
|
|
398
|
-
var
|
|
399
|
-
return
|
|
400
|
-
var
|
|
401
|
-
return
|
|
406
|
+
children: (t) => (() => {
|
|
407
|
+
var u = pe();
|
|
408
|
+
return u.$$click = () => T(t.value), l(u, () => t.label), y((a) => {
|
|
409
|
+
var d = $("w-full flex items-center px-2.5 py-1.5 text-xs cursor-pointer", "transition-colors duration-75", "hover:bg-accent", "focus:outline-none focus:bg-accent", r.value === t.value && "bg-accent/50 font-medium"), k = r.value === t.value;
|
|
410
|
+
return d !== a.e && C(u, a.e = d), k !== a.t && p(u, "aria-selected", a.t = k), a;
|
|
402
411
|
}, {
|
|
403
412
|
e: void 0,
|
|
404
413
|
t: void 0
|
|
405
|
-
}),
|
|
414
|
+
}), u;
|
|
406
415
|
})()
|
|
407
|
-
})),
|
|
408
|
-
var
|
|
409
|
-
return
|
|
416
|
+
})), y((t) => {
|
|
417
|
+
var u = $("fixed z-50 min-w-24 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "animate-in fade-in slide-in-from-top-1"), a = `${S().x}px`, d = `${S().y}px`;
|
|
418
|
+
return u !== t.e && C(i, t.e = u), a !== t.t && ee(i, "left", t.t = a), d !== t.a && ee(i, "top", t.a = d), t;
|
|
410
419
|
}, {
|
|
411
420
|
e: void 0,
|
|
412
421
|
t: void 0,
|
|
413
422
|
a: void 0
|
|
414
|
-
}),
|
|
423
|
+
}), i;
|
|
415
424
|
}
|
|
416
425
|
});
|
|
417
426
|
}
|
|
@@ -419,8 +428,8 @@ function ie(t) {
|
|
|
419
428
|
}
|
|
420
429
|
oe(["click", "input"]);
|
|
421
430
|
export {
|
|
422
|
-
|
|
431
|
+
Oe as AffixInput,
|
|
423
432
|
ze as Input,
|
|
424
|
-
|
|
433
|
+
ke as NumberInput,
|
|
425
434
|
Se as Textarea
|
|
426
435
|
};
|