2020-05-16 19:26:28 +03:00
|
|
|
package ringui
|
|
|
|
|
|
|
|
import react.RBuilder
|
|
|
|
import react.RHandler
|
|
|
|
import react.dom.WithClassName
|
|
|
|
|
|
|
|
// https://github.com/JetBrains/ring-ui/blob/master/components/alert/alert.js
|
2021-05-09 11:11:21 +03:00
|
|
|
public external interface AlertProps : WithClassName {
|
|
|
|
public var timeout: Number
|
|
|
|
public var onCloseRequest: () -> Unit
|
|
|
|
public var onClose: () -> Unit
|
|
|
|
public var isShaking: Boolean
|
|
|
|
public var isClosing: Boolean
|
|
|
|
public var inline: Boolean
|
|
|
|
public var showWithAnimation: Boolean
|
|
|
|
public var closeable: Boolean
|
|
|
|
public var type: AlertType
|
2020-05-16 19:26:28 +03:00
|
|
|
}
|
|
|
|
|
2021-05-09 11:11:21 +03:00
|
|
|
public typealias AlertType = String
|
2020-05-16 19:26:28 +03:00
|
|
|
|
2021-05-09 11:11:21 +03:00
|
|
|
public object AlertTypes {
|
|
|
|
public var ERROR = "error"
|
|
|
|
public var MESSAGE = "message"
|
|
|
|
public var SUCCESS = "success"
|
|
|
|
public var WARNING = "warning"
|
|
|
|
public var LOADING = "loading"
|
2020-05-16 19:26:28 +03:00
|
|
|
}
|
|
|
|
|
2021-05-09 11:11:21 +03:00
|
|
|
public fun RBuilder.ringAlert(handler: RHandler<AlertProps>) {
|
2020-05-16 19:26:28 +03:00
|
|
|
RingUI.Alert {
|
|
|
|
handler()
|
|
|
|
}
|
|
|
|
}
|