Skip to content

Commit

Permalink
Dropped dateProp in favor of asIsProp
Browse files Browse the repository at this point in the history
  • Loading branch information
YakimaProgrammer authored and raquo committed Aug 5, 2024
1 parent 1ede893 commit 6df15ef
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion project/ShoelaceGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ShoelaceGenerator(
case "String" => "stringProp"
case "Int" => "intProp"
case "Double" => "doubleProp"
case "js.Date | String" => "dateProp"
case "js.Date | String" => "asIsProp"
case "dom.MutationObserver" | "js.Array[js.Object]" => "asIsProp"
case _ =>
println(s"PROP ...No impl defined for scala type `${scalaTypeStr}`, trying `htmlProp` for now.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ trait CommonTypes {

protected def asIsProp[V](name: String): HtmlProp[V, _] = L.htmlProp(name, AsIsCodec[V]())

protected def dateProp(name: String): HtmlProp[js.Date | String, _] = L.htmlProp(name, AsIsCodec[js.Date | String]())

protected def boolAttr(name: String): HtmlAttr[Boolean] = {
L.htmlAttr(name, BooleanAsAttrPresenceCodec)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ object FormatDate extends WebComponent("sl-format-date") {
* recommended to use the ISO 8601 format to ensure timezones are handled correctly. To convert a date to this format
* in JavaScript, use [`date.toISOString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString).
*/
lazy val date: HtmlProp[js.Date | String, _] = dateProp("date")
lazy val date: HtmlProp[js.Date | String, _] = asIsProp("date")


// -- Slots --
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object RelativeTime extends WebComponent("sl-relative-time") {
* string, it's strongly recommended to use the ISO 8601 format to ensure timezones are handled correctly. To convert
* a date to this format in JavaScript, use [`date.toISOString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString).
*/
lazy val date: HtmlProp[js.Date | String, _] = dateProp("date")
lazy val date: HtmlProp[js.Date | String, _] = asIsProp("date")


// -- Slots --
Expand Down

0 comments on commit 6df15ef

Please sign in to comment.