mirror of
https://github.com/dzeiocom/FormManager.git
synced 2025-06-23 07:49:21 +00:00
Fix tsc
errors
1 error is still here because I don't know why it popup Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
@ -234,7 +234,7 @@ export default class FormManager {
|
||||
public fillFromURI(uri: string, callback?: () => void) {
|
||||
let ajax = new XMLHttpRequest
|
||||
ajax.open("GET", uri, true)
|
||||
ajax.addEventListener("loadend", (e) => {
|
||||
ajax.addEventListener("loadend", () => {
|
||||
if (ajax.readyState === 4 && ajax.status === 200) {
|
||||
let json = JSON.parse(ajax.responseText)
|
||||
this.fillFromJSON(json)
|
||||
@ -288,14 +288,12 @@ export default class FormManager {
|
||||
*/
|
||||
public clear() {
|
||||
if (this.attributeManager.trigger(AttributeListeners.PRE_CLEAR) === false) return
|
||||
(this.form.querySelectorAll("[name]") as NodeListOf<HTMLInputElement>).forEach((el: HTMLInputElement) => {
|
||||
for (const name in this.inputs) {
|
||||
if (this.inputs.hasOwnProperty(name)) {
|
||||
const input = this.inputs[name];
|
||||
input.setValue(undefined)
|
||||
}
|
||||
for (const name in this.inputs) {
|
||||
if (this.inputs.hasOwnProperty(name)) {
|
||||
const input = this.inputs[name];
|
||||
input.setValue(undefined)
|
||||
}
|
||||
})
|
||||
}
|
||||
this.attributeManager.trigger(AttributeListeners.POST_CLEAR)
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import AttributeIdentity from "./Interfaces/AttributeIdentity";
|
||||
*/
|
||||
export default class AutosetAttribute
|
||||
extends AttributeAbstract {
|
||||
public trigger(event: AttributeListeners, data?: any): boolean | void | object {
|
||||
public trigger(): boolean | void | object {
|
||||
|
||||
let str = this.input.element.getAttribute("data-autoset") || ""
|
||||
if (evalF(str, (ster) => {this.input.setValue(ster)})) return
|
||||
|
@ -25,7 +25,7 @@ import AttributeIdentity from "./Interfaces/AttributeIdentity";
|
||||
*/
|
||||
export default class DefaultAttribute
|
||||
extends AttributeAbstract {
|
||||
public trigger(event: AttributeListeners, data?: any): boolean | void | object {
|
||||
public trigger(): boolean | void | object {
|
||||
this.run()
|
||||
return true
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ export default class RepeatInput extends DefaultInput {
|
||||
})
|
||||
|
||||
// Observer to handle attributes changes
|
||||
const observer = new MutationObserver((mutationList: any, observer: any) => {
|
||||
const observer = new MutationObserver((mutationList: any) => {
|
||||
for (let mutation of mutationList) {
|
||||
if (mutation.type === 'attributes' && mutation.attributeName === "disabled") {
|
||||
(this.element.querySelectorAll(".fmr-add, .fmr-del") as NodeListOf<HTMLElement>).forEach((el: HTMLElement) => {
|
||||
|
@ -11,7 +11,7 @@ export default class SelectInput extends DefaultInput {
|
||||
|
||||
public formatValue(value: any): any {
|
||||
if (typeof value === "undefined") {
|
||||
const opt: HTMLOptionElement = this.element.querySelector("option[selected]")
|
||||
const opt: HTMLOptionElement|null = this.element.querySelector("option[selected]")
|
||||
if (opt) {
|
||||
return opt.value
|
||||
}
|
||||
|
Reference in New Issue
Block a user