diff --git a/project/ShoelaceGenerator.scala b/project/ShoelaceGenerator.scala index 10e1bfb..f4cf041 100644 --- a/project/ShoelaceGenerator.scala +++ b/project/ShoelaceGenerator.scala @@ -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.") diff --git a/src/main/scala/com/raquo/laminar/shoelace/sl/CommonTypes.scala b/src/main/scala/com/raquo/laminar/shoelace/sl/CommonTypes.scala index b1c8827..acc056e 100644 --- a/src/main/scala/com/raquo/laminar/shoelace/sl/CommonTypes.scala +++ b/src/main/scala/com/raquo/laminar/shoelace/sl/CommonTypes.scala @@ -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) } diff --git a/src/main/scala/com/raquo/laminar/shoelace/sl/FormatDate.scala b/src/main/scala/com/raquo/laminar/shoelace/sl/FormatDate.scala index ac0d5a9..719547a 100644 --- a/src/main/scala/com/raquo/laminar/shoelace/sl/FormatDate.scala +++ b/src/main/scala/com/raquo/laminar/shoelace/sl/FormatDate.scala @@ -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 -- diff --git a/src/main/scala/com/raquo/laminar/shoelace/sl/RelativeTime.scala b/src/main/scala/com/raquo/laminar/shoelace/sl/RelativeTime.scala index 18b3b8e..d1f5ebc 100644 --- a/src/main/scala/com/raquo/laminar/shoelace/sl/RelativeTime.scala +++ b/src/main/scala/com/raquo/laminar/shoelace/sl/RelativeTime.scala @@ -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 --