Commit
β’
256ba3e
1
Parent(s):
c4d348c
Upload folder using huggingface_hub
Browse files- README.md +3 -3
- app.py +1 -1
- requirements.txt +1 -1
- src/backend/gradio_calendar/templates/component/index.js +224 -232
- src/backend/gradio_calendar/templates/component/style.css +1 -1
- src/demo/app.py +1 -1
- src/frontend/Index.svelte +4 -7
- src/pyproject.toml +2 -2
README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
|
2 |
---
|
3 |
tags: [gradio-custom-component,gradio-template-Fallback,time,calendar,forms]
|
4 |
-
title: gradio_calendar V0.0.
|
5 |
-
colorFrom:
|
6 |
-
colorTo:
|
7 |
sdk: docker
|
8 |
pinned: false
|
9 |
license: apache-2.0
|
|
|
1 |
|
2 |
---
|
3 |
tags: [gradio-custom-component,gradio-template-Fallback,time,calendar,forms]
|
4 |
+
title: gradio_calendar V0.0.2
|
5 |
+
colorFrom: yellow
|
6 |
+
colorTo: gray
|
7 |
sdk: docker
|
8 |
pinned: false
|
9 |
license: apache-2.0
|
app.py
CHANGED
@@ -6,7 +6,7 @@ def is_weekday(date: datetime.datetime):
|
|
6 |
return date.weekday() < 5
|
7 |
|
8 |
demo = gr.Interface(is_weekday,
|
9 |
-
[Calendar(type="datetime", label="Select a date", info="Click
|
10 |
gr.Label(label="Is it a weekday?"),
|
11 |
examples=["2023-01-01", "2023-12-11"],
|
12 |
cache_examples=True,
|
|
|
6 |
return date.weekday() < 5
|
7 |
|
8 |
demo = gr.Interface(is_weekday,
|
9 |
+
[Calendar(type="datetime", label="Select a date", info="Click the calendar icon to bring up the calendar.")],
|
10 |
gr.Label(label="Is it a weekday?"),
|
11 |
examples=["2023-01-01", "2023-12-11"],
|
12 |
cache_examples=True,
|
requirements.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
gradio_calendar-0.0.
|
|
|
1 |
+
gradio_calendar-0.0.2-py3-none-any.whl
|
src/backend/gradio_calendar/templates/component/index.js
CHANGED
@@ -10,37 +10,37 @@ const {
|
|
10 |
init: le,
|
11 |
insert: ne,
|
12 |
safe_not_equal: fe,
|
13 |
-
set_dynamic_element_data:
|
14 |
set_style: r,
|
15 |
-
toggle_class:
|
16 |
-
transition_in:
|
17 |
-
transition_out:
|
18 |
update_slot_base: ie
|
19 |
} = window.__gradio__svelte__internal;
|
20 |
-
function ae(
|
21 |
-
let e, t,
|
22 |
const f = (
|
23 |
/*#slots*/
|
24 |
-
|
25 |
), a = Z(
|
26 |
f,
|
27 |
-
|
28 |
/*$$scope*/
|
29 |
-
|
30 |
null
|
31 |
);
|
32 |
let o = [
|
33 |
{ "data-testid": (
|
34 |
/*test_id*/
|
35 |
-
|
36 |
) },
|
37 |
{ id: (
|
38 |
/*elem_id*/
|
39 |
-
|
40 |
) },
|
41 |
{
|
42 |
class: t = "block " + /*elem_classes*/
|
43 |
-
|
44 |
}
|
45 |
], _ = {};
|
46 |
for (let i = 0; i < o.length; i += 1)
|
@@ -49,63 +49,63 @@ function ae(l) {
|
|
49 |
c() {
|
50 |
e = x(
|
51 |
/*tag*/
|
52 |
-
|
53 |
-
), a && a.c(),
|
54 |
/*tag*/
|
55 |
-
|
56 |
-
)(e, _),
|
57 |
e,
|
58 |
"hidden",
|
59 |
/*visible*/
|
60 |
-
|
61 |
-
),
|
62 |
e,
|
63 |
"padded",
|
64 |
/*padding*/
|
65 |
-
|
66 |
-
),
|
67 |
e,
|
68 |
"border_focus",
|
69 |
/*border_mode*/
|
70 |
-
|
71 |
-
),
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
/*height*/
|
76 |
-
|
77 |
) : void 0), r(e, "width", typeof /*width*/
|
78 |
-
|
79 |
-
|
80 |
e,
|
81 |
"border-style",
|
82 |
/*variant*/
|
83 |
-
|
84 |
), r(
|
85 |
e,
|
86 |
"overflow",
|
87 |
/*allow_overflow*/
|
88 |
-
|
89 |
), r(
|
90 |
e,
|
91 |
"flex-grow",
|
92 |
/*scale*/
|
93 |
-
|
94 |
), r(e, "min-width", `calc(min(${/*min_width*/
|
95 |
-
|
96 |
},
|
97 |
m(i, s) {
|
98 |
-
ne(i, e, s), a && a.m(e, null),
|
99 |
},
|
100 |
p(i, s) {
|
101 |
-
a && a.p && (!
|
102 |
65536) && ie(
|
103 |
a,
|
104 |
f,
|
105 |
i,
|
106 |
/*$$scope*/
|
107 |
i[16],
|
108 |
-
|
109 |
f,
|
110 |
/*$$scope*/
|
111 |
i[16],
|
@@ -116,39 +116,39 @@ function ae(l) {
|
|
116 |
i[16]
|
117 |
),
|
118 |
null
|
119 |
-
),
|
120 |
/*tag*/
|
121 |
i[14]
|
122 |
)(e, _ = te(o, [
|
123 |
-
(!
|
124 |
128) && { "data-testid": (
|
125 |
/*test_id*/
|
126 |
i[7]
|
127 |
) },
|
128 |
-
(!
|
129 |
4) && { id: (
|
130 |
/*elem_id*/
|
131 |
i[2]
|
132 |
) },
|
133 |
-
(!
|
134 |
8 && t !== (t = "block " + /*elem_classes*/
|
135 |
i[3].join(" ") + " svelte-1t38q2d")) && { class: t }
|
136 |
-
])),
|
137 |
e,
|
138 |
"hidden",
|
139 |
/*visible*/
|
140 |
i[10] === !1
|
141 |
-
),
|
142 |
e,
|
143 |
"padded",
|
144 |
/*padding*/
|
145 |
i[6]
|
146 |
-
),
|
147 |
e,
|
148 |
"border_focus",
|
149 |
/*border_mode*/
|
150 |
i[5] === "focus"
|
151 |
-
),
|
152 |
i[8] && !/*container*/
|
153 |
i[9]), s & /*height*/
|
154 |
1 && r(e, "height", typeof /*height*/
|
@@ -181,47 +181,47 @@ function ae(l) {
|
|
181 |
i[13]}px, 100%))`);
|
182 |
},
|
183 |
i(i) {
|
184 |
-
|
185 |
},
|
186 |
o(i) {
|
187 |
-
|
188 |
},
|
189 |
d(i) {
|
190 |
i && p(e), a && a.d(i);
|
191 |
}
|
192 |
};
|
193 |
}
|
194 |
-
function se(
|
195 |
let e, t = (
|
196 |
/*tag*/
|
197 |
-
|
198 |
);
|
199 |
return {
|
200 |
c() {
|
201 |
t && t.c();
|
202 |
},
|
203 |
-
m(
|
204 |
-
t && t.m(
|
205 |
},
|
206 |
-
p(
|
207 |
/*tag*/
|
208 |
-
|
209 |
},
|
210 |
-
i(
|
211 |
-
e || (
|
212 |
},
|
213 |
-
o(
|
214 |
-
|
215 |
},
|
216 |
-
d(
|
217 |
-
t && t.d(
|
218 |
}
|
219 |
};
|
220 |
}
|
221 |
-
function _e(
|
222 |
-
let { $$slots:
|
223 |
-
return
|
224 |
-
"height" in c && t(0, a = c.height), "width" in c && t(1, o = c.width), "elem_id" in c && t(2, _ = c.elem_id), "elem_classes" in c && t(3, i = c.elem_classes), "variant" in c && t(4, s = c.variant), "border_mode" in c && t(5, u = c.border_mode), "padding" in c && t(6, m = c.padding), "type" in c && t(15,
|
225 |
}, [
|
226 |
a,
|
227 |
o,
|
@@ -238,9 +238,9 @@ function _e(l, e, t) {
|
|
238 |
C,
|
239 |
B,
|
240 |
d,
|
241 |
-
|
242 |
f,
|
243 |
-
|
244 |
];
|
245 |
}
|
246 |
class oe extends X {
|
@@ -271,24 +271,24 @@ const {
|
|
271 |
detach: re,
|
272 |
element: me,
|
273 |
get_all_dirty_from_scope: be,
|
274 |
-
get_slot_changes:
|
275 |
-
init:
|
276 |
insert: we,
|
277 |
safe_not_equal: ve,
|
278 |
transition_in: ye,
|
279 |
transition_out: ke,
|
280 |
update_slot_base: Se
|
281 |
} = window.__gradio__svelte__internal;
|
282 |
-
function qe(
|
283 |
let e, t;
|
284 |
-
const
|
285 |
/*#slots*/
|
286 |
-
|
287 |
), f = ue(
|
288 |
-
n,
|
289 |
l,
|
|
|
290 |
/*$$scope*/
|
291 |
-
|
292 |
null
|
293 |
);
|
294 |
return {
|
@@ -302,12 +302,12 @@ function qe(l) {
|
|
302 |
f && f.p && (!t || o & /*$$scope*/
|
303 |
1) && Se(
|
304 |
f,
|
305 |
-
|
306 |
a,
|
307 |
/*$$scope*/
|
308 |
a[0],
|
309 |
-
t ?
|
310 |
-
|
311 |
/*$$scope*/
|
312 |
a[0],
|
313 |
o,
|
@@ -330,87 +330,87 @@ function qe(l) {
|
|
330 |
}
|
331 |
};
|
332 |
}
|
333 |
-
function Ce(
|
334 |
-
let { $$slots:
|
335 |
-
return
|
336 |
"$$scope" in a && t(0, f = a.$$scope);
|
337 |
-
}, [f,
|
338 |
}
|
339 |
class Be extends ce {
|
340 |
constructor(e) {
|
341 |
-
super(),
|
342 |
}
|
343 |
}
|
344 |
const {
|
345 |
SvelteComponent: Ie,
|
346 |
attr: A,
|
347 |
check_outros: Te,
|
348 |
-
create_component:
|
349 |
-
create_slot:
|
350 |
-
destroy_component:
|
351 |
detach: I,
|
352 |
-
element:
|
353 |
-
empty:
|
354 |
-
get_all_dirty_from_scope:
|
355 |
-
get_slot_changes:
|
356 |
-
group_outros:
|
357 |
-
init:
|
358 |
insert: T,
|
359 |
-
mount_component:
|
360 |
-
safe_not_equal:
|
361 |
-
set_data:
|
362 |
-
space:
|
363 |
-
text:
|
364 |
toggle_class: v,
|
365 |
transition_in: q,
|
366 |
-
transition_out:
|
367 |
-
update_slot_base:
|
368 |
} = window.__gradio__svelte__internal;
|
369 |
-
function E(
|
370 |
let e, t;
|
371 |
return e = new Be({
|
372 |
props: {
|
373 |
-
$$slots: { default: [
|
374 |
-
$$scope: { ctx:
|
375 |
}
|
376 |
}), {
|
377 |
c() {
|
378 |
-
|
379 |
},
|
380 |
-
m(
|
381 |
-
|
382 |
},
|
383 |
-
p(
|
384 |
const a = {};
|
385 |
f & /*$$scope, info*/
|
386 |
-
10 && (a.$$scope = { dirty: f, ctx:
|
387 |
},
|
388 |
-
i(
|
389 |
-
t || (q(e.$$.fragment,
|
390 |
},
|
391 |
-
o(
|
392 |
-
|
393 |
},
|
394 |
-
d(
|
395 |
-
|
396 |
}
|
397 |
};
|
398 |
}
|
399 |
-
function
|
400 |
let e;
|
401 |
return {
|
402 |
c() {
|
403 |
-
e =
|
404 |
/*info*/
|
405 |
-
|
406 |
);
|
407 |
},
|
408 |
-
m(t,
|
409 |
-
T(t, e,
|
410 |
},
|
411 |
-
p(t,
|
412 |
-
|
413 |
-
2 &&
|
414 |
e,
|
415 |
/*info*/
|
416 |
t[1]
|
@@ -421,51 +421,51 @@ function Me(l) {
|
|
421 |
}
|
422 |
};
|
423 |
}
|
424 |
-
function Qe(
|
425 |
-
let e, t,
|
426 |
const a = (
|
427 |
/*#slots*/
|
428 |
-
|
429 |
-
), o =
|
430 |
a,
|
431 |
-
|
432 |
/*$$scope*/
|
433 |
-
|
434 |
null
|
435 |
);
|
436 |
let _ = (
|
437 |
/*info*/
|
438 |
-
|
439 |
);
|
440 |
return {
|
441 |
c() {
|
442 |
-
e =
|
443 |
-
|
444 |
-
|
445 |
e,
|
446 |
"has-info",
|
447 |
/*info*/
|
448 |
-
|
449 |
);
|
450 |
},
|
451 |
m(i, s) {
|
452 |
-
T(i, e, s), o && o.m(e, null), T(i, t, s), _ && _.m(i, s), T(i,
|
453 |
},
|
454 |
p(i, [s]) {
|
455 |
o && o.p && (!f || s & /*$$scope*/
|
456 |
-
8) &&
|
457 |
o,
|
458 |
a,
|
459 |
i,
|
460 |
/*$$scope*/
|
461 |
i[3],
|
462 |
-
f ?
|
463 |
a,
|
464 |
/*$$scope*/
|
465 |
i[3],
|
466 |
s,
|
467 |
null
|
468 |
-
) :
|
469 |
/*$$scope*/
|
470 |
i[3]
|
471 |
),
|
@@ -482,7 +482,7 @@ function Qe(l) {
|
|
482 |
i[1] != null
|
483 |
), /*info*/
|
484 |
i[1] ? _ ? (_.p(i, s), s & /*info*/
|
485 |
-
2 && q(_, 1)) : (_ = E(i), _.c(), q(_, 1), _.m(
|
486 |
_ = null;
|
487 |
}), Te());
|
488 |
},
|
@@ -490,22 +490,22 @@ function Qe(l) {
|
|
490 |
f || (q(o, i), q(_), f = !0);
|
491 |
},
|
492 |
o(i) {
|
493 |
-
|
494 |
},
|
495 |
d(i) {
|
496 |
-
i && (I(e), I(t), I(
|
497 |
}
|
498 |
};
|
499 |
}
|
500 |
-
function Re(
|
501 |
-
let { $$slots:
|
502 |
-
return
|
503 |
"show_label" in _ && t(0, a = _.show_label), "info" in _ && t(1, o = _.info), "$$scope" in _ && t(3, f = _.$$scope);
|
504 |
-
}, [a, o,
|
505 |
}
|
506 |
class Ve extends Ie {
|
507 |
constructor(e) {
|
508 |
-
super(),
|
509 |
}
|
510 |
}
|
511 |
const We = [
|
@@ -813,11 +813,11 @@ const We = [
|
|
813 |
}
|
814 |
};
|
815 |
We.reduce(
|
816 |
-
(
|
817 |
-
...
|
818 |
[e]: {
|
819 |
primary: L[e][t],
|
820 |
-
secondary: L[e][
|
821 |
}
|
822 |
}),
|
823 |
{}
|
@@ -825,124 +825,116 @@ We.reduce(
|
|
825 |
const {
|
826 |
SvelteComponent: Xe,
|
827 |
append: N,
|
828 |
-
attr:
|
829 |
binding_callbacks: Ye,
|
830 |
-
create_component:
|
831 |
-
destroy_component:
|
832 |
-
detach:
|
833 |
element: O,
|
834 |
init: Ze,
|
835 |
insert: Q,
|
836 |
-
|
837 |
-
listen: P,
|
838 |
mount_component: R,
|
839 |
-
run_all:
|
840 |
-
safe_not_equal:
|
841 |
-
set_data:
|
842 |
-
set_input_value:
|
843 |
-
space:
|
844 |
-
text:
|
845 |
-
toggle_class:
|
846 |
transition_in: V,
|
847 |
transition_out: W
|
848 |
} = window.__gradio__svelte__internal;
|
849 |
-
function
|
850 |
let e;
|
851 |
return {
|
852 |
c() {
|
853 |
-
e =
|
854 |
/*label*/
|
855 |
-
|
856 |
);
|
857 |
},
|
858 |
-
m(t,
|
859 |
-
Q(t, e,
|
860 |
},
|
861 |
-
p(t,
|
862 |
-
|
863 |
-
2 &&
|
864 |
e,
|
865 |
/*label*/
|
866 |
t[1]
|
867 |
);
|
868 |
},
|
869 |
d(t) {
|
870 |
-
t &&
|
871 |
}
|
872 |
};
|
873 |
}
|
874 |
-
function
|
875 |
-
let e, t,
|
876 |
return t = new Ve({
|
877 |
props: {
|
878 |
show_label: (
|
879 |
/*show_label*/
|
880 |
-
|
881 |
),
|
882 |
info: (
|
883 |
/*info*/
|
884 |
-
|
885 |
),
|
886 |
-
$$slots: { default: [
|
887 |
-
$$scope: { ctx:
|
888 |
}
|
889 |
}), {
|
890 |
c() {
|
891 |
-
e = O("label"),
|
892 |
-
|
893 |
e,
|
894 |
"container",
|
895 |
/*container*/
|
896 |
-
|
897 |
);
|
898 |
},
|
899 |
m(s, u) {
|
900 |
-
Q(s, e, u), R(t, e, null), N(e,
|
901 |
f,
|
902 |
/*value*/
|
903 |
-
|
904 |
), o = !0, _ || (i = [
|
905 |
-
|
906 |
f,
|
907 |
"input",
|
908 |
/*input_input_handler*/
|
909 |
-
|
910 |
),
|
911 |
-
|
912 |
-
pe(
|
913 |
-
/*el*/
|
914 |
-
l[11].showPicker
|
915 |
-
) && l[11].showPicker.apply(this, arguments);
|
916 |
-
}),
|
917 |
-
P(
|
918 |
f,
|
919 |
"change",
|
920 |
/*handle_change*/
|
921 |
-
|
922 |
)
|
923 |
], _ = !0);
|
924 |
},
|
925 |
p(s, u) {
|
926 |
-
l = s;
|
927 |
const m = {};
|
928 |
u & /*show_label*/
|
929 |
256 && (m.show_label = /*show_label*/
|
930 |
-
|
931 |
64 && (m.info = /*info*/
|
932 |
-
|
933 |
-
131074 && (m.$$scope = { dirty: u, ctx:
|
934 |
1024 && a !== (a = !/*interactive*/
|
935 |
-
|
936 |
-
1 &&
|
937 |
f,
|
938 |
/*value*/
|
939 |
-
|
940 |
), (!o || u & /*container*/
|
941 |
-
512) &&
|
942 |
e,
|
943 |
"container",
|
944 |
/*container*/
|
945 |
-
|
946 |
);
|
947 |
},
|
948 |
i(s) {
|
@@ -952,74 +944,74 @@ function f0(l) {
|
|
952 |
W(t.$$.fragment, s), o = !1;
|
953 |
},
|
954 |
d(s) {
|
955 |
-
s &&
|
956 |
}
|
957 |
};
|
958 |
}
|
959 |
-
function
|
960 |
let e, t;
|
961 |
return e = new oe({
|
962 |
props: {
|
963 |
visible: (
|
964 |
/*visible*/
|
965 |
-
|
966 |
),
|
967 |
elem_id: (
|
968 |
/*elem_id*/
|
969 |
-
|
970 |
),
|
971 |
elem_classes: (
|
972 |
/*elem_classes*/
|
973 |
-
|
974 |
),
|
975 |
scale: (
|
976 |
/*scale*/
|
977 |
-
|
978 |
),
|
979 |
min_width: (
|
980 |
/*min_width*/
|
981 |
-
|
982 |
),
|
983 |
allow_overflow: !1,
|
984 |
padding: !0,
|
985 |
-
$$slots: { default: [
|
986 |
-
$$scope: { ctx:
|
987 |
}
|
988 |
}), {
|
989 |
c() {
|
990 |
-
|
991 |
},
|
992 |
-
m(
|
993 |
-
R(e,
|
994 |
},
|
995 |
-
p(
|
996 |
const a = {};
|
997 |
f & /*visible*/
|
998 |
4 && (a.visible = /*visible*/
|
999 |
-
|
1000 |
16 && (a.elem_id = /*elem_id*/
|
1001 |
-
|
1002 |
8 && (a.elem_classes = /*elem_classes*/
|
1003 |
-
|
1004 |
32 && (a.scale = /*scale*/
|
1005 |
-
|
1006 |
128 && (a.min_width = /*min_width*/
|
1007 |
-
|
1008 |
-
134979 && (a.$$scope = { dirty: f, ctx:
|
1009 |
},
|
1010 |
-
i(
|
1011 |
-
t || (V(e.$$.fragment,
|
1012 |
},
|
1013 |
-
o(
|
1014 |
-
W(e.$$.fragment,
|
1015 |
},
|
1016 |
-
d(
|
1017 |
-
|
1018 |
}
|
1019 |
};
|
1020 |
}
|
1021 |
-
function
|
1022 |
-
let { value:
|
1023 |
function S() {
|
1024 |
b.dispatch("change"), f || (b.dispatch("submit"), b.dispatch("input"));
|
1025 |
}
|
@@ -1029,16 +1021,16 @@ function a0(l, e, t) {
|
|
1029 |
});
|
1030 |
}
|
1031 |
function B() {
|
1032 |
-
|
1033 |
}
|
1034 |
-
return
|
1035 |
-
"value" in d && t(0,
|
1036 |
-
},
|
1037 |
-
|
1038 |
-
1 &&
|
1039 |
1 && S();
|
1040 |
}, [
|
1041 |
-
|
1042 |
a,
|
1043 |
o,
|
1044 |
_,
|
@@ -1046,7 +1038,7 @@ function a0(l, e, t) {
|
|
1046 |
s,
|
1047 |
u,
|
1048 |
m,
|
1049 |
-
|
1050 |
y,
|
1051 |
k,
|
1052 |
w,
|
@@ -1057,9 +1049,9 @@ function a0(l, e, t) {
|
|
1057 |
B
|
1058 |
];
|
1059 |
}
|
1060 |
-
class
|
1061 |
constructor(e) {
|
1062 |
-
super(), Ze(this, e,
|
1063 |
value: 0,
|
1064 |
value_is_output: 13,
|
1065 |
label: 1,
|
@@ -1077,5 +1069,5 @@ class s0 extends Xe {
|
|
1077 |
}
|
1078 |
}
|
1079 |
export {
|
1080 |
-
|
1081 |
};
|
|
|
10 |
init: le,
|
11 |
insert: ne,
|
12 |
safe_not_equal: fe,
|
13 |
+
set_dynamic_element_data: D,
|
14 |
set_style: r,
|
15 |
+
toggle_class: g,
|
16 |
+
transition_in: H,
|
17 |
+
transition_out: J,
|
18 |
update_slot_base: ie
|
19 |
} = window.__gradio__svelte__internal;
|
20 |
+
function ae(n) {
|
21 |
+
let e, t, l;
|
22 |
const f = (
|
23 |
/*#slots*/
|
24 |
+
n[17].default
|
25 |
), a = Z(
|
26 |
f,
|
27 |
+
n,
|
28 |
/*$$scope*/
|
29 |
+
n[16],
|
30 |
null
|
31 |
);
|
32 |
let o = [
|
33 |
{ "data-testid": (
|
34 |
/*test_id*/
|
35 |
+
n[7]
|
36 |
) },
|
37 |
{ id: (
|
38 |
/*elem_id*/
|
39 |
+
n[2]
|
40 |
) },
|
41 |
{
|
42 |
class: t = "block " + /*elem_classes*/
|
43 |
+
n[3].join(" ") + " svelte-1t38q2d"
|
44 |
}
|
45 |
], _ = {};
|
46 |
for (let i = 0; i < o.length; i += 1)
|
|
|
49 |
c() {
|
50 |
e = x(
|
51 |
/*tag*/
|
52 |
+
n[14]
|
53 |
+
), a && a.c(), D(
|
54 |
/*tag*/
|
55 |
+
n[14]
|
56 |
+
)(e, _), g(
|
57 |
e,
|
58 |
"hidden",
|
59 |
/*visible*/
|
60 |
+
n[10] === !1
|
61 |
+
), g(
|
62 |
e,
|
63 |
"padded",
|
64 |
/*padding*/
|
65 |
+
n[6]
|
66 |
+
), g(
|
67 |
e,
|
68 |
"border_focus",
|
69 |
/*border_mode*/
|
70 |
+
n[5] === "focus"
|
71 |
+
), g(e, "hide-container", !/*explicit_call*/
|
72 |
+
n[8] && !/*container*/
|
73 |
+
n[9]), r(e, "height", typeof /*height*/
|
74 |
+
n[0] == "number" ? (
|
75 |
/*height*/
|
76 |
+
n[0] + "px"
|
77 |
) : void 0), r(e, "width", typeof /*width*/
|
78 |
+
n[1] == "number" ? `calc(min(${/*width*/
|
79 |
+
n[1]}px, 100%))` : void 0), r(
|
80 |
e,
|
81 |
"border-style",
|
82 |
/*variant*/
|
83 |
+
n[4]
|
84 |
), r(
|
85 |
e,
|
86 |
"overflow",
|
87 |
/*allow_overflow*/
|
88 |
+
n[11] ? "visible" : "hidden"
|
89 |
), r(
|
90 |
e,
|
91 |
"flex-grow",
|
92 |
/*scale*/
|
93 |
+
n[12]
|
94 |
), r(e, "min-width", `calc(min(${/*min_width*/
|
95 |
+
n[13]}px, 100%))`), r(e, "border-width", "var(--block-border-width)");
|
96 |
},
|
97 |
m(i, s) {
|
98 |
+
ne(i, e, s), a && a.m(e, null), l = !0;
|
99 |
},
|
100 |
p(i, s) {
|
101 |
+
a && a.p && (!l || s & /*$$scope*/
|
102 |
65536) && ie(
|
103 |
a,
|
104 |
f,
|
105 |
i,
|
106 |
/*$$scope*/
|
107 |
i[16],
|
108 |
+
l ? ee(
|
109 |
f,
|
110 |
/*$$scope*/
|
111 |
i[16],
|
|
|
116 |
i[16]
|
117 |
),
|
118 |
null
|
119 |
+
), D(
|
120 |
/*tag*/
|
121 |
i[14]
|
122 |
)(e, _ = te(o, [
|
123 |
+
(!l || s & /*test_id*/
|
124 |
128) && { "data-testid": (
|
125 |
/*test_id*/
|
126 |
i[7]
|
127 |
) },
|
128 |
+
(!l || s & /*elem_id*/
|
129 |
4) && { id: (
|
130 |
/*elem_id*/
|
131 |
i[2]
|
132 |
) },
|
133 |
+
(!l || s & /*elem_classes*/
|
134 |
8 && t !== (t = "block " + /*elem_classes*/
|
135 |
i[3].join(" ") + " svelte-1t38q2d")) && { class: t }
|
136 |
+
])), g(
|
137 |
e,
|
138 |
"hidden",
|
139 |
/*visible*/
|
140 |
i[10] === !1
|
141 |
+
), g(
|
142 |
e,
|
143 |
"padded",
|
144 |
/*padding*/
|
145 |
i[6]
|
146 |
+
), g(
|
147 |
e,
|
148 |
"border_focus",
|
149 |
/*border_mode*/
|
150 |
i[5] === "focus"
|
151 |
+
), g(e, "hide-container", !/*explicit_call*/
|
152 |
i[8] && !/*container*/
|
153 |
i[9]), s & /*height*/
|
154 |
1 && r(e, "height", typeof /*height*/
|
|
|
181 |
i[13]}px, 100%))`);
|
182 |
},
|
183 |
i(i) {
|
184 |
+
l || (H(a, i), l = !0);
|
185 |
},
|
186 |
o(i) {
|
187 |
+
J(a, i), l = !1;
|
188 |
},
|
189 |
d(i) {
|
190 |
i && p(e), a && a.d(i);
|
191 |
}
|
192 |
};
|
193 |
}
|
194 |
+
function se(n) {
|
195 |
let e, t = (
|
196 |
/*tag*/
|
197 |
+
n[14] && ae(n)
|
198 |
);
|
199 |
return {
|
200 |
c() {
|
201 |
t && t.c();
|
202 |
},
|
203 |
+
m(l, f) {
|
204 |
+
t && t.m(l, f), e = !0;
|
205 |
},
|
206 |
+
p(l, [f]) {
|
207 |
/*tag*/
|
208 |
+
l[14] && t.p(l, f);
|
209 |
},
|
210 |
+
i(l) {
|
211 |
+
e || (H(t, l), e = !0);
|
212 |
},
|
213 |
+
o(l) {
|
214 |
+
J(t, l), e = !1;
|
215 |
},
|
216 |
+
d(l) {
|
217 |
+
t && t.d(l);
|
218 |
}
|
219 |
};
|
220 |
}
|
221 |
+
function _e(n, e, t) {
|
222 |
+
let { $$slots: l = {}, $$scope: f } = e, { height: a = void 0 } = e, { width: o = void 0 } = e, { elem_id: _ = "" } = e, { elem_classes: i = [] } = e, { variant: s = "solid" } = e, { border_mode: u = "base" } = e, { padding: m = !0 } = e, { type: h = "normal" } = e, { test_id: y = void 0 } = e, { explicit_call: k = !1 } = e, { container: b = !0 } = e, { visible: w = !0 } = e, { allow_overflow: S = !0 } = e, { scale: C = null } = e, { min_width: B = 0 } = e, d = h === "fieldset" ? "fieldset" : "div";
|
223 |
+
return n.$$set = (c) => {
|
224 |
+
"height" in c && t(0, a = c.height), "width" in c && t(1, o = c.width), "elem_id" in c && t(2, _ = c.elem_id), "elem_classes" in c && t(3, i = c.elem_classes), "variant" in c && t(4, s = c.variant), "border_mode" in c && t(5, u = c.border_mode), "padding" in c && t(6, m = c.padding), "type" in c && t(15, h = c.type), "test_id" in c && t(7, y = c.test_id), "explicit_call" in c && t(8, k = c.explicit_call), "container" in c && t(9, b = c.container), "visible" in c && t(10, w = c.visible), "allow_overflow" in c && t(11, S = c.allow_overflow), "scale" in c && t(12, C = c.scale), "min_width" in c && t(13, B = c.min_width), "$$scope" in c && t(16, f = c.$$scope);
|
225 |
}, [
|
226 |
a,
|
227 |
o,
|
|
|
238 |
C,
|
239 |
B,
|
240 |
d,
|
241 |
+
h,
|
242 |
f,
|
243 |
+
l
|
244 |
];
|
245 |
}
|
246 |
class oe extends X {
|
|
|
271 |
detach: re,
|
272 |
element: me,
|
273 |
get_all_dirty_from_scope: be,
|
274 |
+
get_slot_changes: ge,
|
275 |
+
init: he,
|
276 |
insert: we,
|
277 |
safe_not_equal: ve,
|
278 |
transition_in: ye,
|
279 |
transition_out: ke,
|
280 |
update_slot_base: Se
|
281 |
} = window.__gradio__svelte__internal;
|
282 |
+
function qe(n) {
|
283 |
let e, t;
|
284 |
+
const l = (
|
285 |
/*#slots*/
|
286 |
+
n[1].default
|
287 |
), f = ue(
|
|
|
288 |
l,
|
289 |
+
n,
|
290 |
/*$$scope*/
|
291 |
+
n[0],
|
292 |
null
|
293 |
);
|
294 |
return {
|
|
|
302 |
f && f.p && (!t || o & /*$$scope*/
|
303 |
1) && Se(
|
304 |
f,
|
305 |
+
l,
|
306 |
a,
|
307 |
/*$$scope*/
|
308 |
a[0],
|
309 |
+
t ? ge(
|
310 |
+
l,
|
311 |
/*$$scope*/
|
312 |
a[0],
|
313 |
o,
|
|
|
330 |
}
|
331 |
};
|
332 |
}
|
333 |
+
function Ce(n, e, t) {
|
334 |
+
let { $$slots: l = {}, $$scope: f } = e;
|
335 |
+
return n.$$set = (a) => {
|
336 |
"$$scope" in a && t(0, f = a.$$scope);
|
337 |
+
}, [f, l];
|
338 |
}
|
339 |
class Be extends ce {
|
340 |
constructor(e) {
|
341 |
+
super(), he(this, e, Ce, qe, ve, {});
|
342 |
}
|
343 |
}
|
344 |
const {
|
345 |
SvelteComponent: Ie,
|
346 |
attr: A,
|
347 |
check_outros: Te,
|
348 |
+
create_component: ze,
|
349 |
+
create_slot: je,
|
350 |
+
destroy_component: De,
|
351 |
detach: I,
|
352 |
+
element: Ae,
|
353 |
+
empty: Ee,
|
354 |
+
get_all_dirty_from_scope: Le,
|
355 |
+
get_slot_changes: Ne,
|
356 |
+
group_outros: Oe,
|
357 |
+
init: Ue,
|
358 |
insert: T,
|
359 |
+
mount_component: Fe,
|
360 |
+
safe_not_equal: Ge,
|
361 |
+
set_data: He,
|
362 |
+
space: Je,
|
363 |
+
text: Ke,
|
364 |
toggle_class: v,
|
365 |
transition_in: q,
|
366 |
+
transition_out: z,
|
367 |
+
update_slot_base: Me
|
368 |
} = window.__gradio__svelte__internal;
|
369 |
+
function E(n) {
|
370 |
let e, t;
|
371 |
return e = new Be({
|
372 |
props: {
|
373 |
+
$$slots: { default: [Pe] },
|
374 |
+
$$scope: { ctx: n }
|
375 |
}
|
376 |
}), {
|
377 |
c() {
|
378 |
+
ze(e.$$.fragment);
|
379 |
},
|
380 |
+
m(l, f) {
|
381 |
+
Fe(e, l, f), t = !0;
|
382 |
},
|
383 |
+
p(l, f) {
|
384 |
const a = {};
|
385 |
f & /*$$scope, info*/
|
386 |
+
10 && (a.$$scope = { dirty: f, ctx: l }), e.$set(a);
|
387 |
},
|
388 |
+
i(l) {
|
389 |
+
t || (q(e.$$.fragment, l), t = !0);
|
390 |
},
|
391 |
+
o(l) {
|
392 |
+
z(e.$$.fragment, l), t = !1;
|
393 |
},
|
394 |
+
d(l) {
|
395 |
+
De(e, l);
|
396 |
}
|
397 |
};
|
398 |
}
|
399 |
+
function Pe(n) {
|
400 |
let e;
|
401 |
return {
|
402 |
c() {
|
403 |
+
e = Ke(
|
404 |
/*info*/
|
405 |
+
n[1]
|
406 |
);
|
407 |
},
|
408 |
+
m(t, l) {
|
409 |
+
T(t, e, l);
|
410 |
},
|
411 |
+
p(t, l) {
|
412 |
+
l & /*info*/
|
413 |
+
2 && He(
|
414 |
e,
|
415 |
/*info*/
|
416 |
t[1]
|
|
|
421 |
}
|
422 |
};
|
423 |
}
|
424 |
+
function Qe(n) {
|
425 |
+
let e, t, l, f;
|
426 |
const a = (
|
427 |
/*#slots*/
|
428 |
+
n[2].default
|
429 |
+
), o = je(
|
430 |
a,
|
431 |
+
n,
|
432 |
/*$$scope*/
|
433 |
+
n[3],
|
434 |
null
|
435 |
);
|
436 |
let _ = (
|
437 |
/*info*/
|
438 |
+
n[1] && E(n)
|
439 |
);
|
440 |
return {
|
441 |
c() {
|
442 |
+
e = Ae("span"), o && o.c(), t = Je(), _ && _.c(), l = Ee(), A(e, "data-testid", "block-info"), A(e, "class", "svelte-22c38v"), v(e, "sr-only", !/*show_label*/
|
443 |
+
n[0]), v(e, "hide", !/*show_label*/
|
444 |
+
n[0]), v(
|
445 |
e,
|
446 |
"has-info",
|
447 |
/*info*/
|
448 |
+
n[1] != null
|
449 |
);
|
450 |
},
|
451 |
m(i, s) {
|
452 |
+
T(i, e, s), o && o.m(e, null), T(i, t, s), _ && _.m(i, s), T(i, l, s), f = !0;
|
453 |
},
|
454 |
p(i, [s]) {
|
455 |
o && o.p && (!f || s & /*$$scope*/
|
456 |
+
8) && Me(
|
457 |
o,
|
458 |
a,
|
459 |
i,
|
460 |
/*$$scope*/
|
461 |
i[3],
|
462 |
+
f ? Ne(
|
463 |
a,
|
464 |
/*$$scope*/
|
465 |
i[3],
|
466 |
s,
|
467 |
null
|
468 |
+
) : Le(
|
469 |
/*$$scope*/
|
470 |
i[3]
|
471 |
),
|
|
|
482 |
i[1] != null
|
483 |
), /*info*/
|
484 |
i[1] ? _ ? (_.p(i, s), s & /*info*/
|
485 |
+
2 && q(_, 1)) : (_ = E(i), _.c(), q(_, 1), _.m(l.parentNode, l)) : _ && (Oe(), z(_, 1, 1, () => {
|
486 |
_ = null;
|
487 |
}), Te());
|
488 |
},
|
|
|
490 |
f || (q(o, i), q(_), f = !0);
|
491 |
},
|
492 |
o(i) {
|
493 |
+
z(o, i), z(_), f = !1;
|
494 |
},
|
495 |
d(i) {
|
496 |
+
i && (I(e), I(t), I(l)), o && o.d(i), _ && _.d(i);
|
497 |
}
|
498 |
};
|
499 |
}
|
500 |
+
function Re(n, e, t) {
|
501 |
+
let { $$slots: l = {}, $$scope: f } = e, { show_label: a = !0 } = e, { info: o = void 0 } = e;
|
502 |
+
return n.$$set = (_) => {
|
503 |
"show_label" in _ && t(0, a = _.show_label), "info" in _ && t(1, o = _.info), "$$scope" in _ && t(3, f = _.$$scope);
|
504 |
+
}, [a, o, l, f];
|
505 |
}
|
506 |
class Ve extends Ie {
|
507 |
constructor(e) {
|
508 |
+
super(), Ue(this, e, Re, Qe, Ge, { show_label: 0, info: 1 });
|
509 |
}
|
510 |
}
|
511 |
const We = [
|
|
|
813 |
}
|
814 |
};
|
815 |
We.reduce(
|
816 |
+
(n, { color: e, primary: t, secondary: l }) => ({
|
817 |
+
...n,
|
818 |
[e]: {
|
819 |
primary: L[e][t],
|
820 |
+
secondary: L[e][l]
|
821 |
}
|
822 |
}),
|
823 |
{}
|
|
|
825 |
const {
|
826 |
SvelteComponent: Xe,
|
827 |
append: N,
|
828 |
+
attr: j,
|
829 |
binding_callbacks: Ye,
|
830 |
+
create_component: K,
|
831 |
+
destroy_component: M,
|
832 |
+
detach: P,
|
833 |
element: O,
|
834 |
init: Ze,
|
835 |
insert: Q,
|
836 |
+
listen: U,
|
|
|
837 |
mount_component: R,
|
838 |
+
run_all: pe,
|
839 |
+
safe_not_equal: xe,
|
840 |
+
set_data: $e,
|
841 |
+
set_input_value: F,
|
842 |
+
space: e0,
|
843 |
+
text: t0,
|
844 |
+
toggle_class: G,
|
845 |
transition_in: V,
|
846 |
transition_out: W
|
847 |
} = window.__gradio__svelte__internal;
|
848 |
+
function l0(n) {
|
849 |
let e;
|
850 |
return {
|
851 |
c() {
|
852 |
+
e = t0(
|
853 |
/*label*/
|
854 |
+
n[1]
|
855 |
);
|
856 |
},
|
857 |
+
m(t, l) {
|
858 |
+
Q(t, e, l);
|
859 |
},
|
860 |
+
p(t, l) {
|
861 |
+
l & /*label*/
|
862 |
+
2 && $e(
|
863 |
e,
|
864 |
/*label*/
|
865 |
t[1]
|
866 |
);
|
867 |
},
|
868 |
d(t) {
|
869 |
+
t && P(e);
|
870 |
}
|
871 |
};
|
872 |
}
|
873 |
+
function n0(n) {
|
874 |
+
let e, t, l, f, a, o, _, i;
|
875 |
return t = new Ve({
|
876 |
props: {
|
877 |
show_label: (
|
878 |
/*show_label*/
|
879 |
+
n[8]
|
880 |
),
|
881 |
info: (
|
882 |
/*info*/
|
883 |
+
n[6]
|
884 |
),
|
885 |
+
$$slots: { default: [l0] },
|
886 |
+
$$scope: { ctx: n }
|
887 |
}
|
888 |
}), {
|
889 |
c() {
|
890 |
+
e = O("label"), K(t.$$.fragment), l = e0(), f = O("input"), j(f, "type", "date"), f.disabled = a = !/*interactive*/
|
891 |
+
n[10], j(f, "class", "svelte-c6v8zr"), j(e, "class", "svelte-c6v8zr"), G(
|
892 |
e,
|
893 |
"container",
|
894 |
/*container*/
|
895 |
+
n[9]
|
896 |
);
|
897 |
},
|
898 |
m(s, u) {
|
899 |
+
Q(s, e, u), R(t, e, null), N(e, l), N(e, f), n[15](f), F(
|
900 |
f,
|
901 |
/*value*/
|
902 |
+
n[0]
|
903 |
), o = !0, _ || (i = [
|
904 |
+
U(
|
905 |
f,
|
906 |
"input",
|
907 |
/*input_input_handler*/
|
908 |
+
n[16]
|
909 |
),
|
910 |
+
U(
|
|
|
|
|
|
|
|
|
|
|
|
|
911 |
f,
|
912 |
"change",
|
913 |
/*handle_change*/
|
914 |
+
n[12]
|
915 |
)
|
916 |
], _ = !0);
|
917 |
},
|
918 |
p(s, u) {
|
|
|
919 |
const m = {};
|
920 |
u & /*show_label*/
|
921 |
256 && (m.show_label = /*show_label*/
|
922 |
+
s[8]), u & /*info*/
|
923 |
64 && (m.info = /*info*/
|
924 |
+
s[6]), u & /*$$scope, label*/
|
925 |
+
131074 && (m.$$scope = { dirty: u, ctx: s }), t.$set(m), (!o || u & /*interactive*/
|
926 |
1024 && a !== (a = !/*interactive*/
|
927 |
+
s[10])) && (f.disabled = a), u & /*value*/
|
928 |
+
1 && F(
|
929 |
f,
|
930 |
/*value*/
|
931 |
+
s[0]
|
932 |
), (!o || u & /*container*/
|
933 |
+
512) && G(
|
934 |
e,
|
935 |
"container",
|
936 |
/*container*/
|
937 |
+
s[9]
|
938 |
);
|
939 |
},
|
940 |
i(s) {
|
|
|
944 |
W(t.$$.fragment, s), o = !1;
|
945 |
},
|
946 |
d(s) {
|
947 |
+
s && P(e), M(t), n[15](null), _ = !1, pe(i);
|
948 |
}
|
949 |
};
|
950 |
}
|
951 |
+
function f0(n) {
|
952 |
let e, t;
|
953 |
return e = new oe({
|
954 |
props: {
|
955 |
visible: (
|
956 |
/*visible*/
|
957 |
+
n[2]
|
958 |
),
|
959 |
elem_id: (
|
960 |
/*elem_id*/
|
961 |
+
n[4]
|
962 |
),
|
963 |
elem_classes: (
|
964 |
/*elem_classes*/
|
965 |
+
n[3]
|
966 |
),
|
967 |
scale: (
|
968 |
/*scale*/
|
969 |
+
n[5]
|
970 |
),
|
971 |
min_width: (
|
972 |
/*min_width*/
|
973 |
+
n[7]
|
974 |
),
|
975 |
allow_overflow: !1,
|
976 |
padding: !0,
|
977 |
+
$$slots: { default: [n0] },
|
978 |
+
$$scope: { ctx: n }
|
979 |
}
|
980 |
}), {
|
981 |
c() {
|
982 |
+
K(e.$$.fragment);
|
983 |
},
|
984 |
+
m(l, f) {
|
985 |
+
R(e, l, f), t = !0;
|
986 |
},
|
987 |
+
p(l, [f]) {
|
988 |
const a = {};
|
989 |
f & /*visible*/
|
990 |
4 && (a.visible = /*visible*/
|
991 |
+
l[2]), f & /*elem_id*/
|
992 |
16 && (a.elem_id = /*elem_id*/
|
993 |
+
l[4]), f & /*elem_classes*/
|
994 |
8 && (a.elem_classes = /*elem_classes*/
|
995 |
+
l[3]), f & /*scale*/
|
996 |
32 && (a.scale = /*scale*/
|
997 |
+
l[5]), f & /*min_width*/
|
998 |
128 && (a.min_width = /*min_width*/
|
999 |
+
l[7]), f & /*$$scope, container, interactive, el, value, show_label, info, label*/
|
1000 |
+
134979 && (a.$$scope = { dirty: f, ctx: l }), e.$set(a);
|
1001 |
},
|
1002 |
+
i(l) {
|
1003 |
+
t || (V(e.$$.fragment, l), t = !0);
|
1004 |
},
|
1005 |
+
o(l) {
|
1006 |
+
W(e.$$.fragment, l), t = !1;
|
1007 |
},
|
1008 |
+
d(l) {
|
1009 |
+
M(e, l);
|
1010 |
}
|
1011 |
};
|
1012 |
}
|
1013 |
+
function i0(n, e, t) {
|
1014 |
+
let { value: l = null } = e, { value_is_output: f = !1 } = e, { label: a } = e, { visible: o = !0 } = e, { elem_classes: _ } = e, { elem_id: i } = e, { scale: s } = e, { info: u } = e, { min_width: m } = e, { show_label: h = !0 } = e, { container: y = !0 } = e, { interactive: k = !0 } = e, { gradio: b } = e, w;
|
1015 |
function S() {
|
1016 |
b.dispatch("change"), f || (b.dispatch("submit"), b.dispatch("input"));
|
1017 |
}
|
|
|
1021 |
});
|
1022 |
}
|
1023 |
function B() {
|
1024 |
+
l = this.value, t(0, l);
|
1025 |
}
|
1026 |
+
return n.$$set = (d) => {
|
1027 |
+
"value" in d && t(0, l = d.value), "value_is_output" in d && t(13, f = d.value_is_output), "label" in d && t(1, a = d.label), "visible" in d && t(2, o = d.visible), "elem_classes" in d && t(3, _ = d.elem_classes), "elem_id" in d && t(4, i = d.elem_id), "scale" in d && t(5, s = d.scale), "info" in d && t(6, u = d.info), "min_width" in d && t(7, m = d.min_width), "show_label" in d && t(8, h = d.show_label), "container" in d && t(9, y = d.container), "interactive" in d && t(10, k = d.interactive), "gradio" in d && t(14, b = d.gradio);
|
1028 |
+
}, n.$$.update = () => {
|
1029 |
+
n.$$.dirty & /*value*/
|
1030 |
+
1 && l === null && t(0, l = (/* @__PURE__ */ new Date()).toISOString().split("T")[0]), n.$$.dirty & /*value*/
|
1031 |
1 && S();
|
1032 |
}, [
|
1033 |
+
l,
|
1034 |
a,
|
1035 |
o,
|
1036 |
_,
|
|
|
1038 |
s,
|
1039 |
u,
|
1040 |
m,
|
1041 |
+
h,
|
1042 |
y,
|
1043 |
k,
|
1044 |
w,
|
|
|
1049 |
B
|
1050 |
];
|
1051 |
}
|
1052 |
+
class a0 extends Xe {
|
1053 |
constructor(e) {
|
1054 |
+
super(), Ze(this, e, i0, f0, xe, {
|
1055 |
value: 0,
|
1056 |
value_is_output: 13,
|
1057 |
label: 1,
|
|
|
1069 |
}
|
1070 |
}
|
1071 |
export {
|
1072 |
+
a0 as default
|
1073 |
};
|
src/backend/gradio_calendar/templates/component/style.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.block.svelte-1t38q2d{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-1t38q2d{border-color:var(--color-accent)}.padded.svelte-1t38q2d{padding:var(--block-padding)}.hidden.svelte-1t38q2d{display:none}.hide-container.svelte-1t38q2d{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-1hnfib2{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-22c38v{margin-bottom:var(--spacing-xs)}span.svelte-22c38v:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-22c38v{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-22c38v{margin:0;height:0}label.svelte-9gxdi0{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group label.svelte-9gxdi0{border-top-left-radius:0}label.float.svelte-9gxdi0{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}label.svelte-9gxdi0:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-9gxdi0{height:0}span.svelte-9gxdi0{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-9gxdi0{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-lpi64a{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}button[disabled].svelte-lpi64a{opacity:.5;box-shadow:none}button[disabled].svelte-lpi64a:hover{cursor:not-allowed}.padded.svelte-lpi64a{padding:2px;background:var(--bg-color);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-lpi64a:hover,button.highlight.svelte-lpi64a{cursor:pointer;color:var(--color-accent)}.padded.svelte-lpi64a:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-lpi64a{padding:0 1px;font-size:10px}div.svelte-lpi64a{padding:2px;display:flex;align-items:flex-end}.small.svelte-lpi64a{width:14px;height:14px}.large.svelte-lpi64a{width:22px;height:22px}.pending.svelte-lpi64a{animation:svelte-lpi64a-flash .5s infinite}@keyframes svelte-lpi64a-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.transparent.svelte-lpi64a{background:transparent;border:none;box-shadow:none}.empty.svelte-3w3rth{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-3w3rth{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-3w3rth{min-height:calc(var(--size-32) - 20px)}.large.svelte-3w3rth{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-3w3rth{margin-top:0}.small_parent.svelte-3w3rth{min-height:100%!important}.dropdown-arrow.svelte-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-ipfyu7{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;padding-bottom:var(--spacing-xl);color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-ipfyu7{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl);box-shadow:var(--shadow-drop)}.source-selection.svelte-lde7lt{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto;align-self:flex-end}.icon.svelte-lde7lt{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-lde7lt{color:var(--color-accent)}.icon.svelte-lde7lt:hover,.icon.svelte-lde7lt:focus{color:var(--color-accent)}label.svelte-
|
|
|
1 |
+
.block.svelte-1t38q2d{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-1t38q2d{border-color:var(--color-accent)}.padded.svelte-1t38q2d{padding:var(--block-padding)}.hidden.svelte-1t38q2d{display:none}.hide-container.svelte-1t38q2d{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-1hnfib2{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-22c38v{margin-bottom:var(--spacing-xs)}span.svelte-22c38v:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-22c38v{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-22c38v{margin:0;height:0}label.svelte-9gxdi0{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group label.svelte-9gxdi0{border-top-left-radius:0}label.float.svelte-9gxdi0{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}label.svelte-9gxdi0:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-9gxdi0{height:0}span.svelte-9gxdi0{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-9gxdi0{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-lpi64a{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}button[disabled].svelte-lpi64a{opacity:.5;box-shadow:none}button[disabled].svelte-lpi64a:hover{cursor:not-allowed}.padded.svelte-lpi64a{padding:2px;background:var(--bg-color);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-lpi64a:hover,button.highlight.svelte-lpi64a{cursor:pointer;color:var(--color-accent)}.padded.svelte-lpi64a:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-lpi64a{padding:0 1px;font-size:10px}div.svelte-lpi64a{padding:2px;display:flex;align-items:flex-end}.small.svelte-lpi64a{width:14px;height:14px}.large.svelte-lpi64a{width:22px;height:22px}.pending.svelte-lpi64a{animation:svelte-lpi64a-flash .5s infinite}@keyframes svelte-lpi64a-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.transparent.svelte-lpi64a{background:transparent;border:none;box-shadow:none}.empty.svelte-3w3rth{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-3w3rth{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-3w3rth{min-height:calc(var(--size-32) - 20px)}.large.svelte-3w3rth{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-3w3rth{margin-top:0}.small_parent.svelte-3w3rth{min-height:100%!important}.dropdown-arrow.svelte-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-ipfyu7{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;padding-bottom:var(--spacing-xl);color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-ipfyu7{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl);box-shadow:var(--shadow-drop)}.source-selection.svelte-lde7lt{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto;align-self:flex-end}.icon.svelte-lde7lt{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-lde7lt{color:var(--color-accent)}.icon.svelte-lde7lt:hover,.icon.svelte-lde7lt:focus{color:var(--color-accent)}label.svelte-c6v8zr.svelte-c6v8zr{display:block;width:100%}input.svelte-c6v8zr.svelte-c6v8zr{display:block;position:relative;outline:none!important;box-shadow:var(--input-shadow);background:var(--input-background-fill);padding:var(--input-padding);width:100%;color:var(--body-text-color);font-weight:var(--input-text-weight);font-size:var(--input-text-size);line-height:var(--line-sm);border:none}input[type=date].svelte-c6v8zr.svelte-c6v8zr::-webkit-calendar-picker-indicator{cursor:pointer}label.svelte-c6v8zr.svelte-c6v8zr:not(.container),label.svelte-c6v8zr:not(.container)>input.svelte-c6v8zr{height:100%}.container.svelte-c6v8zr>input.svelte-c6v8zr{border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-radius)}input.svelte-c6v8zr.svelte-c6v8zr:disabled{-webkit-text-fill-color:var(--body-text-color);-webkit-opacity:1;opacity:1}input.svelte-c6v8zr.svelte-c6v8zr:focus{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}input.svelte-c6v8zr.svelte-c6v8zr::placeholder{color:var(--input-placeholder-color)}
|
src/demo/app.py
CHANGED
@@ -6,7 +6,7 @@ def is_weekday(date: datetime.datetime):
|
|
6 |
return date.weekday() < 5
|
7 |
|
8 |
demo = gr.Interface(is_weekday,
|
9 |
-
[Calendar(type="datetime", label="Select a date", info="Click
|
10 |
gr.Label(label="Is it a weekday?"),
|
11 |
examples=["2023-01-01", "2023-12-11"],
|
12 |
cache_examples=True,
|
|
|
6 |
return date.weekday() < 5
|
7 |
|
8 |
demo = gr.Interface(is_weekday,
|
9 |
+
[Calendar(type="datetime", label="Select a date", info="Click the calendar icon to bring up the calendar.")],
|
10 |
gr.Label(label="Is it a weekday?"),
|
11 |
examples=["2023-01-01", "2023-12-11"],
|
12 |
cache_examples=True,
|
src/frontend/Index.svelte
CHANGED
@@ -39,7 +39,6 @@
|
|
39 |
|
40 |
</script>
|
41 |
|
42 |
-
<!-- svelte-ignore a11y-autofocus -->
|
43 |
|
44 |
<Block
|
45 |
{visible}
|
@@ -52,7 +51,7 @@
|
|
52 |
>
|
53 |
<label class:container>
|
54 |
<BlockTitle {show_label} {info}>{label}</BlockTitle>
|
55 |
-
<input type="date" bind:this={el} bind:value={value} on:
|
56 |
</label>
|
57 |
</Block>
|
58 |
|
@@ -76,11 +75,9 @@
|
|
76 |
line-height: var(--line-sm);
|
77 |
border: none;
|
78 |
}
|
79 |
-
|
80 |
-
cursor: pointer;
|
81 |
-
}
|
82 |
input[type="date"]::-webkit-calendar-picker-indicator {
|
83 |
-
|
84 |
}
|
85 |
|
86 |
label:not(.container),
|
@@ -106,4 +103,4 @@
|
|
106 |
color: var(--input-placeholder-color);
|
107 |
}
|
108 |
|
109 |
-
</style>
|
|
|
39 |
|
40 |
</script>
|
41 |
|
|
|
42 |
|
43 |
<Block
|
44 |
{visible}
|
|
|
51 |
>
|
52 |
<label class:container>
|
53 |
<BlockTitle {show_label} {info}>{label}</BlockTitle>
|
54 |
+
<input type="date" bind:this={el} bind:value={value} on:change={handle_change} disabled={!interactive}/>
|
55 |
</label>
|
56 |
</Block>
|
57 |
|
|
|
75 |
line-height: var(--line-sm);
|
76 |
border: none;
|
77 |
}
|
78 |
+
|
|
|
|
|
79 |
input[type="date"]::-webkit-calendar-picker-indicator {
|
80 |
+
cursor: pointer;
|
81 |
}
|
82 |
|
83 |
label:not(.container),
|
|
|
103 |
color: var(--input-placeholder-color);
|
104 |
}
|
105 |
|
106 |
+
</style>
|
src/pyproject.toml
CHANGED
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
|
|
8 |
|
9 |
[project]
|
10 |
name = "gradio_calendar"
|
11 |
-
version = "0.0.
|
12 |
description = "Gradio component for selecting dates with a calendar π"
|
13 |
readme = "README.md"
|
14 |
license = "MIT"
|
@@ -36,7 +36,7 @@ classifiers = [
|
|
36 |
dev = ["build", "twine"]
|
37 |
|
38 |
[tool.hatch.build]
|
39 |
-
artifacts = ["/backend/gradio_calendar/templates", "*.pyi", "backend/gradio_calendar/templates", "backend/gradio_calendar/templates"]
|
40 |
|
41 |
[tool.hatch.build.targets.wheel]
|
42 |
packages = ["/backend/gradio_calendar"]
|
|
|
8 |
|
9 |
[project]
|
10 |
name = "gradio_calendar"
|
11 |
+
version = "0.0.2"
|
12 |
description = "Gradio component for selecting dates with a calendar π"
|
13 |
readme = "README.md"
|
14 |
license = "MIT"
|
|
|
36 |
dev = ["build", "twine"]
|
37 |
|
38 |
[tool.hatch.build]
|
39 |
+
artifacts = ["/backend/gradio_calendar/templates", "*.pyi", "backend/gradio_calendar/templates", "backend/gradio_calendar/templates", "backend/gradio_calendar/templates", "backend/gradio_calendar/templates", "backend/gradio_calendar/templates", "backend/gradio_calendar/templates"]
|
40 |
|
41 |
[tool.hatch.build.targets.wheel]
|
42 |
packages = ["/backend/gradio_calendar"]
|