Methods
alertTemplate(options) → {string}
Generates the markup for an alert in the admin.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.16
- Source
- Type:
- string
import { alertTemplate } from '@gravityforms/components/html/admin/elements/Alert';
function Example() {
const alertTemplateHTML = alertTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', alertTemplateHTML );
}
bindEvents()
Bind event handlers
buttonTemplate(options) → {string}
The template function used to generate our button html.
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options object for the class. Properties
|
- Since
- 1.0.5
- Source
The button html.
- Type:
- string
import { buttonTemplate } from '@gravityforms/components/html/admin/elements/Button';
function Example() {
const buttonHTML = buttonTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', buttonHTML );
}
cleanUp()
Clears timeouts and does all needed garbage cleanup.
- Source
close()
Animates out the snackbar and then removes it from dom.
- Source
dialogTemplate(options)
The template function that returns html for the dialog. Options below are passed from constructor and described there.
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the dialog. Properties
|
- Since
- 1.0.6
- Source
string
import { dialogTemplate } from '@gravityforms/components/html/admin/modules/Dialog';
function Example() {
const dialogHTML = dialogTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', dialogHTML );
}
dropdownTemplate(options) → {string}
Generates the markup for a dropdown in the admin.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.16
- Type:
- string
import { dropdownTemplate } from '@gravityforms/components/html/admin/elements/Dropdown';
function Example() {
const dropdownTemplateHTML = dropdownTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', dropdownTemplateHTML );
}
flyoutTemplate(options) → {string}
The template function that returns html for the flyout. Options below are passed from constructor and described there.
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the flyout. Properties
|
- Since
- 1.0.5
- Source
- Type:
- string
import { flyoutTemplate } from '@gravityforms/components/html/admin/modules/Flyout';
function Example() {
const flyoutTemplateHTML = flyoutTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', flyoutTemplateHTML );
}
headingTemplate(options) → {string}
Generates the markup for a Heading Element in the admin.
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the heading component. Properties
|
- Since
- 2.2.0
- Source
- Type:
- string
import { headingTemplate } from '@gravityforms/components/html/admin/elements/Heading';
function Example() {
const headingTemplateHTML = headingTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', headingTemplateHTML );
}
helpTextTemplate(id, helpText) → {string}
The markup for form field helper text.
Name | Type | Description |
---|---|---|
id | string | Optional id. Auto generated if not passed. |
helpText | string | Optional helper text. |
- Since
- 1.1.18
- Type:
- string
helpTextTemplate(options) → {string}
The help text template function, can be used when not needing events or a help text instance.
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the select component. Properties
|
- Since
- 2.2.0
- Source
The html for the help text component.
- Type:
- string
init() → {void}
Initialize the component.
- Since
- 1.0.0
- Source
- Type:
- void
init() → {void}
Initialize the heading.
- Since
- 2.2.0
- Type:
- void
init() → {void}
Initialize the help text.
- Since
- 2.2.0
- Type:
- void
init() → {void}
Initialize the label.
- Since
- 2.2.0
- Source
- Type:
- void
init() → {void}
Initialize the text.
- Since
- 2.2.0
- Source
- Type:
- void
init()
Initialize and execute a snackbar.
inputTemplate(options) → {string}
Generates the markup for a input in the admin.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.16
- Source
- Type:
- string
import { inputTemplate } from '@gravityforms/components/html/admin/elements/Input';
function Example() {
const inputTemplateHTML = inputTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', inputTemplateHTML );
}
labelTemplate(id, label, labelCustomAttributes, labelCustomClasses, labelVisible) → {string}
The markup for form field label.
Name | Type | Description |
---|---|---|
id | string | Optional id. Auto generated if not passed. |
label | string | Label for the textarea. |
labelCustomAttributes | object | Any custom attributes for the label. |
labelCustomClasses | Array | Any custom classes for the label. |
labelVisible | boolean | If the label should be visible. Defaults to true. |
- Since
- 1.1.18
- Type:
- string
labelTemplate(options) → {string}
Generates the markup for a Label Element in the admin.
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the label component. Properties
|
- Since
- 2.2.0
- Source
The html for the label component.
- Type:
- string
import { labelTemplate } from '@gravityforms/components/html/admin/elements/Label';
function Example() {
const labelTemplateHTML = labelTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', labelTemplateHTML );
}
linkTemplate(options) → {string}
Generates the markup for a link in the admin.
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.16
- Source
- Type:
- string
import { linkTemplate } from '@gravityforms/components/html/admin/elements/Link';
function Example() {
const linkTemplateHTML = linkTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', linkTemplateHTML );
}
loaderTemplate(options) → {string}
Generates the markup for a loader in the admin.
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.16
- Source
- Type:
- string
import { loaderTemplate } from '@gravityforms/components/html/admin/elements/Loader';
function Example() {
const loaderTemplateHTML = loaderTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', loaderTemplateHTML );
}
render() → {void}
Renders the component into the dom.
- Since
- 1.0.0
- Source
- Type:
- void
render() → {string}
Renders the heading into the dom.
- Since
- 2.2.0
- Type:
- string
render() → {void}
Renders the box into the dom.
- Since
- 2.2.0
- Type:
- void
render() → {void}
Renders the label into the dom.
- Since
- 2.2.0
- Source
- Type:
- void
render() → {string}
Renders the text into the dom.
- Since
- 2.2.0
- Source
- Type:
- string
render()
Renders the snackbar in the passed container option.
reveal()
Reveals the snackbar and if autohide true it starts the hide timer. If speak is true, announces the message as well to screenreaders.
selectTemplate(options) → {string}
A select component to use wherever a simple select is needed.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the select component. Properties
|
- Since
- 2.2.0
- Source
The html for the select component.
- Type:
- string
import { selectTemplate } from '@gravityforms/components/html/admin/elements/Select';
function Example() {
const selectTemplateHTML = selectTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', selectTemplateHTML );
}
setOptions()
Merges the default options with the passed args.
snackBarHtml() → {string}
Uses our options to render the snackbar.
- Source
The html for the snackbar.
- Type:
- string
stackedIconTemplate(options) → {string}
Generates the markup for a stackedIcon in the admin.
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.16
- Type:
- string
import { stackedIconTemplate } from '@gravityforms/components/html/admin/elements/StackedIcon';
function Example() {
const stackedIconTemplateHTML = stackedIconTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', stackedIconTemplateHTML );
}
statusIndicatorTemplate(options) → {string}
Generates the markup for a statusIndicator in the admin.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.16
- Type:
- string
import { statusIndicatorTemplate } from '@gravityforms/components/html/admin/elements/StatusIndicator';
function Example() {
const statusIndicatorTemplateHTML = statusIndicatorTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', statusIndicatorTemplateHTML );
}
textTemplate(options) → {string}
A text component to use wherever texts are needed.
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the text component template. Properties
|
- Since
- 2.2.0
- Source
The html for the text component.
- Type:
- string
import { textTemplate } from '@gravityforms/components/html/admin/elements/Text';
function Example() {
const textTemplateHTML = textTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', textTemplateHTML );
}
textareaTemplate(options) → {string}
The markup for a textarea.
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.18
- module:labelTemplate
- module:helpTextTemplate
- Type:
- string
import { textareaTemplate } from '@gravityforms/components/html/admin/elements/Textarea';
function Example() {
const textareaHTML = textareaTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', textareaHTML );
}
toggleTemplate(options) → {string}
Generates the markup for a toggle in the admin.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.16
- Source
- Type:
- string
import { toggleTemplate } from '@gravityforms/components/html/admin/elements/Toggle';
function Example() {
const toggleHTML = toggleTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', toggleHTML );
}
Events
gform/alert/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/alert/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/button/activated
Fired when an interactive button is activated on document.
- object
Name | Type | Description |
---|---|---|
instance | object | The Button class instance. |
- Source
gform/button/deactivated
Fired when an interactive button is deactivated on document.
- object
Name | Type | Description |
---|---|---|
instance | object | The Button class instance. |
- Source
gform/button/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/button/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/dialog/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.0.6
- Source
gform/dialog/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/dropdown/item_selected
Fired when the component has an item selected in the dropdown list.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
event | object | The Component event object for the list item. |
- Since
- 1.1.16
gform/dropdown/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
gform/dropdown/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
gform/flyout/close
Fired when the flyout closes.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 3.3.7
- Source
gform/flyout/open
Fired when the flyout opens.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 3.3.7
- Source
gform/flyout/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.0.5
- Source
gform/flyout/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/input/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/input/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/link/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/link/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/loader/post_hide
Fired when the component has completed hiding in the dom.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/loader/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/loader/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/stacked_icon/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
gform/stacked_icon/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
gform/status_indicator/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
gform/status_indicator/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
gform/textarea/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
gform/textarea/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
gform/toggle/post_render
Fired when the component has completed rendering and all class init functions have completed.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source
gform/toggle/pre_init
Fired before the component has started any internal init functions. A great chance to augment the options.
- object
Name | Type | Description |
---|---|---|
instance | object | The Component class instance. |
- Since
- 1.1.16
- Source