Jump to content

Modal: Difference between revisions

No edit summary
Fix Modal documentation error (getTabData)
 
(3 intermediate revisions by 2 users not shown)
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:<syntaxhighlight lang="typescript">
 
==== CheckboxObj ====
<syntaxhighlight lang="typescript">
Object {
Object {
     elm: HTMLLabelElement,
     elm: HTMLLabelElement,
Line 183: Line 185:
     children: Array<CheckboxObj>
     children: Array<CheckboxObj>
}
}
</syntaxhighlight>EntryObj:<syntaxhighlight lang="typescript">
</syntaxhighlight>
 
==== EntryObj ====
<syntaxhighlight lang="typescript">
Object {
Object {
     input: HTMLInputElement
     input: HTMLInputElement
}
</syntaxhighlight>
==== FormInputObj ====
<syntaxhighlight lang="typescript">
Object {
    input: HTMLInputElement,
value: String,
validation: "number" | "required",
validationFailed: Boolean,
type: "text" | "color",
label: HTMLLabelElement
}
</syntaxhighlight>
==== 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>
</syntaxhighlight>
Line 217: Line 251:
modal.open();
modal.open();
</syntaxhighlight>
</syntaxhighlight>
[[Category:Documentation]]