feat: add indexmap dependency
This commit is contained in:
1 parent
04ba0ff1ea
commit
0816f2da8b
4 files changed
+9
-3
No files matched your search
Generated
+3
@@ -1869,6 +1869,8 @@ checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"hashbrown 0.16.1",
|
"hashbrown 0.16.1",
|
||||||
|
"serde",
|
||||||
|
"serde_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3026,6 +3028,7 @@ dependencies = [
|
|||||||
"chrono",
|
"chrono",
|
||||||
"console_error_panic_hook",
|
"console_error_panic_hook",
|
||||||
"icondata",
|
"icondata",
|
||||||
|
"indexmap",
|
||||||
"leptos",
|
"leptos",
|
||||||
"leptos_animate",
|
"leptos_animate",
|
||||||
"leptos_axum",
|
"leptos_axum",
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ macros = { path = "./macros" }
|
|||||||
traits = { path = "./traits" }
|
traits = { path = "./traits" }
|
||||||
icondata = { version = "0.7.0", features = ["font-awesome"] }
|
icondata = { version = "0.7.0", features = ["font-awesome"] }
|
||||||
leptos_icons = "0.7.1"
|
leptos_icons = "0.7.1"
|
||||||
|
indexmap = { version = "2.13.0", features = ["serde"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["ssr"]
|
default = ["ssr"]
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use indexmap::IndexMap;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
@@ -67,7 +68,7 @@ pub struct SchemaNode {
|
|||||||
pub item_template: Option<Box<SchemaNode>>,
|
pub item_template: Option<Box<SchemaNode>>,
|
||||||
/// When used with a SchemaType::Map, this determines what children from the map are displayed
|
/// When used with a SchemaType::Map, this determines what children from the map are displayed
|
||||||
/// and how. It is ignored with all other SchemaType variants.
|
/// and how. It is ignored with all other SchemaType variants.
|
||||||
pub children: HashMap<String, SchemaNode>,
|
pub children: IndexMap<String, SchemaNode>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SchemaNode {
|
impl SchemaNode {
|
||||||
@@ -76,7 +77,7 @@ impl SchemaNode {
|
|||||||
data_type,
|
data_type,
|
||||||
header: "".to_string(),
|
header: "".to_string(),
|
||||||
item_template: None,
|
item_template: None,
|
||||||
children: HashMap::new(),
|
children: IndexMap::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use crate::common::{SchemaNode, SchemaType, ValueType};
|
use crate::common::{SchemaNode, SchemaType, ValueType};
|
||||||
use leptos::prelude::*;
|
use leptos::prelude::*;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use indexmap::IndexMap;
|
||||||
use leptos::logging::debug_log;
|
use leptos::logging::debug_log;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
@@ -134,7 +135,7 @@ fn ListDisplay(
|
|||||||
fn MapDisplay(
|
fn MapDisplay(
|
||||||
#[prop(into)] value: Signal<ValueType>,
|
#[prop(into)] value: Signal<ValueType>,
|
||||||
#[prop(into)] header: Signal<String>,
|
#[prop(into)] header: Signal<String>,
|
||||||
#[prop(into)] schema: Signal<HashMap<String, SchemaNode>>,
|
#[prop(into)] schema: Signal<IndexMap<String, SchemaNode>>,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
// Unwrap the value and check if it is the correct type. It must be a ValueType::Map.
|
// Unwrap the value and check if it is the correct type. It must be a ValueType::Map.
|
||||||
let display_map = Memo::new(move |_| {
|
let display_map = Memo::new(move |_| {
|
||||||
|
|||||||
Reference in new issue
Block a user