-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add customisation annotations * Update sample component in HelloWorld.scala and Person model * feat: Update password field rendering in UI5WidgetFactory * refactor: Simplify getSubtypeLabel method in Form.scala
- Loading branch information
Showing
8 changed files
with
88 additions
and
33 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
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
19 changes: 3 additions & 16 deletions
19
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 |
---|---|---|
@@ -1,24 +1,11 @@ | ||
package samples.model | ||
|
||
import dev.cheleb.scalamigen.Form | ||
import com.raquo.laminar.api.L.* | ||
import dev.cheleb.scalamigen.WidgetFactory | ||
|
||
import dev.cheleb.scalamigen.secretForm | ||
|
||
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() | ||
} | ||
) | ||
given Form[Password] = secretForm(apply) |
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
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