github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/views/components/edit/Any.html.go (about)

     1  // Code generated by qtc from "Any.html". DO NOT EDIT.
     2  // See https://github.com/valyala/quicktemplate for details.
     3  
     4  // <!-- Content managed by Project Forge, see [projectforge.md] for details. -->
     5  
     6  //line views/components/edit/Any.html:2
     7  package edit
     8  
     9  //line views/components/edit/Any.html:2
    10  import (
    11  	"fmt"
    12  
    13  	"github.com/kyleu/dbaudit/app/lib/types"
    14  )
    15  
    16  //line views/components/edit/Any.html:8
    17  import (
    18  	qtio422016 "io"
    19  
    20  	qt422016 "github.com/valyala/quicktemplate"
    21  )
    22  
    23  //line views/components/edit/Any.html:8
    24  var (
    25  	_ = qtio422016.Copy
    26  	_ = qt422016.AcquireByteBuffer
    27  )
    28  
    29  //line views/components/edit/Any.html:8
    30  func StreamAny(qw422016 *qt422016.Writer, key string, id string, x any, t *types.Wrapped) {
    31  //line views/components/edit/Any.html:9
    32  	switch t.Key() {
    33  //line views/components/edit/Any.html:10
    34  	case types.KeyAny:
    35  //line views/components/edit/Any.html:11
    36  		StreamDefault(qw422016, key, id, x, t)
    37  //line views/components/edit/Any.html:12
    38  	case types.KeyBit:
    39  //line views/components/edit/Any.html:13
    40  		StreamDefault(qw422016, key, id, x, t)
    41  //line views/components/edit/Any.html:14
    42  	case types.KeyBool:
    43  //line views/components/edit/Any.html:15
    44  		StreamBool(qw422016, key, id, x, false)
    45  //line views/components/edit/Any.html:16
    46  	case types.KeyByte:
    47  //line views/components/edit/Any.html:17
    48  		StreamDefault(qw422016, key, id, x, t)
    49  //line views/components/edit/Any.html:18
    50  	case types.KeyChar:
    51  //line views/components/edit/Any.html:19
    52  		StreamDefault(qw422016, key, id, x, t)
    53  //line views/components/edit/Any.html:20
    54  	case types.KeyDate:
    55  //line views/components/edit/Any.html:21
    56  		StreamDefault(qw422016, key, id, x, t)
    57  //line views/components/edit/Any.html:22
    58  	case types.KeyEnum:
    59  //line views/components/edit/Any.html:22
    60  		qw422016.N().S(`<span title="enum:`)
    61  //line views/components/edit/Any.html:23
    62  		qw422016.E().S(t.T.(*types.Enum).Ref)
    63  //line views/components/edit/Any.html:23
    64  		qw422016.N().S(`">`)
    65  //line views/components/edit/Any.html:23
    66  		qw422016.E().V(x)
    67  //line views/components/edit/Any.html:23
    68  		qw422016.N().S(`</span>`)
    69  //line views/components/edit/Any.html:24
    70  	case types.KeyEnumValue:
    71  //line views/components/edit/Any.html:25
    72  		StreamDefault(qw422016, key, id, x, t)
    73  //line views/components/edit/Any.html:26
    74  	case types.KeyError:
    75  //line views/components/edit/Any.html:27
    76  		StreamDefault(qw422016, key, id, x, t)
    77  //line views/components/edit/Any.html:28
    78  	case types.KeyFloat:
    79  //line views/components/edit/Any.html:29
    80  		StreamDefault(qw422016, key, id, x, t)
    81  //line views/components/edit/Any.html:30
    82  	case types.KeyInt:
    83  //line views/components/edit/Any.html:31
    84  		StreamInt(qw422016, key, id, x)
    85  //line views/components/edit/Any.html:32
    86  	case types.KeyJSON:
    87  //line views/components/edit/Any.html:33
    88  		StreamDefault(qw422016, key, id, x, t)
    89  //line views/components/edit/Any.html:34
    90  	case types.KeyList:
    91  //line views/components/edit/Any.html:35
    92  		StreamDefault(qw422016, key, id, x, t)
    93  //line views/components/edit/Any.html:36
    94  	case types.KeyMap:
    95  //line views/components/edit/Any.html:37
    96  		StreamDefault(qw422016, key, id, x, t)
    97  //line views/components/edit/Any.html:38
    98  	case types.KeyMethod:
    99  //line views/components/edit/Any.html:39
   100  		StreamDefault(qw422016, key, id, x, t)
   101  //line views/components/edit/Any.html:40
   102  	case types.KeyNil:
   103  //line views/components/edit/Any.html:41
   104  		StreamDefault(qw422016, key, id, x, t)
   105  //line views/components/edit/Any.html:42
   106  	case types.KeyOption:
   107  //line views/components/edit/Any.html:43
   108  		StreamOption(qw422016, key, id, x, t.T.(*types.Option))
   109  //line views/components/edit/Any.html:44
   110  	case types.KeyRange:
   111  //line views/components/edit/Any.html:45
   112  		StreamDefault(qw422016, key, id, x, t)
   113  //line views/components/edit/Any.html:46
   114  	case types.KeyReference:
   115  //line views/components/edit/Any.html:47
   116  		StreamDefault(qw422016, key, id, x, t)
   117  //line views/components/edit/Any.html:48
   118  	case types.KeySet:
   119  //line views/components/edit/Any.html:49
   120  		StreamDefault(qw422016, key, id, x, t)
   121  //line views/components/edit/Any.html:50
   122  	case types.KeyString:
   123  //line views/components/edit/Any.html:51
   124  		StreamString(qw422016, key, id, fmt.Sprint(x))
   125  //line views/components/edit/Any.html:52
   126  	case types.KeyTime:
   127  //line views/components/edit/Any.html:53
   128  		StreamDefault(qw422016, key, id, x, t)
   129  //line views/components/edit/Any.html:54
   130  	case types.KeyTimestamp:
   131  //line views/components/edit/Any.html:55
   132  		StreamDefault(qw422016, key, id, x, t)
   133  //line views/components/edit/Any.html:56
   134  	case types.KeyTimestampZoned:
   135  //line views/components/edit/Any.html:57
   136  		StreamDefault(qw422016, key, id, x, t)
   137  //line views/components/edit/Any.html:58
   138  	case types.KeyUnknown:
   139  //line views/components/edit/Any.html:59
   140  		StreamDefault(qw422016, key, id, x, t)
   141  //line views/components/edit/Any.html:60
   142  	case types.KeyUUID:
   143  //line views/components/edit/Any.html:61
   144  		StreamDefault(qw422016, key, id, x, t)
   145  //line views/components/edit/Any.html:62
   146  	case types.KeyValueMap:
   147  //line views/components/edit/Any.html:63
   148  		StreamDefault(qw422016, key, id, x, t)
   149  //line views/components/edit/Any.html:64
   150  	case types.KeyXML:
   151  //line views/components/edit/Any.html:65
   152  		StreamDefault(qw422016, key, id, x, t)
   153  //line views/components/edit/Any.html:66
   154  	default:
   155  //line views/components/edit/Any.html:67
   156  		StreamDefault(qw422016, key, id, x, t)
   157  //line views/components/edit/Any.html:68
   158  	}
   159  //line views/components/edit/Any.html:69
   160  }
   161  
   162  //line views/components/edit/Any.html:69
   163  func WriteAny(qq422016 qtio422016.Writer, key string, id string, x any, t *types.Wrapped) {
   164  //line views/components/edit/Any.html:69
   165  	qw422016 := qt422016.AcquireWriter(qq422016)
   166  //line views/components/edit/Any.html:69
   167  	StreamAny(qw422016, key, id, x, t)
   168  //line views/components/edit/Any.html:69
   169  	qt422016.ReleaseWriter(qw422016)
   170  //line views/components/edit/Any.html:69
   171  }
   172  
   173  //line views/components/edit/Any.html:69
   174  func Any(key string, id string, x any, t *types.Wrapped) string {
   175  //line views/components/edit/Any.html:69
   176  	qb422016 := qt422016.AcquireByteBuffer()
   177  //line views/components/edit/Any.html:69
   178  	WriteAny(qb422016, key, id, x, t)
   179  //line views/components/edit/Any.html:69
   180  	qs422016 := string(qb422016.B)
   181  //line views/components/edit/Any.html:69
   182  	qt422016.ReleaseByteBuffer(qb422016)
   183  //line views/components/edit/Any.html:69
   184  	return qs422016
   185  //line views/components/edit/Any.html:69
   186  }
   187  
   188  //line views/components/edit/Any.html:71
   189  func StreamDefault(qw422016 *qt422016.Writer, key string, id string, x any, t types.Type) {
   190  //line views/components/edit/Any.html:73
   191  	msg := fmt.Sprintf("unhandled type: %s (%T)", t.String(), x)
   192  	if x == nil {
   193  		x = "∅"
   194  	}
   195  
   196  //line views/components/edit/Any.html:77
   197  	qw422016.N().S(`<input title="`)
   198  //line views/components/edit/Any.html:78
   199  	qw422016.E().S(msg)
   200  //line views/components/edit/Any.html:78
   201  	qw422016.N().S(`" value="`)
   202  //line views/components/edit/Any.html:78
   203  	qw422016.E().V(x)
   204  //line views/components/edit/Any.html:78
   205  	qw422016.N().S(`" name="`)
   206  //line views/components/edit/Any.html:78
   207  	qw422016.E().S(key)
   208  //line views/components/edit/Any.html:78
   209  	qw422016.N().S(`" id="`)
   210  //line views/components/edit/Any.html:78
   211  	qw422016.E().S(id)
   212  //line views/components/edit/Any.html:78
   213  	qw422016.N().S(`" />`)
   214  //line views/components/edit/Any.html:79
   215  }
   216  
   217  //line views/components/edit/Any.html:79
   218  func WriteDefault(qq422016 qtio422016.Writer, key string, id string, x any, t types.Type) {
   219  //line views/components/edit/Any.html:79
   220  	qw422016 := qt422016.AcquireWriter(qq422016)
   221  //line views/components/edit/Any.html:79
   222  	StreamDefault(qw422016, key, id, x, t)
   223  //line views/components/edit/Any.html:79
   224  	qt422016.ReleaseWriter(qw422016)
   225  //line views/components/edit/Any.html:79
   226  }
   227  
   228  //line views/components/edit/Any.html:79
   229  func Default(key string, id string, x any, t types.Type) string {
   230  //line views/components/edit/Any.html:79
   231  	qb422016 := qt422016.AcquireByteBuffer()
   232  //line views/components/edit/Any.html:79
   233  	WriteDefault(qb422016, key, id, x, t)
   234  //line views/components/edit/Any.html:79
   235  	qs422016 := string(qb422016.B)
   236  //line views/components/edit/Any.html:79
   237  	qt422016.ReleaseByteBuffer(qb422016)
   238  //line views/components/edit/Any.html:79
   239  	return qs422016
   240  //line views/components/edit/Any.html:79
   241  }