@vanstack/solid-ark 0.0.1
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/FormDatePicker-BWrGST8J.js +433 -0
- package/dist/FormSelect-Dex9R5TZ.js +92 -0
- package/dist/button/Button.d.ts +10 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.mjs +2 -0
- package/dist/button-C9xYlZbo.js +44 -0
- package/dist/data-table/DataTable.d.ts +2 -0
- package/dist/data-table/Pagination.d.ts +9 -0
- package/dist/data-table/index.d.ts +4 -0
- package/dist/data-table/index.mjs +251 -0
- package/dist/data-table/type.d.ts +59 -0
- package/dist/drawer/index.d.ts +2 -0
- package/dist/drawer/index.mjs +236 -0
- package/dist/drawer/manager.d.ts +9 -0
- package/dist/drawer/type.d.ts +34 -0
- package/dist/form/Form.d.ts +7 -0
- package/dist/form/components/FieldRenderer.d.ts +8 -0
- package/dist/form/components/FieldSkeleton.d.ts +1 -0
- package/dist/form/components/FormCheckbox.d.ts +6 -0
- package/dist/form/components/FormCheckboxGroup.d.ts +7 -0
- package/dist/form/components/FormDatePicker.d.ts +8 -0
- package/dist/form/components/FormInput.d.ts +7 -0
- package/dist/form/components/FormRadio.d.ts +7 -0
- package/dist/form/components/FormSelect.d.ts +8 -0
- package/dist/form/components/FormSwitch.d.ts +6 -0
- package/dist/form/components/FormTextarea.d.ts +7 -0
- package/dist/form/components/useDebouncedValue.d.ts +16 -0
- package/dist/form/components/utils.d.ts +6 -0
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.mjs +2 -0
- package/dist/form/type.d.ts +127 -0
- package/dist/form-TmnHhNkx.js +559 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +0 -0
- package/dist/modal/index.d.ts +2 -0
- package/dist/modal/index.mjs +239 -0
- package/dist/modal/manager.d.ts +10 -0
- package/dist/modal/type.d.ts +32 -0
- package/dist/solid-ark.css +2 -0
- package/dist/table/Table.d.ts +2 -0
- package/dist/table/index.d.ts +2 -0
- package/dist/table/index.mjs +2 -0
- package/dist/table/type.d.ts +23 -0
- package/dist/table-B88tYpbb.js +230 -0
- package/dist/toast/index.d.ts +9 -0
- package/dist/toast/index.mjs +81 -0
- package/package.json +91 -0
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { Portal as e, createComponent as t, delegateEvents as n, effect as r, insert as i, memo as a, template as o } from "solid-js/web";
|
|
2
|
+
import { Index as s, createMemo as c, createSignal as l } from "solid-js";
|
|
3
|
+
import { DatePicker as u, useDatePicker as d } from "@ark-ui/solid/date-picker";
|
|
4
|
+
import { CalendarDate as f, CalendarDateTime as p, endOfWeek as m, parseDate as h, startOfWeek as g } from "@internationalized/date";
|
|
5
|
+
//#region src/form/components/FormDatePicker.tsx
|
|
6
|
+
var _ = /*#__PURE__*/ o("<svg fill=none height=14 stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 viewBox=\"0 0 24 24\"width=14 xmlns=http://www.w3.org/2000/svg><path d=\"M18 6 6 18\"></path><path d=\"m6 6 12 12\">"), v = /*#__PURE__*/ o("<svg fill=none height=16 stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 viewBox=\"0 0 24 24\"width=16 xmlns=http://www.w3.org/2000/svg><path d=\"M8 2v4\"></path><path d=\"M16 2v4\"></path><rect height=18 rx=2 width=18 x=3 y=4></rect><path d=\"M3 10h18\">"), y = /*#__PURE__*/ o("<svg fill=none height=16 stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 viewBox=\"0 0 24 24\"width=16 xmlns=http://www.w3.org/2000/svg><path d=\"m15 18-6-6 6-6\">"), b = /*#__PURE__*/ o("<svg fill=none height=16 stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 viewBox=\"0 0 24 24\"width=16 xmlns=http://www.w3.org/2000/svg><path d=\"m9 18 6-6-6-6\">"), x = /*#__PURE__*/ o("<div class=van-form-date-days>"), S = /*#__PURE__*/ o("<span class=van-form-date-icon>"), C = /*#__PURE__*/ o("<input aria-label=选择时间 class=van-form-date-time type=time>"), w = [
|
|
7
|
+
"sun",
|
|
8
|
+
"mon",
|
|
9
|
+
"tue",
|
|
10
|
+
"wed",
|
|
11
|
+
"thu",
|
|
12
|
+
"fri",
|
|
13
|
+
"sat"
|
|
14
|
+
];
|
|
15
|
+
function T(e) {
|
|
16
|
+
return String(e).padStart(2, "0");
|
|
17
|
+
}
|
|
18
|
+
function E(e) {
|
|
19
|
+
return "hour" in e ? e : {
|
|
20
|
+
hour: 0,
|
|
21
|
+
minute: 0
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function D(e) {
|
|
25
|
+
if (!e) return "";
|
|
26
|
+
let t = E(e);
|
|
27
|
+
return `${T(t.hour)}:${T(t.minute)}`;
|
|
28
|
+
}
|
|
29
|
+
function O(e, t) {
|
|
30
|
+
switch (t) {
|
|
31
|
+
case "datetime": {
|
|
32
|
+
let t = E(e);
|
|
33
|
+
return `${e.year}-${T(e.month)}-${T(e.day)} ${T(t.hour)}:${T(t.minute)}`;
|
|
34
|
+
}
|
|
35
|
+
case "month": return `${e.year}-${T(e.month)}`;
|
|
36
|
+
case "year": return String(e.year);
|
|
37
|
+
default: return `${e.year}-${T(e.month)}-${T(e.day)}`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function k(e, t) {
|
|
41
|
+
switch (t) {
|
|
42
|
+
case "datetime": {
|
|
43
|
+
let t = E(e);
|
|
44
|
+
return Date.UTC(e.year, e.month - 1, e.day, t.hour, t.minute);
|
|
45
|
+
}
|
|
46
|
+
case "month": return Date.UTC(e.year, e.month - 1, 1);
|
|
47
|
+
case "year": return Date.UTC(e.year, 0, 1);
|
|
48
|
+
default: return Date.UTC(e.year, e.month - 1, e.day);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function A(e, t, n, r) {
|
|
52
|
+
let i = e.filter((e) => e != null);
|
|
53
|
+
if (r) return n === "timestamp" ? i.map((e) => k(e, t)) : i.map((e) => O(e, t));
|
|
54
|
+
let a = i[0];
|
|
55
|
+
return a == null ? void 0 : n === "timestamp" ? k(a, t) : O(a, t);
|
|
56
|
+
}
|
|
57
|
+
function j(e, t, n, r) {
|
|
58
|
+
return (r && Array.isArray(e) ? e : [e]).map((e) => M(e, t, n)).filter((e) => e != null);
|
|
59
|
+
}
|
|
60
|
+
function M(e, t, n) {
|
|
61
|
+
if (!(e == null || e === "")) {
|
|
62
|
+
if (n === "timestamp" && typeof e == "number") return N(e, t);
|
|
63
|
+
if (typeof e == "string") try {
|
|
64
|
+
switch (t) {
|
|
65
|
+
case "datetime": {
|
|
66
|
+
let t = /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})$/.exec(e);
|
|
67
|
+
return t ? new p(Number(t[1]), Number(t[2]), Number(t[3]), Number(t[4]), Number(t[5])) : void 0;
|
|
68
|
+
}
|
|
69
|
+
case "month": {
|
|
70
|
+
let t = /^(\d{4})-(\d{2})$/.exec(e);
|
|
71
|
+
return t ? new f(Number(t[1]), Number(t[2]), 1) : void 0;
|
|
72
|
+
}
|
|
73
|
+
case "year": {
|
|
74
|
+
let t = Number(e);
|
|
75
|
+
return Number.isInteger(t) ? new f(t, 1, 1) : void 0;
|
|
76
|
+
}
|
|
77
|
+
default: return h(e);
|
|
78
|
+
}
|
|
79
|
+
} catch {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function N(e, t) {
|
|
85
|
+
let n = new Date(e), r = n.getUTCFullYear(), i = n.getUTCMonth() + 1, a = n.getUTCDate();
|
|
86
|
+
switch (t) {
|
|
87
|
+
case "datetime": return new p(r, i, a, n.getUTCHours(), n.getUTCMinutes());
|
|
88
|
+
case "month": return new f(r, i, 1);
|
|
89
|
+
case "year": return new f(r, 1, 1);
|
|
90
|
+
default: return new f(r, i, a);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function P() {
|
|
94
|
+
return _();
|
|
95
|
+
}
|
|
96
|
+
function F() {
|
|
97
|
+
return v();
|
|
98
|
+
}
|
|
99
|
+
function I() {
|
|
100
|
+
return y();
|
|
101
|
+
}
|
|
102
|
+
function L() {
|
|
103
|
+
return b();
|
|
104
|
+
}
|
|
105
|
+
function R() {
|
|
106
|
+
return t(u.ViewControl, {
|
|
107
|
+
class: "van-form-date-view-control",
|
|
108
|
+
get children() {
|
|
109
|
+
return [
|
|
110
|
+
t(u.PrevTrigger, {
|
|
111
|
+
class: "van-form-date-nav-trigger",
|
|
112
|
+
get children() {
|
|
113
|
+
return t(I, {});
|
|
114
|
+
}
|
|
115
|
+
}),
|
|
116
|
+
t(u.ViewTrigger, {
|
|
117
|
+
class: "van-form-date-view-trigger",
|
|
118
|
+
get children() {
|
|
119
|
+
return t(u.RangeText, {});
|
|
120
|
+
}
|
|
121
|
+
}),
|
|
122
|
+
t(u.NextTrigger, {
|
|
123
|
+
class: "van-form-date-nav-trigger",
|
|
124
|
+
get children() {
|
|
125
|
+
return t(L, {});
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function z(e) {
|
|
133
|
+
return t(u.Context, { children: (n) => {
|
|
134
|
+
let r = e.dual ? c(() => n().getOffset({ months: 1 })) : null, o = (r, i, o = !1, c = !1) => t(u.Table, {
|
|
135
|
+
class: "van-form-date-table",
|
|
136
|
+
get children() {
|
|
137
|
+
return [t(u.TableHead, {
|
|
138
|
+
class: "van-form-date-table-head",
|
|
139
|
+
get children() {
|
|
140
|
+
return t(u.TableRow, {
|
|
141
|
+
class: "van-form-date-table-row",
|
|
142
|
+
get children() {
|
|
143
|
+
return [a(() => o && t(u.WeekNumberHeaderCell, {
|
|
144
|
+
class: "van-form-date-week-header",
|
|
145
|
+
children: "#"
|
|
146
|
+
})), t(s, {
|
|
147
|
+
get each() {
|
|
148
|
+
return n().weekDays;
|
|
149
|
+
},
|
|
150
|
+
children: (e) => t(u.TableHeader, {
|
|
151
|
+
class: "van-form-date-table-header",
|
|
152
|
+
get children() {
|
|
153
|
+
return e().short;
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
})];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}), t(u.TableBody, {
|
|
161
|
+
class: "van-form-date-table-body",
|
|
162
|
+
get children() {
|
|
163
|
+
return t(s, {
|
|
164
|
+
each: r,
|
|
165
|
+
children: (r, l) => t(u.TableRow, {
|
|
166
|
+
class: "van-form-date-table-row",
|
|
167
|
+
get children() {
|
|
168
|
+
return [a(() => o && t(u.WeekNumberCell, {
|
|
169
|
+
class: "van-form-date-week-cell",
|
|
170
|
+
get week() {
|
|
171
|
+
return r();
|
|
172
|
+
},
|
|
173
|
+
weekIndex: l,
|
|
174
|
+
get children() {
|
|
175
|
+
return n().getWeekNumber(r());
|
|
176
|
+
}
|
|
177
|
+
})), t(s, {
|
|
178
|
+
get each() {
|
|
179
|
+
return r();
|
|
180
|
+
},
|
|
181
|
+
children: (n) => t(u.TableCell, {
|
|
182
|
+
class: "van-form-date-cell",
|
|
183
|
+
get value() {
|
|
184
|
+
return n();
|
|
185
|
+
},
|
|
186
|
+
visibleRange: i,
|
|
187
|
+
get children() {
|
|
188
|
+
return t(u.TableCellTrigger, {
|
|
189
|
+
class: "van-form-date-cell-trigger",
|
|
190
|
+
get id() {
|
|
191
|
+
return c ? `${e.controlId}-offset-${n().toString()}` : void 0;
|
|
192
|
+
},
|
|
193
|
+
get children() {
|
|
194
|
+
return n().day;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
})];
|
|
200
|
+
}
|
|
201
|
+
})
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
})];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
return t(u.View, {
|
|
208
|
+
get class() {
|
|
209
|
+
return `van-form-date-view${e.dual ? " van-form-date-view-dual" : ""}`;
|
|
210
|
+
},
|
|
211
|
+
view: "day",
|
|
212
|
+
get children() {
|
|
213
|
+
return [t(R, {}), a(() => a(() => !!e.dual)() ? (() => {
|
|
214
|
+
var t = x();
|
|
215
|
+
return i(t, () => o(n().weeks, void 0, e.showWeekNumbers), null), i(t, () => r && o(r().weeks, r().visibleRange, !1, !0), null), t;
|
|
216
|
+
})() : o(n().weeks, void 0, e.showWeekNumbers))];
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
} });
|
|
220
|
+
}
|
|
221
|
+
function B() {
|
|
222
|
+
return t(u.Context, { children: (e) => t(u.View, {
|
|
223
|
+
class: "van-form-date-view",
|
|
224
|
+
view: "month",
|
|
225
|
+
get children() {
|
|
226
|
+
return [t(R, {}), t(u.Table, {
|
|
227
|
+
class: "van-form-date-table",
|
|
228
|
+
get children() {
|
|
229
|
+
return t(u.TableBody, {
|
|
230
|
+
class: "van-form-date-table-body",
|
|
231
|
+
get children() {
|
|
232
|
+
return t(s, {
|
|
233
|
+
get each() {
|
|
234
|
+
return e().getMonthsGrid({
|
|
235
|
+
columns: 4,
|
|
236
|
+
format: "short"
|
|
237
|
+
});
|
|
238
|
+
},
|
|
239
|
+
children: (e) => t(u.TableRow, {
|
|
240
|
+
class: "van-form-date-table-row",
|
|
241
|
+
get children() {
|
|
242
|
+
return t(s, {
|
|
243
|
+
get each() {
|
|
244
|
+
return e();
|
|
245
|
+
},
|
|
246
|
+
children: (e) => t(u.TableCell, {
|
|
247
|
+
class: "van-form-date-cell",
|
|
248
|
+
get value() {
|
|
249
|
+
return e().value;
|
|
250
|
+
},
|
|
251
|
+
get children() {
|
|
252
|
+
return t(u.TableCellTrigger, {
|
|
253
|
+
class: "van-form-date-cell-trigger",
|
|
254
|
+
get children() {
|
|
255
|
+
return e().label;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
})
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
})];
|
|
268
|
+
}
|
|
269
|
+
}) });
|
|
270
|
+
}
|
|
271
|
+
function V() {
|
|
272
|
+
return t(u.Context, { children: (e) => t(u.View, {
|
|
273
|
+
class: "van-form-date-view",
|
|
274
|
+
view: "year",
|
|
275
|
+
get children() {
|
|
276
|
+
return [t(R, {}), t(u.Table, {
|
|
277
|
+
class: "van-form-date-table",
|
|
278
|
+
get children() {
|
|
279
|
+
return t(u.TableBody, {
|
|
280
|
+
class: "van-form-date-table-body",
|
|
281
|
+
get children() {
|
|
282
|
+
return t(s, {
|
|
283
|
+
get each() {
|
|
284
|
+
return e().getYearsGrid({ columns: 4 });
|
|
285
|
+
},
|
|
286
|
+
children: (e) => t(u.TableRow, {
|
|
287
|
+
class: "van-form-date-table-row",
|
|
288
|
+
get children() {
|
|
289
|
+
return t(s, {
|
|
290
|
+
get each() {
|
|
291
|
+
return e();
|
|
292
|
+
},
|
|
293
|
+
children: (e) => t(u.TableCell, {
|
|
294
|
+
class: "van-form-date-cell",
|
|
295
|
+
get value() {
|
|
296
|
+
return e().value;
|
|
297
|
+
},
|
|
298
|
+
get children() {
|
|
299
|
+
return t(u.TableCellTrigger, {
|
|
300
|
+
class: "van-form-date-cell-trigger",
|
|
301
|
+
get children() {
|
|
302
|
+
return e().label;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
})
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
})
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
})];
|
|
315
|
+
}
|
|
316
|
+
}) });
|
|
317
|
+
}
|
|
318
|
+
function H(n) {
|
|
319
|
+
let o = () => n.field.mode ?? "date", s = () => n.field.range === !0 || o() === "week", f = () => n.field.valueType ?? "string", [p, h] = l(null), _ = c(() => p() || j(n.value, o(), f(), s())), v, y = (e) => {
|
|
320
|
+
if (o() === "week") {
|
|
321
|
+
let t = e.value.find((e) => e != null);
|
|
322
|
+
if (!t) {
|
|
323
|
+
n.onChange([]);
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
let r = w[n.field.startOfWeek ?? 1] ?? "mon", i = n.field.locale ?? "zh-CN", a = g(t, i, r), o = m(t, i, r);
|
|
327
|
+
n.onChange(f() === "timestamp" ? [k(a, "week"), k(o, "week")] : [O(a, "week"), O(o, "week")]), v?.().setOpen(!1);
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
if (s()) {
|
|
331
|
+
if (e.value.length === 0) {
|
|
332
|
+
h(null), n.onChange([]);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (e.value.length < 2 || e.value[0] === null || e.value[0] === void 0 || e.value[1] === null || e.value[1] === void 0) {
|
|
336
|
+
h(e.value.filter((e) => e != null));
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
h(null), n.onChange(A(e.value, o(), f(), !0));
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
n.onChange(A(e.value, o(), f(), !1));
|
|
343
|
+
}, b = d(() => ({
|
|
344
|
+
closeOnSelect: o() !== "datetime" && void 0,
|
|
345
|
+
defaultView: o() === "year" ? "year" : o() === "month" ? "month" : void 0,
|
|
346
|
+
format: (e) => O(e, o()),
|
|
347
|
+
id: n.controlId,
|
|
348
|
+
ids: { trigger: n.controlId },
|
|
349
|
+
locale: n.field.locale ?? "zh-CN",
|
|
350
|
+
maxView: o() === "year" ? "year" : o() === "month" ? "month" : void 0,
|
|
351
|
+
minView: o() === "year" ? "year" : o() === "month" ? "month" : void 0,
|
|
352
|
+
numOfMonths: s() && o() === "date" ? 2 : void 0,
|
|
353
|
+
onOpenChange: (e) => {
|
|
354
|
+
e.open || h(null), n.onBlur();
|
|
355
|
+
},
|
|
356
|
+
onValueChange: y,
|
|
357
|
+
outsideDaySelectable: n.field.outsideDaySelectable ?? !0,
|
|
358
|
+
selectionMode: s() ? "range" : "single",
|
|
359
|
+
showWeekNumbers: o() === "week",
|
|
360
|
+
startOfWeek: n.field.startOfWeek ?? (o() === "week" ? 1 : void 0),
|
|
361
|
+
value: _()
|
|
362
|
+
}));
|
|
363
|
+
return v = b, t(u.RootProvider, {
|
|
364
|
+
value: b,
|
|
365
|
+
get children() {
|
|
366
|
+
return [t(u.Control, {
|
|
367
|
+
class: "van-form-date-control",
|
|
368
|
+
get children() {
|
|
369
|
+
return [t(u.Trigger, {
|
|
370
|
+
class: "van-form-date-trigger",
|
|
371
|
+
get children() {
|
|
372
|
+
return [t(u.ValueText, {
|
|
373
|
+
class: "van-form-date-value",
|
|
374
|
+
get placeholder() {
|
|
375
|
+
return n.field.placeholder ?? "请选择";
|
|
376
|
+
},
|
|
377
|
+
separator: " ~ "
|
|
378
|
+
}), (() => {
|
|
379
|
+
var e = S();
|
|
380
|
+
return i(e, t(F, {})), e;
|
|
381
|
+
})()];
|
|
382
|
+
}
|
|
383
|
+
}), a(() => a(() => n.field.clearable === !0)() && t(u.ClearTrigger, {
|
|
384
|
+
class: "van-form-date-clear",
|
|
385
|
+
get children() {
|
|
386
|
+
return t(P, {});
|
|
387
|
+
}
|
|
388
|
+
}))];
|
|
389
|
+
}
|
|
390
|
+
}), t(e, { get children() {
|
|
391
|
+
return t(u.Positioner, {
|
|
392
|
+
class: "van-form-date-positioner",
|
|
393
|
+
get children() {
|
|
394
|
+
return t(u.Content, {
|
|
395
|
+
get class() {
|
|
396
|
+
return `van-form-date-content${o() === "week" ? " van-form-date-week-mode" : ""}`;
|
|
397
|
+
},
|
|
398
|
+
get children() {
|
|
399
|
+
return [a(() => a(() => o() === "year")() ? t(V, {}) : a(() => o() === "month")() ? t(B, {}) : [
|
|
400
|
+
t(z, {
|
|
401
|
+
get controlId() {
|
|
402
|
+
return n.controlId;
|
|
403
|
+
},
|
|
404
|
+
get dual() {
|
|
405
|
+
return a(() => n.field.range === !0)() && o() === "date";
|
|
406
|
+
},
|
|
407
|
+
get showWeekNumbers() {
|
|
408
|
+
return o() === "week";
|
|
409
|
+
}
|
|
410
|
+
}),
|
|
411
|
+
t(B, {}),
|
|
412
|
+
t(V, {})
|
|
413
|
+
]), a(() => a(() => o() === "datetime")() && t(u.Context, { children: (e) => (() => {
|
|
414
|
+
var t = C();
|
|
415
|
+
return t.$$input = (t) => {
|
|
416
|
+
let [n, r] = t.currentTarget.value.split(":").map(Number);
|
|
417
|
+
e().setTime({
|
|
418
|
+
hour: n,
|
|
419
|
+
minute: r
|
|
420
|
+
});
|
|
421
|
+
}, r(() => t.value = D(e().value[0])), t;
|
|
422
|
+
})() }))];
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
} })];
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
n(["input"]);
|
|
432
|
+
//#endregion
|
|
433
|
+
export { H as FormDatePicker };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Index as e, Portal as t, createComponent as n, memo as r, template as i } from "solid-js/web";
|
|
2
|
+
import { createMemo as a } from "solid-js";
|
|
3
|
+
import { Select as o, createListCollection as s } from "@ark-ui/solid/select";
|
|
4
|
+
//#region src/form/components/FormSelect.tsx
|
|
5
|
+
var c = /*#__PURE__*/ i("<svg fill=none height=14 stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 viewBox=\"0 0 24 24\"width=14 xmlns=http://www.w3.org/2000/svg><path d=\"M18 6 6 18\"></path><path d=\"m6 6 12 12\">"), l = /*#__PURE__*/ i("<svg fill=none height=16 stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 viewBox=\"0 0 24 24\"width=16 xmlns=http://www.w3.org/2000/svg><path d=\"m7 15 5 5 5-5\"></path><path d=\"m7 9 5-5 5 5\">");
|
|
6
|
+
function u() {
|
|
7
|
+
return c();
|
|
8
|
+
}
|
|
9
|
+
function d(i) {
|
|
10
|
+
let c = a(() => s({ items: i.field.options.map((e) => ({
|
|
11
|
+
label: e.label,
|
|
12
|
+
value: e.value
|
|
13
|
+
})) }));
|
|
14
|
+
return n(o.Root, {
|
|
15
|
+
get collection() {
|
|
16
|
+
return c();
|
|
17
|
+
},
|
|
18
|
+
get id() {
|
|
19
|
+
return i.controlId;
|
|
20
|
+
},
|
|
21
|
+
onOpenChange: () => i.onBlur(),
|
|
22
|
+
onValueChange: (e) => i.onChange(e.value?.[0] ?? ""),
|
|
23
|
+
get value() {
|
|
24
|
+
return r(() => !!i.value)() ? [i.value] : [];
|
|
25
|
+
},
|
|
26
|
+
get children() {
|
|
27
|
+
return [
|
|
28
|
+
n(o.Control, {
|
|
29
|
+
class: "van-form-select-control",
|
|
30
|
+
get children() {
|
|
31
|
+
return [
|
|
32
|
+
n(o.Trigger, {
|
|
33
|
+
class: "van-form-select-trigger",
|
|
34
|
+
get children() {
|
|
35
|
+
return n(o.ValueText, {
|
|
36
|
+
class: "van-form-select-value",
|
|
37
|
+
get placeholder() {
|
|
38
|
+
return i.field.placeholder ?? "请选择";
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
r(() => r(() => i.field.clearable === !0)() && n(o.ClearTrigger, {
|
|
44
|
+
class: "van-form-select-clear",
|
|
45
|
+
get children() {
|
|
46
|
+
return n(u, {});
|
|
47
|
+
}
|
|
48
|
+
})),
|
|
49
|
+
n(o.Indicator, {
|
|
50
|
+
class: "van-form-select-indicator",
|
|
51
|
+
get children() {
|
|
52
|
+
return l();
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
n(t, { get children() {
|
|
59
|
+
return n(o.Positioner, {
|
|
60
|
+
class: "van-form-select-positioner",
|
|
61
|
+
get children() {
|
|
62
|
+
return n(o.Content, {
|
|
63
|
+
class: "van-form-select-content",
|
|
64
|
+
get children() {
|
|
65
|
+
return n(e, {
|
|
66
|
+
get each() {
|
|
67
|
+
return i.field.options;
|
|
68
|
+
},
|
|
69
|
+
children: (e) => n(o.Item, {
|
|
70
|
+
class: "van-form-select-item",
|
|
71
|
+
get item() {
|
|
72
|
+
return e();
|
|
73
|
+
},
|
|
74
|
+
get children() {
|
|
75
|
+
return n(o.ItemText, { get children() {
|
|
76
|
+
return e().label;
|
|
77
|
+
} });
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
} }),
|
|
86
|
+
n(o.HiddenSelect, {})
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { d as FormSelect };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export type ButtonVariant = "danger" | "ghost" | "outline" | "primary" | "success" | "warning";
|
|
3
|
+
export type ButtonSize = "lg" | "md" | "sm";
|
|
4
|
+
export type ButtonProps = {
|
|
5
|
+
/** 加载中:显示 spinner、自动 disabled、设置 aria-busy */
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
} & JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
10
|
+
export declare function Button(rawProps: ButtonProps): JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createComponent as e, insert as t, mergeProps as n, spread as r, template as i } from "solid-js/web";
|
|
2
|
+
import { Show as a, splitProps as o } from "solid-js";
|
|
3
|
+
//#region src/button/Button.tsx
|
|
4
|
+
var s = /*#__PURE__*/ i("<span aria-hidden=true class=van-btn-spinner-wrapper><span class=van-btn-spinner>"), c = /*#__PURE__*/ i("<button>");
|
|
5
|
+
function l(i) {
|
|
6
|
+
let [l, u] = o(i, [
|
|
7
|
+
"loading",
|
|
8
|
+
"size",
|
|
9
|
+
"variant",
|
|
10
|
+
"class",
|
|
11
|
+
"children"
|
|
12
|
+
]), d = () => [
|
|
13
|
+
"van-btn",
|
|
14
|
+
`van-btn-${l.variant ?? "primary"}`,
|
|
15
|
+
`van-btn-${l.size ?? "md"}`,
|
|
16
|
+
l.class
|
|
17
|
+
].filter(Boolean).join(" ");
|
|
18
|
+
return (() => {
|
|
19
|
+
var i = c();
|
|
20
|
+
return r(i, n(u, {
|
|
21
|
+
get "aria-busy"() {
|
|
22
|
+
return l.loading ? "true" : void 0;
|
|
23
|
+
},
|
|
24
|
+
get class() {
|
|
25
|
+
return d();
|
|
26
|
+
},
|
|
27
|
+
get disabled() {
|
|
28
|
+
return l.loading || u.disabled;
|
|
29
|
+
},
|
|
30
|
+
get type() {
|
|
31
|
+
return u.type ?? "button";
|
|
32
|
+
}
|
|
33
|
+
}), !1, !0), t(i, e(a, {
|
|
34
|
+
get when() {
|
|
35
|
+
return l.loading;
|
|
36
|
+
},
|
|
37
|
+
get children() {
|
|
38
|
+
return s();
|
|
39
|
+
}
|
|
40
|
+
}), null), t(i, () => l.children, null), i;
|
|
41
|
+
})();
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { l as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface PaginationProps {
|
|
2
|
+
page: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
count: number;
|
|
5
|
+
onPageChange: (page: number) => void;
|
|
6
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function Pagination(props: PaginationProps): import("solid-js").JSX.Element;
|
|
9
|
+
export {};
|