From 36e66b1989bc682a881eea35fccecf36717a683a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Piaggio?= Date: Tue, 10 Mar 2020 12:47:57 -0300 Subject: [PATCH 1/2] IconShorthand allowing Strings and Booleans. --- .../collections/menu/MenuItem.scala | 10 ++--- .../collections/message/Message.scala | 10 ++--- .../semanticui/elements/button/Button.scala | 39 +++++++++---------- .../semanticui/elements/header/Header.scala | 10 +++-- .../semanticui/elements/icon/package.scala | 14 +++++++ .../semanticui/elements/input/Input.scala | 35 +++++++---------- .../semanticui/elements/label/Label.scala | 15 +++---- .../modules/dropdown/Dropdown.scala | 10 ++--- .../modules/dropdown/DropdownHeader.scala | 33 ++++++++-------- .../modules/dropdown/DropdownItem.scala | 8 ++-- .../main/scala/react/semanticui/package.scala | 1 + 11 files changed, 98 insertions(+), 87 deletions(-) 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 3fdbbd1a..b344d7a5 100644 --- a/facade/src/main/scala/react/semanticui/collections/menu/MenuItem.scala +++ b/facade/src/main/scala/react/semanticui/collections/menu/MenuItem.scala @@ -10,7 +10,7 @@ import react.common.style._ import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } -import react.semanticui.elements.icon.Icon +import react.semanticui.elements.icon.IconShorthand import react.semanticui.elements.icon.Icon.IconProps final case class MenuItem( @@ -24,7 +24,7 @@ final case class MenuItem( disabled: js.UndefOr[Boolean] = js.undefined, fitted: js.UndefOr[MenuItemFitted] = js.undefined, header: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[Icon] = 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, @@ -83,7 +83,7 @@ object MenuItem { var header: js.UndefOr[Boolean] = js.native /** Item can be only icon. */ - var icon: js.UndefOr[suiraw.SemanticShorthandItem[IconProps]] = + var icon: js.UndefOr[suiraw.SemanticShorthandItemSB[IconProps]] = js.native /** Item index inside Menu. */ @@ -140,7 +140,7 @@ object MenuItem { disabled: js.UndefOr[Boolean] = js.undefined, fitted: js.UndefOr[MenuItemFitted] = js.undefined, header: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[Icon] = 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, @@ -158,7 +158,7 @@ object MenuItem { p.disabled = disabled p.fitted = fitted.toJs p.header = header - p.icon = icon.map(_.props) + p.icon = icon.toJs p.index = index p.link = link p.name = name diff --git a/facade/src/main/scala/react/semanticui/collections/message/Message.scala b/facade/src/main/scala/react/semanticui/collections/message/Message.scala index 32d4abaa..ddabaf65 100644 --- a/facade/src/main/scala/react/semanticui/collections/message/Message.scala +++ b/facade/src/main/scala/react/semanticui/collections/message/Message.scala @@ -11,7 +11,7 @@ import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } import react.semanticui.elements.icon.Icon.IconProps -import react.semanticui.elements.icon.Icon +import react.semanticui.elements.icon.IconShorthand final case class Message( as: js.UndefOr[AsC] = js.undefined, @@ -26,7 +26,7 @@ final case class Message( floating: js.UndefOr[Boolean] = js.undefined, header: js.UndefOr[VdomNode | MessageHeader.MessageHeaderProps] = js.undefined, hidden: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[Icon] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, info: js.UndefOr[Boolean] = js.undefined, list: js.UndefOr[Seq[VdomNode] | MessageList.MessageListProps] = js.undefined, negative: js.UndefOr[Boolean] = js.undefined, @@ -97,7 +97,7 @@ object Message { var hidden: js.UndefOr[Boolean] = js.undefined /** Add an icon by icon name or pass an */ - var icon: js.UndefOr[suiraw.SemanticShorthandItem[IconProps]] = js.undefined + var icon: js.UndefOr[suiraw.SemanticShorthandItemSB[IconProps]] = js.undefined /** A message may be formatted to display information. */ var info: js.UndefOr[Boolean] = js.undefined @@ -174,7 +174,7 @@ object Message { floating: js.UndefOr[Boolean] = js.undefined, header: js.UndefOr[VdomNode | MessageHeader.MessageHeaderProps] = js.undefined, hidden: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[Icon] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, info: js.UndefOr[Boolean] = js.undefined, list: js.UndefOr[Seq[VdomNode] | MessageList.MessageListProps] = js.undefined, negative: js.UndefOr[Boolean] = js.undefined, @@ -198,7 +198,7 @@ object Message { p.floating = floating p.header = header.toRaw p.hidden = hidden - p.icon = icon.map(_.props) + p.icon = icon.toJs p.info = info p.list = list.toRaw p.negative = negative diff --git a/facade/src/main/scala/react/semanticui/elements/button/Button.scala b/facade/src/main/scala/react/semanticui/elements/button/Button.scala index 19539990..fa42a7b7 100644 --- a/facade/src/main/scala/react/semanticui/elements/button/Button.scala +++ b/facade/src/main/scala/react/semanticui/elements/button/Button.scala @@ -13,7 +13,7 @@ import react.semanticui._ import react.semanticui.elements.label.Label.LabelProps import react.semanticui.elements.label.Label import react.semanticui.elements.icon.Icon.IconProps -import react.semanticui.elements.icon.Icon +import react.semanticui.elements.icon.IconShorthand final case class Button( as: js.UndefOr[AsC] = js.undefined, @@ -31,7 +31,7 @@ final case class Button( disabled: js.UndefOr[Boolean] = js.undefined, floated: js.UndefOr[SemanticFloat] = js.undefined, fluid: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[Icon] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, inverted: js.UndefOr[Boolean] = js.undefined, label: js.UndefOr[Label] = js.undefined, labelPosition: js.UndefOr[String] = js.undefined, @@ -69,22 +69,21 @@ object Button { @JSBracketAccess def update(key: String, v: js.Any): Unit = js.native - var as: js.UndefOr[AsT] = js.native - var active: js.UndefOr[Boolean] = js.native - var animated: js.UndefOr[Boolean | String] = js.native - var attached: js.UndefOr[Boolean | String] = js.native - var basic: js.UndefOr[Boolean] = js.native - var children: js.UndefOr[React.Node] = js.native - var circular: js.UndefOr[Boolean] = js.native - var className: js.UndefOr[String] = js.native - var color: js.UndefOr[String] = js.native - var compact: js.UndefOr[Boolean] = js.native - var content: js.UndefOr[suiraw.SemanticShorthandContent] = js.native - var disabled: js.UndefOr[Boolean] = js.native - var floated: js.UndefOr[suiraw.SemanticFLOATS] = js.native - var fluid: js.UndefOr[Boolean] = js.native - var icon: js.UndefOr[suiraw.SemanticShorthandItem[IconProps]] = - js.native + var as: js.UndefOr[AsT] = js.native + var active: js.UndefOr[Boolean] = js.native + var animated: js.UndefOr[Boolean | String] = js.native + var attached: js.UndefOr[Boolean | String] = js.native + var basic: js.UndefOr[Boolean] = js.native + var children: js.UndefOr[React.Node] = js.native + var circular: js.UndefOr[Boolean] = js.native + var className: js.UndefOr[String] = js.native + var color: js.UndefOr[String] = js.native + var compact: js.UndefOr[Boolean] = js.native + var content: js.UndefOr[suiraw.SemanticShorthandContent] = js.native + var disabled: js.UndefOr[Boolean] = js.native + var floated: js.UndefOr[suiraw.SemanticFLOATS] = js.native + var fluid: js.UndefOr[Boolean] = js.native + var icon: js.UndefOr[suiraw.SemanticShorthandItemSB[IconProps]] = js.native var inverted: js.UndefOr[Boolean] = js.native var label: js.UndefOr[suiraw.SemanticShorthandItem[LabelProps]] = js.native var labelPosition: js.UndefOr[String] = js.native @@ -150,7 +149,7 @@ object Button { disabled: js.UndefOr[Boolean] = js.undefined, floated: js.UndefOr[SemanticFloat] = js.undefined, fluid: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[Icon] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, inverted: js.UndefOr[Boolean] = js.undefined, label: js.UndefOr[Label] = js.undefined, labelPosition: js.UndefOr[String] = js.undefined, @@ -181,7 +180,7 @@ object Button { p.disabled = disabled p.floated = floated.toJs p.fluid = fluid - p.icon = icon.map(_.props) + p.icon = icon.toJs p.inverted = inverted p.label = label.map(_.props) p.labelPosition = labelPosition diff --git a/facade/src/main/scala/react/semanticui/elements/header/Header.scala b/facade/src/main/scala/react/semanticui/elements/header/Header.scala index e2681d85..168a0749 100644 --- a/facade/src/main/scala/react/semanticui/elements/header/Header.scala +++ b/facade/src/main/scala/react/semanticui/elements/header/Header.scala @@ -10,6 +10,8 @@ import react.common.style._ import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui._ +import react.semanticui.elements.icon.IconShorthand +import react.semanticui.elements.icon.Icon.IconProps final case class Header( as: js.UndefOr[AsC] = js.undefined, @@ -23,7 +25,7 @@ final case class Header( disabled: js.UndefOr[Boolean] = js.undefined, dividing: js.UndefOr[Boolean] = js.undefined, floated: js.UndefOr[SemanticFloat] = js.undefined, - icon: js.UndefOr[Boolean] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, image: js.UndefOr[Boolean] = js.undefined, inverted: js.UndefOr[Boolean] = js.undefined, size: js.UndefOr[SemanticSize] = js.undefined, @@ -85,7 +87,7 @@ object Header { var floated: js.UndefOr[suiraw.SemanticFLOATS] = js.native /** Add an icon by icon name or pass an Icon. */ - var icon: js.UndefOr[Boolean] = js.native + var icon: js.UndefOr[suiraw.SemanticShorthandItemSB[IconProps]] = js.native /** Add an image by img src or pass an Image. */ var image: js.UndefOr[Boolean] = js.native @@ -141,7 +143,7 @@ object Header { disabled: js.UndefOr[Boolean] = js.undefined, dividing: js.UndefOr[Boolean] = js.undefined, floated: js.UndefOr[SemanticFloat] = js.undefined, - icon: js.UndefOr[Boolean] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, image: js.UndefOr[Boolean] = js.undefined, inverted: js.UndefOr[Boolean] = js.undefined, size: js.UndefOr[SemanticSize] = js.undefined, @@ -160,7 +162,7 @@ object Header { p.disabled = disabled p.dividing = dividing p.floated = floated.toJs - p.icon = icon + p.icon = icon.toJs p.image = image p.inverted = inverted p.size = size.toJs diff --git a/facade/src/main/scala/react/semanticui/elements/icon/package.scala b/facade/src/main/scala/react/semanticui/elements/icon/package.scala index 6ed42667..8e1fa83f 100644 --- a/facade/src/main/scala/react/semanticui/elements/icon/package.scala +++ b/facade/src/main/scala/react/semanticui/elements/icon/package.scala @@ -2,6 +2,8 @@ package react.semanticui.elements import react.common._ import react.semanticui._ +import scala.scalajs.js +import scala.scalajs.js.| package icon { sealed trait IconFlip extends Product with Serializable @@ -36,6 +38,18 @@ package icon { } package object icon { + type IconShorthand = Boolean | String | Icon + + implicit class IconShorthandOpsUndef(icon: js.UndefOr[IconShorthand]) { + def toJs: js.UndefOr[raw.SemanticShorthandItemSB[Icon.IconProps]] = + icon.map(i => + (i: Any) match { + case s: String => s + case b: Boolean => b + case obj: Icon => obj.props + } + ) + } implicit class CopyIconOps(val i: Icon) extends AnyVal { def size(s: SemanticSize): Icon = 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 ce03a3cd..e1458090 100644 --- a/facade/src/main/scala/react/semanticui/elements/input/Input.scala +++ b/facade/src/main/scala/react/semanticui/elements/input/Input.scala @@ -11,7 +11,7 @@ import react.common.style._ import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui._ -import react.semanticui.elements.icon.Icon +import react.semanticui.elements.icon.IconShorthand import react.semanticui.elements.icon.Icon.IconProps final case class Input( @@ -25,7 +25,7 @@ final case class Input( error: js.UndefOr[Boolean] = js.undefined, fluid: js.UndefOr[Boolean] = js.undefined, focus: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[Boolean | Icon] = 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, @@ -90,7 +90,7 @@ object Input { var focus: js.UndefOr[Boolean] = js.native /** Optional Icon to display inside the Input. */ - var icon: js.UndefOr[Boolean | suiraw.SemanticShorthandItem[IconProps]] = js.native + var icon: js.UndefOr[suiraw.SemanticShorthandItemSB[IconProps]] = js.native /** An Icon can appear inside an Input on the left or right. */ var iconPosition: js.UndefOr[String] @@ -144,23 +144,18 @@ object Input { p.error = q.error p.fluid = q.fluid p.focus = q.focus - p.icon = q.icon.map { - (_: Any) match { - case b: Boolean => b - case c: Icon => c.props - } - } - p.iconPosition = q.iconPosition.toJs - p.input = q.input.toJs - p.inverted = q.inverted - p.label = q.label.toJs - p.labelPosition = q.labelPosition.toJs - p.loading = q.loading - p.onChange = (q.onChangeE, q.onChange).toJs - p.size = q.size.toJs - p.tabIndex = q.tabIndex - p.transparent = q.transparent - p.`type` = q.`type` + p.icon = q.icon.toJs + p.iconPosition = q.iconPosition.toJs + p.input = q.input.toJs + p.inverted = q.inverted + p.label = q.label.toJs + p.labelPosition = q.labelPosition.toJs + p.loading = q.loading + p.onChange = (q.onChangeE, q.onChange).toJs + p.size = q.size.toJs + p.tabIndex = q.tabIndex + p.transparent = q.transparent + p.`type` = q.`type` p } 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 a58f354f..44e4bf4e 100644 --- a/facade/src/main/scala/react/semanticui/elements/label/Label.scala +++ b/facade/src/main/scala/react/semanticui/elements/label/Label.scala @@ -10,7 +10,8 @@ import react.common.style._ import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } -import react.semanticui.elements.icon.Icon +import react.semanticui.elements.icon.IconShorthand +import react.semanticui.elements.icon.Icon.IconProps final case class Label( as: js.UndefOr[AsC] = js.undefined, @@ -28,14 +29,14 @@ final case class Label( empty: js.UndefOr[Boolean] = js.undefined, floating: js.UndefOr[Boolean] = js.undefined, horizontal: js.UndefOr[Boolean] = js.undefined, - icon: js.UndefOr[Icon] = 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[Icon] = 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, @@ -77,7 +78,7 @@ object Label { var empty: js.UndefOr[js.Any] = js.native var floating: js.UndefOr[Boolean] = js.native var horizontal: js.UndefOr[Boolean] = js.native - var icon: js.UndefOr[suiraw.SemanticShorthandItem[Icon.IconProps]] = + var icon: js.UndefOr[suiraw.SemanticShorthandItemSB[IconProps]] = js.native var image: js.UndefOr[js.Any] = js.native var onClick: js.UndefOr[js.Function2[ReactMouseEvent, LabelProps, Unit]] = @@ -88,7 +89,7 @@ object Label { /** A label can prompt for an error in your forms. */ var prompt: js.UndefOr[Boolean] - var removeIcon: js.UndefOr[suiraw.SemanticShorthandItem[Icon.IconProps]] = + var removeIcon: js.UndefOr[suiraw.SemanticShorthandItemSB[IconProps]] = js.native var ribbon: js.UndefOr[Boolean | String] = js.native var size: js.UndefOr[suiraw.SemanticSIZES] = js.native @@ -113,13 +114,13 @@ object Label { p.empty = q.empty.map(_.asInstanceOf[js.Any]) p.floating = q.floating p.horizontal = q.horizontal - p.icon = q.icon.map(_.props) + p.icon = q.icon.toJs p.image = q.image.map(_.asInstanceOf[js.Any]) p.onClick = (q.onClickE, q.onClick).toJs p.onRemove = q.onRemove.toJs p.pointing = q.pointing.toJs p.prompt = q.prompt - p.removeIcon = q.removeIcon.map(_.props) + p.removeIcon = q.removeIcon.toJs p.ribbon = q.ribbon.toJs p.size = q.size.toJs p.tag = q.tag diff --git a/facade/src/main/scala/react/semanticui/modules/dropdown/Dropdown.scala b/facade/src/main/scala/react/semanticui/modules/dropdown/Dropdown.scala index 1abdda92..d57d4ee3 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/Dropdown.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/Dropdown.scala @@ -13,7 +13,7 @@ import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui.raw._ import react.semanticui.elements.icon.Icon.IconProps -import react.semanticui.elements.icon.Icon +import react.semanticui.elements.icon.IconShorthand import react.semanticui.elements.label.Label import react.semanticui._ @@ -44,7 +44,7 @@ final case class Dropdown( floating: js.UndefOr[Boolean] = js.undefined, fluid: js.UndefOr[Boolean] = js.undefined, header: js.UndefOr[VdomNode] = js.undefined, - icon: js.UndefOr[Icon] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, inline: js.UndefOr[Boolean] = js.undefined, item: js.UndefOr[Boolean] = js.undefined, labeled: js.UndefOr[Boolean] = js.undefined, @@ -240,7 +240,7 @@ object Dropdown { var header: js.UndefOr[React.Node] = js.native /** Shorthand for Icon. */ - var icon: js.UndefOr[suiraw.SemanticShorthandItem[IconProps]] = js.native + var icon: js.UndefOr[suiraw.SemanticShorthandItemSB[IconProps]] = js.native /** A dropdown can be formatted to appear inline in other content. */ var inline: js.UndefOr[Boolean] = js.native @@ -529,7 +529,7 @@ object Dropdown { floating: js.UndefOr[Boolean] = js.undefined, fluid: js.UndefOr[Boolean] = js.undefined, header: js.UndefOr[VdomNode] = js.undefined, - icon: js.UndefOr[Icon] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, inline: js.UndefOr[Boolean] = js.undefined, item: js.UndefOr[Boolean] = js.undefined, labeled: js.UndefOr[Boolean] = js.undefined, @@ -615,7 +615,7 @@ object Dropdown { p.floating = floating p.fluid = fluid p.header = header.toJs - p.icon = icon.map(_.props) + p.icon = icon.toJs p.inline = inline p.item = item p.labeled = labeled diff --git a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownHeader.scala b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownHeader.scala index 5eec888d..0d27c75b 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownHeader.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownHeader.scala @@ -2,7 +2,6 @@ package react.semanticui.modules.dropdown import scala.scalajs.js import js.annotation._ -import js.| import japgolly.scalajs.react._ import japgolly.scalajs.react.raw.React import japgolly.scalajs.react.vdom.VdomNode @@ -11,17 +10,17 @@ import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui.raw._ import react.semanticui.elements.icon.Icon.IconProps -import react.semanticui.elements.icon.Icon +import react.semanticui.elements.icon.IconShorthand import react.semanticui._ final case class DropdownHeader( - 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, - icon: js.UndefOr[VdomNode | Icon] = js.undefined, - override val children: CtorType.ChildrenArgs = Seq.empty + 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, + icon: js.UndefOr[IconShorthand] = js.undefined, + override val children: CtorType.ChildrenArgs = Seq.empty ) extends GenericComponentPC[DropdownHeader.DropdownHeaderProps] { override def cprops = DropdownHeader.props(this) @inline def renderWith = DropdownHeader.component(DropdownHeader.props(this)) @@ -57,26 +56,26 @@ object DropdownHeader { var content: js.UndefOr[SemanticShorthandContent] = js.native /** Shorthand for Icon. */ - var icon: js.UndefOr[suiraw.SemanticShorthandItem[IconProps]] = js.native + var icon: js.UndefOr[suiraw.SemanticShorthandItemSB[IconProps]] = js.native } def props(q: DropdownHeader): DropdownHeaderProps = rawprops(q.as, q.child, q.className, q.clazz, q.content, q.icon) def rawprops( - as: js.UndefOr[AsC] = js.undefined, - children: js.UndefOr[VdomNode] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - content: js.UndefOr[VdomNode] = js.undefined, - icon: js.UndefOr[VdomNode | Icon] = js.undefined + as: js.UndefOr[AsC] = js.undefined, + children: js.UndefOr[VdomNode] = js.undefined, + className: js.UndefOr[String] = js.undefined, + clazz: js.UndefOr[Css] = js.undefined, + content: js.UndefOr[VdomNode] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined ): DropdownHeaderProps = { val p = as.toJsObject[DropdownHeaderProps] p.as = as.toJs p.children = children.toJs p.className = (className, clazz).toJs p.content = content.toJs - p.icon = toRawOrPropsP(icon) + p.icon = icon.toJs p } 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 fbdae7ef..c58a7fec 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownItem.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownItem.scala @@ -13,7 +13,7 @@ import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui.raw._ import react.semanticui.elements.icon.Icon.IconProps -import react.semanticui.elements.icon.Icon +import react.semanticui.elements.icon.IconShorthand import react.semanticui.elements.flag.Flag.FlagProps import react.semanticui.elements.flag.Flag import react.semanticui.elements.label.Label.LabelProps @@ -32,7 +32,7 @@ final case class DropdownItem( description: js.UndefOr[String] = js.undefined, disable: js.UndefOr[Boolean] = js.undefined, flag: js.UndefOr[VdomNode | Flag] = js.undefined, - icon: js.UndefOr[VdomNode | Icon] = js.undefined, + icon: js.UndefOr[IconShorthand] = js.undefined, image: js.UndefOr[VdomNode | Image] = js.undefined, label: js.UndefOr[VdomNode | Label] = js.undefined, onClickE: js.UndefOr[DropdownItem.OnClick] = js.undefined, @@ -88,7 +88,7 @@ object DropdownItem { var flag: js.UndefOr[suiraw.SemanticShorthandItem[FlagProps]] = js.native /** Shorthand for Icon. */ - var icon: js.UndefOr[suiraw.SemanticShorthandItem[IconProps]] = js.native + var icon: js.UndefOr[suiraw.SemanticShorthandItemSB[IconProps]] = js.native /** Shorthand for Image. */ var image: js.UndefOr[suiraw.SemanticShorthandItem[ImageProps]] = js.native @@ -129,7 +129,7 @@ object DropdownItem { p.description = q.description p.disable = q.disable p.flag = toRawOrPropsP(q.flag) - p.icon = toRawOrPropsP(q.icon) + p.icon = q.icon.toJs p.image = fnToRawOrProps(q.image) p.label = toRawOrProps(q.label) p.onClick = (q.onClickE, q.onClick).toJs diff --git a/facade/src/main/scala/react/semanticui/package.scala b/facade/src/main/scala/react/semanticui/package.scala index 06d695c0..01bdd0d1 100644 --- a/facade/src/main/scala/react/semanticui/package.scala +++ b/facade/src/main/scala/react/semanticui/package.scala @@ -230,6 +230,7 @@ package object semanticui type SemanticVERTICALALIGNMENTS = String type SemanticShorthandContent = React.Node type SemanticShorthandItem[T] = React.Node | T + type SemanticShorthandItemSB[T] = String | Boolean | SemanticShortHandItem[T] type SemanticShorthandArray[T] = js.Array[SemanticShorthandItem[T]] type SemanticShorthandOrArray[T] = js.Array[React.Node] | T From bb334b0ffe956bab03c9a9c77dc30eecee1653c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Piaggio?= Date: Tue, 10 Mar 2020 14:05:41 -0300 Subject: [PATCH 2/2] Upgrade to (GitHub) actions/checkout@v2. --- .github/workflows/release.yml | 2 +- .github/workflows/scala.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index abd1bd0a..e871f71f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: olafurpg/setup-scala@v2 - uses: olafurpg/setup-gpg@v2 - name: Publish diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index 0433217b..42a8bf9e 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up JDK 1.8 uses: olafurpg/setup-scala@v2 with: