happy-dom
Advanced tools
Comparing version 14.2.1 to 14.3.0
@@ -12,2 +12,3 @@ import HTMLElement from '../html-element/HTMLElement.cjs'; | ||
import NamedNodeMap from '../../named-node-map/NamedNodeMap.cjs'; | ||
import HTMLCollection from '../element/HTMLCollection.cjs'; | ||
/** | ||
@@ -144,2 +145,8 @@ * HTML Select Element. | ||
/** | ||
* Returns selected options. | ||
* | ||
* @returns HTMLCollection. | ||
*/ | ||
get selectedOptions(): HTMLCollection<HTMLOptionElement>; | ||
/** | ||
* Returns the associated label elements. | ||
@@ -146,0 +153,0 @@ * |
@@ -12,2 +12,3 @@ import HTMLElement from '../html-element/HTMLElement.js'; | ||
import NamedNodeMap from '../../named-node-map/NamedNodeMap.js'; | ||
import HTMLCollection from '../element/HTMLCollection.js'; | ||
/** | ||
@@ -144,2 +145,8 @@ * HTML Select Element. | ||
/** | ||
* Returns selected options. | ||
* | ||
* @returns HTMLCollection. | ||
*/ | ||
get selectedOptions(): HTMLCollection<HTMLOptionElement>; | ||
/** | ||
* Returns the associated label elements. | ||
@@ -146,0 +153,0 @@ * |
@@ -15,2 +15,3 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { | ||
import HTMLSelectElementNamedNodeMap from './HTMLSelectElementNamedNodeMap.js'; | ||
import HTMLCollection from '../element/HTMLCollection.js'; | ||
/** | ||
@@ -239,2 +240,16 @@ * HTML Select Element. | ||
/** | ||
* Returns selected options. | ||
* | ||
* @returns HTMLCollection. | ||
*/ | ||
get selectedOptions() { | ||
const selectedOptions = new HTMLCollection(); | ||
for (let i = 0, max = this[PropertySymbol.options].length; i < max; i++) { | ||
if (this[PropertySymbol.options][i][PropertySymbol.selectedness]) { | ||
selectedOptions.push(this[PropertySymbol.options][i]); | ||
} | ||
} | ||
return selectedOptions; | ||
} | ||
/** | ||
* Returns the associated label elements. | ||
@@ -241,0 +256,0 @@ * |
{ | ||
"name": "happy-dom", | ||
"version": "14.2.1", | ||
"version": "14.3.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/capricorn86/happy-dom", |
@@ -15,2 +15,3 @@ import HTMLElement from '../html-element/HTMLElement.js'; | ||
import HTMLSelectElementNamedNodeMap from './HTMLSelectElementNamedNodeMap.js'; | ||
import HTMLCollection from '../element/HTMLCollection.js'; | ||
@@ -256,2 +257,17 @@ /** | ||
/** | ||
* Returns selected options. | ||
* | ||
* @returns HTMLCollection. | ||
*/ | ||
public get selectedOptions(): HTMLCollection<HTMLOptionElement> { | ||
const selectedOptions = new HTMLCollection<HTMLOptionElement>(); | ||
for (let i = 0, max = this[PropertySymbol.options].length; i < max; i++) { | ||
if ((<HTMLOptionElement>this[PropertySymbol.options][i])[PropertySymbol.selectedness]) { | ||
selectedOptions.push(<HTMLOptionElement>this[PropertySymbol.options][i]); | ||
} | ||
} | ||
return selectedOptions; | ||
} | ||
/** | ||
* Returns the associated label elements. | ||
@@ -258,0 +274,0 @@ * |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
8191638
164242