happy-dom 2.55.0 → 3.1.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 +26 -6
- package/lib/async-task-manager/AsyncTaskManager.js +34 -78
- package/lib/async-task-manager/AsyncTaskManager.js.map +1 -1
- package/lib/attribute/Attr.js +19 -28
- package/lib/attribute/Attr.js.map +1 -1
- package/lib/config/ElementTag.js +15 -15
- package/lib/config/ElementTag.js.map +1 -1
- package/lib/cookie/CookieUtility.js +21 -26
- package/lib/cookie/CookieUtility.js.map +1 -1
- package/lib/css/CSS.js +12 -18
- package/lib/css/CSS.js.map +1 -1
- package/lib/css/CSSParser.js +29 -33
- package/lib/css/CSSParser.js.map +1 -1
- package/lib/css/CSSRule.js +24 -29
- package/lib/css/CSSRule.js.map +1 -1
- package/lib/css/CSSStyleDeclaration.js +4516 -6005
- package/lib/css/CSSStyleDeclaration.js.map +1 -1
- package/lib/css/CSSStyleSheet.js +17 -59
- package/lib/css/CSSStyleSheet.js.map +1 -1
- package/lib/css/CSSUnitValue.js +4 -5
- package/lib/css/CSSUnitValue.js.map +1 -1
- package/lib/css/MediaList.js +23 -28
- package/lib/css/MediaList.js.map +1 -1
- package/lib/css/rules/CSSFontFaceRule.js +6 -24
- package/lib/css/rules/CSSFontFaceRule.js.map +1 -1
- package/lib/css/rules/CSSKeyframeRule.js +14 -36
- package/lib/css/rules/CSSKeyframeRule.js.map +1 -1
- package/lib/css/rules/CSSKeyframesRule.js +31 -54
- package/lib/css/rules/CSSKeyframesRule.js.map +1 -1
- package/lib/css/rules/CSSMediaRule.js +29 -56
- package/lib/css/rules/CSSMediaRule.js.map +1 -1
- package/lib/css/rules/CSSStyleRule.js +16 -38
- package/lib/css/rules/CSSStyleRule.js.map +1 -1
- package/lib/custom-element/CustomElementRegistry.js +21 -24
- package/lib/custom-element/CustomElementRegistry.js.map +1 -1
- package/lib/dom-implementation/DOMImplementation.js +12 -13
- package/lib/dom-implementation/DOMImplementation.js.map +1 -1
- package/lib/dom-parser/DOMParser.js +29 -35
- package/lib/dom-parser/DOMParser.js.map +1 -1
- package/lib/dom-token-list/DOMTokenList.js +64 -79
- package/lib/dom-token-list/DOMTokenList.js.map +1 -1
- package/lib/event/DataTransfer.js +4 -5
- package/lib/event/DataTransfer.js.map +1 -1
- package/lib/event/DataTransferItem.js +7 -8
- package/lib/event/DataTransferItem.js.map +1 -1
- package/lib/event/DataTransferItemList.js +10 -11
- package/lib/event/DataTransferItemList.js.map +1 -1
- package/lib/event/Event.js +11 -15
- package/lib/event/Event.js.map +1 -1
- package/lib/event/EventTarget.js +14 -16
- package/lib/event/EventTarget.js.map +1 -1
- package/lib/event/IUIEventInit.d.ts +2 -2
- package/lib/event/UIEvent.d.ts +2 -2
- package/lib/event/UIEvent.js +25 -46
- package/lib/event/UIEvent.js.map +1 -1
- package/lib/event/events/AnimationEvent.js +11 -29
- package/lib/event/events/AnimationEvent.js.map +1 -1
- package/lib/event/events/CustomEvent.js +9 -31
- package/lib/event/events/CustomEvent.js.map +1 -1
- package/lib/event/events/ErrorEvent.js +15 -34
- package/lib/event/events/ErrorEvent.js.map +1 -1
- package/lib/event/events/FocusEvent.js +7 -26
- package/lib/event/events/FocusEvent.js.map +1 -1
- package/lib/event/events/InputEvent.js +13 -32
- package/lib/event/events/InputEvent.js.map +1 -1
- package/lib/event/events/KeyboardEvent.js +27 -46
- package/lib/event/events/KeyboardEvent.js.map +1 -1
- package/lib/event/events/MouseEvent.js +33 -52
- package/lib/event/events/MouseEvent.js.map +1 -1
- package/lib/event/events/PointerEvent.js +25 -44
- package/lib/event/events/PointerEvent.js.map +1 -1
- package/lib/event/events/ProgressEvent.js +11 -30
- package/lib/event/events/ProgressEvent.js.map +1 -1
- package/lib/event/events/StorageEvent.js +13 -32
- package/lib/event/events/StorageEvent.js.map +1 -1
- package/lib/event/events/WheelEvent.js +16 -35
- package/lib/event/events/WheelEvent.js.map +1 -1
- package/lib/exception/DOMException.js +5 -24
- package/lib/exception/DOMException.js.map +1 -1
- package/lib/fetch/FetchHandler.js +18 -22
- package/lib/fetch/FetchHandler.js.map +1 -1
- package/lib/fetch/Headers.js +3 -23
- package/lib/fetch/Headers.js.map +1 -1
- package/lib/fetch/Request.js +61 -81
- package/lib/fetch/Request.js.map +1 -1
- package/lib/fetch/ResourceFetchHandler.js +18 -67
- package/lib/fetch/ResourceFetchHandler.js.map +1 -1
- package/lib/fetch/Response.js +61 -81
- package/lib/fetch/Response.js.map +1 -1
- package/lib/file/Blob.js +29 -78
- package/lib/file/Blob.js.map +1 -1
- package/lib/file/File.js +9 -27
- package/lib/file/File.js.map +1 -1
- package/lib/file/FileReader.js +57 -78
- package/lib/file/FileReader.js.map +1 -1
- package/lib/history/History.js +32 -37
- package/lib/history/History.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +69 -69
- package/lib/index.js.map +1 -1
- package/lib/location/Location.js +11 -28
- package/lib/location/Location.js.map +1 -1
- package/lib/location/RelativeURL.js +5 -8
- package/lib/location/RelativeURL.js.map +1 -1
- package/lib/location/URL.js +46 -59
- package/lib/location/URL.js.map +1 -1
- package/lib/match-media/MediaQueryList.js +28 -54
- package/lib/match-media/MediaQueryList.js.map +1 -1
- package/lib/mutation-observer/MutationListener.js +3 -4
- package/lib/mutation-observer/MutationListener.js.map +1 -1
- package/lib/mutation-observer/MutationObserver.js +12 -13
- package/lib/mutation-observer/MutationObserver.js.map +1 -1
- package/lib/mutation-observer/MutationRecord.js +3 -4
- package/lib/mutation-observer/MutationRecord.js.map +1 -1
- package/lib/navigator/MimeType.js +5 -6
- package/lib/navigator/MimeType.js.map +1 -1
- package/lib/navigator/MimeTypeArray.js +10 -11
- package/lib/navigator/MimeTypeArray.js.map +1 -1
- package/lib/navigator/Navigator.js +7 -8
- package/lib/navigator/Navigator.js.map +1 -1
- package/lib/navigator/Plugin.js +10 -11
- package/lib/navigator/Plugin.js.map +1 -1
- package/lib/navigator/PluginArray.js +12 -13
- package/lib/navigator/PluginArray.js.map +1 -1
- package/lib/nodes/character-data/CharacterData.js +119 -184
- package/lib/nodes/character-data/CharacterData.js.map +1 -1
- package/lib/nodes/character-data/CharacterDataUtility.js +12 -15
- package/lib/nodes/character-data/CharacterDataUtility.js.map +1 -1
- package/lib/nodes/child-node/ChildNodeUtility.js +24 -45
- package/lib/nodes/child-node/ChildNodeUtility.js.map +1 -1
- package/lib/nodes/child-node/NonDocumentChildNodeUtility.js +9 -12
- package/lib/nodes/child-node/NonDocumentChildNodeUtility.js.map +1 -1
- package/lib/nodes/comment/Comment.js +20 -43
- package/lib/nodes/comment/Comment.js.map +1 -1
- package/lib/nodes/document/Document.d.ts +3 -3
- package/lib/nodes/document/Document.js +334 -461
- package/lib/nodes/document/Document.js.map +1 -1
- package/lib/nodes/document/DocumentReadyStateManager.js +16 -19
- package/lib/nodes/document/DocumentReadyStateManager.js.map +1 -1
- package/lib/nodes/document/IDocument.d.ts +2 -2
- package/lib/nodes/document-fragment/DocumentFragment.js +93 -153
- package/lib/nodes/document-fragment/DocumentFragment.js.map +1 -1
- package/lib/nodes/document-type/DocumentType.js +22 -45
- package/lib/nodes/document-type/DocumentType.js.map +1 -1
- package/lib/nodes/element/DOMRect.js +3 -4
- package/lib/nodes/element/DOMRect.js.map +1 -1
- package/lib/nodes/element/Element.js +367 -496
- package/lib/nodes/element/Element.js.map +1 -1
- package/lib/nodes/element/HTMLCollection.js +4 -24
- package/lib/nodes/element/HTMLCollection.js.map +1 -1
- package/lib/nodes/element/HTMLCollectionFactory.js +6 -9
- package/lib/nodes/element/HTMLCollectionFactory.js.map +1 -1
- package/lib/nodes/element/Range.js +89 -114
- package/lib/nodes/element/Range.js.map +1 -1
- package/lib/nodes/html-base-element/HTMLBaseElement.js +41 -70
- package/lib/nodes/html-base-element/HTMLBaseElement.js.map +1 -1
- package/lib/nodes/html-document/HTMLDocument.js +3 -23
- package/lib/nodes/html-document/HTMLDocument.js.map +1 -1
- package/lib/nodes/html-element/DatasetUtility.js +9 -12
- package/lib/nodes/html-element/DatasetUtility.js.map +1 -1
- package/lib/nodes/html-element/HTMLElement.js +232 -290
- package/lib/nodes/html-element/HTMLElement.js.map +1 -1
- package/lib/nodes/html-form-element/HTMLFormElement.js +170 -235
- package/lib/nodes/html-form-element/HTMLFormElement.js.map +1 -1
- package/lib/nodes/html-image-element/HTMLImageElement.js +178 -237
- package/lib/nodes/html-image-element/HTMLImageElement.js.map +1 -1
- package/lib/nodes/html-image-element/Image.js +7 -27
- package/lib/nodes/html-image-element/Image.js.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElement.js +705 -872
- package/lib/nodes/html-input-element/HTMLInputElement.js.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElementValueSanitizer.js +9 -12
- package/lib/nodes/html-input-element/HTMLInputElementValueSanitizer.js.map +1 -1
- package/lib/nodes/html-input-element/HTMLInputElementValueStepping.js +5 -8
- package/lib/nodes/html-input-element/HTMLInputElementValueStepping.js.map +1 -1
- package/lib/nodes/html-input-element/ValidityState.js +47 -69
- package/lib/nodes/html-input-element/ValidityState.js.map +1 -1
- package/lib/nodes/html-label-element/HTMLLabelElement.js +53 -87
- package/lib/nodes/html-label-element/HTMLLabelElement.js.map +1 -1
- package/lib/nodes/html-link-element/HTMLLinkElement.js +197 -252
- package/lib/nodes/html-link-element/HTMLLinkElement.js.map +1 -1
- package/lib/nodes/html-meta-element/HTMLMetaElement.js +66 -102
- package/lib/nodes/html-meta-element/HTMLMetaElement.js.map +1 -1
- package/lib/nodes/html-script-element/HTMLScriptElement.js +145 -193
- package/lib/nodes/html-script-element/HTMLScriptElement.js.map +1 -1
- package/lib/nodes/html-script-element/ScriptUtility.js +58 -112
- package/lib/nodes/html-script-element/ScriptUtility.js.map +1 -1
- package/lib/nodes/html-slot-element/HTMLSlotElement.js +33 -65
- package/lib/nodes/html-slot-element/HTMLSlotElement.js.map +1 -1
- package/lib/nodes/html-style-element/HTMLStyleElement.js +75 -109
- package/lib/nodes/html-style-element/HTMLStyleElement.js.map +1 -1
- package/lib/nodes/html-template-element/HTMLTemplateElement.js +60 -99
- package/lib/nodes/html-template-element/HTMLTemplateElement.js.map +1 -1
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js +349 -444
- package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js.map +1 -1
- package/lib/nodes/html-unknown-element/HTMLUnknownElement.js +17 -37
- package/lib/nodes/html-unknown-element/HTMLUnknownElement.js.map +1 -1
- package/lib/nodes/node/Node.js +193 -260
- package/lib/nodes/node/Node.js.map +1 -1
- package/lib/nodes/node/NodeList.js +4 -24
- package/lib/nodes/node/NodeList.js.map +1 -1
- package/lib/nodes/node/NodeListFactory.js +6 -9
- package/lib/nodes/node/NodeListFactory.js.map +1 -1
- package/lib/nodes/parent-node/ParentNodeUtility.js +43 -78
- package/lib/nodes/parent-node/ParentNodeUtility.js.map +1 -1
- package/lib/nodes/shadow-root/ShadowRoot.js +53 -83
- package/lib/nodes/shadow-root/ShadowRoot.js.map +1 -1
- package/lib/nodes/svg-document/SVGDocument.js +3 -23
- package/lib/nodes/svg-document/SVGDocument.js.map +1 -1
- package/lib/nodes/svg-element/DOMMatrix.js +3 -4
- package/lib/nodes/svg-element/DOMMatrix.js.map +1 -1
- package/lib/nodes/svg-element/SVGAngle.js +10 -11
- package/lib/nodes/svg-element/SVGAngle.js.map +1 -1
- package/lib/nodes/svg-element/SVGAnimatedRect.js +4 -5
- package/lib/nodes/svg-element/SVGAnimatedRect.js.map +1 -1
- package/lib/nodes/svg-element/SVGElement.js +58 -93
- package/lib/nodes/svg-element/SVGElement.js.map +1 -1
- package/lib/nodes/svg-element/SVGGraphicsElement.js +14 -32
- package/lib/nodes/svg-element/SVGGraphicsElement.js.map +1 -1
- package/lib/nodes/svg-element/SVGLength.js +16 -17
- package/lib/nodes/svg-element/SVGLength.js.map +1 -1
- package/lib/nodes/svg-element/SVGNumber.js +3 -4
- package/lib/nodes/svg-element/SVGNumber.js.map +1 -1
- package/lib/nodes/svg-element/SVGPoint.js +3 -4
- package/lib/nodes/svg-element/SVGPoint.js.map +1 -1
- package/lib/nodes/svg-element/SVGRect.js +3 -4
- package/lib/nodes/svg-element/SVGRect.js.map +1 -1
- package/lib/nodes/svg-element/SVGSVGElement.js +187 -248
- package/lib/nodes/svg-element/SVGSVGElement.js.map +1 -1
- package/lib/nodes/svg-element/SVGTransform.js +16 -17
- package/lib/nodes/svg-element/SVGTransform.js.map +1 -1
- package/lib/nodes/text/Text.js +20 -43
- package/lib/nodes/text/Text.js.map +1 -1
- package/lib/nodes/xml-document/XMLDocument.js +3 -23
- package/lib/nodes/xml-document/XMLDocument.js.map +1 -1
- package/lib/query-selector/QuerySelector.js +36 -44
- package/lib/query-selector/QuerySelector.js.map +1 -1
- package/lib/query-selector/SelectorItem.js +62 -66
- package/lib/query-selector/SelectorItem.js.map +1 -1
- package/lib/resize-observer/ResizeObserver.js +8 -11
- package/lib/resize-observer/ResizeObserver.js.map +1 -1
- package/lib/screen/Screen.js +3 -4
- package/lib/screen/Screen.js.map +1 -1
- package/lib/selection/Selection.js +29 -30
- package/lib/selection/Selection.js.map +1 -1
- package/lib/storage/Storage.js +22 -27
- package/lib/storage/Storage.js.map +1 -1
- package/lib/tree-walker/NodeFilterMask.js +1 -1
- package/lib/tree-walker/NodeFilterMask.js.map +1 -1
- package/lib/tree-walker/TreeWalker.js +30 -33
- package/lib/tree-walker/TreeWalker.js.map +1 -1
- package/lib/window/GlobalWindow.d.ts +90 -0
- package/lib/window/GlobalWindow.js +98 -0
- package/lib/window/GlobalWindow.js.map +1 -0
- package/lib/window/IWindow.d.ts +35 -18
- package/lib/window/VMGlobalPropertyScript.d.ts +2 -0
- package/lib/window/VMGlobalPropertyScript.js +65 -0
- package/lib/window/VMGlobalPropertyScript.js.map +1 -0
- package/lib/window/Window.d.ts +84 -105
- package/lib/window/Window.js +286 -490
- package/lib/window/Window.js.map +1 -1
- package/lib/xml-parser/XMLParser.js +65 -71
- package/lib/xml-parser/XMLParser.js.map +1 -1
- package/lib/xml-serializer/XMLSerializer.js +30 -37
- package/lib/xml-serializer/XMLSerializer.js.map +1 -1
- package/package.json +6 -7
- package/src/dom-parser/DOMParser.ts +4 -5
- package/src/event/IUIEventInit.ts +2 -2
- package/src/event/UIEvent.ts +2 -2
- package/src/fetch/FetchHandler.ts +3 -3
- package/src/fetch/ResourceFetchHandler.ts +2 -2
- package/src/index.ts +3 -3
- package/src/nodes/document/Document.ts +4 -4
- package/src/nodes/document/IDocument.ts +2 -2
- package/src/nodes/html-link-element/HTMLLinkElement.ts +8 -2
- package/src/nodes/html-script-element/ScriptUtility.ts +4 -4
- package/src/window/GlobalWindow.ts +91 -0
- package/src/window/IWindow.ts +31 -12
- package/src/window/VMGlobalPropertyScript.ts +62 -0
- package/src/window/Window.ts +125 -173
- package/tsconfig.json +1 -1
- package/lib/window/AsyncWindow.d.ts +0 -10
- package/lib/window/AsyncWindow.js +0 -38
- package/lib/window/AsyncWindow.js.map +0 -1
- package/src/window/AsyncWindow.ts +0 -17
@@ -1,438 +1,349 @@
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
19
4
|
};
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
6
|
+
const Event_1 = __importDefault(require("../../event/Event"));
|
7
|
+
const DOMException_1 = __importDefault(require("../../exception/DOMException"));
|
8
|
+
const DOMExceptionNameEnum_1 = __importDefault(require("../../exception/DOMExceptionNameEnum"));
|
9
|
+
const HTMLElement_1 = __importDefault(require("../html-element/HTMLElement"));
|
10
|
+
const HTMLInputElementSelectionDirectionEnum_1 = __importDefault(require("../html-input-element/HTMLInputElementSelectionDirectionEnum"));
|
11
|
+
const HTMLInputElementSelectionModeEnum_1 = __importDefault(require("../html-input-element/HTMLInputElementSelectionModeEnum"));
|
27
12
|
/**
|
28
13
|
* HTML Text Area Element.
|
29
14
|
*
|
30
15
|
* Reference:
|
31
16
|
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement.
|
32
17
|
*/
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
}
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
return this.getAttributeNS(null, '
|
271
|
-
}
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
}
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
return this.getAttributeNS(null, 'required') !== null;
|
296
|
-
},
|
297
|
-
/**
|
298
|
-
* Sets required.
|
299
|
-
*
|
300
|
-
* @param required Required.
|
301
|
-
*/
|
302
|
-
set: function (required) {
|
303
|
-
if (!required) {
|
304
|
-
this.removeAttributeNS(null, 'required');
|
305
|
-
}
|
306
|
-
else {
|
307
|
-
this.setAttributeNS(null, 'required', '');
|
308
|
-
}
|
309
|
-
},
|
310
|
-
enumerable: false,
|
311
|
-
configurable: true
|
312
|
-
});
|
313
|
-
Object.defineProperty(HTMLTextAreaElement.prototype, "value", {
|
314
|
-
/**
|
315
|
-
* Returns value.
|
316
|
-
*
|
317
|
-
* @returns Value.
|
318
|
-
*/
|
319
|
-
get: function () {
|
320
|
-
if (this._value === null) {
|
321
|
-
return this.getAttributeNS(null, 'value') || '';
|
322
|
-
}
|
323
|
-
return this._value;
|
324
|
-
},
|
325
|
-
/**
|
326
|
-
* Sets value.
|
327
|
-
*
|
328
|
-
* @param value Value.
|
329
|
-
*/
|
330
|
-
set: function (value) {
|
331
|
-
var oldValue = this._value;
|
332
|
-
this._value = value;
|
333
|
-
if (oldValue !== this._value) {
|
334
|
-
this._selectionStart = this._value.length;
|
335
|
-
this._selectionEnd = this._value.length;
|
336
|
-
this._selectionDirection = HTMLInputElementSelectionDirectionEnum_1.default.none;
|
337
|
-
}
|
338
|
-
},
|
339
|
-
enumerable: false,
|
340
|
-
configurable: true
|
341
|
-
});
|
342
|
-
Object.defineProperty(HTMLTextAreaElement.prototype, "selectionStart", {
|
343
|
-
/**
|
344
|
-
* Returns selection start.
|
345
|
-
*
|
346
|
-
* @returns Selection start.
|
347
|
-
*/
|
348
|
-
get: function () {
|
349
|
-
if (this._selectionStart === null) {
|
350
|
-
return this.value.length;
|
351
|
-
}
|
352
|
-
return this._selectionStart;
|
353
|
-
},
|
354
|
-
/**
|
355
|
-
* Sets selection start.
|
356
|
-
*
|
357
|
-
* @param start Start.
|
358
|
-
*/
|
359
|
-
set: function (start) {
|
360
|
-
this.setSelectionRange(start, Math.max(start, this.selectionEnd), this._selectionDirection);
|
361
|
-
},
|
362
|
-
enumerable: false,
|
363
|
-
configurable: true
|
364
|
-
});
|
365
|
-
Object.defineProperty(HTMLTextAreaElement.prototype, "selectionEnd", {
|
366
|
-
/**
|
367
|
-
* Returns selection end.
|
368
|
-
*
|
369
|
-
* @returns Selection end.
|
370
|
-
*/
|
371
|
-
get: function () {
|
372
|
-
if (this._selectionEnd === null) {
|
373
|
-
return this.value.length;
|
374
|
-
}
|
375
|
-
return this._selectionEnd;
|
376
|
-
},
|
377
|
-
/**
|
378
|
-
* Sets selection end.
|
379
|
-
*
|
380
|
-
* @param end End.
|
381
|
-
*/
|
382
|
-
set: function (end) {
|
383
|
-
this.setSelectionRange(this.selectionStart, end, this._selectionDirection);
|
384
|
-
},
|
385
|
-
enumerable: false,
|
386
|
-
configurable: true
|
387
|
-
});
|
388
|
-
Object.defineProperty(HTMLTextAreaElement.prototype, "selectionDirection", {
|
389
|
-
/**
|
390
|
-
* Returns selection direction.
|
391
|
-
*
|
392
|
-
* @returns Selection direction.
|
393
|
-
*/
|
394
|
-
get: function () {
|
395
|
-
return this._selectionDirection;
|
396
|
-
},
|
397
|
-
/**
|
398
|
-
* Sets selection direction.
|
399
|
-
*
|
400
|
-
* @param direction Direction.
|
401
|
-
*/
|
402
|
-
set: function (direction) {
|
403
|
-
this.setSelectionRange(this._selectionStart, this._selectionEnd, direction);
|
404
|
-
},
|
405
|
-
enumerable: false,
|
406
|
-
configurable: true
|
407
|
-
});
|
408
|
-
Object.defineProperty(HTMLTextAreaElement.prototype, "form", {
|
409
|
-
/**
|
410
|
-
* Returns the parent form element.
|
411
|
-
*
|
412
|
-
* @returns Form.
|
413
|
-
*/
|
414
|
-
get: function () {
|
415
|
-
var parent = this.parentNode;
|
416
|
-
while (parent && parent.tagName !== 'FORM') {
|
417
|
-
parent = parent.parentNode;
|
418
|
-
}
|
419
|
-
return parent;
|
420
|
-
},
|
421
|
-
enumerable: false,
|
422
|
-
configurable: true
|
423
|
-
});
|
424
|
-
Object.defineProperty(HTMLTextAreaElement.prototype, "textLength", {
|
425
|
-
/**
|
426
|
-
* Returns text length.
|
427
|
-
*
|
428
|
-
* @param Text Length.
|
429
|
-
*/
|
430
|
-
get: function () {
|
18
|
+
class HTMLTextAreaElement extends HTMLElement_1.default {
|
19
|
+
constructor() {
|
20
|
+
super(...arguments);
|
21
|
+
this.type = 'textarea';
|
22
|
+
this._value = null;
|
23
|
+
this._selectionStart = null;
|
24
|
+
this._selectionEnd = null;
|
25
|
+
this._selectionDirection = HTMLInputElementSelectionDirectionEnum_1.default.none;
|
26
|
+
this.defaultValue = '';
|
27
|
+
}
|
28
|
+
/**
|
29
|
+
* Returns minlength.
|
30
|
+
*
|
31
|
+
* @returns Min length.
|
32
|
+
*/
|
33
|
+
get minLength() {
|
34
|
+
const minLength = this.getAttributeNS(null, 'minlength');
|
35
|
+
if (minLength !== null) {
|
36
|
+
return parseInt(minLength);
|
37
|
+
}
|
38
|
+
return -1;
|
39
|
+
}
|
40
|
+
/**
|
41
|
+
* Sets minlength.
|
42
|
+
*
|
43
|
+
* @param minLength Min length.
|
44
|
+
*/
|
45
|
+
set minLength(minlength) {
|
46
|
+
this.setAttributeNS(null, 'minlength', String(minlength));
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* Returns maxlength.
|
50
|
+
*
|
51
|
+
* @returns Max length.
|
52
|
+
*/
|
53
|
+
get maxLength() {
|
54
|
+
const maxLength = this.getAttributeNS(null, 'maxlength');
|
55
|
+
if (maxLength !== null) {
|
56
|
+
return parseInt(maxLength);
|
57
|
+
}
|
58
|
+
return -1;
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* Sets maxlength.
|
62
|
+
*
|
63
|
+
* @param maxlength Max length.
|
64
|
+
*/
|
65
|
+
set maxLength(maxLength) {
|
66
|
+
this.setAttributeNS(null, 'maxlength', String(maxLength));
|
67
|
+
}
|
68
|
+
/**
|
69
|
+
* Returns name.
|
70
|
+
*
|
71
|
+
* @returns Name.
|
72
|
+
*/
|
73
|
+
get name() {
|
74
|
+
return this.getAttributeNS(null, 'name') || '';
|
75
|
+
}
|
76
|
+
/**
|
77
|
+
* Sets name.
|
78
|
+
*
|
79
|
+
* @param name Name.
|
80
|
+
*/
|
81
|
+
set name(name) {
|
82
|
+
this.setAttributeNS(null, 'name', name);
|
83
|
+
}
|
84
|
+
/**
|
85
|
+
* Returns placeholder.
|
86
|
+
*
|
87
|
+
* @returns Placeholder.
|
88
|
+
*/
|
89
|
+
get placeholder() {
|
90
|
+
return this.getAttributeNS(null, 'placeholder') || '';
|
91
|
+
}
|
92
|
+
/**
|
93
|
+
* Sets placeholder.
|
94
|
+
*
|
95
|
+
* @param placeholder Placeholder.
|
96
|
+
*/
|
97
|
+
set placeholder(placeholder) {
|
98
|
+
this.setAttributeNS(null, 'placeholder', placeholder);
|
99
|
+
}
|
100
|
+
/**
|
101
|
+
* Returns inputmode.
|
102
|
+
*
|
103
|
+
* @returns Inputmode.
|
104
|
+
*/
|
105
|
+
get inputmode() {
|
106
|
+
return this.getAttributeNS(null, 'inputmode') || '';
|
107
|
+
}
|
108
|
+
/**
|
109
|
+
* Sets inputmode.
|
110
|
+
*
|
111
|
+
* @param inputmode Inputmode.
|
112
|
+
*/
|
113
|
+
set inputmode(inputmode) {
|
114
|
+
this.setAttributeNS(null, 'inputmode', inputmode);
|
115
|
+
}
|
116
|
+
/**
|
117
|
+
* Returns cols.
|
118
|
+
*
|
119
|
+
* @returns Cols.
|
120
|
+
*/
|
121
|
+
get cols() {
|
122
|
+
return this.getAttributeNS(null, 'cols') || '';
|
123
|
+
}
|
124
|
+
/**
|
125
|
+
* Sets cols.
|
126
|
+
*
|
127
|
+
* @param cols Cols.
|
128
|
+
*/
|
129
|
+
set cols(cols) {
|
130
|
+
this.setAttributeNS(null, 'cols', cols);
|
131
|
+
}
|
132
|
+
/**
|
133
|
+
* Returns rows.
|
134
|
+
*
|
135
|
+
* @returns Rows.
|
136
|
+
*/
|
137
|
+
get rows() {
|
138
|
+
return this.getAttributeNS(null, 'rows') || '';
|
139
|
+
}
|
140
|
+
/**
|
141
|
+
* Sets rows.
|
142
|
+
*
|
143
|
+
* @param rows Rows.
|
144
|
+
*/
|
145
|
+
set rows(rows) {
|
146
|
+
this.setAttributeNS(null, 'rows', rows);
|
147
|
+
}
|
148
|
+
/**
|
149
|
+
* Returns autocomplete.
|
150
|
+
*
|
151
|
+
* @returns Autocomplete.
|
152
|
+
*/
|
153
|
+
get autocomplete() {
|
154
|
+
return this.getAttributeNS(null, 'autocomplete') || '';
|
155
|
+
}
|
156
|
+
/**
|
157
|
+
* Sets autocomplete.
|
158
|
+
*
|
159
|
+
* @param autocomplete Autocomplete.
|
160
|
+
*/
|
161
|
+
set autocomplete(autocomplete) {
|
162
|
+
this.setAttributeNS(null, 'autocomplete', autocomplete);
|
163
|
+
}
|
164
|
+
/**
|
165
|
+
* Returns readOnly.
|
166
|
+
*
|
167
|
+
* @returns ReadOnly.
|
168
|
+
*/
|
169
|
+
get readOnly() {
|
170
|
+
return this.getAttributeNS(null, 'readonly') !== null;
|
171
|
+
}
|
172
|
+
/**
|
173
|
+
* Sets readOnly.
|
174
|
+
*
|
175
|
+
* @param readOnly ReadOnly.
|
176
|
+
*/
|
177
|
+
set readOnly(readOnly) {
|
178
|
+
if (!readOnly) {
|
179
|
+
this.removeAttributeNS(null, 'readonly');
|
180
|
+
}
|
181
|
+
else {
|
182
|
+
this.setAttributeNS(null, 'readonly', '');
|
183
|
+
}
|
184
|
+
}
|
185
|
+
/**
|
186
|
+
* Returns disabled.
|
187
|
+
*
|
188
|
+
* @returns Disabled.
|
189
|
+
*/
|
190
|
+
get disabled() {
|
191
|
+
return this.getAttributeNS(null, 'disabled') !== null;
|
192
|
+
}
|
193
|
+
/**
|
194
|
+
* Sets disabled.
|
195
|
+
*
|
196
|
+
* @param disabled Disabled.
|
197
|
+
*/
|
198
|
+
set disabled(disabled) {
|
199
|
+
if (!disabled) {
|
200
|
+
this.removeAttributeNS(null, 'disabled');
|
201
|
+
}
|
202
|
+
else {
|
203
|
+
this.setAttributeNS(null, 'disabled', '');
|
204
|
+
}
|
205
|
+
}
|
206
|
+
/**
|
207
|
+
* Returns autofocus.
|
208
|
+
*
|
209
|
+
* @returns Autofocus.
|
210
|
+
*/
|
211
|
+
get autofocus() {
|
212
|
+
return this.getAttributeNS(null, 'autofocus') !== null;
|
213
|
+
}
|
214
|
+
/**
|
215
|
+
* Sets autofocus.
|
216
|
+
*
|
217
|
+
* @param autofocus Autofocus.
|
218
|
+
*/
|
219
|
+
set autofocus(autofocus) {
|
220
|
+
if (!autofocus) {
|
221
|
+
this.removeAttributeNS(null, 'autofocus');
|
222
|
+
}
|
223
|
+
else {
|
224
|
+
this.setAttributeNS(null, 'autofocus', '');
|
225
|
+
}
|
226
|
+
}
|
227
|
+
/**
|
228
|
+
* Returns required.
|
229
|
+
*
|
230
|
+
* @returns Required.
|
231
|
+
*/
|
232
|
+
get required() {
|
233
|
+
return this.getAttributeNS(null, 'required') !== null;
|
234
|
+
}
|
235
|
+
/**
|
236
|
+
* Sets required.
|
237
|
+
*
|
238
|
+
* @param required Required.
|
239
|
+
*/
|
240
|
+
set required(required) {
|
241
|
+
if (!required) {
|
242
|
+
this.removeAttributeNS(null, 'required');
|
243
|
+
}
|
244
|
+
else {
|
245
|
+
this.setAttributeNS(null, 'required', '');
|
246
|
+
}
|
247
|
+
}
|
248
|
+
/**
|
249
|
+
* Returns value.
|
250
|
+
*
|
251
|
+
* @returns Value.
|
252
|
+
*/
|
253
|
+
get value() {
|
254
|
+
if (this._value === null) {
|
255
|
+
return this.getAttributeNS(null, 'value') || '';
|
256
|
+
}
|
257
|
+
return this._value;
|
258
|
+
}
|
259
|
+
/**
|
260
|
+
* Sets value.
|
261
|
+
*
|
262
|
+
* @param value Value.
|
263
|
+
*/
|
264
|
+
set value(value) {
|
265
|
+
const oldValue = this._value;
|
266
|
+
this._value = value;
|
267
|
+
if (oldValue !== this._value) {
|
268
|
+
this._selectionStart = this._value.length;
|
269
|
+
this._selectionEnd = this._value.length;
|
270
|
+
this._selectionDirection = HTMLInputElementSelectionDirectionEnum_1.default.none;
|
271
|
+
}
|
272
|
+
}
|
273
|
+
/**
|
274
|
+
* Returns selection start.
|
275
|
+
*
|
276
|
+
* @returns Selection start.
|
277
|
+
*/
|
278
|
+
get selectionStart() {
|
279
|
+
if (this._selectionStart === null) {
|
431
280
|
return this.value.length;
|
432
|
-
}
|
433
|
-
|
434
|
-
|
435
|
-
|
281
|
+
}
|
282
|
+
return this._selectionStart;
|
283
|
+
}
|
284
|
+
/**
|
285
|
+
* Sets selection start.
|
286
|
+
*
|
287
|
+
* @param start Start.
|
288
|
+
*/
|
289
|
+
set selectionStart(start) {
|
290
|
+
this.setSelectionRange(start, Math.max(start, this.selectionEnd), this._selectionDirection);
|
291
|
+
}
|
292
|
+
/**
|
293
|
+
* Returns selection end.
|
294
|
+
*
|
295
|
+
* @returns Selection end.
|
296
|
+
*/
|
297
|
+
get selectionEnd() {
|
298
|
+
if (this._selectionEnd === null) {
|
299
|
+
return this.value.length;
|
300
|
+
}
|
301
|
+
return this._selectionEnd;
|
302
|
+
}
|
303
|
+
/**
|
304
|
+
* Sets selection end.
|
305
|
+
*
|
306
|
+
* @param end End.
|
307
|
+
*/
|
308
|
+
set selectionEnd(end) {
|
309
|
+
this.setSelectionRange(this.selectionStart, end, this._selectionDirection);
|
310
|
+
}
|
311
|
+
/**
|
312
|
+
* Returns selection direction.
|
313
|
+
*
|
314
|
+
* @returns Selection direction.
|
315
|
+
*/
|
316
|
+
get selectionDirection() {
|
317
|
+
return this._selectionDirection;
|
318
|
+
}
|
319
|
+
/**
|
320
|
+
* Sets selection direction.
|
321
|
+
*
|
322
|
+
* @param direction Direction.
|
323
|
+
*/
|
324
|
+
set selectionDirection(direction) {
|
325
|
+
this.setSelectionRange(this._selectionStart, this._selectionEnd, direction);
|
326
|
+
}
|
327
|
+
/**
|
328
|
+
* Returns the parent form element.
|
329
|
+
*
|
330
|
+
* @returns Form.
|
331
|
+
*/
|
332
|
+
get form() {
|
333
|
+
let parent = this.parentNode;
|
334
|
+
while (parent && parent.tagName !== 'FORM') {
|
335
|
+
parent = parent.parentNode;
|
336
|
+
}
|
337
|
+
return parent;
|
338
|
+
}
|
339
|
+
/**
|
340
|
+
* Returns text length.
|
341
|
+
*
|
342
|
+
* @param Text Length.
|
343
|
+
*/
|
344
|
+
get textLength() {
|
345
|
+
return this.value.length;
|
346
|
+
}
|
436
347
|
/**
|
437
348
|
* Set selection range.
|
438
349
|
*
|
@@ -440,8 +351,7 @@ var HTMLTextAreaElement = /** @class */ (function (_super) {
|
|
440
351
|
* @param end End.
|
441
352
|
* @param [direction="none"] Direction.
|
442
353
|
*/
|
443
|
-
|
444
|
-
if (direction === void 0) { direction = 'none'; }
|
354
|
+
setSelectionRange(start, end, direction = 'none') {
|
445
355
|
this._selectionEnd = Math.min(end, this.value.length);
|
446
356
|
this._selectionStart = Math.min(start, this._selectionEnd);
|
447
357
|
this._selectionDirection =
|
@@ -450,7 +360,7 @@ var HTMLTextAreaElement = /** @class */ (function (_super) {
|
|
450
360
|
? direction
|
451
361
|
: HTMLInputElementSelectionDirectionEnum_1.default.none;
|
452
362
|
this.dispatchEvent(new Event_1.default('select', { bubbles: true, cancelable: true }));
|
453
|
-
}
|
363
|
+
}
|
454
364
|
/**
|
455
365
|
* Set range text.
|
456
366
|
*
|
@@ -460,10 +370,7 @@ var HTMLTextAreaElement = /** @class */ (function (_super) {
|
|
460
370
|
* @param [direction] Direction.
|
461
371
|
* @param selectionMode
|
462
372
|
*/
|
463
|
-
|
464
|
-
if (start === void 0) { start = null; }
|
465
|
-
if (end === void 0) { end = null; }
|
466
|
-
if (selectionMode === void 0) { selectionMode = HTMLInputElementSelectionModeEnum_1.default.preserve; }
|
373
|
+
setRangeText(replacement, start = null, end = null, selectionMode = HTMLInputElementSelectionModeEnum_1.default.preserve) {
|
467
374
|
if (start === null) {
|
468
375
|
start = this._selectionStart;
|
469
376
|
}
|
@@ -475,11 +382,11 @@ var HTMLTextAreaElement = /** @class */ (function (_super) {
|
|
475
382
|
}
|
476
383
|
start = Math.min(start, this.value.length);
|
477
384
|
end = Math.min(end, this.value.length);
|
478
|
-
|
479
|
-
|
480
|
-
|
385
|
+
const val = this.value;
|
386
|
+
let selectionStart = this._selectionStart;
|
387
|
+
let selectionEnd = this._selectionEnd;
|
481
388
|
this.value = val.slice(0, start) + replacement + val.slice(end);
|
482
|
-
|
389
|
+
const newEnd = start + this.value.length;
|
483
390
|
switch (selectionMode) {
|
484
391
|
case HTMLInputElementSelectionModeEnum_1.default.select:
|
485
392
|
this.setSelectionRange(start, newEnd);
|
@@ -491,7 +398,7 @@ var HTMLTextAreaElement = /** @class */ (function (_super) {
|
|
491
398
|
this.setSelectionRange(newEnd, newEnd);
|
492
399
|
break;
|
493
400
|
default:
|
494
|
-
|
401
|
+
const delta = replacement.length - (end - start);
|
495
402
|
if (selectionStart > end) {
|
496
403
|
selectionStart += delta;
|
497
404
|
}
|
@@ -507,15 +414,15 @@ var HTMLTextAreaElement = /** @class */ (function (_super) {
|
|
507
414
|
this.setSelectionRange(selectionStart, selectionEnd);
|
508
415
|
break;
|
509
416
|
}
|
510
|
-
}
|
417
|
+
}
|
511
418
|
/**
|
512
419
|
* Checks validity.
|
513
420
|
*
|
514
421
|
* @returns "true" if validation does'nt fail.
|
515
422
|
*/
|
516
|
-
|
423
|
+
checkValidity() {
|
517
424
|
return true;
|
518
|
-
}
|
425
|
+
}
|
519
426
|
/**
|
520
427
|
* Clones a node.
|
521
428
|
*
|
@@ -523,17 +430,15 @@ var HTMLTextAreaElement = /** @class */ (function (_super) {
|
|
523
430
|
* @param [deep=false] "true" to clone deep.
|
524
431
|
* @returns Cloned node.
|
525
432
|
*/
|
526
|
-
|
527
|
-
|
528
|
-
var clone = _super.prototype.cloneNode.call(this, deep);
|
433
|
+
cloneNode(deep = false) {
|
434
|
+
const clone = super.cloneNode(deep);
|
529
435
|
clone._value = this._value;
|
530
436
|
clone._selectionStart = this._selectionStart;
|
531
437
|
clone._selectionEnd = this._selectionEnd;
|
532
438
|
clone._selectionDirection = this._selectionDirection;
|
533
439
|
clone.defaultValue = this.defaultValue;
|
534
440
|
return clone;
|
535
|
-
}
|
536
|
-
|
537
|
-
}(HTMLElement_1.default));
|
441
|
+
}
|
442
|
+
}
|
538
443
|
exports.default = HTMLTextAreaElement;
|
539
444
|
//# sourceMappingURL=HTMLTextAreaElement.js.map
|