happy-dom 2.31.0 → 2.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of happy-dom might be problematic. Click here for more details.
- package/README.md +1 -1
- package/lib/config/ElementClass.d.ts +0 -22
- package/lib/config/ElementClass.js +1 -23
- package/lib/config/ElementClass.js.map +1 -1
- package/lib/config/ElementTag.d.ts +2 -0
- package/lib/config/ElementTag.js +2 -0
- package/lib/config/ElementTag.js.map +1 -1
- package/lib/event/EventTarget.js +5 -1
- package/lib/event/EventTarget.js.map +1 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.js +6 -2
- package/lib/index.js.map +1 -1
- package/lib/match-media/MediaQueryList.d.ts +39 -0
- package/lib/match-media/MediaQueryList.js +82 -0
- package/lib/match-media/MediaQueryList.js.map +1 -0
- package/lib/nodes/html-input-element/IHTMLInputElement.d.ts +1 -1
- package/lib/nodes/html-label-element/HTMLLabelElement.d.ts +45 -0
- package/lib/nodes/html-label-element/HTMLLabelElement.js +113 -0
- package/lib/nodes/html-label-element/HTMLLabelElement.js.map +1 -0
- package/lib/nodes/html-label-element/IHTMLLabelElement.d.ts +13 -0
- package/lib/nodes/html-label-element/IHTMLLabelElement.js +3 -0
- package/lib/nodes/html-label-element/IHTMLLabelElement.js.map +1 -0
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js +1 -1
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js.map +1 -1
- package/lib/nodes/html-text-area-element/IHTMLTextAreaElement.d.ts +1 -1
- package/lib/nodes/node/Node.js +0 -4
- package/lib/nodes/node/Node.js.map +1 -1
- package/lib/window/IWindow.d.ts +6 -2
- package/lib/window/Window.d.ts +16 -2
- package/lib/window/Window.js +20 -2
- package/lib/window/Window.js.map +1 -1
- package/package.json +3 -3
- package/src/config/ElementClass.ts +1 -23
- package/src/config/ElementTag.ts +2 -0
- package/src/event/EventTarget.ts +7 -1
- package/src/index.ts +8 -0
- package/src/match-media/MediaQueryList.ts +52 -0
- package/src/nodes/html-input-element/IHTMLInputElement.ts +1 -1
- package/src/nodes/html-label-element/HTMLLabelElement.ts +80 -0
- package/src/nodes/html-label-element/IHTMLLabelElement.ts +14 -0
- package/src/nodes/html-text-area-element/HTMLTextAreaElement.ts +1 -1
- package/src/nodes/html-text-area-element/IHTMLTextAreaElement.ts +1 -1
- package/src/nodes/node/Node.ts +0 -6
- package/src/window/IWindow.ts +6 -2
- package/src/window/Window.ts +21 -2
package/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
# About
|
5
5
|
|
6
|
-
A [JSDOM](https://github.com/jsdom/jsdom) alternative with
|
6
|
+
A [JSDOM](https://github.com/jsdom/jsdom) alternative with focus on performance.
|
7
7
|
|
8
8
|
[Happy DOM](https://github.com/capricorn86/happy-dom) aim to support the most common functionality of a web browser.
|
9
9
|
|
@@ -1,26 +1,10 @@
|
|
1
|
-
import HTMLTemplateElement from '../nodes/html-template-element/HTMLTemplateElement';
|
2
|
-
import HTMLFormElement from '../nodes/html-form-element/HTMLFormElement';
|
3
1
|
import HTMLElement from '../nodes/html-element/HTMLElement';
|
4
|
-
import HTMLInputElement from '../nodes/html-input-element/HTMLInputElement';
|
5
|
-
import HTMLTextAreaElement from '../nodes/html-text-area-element/HTMLTextAreaElement';
|
6
|
-
import SVGSVGElement from '../nodes/svg-element/SVGSVGElement';
|
7
|
-
import SVGElement from '../nodes/svg-element/SVGElement';
|
8
|
-
import HTMLScriptElement from '../nodes/html-script-element/HTMLScriptElement';
|
9
|
-
import HTMLImageElement from '../nodes/html-image-element/HTMLImageElement';
|
10
|
-
import HTMLStyleElement from '../nodes/html-style-element/HTMLStyleElement';
|
11
|
-
import HTMLLinkElement from '../nodes/html-link-element/HTMLLinkElement';
|
12
2
|
declare const _default: {
|
13
|
-
HTMLTemplateElement: typeof HTMLTemplateElement;
|
14
|
-
HTMLFormElement: typeof HTMLFormElement;
|
15
|
-
HTMLInputElement: typeof HTMLInputElement;
|
16
|
-
HTMLTextAreaElement: typeof HTMLTextAreaElement;
|
17
3
|
HTMLElement: typeof HTMLElement;
|
18
4
|
HTMLHeadElement: typeof HTMLElement;
|
19
5
|
HTMLTitleElement: typeof HTMLElement;
|
20
6
|
HTMLBaseElement: typeof HTMLElement;
|
21
|
-
HTMLLinkElement: typeof HTMLLinkElement;
|
22
7
|
HTMLMetaElement: typeof HTMLElement;
|
23
|
-
HTMLStyleElement: typeof HTMLStyleElement;
|
24
8
|
HTMLBodyElement: typeof HTMLElement;
|
25
9
|
HTMLHeadingElement: typeof HTMLElement;
|
26
10
|
HTMLParagraphElement: typeof HTMLElement;
|
@@ -45,8 +29,6 @@ declare const _default: {
|
|
45
29
|
HTMLFieldSetElement: typeof HTMLElement;
|
46
30
|
HTMLFontElement: typeof HTMLElement;
|
47
31
|
HTMLHtmlElement: typeof HTMLElement;
|
48
|
-
HTMLImageElement: typeof HTMLImageElement;
|
49
|
-
HTMLLabelElement: typeof HTMLElement;
|
50
32
|
HTMLLegendElement: typeof HTMLElement;
|
51
33
|
HTMLMapElement: typeof HTMLElement;
|
52
34
|
HTMLMarqueeElement: typeof HTMLElement;
|
@@ -59,9 +41,7 @@ declare const _default: {
|
|
59
41
|
HTMLPictureElement: typeof HTMLElement;
|
60
42
|
HTMLProgressElement: typeof HTMLElement;
|
61
43
|
HTMLQuoteElement: typeof HTMLElement;
|
62
|
-
HTMLScriptElement: typeof HTMLScriptElement;
|
63
44
|
HTMLSelectElement: typeof HTMLElement;
|
64
|
-
HTMLSlotElement: typeof HTMLElement;
|
65
45
|
HTMLSourceElement: typeof HTMLElement;
|
66
46
|
HTMLSpanElement: typeof HTMLElement;
|
67
47
|
HTMLTableCaptionElement: typeof HTMLElement;
|
@@ -81,7 +61,5 @@ declare const _default: {
|
|
81
61
|
HTMLVideoElement: typeof HTMLElement;
|
82
62
|
HTMLAudioElement: typeof HTMLElement;
|
83
63
|
HTMLTrackElement: typeof HTMLElement;
|
84
|
-
SVGSVGElement: typeof SVGSVGElement;
|
85
|
-
SVGElement: typeof SVGElement;
|
86
64
|
};
|
87
65
|
export default _default;
|
@@ -3,29 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
var HTMLTemplateElement_1 = __importDefault(require("../nodes/html-template-element/HTMLTemplateElement"));
|
7
|
-
var HTMLFormElement_1 = __importDefault(require("../nodes/html-form-element/HTMLFormElement"));
|
8
6
|
var HTMLElement_1 = __importDefault(require("../nodes/html-element/HTMLElement"));
|
9
|
-
var HTMLInputElement_1 = __importDefault(require("../nodes/html-input-element/HTMLInputElement"));
|
10
|
-
var HTMLTextAreaElement_1 = __importDefault(require("../nodes/html-text-area-element/HTMLTextAreaElement"));
|
11
|
-
var SVGSVGElement_1 = __importDefault(require("../nodes/svg-element/SVGSVGElement"));
|
12
|
-
var SVGElement_1 = __importDefault(require("../nodes/svg-element/SVGElement"));
|
13
|
-
var HTMLScriptElement_1 = __importDefault(require("../nodes/html-script-element/HTMLScriptElement"));
|
14
|
-
var HTMLImageElement_1 = __importDefault(require("../nodes/html-image-element/HTMLImageElement"));
|
15
|
-
var HTMLStyleElement_1 = __importDefault(require("../nodes/html-style-element/HTMLStyleElement"));
|
16
|
-
var HTMLLinkElement_1 = __importDefault(require("../nodes/html-link-element/HTMLLinkElement"));
|
17
7
|
exports.default = {
|
18
|
-
HTMLTemplateElement: HTMLTemplateElement_1.default,
|
19
|
-
HTMLFormElement: HTMLFormElement_1.default,
|
20
|
-
HTMLInputElement: HTMLInputElement_1.default,
|
21
|
-
HTMLTextAreaElement: HTMLTextAreaElement_1.default,
|
22
8
|
HTMLElement: HTMLElement_1.default,
|
23
9
|
HTMLHeadElement: HTMLElement_1.default,
|
24
10
|
HTMLTitleElement: HTMLElement_1.default,
|
25
11
|
HTMLBaseElement: HTMLElement_1.default,
|
26
|
-
HTMLLinkElement: HTMLLinkElement_1.default,
|
27
12
|
HTMLMetaElement: HTMLElement_1.default,
|
28
|
-
HTMLStyleElement: HTMLStyleElement_1.default,
|
29
13
|
HTMLBodyElement: HTMLElement_1.default,
|
30
14
|
HTMLHeadingElement: HTMLElement_1.default,
|
31
15
|
HTMLParagraphElement: HTMLElement_1.default,
|
@@ -50,8 +34,6 @@ exports.default = {
|
|
50
34
|
HTMLFieldSetElement: HTMLElement_1.default,
|
51
35
|
HTMLFontElement: HTMLElement_1.default,
|
52
36
|
HTMLHtmlElement: HTMLElement_1.default,
|
53
|
-
HTMLImageElement: HTMLImageElement_1.default,
|
54
|
-
HTMLLabelElement: HTMLElement_1.default,
|
55
37
|
HTMLLegendElement: HTMLElement_1.default,
|
56
38
|
HTMLMapElement: HTMLElement_1.default,
|
57
39
|
HTMLMarqueeElement: HTMLElement_1.default,
|
@@ -64,9 +46,7 @@ exports.default = {
|
|
64
46
|
HTMLPictureElement: HTMLElement_1.default,
|
65
47
|
HTMLProgressElement: HTMLElement_1.default,
|
66
48
|
HTMLQuoteElement: HTMLElement_1.default,
|
67
|
-
HTMLScriptElement: HTMLScriptElement_1.default,
|
68
49
|
HTMLSelectElement: HTMLElement_1.default,
|
69
|
-
HTMLSlotElement: HTMLElement_1.default,
|
70
50
|
HTMLSourceElement: HTMLElement_1.default,
|
71
51
|
HTMLSpanElement: HTMLElement_1.default,
|
72
52
|
HTMLTableCaptionElement: HTMLElement_1.default,
|
@@ -85,8 +65,6 @@ exports.default = {
|
|
85
65
|
HTMLParamElement: HTMLElement_1.default,
|
86
66
|
HTMLVideoElement: HTMLElement_1.default,
|
87
67
|
HTMLAudioElement: HTMLElement_1.default,
|
88
|
-
HTMLTrackElement: HTMLElement_1.default
|
89
|
-
SVGSVGElement: SVGSVGElement_1.default,
|
90
|
-
SVGElement: SVGElement_1.default
|
68
|
+
HTMLTrackElement: HTMLElement_1.default
|
91
69
|
};
|
92
70
|
//# sourceMappingURL=ElementClass.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ElementClass.js","sourceRoot":"","sources":["../../src/config/ElementClass.ts"],"names":[],"mappings":";;;;;AAAA,
|
1
|
+
{"version":3,"file":"ElementClass.js","sourceRoot":"","sources":["../../src/config/ElementClass.ts"],"names":[],"mappings":";;;;;AAAA,kFAA4D;AAE5D,kBAAe;IACd,WAAW,EAAE,qBAAW;IACxB,eAAe,EAAE,qBAAW;IAC5B,gBAAgB,EAAE,qBAAW;IAC7B,eAAe,EAAE,qBAAW;IAC5B,eAAe,EAAE,qBAAW;IAC5B,eAAe,EAAE,qBAAW;IAC5B,kBAAkB,EAAE,qBAAW;IAC/B,oBAAoB,EAAE,qBAAW;IACjC,aAAa,EAAE,qBAAW;IAC1B,cAAc,EAAE,qBAAW;IAC3B,gBAAgB,EAAE,qBAAW;IAC7B,gBAAgB,EAAE,qBAAW;IAC7B,aAAa,EAAE,qBAAW;IAC1B,eAAe,EAAE,qBAAW;IAC5B,gBAAgB,EAAE,qBAAW;IAC7B,cAAc,EAAE,qBAAW;IAC3B,iBAAiB,EAAE,qBAAW;IAC9B,eAAe,EAAE,qBAAW;IAC5B,aAAa,EAAE,qBAAW;IAC1B,iBAAiB,EAAE,qBAAW;IAC9B,iBAAiB,EAAE,qBAAW;IAC9B,eAAe,EAAE,qBAAW;IAC5B,mBAAmB,EAAE,qBAAW;IAChC,kBAAkB,EAAE,qBAAW;IAC/B,iBAAiB,EAAE,qBAAW;IAC9B,oBAAoB,EAAE,qBAAW;IACjC,mBAAmB,EAAE,qBAAW;IAChC,eAAe,EAAE,qBAAW;IAC5B,eAAe,EAAE,qBAAW;IAC5B,iBAAiB,EAAE,qBAAW;IAC9B,cAAc,EAAE,qBAAW;IAC3B,kBAAkB,EAAE,qBAAW;IAC/B,gBAAgB,EAAE,qBAAW;IAC7B,gBAAgB,EAAE,qBAAW;IAC7B,cAAc,EAAE,qBAAW;IAC3B,mBAAmB,EAAE,qBAAW;IAChC,iBAAiB,EAAE,qBAAW;IAC9B,iBAAiB,EAAE,qBAAW;IAC9B,kBAAkB,EAAE,qBAAW;IAC/B,mBAAmB,EAAE,qBAAW;IAChC,gBAAgB,EAAE,qBAAW;IAC7B,iBAAiB,EAAE,qBAAW;IAC9B,iBAAiB,EAAE,qBAAW;IAC9B,eAAe,EAAE,qBAAW;IAC5B,uBAAuB,EAAE,qBAAW;IACpC,oBAAoB,EAAE,qBAAW;IACjC,mBAAmB,EAAE,qBAAW;IAChC,gBAAgB,EAAE,qBAAW;IAC7B,eAAe,EAAE,qBAAW;IAC5B,mBAAmB,EAAE,qBAAW;IAChC,uBAAuB,EAAE,qBAAW;IACpC,kBAAkB,EAAE,qBAAW;IAC/B,gBAAgB,EAAE,qBAAW;IAC7B,mBAAmB,EAAE,qBAAW;IAChC,iBAAiB,EAAE,qBAAW;IAC9B,gBAAgB,EAAE,qBAAW;IAC7B,iBAAiB,EAAE,qBAAW;IAC9B,gBAAgB,EAAE,qBAAW;IAC7B,gBAAgB,EAAE,qBAAW;IAC7B,gBAAgB,EAAE,qBAAW;IAC7B,gBAAgB,EAAE,qBAAW;CAC7B,CAAC"}
|
@@ -8,6 +8,7 @@ import HTMLScriptElement from '../nodes/html-script-element/HTMLScriptElement';
|
|
8
8
|
import HTMLImageElement from '../nodes/html-image-element/HTMLImageElement';
|
9
9
|
import HTMLLinkElement from '../nodes/html-link-element/HTMLLinkElement';
|
10
10
|
import HTMLStyleElement from '../nodes/html-style-element/HTMLStyleElement';
|
11
|
+
import HTMLLabelElement from '../nodes/html-label-element/HTMLLabelElement';
|
11
12
|
import HTMLSlotElement from '../nodes/html-slot-element/HTMLSlotElement';
|
12
13
|
declare const _default: {
|
13
14
|
template: typeof HTMLTemplateElement;
|
@@ -18,6 +19,7 @@ declare const _default: {
|
|
18
19
|
img: typeof HTMLImageElement;
|
19
20
|
link: typeof HTMLLinkElement;
|
20
21
|
style: typeof HTMLStyleElement;
|
22
|
+
label: typeof HTMLLabelElement;
|
21
23
|
slot: typeof HTMLSlotElement;
|
22
24
|
svg: typeof SVGSVGElement;
|
23
25
|
circle: typeof SVGElement;
|
package/lib/config/ElementTag.js
CHANGED
@@ -13,6 +13,7 @@ var HTMLScriptElement_1 = __importDefault(require("../nodes/html-script-element/
|
|
13
13
|
var HTMLImageElement_1 = __importDefault(require("../nodes/html-image-element/HTMLImageElement"));
|
14
14
|
var HTMLLinkElement_1 = __importDefault(require("../nodes/html-link-element/HTMLLinkElement"));
|
15
15
|
var HTMLStyleElement_1 = __importDefault(require("../nodes/html-style-element/HTMLStyleElement"));
|
16
|
+
var HTMLLabelElement_1 = __importDefault(require("../nodes/html-label-element/HTMLLabelElement"));
|
16
17
|
var HTMLSlotElement_1 = __importDefault(require("../nodes/html-slot-element/HTMLSlotElement"));
|
17
18
|
exports.default = {
|
18
19
|
template: HTMLTemplateElement_1.default,
|
@@ -23,6 +24,7 @@ exports.default = {
|
|
23
24
|
img: HTMLImageElement_1.default,
|
24
25
|
link: HTMLLinkElement_1.default,
|
25
26
|
style: HTMLStyleElement_1.default,
|
27
|
+
label: HTMLLabelElement_1.default,
|
26
28
|
slot: HTMLSlotElement_1.default,
|
27
29
|
svg: SVGSVGElement_1.default,
|
28
30
|
circle: SVGElement_1.default,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ElementTag.js","sourceRoot":"","sources":["../../src/config/ElementTag.ts"],"names":[],"mappings":";;;;;AAAA,2GAAqF;AACrF,+FAAyE;AACzE,kGAA4E;AAC5E,4GAAsF;AACtF,qFAA+D;AAC/D,+EAAyD;AACzD,qGAA+E;AAC/E,kGAA4E;AAC5E,+FAAyE;AACzE,kGAA4E;AAC5E,+FAAyE;AAEzE,kBAAe;IACd,QAAQ,EAAE,6BAAmB;IAC7B,IAAI,EAAE,yBAAe;IACrB,KAAK,EAAE,0BAAgB;IACvB,QAAQ,EAAE,6BAAmB;IAC7B,MAAM,EAAE,2BAAiB;IACzB,GAAG,EAAE,0BAAgB;IACrB,IAAI,EAAE,yBAAe;IACrB,KAAK,EAAE,0BAAgB;IACvB,IAAI,EAAE,yBAAe;IACrB,GAAG,EAAE,uBAAa;IAClB,MAAM,EAAE,oBAAU;IAClB,OAAO,EAAE,oBAAU;IACnB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,OAAO,EAAE,oBAAU;IACnB,QAAQ,EAAE,oBAAU;IACpB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,GAAG,EAAE,oBAAU;CACf,CAAC"}
|
1
|
+
{"version":3,"file":"ElementTag.js","sourceRoot":"","sources":["../../src/config/ElementTag.ts"],"names":[],"mappings":";;;;;AAAA,2GAAqF;AACrF,+FAAyE;AACzE,kGAA4E;AAC5E,4GAAsF;AACtF,qFAA+D;AAC/D,+EAAyD;AACzD,qGAA+E;AAC/E,kGAA4E;AAC5E,+FAAyE;AACzE,kGAA4E;AAC5E,kGAA4E;AAC5E,+FAAyE;AAEzE,kBAAe;IACd,QAAQ,EAAE,6BAAmB;IAC7B,IAAI,EAAE,yBAAe;IACrB,KAAK,EAAE,0BAAgB;IACvB,QAAQ,EAAE,6BAAmB;IAC7B,MAAM,EAAE,2BAAiB;IACzB,GAAG,EAAE,0BAAgB;IACrB,IAAI,EAAE,yBAAe;IACrB,KAAK,EAAE,0BAAgB;IACvB,KAAK,EAAE,0BAAgB;IACvB,IAAI,EAAE,yBAAe;IACrB,GAAG,EAAE,uBAAa;IAClB,MAAM,EAAE,oBAAU;IAClB,OAAO,EAAE,oBAAU;IACnB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,OAAO,EAAE,oBAAU;IACnB,QAAQ,EAAE,oBAAU;IACpB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,GAAG,EAAE,oBAAU;CACf,CAAC"}
|
package/lib/event/EventTarget.js
CHANGED
@@ -27,7 +27,7 @@ var EventTarget = /** @class */ (function () {
|
|
27
27
|
if (this._listeners[type]) {
|
28
28
|
var index = this._listeners[type].indexOf(listener);
|
29
29
|
if (index !== -1) {
|
30
|
-
this._listeners[type].splice(index);
|
30
|
+
this._listeners[type].splice(index, 1);
|
31
31
|
}
|
32
32
|
}
|
33
33
|
};
|
@@ -42,6 +42,10 @@ var EventTarget = /** @class */ (function () {
|
|
42
42
|
event.target = this;
|
43
43
|
}
|
44
44
|
event.currentTarget = this;
|
45
|
+
var onEventName = 'on' + event.type.toLowerCase();
|
46
|
+
if (typeof this[onEventName] === 'function') {
|
47
|
+
this[onEventName].call(this, event);
|
48
|
+
}
|
45
49
|
if (this._listeners[event.type]) {
|
46
50
|
for (var _i = 0, _a = this._listeners[event.type]; _i < _a.length; _i++) {
|
47
51
|
var listener = _a[_i];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EventTarget.js","sourceRoot":"","sources":["../../src/event/EventTarget.ts"],"names":[],"mappings":";;AAIA;;GAEG;AACH;IAAA;QACiB,eAAU,GAEtB,EAAE,CAAC;
|
1
|
+
{"version":3,"file":"EventTarget.js","sourceRoot":"","sources":["../../src/event/EventTarget.ts"],"names":[],"mappings":";;AAIA;;GAEG;AACH;IAAA;QACiB,eAAU,GAEtB,EAAE,CAAC;IA6ER,CAAC;IA3EA;;;;;OAKG;IACI,sCAAgB,GAAvB,UAAwB,IAAY,EAAE,QAAmD;QACxF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACpD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACI,yCAAmB,GAA1B,UACC,IAAY,EACZ,QAAmD;QAEnD,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YAC1B,IAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,Q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nF,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC;IACF,kBAAC;AAAD,CAAC,AAhFD,IAgFC"}
|
package/lib/index.d.ts
CHANGED
@@ -69,6 +69,10 @@ import HTMLLinkElement from './nodes/html-link-element/HTMLLinkElement';
|
|
69
69
|
import IHTMLLinkElement from './nodes/html-link-element/IHTMLLinkElement';
|
70
70
|
import HTMLStyleElement from './nodes/html-style-element/HTMLStyleElement';
|
71
71
|
import IHTMLStyleElement from './nodes/html-style-element/IHTMLStyleElement';
|
72
|
+
import HTMLSlotElement from './nodes/html-slot-element/HTMLSlotElement';
|
73
|
+
import IHTMLSlotElement from './nodes/html-slot-element/IHTMLSlotElement';
|
74
|
+
import HTMLLabelElement from './nodes/html-label-element/HTMLLabelElement';
|
75
|
+
import IHTMLLabelElement from './nodes/html-label-element/IHTMLLabelElement';
|
72
76
|
import SVGElement from './nodes/svg-element/SVGElement';
|
73
77
|
import ISVGElement from './nodes/svg-element/ISVGElement';
|
74
78
|
import SVGGraphicsElement from './nodes/svg-element/SVGGraphicsElement';
|
@@ -98,4 +102,4 @@ import UnclosedElements from './config/UnclosedElements';
|
|
98
102
|
import CSSStyleSheet from './css/CSSStyleSheet';
|
99
103
|
import Storage from './storage/Storage';
|
100
104
|
import URLSearchParams from './url-search-params/URLSearchParams';
|
101
|
-
export { AsyncWindow, Window, IWindow, DataTransfer, DataTransferItem, DataTransferItemList, URL, Location, MutationObserver, ResizeObserver, Blob, File, FileReader, DOMException, History, CSSStyleDeclaration, Screen, AsyncTaskManager, IResponse, IFetchOptions, NodeFilter, Event, EventTarget, IEventInit, IEventListener, IUIEventInit, UIEvent, ErrorEvent, FocusEvent, AnimationEvent, IAnimationEventInit, ICustomEventInit, CustomEvent, IErrorEventInit, IFocusEventInit, IInputEventInit, IKeyboardEventInit, IMouseEventInit, IProgressEventInit, IWheelEventInit, InputEvent, KeyboardEvent, MouseEvent, ProgressEvent, WheelEvent, DOMParser, Document, IDocument, HTMLDocument, XMLDocument, SVGDocument, Element, IElement, IHTMLCollection, HTMLElement, IHTMLElement, HTMLTemplateElement, IHTMLTemplateElement, HTMLFormElement, IHTMLFormElement, HTMLInputElement, IHTMLInputElement, HTMLTextAreaElement, IHTMLTextAreaElement, HTMLImageElement, IHTMLImageElement, HTMLScriptElement, HTMLLinkElement, IHTMLLinkElement, HTMLStyleElement, IHTMLStyleElement, SVGElement, ISVGElement, SVGGraphicsElement, ISVGGraphicsElement, SVGSVGElement, ISVGSVGElement, DocumentFragment, IDocumentFragment, ShadowRoot, IShadowRoot, Node, INode, INodeList, Text, IText, Comment, IComment, DocumentType, IDocumentType, TreeWalker, CustomElementRegistry, XMLParser, XMLSerializer, ElementTag, SelfClosingElements, UnclosedElements, CSSStyleSheet, Storage, URLSearchParams };
|
105
|
+
export { AsyncWindow, Window, IWindow, DataTransfer, DataTransferItem, DataTransferItemList, URL, Location, MutationObserver, ResizeObserver, Blob, File, FileReader, DOMException, History, CSSStyleDeclaration, Screen, AsyncTaskManager, IResponse, IFetchOptions, NodeFilter, Event, EventTarget, IEventInit, IEventListener, IUIEventInit, UIEvent, ErrorEvent, FocusEvent, AnimationEvent, IAnimationEventInit, ICustomEventInit, CustomEvent, IErrorEventInit, IFocusEventInit, IInputEventInit, IKeyboardEventInit, IMouseEventInit, IProgressEventInit, IWheelEventInit, InputEvent, KeyboardEvent, MouseEvent, ProgressEvent, WheelEvent, DOMParser, Document, IDocument, HTMLDocument, XMLDocument, SVGDocument, Element, IElement, IHTMLCollection, HTMLElement, IHTMLElement, HTMLTemplateElement, IHTMLTemplateElement, HTMLFormElement, IHTMLFormElement, HTMLInputElement, IHTMLInputElement, HTMLTextAreaElement, IHTMLTextAreaElement, HTMLImageElement, IHTMLImageElement, HTMLScriptElement, HTMLLinkElement, IHTMLLinkElement, HTMLStyleElement, IHTMLStyleElement, HTMLSlotElement, IHTMLSlotElement, HTMLLabelElement, IHTMLLabelElement, SVGElement, ISVGElement, SVGGraphicsElement, ISVGGraphicsElement, SVGSVGElement, ISVGSVGElement, DocumentFragment, IDocumentFragment, ShadowRoot, IShadowRoot, Node, INode, INodeList, Text, IText, Comment, IComment, DocumentType, IDocumentType, TreeWalker, CustomElementRegistry, XMLParser, XMLSerializer, ElementTag, SelfClosingElements, UnclosedElements, CSSStyleSheet, Storage, URLSearchParams };
|
package/lib/index.js
CHANGED
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.
|
7
|
-
exports.URLSearchParams = exports.Storage = exports.CSSStyleSheet = exports.UnclosedElements = exports.SelfClosingElements = exports.ElementTag = exports.XMLSerializer = exports.XMLParser = exports.CustomElementRegistry = exports.TreeWalker = exports.DocumentType = exports.Comment = exports.Text = exports.Node = void 0;
|
6
|
+
exports.SVGSVGElement = exports.SVGGraphicsElement = exports.SVGElement = exports.HTMLLabelElement = exports.HTMLSlotElement = exports.HTMLStyleElement = exports.HTMLLinkElement = exports.HTMLScriptElement = exports.HTMLImageElement = exports.HTMLTextAreaElement = exports.HTMLInputElement = exports.HTMLFormElement = exports.HTMLTemplateElement = exports.HTMLElement = exports.Element = exports.SVGDocument = exports.XMLDocument = exports.HTMLDocument = exports.Document = exports.DOMParser = exports.WheelEvent = exports.ProgressEvent = exports.MouseEvent = exports.KeyboardEvent = exports.InputEvent = exports.CustomEvent = exports.AnimationEvent = exports.FocusEvent = exports.ErrorEvent = exports.UIEvent = exports.EventTarget = exports.Event = exports.NodeFilter = exports.AsyncTaskManager = exports.Screen = exports.CSSStyleDeclaration = exports.History = exports.DOMException = exports.FileReader = exports.File = exports.Blob = exports.ResizeObserver = exports.MutationObserver = exports.Location = exports.URL = exports.DataTransferItemList = exports.DataTransferItem = exports.DataTransfer = exports.Window = exports.AsyncWindow = void 0;
|
7
|
+
exports.URLSearchParams = exports.Storage = exports.CSSStyleSheet = exports.UnclosedElements = exports.SelfClosingElements = exports.ElementTag = exports.XMLSerializer = exports.XMLParser = exports.CustomElementRegistry = exports.TreeWalker = exports.DocumentType = exports.Comment = exports.Text = exports.Node = exports.ShadowRoot = exports.DocumentFragment = void 0;
|
8
8
|
var Window_1 = __importDefault(require("./window/Window"));
|
9
9
|
exports.Window = Window_1.default;
|
10
10
|
var DataTransfer_1 = __importDefault(require("./event/DataTransfer"));
|
@@ -95,6 +95,10 @@ var HTMLLinkElement_1 = __importDefault(require("./nodes/html-link-element/HTMLL
|
|
95
95
|
exports.HTMLLinkElement = HTMLLinkElement_1.default;
|
96
96
|
var HTMLStyleElement_1 = __importDefault(require("./nodes/html-style-element/HTMLStyleElement"));
|
97
97
|
exports.HTMLStyleElement = HTMLStyleElement_1.default;
|
98
|
+
var HTMLSlotElement_1 = __importDefault(require("./nodes/html-slot-element/HTMLSlotElement"));
|
99
|
+
exports.HTMLSlotElement = HTMLSlotElement_1.default;
|
100
|
+
var HTMLLabelElement_1 = __importDefault(require("./nodes/html-label-element/HTMLLabelElement"));
|
101
|
+
exports.HTMLLabelElement = HTMLLabelElement_1.default;
|
98
102
|
var SVGElement_1 = __importDefault(require("./nodes/svg-element/SVGElement"));
|
99
103
|
exports.SVGElement = SVGElement_1.default;
|
100
104
|
var SVGGraphicsElement_1 = __importDefault(require("./nodes/svg-element/SVGGraphicsElement"));
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,2DAAqC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,2DAAqC;AA2GpC,iBA3GM,gBAAM,CA2GN;AAzGP,sEAAgD;AA2G/C,uBA3GM,sBAAY,CA2GN;AA1Gb,8EAAwD;A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AxGL,oEAA8C;AA0G7C,kBA1GM,iBAAO,CA0GN;AAxGR,oFAA8D;AA0G7D,uBA1GM,sBAAY,CA0GN;AAxGb,wEAAkD;AA0GjD,qBA1GM,oBAAU,CA0GN;AAzGX,iGAA2E;AA0G1E,gCA1GM,+BAAqB,CA0GN;AAzGtB,qEAA+C;AA0G9C,oBA1GM,mBAAS,CA0GN;AAzGV,iFAA2D;AA0G1D,wBA1GM,uBAAa,CA0GN;AAzGd,mEAA6C;AA0G5C,qBA1GM,oBAAU,CA0GN;AAzGX,qFAA+D;AA0G9D,8BA1GM,6BAAmB,CA0GN;AAzGpB,+EAAyD;AA0GxD,2BA1GM,0BAAgB,CA0GN;AAzGjB,sEAAgD;AA0G/C,wBA1GM,uBAAa,CA0GN;AAzGd,8DAAwC;AA0GvC,kBA1GM,iBAAO,CA0GN;AAzGR,wFAAkE;AA0GjE,0BA1GM,yBAAe,CA0GN"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import EventTarget from '../event/EventTarget';
|
2
|
+
import Event from '../event/Event';
|
3
|
+
/**
|
4
|
+
* Media Query List.
|
5
|
+
*
|
6
|
+
* Reference:
|
7
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList.
|
8
|
+
*/
|
9
|
+
export default class MediaQueryList extends EventTarget {
|
10
|
+
_matches: boolean;
|
11
|
+
_media: string;
|
12
|
+
onchange: (event: Event) => void;
|
13
|
+
/**
|
14
|
+
* Returns "true" if the document matches.
|
15
|
+
*
|
16
|
+
* @returns Matches.
|
17
|
+
*/
|
18
|
+
get matches(): boolean;
|
19
|
+
/**
|
20
|
+
* Returns the serialized media query.
|
21
|
+
*
|
22
|
+
* @returns Serialized media query.
|
23
|
+
*/
|
24
|
+
get media(): string;
|
25
|
+
/**
|
26
|
+
* Adds a listener.
|
27
|
+
*
|
28
|
+
* @deprecated
|
29
|
+
* @param callback Callback.
|
30
|
+
*/
|
31
|
+
addListener(callback: (event: Event) => void): void;
|
32
|
+
/**
|
33
|
+
* Removes listener.
|
34
|
+
*
|
35
|
+
* @deprecated
|
36
|
+
* @param callback Callback.
|
37
|
+
*/
|
38
|
+
removeListener(callback: (event: Event) => void): void;
|
39
|
+
}
|
@@ -0,0 +1,82 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
19
|
+
};
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
21
|
+
var EventTarget_1 = __importDefault(require("../event/EventTarget"));
|
22
|
+
/**
|
23
|
+
* Media Query List.
|
24
|
+
*
|
25
|
+
* Reference:
|
26
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList.
|
27
|
+
*/
|
28
|
+
var MediaQueryList = /** @class */ (function (_super) {
|
29
|
+
__extends(MediaQueryList, _super);
|
30
|
+
function MediaQueryList() {
|
31
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
32
|
+
_this._matches = false;
|
33
|
+
_this._media = '';
|
34
|
+
_this.onchange = null;
|
35
|
+
return _this;
|
36
|
+
}
|
37
|
+
Object.defineProperty(MediaQueryList.prototype, "matches", {
|
38
|
+
/**
|
39
|
+
* Returns "true" if the document matches.
|
40
|
+
*
|
41
|
+
* @returns Matches.
|
42
|
+
*/
|
43
|
+
get: function () {
|
44
|
+
return this._matches;
|
45
|
+
},
|
46
|
+
enumerable: false,
|
47
|
+
configurable: true
|
48
|
+
});
|
49
|
+
Object.defineProperty(MediaQueryList.prototype, "media", {
|
50
|
+
/**
|
51
|
+
* Returns the serialized media query.
|
52
|
+
*
|
53
|
+
* @returns Serialized media query.
|
54
|
+
*/
|
55
|
+
get: function () {
|
56
|
+
return this._media;
|
57
|
+
},
|
58
|
+
enumerable: false,
|
59
|
+
configurable: true
|
60
|
+
});
|
61
|
+
/**
|
62
|
+
* Adds a listener.
|
63
|
+
*
|
64
|
+
* @deprecated
|
65
|
+
* @param callback Callback.
|
66
|
+
*/
|
67
|
+
MediaQueryList.prototype.addListener = function (callback) {
|
68
|
+
this.addEventListener('change', callback);
|
69
|
+
};
|
70
|
+
/**
|
71
|
+
* Removes listener.
|
72
|
+
*
|
73
|
+
* @deprecated
|
74
|
+
* @param callback Callback.
|
75
|
+
*/
|
76
|
+
MediaQueryList.prototype.removeListener = function (callback) {
|
77
|
+
this.removeEventListener('change', callback);
|
78
|
+
};
|
79
|
+
return MediaQueryList;
|
80
|
+
}(EventTarget_1.default));
|
81
|
+
exports.default = MediaQueryList;
|
82
|
+
//# sourceMappingURL=MediaQueryList.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MediaQueryList.js","sourceRoot":"","sources":["../../src/match-media/MediaQueryList.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,qEAA+C;AAG/C;;;;;GAKG;AACH;IAA4C,kCAAW;IAAvD;QAAA,qEA0CC;QAzCO,cAAQ,GAAG,KAAK,CAAC;QACjB,YAAM,GAAG,EAAE,CAAC;QACZ,cAAQ,GAA2B,IAAI,CAAC;;IAuChD,CAAC;IAhCA,sBAAW,mCAAO;QALlB;;;;WAIG;aACH;YACC,OAAO,IAAI,CAAC,QAAQ,CAAC;QACtB,CAAC;;;OAAA;IAOD,sBAAW,iCAAK;QALhB;;;;WAIG;aACH;YACC,OAAO,IAAI,CAAC,MAAM,CAAC;QACpB,CAAC;;;OAAA;IAED;;;;;OAKG;IACI,oCAAW,GAAlB,UAAmB,QAAgC;QAClD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,uCAAc,GAArB,UAAsB,QAAgC;QACrD,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IACF,qBAAC;AAAD,CAAC,AA1CD,CAA4C,qBAAW,GA0CtD"}
|
@@ -10,6 +10,7 @@ import ValidityState from './ValidityState';
|
|
10
10
|
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement.
|
11
11
|
*/
|
12
12
|
export default interface IHTMLInputElement extends IHTMLElement {
|
13
|
+
readonly form: IHTMLFormElement;
|
13
14
|
formAction: string;
|
14
15
|
formMethod: string;
|
15
16
|
formNoValidate: boolean;
|
@@ -45,7 +46,6 @@ export default interface IHTMLInputElement extends IHTMLElement {
|
|
45
46
|
selectionStart: number;
|
46
47
|
selectionEnd: number;
|
47
48
|
selectionDirection: string;
|
48
|
-
form: IHTMLFormElement;
|
49
49
|
validity: ValidityState;
|
50
50
|
validationMessage: string;
|
51
51
|
willValidate: boolean;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import HTMLElement from '../html-element/HTMLElement';
|
2
|
+
import IHTMLElement from '../html-element/IHTMLElement';
|
3
|
+
import IHTMLFormElement from '../html-form-element/IHTMLFormElement';
|
4
|
+
import IHTMLLabelElement from './IHTMLLabelElement';
|
5
|
+
/**
|
6
|
+
* HTML Label Element.
|
7
|
+
*
|
8
|
+
* Reference:
|
9
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement.
|
10
|
+
*/
|
11
|
+
export default class HTMLLabelElement extends HTMLElement implements IHTMLLabelElement {
|
12
|
+
_htmlFor: string;
|
13
|
+
/**
|
14
|
+
* Returns a string containing the ID of the labeled control. This reflects the "for" attribute.
|
15
|
+
*
|
16
|
+
* @returns ID of the labeled control.
|
17
|
+
*/
|
18
|
+
get htmlFor(): string;
|
19
|
+
/**
|
20
|
+
* Sets a string containing the ID of the labeled control. This reflects the "for" attribute.
|
21
|
+
*
|
22
|
+
* @param htmlFor ID of the labeled control.
|
23
|
+
*/
|
24
|
+
set htmlFor(htmlFor: string);
|
25
|
+
/**
|
26
|
+
* Returns an HTML element representing the control with which the label is associated.
|
27
|
+
*
|
28
|
+
* @returns Control element.
|
29
|
+
*/
|
30
|
+
get control(): IHTMLElement;
|
31
|
+
/**
|
32
|
+
* Returns the parent form element.
|
33
|
+
*
|
34
|
+
* @returns Form.
|
35
|
+
*/
|
36
|
+
get form(): IHTMLFormElement;
|
37
|
+
/**
|
38
|
+
* Clones a node.
|
39
|
+
*
|
40
|
+
* @override
|
41
|
+
* @param [deep=false] "true" to clone deep.
|
42
|
+
* @returns Cloned node.
|
43
|
+
*/
|
44
|
+
cloneNode(deep?: boolean): IHTMLLabelElement;
|
45
|
+
}
|
@@ -0,0 +1,113 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
19
|
+
};
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
21
|
+
var HTMLElement_1 = __importDefault(require("../html-element/HTMLElement"));
|
22
|
+
/**
|
23
|
+
* HTML Label Element.
|
24
|
+
*
|
25
|
+
* Reference:
|
26
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement.
|
27
|
+
*/
|
28
|
+
var HTMLLabelElement = /** @class */ (function (_super) {
|
29
|
+
__extends(HTMLLabelElement, _super);
|
30
|
+
function HTMLLabelElement() {
|
31
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
32
|
+
_this._htmlFor = null;
|
33
|
+
return _this;
|
34
|
+
}
|
35
|
+
Object.defineProperty(HTMLLabelElement.prototype, "htmlFor", {
|
36
|
+
/**
|
37
|
+
* Returns a string containing the ID of the labeled control. This reflects the "for" attribute.
|
38
|
+
*
|
39
|
+
* @returns ID of the labeled control.
|
40
|
+
*/
|
41
|
+
get: function () {
|
42
|
+
var htmlFor = this.getAttributeNS(null, 'for');
|
43
|
+
if (htmlFor !== null) {
|
44
|
+
return htmlFor;
|
45
|
+
}
|
46
|
+
return htmlFor !== null ? htmlFor : '';
|
47
|
+
},
|
48
|
+
/**
|
49
|
+
* Sets a string containing the ID of the labeled control. This reflects the "for" attribute.
|
50
|
+
*
|
51
|
+
* @param htmlFor ID of the labeled control.
|
52
|
+
*/
|
53
|
+
set: function (htmlFor) {
|
54
|
+
this.setAttributeNS(null, 'for', htmlFor);
|
55
|
+
},
|
56
|
+
enumerable: false,
|
57
|
+
configurable: true
|
58
|
+
});
|
59
|
+
Object.defineProperty(HTMLLabelElement.prototype, "control", {
|
60
|
+
/**
|
61
|
+
* Returns an HTML element representing the control with which the label is associated.
|
62
|
+
*
|
63
|
+
* @returns Control element.
|
64
|
+
*/
|
65
|
+
get: function () {
|
66
|
+
var htmlFor = this.htmlFor;
|
67
|
+
if (htmlFor) {
|
68
|
+
return this.ownerDocument.getElementById(htmlFor);
|
69
|
+
}
|
70
|
+
for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
|
71
|
+
var child = _a[_i];
|
72
|
+
if (child.tagName === 'INPUT') {
|
73
|
+
return child;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
return null;
|
77
|
+
},
|
78
|
+
enumerable: false,
|
79
|
+
configurable: true
|
80
|
+
});
|
81
|
+
Object.defineProperty(HTMLLabelElement.prototype, "form", {
|
82
|
+
/**
|
83
|
+
* Returns the parent form element.
|
84
|
+
*
|
85
|
+
* @returns Form.
|
86
|
+
*/
|
87
|
+
get: function () {
|
88
|
+
var parent = this.parentNode;
|
89
|
+
while (parent && parent.tagName !== 'FORM') {
|
90
|
+
parent = parent.parentNode;
|
91
|
+
}
|
92
|
+
return parent;
|
93
|
+
},
|
94
|
+
enumerable: false,
|
95
|
+
configurable: true
|
96
|
+
});
|
97
|
+
/**
|
98
|
+
* Clones a node.
|
99
|
+
*
|
100
|
+
* @override
|
101
|
+
* @param [deep=false] "true" to clone deep.
|
102
|
+
* @returns Cloned node.
|
103
|
+
*/
|
104
|
+
HTMLLabelElement.prototype.cloneNode = function (deep) {
|
105
|
+
if (deep === void 0) { deep = false; }
|
106
|
+
var clone = _super.prototype.cloneNode.call(this, deep);
|
107
|
+
clone._htmlFor = this._htmlFor;
|
108
|
+
return clone;
|
109
|
+
};
|
110
|
+
return HTMLLabelElement;
|
111
|
+
}(HTMLElement_1.default));
|
112
|
+
exports.default = HTMLLabelElement;
|
113
|
+
//# sourceMappingURL=HTMLLabelElement.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"HTMLLabelElement.js","sourceRoot":"","sources":["../../../src/nodes/html-label-element/HTMLLabelElement.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,4EAAsD;AAKtD;;;;;GAKG;AACH;IAA8C,oCAAW;IAAzD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AK,GAAqB,iBAAM,SAAS,YAAC,IAAI,CAAC,CAAC;QACtD,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IACF,uBAAC;AAAD,CAAC,AApED,CAA8C,qBAAW,GAoExD"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import IHTMLElement from '../html-element/IHTMLElement';
|
2
|
+
import IHTMLFormElement from '../html-form-element/IHTMLFormElement';
|
3
|
+
/**
|
4
|
+
* HTML Label Element.
|
5
|
+
*
|
6
|
+
* Reference:
|
7
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement.
|
8
|
+
*/
|
9
|
+
export default interface IHTMLLabelElement extends IHTMLElement {
|
10
|
+
readonly control: IHTMLElement;
|
11
|
+
readonly form: IHTMLFormElement;
|
12
|
+
htmlFor: string;
|
13
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"IHTMLLabelElement.js","sourceRoot":"","sources":["../../../src/nodes/html-label-element/IHTMLLabelElement.ts"],"names":[],"mappings":""}
|
@@ -414,7 +414,7 @@ var HTMLTextAreaElement = /** @class */ (function (_super) {
|
|
414
414
|
get: function () {
|
415
415
|
var parent = this.parentNode;
|
416
416
|
while (parent && parent.tagName !== 'FORM') {
|
417
|
-
parent =
|
417
|
+
parent = parent.parentNode;
|
418
418
|
}
|
419
419
|
return parent;
|
420
420
|
},
|