diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-04-06 18:55:25 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-04-06 18:55:58 +0200 |
commit | d4d20533556928f63c8759437f67e76336bab55e (patch) | |
tree | 34e7bb151b5d21497665131b6ab8d875254e7666 /sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt | |
parent | Refactoring in GameScene.kt (diff) | |
download | seven-wonders-d4d20533556928f63c8759437f67e76336bab55e.tar.gz seven-wonders-d4d20533556928f63c8759437f67e76336bab55e.tar.bz2 seven-wonders-d4d20533556928f63c8759437f67e76336bab55e.zip |
Delete old React/TypeScript UI
Diffstat (limited to 'sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt')
-rw-r--r-- | sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt b/sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt deleted file mode 100644 index da6b6914..00000000 --- a/sw-ui-kt/src/main/kotlin/blueprintjsHelpers.kt +++ /dev/null @@ -1,137 +0,0 @@ -package com.palantir.blueprintjs - -import org.w3c.dom.events.Event -import org.w3c.dom.events.MouseEvent -import react.RBuilder -import react.RHandler -import react.ReactElement - -typealias IconName = String - -fun RBuilder.bpIcon( - name: IconName, - size: Int = Icon.SIZE_STANDARD, - intent: Intent = Intent.NONE, - title: String? = null, - alt: String? = null, - className: String? = null, - block: RHandler<IIconProps> = {} -): ReactElement = child(Icon::class) { - attrs { - this.icon = name - this.iconSize = size - this.htmlTitle = title - this.intent = intent - this.title = alt - this.className = className - } - block() -} - -fun RBuilder.bpButton( - minimal: Boolean = false, - small: Boolean = false, - large: Boolean = false, - disabled: Boolean = false, - title: String? = null, - icon: IconName? = null, - rightIcon: IconName? = null, - intent: Intent = Intent.NONE, - onClick: ((event: MouseEvent) -> Unit)? = {}, - block: RHandler<IButtonProps> = {} -): ReactElement = child(Button::class) { - attrs { - this.title = title - this.minimal = minimal - this.small = small - this.large = large - this.disabled = disabled - this.icon = icon - this.rightIcon = rightIcon - this.intent = intent - this.onClick = onClick - } - block() -} - -fun RBuilder.bpButtonGroup( - large: Boolean = false, - minimal: Boolean = false, - block: RHandler<IButtonGroupProps> = {} -): ReactElement = child(ButtonGroup::class) { - attrs { - this.large = large - this.minimal = minimal - } - block() -} - -fun RBuilder.bpInputGroup( - large: Boolean = false, - placeholder: String = "", - rightElement: ReactElement? = null, - onChange: (Event) -> Unit -): ReactElement = child(InputGroup::class) { - attrs { - this.large = large - this.placeholder = placeholder - this.rightElement = rightElement - this.onChange = onChange - } -} - -fun RBuilder.bpTag( - intent: Intent? = null, - minimal: Boolean? = null, - active: Boolean? = null, - block: RHandler<ITagProps> = {} -): ReactElement = child(Tag::class) { - attrs { - this.intent = intent - this.minimal = minimal - this.active = active - } - block() -} - -fun RBuilder.bpNonIdealState( - icon: IconName? = null, - title: ReactElement? = null, - description: ReactElement? = null, - action: ReactElement? = null, - children: ReactElement? = null, - block: RHandler<INonIdealStateProps> = {} -): ReactElement = child(NonIdealState::class) { - attrs { - this.icon = icon - this.title = title - this.description = description - this.action = action - this.children = children - } - block() -} - -fun RBuilder.bpOverlay( - isOpen: Boolean, - autoFocus: Boolean = true, - enforceFocus: Boolean = true, - usePortal: Boolean = true, - hasBackdrop: Boolean = true, - canEscapeKeyClose: Boolean = true, - canOutsideClickClose: Boolean = true, - onClose: () -> Unit = {}, - block: RHandler<IOverlayProps> = {} -): ReactElement = child(Overlay::class) { - attrs { - this.isOpen = isOpen - this.autoFocus = autoFocus - this.enforceFocus = enforceFocus - this.usePortal = usePortal - this.hasBackdrop = hasBackdrop - this.canEscapeKeyClose = canEscapeKeyClose - this.canOutsideClickClose = canOutsideClickClose - this.onClose = { onClose() } - } - block() -} |