PopUpButton
This view will display as a button. Upon tapping on the button, a pop-up will be triggered. You can customize the pop-up view as you like.
JSON Format
{
"type": "popUpButton",
"id": ...,
"type": ...,
"margin_left": ...,
"margin_right": ...,
"margin_top": ...,
"margin_bottom": ...,
"is_visible": ...,
"validation_message": ...,
"text": ...,
"icon": ...,
"pop_up_view": ...,
"pop_up_title": ...,
"pop_up_type": ...,
"display_cancel_button": ...,
"cancel_text": ...,
"display_save_button": ...,
"save_text": ...,
"should_persist_on_save": ...,
"extra_buttons": ...,
"in_edit_mode": ...,
"dismissible": ...
}
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | String | ✓ | A unique identifier for the view. You can use it to reference view values in stat formulas by doing $view.view_id (where view_id is the id that was assigned to this view by you in the system definition) |
type | RPGViewType | ✓ | The type of this view. Note that these are all in camelCase. |
margin_left | double | Optional. How much margin to add to the left of this view. | |
margin_right | double | Optional. How much margin to add to the right of this view. | |
margin_top | double | Optional. How much margin to add to the top of this view. | |
margin_bottom | double | Optional. How much margin to add to the bottom of this view. | |
is_visible | StatFormulaComponent | Optional. A formula to specify if the view should be visible or not. Must return a bool. | |
validation_message | StatFormulaComponent | Optional. If this view is an input, you can define this formula to return a message when the input value is invalid. If the input is valid, you should return null. Otherwise, make the formula return the string that should be shown to the user. | |
text | StatFormulaComponent | A formula for the text to display in the button. Either this property or icon need to be provided. | |
icon | RPGView | The icon to display in the button. It has to be an Icon view. Trying to display a non-icon view will simply not work. | |
pop_up_view | RPGView | ✓ | The RPGView to be displayed as content for the pop up. |
pop_up_title | StatFormulaComponent | ✓ | The title for the pop up. This stat formula must compute to a string. |
pop_up_type | PopUpType | ✓ | Optional. The type for the pop up. If not specified, it will default to bottom sheet. |
display_cancel_button | bool | ✓ | Optional. Defaults to true. Whether to display a cancel button or not. |
cancel_text | StatFormulaComponent | Optional. Defaults to a stat formula that returns "Cancel". A stat formula returning a string to display as text in the cancel button. | |
display_save_button | bool | ✓ | Optional. Defaults to false. Whether to display a save button or not. If this is false but a save_text is provided, the text will override this value and the save button will display. |
save_text | StatFormulaComponent | Optional. Defaults to a stat formula that returns "Save". A stat formula returning a string to display as text in the save button. | |
should_persist_on_save | bool | ✓ | Optional. Defaults to false. Whether or not the given resource should be persisted (saved in the database) upon saving. You would want to set this to true if you are editing a first-level resource. However, if you are editing (for example) a resource within a resource within the character (e.g: an effect, which is in an item, which is in the items stat in the character), you would want to set it as false, as you would want to allow the user to finish editing the whole resource before saving (as they might regret their choices and choose to exit without saving to discard their changes). |
extra_buttons | List<RPGViewBottomSheetExtraButton> | Optional. This allows you to specify an array of buttons to display at the bottom of the pop up. | |
in_edit_mode | bool | Optional. Defaults to false. If the alert should be in edit mode by default. This might be particularly helpful if you are using it to display Stat RPGViews and want to allow the user to edit them. | |
dismissible | bool | Optional. Indicates if the alert should be dismissible by tapping outside of it. If not provided, it will default to dismissible if there is no save button nor save button text specified, and it will default to non-dismissible if there is to prevent the user from accidentally dismissing a sheet in which they were working. |