Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ trait BoxStyle {
val boxButtonIconMini: StyleA
val boxNavigationLabel: StyleA
val spacedList: StyleA
val validationInput:StyleA
val boxButtonImportant: StyleA
val boxButtonDanger: StyleA
val popupButton: StyleA
Expand Down
10 changes: 10 additions & 0 deletions client/src/main/scala/ch/wsl/box/client/styles/GlobalStyles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,16 @@ class GlobalStyles(settings:Settings,conf:StyleConf,font:BoxFont ) extends Style
)
)

override val validationInput = style(
margin.`0`,
padding.`0`,
border.`0`,
float.left,
minHeight.`0`,
minWidth.`0`,
width(1 px),
height(1 px),
)


override val boxButtonImportant = style(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ object PopupWidget extends ComponentWidgetFactory {

private def _renderOnTable(write:Boolean,nested:Binding.NestedInterceptor): JsDom.all.Modifier = popup(nested,write,(modal,modalStatus) => {
div(
TextInput(params.prop.bitransform(_.string)(x => params.prop.get))(width := 1.px, height := 1.px, padding := 0, border := 0, float.left,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
TextInput(params.prop.bitransform(_.string)(x => params.prop.get))(ClientConf.style.validationInput,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
button(ClientConf.style.popupButton, width := 100.pct, onclick :+= ((e:Event) => {
modalStatus.set(Status.Open)
e.preventDefault()
Expand All @@ -161,7 +161,7 @@ object PopupWidget extends ComponentWidgetFactory {

div(BootstrapCol.md(12),ClientConf.style.noPadding, ClientConf.style.smallBottomMargin,ClientConf.style.fieldContainerWrite)(
WidgetUtils.toLabel(field,WidgetUtils.LabelRight),
TextInput(params.prop.bitransform(_.string)(x => params.prop.get))(width := 1.px, height := 1.px, padding := 0, border := 0, float.left,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
TextInput(params.prop.bitransform(_.string)(x => params.prop.get))(ClientConf.style.validationInput,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
tooltip(button(ClientConf.style.popupButton,BootstrapStyles.Float.right(), onclick :+= ((e:Event) => {
modalStatus.set(Status.Open)
e.preventDefault()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ object RichTextPopup extends ComponentWidgetFactory {

private def _renderOnTable(write:Boolean,nested:Binding.NestedInterceptor): JsDom.all.Modifier = popup(nested,write,(modal,modalStatus) => {
div(
TextInput(params.prop.bitransform(_.string)(x => params.prop.get))(width := 1.px, height := 1.px, padding := 0, border := 0, float.left,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
TextInput(params.prop.bitransform(_.string)(x => params.prop.get))(ClientConf.style.validationInput,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
produceLabel(modalStatus),
modal.render
)
Expand All @@ -124,7 +124,7 @@ object RichTextPopup extends ComponentWidgetFactory {

div(BootstrapCol.md(12),ClientConf.style.noPadding, ClientConf.style.smallBottomMargin,
WidgetUtils.toLabel(field,WidgetUtils.LabelRight),
TextInput(params.prop.bitransform(_.string)(x => params.prop.get))(width := 1.px, height := 1.px, padding := 0, border := 0, float.left,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
TextInput(params.prop.bitransform(_.string)(x => params.prop.get))(ClientConf.style.validationInput,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
produceLabel(modalStatus),
modal.render

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class OlMapWidget(val id: ReadableProperty[Option[String]], val field: JSONField
def requiredCheckField = TextInput(
_data.bitransform(_.map(_.toString(1).take(5)).getOrElse("")) // check on the actual data is is non empty
(x => _data.get) // the text input will never been changed
)(width := 1.px, height := 1.px, minHeight := 1.px, padding := 0, border := 0, float.left,WidgetUtils.toNullable(field.nullable)) //in order to use HTML5 validation we insert an hidden field
)(ClientConf.style.validationInput,WidgetUtils.toNullable(field.nullable)) //in order to use HTML5 validation we insert an hidden field

override protected def edit(nested:Binding.NestedInterceptor): JsDom.all.Modifier = {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ object PopupSelectWidget extends ComponentWidgetFactory {

override def editOnTable(nested:Binding.NestedInterceptor): JsDom.all.Modifier = popupEdit(nested)((modalStatus) => {
div(
TextInput(data.bitransform(_.string)(x => data.get))(width := 1.px, height := 1.px, padding := 0, border := 0, float.left,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
TextInput(data.bitransform(_.string)(x => data.get))(ClientConf.style.validationInput,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
button(ClientConf.style.popupButton, width := 100.pct, onclick :+= ((e:Event) => {
modalStatus.set(Status.Open)
e.preventDefault()
Expand All @@ -271,7 +271,7 @@ object PopupSelectWidget extends ComponentWidgetFactory {

div(ClientConf.style.fieldContainerWrite)(
WidgetUtils.toLabel(field,WidgetUtils.LabelRight),
TextInput(data.bitransform(_.string)(x => data.get))(width := 1.px, height := 1.px, padding := 0, border := 0, float.left,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
TextInput(data.bitransform(_.string)(x => data.get))(ClientConf.style.validationInput,WidgetUtils.toNullable(field.nullable)), //in order to use HTML5 validation we insert an hidden field
tooltip(button(ClientConf.style.popupButton, onclick :+= ((e:Event) => {
modalStatus.set(Status.Open)
e.preventDefault()
Expand Down
Loading