happy-dom 14.10.3 → 14.11.0

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.

Files changed (38) hide show
  1. package/cjs/config/HTMLElementConfig.cjs +1 -1
  2. package/cjs/config/HTMLElementConfig.cjs.map +1 -1
  3. package/cjs/config/IHTMLElementTagNameMap.d.ts +2 -1
  4. package/cjs/config/IHTMLElementTagNameMap.d.ts.map +1 -1
  5. package/cjs/index.cjs +2 -1
  6. package/cjs/index.cjs.map +1 -1
  7. package/cjs/index.d.ts +2 -1
  8. package/cjs/index.d.ts.map +1 -1
  9. package/cjs/nodes/html-time-element/HTMLTimeElement.cjs +32 -0
  10. package/cjs/nodes/html-time-element/HTMLTimeElement.cjs.map +1 -0
  11. package/cjs/nodes/html-time-element/HTMLTimeElement.d.ts +22 -0
  12. package/cjs/nodes/html-time-element/HTMLTimeElement.d.ts.map +1 -0
  13. package/cjs/window/BrowserWindow.cjs +2 -1
  14. package/cjs/window/BrowserWindow.cjs.map +1 -1
  15. package/cjs/window/BrowserWindow.d.ts +2 -1
  16. package/cjs/window/BrowserWindow.d.ts.map +1 -1
  17. package/lib/config/HTMLElementConfig.js +1 -1
  18. package/lib/config/HTMLElementConfig.js.map +1 -1
  19. package/lib/config/IHTMLElementTagNameMap.d.ts +2 -1
  20. package/lib/config/IHTMLElementTagNameMap.d.ts.map +1 -1
  21. package/lib/index.d.ts +2 -1
  22. package/lib/index.d.ts.map +1 -1
  23. package/lib/index.js +2 -1
  24. package/lib/index.js.map +1 -1
  25. package/lib/nodes/html-time-element/HTMLTimeElement.d.ts +22 -0
  26. package/lib/nodes/html-time-element/HTMLTimeElement.d.ts.map +1 -0
  27. package/lib/nodes/html-time-element/HTMLTimeElement.js +26 -0
  28. package/lib/nodes/html-time-element/HTMLTimeElement.js.map +1 -0
  29. package/lib/window/BrowserWindow.d.ts +2 -1
  30. package/lib/window/BrowserWindow.d.ts.map +1 -1
  31. package/lib/window/BrowserWindow.js +2 -1
  32. package/lib/window/BrowserWindow.js.map +1 -1
  33. package/package.json +1 -1
  34. package/src/config/HTMLElementConfig.ts +1 -1
  35. package/src/config/IHTMLElementTagNameMap.ts +2 -1
  36. package/src/index.ts +2 -1
  37. package/src/nodes/html-time-element/HTMLTimeElement.ts +27 -0
  38. package/src/window/BrowserWindow.ts +2 -1
@@ -654,7 +654,7 @@ export default <{ [key: string]: IHTMLElementConfigEntity }>{
654
654
  contentModel: HTMLElementConfigContentModelEnum.anyDescendants
655
655
  },
656
656
  time: {
657
- className: 'HTMLElement',
657
+ className: 'HTMLTimeElement',
658
658
  localName: 'time',
659
659
  tagName: 'TIME',
660
660
  contentModel: HTMLElementConfigContentModelEnum.anyDescendants
@@ -19,6 +19,7 @@ import HTMLIFrameElement from '../nodes/html-iframe-element/HTMLIFrameElement.js
19
19
  import HTMLOptGroupElement from '../nodes/html-opt-group-element/HTMLOptGroupElement.js';
20
20
  import HTMLOptionElement from '../nodes/html-option-element/HTMLOptionElement.js';
21
21
  import HTMLSelectElement from '../nodes/html-select-element/HTMLSelectElement.js';
22
+ import HTMLTimeElement from '../nodes/html-time-element/HTMLTimeElement.js';
22
23
  import HTMLVideoElement from '../nodes/html-video-element/HTMLVideoElement.js';
23
24
 
24
25
  // Makes it work with custom elements when they declare their own interface.
@@ -139,7 +140,7 @@ export default interface IHTMLElementTagNameMap extends HTMLElementTagNameMap {
139
140
  tfoot: HTMLElement;
140
141
  th: HTMLElement;
141
142
  thead: HTMLElement;
142
- time: HTMLElement;
143
+ time: HTMLTimeElement;
143
144
  title: HTMLElement;
144
145
  tr: HTMLElement;
145
146
  track: HTMLElement;
package/src/index.ts CHANGED
@@ -99,6 +99,7 @@ import HTMLSlotElement from './nodes/html-slot-element/HTMLSlotElement.js';
99
99
  import HTMLStyleElement from './nodes/html-style-element/HTMLStyleElement.js';
100
100
  import HTMLTemplateElement from './nodes/html-template-element/HTMLTemplateElement.js';
101
101
  import HTMLTextAreaElement from './nodes/html-text-area-element/HTMLTextAreaElement.js';
102
+ import HTMLTimeElement from './nodes/html-time-element/HTMLTimeElement.js';
102
103
  import HTMLUnknownElement from './nodes/html-unknown-element/HTMLUnknownElement.js';
103
104
  import HTMLVideoElement from './nodes/html-video-element/HTMLVideoElement.js';
104
105
  import Node from './nodes/node/Node.js';
@@ -303,7 +304,7 @@ export {
303
304
  HTMLElement as HTMLTableSectionElement,
304
305
  HTMLTemplateElement,
305
306
  HTMLTextAreaElement,
306
- HTMLElement as HTMLTimeElement,
307
+ HTMLTimeElement,
307
308
  HTMLElement as HTMLTitleElement,
308
309
  HTMLElement as HTMLTrackElement,
309
310
  HTMLElement as HTMLUListElement,
@@ -0,0 +1,27 @@
1
+ import HTMLElement from '../html-element/HTMLElement.js';
2
+
3
+ /**
4
+ * HTML Time Element.
5
+ *
6
+ * Reference:
7
+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLTimeElement
8
+ */
9
+ export default class HTMLTimeElement extends HTMLElement {
10
+ /**
11
+ * Returns dateTime.
12
+ *
13
+ * @returns dateTime.
14
+ */
15
+ public get dateTime(): string {
16
+ return this.getAttribute('dateTime') || '';
17
+ }
18
+
19
+ /**
20
+ * Sets dateTime.
21
+ *
22
+ * @param dateTime dateTime.
23
+ */
24
+ public set dateTime(dateTime: string) {
25
+ this.setAttribute('dateTime', dateTime);
26
+ }
27
+ }
@@ -134,6 +134,7 @@ import HTMLAnchorElement from '../nodes/html-anchor-element/HTMLAnchorElement.js
134
134
  import HTMLButtonElement from '../nodes/html-button-element/HTMLButtonElement.js';
135
135
  import HTMLOptionElement from '../nodes/html-option-element/HTMLOptionElement.js';
136
136
  import HTMLOptGroupElement from '../nodes/html-opt-group-element/HTMLOptGroupElement.js';
137
+ import HTMLTimeElement from '../nodes/html-time-element/HTMLTimeElement.js';
137
138
  import WindowPageOpenUtility from './WindowPageOpenUtility.js';
138
139
  import IResponseBody from '../fetch/types/IResponseBody.js';
139
140
  import IResponseInit from '../fetch/types/IResponseInit.js';
@@ -214,6 +215,7 @@ export default class BrowserWindow extends EventTarget implements INodeJSGlobal
214
215
  public readonly HTMLLinkElement: typeof HTMLLinkElementImplementation;
215
216
  public readonly HTMLIFrameElement: typeof HTMLIFrameElementImplementation;
216
217
  public readonly HTMLFormElement: typeof HTMLFormElementImplementation;
218
+ public readonly HTMLTimeElement: typeof HTMLTimeElement = HTMLTimeElement;
217
219
 
218
220
  // Non-implemented element classes
219
221
  public readonly HTMLHeadElement: typeof HTMLElement = HTMLElement;
@@ -254,7 +256,6 @@ export default class BrowserWindow extends EventTarget implements INodeJSGlobal
254
256
  public readonly HTMLTableCellElement: typeof HTMLElement = HTMLElement;
255
257
  public readonly HTMLTableColElement: typeof HTMLElement = HTMLElement;
256
258
  public readonly HTMLTableElement: typeof HTMLElement = HTMLElement;
257
- public readonly HTMLTimeElement: typeof HTMLElement = HTMLElement;
258
259
  public readonly HTMLTableRowElement: typeof HTMLElement = HTMLElement;
259
260
  public readonly HTMLTableSectionElement: typeof HTMLElement = HTMLElement;
260
261
  public readonly HTMLFrameElement: typeof HTMLElement = HTMLElement;