pub struct KeyValueEditorProps {
pub field: String,
pub label: Option<String>,
pub suggested_keys: Vec<String>,
pub allow_custom_keys: bool,
pub data_path: Option<String>,
pub error: Option<String>,
}Expand description
Props for KeyValueEditor component.
Renders a dynamic list of key/value rows backed by a hidden <input>
that holds the current pairs serialized as a JSON object. The runtime
module key_value_editor wires add/remove/input events and keeps the
hidden field in sync on every mutation.
When data_path resolves to a JSON object, each entry seeds one row.
suggested_keys drives a <datalist> (when allow_custom_keys) or a
<select> (when !allow_custom_keys).
Fields§
§field: StringName of the hidden input that receives the serialized JSON.
label: Option<String>Optional visible label above the editor block.
suggested_keys: Vec<String>Keys offered as suggestions (via <datalist> or <select>).
allow_custom_keys: boolIf true (default), the key input accepts any text with suggestions;
if false, the key input is a <select> restricted to suggested_keys.
data_path: Option<String>JSON pointer path whose resolved object seeds the initial rows.
error: Option<String>Validation error message rendered below the editor.
Trait Implementations§
Source§impl Clone for KeyValueEditorProps
impl Clone for KeyValueEditorProps
Source§fn clone(&self) -> KeyValueEditorProps
fn clone(&self) -> KeyValueEditorProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KeyValueEditorProps
impl Debug for KeyValueEditorProps
Source§impl<'de> Deserialize<'de> for KeyValueEditorProps
impl<'de> Deserialize<'de> for KeyValueEditorProps
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for KeyValueEditorProps
impl JsonSchema for KeyValueEditorProps
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more