@expressen/tallahassee
Advanced tools
Comparing version 14.4.0 to 14.5.0
@@ -9,3 +9,2 @@ "use strict"; | ||
const DOMException = require("domexception"); | ||
const DOMStringMap = require("./DOMStringMap"); | ||
const DOMTokenList = require("./DOMTokenList"); | ||
@@ -19,3 +18,2 @@ const HTMLCollection = require("./HTMLCollection"); | ||
const classListSymbol = Symbol.for("classList"); | ||
const datasetSymbol = Symbol.for("dataset"); | ||
const rectsSymbol = Symbol.for("rects"); | ||
@@ -42,3 +40,2 @@ const scrolledSymbol = Symbol.for("scrolled"); | ||
this[classListSymbol] = new DOMTokenList(this); | ||
this[datasetSymbol] = new DOMStringMap(this); | ||
this[stylesSymbol] = new CSSStyleDeclaration(this); | ||
@@ -211,5 +208,2 @@ | ||
} | ||
get dataset() { | ||
return this[datasetSymbol]; | ||
} | ||
get style() { | ||
@@ -216,0 +210,0 @@ return this[stylesSymbol]; |
"use strict"; | ||
const DocumentType = require("./DocumentType"); | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
const HTMLAnchorElement = require("./HTMLAnchorElement"); | ||
const HTMLButtonElement = require("./HTMLButtonElement"); | ||
const HTMLDialogElement = require("./HTMLDialogElement"); | ||
const HTMLFieldSetElement = require("./HTMLFieldSetElement"); | ||
const HTMLLegendElement = require("./HTMLLegendElement"); | ||
const HTMLFormElement = require("./HTMLFormElement"); | ||
@@ -29,2 +31,4 @@ const HTMLInputElement = require("./HTMLInputElement"); | ||
dialog: HTMLDialogElement, | ||
fieldset: HTMLFieldSetElement, | ||
legend: HTMLLegendElement, | ||
img: HTMLImageElement, | ||
@@ -59,3 +63,3 @@ iframe: HTMLIFrameElement, | ||
return new Element(document, $elm); | ||
return new HTMLElement(document, $elm); | ||
}; | ||
@@ -62,0 +66,0 @@ |
"use strict"; | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
const urlSymbol = Symbol.for("href"); | ||
module.exports = class HTMLAnchorElement extends Element { | ||
module.exports = class HTMLAnchorElement extends HTMLElement { | ||
get href() { | ||
@@ -9,0 +9,0 @@ return hrefPropertyGetter(this[urlSymbol], "href"); |
"use strict"; | ||
const { PointerEvent } = require("./Events"); | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
module.exports = class HTMLButtonElement extends Element { | ||
module.exports = class HTMLButtonElement extends HTMLElement { | ||
constructor(document, $elm) { | ||
@@ -8,0 +8,0 @@ super(document, $elm); |
"use strict"; | ||
const { Event } = require("./Events"); | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
module.exports = class HTMLDialogElement extends Element { | ||
module.exports = class HTMLDialogElement extends HTMLElement { | ||
constructor(document, $elm) { | ||
@@ -8,0 +8,0 @@ super(document, $elm); |
"use strict"; | ||
const Element = require("./Element"); | ||
const DOMStringMap = require("./DOMStringMap"); | ||
module.exports = class HTMLElement extends Element {}; | ||
const datasetSymbol = Symbol.for("dataset"); | ||
module.exports = class HTMLElement extends Element { | ||
constructor(document, $elm) { | ||
super(document, $elm); | ||
this[datasetSymbol] = new DOMStringMap(this); | ||
} | ||
get dataset() { | ||
return this[datasetSymbol]; | ||
} | ||
get contentEditable() { | ||
return this.hasAttribute("contenteditable") || false; | ||
} | ||
}; |
"use strict"; | ||
const { Event, SubmitEvent, symbols } = require("./Events"); | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
const HTMLFormControlsCollection = require("./HTMLFormControlsCollection"); | ||
@@ -10,3 +10,3 @@ const HTMLInputElement = require("./HTMLInputElement"); | ||
module.exports = class HTMLFormElement extends Element { | ||
module.exports = class HTMLFormElement extends HTMLElement { | ||
constructor(document, $elm) { | ||
@@ -13,0 +13,0 @@ super(document, $elm); |
"use strict"; | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
module.exports = class HTMLImageElement extends Element { | ||
module.exports = class HTMLImageElement extends HTMLElement { | ||
constructor(document, $elm) { | ||
@@ -7,0 +7,0 @@ super(document, $elm); |
"use strict"; | ||
const { Event, InputEvent, PointerEvent } = require("./Events"); | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
const ValidityState = require("./ValidityState"); | ||
@@ -9,4 +9,5 @@ | ||
const kValidationMessage = Symbol.for("validation message"); | ||
const kFiles = Symbol.for("files"); | ||
module.exports = class HTMLInputElement extends Element { | ||
module.exports = class HTMLInputElement extends HTMLElement { | ||
constructor(...args) { | ||
@@ -17,2 +18,3 @@ super(...args); | ||
this[kValidity] = new ValidityState(this); | ||
this[kFiles] = []; | ||
} | ||
@@ -67,2 +69,9 @@ get checked() { | ||
} | ||
get multiple() { | ||
return this.$elm.prop("multiple"); | ||
} | ||
set multiple(value) { | ||
if (value === true) return this.setAttribute("multiple", ""); | ||
this.removeAttribute("multiple"); | ||
} | ||
get validationMessage() { | ||
@@ -95,2 +104,6 @@ return this[kValidationMessage]; | ||
break; | ||
case "file": | ||
if (!val) this[kFiles].length = 0; | ||
this.dispatchEvent(new Event("input")); | ||
break; | ||
default: | ||
@@ -104,2 +117,14 @@ this.dispatchEvent(new Event("input")); | ||
} | ||
get accept() { | ||
const value = this.getAttribute("accept"); | ||
if (value === undefined) return ""; | ||
return value; | ||
} | ||
set accept(value) { | ||
this.setAttribute("accept", value); | ||
return value; | ||
} | ||
get files() { | ||
return this[kFiles]; | ||
} | ||
get willValidate() { | ||
@@ -146,2 +171,21 @@ if (this.readOnly) return false; | ||
} | ||
_uploadFile(file) { | ||
let changed = false; | ||
if (!this[kFiles].includes(file)) { | ||
if (this.multiple) { | ||
this[kFiles].push(file); | ||
} else { | ||
this[kFiles] = [file]; | ||
} | ||
changed = true; | ||
} | ||
if (changed) { | ||
if (this[kFiles].length) { | ||
this.value = `C:\\fakepath\\${this[kFiles][0].name}`; | ||
} else { | ||
this.value = ""; | ||
} | ||
} | ||
} | ||
}; |
"use strict"; | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
const {Event} = require("./Events"); | ||
module.exports = class HTMLOptionElement extends Element { | ||
module.exports = class HTMLOptionElement extends HTMLElement { | ||
get selected() { | ||
@@ -8,0 +8,0 @@ return this.$elm.prop("selected"); |
"use strict"; | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
const vm = require("vm"); | ||
module.exports = class HTMLScriptElement extends Element { | ||
module.exports = class HTMLScriptElement extends HTMLElement { | ||
get textContent() { | ||
@@ -8,0 +8,0 @@ return this.$elm.html(); |
"use strict"; | ||
const { Event } = require("./Events"); | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
const HTMLCollection = require("./HTMLCollection"); | ||
@@ -11,3 +11,3 @@ const HtmlOptionCollection = require("./HTMLOptionsCollection"); | ||
module.exports = class HTMLSelectElement extends Element { | ||
module.exports = class HTMLSelectElement extends HTMLElement { | ||
constructor(...args) { | ||
@@ -14,0 +14,0 @@ super(...args); |
"use strict"; | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
module.exports = class HTMLTemplateElement extends Element { | ||
module.exports = class HTMLTemplateElement extends HTMLElement { | ||
get content() { | ||
@@ -7,0 +7,0 @@ const DocumentFragment = require("./DocumentFragment"); |
"use strict"; | ||
const { InputEvent } = require("./Events"); | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
module.exports = class HTMLTextAreaElement extends Element { | ||
module.exports = class HTMLTextAreaElement extends HTMLElement { | ||
get disabled() { | ||
@@ -8,0 +8,0 @@ return this.$elm.prop("disabled"); |
"use strict"; | ||
const Element = require("./Element"); | ||
const HTMLElement = require("./HTMLElement"); | ||
module.exports = class HTMLVideoElement extends Element { | ||
module.exports = class HTMLVideoElement extends HTMLElement { | ||
constructor(document, $elm) { | ||
@@ -7,0 +7,0 @@ super(document, $elm); |
{ | ||
"name": "@expressen/tallahassee", | ||
"version": "14.4.0", | ||
"version": "14.5.0", | ||
"description": "Lightweight client testing framework", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64
3773
122497