@floegence/floe-webapp-core 0.86.75 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +2 -0
- package/dist/components/ui/Accordion.d.ts +16 -0
- package/dist/components/ui/Accordion.js +59 -0
- package/dist/components/ui/Breadcrumb.d.ts +14 -0
- package/dist/components/ui/Breadcrumb.js +72 -0
- package/dist/components/ui/Calendar.d.ts +17 -0
- package/dist/components/ui/Calendar.js +151 -0
- package/dist/components/ui/Checkbox.js +137 -130
- package/dist/components/ui/DataTable.d.ts +33 -0
- package/dist/components/ui/DataTable.js +269 -0
- package/dist/components/ui/DatePicker.d.ts +35 -0
- package/dist/components/ui/DatePicker.js +198 -0
- package/dist/components/ui/Dropdown.d.ts +4 -20
- package/dist/components/ui/Dropdown.js +195 -231
- package/dist/components/ui/Form.d.ts +24 -5
- package/dist/components/ui/Form.js +179 -128
- package/dist/components/ui/Input.d.ts +6 -0
- package/dist/components/ui/Input.js +237 -189
- package/dist/components/ui/Pagination.js +211 -162
- package/dist/components/ui/Popover.d.ts +6 -1
- package/dist/components/ui/Popover.js +75 -56
- package/dist/components/ui/Select.d.ts +46 -0
- package/dist/components/ui/Select.js +414 -0
- package/dist/components/ui/Slider.d.ts +7 -0
- package/dist/components/ui/Slider.js +28 -0
- package/dist/components/ui/Switch.js +41 -32
- package/dist/components/ui/Table.d.ts +9 -0
- package/dist/components/ui/Table.js +97 -0
- package/dist/components/ui/calendarModel.d.ts +6 -0
- package/dist/components/ui/calendarModel.js +37 -0
- package/dist/components/ui/controllable.d.ts +7 -0
- package/dist/components/ui/controllable.js +10 -0
- package/dist/components/ui/dataTableModel.d.ts +18 -0
- package/dist/components/ui/dataTableModel.js +18 -0
- package/dist/components/ui/formFieldContext.d.ts +26 -0
- package/dist/components/ui/formFieldContext.js +40 -0
- package/dist/components/ui/index.d.ts +13 -1
- package/dist/components/ui/picker/PickerBase.js +106 -112
- package/dist/context/LocaleContext.d.ts +55 -0
- package/dist/context/LocaleContext.js +80 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/diagrams/Diagram.js +129 -120
- package/dist/diagrams.css +5 -3
- package/dist/floe-webapp-core.css +1 -1
- package/dist/full.d.ts +2 -0
- package/dist/full.js +776 -737
- package/dist/index.js +111 -107
- package/dist/styles.css +1 -1
- package/dist/ui.js +223 -184
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { splitProps as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { createComponent as n, insert as a, effect as f, className as g, setAttribute as m, spread as A, mergeProps as B, template as v, use as N, memo as G } from "solid-js/web";
|
|
2
|
+
import { splitProps as P, createUniqueId as U, Switch as V, Match as j, Show as b, For as J, useContext as K, createEffect as Q, createContext as R } from "solid-js";
|
|
3
|
+
import { useFormControl as T } from "./formFieldContext.js";
|
|
4
|
+
import { cn as d } from "../../utils/cn.js";
|
|
5
|
+
var W = /* @__PURE__ */ v('<svg viewBox="0 0 12 12"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M2 6l3 3 5-6">'), X = /* @__PURE__ */ v('<svg viewBox="0 0 12 12"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round><path d="M2 6h8">'), Y = /* @__PURE__ */ v("<div role=group>"), Z = /* @__PURE__ */ v("<div data-floe-surface=inset data-floe-surface-part=indicator>"), ee = /* @__PURE__ */ v("<input>"), $ = /* @__PURE__ */ v("<span>"), re = /* @__PURE__ */ v('<div class="flex flex-col">'), te = /* @__PURE__ */ v('<label><div class="relative flex items-center justify-center pt-0.5">'), ne = /* @__PURE__ */ v("<label data-floe-surface-part=choice><span class=font-medium>"), oe = /* @__PURE__ */ v('<div class="absolute top-2 right-2"><svg class="w-4 h-4 text-[var(--floe-accent-ink)]"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"clip-rule=evenodd>'), le = /* @__PURE__ */ v('<label data-floe-surface-part=choice><div class="flex items-start gap-3"><div class="flex items-center justify-center pt-0.5"></div><div class="flex flex-col flex-1 min-w-0">'), ae = /* @__PURE__ */ v('<div class="absolute top-1.5 right-1.5"><div class="w-4 h-4 rounded-full bg-primary flex items-center justify-center">'), ie = /* @__PURE__ */ v("<label data-floe-surface-part=choice>"), se = /* @__PURE__ */ v("<div>");
|
|
6
|
+
const E = R();
|
|
7
|
+
function ce() {
|
|
8
|
+
return K(E);
|
|
8
9
|
}
|
|
9
10
|
const C = {
|
|
10
11
|
sm: {
|
|
@@ -25,15 +26,15 @@ const C = {
|
|
|
25
26
|
label: "text-sm",
|
|
26
27
|
description: "text-xs"
|
|
27
28
|
}
|
|
28
|
-
},
|
|
29
|
+
}, de = {
|
|
29
30
|
sm: "px-2.5 py-1 text-xs",
|
|
30
31
|
md: "px-3 py-1.5 text-xs",
|
|
31
32
|
lg: "px-4 py-2 text-sm"
|
|
32
|
-
},
|
|
33
|
+
}, ue = {
|
|
33
34
|
sm: "p-2.5",
|
|
34
35
|
md: "p-3",
|
|
35
36
|
lg: "p-4"
|
|
36
|
-
},
|
|
37
|
+
}, L = {
|
|
37
38
|
sm: {
|
|
38
39
|
container: "p-3 min-w-[80px]",
|
|
39
40
|
icon: "w-5 h-5"
|
|
@@ -47,95 +48,97 @@ const C = {
|
|
|
47
48
|
icon: "w-8 h-8"
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
|
-
function
|
|
51
|
+
function O(x) {
|
|
51
52
|
return (() => {
|
|
52
|
-
var
|
|
53
|
-
return f(() => m(
|
|
53
|
+
var s = W();
|
|
54
|
+
return f(() => m(s, "class", x.class)), s;
|
|
54
55
|
})();
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function fe(x) {
|
|
57
58
|
return (() => {
|
|
58
|
-
var
|
|
59
|
-
return f(() => m(
|
|
59
|
+
var s = X();
|
|
60
|
+
return f(() => m(s, "class", x.class)), s;
|
|
60
61
|
})();
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
-
const [
|
|
64
|
-
value: () =>
|
|
65
|
-
onChange: (h,
|
|
66
|
-
const
|
|
67
|
-
|
|
63
|
+
function ve(x) {
|
|
64
|
+
const [s, p] = P(x, ["value", "onChange", "size", "orientation", "variant", "disabled", "class", "children"]), e = () => s.variant ?? "default", M = {
|
|
65
|
+
value: () => s.value ?? [],
|
|
66
|
+
onChange: (h, y) => {
|
|
67
|
+
const u = s.value ?? [], w = y ? [...u, h] : u.filter((k) => k !== h);
|
|
68
|
+
s.onChange?.(w);
|
|
68
69
|
},
|
|
69
|
-
size: () =>
|
|
70
|
-
variant:
|
|
71
|
-
disabled: () =>
|
|
72
|
-
},
|
|
73
|
-
const h =
|
|
74
|
-
return h === "button" ?
|
|
70
|
+
size: () => s.size ?? "md",
|
|
71
|
+
variant: e,
|
|
72
|
+
disabled: () => s.disabled ?? !1
|
|
73
|
+
}, S = () => {
|
|
74
|
+
const h = e(), y = s.orientation === "horizontal";
|
|
75
|
+
return h === "button" ? d("inline-flex rounded-group border border-[var(--floe-line)] overflow-hidden", y ? "flex-row" : "flex-col") : h === "card" || h === "tile" ? d("grid gap-2", y ? "grid-flow-col auto-cols-fr" : "grid-cols-1") : d("flex", y ? "flex-row flex-wrap gap-4" : "flex-col gap-2");
|
|
75
76
|
};
|
|
76
|
-
return
|
|
77
|
-
value:
|
|
77
|
+
return n(E.Provider, {
|
|
78
|
+
value: M,
|
|
78
79
|
get children() {
|
|
79
|
-
var h =
|
|
80
|
-
return
|
|
80
|
+
var h = Y();
|
|
81
|
+
return A(h, B({
|
|
81
82
|
get "data-floe-surface"() {
|
|
82
|
-
return
|
|
83
|
+
return e() === "button" ? "inset" : void 0;
|
|
83
84
|
},
|
|
84
85
|
get "data-floe-surface-part"() {
|
|
85
|
-
return
|
|
86
|
+
return e() === "button" ? "rail" : void 0;
|
|
86
87
|
},
|
|
87
88
|
get class() {
|
|
88
|
-
return
|
|
89
|
+
return d(S(), s.class);
|
|
89
90
|
}
|
|
90
|
-
},
|
|
91
|
+
}, p), !1, !0), a(h, () => s.children), h;
|
|
91
92
|
}
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
-
const
|
|
96
|
-
k() || (
|
|
97
|
-
},
|
|
98
|
-
var t =
|
|
99
|
-
return
|
|
95
|
+
function he(x) {
|
|
96
|
+
const s = T(), p = ce(), [e, M] = P(x, ["value", "checked", "onChange", "label", "description", "icon", "size", "variant", "indeterminate", "ref", "class", "disabled", "id"]), S = U(), h = () => e.id ?? (p ? S : s.id) ?? S, y = () => p !== void 0, u = () => e.size ?? p?.size() ?? "md", w = () => e.variant ?? p?.variant() ?? "default", k = () => e.disabled ?? (p?.disabled() || s.disabled || !1), c = () => y() && e.value ? p.value().includes(e.value) : e.checked ?? !1, H = () => {
|
|
97
|
+
k() || (y() && e.value ? p.onChange(e.value, !c()) : e.onChange?.(!c()));
|
|
98
|
+
}, q = () => (() => {
|
|
99
|
+
var t = Z();
|
|
100
|
+
return a(t, n(b, {
|
|
100
101
|
get when() {
|
|
101
102
|
return e.indeterminate;
|
|
102
103
|
},
|
|
103
104
|
get children() {
|
|
104
|
-
return
|
|
105
|
+
return n(fe, {
|
|
105
106
|
get class() {
|
|
106
|
-
return
|
|
107
|
+
return d(C[u()].icon, "transition-transform duration-[var(--floe-duration-fast)]");
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
|
-
}), null),
|
|
111
|
+
}), null), a(t, n(b, {
|
|
111
112
|
get when() {
|
|
112
|
-
return
|
|
113
|
+
return G(() => !e.indeterminate)() && c();
|
|
113
114
|
},
|
|
114
115
|
get children() {
|
|
115
|
-
return
|
|
116
|
+
return n(O, {
|
|
116
117
|
get class() {
|
|
117
|
-
return
|
|
118
|
+
return d(C[u()].icon, "transition-transform duration-[var(--floe-duration-fast)]");
|
|
118
119
|
}
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
}), null), f((r) => {
|
|
122
|
-
var
|
|
123
|
-
return
|
|
123
|
+
var o = c() || e.indeterminate ? "true" : void 0, l = d("rounded-xs border-2 transition-[background-color,border-color,color,transform] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", "flex items-center justify-center", C[u()].box, c() || e.indeterminate ? "border-primary bg-primary text-primary-foreground" : "border-[var(--floe-control-edge)] bg-transparent hover:border-[var(--floe-control-edge-hover)]", k() && "cursor-not-allowed");
|
|
124
|
+
return o !== r.e && m(t, "data-floe-selected", r.e = o), l !== r.t && g(t, r.t = l), r;
|
|
124
125
|
}, {
|
|
125
126
|
e: void 0,
|
|
126
127
|
t: void 0
|
|
127
128
|
}), t;
|
|
128
|
-
})(),
|
|
129
|
+
})(), I = (t) => {
|
|
129
130
|
let r;
|
|
130
|
-
return
|
|
131
|
+
return Q(() => {
|
|
131
132
|
r && (r.indeterminate = e.indeterminate ?? !1);
|
|
132
133
|
}), (() => {
|
|
133
|
-
var
|
|
134
|
-
return N((
|
|
135
|
-
r =
|
|
136
|
-
},
|
|
134
|
+
var o = ee();
|
|
135
|
+
return N((l) => {
|
|
136
|
+
r = l, typeof e.ref == "function" && e.ref(l);
|
|
137
|
+
}, o), A(o, B(s, {
|
|
138
|
+
"data-floe-choice-input": "",
|
|
139
|
+
type: "checkbox",
|
|
137
140
|
get id() {
|
|
138
|
-
return
|
|
141
|
+
return h();
|
|
139
142
|
},
|
|
140
143
|
get value() {
|
|
141
144
|
return e.value;
|
|
@@ -144,62 +147,66 @@ function fe(w) {
|
|
|
144
147
|
return c();
|
|
145
148
|
},
|
|
146
149
|
get "aria-checked"() {
|
|
147
|
-
return
|
|
150
|
+
return G(() => !!e.indeterminate)() ? "mixed" : c();
|
|
148
151
|
},
|
|
149
152
|
get disabled() {
|
|
150
153
|
return k();
|
|
151
154
|
},
|
|
155
|
+
onClick: (l) => {
|
|
156
|
+
(x.readOnly ?? s.readOnly) && l.preventDefault();
|
|
157
|
+
},
|
|
158
|
+
onChange: H,
|
|
152
159
|
get class() {
|
|
153
160
|
return t.class ?? "sr-only peer";
|
|
154
161
|
}
|
|
155
|
-
},
|
|
162
|
+
}, M), !1, !1), o;
|
|
156
163
|
})();
|
|
157
164
|
};
|
|
158
|
-
return
|
|
165
|
+
return n(V, {
|
|
159
166
|
get children() {
|
|
160
|
-
return [
|
|
167
|
+
return [n(j, {
|
|
161
168
|
get when() {
|
|
162
|
-
return
|
|
169
|
+
return w() === "default";
|
|
163
170
|
},
|
|
164
171
|
get children() {
|
|
165
|
-
var t =
|
|
166
|
-
return
|
|
172
|
+
var t = te(), r = t.firstChild;
|
|
173
|
+
return a(r, n(I, {}), null), a(r, n(q, {}), null), a(t, n(b, {
|
|
167
174
|
get when() {
|
|
168
175
|
return e.label || e.description;
|
|
169
176
|
},
|
|
170
177
|
get children() {
|
|
171
|
-
var
|
|
172
|
-
return
|
|
178
|
+
var o = re();
|
|
179
|
+
return a(o, n(b, {
|
|
173
180
|
get when() {
|
|
174
181
|
return e.label;
|
|
175
182
|
},
|
|
176
183
|
get children() {
|
|
177
|
-
var
|
|
178
|
-
return l
|
|
184
|
+
var l = $();
|
|
185
|
+
return a(l, () => e.label), f(() => g(l, d("text-foreground", C[u()].label))), l;
|
|
179
186
|
}
|
|
180
|
-
}), null),
|
|
187
|
+
}), null), a(o, n(b, {
|
|
181
188
|
get when() {
|
|
182
189
|
return e.description;
|
|
183
190
|
},
|
|
184
191
|
get children() {
|
|
185
|
-
var
|
|
186
|
-
return l
|
|
192
|
+
var l = $();
|
|
193
|
+
return a(l, () => e.description), f(() => g(l, d("text-[var(--floe-ink-soft)]", C[u()].description))), l;
|
|
187
194
|
}
|
|
188
|
-
}), null),
|
|
195
|
+
}), null), o;
|
|
189
196
|
}
|
|
190
|
-
}), null), f(() =>
|
|
197
|
+
}), null), f(() => g(t, d("inline-flex items-start gap-2 cursor-pointer select-none", k() && "opacity-50 cursor-not-allowed", e.class))), t;
|
|
191
198
|
}
|
|
192
|
-
}),
|
|
199
|
+
}), n(j, {
|
|
193
200
|
get when() {
|
|
194
|
-
return
|
|
201
|
+
return w() === "button";
|
|
195
202
|
},
|
|
196
203
|
get children() {
|
|
197
|
-
var t =
|
|
198
|
-
return
|
|
204
|
+
var t = ne(), r = t.firstChild;
|
|
205
|
+
return a(t, n(I, {
|
|
199
206
|
class: "sr-only"
|
|
200
|
-
}), r),
|
|
201
|
-
var
|
|
202
|
-
return
|
|
207
|
+
}), r), a(r, () => e.label), f((o) => {
|
|
208
|
+
var l = c() ? "inset" : "raised", i = c() ? "true" : void 0, _ = w(), z = d("cursor-pointer select-none transition-colors duration-[var(--floe-duration-fast)]", "border-r border-[var(--floe-line)] last:border-r-0", de[u()], c() ? "bg-[var(--primary)] text-[var(--primary-foreground)] border-[var(--primary)]" : "bg-transparent text-[var(--floe-ink-soft)] hover:bg-[var(--floe-state-hover)] hover:text-[var(--floe-ink)]", k() && "opacity-50 cursor-not-allowed", e.class);
|
|
209
|
+
return l !== o.e && m(t, "data-floe-surface", o.e = l), i !== o.t && m(t, "data-floe-selected", o.t = i), _ !== o.a && m(t, "data-floe-choice-variant", o.a = _), z !== o.o && g(t, o.o = z), o;
|
|
203
210
|
}, {
|
|
204
211
|
e: void 0,
|
|
205
212
|
t: void 0,
|
|
@@ -207,40 +214,40 @@ function fe(w) {
|
|
|
207
214
|
o: void 0
|
|
208
215
|
}), t;
|
|
209
216
|
}
|
|
210
|
-
}),
|
|
217
|
+
}), n(j, {
|
|
211
218
|
get when() {
|
|
212
|
-
return
|
|
219
|
+
return w() === "card";
|
|
213
220
|
},
|
|
214
221
|
get children() {
|
|
215
|
-
var t =
|
|
216
|
-
return
|
|
222
|
+
var t = le(), r = t.firstChild, o = r.firstChild, l = o.nextSibling;
|
|
223
|
+
return a(t, n(I, {
|
|
217
224
|
class: "sr-only"
|
|
218
|
-
}), r),
|
|
225
|
+
}), r), a(o, n(q, {})), a(l, n(b, {
|
|
219
226
|
get when() {
|
|
220
227
|
return e.label;
|
|
221
228
|
},
|
|
222
229
|
get children() {
|
|
223
|
-
var
|
|
224
|
-
return
|
|
230
|
+
var i = $();
|
|
231
|
+
return a(i, () => e.label), f(() => g(i, d("font-medium text-foreground", C[u()].label))), i;
|
|
225
232
|
}
|
|
226
|
-
}), null), l
|
|
233
|
+
}), null), a(l, n(b, {
|
|
227
234
|
get when() {
|
|
228
235
|
return e.description;
|
|
229
236
|
},
|
|
230
237
|
get children() {
|
|
231
|
-
var
|
|
232
|
-
return
|
|
238
|
+
var i = $();
|
|
239
|
+
return a(i, () => e.description), f(() => g(i, d("text-[var(--floe-ink-soft)] mt-0.5", C[u()].description))), i;
|
|
233
240
|
}
|
|
234
|
-
}), null),
|
|
241
|
+
}), null), a(t, n(b, {
|
|
235
242
|
get when() {
|
|
236
243
|
return c();
|
|
237
244
|
},
|
|
238
245
|
get children() {
|
|
239
|
-
return
|
|
246
|
+
return oe();
|
|
240
247
|
}
|
|
241
|
-
}), null), f((
|
|
242
|
-
var
|
|
243
|
-
return
|
|
248
|
+
}), null), f((i) => {
|
|
249
|
+
var _ = c() ? "inset" : "raised", z = c() ? "true" : void 0, D = w(), F = d("relative cursor-pointer select-none rounded-group border transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", ue[u()], c() ? "border-[var(--floe-accent-line)] bg-[var(--floe-state-selected)]" : "border-[var(--floe-line)] bg-transparent hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)]", k() && "opacity-50 cursor-not-allowed", e.class);
|
|
250
|
+
return _ !== i.e && m(t, "data-floe-surface", i.e = _), z !== i.t && m(t, "data-floe-selected", i.t = z), D !== i.a && m(t, "data-floe-choice-variant", i.a = D), F !== i.o && g(t, i.o = F), i;
|
|
244
251
|
}, {
|
|
245
252
|
e: void 0,
|
|
246
253
|
t: void 0,
|
|
@@ -248,58 +255,58 @@ function fe(w) {
|
|
|
248
255
|
o: void 0
|
|
249
256
|
}), t;
|
|
250
257
|
}
|
|
251
|
-
}),
|
|
258
|
+
}), n(j, {
|
|
252
259
|
get when() {
|
|
253
|
-
return
|
|
260
|
+
return w() === "tile";
|
|
254
261
|
},
|
|
255
262
|
get children() {
|
|
256
|
-
var t =
|
|
257
|
-
return
|
|
263
|
+
var t = ie();
|
|
264
|
+
return a(t, n(I, {
|
|
258
265
|
class: "sr-only"
|
|
259
|
-
}), null),
|
|
266
|
+
}), null), a(t, n(b, {
|
|
260
267
|
get when() {
|
|
261
268
|
return e.icon;
|
|
262
269
|
},
|
|
263
270
|
children: (r) => {
|
|
264
|
-
const
|
|
271
|
+
const o = r();
|
|
265
272
|
return (() => {
|
|
266
|
-
var
|
|
267
|
-
return l
|
|
273
|
+
var l = se();
|
|
274
|
+
return a(l, n(o, {
|
|
268
275
|
get class() {
|
|
269
|
-
return
|
|
276
|
+
return L[u()].icon;
|
|
270
277
|
}
|
|
271
|
-
})), f(() =>
|
|
278
|
+
})), f(() => g(l, d("mb-2 transition-colors duration-[var(--floe-duration-fast)]", c() ? "text-[var(--floe-accent-ink)]" : "text-[var(--floe-ink-quiet)]"))), l;
|
|
272
279
|
})();
|
|
273
280
|
}
|
|
274
|
-
}), null),
|
|
281
|
+
}), null), a(t, n(b, {
|
|
275
282
|
get when() {
|
|
276
283
|
return e.label;
|
|
277
284
|
},
|
|
278
285
|
get children() {
|
|
279
|
-
var r =
|
|
280
|
-
return
|
|
286
|
+
var r = $();
|
|
287
|
+
return a(r, () => e.label), f(() => g(r, d("font-medium transition-colors duration-[var(--floe-duration-fast)]", C[u()].label, c() ? "text-[var(--floe-ink)]" : "text-[var(--floe-ink-soft)]"))), r;
|
|
281
288
|
}
|
|
282
|
-
}), null),
|
|
289
|
+
}), null), a(t, n(b, {
|
|
283
290
|
get when() {
|
|
284
291
|
return e.description;
|
|
285
292
|
},
|
|
286
293
|
get children() {
|
|
287
|
-
var r =
|
|
288
|
-
return
|
|
294
|
+
var r = $();
|
|
295
|
+
return a(r, () => e.description), f(() => g(r, d("text-[var(--floe-ink-soft)] mt-0.5", C[u()].description))), r;
|
|
289
296
|
}
|
|
290
|
-
}), null),
|
|
297
|
+
}), null), a(t, n(b, {
|
|
291
298
|
get when() {
|
|
292
299
|
return c();
|
|
293
300
|
},
|
|
294
301
|
get children() {
|
|
295
|
-
var r =
|
|
296
|
-
return
|
|
302
|
+
var r = ae(), o = r.firstChild;
|
|
303
|
+
return a(o, n(O, {
|
|
297
304
|
class: "w-2.5 h-2.5 text-primary-foreground"
|
|
298
305
|
})), r;
|
|
299
306
|
}
|
|
300
307
|
}), null), f((r) => {
|
|
301
|
-
var
|
|
302
|
-
return
|
|
308
|
+
var o = c() ? "inset" : "raised", l = c() ? "true" : void 0, i = w(), _ = d("relative flex flex-col items-center justify-center cursor-pointer select-none", "rounded-control border transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)] text-center", L[u()].container, c() ? "border-[var(--floe-accent-line)] bg-[var(--floe-state-selected)]" : "border-[var(--floe-line)] bg-transparent hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)]", k() && "opacity-50 cursor-not-allowed", e.class);
|
|
309
|
+
return o !== r.e && m(t, "data-floe-surface", r.e = o), l !== r.t && m(t, "data-floe-selected", r.t = l), i !== r.a && m(t, "data-floe-choice-variant", r.a = i), _ !== r.o && g(t, r.o = _), r;
|
|
303
310
|
}, {
|
|
304
311
|
e: void 0,
|
|
305
312
|
t: void 0,
|
|
@@ -311,29 +318,29 @@ function fe(w) {
|
|
|
311
318
|
}
|
|
312
319
|
});
|
|
313
320
|
}
|
|
314
|
-
function
|
|
315
|
-
const [
|
|
316
|
-
return
|
|
321
|
+
function xe(x) {
|
|
322
|
+
const [s, p] = P(x, ["options"]);
|
|
323
|
+
return n(ve, B(p, {
|
|
317
324
|
get children() {
|
|
318
|
-
return
|
|
325
|
+
return n(J, {
|
|
319
326
|
get each() {
|
|
320
|
-
return
|
|
327
|
+
return s.options;
|
|
321
328
|
},
|
|
322
|
-
children: (
|
|
329
|
+
children: (e) => n(he, {
|
|
323
330
|
get value() {
|
|
324
|
-
return
|
|
331
|
+
return e.value;
|
|
325
332
|
},
|
|
326
333
|
get label() {
|
|
327
|
-
return
|
|
334
|
+
return e.label;
|
|
328
335
|
},
|
|
329
336
|
get description() {
|
|
330
|
-
return
|
|
337
|
+
return e.description;
|
|
331
338
|
},
|
|
332
339
|
get icon() {
|
|
333
|
-
return
|
|
340
|
+
return e.icon;
|
|
334
341
|
},
|
|
335
342
|
get disabled() {
|
|
336
|
-
return
|
|
343
|
+
return e.disabled;
|
|
337
344
|
}
|
|
338
345
|
})
|
|
339
346
|
});
|
|
@@ -341,7 +348,7 @@ function be(w) {
|
|
|
341
348
|
}));
|
|
342
349
|
}
|
|
343
350
|
export {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
351
|
+
he as Checkbox,
|
|
352
|
+
ve as CheckboxGroup,
|
|
353
|
+
xe as CheckboxList
|
|
347
354
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
import type { TableSort } from './dataTableModel';
|
|
3
|
+
export interface DataTableColumn<T> {
|
|
4
|
+
id: string;
|
|
5
|
+
header: string;
|
|
6
|
+
cell: (row: T) => JSX.Element;
|
|
7
|
+
sortable?: boolean;
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface DataTableProps<T> {
|
|
11
|
+
/** Rows are already filtered, sorted and paginated by the host or createTableModel. */
|
|
12
|
+
rows: readonly T[];
|
|
13
|
+
columns: readonly DataTableColumn<T>[];
|
|
14
|
+
rowKey: (row: T) => string;
|
|
15
|
+
ariaLabel: string;
|
|
16
|
+
caption?: string;
|
|
17
|
+
sort?: TableSort;
|
|
18
|
+
onSortChange?: (sort: TableSort) => void;
|
|
19
|
+
selectedKeys?: readonly string[];
|
|
20
|
+
onSelectionChange?: (keys: string[]) => void;
|
|
21
|
+
isRowSelectable?: (row: T) => boolean;
|
|
22
|
+
rowLabel?: (row: T) => string;
|
|
23
|
+
hiddenColumns?: readonly string[];
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
error?: string;
|
|
26
|
+
onRetry?: () => void;
|
|
27
|
+
empty?: JSX.Element;
|
|
28
|
+
/** Product-owned search, column visibility and bulk actions. */
|
|
29
|
+
toolbar?: JSX.Element;
|
|
30
|
+
pagination?: JSX.Element;
|
|
31
|
+
class?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function DataTable<T>(props: DataTableProps<T>): JSX.Element;
|