Skip to content

Commit 0b438cf

Browse files
feat(core): add query parameter to input value
1 parent 634eb94 commit 0b438cf

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

packages/core/shield/src/form.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub struct Input {
2222
#[serde(tag = "type", rename_all = "kebab-case")]
2323
pub enum InputValue {
2424
Origin,
25+
Query { key: String },
2526
String { value: String },
2627
}
2728

packages/styles/shield-bootstrap/src/dioxus/input.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ pub fn FormInput(props: FormInputProps) -> Element {
2727
name: props.input.name,
2828
type: props.input.r#type.as_str(),
2929
value: props.input.value.map(|value| match value {
30-
InputValue::Origin => todo!(),
30+
InputValue::Origin => todo!("origin"),
31+
InputValue::Query {key} => todo!("query parameter `{key}`"),
3132
InputValue::String { value } => value.clone(),
3233
}),
3334
placeholder: props.input.label,

packages/styles/shield-bootstrap/src/leptos/input.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ fn Control(input: Input) -> impl IntoView {
2929
name=format!("data[{}]", input.name)
3030
r#type=input.r#type.as_str()
3131
value=input.value.map(|value| match value {
32-
InputValue::Origin => todo!(),
32+
InputValue::Origin => todo!("origin"),
33+
InputValue::Query {key} => todo!("query parameter `{key}`"),
3334
InputValue::String { value } => value.clone(),
3435
})
3536
placeholder=input.label

0 commit comments

Comments
 (0)