@floegence/floe-webapp-core 0.86.76 → 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/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,8 +1,9 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { splitProps as
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { createComponent as l, spread as M, mergeProps as I, insert as s, effect as g, className as k, setAttribute as v, memo as O, template as h, delegateEvents as q } from "solid-js/web";
|
|
2
|
+
import { splitProps as H, createMemo as K, Switch as Q, Match as A, Show as z, For as j } from "solid-js";
|
|
3
|
+
import { cn as m } from "../../utils/cn.js";
|
|
4
|
+
import { useFloeLocale as U } from "../../context/LocaleContext.js";
|
|
5
|
+
var V = /* @__PURE__ */ h('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M9.78 4.22a.75.75 0 010 1.06L7.06 8l2.72 2.72a.75.75 0 11-1.06 1.06L5.47 8.53a.75.75 0 010-1.06l3.25-3.25a.75.75 0 011.06 0z"clip-rule=evenodd>'), W = /* @__PURE__ */ h('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M6.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L8.94 8 6.22 5.28a.75.75 0 010-1.06z"clip-rule=evenodd>'), X = /* @__PURE__ */ h('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M8.78 4.22a.75.75 0 010 1.06L6.06 8l2.72 2.72a.75.75 0 11-1.06 1.06L4.47 8.53a.75.75 0 010-1.06l3.25-3.25a.75.75 0 011.06 0z"clip-rule=evenodd></path><path fill-rule=evenodd d="M12.78 4.22a.75.75 0 010 1.06L10.06 8l2.72 2.72a.75.75 0 11-1.06 1.06L8.47 8.53a.75.75 0 010-1.06l3.25-3.25a.75.75 0 011.06 0z"clip-rule=evenodd>'), Y = /* @__PURE__ */ h('<svg viewBox="0 0 16 16"fill=currentColor><path fill-rule=evenodd d="M3.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L5.94 8 3.22 5.28a.75.75 0 010-1.06z"clip-rule=evenodd></path><path fill-rule=evenodd d="M7.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L9.94 8 7.22 5.28a.75.75 0 010-1.06z"clip-rule=evenodd>'), Z = /* @__PURE__ */ h('<svg viewBox="0 0 16 16"fill=currentColor><circle cx=4 cy=8 r=1.5></circle><circle cx=8 cy=8 r=1.5></circle><circle cx=12 cy=8 r=1.5>'), ee = /* @__PURE__ */ h("<button type=button data-floe-surface-part=action>"), te = /* @__PURE__ */ h("<nav><span>"), re = /* @__PURE__ */ h("<nav><span> / "), J = /* @__PURE__ */ h("<span>"), le = /* @__PURE__ */ h('<div class="flex items-center gap-2"><span></span><select data-floe-surface=inset>'), ne = /* @__PURE__ */ h('<div class="flex items-center gap-2"><span></span><input data-floe-surface=inset type=number min=1>'), ae = /* @__PURE__ */ h('<nav><div class="flex items-center gap-1">'), ie = /* @__PURE__ */ h("<option>");
|
|
6
|
+
const oe = {
|
|
6
7
|
sm: {
|
|
7
8
|
button: "h-7 min-w-7 px-2 text-xs",
|
|
8
9
|
text: "text-xs",
|
|
@@ -19,313 +20,361 @@ const ae = {
|
|
|
19
20
|
input: "h-9 w-18 text-sm"
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
|
-
function
|
|
23
|
+
function R(u) {
|
|
23
24
|
return (() => {
|
|
24
|
-
var
|
|
25
|
-
return g(() =>
|
|
25
|
+
var t = V();
|
|
26
|
+
return g(() => v(t, "class", u.class)), t;
|
|
26
27
|
})();
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function F(u) {
|
|
29
30
|
return (() => {
|
|
30
|
-
var
|
|
31
|
-
return g(() =>
|
|
31
|
+
var t = W();
|
|
32
|
+
return g(() => v(t, "class", u.class)), t;
|
|
32
33
|
})();
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function D(u) {
|
|
35
36
|
return (() => {
|
|
36
|
-
var
|
|
37
|
-
return g(() =>
|
|
37
|
+
var t = X();
|
|
38
|
+
return g(() => v(t, "class", u.class)), t;
|
|
38
39
|
})();
|
|
39
40
|
}
|
|
40
|
-
function G(
|
|
41
|
+
function G(u) {
|
|
41
42
|
return (() => {
|
|
42
|
-
var
|
|
43
|
-
return g(() =>
|
|
43
|
+
var t = Y();
|
|
44
|
+
return g(() => v(t, "class", u.class)), t;
|
|
44
45
|
})();
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function se(u) {
|
|
47
48
|
return (() => {
|
|
48
|
-
var
|
|
49
|
-
return g(() =>
|
|
49
|
+
var t = Z();
|
|
50
|
+
return g(() => v(t, "class", u.class)), t;
|
|
50
51
|
})();
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
53
|
+
function ce(u, t, e) {
|
|
54
|
+
const S = e * 2 + 5;
|
|
55
|
+
if (t <= S)
|
|
55
56
|
return Array.from({
|
|
56
|
-
length:
|
|
57
|
-
}, (
|
|
58
|
-
const
|
|
59
|
-
return !
|
|
60
|
-
length: 3 + 2 *
|
|
61
|
-
}, (
|
|
62
|
-
length: 3 + 2 *
|
|
63
|
-
}, (
|
|
64
|
-
length:
|
|
65
|
-
}, (
|
|
57
|
+
length: t
|
|
58
|
+
}, (w, x) => x + 1);
|
|
59
|
+
const y = Math.max(u - e, 1), L = Math.min(u + e, t), P = y > 2, f = L < t - 1;
|
|
60
|
+
return !P && f ? [...Array.from({
|
|
61
|
+
length: 3 + 2 * e
|
|
62
|
+
}, (x, d) => d + 1), "ellipsis", t] : P && !f ? [1, "ellipsis", ...Array.from({
|
|
63
|
+
length: 3 + 2 * e
|
|
64
|
+
}, (x, d) => t - (3 + 2 * e) + d + 1)] : [1, "ellipsis", ...Array.from({
|
|
65
|
+
length: L - y + 1
|
|
66
|
+
}, (w, x) => y + x), "ellipsis", t];
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
const [e,
|
|
68
|
+
function he(u) {
|
|
69
|
+
const t = U(), [e, S] = H(u, ["page", "totalPages", "onChange", "size", "variant", "siblingCount", "showFirstLast", "showPageSize", "pageSize", "pageSizes", "onPageSizeChange", "showJumpTo", "totalItems", "disabled", "class"]), y = () => e.size ?? "md", L = () => e.variant ?? "default", P = () => e.siblingCount ?? 1, f = () => oe[y()], N = K(() => ce(e.page, e.totalPages, P())), w = () => e.page > 1, x = () => e.page < e.totalPages, d = (r) => {
|
|
69
70
|
if (e.disabled) return;
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
const
|
|
74
|
-
isNaN(
|
|
75
|
-
},
|
|
76
|
-
const
|
|
71
|
+
const i = Math.max(1, Math.min(r, e.totalPages));
|
|
72
|
+
i !== e.page && e.onChange?.(i);
|
|
73
|
+
}, B = (r) => {
|
|
74
|
+
const i = r.target, a = parseInt(i.value, 10);
|
|
75
|
+
isNaN(a) || d(a), i.value = "";
|
|
76
|
+
}, b = (r) => {
|
|
77
|
+
const i = () => r.onClick?.();
|
|
77
78
|
return (() => {
|
|
78
|
-
var
|
|
79
|
-
return
|
|
80
|
-
var c = r.isActive ? "inset" : "raised", n = r.isActive ? "page" : void 0,
|
|
81
|
-
|
|
79
|
+
var a = ee();
|
|
80
|
+
return a.$$click = i, s(a, () => r.children), g((o) => {
|
|
81
|
+
var c = r.isActive ? "inset" : "raised", n = r.isActive ? "page" : void 0, p = r.disabled || e.disabled, C = r.title ?? (r.page ? t.t("page", {
|
|
82
|
+
page: r.page
|
|
83
|
+
}) : void 0), _ = r.title, $ = m("inline-flex items-center justify-center rounded-sm font-medium", "transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)] cursor-pointer", f().button, r.isActive ? "bg-[var(--floe-plane)] text-[var(--floe-ink)] border border-[var(--floe-accent-line)] shadow-[var(--floe-elevation-raised)]" : "bg-transparent text-[var(--floe-ink-soft)] border border-[var(--floe-line)] hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)] hover:text-[var(--floe-ink)]", (r.disabled || e.disabled) && "opacity-50 cursor-not-allowed");
|
|
84
|
+
return c !== o.e && v(a, "data-floe-surface", o.e = c), n !== o.t && v(a, "aria-current", o.t = n), p !== o.a && (a.disabled = o.a = p), C !== o.o && v(a, "aria-label", o.o = C), _ !== o.i && v(a, "title", o.i = _), $ !== o.n && k(a, o.n = $), o;
|
|
82
85
|
}, {
|
|
83
86
|
e: void 0,
|
|
84
87
|
t: void 0,
|
|
85
88
|
a: void 0,
|
|
86
89
|
o: void 0,
|
|
87
|
-
i: void 0
|
|
88
|
-
|
|
90
|
+
i: void 0,
|
|
91
|
+
n: void 0
|
|
92
|
+
}), a;
|
|
89
93
|
})();
|
|
90
94
|
};
|
|
91
|
-
return
|
|
95
|
+
return l(Q, {
|
|
92
96
|
get children() {
|
|
93
|
-
return [
|
|
97
|
+
return [l(A, {
|
|
94
98
|
get when() {
|
|
95
|
-
return
|
|
99
|
+
return L() === "simple";
|
|
96
100
|
},
|
|
97
101
|
get children() {
|
|
98
|
-
var r =
|
|
99
|
-
return
|
|
102
|
+
var r = te(), i = r.firstChild;
|
|
103
|
+
return M(r, I({
|
|
104
|
+
get dir() {
|
|
105
|
+
return t.direction;
|
|
106
|
+
},
|
|
107
|
+
get "aria-label"() {
|
|
108
|
+
return t.t("pagination");
|
|
109
|
+
},
|
|
100
110
|
get class() {
|
|
101
|
-
return
|
|
111
|
+
return m("flex items-center gap-2", e.class);
|
|
102
112
|
}
|
|
103
|
-
},
|
|
113
|
+
}, S), !1, !0), s(r, l(b, {
|
|
104
114
|
get disabled() {
|
|
105
|
-
return !
|
|
115
|
+
return !w();
|
|
116
|
+
},
|
|
117
|
+
onClick: () => d(e.page - 1),
|
|
118
|
+
get title() {
|
|
119
|
+
return t.t("previousPage");
|
|
106
120
|
},
|
|
107
|
-
onClick: () => o(e.page - 1),
|
|
108
|
-
title: "Previous page",
|
|
109
121
|
get children() {
|
|
110
|
-
return
|
|
111
|
-
class: "w-4 h-4"
|
|
122
|
+
return l(R, {
|
|
123
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
112
124
|
});
|
|
113
125
|
}
|
|
114
|
-
}),
|
|
126
|
+
}), i), s(i, () => t.t("pageOf", {
|
|
127
|
+
page: e.page,
|
|
128
|
+
total: e.totalPages
|
|
129
|
+
})), s(r, l(b, {
|
|
115
130
|
get disabled() {
|
|
116
|
-
return !
|
|
131
|
+
return !x();
|
|
132
|
+
},
|
|
133
|
+
onClick: () => d(e.page + 1),
|
|
134
|
+
get title() {
|
|
135
|
+
return t.t("nextPage");
|
|
117
136
|
},
|
|
118
|
-
onClick: () => o(e.page + 1),
|
|
119
|
-
title: "Next page",
|
|
120
137
|
get children() {
|
|
121
|
-
return
|
|
122
|
-
class: "w-4 h-4"
|
|
138
|
+
return l(F, {
|
|
139
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
123
140
|
});
|
|
124
141
|
}
|
|
125
|
-
}), null), g(() =>
|
|
142
|
+
}), null), g(() => k(i, m("text-[var(--floe-ink-soft)] px-2", f().text))), r;
|
|
126
143
|
}
|
|
127
|
-
}),
|
|
144
|
+
}), l(A, {
|
|
128
145
|
get when() {
|
|
129
|
-
return
|
|
146
|
+
return L() === "minimal";
|
|
130
147
|
},
|
|
131
148
|
get children() {
|
|
132
|
-
var r =
|
|
149
|
+
var r = re(), i = r.firstChild, a = i.firstChild;
|
|
133
150
|
return M(r, I({
|
|
151
|
+
get dir() {
|
|
152
|
+
return t.direction;
|
|
153
|
+
},
|
|
154
|
+
get "aria-label"() {
|
|
155
|
+
return t.t("pagination");
|
|
156
|
+
},
|
|
134
157
|
get class() {
|
|
135
|
-
return
|
|
158
|
+
return m("flex items-center gap-1", e.class);
|
|
136
159
|
}
|
|
137
|
-
},
|
|
160
|
+
}, S), !1, !0), s(r, l(z, {
|
|
138
161
|
get when() {
|
|
139
162
|
return e.showFirstLast;
|
|
140
163
|
},
|
|
141
164
|
get children() {
|
|
142
|
-
return
|
|
165
|
+
return l(b, {
|
|
143
166
|
get disabled() {
|
|
144
|
-
return !
|
|
167
|
+
return !w();
|
|
168
|
+
},
|
|
169
|
+
onClick: () => d(1),
|
|
170
|
+
get title() {
|
|
171
|
+
return t.t("firstPage");
|
|
145
172
|
},
|
|
146
|
-
onClick: () => o(1),
|
|
147
|
-
title: "First page",
|
|
148
173
|
get children() {
|
|
149
|
-
return
|
|
150
|
-
class: "w-4 h-4"
|
|
174
|
+
return l(D, {
|
|
175
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
151
176
|
});
|
|
152
177
|
}
|
|
153
178
|
});
|
|
154
179
|
}
|
|
155
|
-
}),
|
|
180
|
+
}), i), s(r, l(b, {
|
|
156
181
|
get disabled() {
|
|
157
|
-
return !
|
|
182
|
+
return !w();
|
|
183
|
+
},
|
|
184
|
+
onClick: () => d(e.page - 1),
|
|
185
|
+
get title() {
|
|
186
|
+
return t.t("previousPage");
|
|
158
187
|
},
|
|
159
|
-
onClick: () => o(e.page - 1),
|
|
160
|
-
title: "Previous page",
|
|
161
188
|
get children() {
|
|
162
|
-
return
|
|
163
|
-
class: "w-4 h-4"
|
|
189
|
+
return l(R, {
|
|
190
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
164
191
|
});
|
|
165
192
|
}
|
|
166
|
-
}),
|
|
193
|
+
}), i), s(i, () => e.page, a), s(i, () => e.totalPages, null), s(r, l(b, {
|
|
167
194
|
get disabled() {
|
|
168
|
-
return !
|
|
195
|
+
return !x();
|
|
196
|
+
},
|
|
197
|
+
onClick: () => d(e.page + 1),
|
|
198
|
+
get title() {
|
|
199
|
+
return t.t("nextPage");
|
|
169
200
|
},
|
|
170
|
-
onClick: () => o(e.page + 1),
|
|
171
|
-
title: "Next page",
|
|
172
201
|
get children() {
|
|
173
|
-
return
|
|
174
|
-
class: "w-4 h-4"
|
|
202
|
+
return l(F, {
|
|
203
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
175
204
|
});
|
|
176
205
|
}
|
|
177
|
-
}), null), s(r,
|
|
206
|
+
}), null), s(r, l(z, {
|
|
178
207
|
get when() {
|
|
179
208
|
return e.showFirstLast;
|
|
180
209
|
},
|
|
181
210
|
get children() {
|
|
182
|
-
return
|
|
211
|
+
return l(b, {
|
|
183
212
|
get disabled() {
|
|
184
|
-
return !
|
|
213
|
+
return !x();
|
|
214
|
+
},
|
|
215
|
+
onClick: () => d(e.totalPages),
|
|
216
|
+
get title() {
|
|
217
|
+
return t.t("lastPage");
|
|
185
218
|
},
|
|
186
|
-
onClick: () => o(e.totalPages),
|
|
187
|
-
title: "Last page",
|
|
188
219
|
get children() {
|
|
189
|
-
return
|
|
190
|
-
class: "w-4 h-4"
|
|
220
|
+
return l(G, {
|
|
221
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
191
222
|
});
|
|
192
223
|
}
|
|
193
224
|
});
|
|
194
225
|
}
|
|
195
|
-
}), null), g(() =>
|
|
226
|
+
}), null), g(() => k(i, m("text-[var(--floe-ink-soft)] px-3 tabular-nums", f().text))), r;
|
|
196
227
|
}
|
|
197
|
-
}),
|
|
228
|
+
}), l(A, {
|
|
198
229
|
get when() {
|
|
199
|
-
return
|
|
230
|
+
return L() === "default";
|
|
200
231
|
},
|
|
201
232
|
get children() {
|
|
202
|
-
var r =
|
|
233
|
+
var r = ae(), i = r.firstChild;
|
|
203
234
|
return M(r, I({
|
|
235
|
+
get dir() {
|
|
236
|
+
return t.direction;
|
|
237
|
+
},
|
|
238
|
+
get "aria-label"() {
|
|
239
|
+
return t.t("pagination");
|
|
240
|
+
},
|
|
204
241
|
get class() {
|
|
205
|
-
return
|
|
242
|
+
return m("flex flex-wrap items-center gap-4", e.class);
|
|
206
243
|
}
|
|
207
|
-
},
|
|
244
|
+
}, S), !1, !0), s(r, l(z, {
|
|
208
245
|
get when() {
|
|
209
246
|
return e.totalItems !== void 0;
|
|
210
247
|
},
|
|
211
248
|
get children() {
|
|
212
|
-
var
|
|
213
|
-
return s(
|
|
249
|
+
var a = J();
|
|
250
|
+
return s(a, () => t.t("itemCount", {
|
|
251
|
+
count: e.totalItems ?? 0
|
|
252
|
+
})), g(() => k(a, m("text-[var(--floe-ink-soft)]", f().text))), a;
|
|
214
253
|
}
|
|
215
|
-
}),
|
|
254
|
+
}), i), s(r, l(z, {
|
|
216
255
|
get when() {
|
|
217
|
-
return
|
|
256
|
+
return O(() => !!e.showPageSize)() && e.pageSizes;
|
|
218
257
|
},
|
|
219
258
|
get children() {
|
|
220
|
-
var
|
|
221
|
-
return c.addEventListener("change", (n) => e.onPageSizeChange?.(parseInt(n.target.value, 10))), s(c,
|
|
259
|
+
var a = le(), o = a.firstChild, c = o.nextSibling;
|
|
260
|
+
return s(o, () => t.t("pageSize")), c.addEventListener("change", (n) => e.onPageSizeChange?.(parseInt(n.target.value, 10))), s(c, l(j, {
|
|
222
261
|
get each() {
|
|
223
262
|
return e.pageSizes;
|
|
224
263
|
},
|
|
225
264
|
children: (n) => (() => {
|
|
226
|
-
var
|
|
227
|
-
return
|
|
265
|
+
var p = ie();
|
|
266
|
+
return p.value = n, s(p, n), p;
|
|
228
267
|
})()
|
|
229
268
|
})), g((n) => {
|
|
230
|
-
var
|
|
231
|
-
return
|
|
269
|
+
var p = m("text-[var(--floe-ink-soft)]", f().text), C = t.t("pageSize"), _ = e.disabled, $ = m("rounded-control border border-[var(--floe-line)] bg-background px-2 focus:outline-none", f().input, e.disabled && "opacity-50 cursor-not-allowed");
|
|
270
|
+
return p !== n.e && k(o, n.e = p), C !== n.t && v(c, "aria-label", n.t = C), _ !== n.a && (c.disabled = n.a = _), $ !== n.o && k(c, n.o = $), n;
|
|
232
271
|
}, {
|
|
233
272
|
e: void 0,
|
|
234
273
|
t: void 0,
|
|
235
|
-
a: void 0
|
|
236
|
-
|
|
274
|
+
a: void 0,
|
|
275
|
+
o: void 0
|
|
276
|
+
}), g(() => c.value = e.pageSize), a;
|
|
237
277
|
}
|
|
238
|
-
}),
|
|
278
|
+
}), i), s(i, l(z, {
|
|
239
279
|
get when() {
|
|
240
280
|
return e.showFirstLast;
|
|
241
281
|
},
|
|
242
282
|
get children() {
|
|
243
|
-
return
|
|
283
|
+
return l(b, {
|
|
244
284
|
get disabled() {
|
|
245
|
-
return !
|
|
285
|
+
return !w();
|
|
286
|
+
},
|
|
287
|
+
onClick: () => d(1),
|
|
288
|
+
get title() {
|
|
289
|
+
return t.t("firstPage");
|
|
246
290
|
},
|
|
247
|
-
onClick: () => o(1),
|
|
248
|
-
title: "First page",
|
|
249
291
|
get children() {
|
|
250
|
-
return
|
|
251
|
-
class: "w-4 h-4"
|
|
292
|
+
return l(D, {
|
|
293
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
252
294
|
});
|
|
253
295
|
}
|
|
254
296
|
});
|
|
255
297
|
}
|
|
256
|
-
}), null), s(
|
|
298
|
+
}), null), s(i, l(b, {
|
|
257
299
|
get disabled() {
|
|
258
|
-
return !
|
|
300
|
+
return !w();
|
|
301
|
+
},
|
|
302
|
+
onClick: () => d(e.page - 1),
|
|
303
|
+
get title() {
|
|
304
|
+
return t.t("previousPage");
|
|
259
305
|
},
|
|
260
|
-
onClick: () => o(e.page - 1),
|
|
261
|
-
title: "Previous page",
|
|
262
306
|
get children() {
|
|
263
|
-
return
|
|
264
|
-
class: "w-4 h-4"
|
|
307
|
+
return l(R, {
|
|
308
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
265
309
|
});
|
|
266
310
|
}
|
|
267
|
-
}), null), s(
|
|
311
|
+
}), null), s(i, l(j, {
|
|
268
312
|
get each() {
|
|
269
|
-
return
|
|
313
|
+
return N();
|
|
270
314
|
},
|
|
271
|
-
children: (
|
|
272
|
-
var
|
|
273
|
-
return s(
|
|
274
|
-
class: "w-4 h-4"
|
|
275
|
-
})), g(() =>
|
|
276
|
-
})() :
|
|
277
|
-
page:
|
|
315
|
+
children: (a) => a === "ellipsis" ? (() => {
|
|
316
|
+
var o = J();
|
|
317
|
+
return s(o, l(se, {
|
|
318
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
319
|
+
})), g(() => k(o, m("px-2 text-[var(--floe-ink-soft)]", f().text))), o;
|
|
320
|
+
})() : l(b, {
|
|
321
|
+
page: a,
|
|
278
322
|
get isActive() {
|
|
279
|
-
return
|
|
323
|
+
return a === e.page;
|
|
280
324
|
},
|
|
281
|
-
onClick: () =>
|
|
282
|
-
children:
|
|
325
|
+
onClick: () => d(a),
|
|
326
|
+
children: a
|
|
283
327
|
})
|
|
284
|
-
}), null), s(
|
|
328
|
+
}), null), s(i, l(b, {
|
|
285
329
|
get disabled() {
|
|
286
|
-
return !
|
|
330
|
+
return !x();
|
|
331
|
+
},
|
|
332
|
+
onClick: () => d(e.page + 1),
|
|
333
|
+
get title() {
|
|
334
|
+
return t.t("nextPage");
|
|
287
335
|
},
|
|
288
|
-
onClick: () => o(e.page + 1),
|
|
289
|
-
title: "Next page",
|
|
290
336
|
get children() {
|
|
291
|
-
return
|
|
292
|
-
class: "w-4 h-4"
|
|
337
|
+
return l(F, {
|
|
338
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
293
339
|
});
|
|
294
340
|
}
|
|
295
|
-
}), null), s(
|
|
341
|
+
}), null), s(i, l(z, {
|
|
296
342
|
get when() {
|
|
297
343
|
return e.showFirstLast;
|
|
298
344
|
},
|
|
299
345
|
get children() {
|
|
300
|
-
return
|
|
346
|
+
return l(b, {
|
|
301
347
|
get disabled() {
|
|
302
|
-
return !
|
|
348
|
+
return !x();
|
|
349
|
+
},
|
|
350
|
+
onClick: () => d(e.totalPages),
|
|
351
|
+
get title() {
|
|
352
|
+
return t.t("lastPage");
|
|
303
353
|
},
|
|
304
|
-
onClick: () => o(e.totalPages),
|
|
305
|
-
title: "Last page",
|
|
306
354
|
get children() {
|
|
307
|
-
return
|
|
308
|
-
class: "w-4 h-4"
|
|
355
|
+
return l(G, {
|
|
356
|
+
class: "w-4 h-4 rtl:rotate-180"
|
|
309
357
|
});
|
|
310
358
|
}
|
|
311
359
|
});
|
|
312
360
|
}
|
|
313
|
-
}), null), s(r,
|
|
361
|
+
}), null), s(r, l(z, {
|
|
314
362
|
get when() {
|
|
315
363
|
return e.showJumpTo;
|
|
316
364
|
},
|
|
317
365
|
get children() {
|
|
318
|
-
var
|
|
319
|
-
return c.addEventListener("blur",
|
|
320
|
-
var
|
|
321
|
-
return
|
|
366
|
+
var a = ne(), o = a.firstChild, c = o.nextSibling;
|
|
367
|
+
return s(o, () => t.t("jumpTo")), c.addEventListener("blur", B), c.$$keydown = (n) => n.key === "Enter" && B(n), g((n) => {
|
|
368
|
+
var p = m("text-[var(--floe-ink-soft)]", f().text), C = t.t("jumpTo"), _ = e.totalPages, $ = String(e.page), E = e.disabled, T = m("rounded-control border border-[var(--floe-line)] bg-background px-2 text-center", "focus:outline-none", "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none", f().input, e.disabled && "opacity-50 cursor-not-allowed");
|
|
369
|
+
return p !== n.e && k(o, n.e = p), C !== n.t && v(c, "aria-label", n.t = C), _ !== n.a && v(c, "max", n.a = _), $ !== n.o && v(c, "placeholder", n.o = $), E !== n.i && (c.disabled = n.i = E), T !== n.n && k(c, n.n = T), n;
|
|
322
370
|
}, {
|
|
323
371
|
e: void 0,
|
|
324
372
|
t: void 0,
|
|
325
373
|
a: void 0,
|
|
326
374
|
o: void 0,
|
|
327
|
-
i: void 0
|
|
328
|
-
|
|
375
|
+
i: void 0,
|
|
376
|
+
n: void 0
|
|
377
|
+
}), a;
|
|
329
378
|
}
|
|
330
379
|
}), null), r;
|
|
331
380
|
}
|
|
@@ -333,7 +382,7 @@ function ue(d) {
|
|
|
333
382
|
}
|
|
334
383
|
});
|
|
335
384
|
}
|
|
336
|
-
|
|
385
|
+
q(["click", "keydown"]);
|
|
337
386
|
export {
|
|
338
|
-
|
|
387
|
+
he as Pagination
|
|
339
388
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
2
|
export type PopoverPlacement = 'bottom-start' | 'bottom-center' | 'bottom-end' | 'top-start' | 'top-center' | 'top-end';
|
|
3
|
+
export interface PopoverTriggerProps {
|
|
4
|
+
'aria-haspopup': 'dialog';
|
|
5
|
+
'aria-expanded': boolean;
|
|
6
|
+
'aria-controls': string | undefined;
|
|
7
|
+
}
|
|
3
8
|
export interface PopoverProps {
|
|
4
9
|
/** The element that opens the panel. It keeps its own layout and semantics. */
|
|
5
|
-
trigger: JSX.Element;
|
|
10
|
+
trigger: JSX.Element | ((props: PopoverTriggerProps) => JSX.Element);
|
|
6
11
|
children: JSX.Element | ((close: () => void) => JSX.Element);
|
|
7
12
|
/** Controlled visibility. Omit for uncontrolled use with `defaultOpen`. */
|
|
8
13
|
open?: boolean;
|