-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Scala 3.5.0 * chore: update Scala version to 3.5.0 * chore: update laminarVersion to 17.1.0 Vars <3 * feat: Update password field rendering in UI5WidgetFactory This commit updates the `UI5WidgetFactory` in the `modules/ui5` directory to include a new implementation for rendering a password input field. The `renderSecret` method now uses the `Input` component from the `com.raquo.laminar.api.L` package and sets the input type to "password". This change allows for rendering password fields with the appropriate input type in UI5 widgets. Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Update rendering of form fields in UI5WidgetFactory This commit updates the `UI5WidgetFactory` in the `modules/ui5` directory to improve the rendering of form fields. The `renderVar` method now uses the `asForm` extension method from the `Form` object to render the form fields. This change ensures consistency in rendering across different types of form fields in UI5 widgets. Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Update dependencies and add scala-java-time library This commit updates the dependencies in the `build.sbt` file. It updates the `web-components-ui5` library to version 2.0.0-RC1 and adds the `scala-java-time` library with version 2.6.0. These updates ensure compatibility with the latest versions of the dependencies and introduce new functionality provided by the `scala-java-time` library. Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: Update dependencies and add scala-java-time library Date support --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b8ca862
commit c246f35
Showing
18 changed files
with
256 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ val either = Sample( | |
s"$item" | ||
) | ||
}, | ||
Form.renderVar(eitherVar) | ||
eitherVar.asForm | ||
) | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ val enums = Sample( | |
s"$item" | ||
) | ||
}, | ||
Form.renderVar(eitherVar) | ||
eitherVar.asForm | ||
) | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,14 @@ import magnolia1.* | |
|
||
import io.github.iltotore.iron.* | ||
import io.github.iltotore.iron.constraint.all.* | ||
import samples.model.Password | ||
import java.time.LocalDate | ||
|
||
// Define some models | ||
case class Person( | ||
name: String, | ||
password: Password, | ||
birthDate: LocalDate, | ||
fav: Pet, | ||
pet: Option[Pet], | ||
email: Option[String], | ||
|
@@ -34,6 +38,8 @@ given Defaultable[Pet] with | |
val vlad = | ||
Person( | ||
"Vlad", | ||
Password("not a password"), | ||
LocalDate.of(1431, 11, 8), | ||
Pet("Batman", 666, House(2), 169), | ||
Some(Pet("Wolfy", 12, House(1), 42)), | ||
Some("[email protected]"), | ||
|
@@ -51,6 +57,6 @@ val person = Sample( | |
s"$item" | ||
) | ||
}, | ||
Form.renderVar(personVar) | ||
personVar.asForm | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ val simple = Sample( | |
s"$item" | ||
) | ||
}, | ||
Form.renderVar(eitherVar) | ||
eitherVar.asForm | ||
) | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,6 @@ val validation = Sample( | |
s"$item" | ||
) | ||
}, | ||
Form.renderVar(ironSampleVar) | ||
ironSampleVar.asForm | ||
) | ||
) |
24 changes: 24 additions & 0 deletions
24
examples/client/src/main/scala/samples/model/LoginPassword.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package samples.model | ||
|
||
import dev.cheleb.scalamigen.Form | ||
import com.raquo.laminar.api.L.* | ||
import dev.cheleb.scalamigen.WidgetFactory | ||
|
||
opaque type Password = String | ||
|
||
object Password: | ||
def apply(password: String): Password = password | ||
given Form[Password] with | ||
override def render( | ||
variable: Var[Password], | ||
syncParent: () => Unit, | ||
values: List[Password] = List.empty | ||
)(using factory: WidgetFactory): HtmlElement = | ||
factory.renderSecret | ||
.amend( | ||
value <-- variable.signal, | ||
onInput.mapToValue --> { v => | ||
variable.set(v) | ||
syncParent() | ||
} | ||
) |
Oops, something went wrong.