-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add apply method to facades * Update components to apply * Remove redundant children * Minor changes
- Loading branch information
Showing
27 changed files
with
206 additions
and
125 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
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
10 changes: 7 additions & 3 deletions
10
spra-web/src/main/scala/net/wiringbits/spra/ui/web/facades/reactadmin/Admin.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,13 +1,17 @@ | ||
package net.wiringbits.spra.ui.web.facades.reactadmin | ||
|
||
import net.wiringbits.spra.ui.web.facades.DataProvider | ||
import slinky.core.ExternalComponent | ||
import slinky.core.facade.ReactElement | ||
import slinky.core.{BuildingComponent, ExternalComponent} | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.| | ||
|
||
object Admin extends ExternalComponent { | ||
case class Props(dataProvider: DataProvider, children: Seq[ReactElement]) | ||
case class Props(dataProvider: DataProvider) | ||
|
||
def apply(dataProvider: DataProvider): BuildingComponent[_, _] = { | ||
super.apply(Props(dataProvider)) | ||
} | ||
|
||
override val component: String | js.Object = ReactAdmin.Admin | ||
} |
10 changes: 7 additions & 3 deletions
10
spra-web/src/main/scala/net/wiringbits/spra/ui/web/facades/reactadmin/Button.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,12 +1,16 @@ | ||
package net.wiringbits.spra.ui.web.facades.reactadmin | ||
|
||
import slinky.core.ExternalComponent | ||
import slinky.core.facade.ReactElement | ||
import slinky.core.{BuildingComponent, ExternalComponent} | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.| | ||
|
||
object Button extends ExternalComponent { | ||
case class Props(onClick: () => Unit, children: Seq[ReactElement]) | ||
case class Props(onClick: () => Unit) | ||
|
||
def apply(onClick: () => Unit): BuildingComponent[_, _] = { | ||
super.apply(Props(onClick)) | ||
} | ||
|
||
override val component: String | js.Object = ReactAdmin.Button | ||
} |
7 changes: 6 additions & 1 deletion
7
spra-web/src/main/scala/net/wiringbits/spra/ui/web/facades/reactadmin/ComponentList.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,12 +1,17 @@ | ||
package net.wiringbits.spra.ui.web.facades.reactadmin | ||
|
||
import slinky.core.ExternalComponent | ||
import slinky.core.facade.ReactElement | ||
import slinky.core.{BuildingComponent, ExternalComponent} | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.| | ||
|
||
object ComponentList extends ExternalComponent { | ||
case class Props(actions: ReactElement, filters: Seq[ReactElement]) | ||
|
||
def apply(actions: ReactElement)(filters: ReactElement*): BuildingComponent[_, _] = { | ||
super.apply(Props(actions, filters)) | ||
} | ||
|
||
override val component: String | js.Object = ReactAdmin.List | ||
} |
7 changes: 2 additions & 5 deletions
7
spra-web/src/main/scala/net/wiringbits/spra/ui/web/facades/reactadmin/Create.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,12 +1,9 @@ | ||
package net.wiringbits.spra.ui.web.facades.reactadmin | ||
|
||
import slinky.core.ExternalComponent | ||
import slinky.core.facade.ReactElement | ||
import slinky.core.ExternalComponentNoProps | ||
|
||
import scala.scalajs.js | ||
|
||
object Create extends ExternalComponent { | ||
case class Props(children: ReactElement*) | ||
|
||
object Create extends ExternalComponentNoProps { | ||
override val component: String | js.Object = ReactAdmin.Create | ||
} |
9 changes: 6 additions & 3 deletions
9
spra-web/src/main/scala/net/wiringbits/spra/ui/web/facades/reactadmin/Datagrid.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,12 +1,15 @@ | ||
package net.wiringbits.spra.ui.web.facades.reactadmin | ||
|
||
import slinky.core.ExternalComponent | ||
import slinky.core.facade.ReactElement | ||
import slinky.core.{BuildingComponent, ExternalComponent} | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.| | ||
|
||
object Datagrid extends ExternalComponent { | ||
case class Props(rowClick: String, bulkActionButtons: Boolean, children: Seq[ReactElement]) | ||
case class Props(rowClick: String, bulkActionButtons: Boolean) | ||
|
||
def apply(rowClick: String, bulkActionButtons: Boolean): BuildingComponent[_, _] = | ||
super.apply(Props(rowClick, bulkActionButtons)) | ||
|
||
override val component: String | js.Object = ReactAdmin.Datagrid | ||
} |
7 changes: 6 additions & 1 deletion
7
spra-web/src/main/scala/net/wiringbits/spra/ui/web/facades/reactadmin/DateField.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,11 +1,16 @@ | ||
package net.wiringbits.spra.ui.web.facades.reactadmin | ||
|
||
import slinky.core.ExternalComponent | ||
import slinky.core.{BuildingComponent, ExternalComponent} | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.| | ||
|
||
object DateField extends ExternalComponent { | ||
case class Props(source: String, showTime: Boolean) | ||
|
||
def apply(source: String, showTime: Boolean = false): BuildingComponent[_, _] = { | ||
super.apply(Props(source, showTime)) | ||
} | ||
|
||
override val component: String | js.Object = ReactAdmin.DateField | ||
} |
11 changes: 10 additions & 1 deletion
11
spra-web/src/main/scala/net/wiringbits/spra/ui/web/facades/reactadmin/DateInput.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,11 +1,20 @@ | ||
package net.wiringbits.spra.ui.web.facades.reactadmin | ||
|
||
import slinky.core.ExternalComponent | ||
import slinky.core.{BuildingComponent, ExternalComponent} | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.| | ||
|
||
object DateInput extends ExternalComponent { | ||
case class Props(source: String, isRequired: Boolean = false, validate: js.UndefOr[js.Any] = js.undefined) | ||
|
||
def apply( | ||
source: String, | ||
isRequired: Boolean = false, | ||
validate: js.UndefOr[js.Any] = js.undefined | ||
): BuildingComponent[_, _] = { | ||
super.apply(Props(source, isRequired, validate)) | ||
} | ||
|
||
override val component: String | js.Object = ReactAdmin.DateInput | ||
} |
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
9 changes: 7 additions & 2 deletions
9
spra-web/src/main/scala/net/wiringbits/spra/ui/web/facades/reactadmin/Edit.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,12 +1,17 @@ | ||
package net.wiringbits.spra.ui.web.facades.reactadmin | ||
|
||
import slinky.core.ExternalComponent | ||
import slinky.core.facade.ReactElement | ||
import slinky.core.{BuildingComponent, ExternalComponent} | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.| | ||
|
||
object Edit extends ExternalComponent { | ||
case class Props(actions: ReactElement, children: Seq[ReactElement]) | ||
case class Props(actions: ReactElement) | ||
|
||
def apply(actions: ReactElement): BuildingComponent[_, _] = { | ||
super.apply(Props(actions)) | ||
} | ||
|
||
override val component: String | js.Object = ReactAdmin.Edit | ||
} |
Oops, something went wrong.