diff --git a/build.sbt b/build.sbt index 86c98f09..8bfe7ec3 100644 --- a/build.sbt +++ b/build.sbt @@ -135,7 +135,7 @@ lazy val facade = "com.github.japgolly.scalajs-react" %%% "core" % scalaJsReact, "com.github.japgolly.scalajs-react" %%% "extra" % scalaJsReact, "com.github.japgolly.scalajs-react" %%% "test" % scalaJsReact % Test, - "io.github.cquiroz.react" %%% "common" % "0.6.2", + "io.github.cquiroz.react" %%% "common" % "0.6.3", "com.lihaoyi" %%% "utest" % "0.7.4" % Test, "org.typelevel" %%% "cats-core" % "2.1.1" % Test ), diff --git a/facade/src/main/scala/react/semanticui/addons/radio/Radio.scala b/facade/src/main/scala/react/semanticui/addons/radio/Radio.scala index 17ef43d3..092d5590 100644 --- a/facade/src/main/scala/react/semanticui/addons/radio/Radio.scala +++ b/facade/src/main/scala/react/semanticui/addons/radio/Radio.scala @@ -10,38 +10,41 @@ import react.common.style._ import react.common._ import react.semanticui._ import react.semanticui.modules.checkbox._ +import japgolly.scalajs.react.vdom.TagMod final case class Radio( - as: js.UndefOr[AsC] = js.undefined, - checked: js.UndefOr[Boolean] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - defaultChecked: js.UndefOr[Boolean] = js.undefined, - defaultIndeterminate: js.UndefOr[Boolean] = js.undefined, - disabled: js.UndefOr[Boolean] = js.undefined, - fitted: js.UndefOr[Boolean] = js.undefined, - id: js.UndefOr[JsNumber | String] = js.undefined, - indeterminate: js.UndefOr[Boolean] = js.undefined, - label: js.UndefOr[VdomNode] = js.undefined, - name: js.UndefOr[String] = js.undefined, - onChangeE: js.UndefOr[Radio.Event] = js.undefined, - onChange: js.UndefOr[Callback] = js.undefined, - onClickE: js.UndefOr[Radio.Event] = js.undefined, - onClick: js.UndefOr[Callback] = js.undefined, - onMouseDownE: js.UndefOr[Radio.Event] = js.undefined, - onMouseDown: js.UndefOr[Callback] = js.undefined, - onMouseUpE: js.UndefOr[Radio.Event] = js.undefined, - onMouseUp: js.UndefOr[Callback] = js.undefined, - radio: js.UndefOr[Boolean] = js.undefined, - readOnly: js.UndefOr[Boolean] = js.undefined, - slider: js.UndefOr[Boolean] = js.undefined, - tabIndex: js.UndefOr[JsNumber | String] = js.undefined, - toggle: js.UndefOr[Boolean] = js.undefined, - `type`: js.UndefOr[CheckboxType] = CheckboxType.Radio, - value: js.UndefOr[String | JsNumber] = js.undefined -) extends GenericComponentP[Radio.RadioProps] { - override protected def cprops = Radio.props(this) - @inline def render = Radio.component(Radio.props(this)) + as: js.UndefOr[AsC] = js.undefined, + checked: js.UndefOr[Boolean] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + defaultChecked: js.UndefOr[Boolean] = js.undefined, + defaultIndeterminate: js.UndefOr[Boolean] = js.undefined, + disabled: js.UndefOr[Boolean] = js.undefined, + fitted: js.UndefOr[Boolean] = js.undefined, + id: js.UndefOr[JsNumber | String] = js.undefined, + indeterminate: js.UndefOr[Boolean] = js.undefined, + label: js.UndefOr[VdomNode] = js.undefined, + name: js.UndefOr[String] = js.undefined, + onChangeE: js.UndefOr[Radio.Event] = js.undefined, + onChange: js.UndefOr[Callback] = js.undefined, + onClickE: js.UndefOr[Radio.Event] = js.undefined, + onClick: js.UndefOr[Callback] = js.undefined, + onMouseDownE: js.UndefOr[Radio.Event] = js.undefined, + onMouseDown: js.UndefOr[Callback] = js.undefined, + onMouseUpE: js.UndefOr[Radio.Event] = js.undefined, + onMouseUp: js.UndefOr[Callback] = js.undefined, + radio: js.UndefOr[Boolean] = js.undefined, + readOnly: js.UndefOr[Boolean] = js.undefined, + slider: js.UndefOr[Boolean] = js.undefined, + tabIndex: js.UndefOr[JsNumber | String] = js.undefined, + toggle: js.UndefOr[Boolean] = js.undefined, + tpe: js.UndefOr[CheckboxType] = CheckboxType.Radio, + value: js.UndefOr[String | JsNumber] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPA[Radio.RadioProps, Radio] { + override protected def cprops = Radio.props(this) + override protected val component = Radio.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object Radio { @@ -176,7 +179,7 @@ object Radio { q.slider, q.tabIndex, q.toggle, - q.`type`, + q.tpe, q.value ) @@ -242,4 +245,6 @@ object Radio { val defaultProps: RadioProps = props(Default) + def apply(content: TagMod*): Radio = + new Radio(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/collections/form/FormField.scala b/facade/src/main/scala/react/semanticui/collections/form/FormField.scala index feb16239..9ad4fc6e 100644 --- a/facade/src/main/scala/react/semanticui/collections/form/FormField.scala +++ b/facade/src/main/scala/react/semanticui/collections/form/FormField.scala @@ -11,27 +11,26 @@ import react.common._ import react.semanticui._ import react.semanticui.elements.label.Label import react.semanticui.{ raw => suiraw } +import japgolly.scalajs.react.vdom.TagMod final case class FormField( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - disabled: js.UndefOr[Boolean] = js.undefined, - error: js.UndefOr[Label] = js.undefined, - inline: js.UndefOr[Boolean] = js.undefined, - label: js.UndefOr[Label] = js.undefined, - required: js.UndefOr[Boolean | Label] = js.undefined, - `type`: js.UndefOr[String] = js.undefined, - width: js.UndefOr[SemanticWidth] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericComponentPC[FormField.FormFieldProps, FormField] { - override protected def cprops = FormField.props(this) - @inline def renderWith = - FormField.component(FormField.props(this)) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + disabled: js.UndefOr[Boolean] = js.undefined, + error: js.UndefOr[Label] = js.undefined, + inline: js.UndefOr[Boolean] = js.undefined, + label: js.UndefOr[Label] = js.undefined, + required: js.UndefOr[Boolean | Label] = js.undefined, + tpe: js.UndefOr[String] = js.undefined, + width: js.UndefOr[SemanticWidth] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPAC[FormField.FormFieldProps, FormField] { + override protected def cprops = FormField.props(this) + override protected val component = FormField.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object FormField { @@ -102,7 +101,7 @@ object FormField { q.inline, q.label, q.required, - q.`type`, + q.tpe, q.width ) @@ -142,6 +141,6 @@ object FormField { private val component = JsComponent[FormFieldProps, Children.Varargs, Null](RawComponent) - def apply(content: VdomNode*): FormField = - new FormField(children = content) + def apply(content: TagMod*): FormField = + new FormField(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/collections/form/FormGroup.scala b/facade/src/main/scala/react/semanticui/collections/form/FormGroup.scala index 1bed5249..f996fe55 100644 --- a/facade/src/main/scala/react/semanticui/collections/form/FormGroup.scala +++ b/facade/src/main/scala/react/semanticui/collections/form/FormGroup.scala @@ -10,24 +10,23 @@ import react.common.style._ import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } +import japgolly.scalajs.react.vdom.TagMod final case class FormGroup( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - grouped: js.UndefOr[Boolean] = js.undefined, - inline: js.UndefOr[Boolean] = js.undefined, - unstackable: js.UndefOr[Boolean] = js.undefined, - widths: js.UndefOr[SemanticWidth | FormWidths] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericComponentPC[FormGroup.FormGroupProps, FormGroup] { - override protected def cprops = FormGroup.props(this) - @inline def renderWith = - FormGroup.component(FormGroup.props(this)) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + grouped: js.UndefOr[Boolean] = js.undefined, + inline: js.UndefOr[Boolean] = js.undefined, + unstackable: js.UndefOr[Boolean] = js.undefined, + widths: js.UndefOr[SemanticWidth | FormWidths] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPAC[FormGroup.FormGroupProps, FormGroup] { + override protected def cprops = FormGroup.props(this) + override protected val component = FormGroup.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object FormGroup { @@ -112,6 +111,6 @@ object FormGroup { private val component = JsComponent[FormGroupProps, Children.Varargs, Null](RawComponent) - def apply(content: VdomNode*): FormGroup = - new FormGroup(children = content) + def apply(content: TagMod*): FormGroup = + new FormGroup(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/collections/menu/Menu.scala b/facade/src/main/scala/react/semanticui/collections/menu/Menu.scala index 77a35e37..dd3eb884 100644 --- a/facade/src/main/scala/react/semanticui/collections/menu/Menu.scala +++ b/facade/src/main/scala/react/semanticui/collections/menu/Menu.scala @@ -10,41 +10,40 @@ import react.common.style._ import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } +import japgolly.scalajs.react.vdom.TagMod final case class Menu( - as: js.UndefOr[AsC] = js.undefined, - activeIndex: js.UndefOr[Int | String] = js.undefined, - attached: js.UndefOr[MenuAttached] = js.undefined, - borderless: js.UndefOr[Boolean] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - color: js.UndefOr[SemanticColor] = js.undefined, - compact: js.UndefOr[Boolean] = js.undefined, - defaultActiveIndex: js.UndefOr[Int | String] = js.undefined, - fixed: js.UndefOr[MenuFixed] = js.undefined, - floated: js.UndefOr[MenuFloated] = js.undefined, - fluid: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[MenuIcon] = js.undefined, - inverted: js.UndefOr[Boolean] = js.undefined, - onItemClickE: js.UndefOr[Menu.OnItemClick] = js.undefined, - onItemClick: js.UndefOr[Callback] = js.undefined, - pagination: js.UndefOr[Boolean] = js.undefined, - pointing: js.UndefOr[Boolean] = js.undefined, - secondary: js.UndefOr[Boolean] = js.undefined, - size: js.UndefOr[SemanticSize] = js.undefined, - stackable: js.UndefOr[Boolean] = js.undefined, - tabular: js.UndefOr[MenuTabular] = js.undefined, - text: js.UndefOr[Boolean] = js.undefined, - vertical: js.UndefOr[Boolean] = js.undefined, - widths: js.UndefOr[SemanticWidth] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericComponentPC[Menu.MenuProps, Menu] { - override protected def cprops = Menu.props(this) - @inline def renderWith = - Menu.component(Menu.props(this)) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) + as: js.UndefOr[AsC] = js.undefined, + activeIndex: js.UndefOr[Int | String] = js.undefined, + attached: js.UndefOr[MenuAttached] = js.undefined, + borderless: js.UndefOr[Boolean] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + color: js.UndefOr[SemanticColor] = js.undefined, + compact: js.UndefOr[Boolean] = js.undefined, + defaultActiveIndex: js.UndefOr[Int | String] = js.undefined, + fixed: js.UndefOr[MenuFixed] = js.undefined, + floated: js.UndefOr[MenuFloated] = js.undefined, + fluid: js.UndefOr[Boolean] = js.undefined, + icon: js.UndefOr[MenuIcon] = js.undefined, + inverted: js.UndefOr[Boolean] = js.undefined, + onItemClickE: js.UndefOr[Menu.OnItemClick] = js.undefined, + onItemClick: js.UndefOr[Callback] = js.undefined, + pagination: js.UndefOr[Boolean] = js.undefined, + pointing: js.UndefOr[Boolean] = js.undefined, + secondary: js.UndefOr[Boolean] = js.undefined, + size: js.UndefOr[SemanticSize] = js.undefined, + stackable: js.UndefOr[Boolean] = js.undefined, + tabular: js.UndefOr[MenuTabular] = js.undefined, + text: js.UndefOr[Boolean] = js.undefined, + vertical: js.UndefOr[Boolean] = js.undefined, + widths: js.UndefOr[SemanticWidth] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPAC[Menu.MenuProps, Menu] { + override protected def cprops = Menu.props(this) + override protected val component = Menu.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object Menu { @@ -146,10 +145,6 @@ object Menu { var widths: js.UndefOr[suiraw.SemanticWIDTHS] = js.native } - val Default: Menu = Menu() - - val defaultProps: MenuProps = props(Default) - def props(q: Menu): MenuProps = rawprops( q.as, @@ -238,7 +233,11 @@ object Menu { private val component = JsComponent[MenuProps, Children.Varargs, Null](RawComponent) - def apply(content: VdomNode*): Menu = - new Menu(children = content) + val Default: Menu = Menu() + + val defaultProps: MenuProps = props(Default) + + def apply(content: TagMod*): Menu = + new Menu(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/collections/menu/MenuHeader.scala b/facade/src/main/scala/react/semanticui/collections/menu/MenuHeader.scala index 1b4cf7a0..91e395b2 100644 --- a/facade/src/main/scala/react/semanticui/collections/menu/MenuHeader.scala +++ b/facade/src/main/scala/react/semanticui/collections/menu/MenuHeader.scala @@ -9,20 +9,19 @@ import react.common.style._ import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } +import japgolly.scalajs.react.vdom.TagMod final case class MenuHeader( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericFnComponentPC[MenuHeader.MenuHeaderProps, MenuHeader] { - override protected def cprops = MenuHeader.props(this) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) - @inline def renderWith = - MenuHeader.component(MenuHeader.props(this)) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericFnComponentPAC[MenuHeader.MenuHeaderProps, MenuHeader] { + override protected def cprops = MenuHeader.props(this) + override protected val component = MenuHeader.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object MenuHeader { @@ -74,6 +73,6 @@ object MenuHeader { private val component = JsFnComponent[MenuHeaderProps, Children.Varargs](RawComponent) - def apply(content: VdomNode*): MenuHeader = - new MenuHeader(children = content) + def apply(content: TagMod*): MenuHeader = + new MenuHeader(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/collections/menu/MenuItem.scala b/facade/src/main/scala/react/semanticui/collections/menu/MenuItem.scala index 6dc2d16d..082d8672 100644 --- a/facade/src/main/scala/react/semanticui/collections/menu/MenuItem.scala +++ b/facade/src/main/scala/react/semanticui/collections/menu/MenuItem.scala @@ -12,32 +12,31 @@ import react.semanticui._ import react.semanticui.{ raw => suiraw } import react.semanticui.elements.icon.IconShorthand import react.semanticui.elements.icon.Icon.IconProps +import japgolly.scalajs.react.vdom.TagMod final case class MenuItem( - as: js.UndefOr[AsC] = js.undefined, - active: js.UndefOr[Boolean] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - color: js.UndefOr[SemanticColor] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - disabled: js.UndefOr[Boolean] = js.undefined, - fitted: js.UndefOr[MenuItemFitted] = js.undefined, - header: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[IconShorthand] = js.undefined, - index: js.UndefOr[Int] = js.undefined, - link: js.UndefOr[Boolean] = js.undefined, - name: js.UndefOr[String] = js.undefined, - onClickE: js.UndefOr[MenuItem.OnClick] = js.undefined, - onClick: js.UndefOr[Callback] = js.undefined, - position: js.UndefOr[MenuItemPosition] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericComponentPC[MenuItem.MenuItemProps, MenuItem] { - override protected def cprops = MenuItem.props(this) - @inline def renderWith = - MenuItem.component(MenuItem.props(this)) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) + as: js.UndefOr[AsC] = js.undefined, + active: js.UndefOr[Boolean] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + color: js.UndefOr[SemanticColor] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + disabled: js.UndefOr[Boolean] = js.undefined, + fitted: js.UndefOr[MenuItemFitted] = js.undefined, + header: js.UndefOr[Boolean] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, + index: js.UndefOr[Int] = js.undefined, + link: js.UndefOr[Boolean] = js.undefined, + name: js.UndefOr[String] = js.undefined, + onClickE: js.UndefOr[MenuItem.OnClick] = js.undefined, + onClick: js.UndefOr[Callback] = js.undefined, + position: js.UndefOr[MenuItemPosition] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPAC[MenuItem.MenuItemProps, MenuItem] { + override protected def cprops = MenuItem.props(this) + override protected val component = MenuItem.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object MenuItem { @@ -170,6 +169,6 @@ object MenuItem { private val component = JsComponent[MenuItemProps, Children.Varargs, Null](RawComponent) - def apply(content: VdomNode*): MenuItem = - new MenuItem(children = content) + def apply(content: TagMod*): MenuItem = + new MenuItem(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/collections/menu/MenuMenu.scala b/facade/src/main/scala/react/semanticui/collections/menu/MenuMenu.scala index bf14f965..f020c6a5 100644 --- a/facade/src/main/scala/react/semanticui/collections/menu/MenuMenu.scala +++ b/facade/src/main/scala/react/semanticui/collections/menu/MenuMenu.scala @@ -9,21 +9,20 @@ import react.common.style._ import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } +import japgolly.scalajs.react.vdom.TagMod final case class MenuMenu( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - position: js.UndefOr[MenuMenuPosition] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericFnComponentPC[MenuMenu.MenuMenuProps, MenuMenu] { - override protected def cprops = MenuMenu.props(this) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) - @inline def renderWith = - MenuMenu.component(MenuMenu.props(this)) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + position: js.UndefOr[MenuMenuPosition] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericFnComponentPAC[MenuMenu.MenuMenuProps, MenuMenu] { + override protected def cprops = MenuMenu.props(this) + override protected val component = MenuMenu.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object MenuMenu { @@ -80,6 +79,6 @@ object MenuMenu { private val component = JsFnComponent[MenuMenuProps, Children.Varargs](RawComponent) - def apply(content: VdomNode*): MenuMenu = - new MenuMenu(children = content) + def apply(content: TagMod*): MenuMenu = + new MenuMenu(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/elements/button/ButtonContent.scala b/facade/src/main/scala/react/semanticui/elements/button/ButtonContent.scala index b1974a45..d6ce864e 100644 --- a/facade/src/main/scala/react/semanticui/elements/button/ButtonContent.scala +++ b/facade/src/main/scala/react/semanticui/elements/button/ButtonContent.scala @@ -9,22 +9,21 @@ import react.common.style._ import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } +import japgolly.scalajs.react.vdom.TagMod final case class ButtonContent( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - hidden: js.UndefOr[Boolean] = js.undefined, - visible: js.UndefOr[Boolean] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericComponentPC[ButtonContent.ButtonContentProps, ButtonContent] { - override protected def cprops = ButtonContent.props(this) - @inline def renderWith = - ButtonContent.component(ButtonContent.props(this)) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + hidden: js.UndefOr[Boolean] = js.undefined, + visible: js.UndefOr[Boolean] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPAC[ButtonContent.ButtonContentProps, ButtonContent] { + override protected def cprops = ButtonContent.props(this) + override protected val component = ButtonContent.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object ButtonContent { @@ -87,7 +86,7 @@ object ButtonContent { JsComponent[ButtonContentProps, Children.Varargs, Null](RawComponent) def apply( - content: VdomNode* + content: TagMod* ): ButtonContent = - new ButtonContent(children = content) + new ButtonContent(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/elements/button/ButtonGroup.scala b/facade/src/main/scala/react/semanticui/elements/button/ButtonGroup.scala index 2aadc18e..e89612ed 100644 --- a/facade/src/main/scala/react/semanticui/elements/button/ButtonGroup.scala +++ b/facade/src/main/scala/react/semanticui/elements/button/ButtonGroup.scala @@ -11,38 +11,37 @@ import react.common.style._ import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui._ +import japgolly.scalajs.react.vdom.TagMod final case class ButtonGroup( - as: js.UndefOr[AsC] = js.undefined, - attached: js.UndefOr[Boolean | String] = js.undefined, - basic: js.UndefOr[Boolean] = js.undefined, - buttons: js.UndefOr[List[Button.ButtonProps]] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - color: js.UndefOr[SemanticColor] = js.undefined, - compact: js.UndefOr[Boolean] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - floated: js.UndefOr[SemanticFloat] = js.undefined, - fluid: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[Boolean] = js.undefined, - inverted: js.UndefOr[Boolean] = js.undefined, - labeled: js.UndefOr[Boolean] = js.undefined, - negative: js.UndefOr[Boolean] = js.undefined, - positive: js.UndefOr[Boolean] = js.undefined, - primary: js.UndefOr[Boolean] = js.undefined, - secondary: js.UndefOr[Boolean] = js.undefined, - size: js.UndefOr[SemanticSize] = js.undefined, - toggle: js.UndefOr[Boolean] = js.undefined, - vertical: js.UndefOr[Boolean] = js.undefined, - widths: js.UndefOr[SemanticWidth] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericComponentPC[ButtonGroup.ButtonGroupProps, ButtonGroup] { - override protected def cprops = ButtonGroup.props(this) - @inline def renderWith = - ButtonGroup.component(ButtonGroup.props(this)) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) + as: js.UndefOr[AsC] = js.undefined, + attached: js.UndefOr[Boolean | String] = js.undefined, + basic: js.UndefOr[Boolean] = js.undefined, + buttons: js.UndefOr[List[Button.ButtonProps]] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + color: js.UndefOr[SemanticColor] = js.undefined, + compact: js.UndefOr[Boolean] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + floated: js.UndefOr[SemanticFloat] = js.undefined, + fluid: js.UndefOr[Boolean] = js.undefined, + icon: js.UndefOr[Boolean] = js.undefined, + inverted: js.UndefOr[Boolean] = js.undefined, + labeled: js.UndefOr[Boolean] = js.undefined, + negative: js.UndefOr[Boolean] = js.undefined, + positive: js.UndefOr[Boolean] = js.undefined, + primary: js.UndefOr[Boolean] = js.undefined, + secondary: js.UndefOr[Boolean] = js.undefined, + size: js.UndefOr[SemanticSize] = js.undefined, + toggle: js.UndefOr[Boolean] = js.undefined, + vertical: js.UndefOr[Boolean] = js.undefined, + widths: js.UndefOr[SemanticWidth] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPAC[ButtonGroup.ButtonGroupProps, ButtonGroup] { + override protected def cprops = ButtonGroup.props(this) + override protected val component = ButtonGroup.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object ButtonGroup { @@ -208,6 +207,6 @@ object ButtonGroup { private val component = JsComponent[ButtonGroupProps, Children.Varargs, Null](RawComponent) - def apply(content: VdomNode*): ButtonGroup = - new ButtonGroup(children = content) + def apply(content: TagMod*): ButtonGroup = + new ButtonGroup(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/elements/button/ButtonOr.scala b/facade/src/main/scala/react/semanticui/elements/button/ButtonOr.scala index 14100792..ac6bc4ab 100644 --- a/facade/src/main/scala/react/semanticui/elements/button/ButtonOr.scala +++ b/facade/src/main/scala/react/semanticui/elements/button/ButtonOr.scala @@ -4,20 +4,22 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.TagMod import japgolly.scalajs.react.raw.JsNumber import react.semanticui._ import react.common._ import react.common.style._ final case class ButtonOr( - as: js.UndefOr[AsC] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - text: js.UndefOr[JsNumber | String] = js.undefined -) extends GenericComponentP[ButtonOr.ButtonOrProps] { - override protected def cprops = ButtonOr.props(this) - @inline def render = - ButtonOr.component(ButtonOr.props(this)) + as: js.UndefOr[AsC] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + text: js.UndefOr[JsNumber | String] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPA[ButtonOr.ButtonOrProps, ButtonOr] { + override protected def cprops = ButtonOr.props(this) + override protected val component = ButtonOr.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object ButtonOr { @@ -65,4 +67,8 @@ object ButtonOr { private val component = JsComponent[ButtonOrProps, Children.None, Null](RawComponent) + def apply( + content: TagMod* + ): ButtonOr = + new ButtonOr(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/elements/icon/Icon.scala b/facade/src/main/scala/react/semanticui/elements/icon/Icon.scala index b76fcf2c..afa69513 100644 --- a/facade/src/main/scala/react/semanticui/elements/icon/Icon.scala +++ b/facade/src/main/scala/react/semanticui/elements/icon/Icon.scala @@ -8,28 +8,31 @@ import react.semanticui.{ raw => suiraw } import scala.scalajs.js import scala.scalajs.js.| import js.annotation._ +import japgolly.scalajs.react.vdom.TagMod final case class Icon( - as: js.UndefOr[AsC] = js.undefined, - bordered: js.UndefOr[Boolean] = js.undefined, - circular: js.UndefOr[Boolean] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - color: js.UndefOr[SemanticColor] = js.undefined, - corner: js.UndefOr[IconCorner] = js.undefined, - disabled: js.UndefOr[Boolean] = js.undefined, - fitted: js.UndefOr[Boolean] = js.undefined, - flipped: js.UndefOr[IconFlip] = js.undefined, - inverted: js.UndefOr[Boolean] = js.undefined, - link: js.UndefOr[Boolean] = js.undefined, - loading: js.UndefOr[Boolean] = js.undefined, - name: js.UndefOr[suiraw.SemanticICONS] = js.undefined, - rotated: js.UndefOr[IconRotated] = js.undefined, - size: js.UndefOr[SemanticSize] = js.undefined, - ariaLabel: js.UndefOr[String] = js.undefined -) extends GenericComponentP[Icon.IconProps] { + as: js.UndefOr[AsC] = js.undefined, + bordered: js.UndefOr[Boolean] = js.undefined, + circular: js.UndefOr[Boolean] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + color: js.UndefOr[SemanticColor] = js.undefined, + corner: js.UndefOr[IconCorner] = js.undefined, + disabled: js.UndefOr[Boolean] = js.undefined, + fitted: js.UndefOr[Boolean] = js.undefined, + flipped: js.UndefOr[IconFlip] = js.undefined, + inverted: js.UndefOr[Boolean] = js.undefined, + link: js.UndefOr[Boolean] = js.undefined, + loading: js.UndefOr[Boolean] = js.undefined, + name: js.UndefOr[suiraw.SemanticICONS] = js.undefined, + rotated: js.UndefOr[IconRotated] = js.undefined, + size: js.UndefOr[SemanticSize] = js.undefined, + ariaLabel: js.UndefOr[String] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPA[Icon.IconProps, Icon] { override protected def cprops = Icon.props(this) - @inline def render = Icon.component(Icon.props(this)) + override val component = Icon.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object Icon { diff --git a/facade/src/main/scala/react/semanticui/elements/icon/IconGroup.scala b/facade/src/main/scala/react/semanticui/elements/icon/IconGroup.scala index 6bc23e6f..21c0263a 100644 --- a/facade/src/main/scala/react/semanticui/elements/icon/IconGroup.scala +++ b/facade/src/main/scala/react/semanticui/elements/icon/IconGroup.scala @@ -9,21 +9,20 @@ import react.semanticui._ import react.semanticui.{ raw => suiraw } import scala.scalajs.js import js.annotation._ +import japgolly.scalajs.react.vdom.TagMod final case class IconGroup( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - size: js.UndefOr[SemanticSize] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericComponentPC[IconGroup.IconGroupProps, IconGroup] { - override protected def cprops = IconGroup.props(this) - @inline def renderWith = - IconGroup.component(IconGroup.props(this)) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + size: js.UndefOr[SemanticSize] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPAC[IconGroup.IconGroupProps, IconGroup] { + override protected def cprops = IconGroup.props(this) + override protected val component = IconGroup.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object IconGroup { @@ -61,6 +60,6 @@ object IconGroup { private val component = JsComponent[IconGroupProps, Children.Varargs, Null](RawComponent) - def apply(content: VdomNode*): IconGroup = - new IconGroup(children = content) + def apply(content: TagMod*): IconGroup = + new IconGroup(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/elements/input/Input.scala b/facade/src/main/scala/react/semanticui/elements/input/Input.scala index 3f41673e..34548d90 100644 --- a/facade/src/main/scala/react/semanticui/elements/input/Input.scala +++ b/facade/src/main/scala/react/semanticui/elements/input/Input.scala @@ -13,38 +13,37 @@ import react.semanticui.{ raw => suiraw } import react.semanticui._ import react.semanticui.elements.icon.IconShorthand import react.semanticui.elements.icon.Icon.IconProps +import japgolly.scalajs.react.vdom.TagMod final case class Input( - as: js.UndefOr[AsC] = js.undefined, - action: js.UndefOr[Boolean | SemanticShortHandItem[js.Any]] = js.undefined, - actionPosition: js.UndefOr[ActionPosition] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - disabled: js.UndefOr[Boolean] = js.undefined, - error: js.UndefOr[Boolean] = js.undefined, - fluid: js.UndefOr[Boolean] = js.undefined, - focus: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[IconShorthand] = js.undefined, - iconPosition: js.UndefOr[IconPosition] = js.undefined, - input: js.UndefOr[VdomNode] = js.undefined, - inverted: js.UndefOr[Boolean] = js.undefined, - label: js.UndefOr[VdomNode] = js.undefined, - labelPosition: js.UndefOr[LabelPosition] = js.undefined, - loading: js.UndefOr[Boolean] = js.undefined, - onChangeE: js.UndefOr[Input.OnChange] = js.undefined, - onChange: js.UndefOr[Callback] = js.undefined, - size: js.UndefOr[SemanticSize] = js.undefined, - tabIndex: js.UndefOr[String | JsNumber] = js.undefined, - transparent: js.UndefOr[Boolean] = js.undefined, - `type`: js.UndefOr[String] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericComponentPC[Input.InputProps, Input] { - override protected def cprops = Input.props(this) - @inline def renderWith = - Input.component(Input.props(this)) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) + as: js.UndefOr[AsC] = js.undefined, + action: js.UndefOr[Boolean | SemanticShortHandItem[js.Any]] = js.undefined, + actionPosition: js.UndefOr[ActionPosition] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + disabled: js.UndefOr[Boolean] = js.undefined, + error: js.UndefOr[Boolean] = js.undefined, + fluid: js.UndefOr[Boolean] = js.undefined, + focus: js.UndefOr[Boolean] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, + iconPosition: js.UndefOr[IconPosition] = js.undefined, + input: js.UndefOr[VdomNode] = js.undefined, + inverted: js.UndefOr[Boolean] = js.undefined, + label: js.UndefOr[VdomNode] = js.undefined, + labelPosition: js.UndefOr[LabelPosition] = js.undefined, + loading: js.UndefOr[Boolean] = js.undefined, + onChangeE: js.UndefOr[Input.OnChange] = js.undefined, + onChange: js.UndefOr[Callback] = js.undefined, + size: js.UndefOr[SemanticSize] = js.undefined, + tabIndex: js.UndefOr[String | JsNumber] = js.undefined, + transparent: js.UndefOr[Boolean] = js.undefined, + tpe: js.UndefOr[String] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPAC[Input.InputProps, Input] { + override protected def cprops = Input.props(this) + override protected val component = Input.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object Input { @@ -155,7 +154,7 @@ object Input { p.size = q.size.toJs p.tabIndex = q.tabIndex p.transparent = q.transparent - p.`type` = q.`type` + p.`type` = q.tpe p } @@ -163,7 +162,7 @@ object Input { JsComponent[InputProps, Children.Varargs, Null](RawComponent) def apply( - content: VdomNode* + content: TagMod* ): Input = - new Input(children = content) + new Input(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/elements/label/Label.scala b/facade/src/main/scala/react/semanticui/elements/label/Label.scala index 620137ae..44b3f90e 100644 --- a/facade/src/main/scala/react/semanticui/elements/label/Label.scala +++ b/facade/src/main/scala/react/semanticui/elements/label/Label.scala @@ -5,47 +5,46 @@ import js.annotation._ import js.| import japgolly.scalajs.react._ import japgolly.scalajs.react.raw.React -import japgolly.scalajs.react.vdom.VdomNode import react.common.style._ import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } import react.semanticui.elements.icon.IconShorthand import react.semanticui.elements.icon.Icon.IconProps +import japgolly.scalajs.react.vdom.TagMod final case class Label( - as: js.UndefOr[AsC] = js.undefined, - active: js.UndefOr[Boolean] = js.undefined, - attached: js.UndefOr[LabelAttached] = js.undefined, - basic: js.UndefOr[Boolean] = js.undefined, - child: js.UndefOr[React.Node] = js.undefined, - circular: js.UndefOr[Boolean] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - color: js.UndefOr[SemanticColor] = js.undefined, - content: js.UndefOr[SemanticShortHandContent] = js.undefined, - corner: js.UndefOr[LabelCorner] = js.undefined, - detail: js.UndefOr[LabelDetail] = js.undefined, - empty: js.UndefOr[Boolean] = js.undefined, - floating: js.UndefOr[Boolean] = js.undefined, - horizontal: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[IconShorthand] = js.undefined, - image: js.UndefOr[Boolean] = js.undefined, - onClickE: js.UndefOr[Label.OnClick] = js.undefined, - onClick: js.UndefOr[Callback] = js.undefined, - onRemove: js.UndefOr[Label.OnClick] = js.undefined, - pointing: js.UndefOr[LabelPointing] = js.undefined, - prompt: js.UndefOr[Boolean] = js.undefined, - removeIcon: js.UndefOr[IconShorthand] = js.undefined, - ribbon: js.UndefOr[LabelRibbon] = js.undefined, - size: js.UndefOr[SemanticSize] = js.undefined, - tag: js.UndefOr[Boolean] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericComponentPC[Label.LabelProps, Label] { - override protected def cprops = Label.props(this) - @inline def renderWith = Label.component(Label.props(this)) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) + as: js.UndefOr[AsC] = js.undefined, + active: js.UndefOr[Boolean] = js.undefined, + attached: js.UndefOr[LabelAttached] = js.undefined, + basic: js.UndefOr[Boolean] = js.undefined, + child: js.UndefOr[React.Node] = js.undefined, + circular: js.UndefOr[Boolean] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + color: js.UndefOr[SemanticColor] = js.undefined, + content: js.UndefOr[SemanticShortHandContent] = js.undefined, + corner: js.UndefOr[LabelCorner] = js.undefined, + detail: js.UndefOr[LabelDetail] = js.undefined, + empty: js.UndefOr[Boolean] = js.undefined, + floating: js.UndefOr[Boolean] = js.undefined, + horizontal: js.UndefOr[Boolean] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, + image: js.UndefOr[Boolean] = js.undefined, + onClickE: js.UndefOr[Label.OnClick] = js.undefined, + onClick: js.UndefOr[Callback] = js.undefined, + onRemove: js.UndefOr[Label.OnClick] = js.undefined, + pointing: js.UndefOr[LabelPointing] = js.undefined, + prompt: js.UndefOr[Boolean] = js.undefined, + removeIcon: js.UndefOr[IconShorthand] = js.undefined, + ribbon: js.UndefOr[LabelRibbon] = js.undefined, + size: js.UndefOr[SemanticSize] = js.undefined, + tag: js.UndefOr[Boolean] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPAC[Label.LabelProps, Label] { + override protected def cprops = Label.props(this) + override protected val component = Label.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object Label { @@ -131,7 +130,7 @@ object Label { JsComponent[LabelProps, Children.Varargs, Null](RawComponent) def apply( - content: VdomNode* + content: TagMod* ): Label = - new Label(children = content) + new Label(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/elements/label/LabelDetail.scala b/facade/src/main/scala/react/semanticui/elements/label/LabelDetail.scala index 0e97d580..7072578a 100644 --- a/facade/src/main/scala/react/semanticui/elements/label/LabelDetail.scala +++ b/facade/src/main/scala/react/semanticui/elements/label/LabelDetail.scala @@ -9,20 +9,19 @@ import react.semanticui._ import react.semanticui.raw._ import react.common.style._ import react.common._ +import japgolly.scalajs.react.vdom.TagMod final case class LabelDetail( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericComponentPC[LabelDetail.LabelDetailProps, LabelDetail] { - override protected def cprops = LabelDetail.props(this) - @inline def renderWith = - LabelDetail.component(LabelDetail.props(this)) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPAC[LabelDetail.LabelDetailProps, LabelDetail] { + override protected def cprops = LabelDetail.props(this) + override protected val component = LabelDetail.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object LabelDetail { @@ -58,7 +57,7 @@ object LabelDetail { JsComponent[LabelDetailProps, Children.Varargs, Null](RawComponent) def apply( - content: VdomNode* + content: TagMod* ): LabelDetail = - new LabelDetail(children = content) + new LabelDetail(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/modules/checkbox/Checkbox.scala b/facade/src/main/scala/react/semanticui/modules/checkbox/Checkbox.scala index 0d9e5a73..aeb436ce 100644 --- a/facade/src/main/scala/react/semanticui/modules/checkbox/Checkbox.scala +++ b/facade/src/main/scala/react/semanticui/modules/checkbox/Checkbox.scala @@ -9,38 +9,41 @@ import japgolly.scalajs.react.vdom.VdomNode import react.common.style._ import react.common._ import react.semanticui._ +import japgolly.scalajs.react.vdom.TagMod final case class Checkbox( - as: js.UndefOr[AsC] = js.undefined, - checked: js.UndefOr[Boolean] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - defaultChecked: js.UndefOr[Boolean] = js.undefined, - defaultIndeterminate: js.UndefOr[Boolean] = js.undefined, - disabled: js.UndefOr[Boolean] = js.undefined, - fitted: js.UndefOr[Boolean] = js.undefined, - id: js.UndefOr[JsNumber | String] = js.undefined, - indeterminate: js.UndefOr[Boolean] = js.undefined, - label: js.UndefOr[VdomNode] = js.undefined, - name: js.UndefOr[String] = js.undefined, - onChangeE: js.UndefOr[Checkbox.Event] = js.undefined, - onChange: js.UndefOr[Callback] = js.undefined, - onClickE: js.UndefOr[Checkbox.Event] = js.undefined, - onClick: js.UndefOr[Callback] = js.undefined, - onMouseDownE: js.UndefOr[Checkbox.Event] = js.undefined, - onMouseDown: js.UndefOr[Callback] = js.undefined, - onMouseUpE: js.UndefOr[Checkbox.Event] = js.undefined, - onMouseUp: js.UndefOr[Callback] = js.undefined, - radio: js.UndefOr[Boolean] = js.undefined, - readOnly: js.UndefOr[Boolean] = js.undefined, - slider: js.UndefOr[Boolean] = js.undefined, - tabIndex: js.UndefOr[JsNumber | String] = js.undefined, - toggle: js.UndefOr[Boolean] = js.undefined, - `type`: js.UndefOr[CheckboxType] = CheckboxType.Checkbox, - value: js.UndefOr[String | JsNumber] = js.undefined -) extends GenericComponentP[Checkbox.CheckboxProps] { + as: js.UndefOr[AsC] = js.undefined, + checked: js.UndefOr[Boolean] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + defaultChecked: js.UndefOr[Boolean] = js.undefined, + defaultIndeterminate: js.UndefOr[Boolean] = js.undefined, + disabled: js.UndefOr[Boolean] = js.undefined, + fitted: js.UndefOr[Boolean] = js.undefined, + id: js.UndefOr[JsNumber | String] = js.undefined, + indeterminate: js.UndefOr[Boolean] = js.undefined, + label: js.UndefOr[VdomNode] = js.undefined, + name: js.UndefOr[String] = js.undefined, + onChangeE: js.UndefOr[Checkbox.Event] = js.undefined, + onChange: js.UndefOr[Callback] = js.undefined, + onClickE: js.UndefOr[Checkbox.Event] = js.undefined, + onClick: js.UndefOr[Callback] = js.undefined, + onMouseDownE: js.UndefOr[Checkbox.Event] = js.undefined, + onMouseDown: js.UndefOr[Callback] = js.undefined, + onMouseUpE: js.UndefOr[Checkbox.Event] = js.undefined, + onMouseUp: js.UndefOr[Callback] = js.undefined, + radio: js.UndefOr[Boolean] = js.undefined, + readOnly: js.UndefOr[Boolean] = js.undefined, + slider: js.UndefOr[Boolean] = js.undefined, + tabIndex: js.UndefOr[JsNumber | String] = js.undefined, + toggle: js.UndefOr[Boolean] = js.undefined, + tpe: js.UndefOr[CheckboxType] = CheckboxType.Checkbox, + value: js.UndefOr[String | JsNumber] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPA[Checkbox.CheckboxProps, Checkbox] { override protected def cprops = Checkbox.props(this) - @inline def render = Checkbox.component(Checkbox.props(this)) + override val component = Checkbox.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object Checkbox { @@ -175,7 +178,7 @@ object Checkbox { q.slider, q.tabIndex, q.toggle, - q.`type`, + q.tpe, q.value ) @@ -241,4 +244,6 @@ object Checkbox { val defaultProps: CheckboxProps = props(Default) + def apply(content: TagMod*): Checkbox = + new Checkbox(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownItem.scala b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownItem.scala index 6d0de6f5..81958f51 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownItem.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownItem.scala @@ -130,7 +130,7 @@ object DropdownItem { p.flag = toRawOrPropsP(q.flag) p.icon = q.icon.toJs p.image = fnToRawOrPropsPC(q.image) - p.label = toRawOrPropsPC(q.label) + p.label = toRawOrPropsPAC(q.label) p.onClick = (q.onClickE, q.onClick).toJs p.selected = q.selected p.text = q.text.toJs diff --git a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownSearchInput.scala b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownSearchInput.scala index e05acd5d..c867bcac 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownSearchInput.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownSearchInput.scala @@ -8,18 +8,21 @@ import japgolly.scalajs.react.raw.JsNumber import react.semanticui._ import react.common.style._ import react.common._ +import japgolly.scalajs.react.vdom.TagMod final case class DropdownSearchInput( - as: js.UndefOr[AsC] = js.undefined, - autoComplete: js.UndefOr[String] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - tabIndex: js.UndefOr[String | JsNumber] = js.undefined, - `type`: js.UndefOr[String] = js.undefined, - value: js.UndefOr[JsNumber | String] = js.undefined -) extends GenericComponentP[DropdownSearchInput.DropdownSearchInputProps] { + as: js.UndefOr[AsC] = js.undefined, + autoComplete: js.UndefOr[String] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + tabIndex: js.UndefOr[String | JsNumber] = js.undefined, + tpe: js.UndefOr[String] = js.undefined, + value: js.UndefOr[JsNumber | String] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericComponentPA[DropdownSearchInput.DropdownSearchInputProps, DropdownSearchInput] { override protected def cprops = DropdownSearchInput.props(this) - @inline def render = DropdownSearchInput.component(DropdownSearchInput.props(this)) + override val component = DropdownSearchInput.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object DropdownSearchInput { @@ -55,7 +58,7 @@ object DropdownSearchInput { } def props(q: DropdownSearchInput): DropdownSearchInputProps = - rawprops(q.as, q.autoComplete, q.className, q.clazz, q.tabIndex, q.`type`, q.value) + rawprops(q.as, q.autoComplete, q.className, q.clazz, q.tabIndex, q.tpe, q.value) def rawprops( as: js.UndefOr[AsC] = js.undefined, @@ -79,4 +82,6 @@ object DropdownSearchInput { private val component = JsComponent[DropdownSearchInputProps, Children.None, Null](RawComponent) + def apply(content: TagMod*): DropdownSearchInput = + new DropdownSearchInput(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/package.scala b/facade/src/main/scala/react/semanticui/package.scala index 70226d28..900f9a34 100644 --- a/facade/src/main/scala/react/semanticui/package.scala +++ b/facade/src/main/scala/react/semanticui/package.scala @@ -12,6 +12,7 @@ import react.common.GenericFnComponentPC import react.common.GenericFnComponentPAC import react.common.GenericComponentP import react.common.GenericComponentPC +import react.common.GenericComponentPAC package semanticui { sealed trait As extends Product with Serializable { @@ -222,6 +223,17 @@ package object semanticui } } + def toRawOrPropsPAC[P <: js.Object, A <: GenericComponentPAC[P, A]]( + c: js.UndefOr[VdomNode | A] + ): js.UndefOr[raw.SemanticShorthandItem[P]] = + c.map { d => + (d: Any) match { + case o: VdomNode => + o.rawNode.asInstanceOf[raw.SemanticShorthandItem[P]] + case f => f.asInstanceOf[A].props + } + } + type AsFn = js.Function1[js.Any, js.Any] type AsObj = js.Object type AsT = String | AsFn | AsObj diff --git a/facade/src/main/scala/react/semanticui/toasts/package.scala b/facade/src/main/scala/react/semanticui/toasts/package.scala index f4e9a006..df28001c 100644 --- a/facade/src/main/scala/react/semanticui/toasts/package.scala +++ b/facade/src/main/scala/react/semanticui/toasts/package.scala @@ -138,7 +138,7 @@ package toasts { def apply( title: String, description: js.UndefOr[String] = js.undefined, - `type`: js.UndefOr[ToastType] = js.undefined, + tpe: js.UndefOr[ToastType] = js.undefined, icon: js.UndefOr[Icon] = js.undefined, time: js.UndefOr[Dismissal] = js.undefined, animation: js.UndefOr[SemanticAnimation] = js.undefined, @@ -149,7 +149,7 @@ package toasts { val p = (new js.Object).asInstanceOf[ToastOptions] p.title = title p.description = description - p.`type` = `type`.toJs + p.`type` = tpe.toJs p.icon = icon.map(_.props) p.time = time.map(_ match { case Dismissal.User => 0 diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemContent.scala b/facade/src/main/scala/react/semanticui/views/item/ItemContent.scala index e0215ff7..78a8e74a 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemContent.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemContent.scala @@ -5,6 +5,7 @@ import js.annotation._ import js.| import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode +import japgolly.scalajs.react.vdom.TagMod import japgolly.scalajs.react.raw.React import react.common.style._ import react.common._ @@ -12,23 +13,21 @@ import react.semanticui._ import react.semanticui.{ raw => suiraw } final case class ItemContent( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - description: js.UndefOr[VdomNode | ItemDescription.ItemDescriptionProps] = js.undefined, - extra: js.UndefOr[VdomNode | ItemExtra.ItemExtraProps] = js.undefined, - header: js.UndefOr[VdomNode | ItemHeader.ItemHeaderProps] = js.undefined, - meta: js.UndefOr[VdomNode | ItemMeta.ItemMetaProps] = js.undefined, - verticalAlign: js.UndefOr[SemanticVerticalAlignment] = js.undefined, - override val children: CtorType.ChildrenArgs -) extends GenericFnComponentPC[ItemContent.ItemContentProps, ItemContent] { - override protected def cprops = ItemContent.props(this) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) - @inline def renderWith = - ItemContent.component(ItemContent.props(this)) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + description: js.UndefOr[VdomNode | ItemDescription.ItemDescriptionProps] = js.undefined, + extra: js.UndefOr[VdomNode | ItemExtra.ItemExtraProps] = js.undefined, + header: js.UndefOr[VdomNode | ItemHeader.ItemHeaderProps] = js.undefined, + meta: js.UndefOr[VdomNode | ItemMeta.ItemMetaProps] = js.undefined, + verticalAlign: js.UndefOr[SemanticVerticalAlignment] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericFnComponentPAC[ItemContent.ItemContentProps, ItemContent] { + override protected def cprops = ItemContent.props(this) + override protected val component = ItemContent.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object ItemContent { @@ -115,6 +114,6 @@ object ItemContent { private val component = JsFnComponent[ItemContentProps, Children.Varargs](RawComponent) - def apply(content: VdomNode*): ItemContent = - new ItemContent(children = content) + def apply(content: TagMod*): ItemContent = + new ItemContent(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemDescription.scala b/facade/src/main/scala/react/semanticui/views/item/ItemDescription.scala index 45e8f4ae..affe01ff 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemDescription.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemDescription.scala @@ -4,6 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode +import japgolly.scalajs.react.vdom.TagMod import japgolly.scalajs.react.raw.React import react.common.style._ import react.common._ @@ -11,18 +12,16 @@ import react.semanticui._ import react.semanticui.{ raw => suiraw } final case class ItemDescription( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericFnComponentPC[ItemDescription.ItemDescriptionProps, ItemDescription] { - override protected def cprops = ItemDescription.props(this) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) - @inline def renderWith = - ItemDescription.component(ItemDescription.props(this)) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericFnComponentPAC[ItemDescription.ItemDescriptionProps, ItemDescription] { + override protected def cprops = ItemDescription.props(this) + override protected val component = ItemDescription.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object ItemDescription { @@ -74,6 +73,6 @@ object ItemDescription { private val component = JsFnComponent[ItemDescriptionProps, Children.Varargs](RawComponent) - def apply(content: VdomNode*): ItemDescription = - new ItemDescription(children = content) + def apply(content: TagMod*): ItemDescription = + new ItemDescription(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemExtra.scala b/facade/src/main/scala/react/semanticui/views/item/ItemExtra.scala index d44c6608..39eeace2 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemExtra.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemExtra.scala @@ -4,6 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode +import japgolly.scalajs.react.vdom.TagMod import japgolly.scalajs.react.raw.React import react.common.style._ import react.common._ @@ -11,18 +12,16 @@ import react.semanticui._ import react.semanticui.{ raw => suiraw } final case class ItemExtra( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericFnComponentPC[ItemExtra.ItemExtraProps, ItemExtra] { - override protected def cprops = ItemExtra.props(this) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) - @inline def renderWith = - ItemExtra.component(ItemExtra.props(this)) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericFnComponentPAC[ItemExtra.ItemExtraProps, ItemExtra] { + override protected def cprops = ItemExtra.props(this) + override protected val component = ItemExtra.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object ItemExtra { @@ -74,6 +73,6 @@ object ItemExtra { private val component = JsFnComponent[ItemExtraProps, Children.Varargs](RawComponent) - def apply(content: VdomNode*): ItemExtra = - new ItemExtra(children = content) + def apply(content: TagMod*): ItemExtra = + new ItemExtra(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemGroup.scala b/facade/src/main/scala/react/semanticui/views/item/ItemGroup.scala index c6b2c060..f98fbf6c 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemGroup.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemGroup.scala @@ -5,6 +5,7 @@ import js.annotation._ import js.| import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode +import japgolly.scalajs.react.vdom.TagMod import japgolly.scalajs.react.raw.React import react.common.style._ import react.common._ @@ -12,22 +13,20 @@ import react.semanticui._ import react.semanticui.{ raw => suiraw } final case class ItemGroup( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - divided: js.UndefOr[Boolean] = js.undefined, - link: js.UndefOr[Boolean] = js.undefined, - relaxed: js.UndefOr[ItemRelaxed] = js.undefined, - unstackable: js.UndefOr[Boolean] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericFnComponentPC[ItemGroup.ItemGroupProps, ItemGroup] { - override protected def cprops = ItemGroup.props(this) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) - @inline def renderWith = - ItemGroup.component(ItemGroup.props(this)) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + divided: js.UndefOr[Boolean] = js.undefined, + link: js.UndefOr[Boolean] = js.undefined, + relaxed: js.UndefOr[ItemRelaxed] = js.undefined, + unstackable: js.UndefOr[Boolean] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericFnComponentPAC[ItemGroup.ItemGroupProps, ItemGroup] { + override protected def cprops = ItemGroup.props(this) + override protected val component = ItemGroup.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object ItemGroup { @@ -110,6 +109,6 @@ object ItemGroup { private val component = JsFnComponent[ItemGroupProps, Children.Varargs](RawComponent) - def apply(content: VdomNode*): ItemGroup = - new ItemGroup(children = content) + def apply(content: TagMod*): ItemGroup = + new ItemGroup(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemImage.scala b/facade/src/main/scala/react/semanticui/views/item/ItemImage.scala index ea6b82da..5abfd384 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemImage.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemImage.scala @@ -10,39 +10,38 @@ import react.common._ import react.semanticui._ import react.semanticui.elements.image._ import react.semanticui.elements.image.Image._ +import japgolly.scalajs.react.vdom.TagMod final case class ItemImage( - as: js.UndefOr[AsC] = js.undefined, - avatar: js.UndefOr[Boolean] = js.undefined, - bordered: js.UndefOr[Boolean] = js.undefined, - centered: js.UndefOr[Boolean] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - circular: js.UndefOr[Boolean] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - disabled: js.UndefOr[Boolean] = js.undefined, - dimmer: js.UndefOr[VdomNode] = js.undefined, - floated: js.UndefOr[SemanticFloat] = js.undefined, - fluid: js.UndefOr[Boolean | String] = js.undefined, - hidden: js.UndefOr[Boolean] = js.undefined, - href: js.UndefOr[String] = js.undefined, - inline: js.UndefOr[Boolean] = js.undefined, - label: js.UndefOr[VdomNode] = js.undefined, - rounded: js.UndefOr[Boolean] = js.undefined, - size: js.UndefOr[SemanticSize] = js.undefined, - spaced: js.UndefOr[ImageSpaced] = js.undefined, - src: js.UndefOr[String] = js.undefined, - ui: js.UndefOr[Boolean] = js.undefined, - verticalAlign: js.UndefOr[SemanticVerticalAlignment] = js.undefined, - wrapped: js.UndefOr[Boolean] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericFnComponentPC[ItemImage.ItemImageProps, ItemImage] { - override protected def cprops = ItemImage.props(this) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) - @inline def renderWith = - ItemImage.component(ItemImage.props(this)) + as: js.UndefOr[AsC] = js.undefined, + avatar: js.UndefOr[Boolean] = js.undefined, + bordered: js.UndefOr[Boolean] = js.undefined, + centered: js.UndefOr[Boolean] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + circular: js.UndefOr[Boolean] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + disabled: js.UndefOr[Boolean] = js.undefined, + dimmer: js.UndefOr[VdomNode] = js.undefined, + floated: js.UndefOr[SemanticFloat] = js.undefined, + fluid: js.UndefOr[Boolean | String] = js.undefined, + hidden: js.UndefOr[Boolean] = js.undefined, + href: js.UndefOr[String] = js.undefined, + inline: js.UndefOr[Boolean] = js.undefined, + label: js.UndefOr[VdomNode] = js.undefined, + rounded: js.UndefOr[Boolean] = js.undefined, + size: js.UndefOr[SemanticSize] = js.undefined, + spaced: js.UndefOr[ImageSpaced] = js.undefined, + src: js.UndefOr[String] = js.undefined, + ui: js.UndefOr[Boolean] = js.undefined, + verticalAlign: js.UndefOr[SemanticVerticalAlignment] = js.undefined, + wrapped: js.UndefOr[Boolean] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericFnComponentPAC[ItemImage.ItemImageProps, ItemImage] { + override protected def cprops = ItemImage.props(this) + override protected val component = ItemImage.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object ItemImage { @@ -88,6 +87,6 @@ object ItemImage { private val component = JsFnComponent[ItemImageProps, Children.Varargs](RawComponent) - def apply(content: VdomNode*): ItemImage = new ItemImage(children = content) + def apply(content: TagMod*): ItemImage = new ItemImage(modifiers = content) } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemMeta.scala b/facade/src/main/scala/react/semanticui/views/item/ItemMeta.scala index 6dd7c669..36b1378e 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemMeta.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemMeta.scala @@ -9,20 +9,19 @@ import react.common.style._ import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } +import japgolly.scalajs.react.vdom.TagMod final case class ItemMeta( - as: js.UndefOr[AsC] = js.undefined, - child: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty -) extends GenericFnComponentPC[ItemMeta.ItemMetaProps, ItemMeta] { - override protected def cprops = ItemMeta.props(this) - override def withChildren(children: CtorType.ChildrenArgs) = - copy(children = children) - @inline def renderWith = - ItemMeta.component(ItemMeta.props(this)) + as: js.UndefOr[AsC] = js.undefined, + child: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + override val modifiers: Seq[TagMod] = Seq.empty +) extends GenericFnComponentPAC[ItemMeta.ItemMetaProps, ItemMeta] { + override protected def cprops = ItemMeta.props(this) + override protected val component = ItemMeta.component + override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) } object ItemMeta { @@ -74,6 +73,6 @@ object ItemMeta { private val component = JsFnComponent[ItemMetaProps, Children.Varargs](RawComponent) - def apply(content: VdomNode*): ItemMeta = - ItemMeta(children = content) + def apply(content: TagMod*): ItemMeta = + ItemMeta(modifiers = content) } diff --git a/facade/src/test/scala/react/semanticui/elements/input/InputTests.scala b/facade/src/test/scala/react/semanticui/elements/input/InputTests.scala index f691468b..9f95c1ee 100644 --- a/facade/src/test/scala/react/semanticui/elements/input/InputTests.scala +++ b/facade/src/test/scala/react/semanticui/elements/input/InputTests.scala @@ -56,7 +56,7 @@ object InputTests extends TestSuite { } } test("typePassword") { - val input = Input(`type` = "password") + val input = Input(tpe = "password") ReactTestUtils.withRenderedIntoDocument(input) { m => assert(m.outerHtmlScrubbed() == """
""") }