Component Name
Json
Builder Function Name
create_json_manager
Description
manages json data for viewing and (optionally) editing, with features like expanding/collapsing nested objects and uploading/importing data
Use like example
Config
Property | Type | Default | Description |
---|---|---|---|
val | any | the initial json object/array/value to display or edit | |
is_popover | boolean | false | if true, the json viewer/editor is placed in a popover |
is_edit_mode | boolean | false | if true, displays editing controls (upload, full-edit popover, etc.) |
is_show_buttons | boolean | false | if true, shows collapse, expand, copy, etc. buttons in the interface |
label | string | optional label text to show above the json viewer | |
indentation | number | 1 | indentation or nesting offset for the displayed structure |
on_finish | function | called when the user taps the 'finish' button in the popover, receives the final json value |
Methods
Method | Description | Parameters | Returns |
---|---|---|---|
set_val | replaces the json with a new object/array/value, reprocessing into nested form | input: any | void |
init | initializes the manager, sets up popovers, buttons, file inputs, etc. | config: object | void |
Returned Properties
Property | Type | Description |
---|---|---|
id | string | unique id for this json manager instance |
val | any | the fully processed json value representing the user's final object/array or primitive |
label | string | optional label for the json viewer/editor |
popover_manager | object | manages the main popover if is_popover is true |
popover_toggle_button_manager | object | button manager to open/close the popover if is_popover is true |
is_popover | boolean | if true, the json editor is displayed in a popover |
json_prepped | object | internal nested representation of the json data structure |
file_input_manager | object | manages file input for uploading JSON or CSV |
data_upload_popover_manager | object | popover manager for the 'edit full json' text area |
edit_json_button_manager | object | button manager opening the data_upload_popover_manager |
data_text_input_manager | object | text input manager for the raw json text/csv content |
collapse_all_button_manager | object | button manager that collapses all nested objects/arrays |
expand_all_button_manager | object | button manager that expands all nested objects/arrays |
copy_json_button_manager | object | button manager that copies the final json to clipboard |
is_show_buttons | boolean | if true, shows the top row of collapse/expand/copy/etc. controls |
is_edit_mode | boolean | if true, user can directly edit nested items or the entire json |
finish_data_upload_button_manager | object | button manager that finalizes the raw text input from the data_upload_popover |
finish_button_manager | object | button manager that calls on_finish and closes the main popover |