👑 tui-rs framework to build stateful applications with a React/Elm inspired approach
Released on 25/11/2021
Yet, another update 🙄
lock_subs()
and unlock_subs()
methods.
lock_subs()
is called, events won't be anymore propagated to subscriptions as long as unlock_subs()
is not called.Id
to HasAttr
and HasState
sub clauses.IsMounted(Id)
sub clauseReleased on 03/08/2021
Yet another update...
0.16
and crossterm 0.20
❗
You can now set the block title alignment
title
to Props
BlockTitle
type in Props
, which is made up of text
and alignment
. Use this instead of setting title in own
map🔴 A really bad new in Msg
matching 😭
in crossterm 0.20
to solve an issue they removed the #[derive(Eq, PartialEq)]
from KeyEvent
.
This has now caused an issue when matching against OnKey
events:
error: to use a constant of type `KeyEvent` in a pattern, `KeyEvent` must be annotated with `#[derive(PartialEq, Eq)]`
To solve this issue you must from now on use a guard match to match keys:
fn update(model: &mut Model, view: &mut View, msg: Option<(String, Msg)>) -> Option<(String, Msg)> {
let ref_msg: Option<(&str, &Msg)> = msg.as_ref().map(|(s, msg)| (s.as_str(), msg));
match ref_msg {
None => None, // Exit after None
Some(msg) => match msg {
(COMPONENT_COUNTER1, key) if key == &MSG_KEY_TAB => {
view.active(COMPONENT_COUNTER2);
None
}
(COMPONENT_COUNTER2, key) if key == &MSG_KEY_TAB => {
view.active(COMPONENT_COUNTER1);
None
}
(_, key) if key == &MSG_KEY_ESC => {
// Quit on esc
model.quit();
None
}
_ => None,
},
}
}
Released on 31/07/2021
Alignment
Dataset
Shape
Style
Table
TextSpan
unwrap_{type}()
helpers for PropPayload
and PropValue
Color
from PropValue
, use palette
instead ❗TextParts
from Props
, use own
properties instead ❗TextSpanBuilder
, you can just use the same methods on TextSpan
when creating it ❗Canvas
to Frame
❗with-components
feature ❗