Skip to content

Commit

Permalink
⬆️ Catch up with sap version 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
misherpal authored and sherpal committed Jan 14, 2024
1 parent 2eeafc2 commit d5e1366
Show file tree
Hide file tree
Showing 9 changed files with 277 additions and 72 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ First of all, don't panic. You can do the following things:
These bindings are barely "facades" types for the official UI5 library. They _won't_ work if you don't handle that npm dependency on your own project. You will need the following imports in your `package.json` (or equivalent tool such as scala-js-bundler):

```
"@ui5/webcomponents": "1.19.1",
"@ui5/webcomponents-fiori": "1.19.1",
"@ui5/webcomponents-icons": "1.19.1"
"@ui5/webcomponents": "1.20.1",
"@ui5/webcomponents-fiori": "1.20.1",
"@ui5/webcomponents-icons": "1.20.1"
```

(and thus `npm install` it). Then, you can use any of the components as defined in the `be.doeraene.webcomponents.ui5` package.
Expand Down
72 changes: 36 additions & 36 deletions demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"vite-plugin-html": "3.2.0"
},
"dependencies": {
"@ui5/webcomponents": "1.19.1",
"@ui5/webcomponents-fiori": "1.19.1",
"@ui5/webcomponents-icons": "1.19.1",
"@ui5/webcomponents": "1.20.1",
"@ui5/webcomponents-fiori": "1.20.1",
"@ui5/webcomponents-icons": "1.20.1",
"highlight.js": "^11.6.0"
}
}
36 changes: 18 additions & 18 deletions demo/src/main/scala/demo/IllustratedMessageExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ object IllustratedMessageExample extends Example("IllustratedMessage") {
//-- Begin: Illustrated Message
IllustratedMessage(
_.name := IllustratedMessageType.PageNotFound,
List(
Button(_.design := ButtonDesign.Emphasized, "Action 1"),
Button("Action 2")
)
List(
Button(_.design := ButtonDesign.Emphasized, "Action 1"),
Button("Action 2")
)
)
//-- End
),
Expand All @@ -28,9 +28,9 @@ object IllustratedMessageExample extends Example("IllustratedMessage") {
Button("Open Dialog", _.events.onClick.mapTo(true) --> dialogShowActionBus.writer),
Dialog(
_.headerText := "Error",
inContext(el =>
dialogShowActionBus.events --> Observer[Boolean](if _ then el.ref.show() else el.ref.close())
),
inContext(el =>
dialogShowActionBus.events --> Observer[Boolean](if _ then el.ref.show() else el.ref.close())
),
IllustratedMessage(_.name := IllustratedMessageType.ErrorScreen),
_.slots.footer := Bar(
_.design := BarDesign.Footer,
Expand All @@ -44,17 +44,17 @@ object IllustratedMessageExample extends Example("IllustratedMessage") {
)
//-- End
},
DemoPanel(
"Illustrated Message with link in subtitle")(
//-- Begin: Illustrated Message with sub-title slot
IllustratedMessage(
_.name := IllustratedMessageType.tnt.UnsuccessfulAuth,
_.titleText := "Something wen wrong...",
_.slots.subtitle := div("Please try again or contact us at ", Link("[email protected]"), "."),
Button(_.icon := IconName.refresh, "Try again")
)
//-- End
)
DemoPanel("Illustrated Message with link in subtitle")(
//-- Begin: Illustrated Message with sub-title slot
IllustratedMessage(
_.name := IllustratedMessageType.tnt.UnsuccessfulAuth,
_.titleText := "Something went wrong...",
_.titleLevel := TitleLevel.H4,
_.slots.subtitle := div("Please try again or contact us at ", Link("[email protected]"), "."),
Button(_.icon := IconName.refresh, "Try again")
)
//-- End
)
)

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import be.doeraene.webcomponents.ui5.configkeys.IllustratedMessageType
import com.raquo.laminar.codecs.{BooleanAsAttrPresenceCodec, StringAsIsCodec}
import com.raquo.laminar.api.L.*
import com.raquo.laminar.tags.HtmlTag
import com.raquo.laminar.keys.{HtmlAttr}
import com.raquo.laminar.keys.HtmlAttr
import com.raquo.laminar.nodes.ReactiveHtmlElement
import org.scalajs.dom

import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import be.doeraene.webcomponents.ui5.internal.Slot
import be.doeraene.webcomponents.WebComponent
import be.doeraene.webcomponents.ui5.configkeys.TitleLevel

/** Simple UI button
*
Expand Down Expand Up @@ -42,19 +43,18 @@ object IllustratedMessage extends WebComponent with HasIcon {
lazy val accessibleNameRef: HtmlAttr[String] = htmlAttr("accessible-name-ref", StringAsIsCodec)
lazy val name: HtmlAttr[IllustratedMessageType] =
htmlAttr("name", IllustratedMessageType.AsStringCodec)

/** Alternative to "name" for Scala 2.13 users. */
lazy val nameStr: HtmlAttr[String] = htmlAttr("name", StringAsIsCodec)
lazy val subtitleText: HtmlAttr[String] = htmlAttr("subtitle-text", StringAsIsCodec)
lazy val titleText: HtmlAttr[String] = htmlAttr("title-text", StringAsIsCodec)
lazy val nameStr: HtmlAttr[String] = htmlAttr("name", StringAsIsCodec)
lazy val subtitleText: HtmlAttr[String] = htmlAttr("subtitle-text", StringAsIsCodec)
lazy val titleText: HtmlAttr[String] = htmlAttr("title-text", StringAsIsCodec)
lazy val titleLevel: HtmlAttr[TitleLevel] = htmlAttr("title-level", TitleLevel.AsStringCodec)

object slots {
val subtitle: Slot = new Slot("subtitle")
val title: Slot = new Slot("title")
val title: Slot = new Slot("title")
}

object events {}



}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ import be.doeraene.webcomponents.WebComponent
* @see
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Select/">the doc</a> for more information.
*/
object Select extends WebComponent with HasIcon with HasAccessibleName with HasName {
object Select extends WebComponent with HasIcon with HasAccessibleName with HasName with HasValue {

@js.native
trait RawElement extends js.Object {
def selectedOption: dom.HTMLElement = js.native

def value: String = js.native
}

@js.native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import be.doeraene.webcomponents.ui5.internal.Slot
import com.raquo.laminar.codecs.{BooleanAsAttrPresenceCodec, StringAsIsCodec}
import com.raquo.laminar.api.L.*
import com.raquo.laminar.tags.HtmlTag
import com.raquo.laminar.keys.{HtmlAttr}
import com.raquo.laminar.keys.HtmlAttr
import com.raquo.laminar.nodes.ReactiveHtmlElement
import org.scalajs.dom

import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import be.doeraene.webcomponents.WebComponent
import be.doeraene.webcomponents.ui5.configkeys.LinkTarget

/** The ui5-side-navigation-item is used within ui5-side-navigation only. Via the ui5-side-navigation-item you control
* the content of the SideNavigation.
Expand Down Expand Up @@ -45,12 +46,14 @@ object SideNavigationItem extends WebComponent with HasText {
lazy val wholeItemToggleable: HtmlAttr[Boolean] =
htmlAttr("whole-item-toggleable", BooleanAsAttrPresenceCodec)

lazy val href: HtmlAttr[String] = htmlAttr("href", StringAsIsCodec)

lazy val target: HtmlAttr[LinkTarget] = htmlAttr("target", LinkTarget.AsStringCodec)

object slots {}

object events {}



def subItem: SideNavigationSubItem.type = SideNavigationSubItem

}
Loading

0 comments on commit d5e1366

Please sign in to comment.