forked from cardiomoon/r-sem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtextInput2.R
executable file
·113 lines (97 loc) · 3.98 KB
/
textInput2.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
textareaInput<-function(inputId, label="",value="", rows=8, width=100){
div(class="form-group shiny-input-container",
tags$style(type="text/css", "textarea {width:100%}"),
tags$textarea(id = inputId, placeholder = label, rows = rows, value=value,
style=paste("width: ",width,"px; display:inline-block;",sep=""))
)
}
textInput2<-function (inputId, label, value = "",width=100,...)
{
div(class="form-group shiny-input-container",style="display:inline-block;",
tags$label(label, `for` = inputId, style="display:inline-block;"),
tags$input(id = inputId, type = "text", class="form-control",value = value,
style=paste("width: ",width,"px; display:inline-block;",sep=""),...)
)
}
# textInput과 동일하나 폭 조절 가능(px)하고 side by side로 사용 가능
textInput3<-function (inputId, label, value = "",width=100,...)
{
div(style="display:inline-block;",
if(label!="") tags$label(label, `for` = inputId),
tags$input(id = inputId, type = "text", class="form-control",value = value,
style=paste("width: ",width,"px;",sep=""),...))
}
textInput4<-function (inputId, label, value = "",width=100,...)
{
div(
tags$label(label, `for` = inputId),
tags$input(id = inputId, type = "text", class="form-control",value = value,
style=paste("color: green; width: ",width,"px;",sep=""),...))
}
numericInput2<-function (inputId, label, value , min=NA,max=NA,step=NA,width=100,...)
{
div(class="form-group shiny-input-container",style="display:inline-block;",
tags$label(label, `for` = inputId,class="control-label"),
tags$input(id = inputId, type = "number", class="form-control",
value = value, min=min,max=max,step=step,style=paste("width: ",width,"px; display:inline-block;",sep=""),...)
)
}
numericInput3<-function (inputId, label, value, min=NA,max=NA,step=NA,width=100,...)
{
div(style="display:inline-block;",
tags$label(label, `for` = inputId,class="control-label"),
tags$input(id = inputId, type = "number", class="form-control",
value = value, min=min,max=max,step=step,style=paste("width: ",width,"px;",sep=""),...)
)
}
selectInput3<-function(...,width=100){
mywidth=paste(width,"px",sep="")
div(style="display:inline-block;",selectInput(...,width=mywidth))
}
selectizeInput2<-function(inputId,label,...,width=100){
mywidth=paste(width,"px",sep="")
div(class="form-group shiny-input-container",
selectizeInput(
inputId, '',...,
options = list(
placeholder = label,
onInitialize = I('function() { this.setValue(""); }')
),width=mywidth))
}
selectizeInput3<-function(inputId,label,...,width=100){
mywidth=paste(width,"px",sep="")
div(style="display:inline-block;",
selectizeInput(
inputId, '',...,
options = list(
placeholder = label,
onInitialize = I('function() { this.setValue(""); }')
),width=mywidth))
}
checkboxInput2<-function(inputId,label,value=FALSE,width=100){
if(value)
div(
tags$input(id = inputId, type = "checkbox",checked = "checked"),
tags$label(label, `for` = inputId,
style=paste("width: ",width-15,"px;display:inline-block;",sep=""))
)
else
div(
tags$input(id = inputId, type = "checkbox"),
tags$label(label, `for` = inputId,
style=paste("width: ",width-15,"px; display:inline-block;",sep=""))
)
}
checkboxInput3<-function(inputId,label,value=FALSE,width=100){
if(value)
div(style="display:inline-block;",
tags$input(id = inputId, type = "checkbox",checked = "checked"),
tags$label(label, `for` = inputId,
style=paste("width: ",width-15,"px;",sep=""))
)
else
div(style="display:inline-block;",
tags$input(id = inputId, type = "checkbox"),
tags$label(label, `for` = inputId, style=paste("width: ",width-15,"px;",sep=""))
)
}