1
+ /* generated by Svelte vX.Y.Z */
2
+ import {
3
+ SvelteComponent ,
4
+ append ,
5
+ attr ,
6
+ detach ,
7
+ element ,
8
+ init ,
9
+ insert ,
10
+ listen ,
11
+ noop ,
12
+ run_all ,
13
+ safe_not_equal ,
14
+ set_input_value ,
15
+ space
16
+ } from "svelte/internal" ;
17
+
18
+ function create_fragment ( ctx ) {
19
+ var form , input , t , button , dispose ;
20
+
21
+ return {
22
+ c ( ) {
23
+ form = element ( "form" ) ;
24
+ input = element ( "input" ) ;
25
+ t = space ( ) ;
26
+ button = element ( "button" ) ;
27
+ button . textContent = "Store" ;
28
+ attr ( input , "type" , "text" ) ;
29
+ input . required = true ;
30
+
31
+ dispose = [
32
+ listen ( input , "input" , ctx . input_input_handler ) ,
33
+ listen ( form , "submit" , ctx . handleSubmit )
34
+ ] ;
35
+ } ,
36
+
37
+ m ( target , anchor ) {
38
+ insert ( target , form , anchor ) ;
39
+ append ( form , input ) ;
40
+
41
+ set_input_value ( input , ctx . test ) ;
42
+
43
+ append ( form , t ) ;
44
+ append ( form , button ) ;
45
+ } ,
46
+
47
+ p ( changed , ctx ) {
48
+ if ( changed . test && ( input . value !== ctx . test ) ) set_input_value ( input , ctx . test ) ;
49
+ } ,
50
+
51
+ i : noop ,
52
+ o : noop ,
53
+
54
+ d ( detaching ) {
55
+ if ( detaching ) {
56
+ detach ( form ) ;
57
+ }
58
+
59
+ run_all ( dispose ) ;
60
+ }
61
+ } ;
62
+ }
63
+
64
+ function instance ( $$self , $$props , $$invalidate ) {
65
+ let test = undefined ;
66
+
67
+ function handleSubmit ( event ) {
68
+ event . preventDefault ( ) ;
69
+ console . log ( 'value' , test ) ;
70
+ }
71
+
72
+ function input_input_handler ( ) {
73
+ test = this . value ;
74
+ $$invalidate ( 'test' , test ) ;
75
+ }
76
+
77
+ return { test, handleSubmit, input_input_handler } ;
78
+ }
79
+
80
+ class Component extends SvelteComponent {
81
+ constructor ( options ) {
82
+ super ( ) ;
83
+ init ( this , options , instance , create_fragment , safe_not_equal , [ ] ) ;
84
+ }
85
+ }
86
+
87
+ export default Component ;
0 commit comments