nu-table/ Bump tabled version (#6097)

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
Maxim Zhiburt 2022-07-22 18:33:29 +03:00 committed by GitHub
parent c66b97126f
commit 453c11b4b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 18 deletions

16
Cargo.lock generated
View File

@ -3102,11 +3102,13 @@ checksum = "decf7381921fea4dcb2549c5667eda59b3ec297ab7e2b5fc33eac69d2e7da87b"
[[package]]
name = "papergrid"
version = "0.4.0"
source = "git+https://github.com/zhiburt/tabled?rev=f24b945bdd3a1152d52561b70b0c88c2581ac5ff#f24b945bdd3a1152d52561b70b0c88c2581ac5ff"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "453cf71f2a37af495a1a124bf30d4d7469cfbea58e9f2479be9d222396a518a2"
dependencies = [
"ansi-str",
"bytecount",
"fnv",
"strip-ansi-escapes",
"unicode-width",
]
@ -4720,8 +4722,9 @@ dependencies = [
[[package]]
name = "tabled"
version = "0.7.0"
source = "git+https://github.com/zhiburt/tabled?rev=f24b945bdd3a1152d52561b70b0c88c2581ac5ff#f24b945bdd3a1152d52561b70b0c88c2581ac5ff"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5b2f8c37d26d87d2252187b0a45ea3cbf42baca10377c7e7eaaa2800fa9bf97"
dependencies = [
"ansi-str",
"papergrid",
@ -4731,8 +4734,9 @@ dependencies = [
[[package]]
name = "tabled_derive"
version = "0.3.0"
source = "git+https://github.com/zhiburt/tabled?rev=f24b945bdd3a1152d52561b70b0c88c2581ac5ff#f24b945bdd3a1152d52561b70b0c88c2581ac5ff"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9ee618502f497abf593e1c5c9577f34775b111480009ffccd7ad70d23fcaba8"
dependencies = [
"heck 0.4.0",
"proc-macro-error",

View File

@ -16,4 +16,4 @@ nu-ansi-term = "0.46.0"
nu-protocol = { path = "../nu-protocol", version = "0.65.1" }
strip-ansi-escapes = "0.1.1"
atty = "0.2.14"
tabled = { git = "https://github.com/zhiburt/tabled", rev = "f24b945bdd3a1152d52561b70b0c88c2581ac5ff", features = ["color"] }
tabled = { version = "0.8.0", features = ["color"] }

View File

@ -7,7 +7,7 @@ use tabled::{
formatting_settings::AlignmentStrategy,
object::{Cell, Columns, Rows, Segment},
papergrid,
style::BorderColor,
style::Color,
Alignment, AlignmentHorizontal, Modify, ModifyObject, TableOption, Width,
};
@ -205,20 +205,20 @@ fn align_table(
.with(AlignmentStrategy::PerLine),
);
if with_header {
let alignment = Alignment::Horizontal(alignments.header);
if with_footer {
table = table.with(Modify::new(Rows::last()).with(alignment.clone()));
}
table = table.with(Modify::new(Rows::first()).with(alignment));
}
if with_index {
table =
table.with(Modify::new(Columns::first()).with(Alignment::Horizontal(alignments.index)));
}
if with_header {
let alignment = Alignment::Horizontal(alignments.header);
table = table.with(Modify::new(Rows::first()).with(alignment.clone()));
if with_footer {
table = table.with(Modify::new(Rows::last()).with(alignment));
}
}
table = override_alignments(table, data, with_header, with_index, alignments);
table
@ -269,7 +269,7 @@ fn load_theme(
if let Some(color) = color_hm.get("separator") {
let color = color.paint(" ").to_string();
if let Ok(color) = BorderColor::try_from(color) {
if let Ok(color) = Color::try_from(color) {
table = table.with(color);
}
}