Jump to content

Modal: Difference between revisions

No edit summary
Fix Modal documentation error (getTabData)
 
(4 intermediate revisions by 2 users not shown)
Line 65: Line 65:
Setting either dimension to zero will reset that dimension.
Setting either dimension to zero will reset that dimension.


==== modal.setFormTitle(title: <code>String</code>, opts: <code>FormTitleOpts</code>): <code>void</code> ====
==== modal.setFormTitle(title: <code>String</code>, opts?: <code>{ bold?: Boolean, center?: Boolean }</code>): <code>void</code> ====
Set a title or description at the top of the modal.
Set a title or description at the top of the modal.


Line 76: Line 76:
Removes the footer from the modal.
Removes the footer from the modal.


==== modal.setFooterCheckbox(labelName: <code>String</code>, callback: <code>Function</code>, defaultState: <code>Boolean</code>): <code>void</code> ====
==== modal.setFooterCheckbox(labelName: <code>String</code>, callback: <code>Function<any></code>, defaultState: <code>Boolean</code>): <code>void</code> ====
Adds a checkbox to the left section of the footer.
Adds a checkbox to the left section of the footer.


Line 101: Line 101:
Clears a section of the footer.
Clears a section of the footer.


==== modal.onSubmit(callback: <code>Function</code>): <code>void</code> ====
==== modal.onSubmit(callback: <code>Function<any></code>): <code>void</code> ====
Set event callback.
Set event callback.


This will be called whenever the form is submitted.
This will be called whenever the form is submitted.


==== modal.onOpen(callback: <code>Function</code>): <code>void</code> ====
==== modal.onOpen(callback: <code>Function<any></code>): <code>void</code> ====
Set event callback.
Set event callback.


This will be called whenever the form is opened.
This will be called whenever the form is opened.


==== modal.onClose(callback: <code>Function</code>): <code>void</code> ====
==== modal.onClose(callback: <code>Function<any></code>): <code>void</code> ====
Set event callback.
Set event callback.


This will be called whenever the form is closed.
This will be called whenever the form is closed.


==== modal.onTabChange(callback: <code>Function</code>): <code>void</code> ====
==== modal.onTabChange(callback: <code>Function<any></code>): <code>void</code> ====
Set event callback.
Set event callback.


This will be called whenever the tab is changed.
This will be called whenever the tab is changed.


==== modal.checkboxFieldOnInput(callback: <code>Function</code>): <code>void</code> ====
==== modal.checkboxFieldOnInput(callback: <code>Function<any></code>): <code>void</code> ====
Set event callback.
Set event callback.


Line 167: Line 167:
Show tab on the tab bar.
Show tab on the tab bar.


==== modal.getTabData(id: <code>Number</code>): <code>Number | null</code> ====
==== modal.getTabData(id: <code>Number</code>): <code>TabContext | null</code> ====
Return raw tab data.
Return raw tab data.


Line 177: Line 177:


=== Interfaces ===
=== Interfaces ===
CheckboxObj: <code>Object { elm: HTMLLabelElement, cbElm: Function, children: Array<CheckboxObj> }</code>


EntryObj: <code>Object { input: HTMLInputElement }</code>
==== CheckboxObj ====
<syntaxhighlight lang="typescript">
Object {
    elm: HTMLLabelElement,
    cbElm: Function,
    children: Array<CheckboxObj>
}
</syntaxhighlight>
 
==== EntryObj ====
<syntaxhighlight lang="typescript">
Object {
    input: HTMLInputElement
}
</syntaxhighlight>
 
==== FormInputObj ====
<syntaxhighlight lang="typescript">
Object {
    input: HTMLInputElement,
value: String,
validation: "number" | "required",
validationFailed: Boolean,
type: "text" | "color",
label: HTMLLabelElement
}
</syntaxhighlight>


FormTitleOpts: <code>Object { bold: Boolean, center: Boolean }</code>
==== TabContext ====
<syntaxhighlight lang="typescript">
Object {
id: Number,
tabButton: HTMLElement,
client: HTMLElement,
inputField: HTMLElement,
formTitle: HTMLElement,
formField: HTMLElement,
formInputs: Array<FormInputObj>,
hasSubmitted: Boolean,
cbField: HTMLElement,
cbList: Array<CheckboxObj>,
cbCallback: Function<any>
}
</syntaxhighlight>


=== Static functions ===
=== Static functions ===
Line 211: Line 251:
modal.open();
modal.open();
</syntaxhighlight>
</syntaxhighlight>
[[Category:Documentation]]