FlotiqGlobals¶
class FlotiqGlobals
¶
Properties
Name | Type | Description |
---|---|---|
Jodit |
Jodit |
Jodit editor instance |
toast |
toast |
Toast ui instance |
openModal |
openModal |
Function to open modal |
openSchemaModal |
openSchemaModal |
Function to open modal with form based on schema passed with config |
getPluginSettings |
getPluginSettings |
Function to get settings for the plugin |
getApiUrl |
getApiUrl |
Function to get flotiq api url |
closeModal |
closeModal |
Function to close modal with given id with given result |
function closeModal
¶
Function that will close modal with given id with given result
Returns¶
function getApiUrl
¶
Function that will return the Flotiq API URL.
Returns
- string
Flotiq API URL
function getPluginSettings
¶
Function that will return the plugin setting.
Returns
- string
Plugin settings returned as string.
function openModal
¶
Function that will open the modal With an HTML content managed by the plugin.
See Open custom modal 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 |
class FlotiqModalButton
¶
Modal button config.
Properties
Name | Type | Description |
---|---|---|
key |
string |
Unique button key |
label |
string |
Button label |
color |
'blue' |'blueBordered' |'borderless' |'gray' |'grayBordered' |'redBordered' |
Predefined button colors |
result |
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 |
func |
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 modalwill be resolved with this value, otherwise undefined will be the result. |
class FlotiqModalConfig
¶
Modal properties to generate modal.
Properties
Name | Type | Description |
---|---|---|
title |
string |
Modal title |
content |
null |string |array |number |boolean |HTMLElement |ReactElement |
Modal content |
buttons |
Array.<FlotiqModalButton> |
Modal buttons |
size |
'sm' |'md' |'lg' |'xl' |'2xl' |
Modal predefined size |
hideClose |
boolean |
If close icon should be hidden in the modal. Closing modal will be avaiable only on modal buttons click. |
class FlotiqModalFormConfig
¶
Form properties to generate modal with form.
Properties
Name | Type | Description |
---|---|---|
schema |
object |
Schema object compatible flotiq api. All passed schema gets nonCtdSchema value set on true. |
options |
object |
Additional options passed to settings form |
options.onValidate |
FlotiqPlugins.Form.onValidate |
Custom validate on form data change |
options.onSubmit |
FlotiqPlugins.Form.onSubmit |
Custom submit handler. If not provided on form submission, the modal will be resolved with form values. |
options.disbaledBuildInValidation |
boolean |
If build in validation should be disabled. If not provided on form submission, the validation has to be handled by onValidate option. |
initialData |
object |
Initial data for form |
labels |
object |
Custom labels for modal buttons |
labels.ok |
string |
Custom label for submit button, default: "Ok" |
labels.cancel |
string |
Custom label for cancel button, default: "Cancel" |
class FlotiqSchemaModalConfig
¶
Modal properties with form data to generate modal with form.
Properties
Name | Type | Description |
---|---|---|
title |
string |
Modal title |
size |
'sm' |'md' |'lg' |'xl' |'2xl' |
Modal predefined size |
hideClose |
boolean |
If close icon should be hidden in the modal. Closing modal will be avaiable only on modal buttons click. |
form |
FlotiqModalFormConfig |
Form config |