FlotiqGlobals¶
class FlotiqGlobals¶
Global helpers provided to plugins.
Properties
| Name | Type | Description |
|---|---|---|
Jodit |
JoditPro |
Jodit editor instance. |
toast |
toast |
Toast UI instance. |
getLanguage |
getLanguage | Returns currently selected language. |
openModal |
openModal | Function that will open the modal With an HTML content managed by the plugin. |
openSchemaModal |
openSchemaModal | Function that will open the modal with a form based on the Content Type Definition schema. |
getPluginSettings |
getPluginSettings | Function that will return the plugin setting. |
setPluginSettings |
setPluginSettings | Function that will set the plugin setting. |
getApiUrl |
getApiUrl | Function that will return the Flotiq API URL. |
closeModal |
closeModal | Function that will close modal with given id with given result |
getSpaceId |
getSpaceId | Function that will return the currently entered space ID |
navigate |
navigate | Function to navigate via app router. |
function closeModal¶
Function that will close modal with given id with given result
Returns
- void
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
The id of the modal to close |
result |
any |
The result to return from the modal promise. Can be any data type, including objects and arrays. |
function getApiUrl¶
Function that will return the Flotiq API URL.
Returns
- string
function getLanguage¶
Returns currently selected language.
Returns
- "pl" | "en"
function getPluginSettings¶
Function that will return the plugin setting.
Returns
- string
function getSpaceId¶
Function that will return the currently entered space ID
Returns
- string | null
function navigate¶
Function to navigate via app router.
Returns
- void
Parameters
| Name | Type | Description |
|---|---|---|
url |
string |
The url to navigate to |
function openModal¶
Function that will open the modal With an HTML content managed by the plugin.
See Open custom modal section in our examples. See section in our examples.
Returns
- Promise<any>
Our internal modal system is based on promises. You'll get the modal promise upon creating the modal
and it will be resolved (or rejected) automatically once result button is clicked.
Result can be provided either by using the result field of each button,
or by returning it from onClick method of the button.
Parameters
| Name | Type | Description |
|---|---|---|
config |
FlotiqModalConfig | Modal properties |
function openSchemaModal¶
Function that will open the modal with a form based on the Content Type Definition schema.
See CTD form modal and customized CTD form modal in our examples.
Returns
- Promise<any>
Our internal modal system is based on promises. You'll get the modal promise upon creating the modal
and it will be resolved (or rejected) automatically once result button is clicked.
Result can be provided either by using the result field of each button,
or by returning it from onClick method of the button.
Parameters
| Name | Type | Description |
|---|---|---|
config |
FlotiqSchemaModalConfig | Modal properties |
function setPluginSettings¶
Function that will set the plugin setting.
Returns
- void
Parameters
| Name | Type | Description |
|---|---|---|
settings |
string |
The settings to set. |
class FlotiqModalButton¶
Modal button config.
Properties
| Name | Type | Description |
|---|---|---|
key |
string |
Unique button key |
label |
string |
Button label |
color (optional) |
"blue"|"blueBordered"|"borderless"|"gray"|"grayBordered"|"redBordered" |
Predefined button color |
result (optional) |
any |
Result that will be returned from the modal promise on the button click. You can return any data type, including objects and arrays. |
onClick (optional) |
FlotiqModalButtonOnClick | A callback function that will be called when modal button is clicked. |
function FlotiqModalButtonOnClick¶
Whenever you want to perform some action on button click that is e.g. waiting for some results,
you can use buttons onClick property. If the onClick method will return some result,
the modal will be resolved with this value, otherwise undefined will be the result.
Returns
- any
Parameters
| Name | Type | Description |
|---|---|---|
...args |
any[] |
class FlotiqModalConfig¶
Modal properties to generate modal.
Properties
| Name | Type | Description |
|---|---|---|
id (optional) |
string|number |
Unique modal ID. If not provided, custom id will be generated |
size (optional) |
"page"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl" |
Modal size |
hideClose (optional) |
boolean |
If close button should be hidden |
className (optional) |
string |
Dialog class name |
title (optional) |
string |
Dialog title |
content (optional) |
string |
Dialog content |
buttons (optional) |
FlotiqModalButton[] | Modal buttons |
class FlotiqSchemaModalConfig¶
Modal configuration with form data used by schema-based modals.
Properties
| Name | Type | Description |
|---|---|---|
id (optional) |
string|number |
Unique modal ID. If not provided, custom id will be generated |
size (optional) |
"page"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl" |
Modal size |
hideClose (optional) |
boolean |
If close button should be hidden |
className (optional) |
string |
Dialog class name |
title (optional) |
string |
Dialog title |
form |
SchemaModalFormConfig | Form configuration |