x4js 1.4.18 → 1.4.20
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.
- package/lib/application.d.ts +1 -1
- package/lib/application.js +4 -3
- package/lib/base_component.d.ts +1 -1
- package/lib/base_component.js +3 -3
- package/lib/button.d.ts +1 -1
- package/lib/button.js +3 -3
- package/lib/calendar.d.ts +1 -1
- package/lib/calendar.js +5 -4
- package/lib/canvas.d.ts +1 -1
- package/lib/canvas.js +2 -2
- package/lib/cardview.d.ts +1 -1
- package/lib/cardview.js +2 -2
- package/lib/checkbox.d.ts +1 -1
- package/lib/checkbox.js +2 -2
- package/lib/colorpicker.d.ts +1 -1
- package/lib/colorpicker.js +5 -5
- package/lib/combobox.d.ts +1 -1
- package/lib/combobox.js +3 -3
- package/lib/component.d.ts +1 -5
- package/lib/component.js +35 -39
- package/lib/datastore.d.ts +1 -1
- package/lib/datastore.js +5 -5
- package/lib/dialog.d.ts +1 -1
- package/lib/dialog.js +4 -3
- package/lib/drag_manager.js +30 -1
- package/lib/fileupload.js +2 -1
- package/lib/form.d.ts +1 -1
- package/lib/gridview.d.ts +1 -5
- package/lib/gridview.js +8 -7
- package/lib/i18n.d.ts +35 -33
- package/lib/i18n.js +180 -93
- package/lib/icon.d.ts +1 -1
- package/lib/icon.js +10 -13
- package/lib/image.js +4 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/input.js +1 -1
- package/lib/link.d.ts +1 -1
- package/lib/link.js +2 -2
- package/lib/listview.d.ts +1 -1
- package/lib/listview.js +10 -9
- package/lib/menu.d.ts +1 -1
- package/lib/menu.js +5 -4
- package/lib/popup.d.ts +1 -1
- package/lib/popup.js +13 -12
- package/lib/property_editor.d.ts +1 -1
- package/lib/property_editor.js +2 -2
- package/lib/radiobtn.d.ts +1 -1
- package/lib/radiobtn.js +4 -3
- package/lib/rating.d.ts +1 -1
- package/lib/rating.js +2 -2
- package/lib/router.d.ts +1 -1
- package/lib/router.js +5 -4
- package/lib/spreadsheet.d.ts +1 -1
- package/lib/spreadsheet.js +9 -8
- package/lib/styles.js +6 -5
- package/lib/svgcomponent.d.ts +1 -1
- package/lib/svgcomponent.js +4 -1
- package/lib/tabbar.d.ts +1 -1
- package/lib/tabbar.js +2 -2
- package/lib/textarea.d.ts +1 -1
- package/lib/textarea.js +2 -2
- package/lib/textedit.d.ts +1 -1
- package/lib/textedit.js +5 -4
- package/lib/tools.d.ts +1 -0
- package/lib/tools.js +15 -6
- package/lib/tooltips.js +6 -5
- package/lib/treeview.d.ts +1 -1
- package/lib/treeview.js +8 -8
- package/lib/x4dom.d.ts +21 -0
- package/lib/x4dom.js +7 -0
- package/lib/x4events.d.ts +266 -0
- package/lib/x4events.js +389 -0
- package/package.json +4 -3
- package/src/application.ts +5 -4
- package/src/base_component.ts +1 -1
- package/src/button.ts +1 -1
- package/src/calendar.ts +5 -3
- package/src/canvas.ts +1 -1
- package/src/cardview.ts +1 -1
- package/src/checkbox.ts +1 -1
- package/src/colorpicker.ts +1 -1
- package/src/combobox.ts +1 -1
- package/src/component.ts +34 -39
- package/src/datastore.ts +1 -1
- package/src/dialog.ts +4 -2
- package/src/drag_manager.ts +4 -1
- package/src/fileupload.ts +2 -1
- package/src/form.ts +1 -1
- package/src/gridview.ts +4 -3
- package/src/hosts/electron.ts +4 -1
- package/src/i18n.ts +234 -97
- package/src/icon.ts +9 -12
- package/src/image.ts +5 -3
- package/src/index.ts +1 -1
- package/src/input.ts +1 -1
- package/src/layout.ts +1 -1
- package/src/link.ts +1 -1
- package/src/listview.ts +6 -4
- package/src/menu.ts +5 -3
- package/src/popup.ts +14 -12
- package/src/property_editor.ts +1 -1
- package/src/radiobtn.ts +4 -2
- package/src/rating.ts +1 -1
- package/src/router.ts +4 -2
- package/src/smartedit.ts +3 -2
- package/src/spreadsheet.ts +8 -6
- package/src/styles.ts +7 -5
- package/src/svgcomponent.ts +4 -1
- package/src/tabbar.ts +1 -1
- package/src/textarea.ts +1 -1
- package/src/textedit.ts +4 -2
- package/src/tools.ts +15 -5
- package/src/tooltips.ts +7 -5
- package/src/treeview.ts +1 -1
- package/src/x4dom.ts +57 -0
- package/src/{x4_events.ts → x4events.ts} +1 -1
- package/tsconfig.json +5 -1
package/src/radiobtn.ts
CHANGED
|
@@ -27,8 +27,10 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
|
+
import { x4document } from './x4dom'
|
|
31
|
+
|
|
30
32
|
import { Component, CProps, CEventMap } from './component'
|
|
31
|
-
import { EvChange, EventCallback } from './
|
|
33
|
+
import { EvChange, EventCallback } from './x4events'
|
|
32
34
|
|
|
33
35
|
import { IconID } from './icon';
|
|
34
36
|
import { Input } from './input'
|
|
@@ -131,7 +133,7 @@ export class RadioBtn extends Component<RadioBtnProps,RadioBtnEventMap> {
|
|
|
131
133
|
let props = this.m_props;
|
|
132
134
|
|
|
133
135
|
let query = '.x-input[name='+props.name+']';
|
|
134
|
-
let nlist =
|
|
136
|
+
let nlist = x4document.querySelectorAll( query ); //todo: document ?
|
|
135
137
|
|
|
136
138
|
nlist.forEach( (dom) => {
|
|
137
139
|
let radio = Component.getElement( <HTMLElement>dom, RadioBtn );
|
package/src/rating.ts
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import { CProps, Component, ContainerEventMap } from './component'
|
|
31
31
|
import { HLayout } from './layout';
|
|
32
32
|
import { Input } from './input'
|
|
33
|
-
import { EvChange, EventCallback } from './
|
|
33
|
+
import { EvChange, EventCallback } from './x4events';
|
|
34
34
|
|
|
35
35
|
interface RatingEventMap extends ContainerEventMap {
|
|
36
36
|
change: EvChange;
|
package/src/router.ts
CHANGED
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
|
-
import {
|
|
30
|
+
import { x4document } from './x4dom'
|
|
31
|
+
|
|
32
|
+
import { EventSource, EvError, EventMap } from "./x4events"
|
|
31
33
|
|
|
32
34
|
type RouteHandler = ( params: any, path: string ) => void;
|
|
33
35
|
|
|
@@ -102,7 +104,7 @@ export class Router extends EventSource< RouterEventMap > {
|
|
|
102
104
|
this.routes = [];
|
|
103
105
|
|
|
104
106
|
window.addEventListener('popstate', (event) => {
|
|
105
|
-
const url =
|
|
107
|
+
const url = x4document.location.pathname;
|
|
106
108
|
const found = this._find(url);
|
|
107
109
|
|
|
108
110
|
found.handlers.forEach(h => {
|
package/src/smartedit.ts
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
|
-
import {
|
|
30
|
+
import { x4document } from './dom-gen'
|
|
31
|
+
|
|
31
32
|
import { TextEdit, TextEditProps } from './textedit'
|
|
32
33
|
import { DataStore, DataView, Record } from './datastore'
|
|
33
34
|
import { Popup, PopupProps, PopupEventMap } from './popup';
|
|
@@ -481,7 +482,7 @@ export class PopupTable extends Popup<PopupTableProps, PopupTableEventMap> {
|
|
|
481
482
|
}
|
|
482
483
|
|
|
483
484
|
// @TODO: this is a minimal overflow problem solution
|
|
484
|
-
let rc =
|
|
485
|
+
let rc = x4document.body.getBoundingClientRect(),
|
|
485
486
|
rm = this.getBoundingRect();
|
|
486
487
|
|
|
487
488
|
if (halign == 'r') {
|
package/src/spreadsheet.ts
CHANGED
|
@@ -27,14 +27,16 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
|
-
import {
|
|
30
|
+
import { x4document } from './x4dom'
|
|
31
|
+
|
|
32
|
+
import { Component, SizerOverlay, EvDblClick, EvSize, ContainerEventMap, ContainerProps } from './component'
|
|
31
33
|
import { Input, InputProps } from './input';
|
|
32
34
|
import { HLayout, VLayout } from './layout';
|
|
33
35
|
import { TextEditProps, TextEdit } from './textedit';
|
|
34
36
|
import * as Formatters from './formatters';
|
|
35
37
|
import { asap, parseIntlFloat } from './tools';
|
|
36
38
|
import { deferCall } from './tools';
|
|
37
|
-
import { EvContextMenu, EvChange, EvSelectionChange, EventCallback } from './
|
|
39
|
+
import { EvContextMenu, EvChange, EvSelectionChange, EventCallback } from './x4events'
|
|
38
40
|
import { ComboBox } from './combobox';
|
|
39
41
|
|
|
40
42
|
|
|
@@ -153,7 +155,7 @@ export class Spreadsheet extends VLayout<SpreadsheetProps, SpreadsheetEventSet>
|
|
|
153
155
|
this.m_row_limit = props.maxrows;
|
|
154
156
|
}
|
|
155
157
|
|
|
156
|
-
this.setAttribute('
|
|
158
|
+
this.setAttribute('tabindex', 0);
|
|
157
159
|
|
|
158
160
|
this.setDomEvent('click', (e) => this._itemClick(e) );
|
|
159
161
|
this.setDomEvent('dblclick', (e) => this._itemDblClick(e) );
|
|
@@ -459,13 +461,13 @@ export class Spreadsheet extends VLayout<SpreadsheetProps, SpreadsheetEventSet>
|
|
|
459
461
|
*/
|
|
460
462
|
|
|
461
463
|
private _computeItemHeight() {
|
|
462
|
-
let g1 =
|
|
464
|
+
let g1 = x4document.createElement('div');
|
|
463
465
|
g1.classList.add('x-spreadsheet');
|
|
464
466
|
|
|
465
|
-
let g2 =
|
|
467
|
+
let g2 = x4document.createElement('div');
|
|
466
468
|
g2.classList.add('content');
|
|
467
469
|
|
|
468
|
-
let g3 =
|
|
470
|
+
let g3 = x4document.createElement('div');
|
|
469
471
|
g3.classList.add('x-cell');
|
|
470
472
|
g3.append( ' ' )
|
|
471
473
|
|
package/src/styles.ts
CHANGED
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
|
+
import { x4document } from './x4dom'
|
|
31
|
+
|
|
30
32
|
import { pascalCase, isString, isArray } from "./tools";
|
|
31
33
|
|
|
32
34
|
|
|
@@ -42,8 +44,8 @@ export class Stylesheet {
|
|
|
42
44
|
constructor() {
|
|
43
45
|
|
|
44
46
|
function getStyleSheet( name ) : CSSStyleSheet {
|
|
45
|
-
for(let i=0; i<
|
|
46
|
-
let sheet =
|
|
47
|
+
for(let i=0; i<x4document.styleSheets.length; i++) {
|
|
48
|
+
let sheet = x4document.styleSheets[i];
|
|
47
49
|
if(sheet.title === name ) {
|
|
48
50
|
return <CSSStyleSheet>sheet;
|
|
49
51
|
}
|
|
@@ -52,9 +54,9 @@ export class Stylesheet {
|
|
|
52
54
|
|
|
53
55
|
this.m_sheet = getStyleSheet( '@dynamic-css' );
|
|
54
56
|
if( !this.m_sheet ) {
|
|
55
|
-
let dom =
|
|
57
|
+
let dom = x4document.createElement( 'style' );
|
|
56
58
|
dom.setAttribute('id', '@dynamic-css' );
|
|
57
|
-
|
|
59
|
+
x4document.head.appendChild(dom);
|
|
58
60
|
|
|
59
61
|
this.m_sheet = <CSSStyleSheet>dom.sheet
|
|
60
62
|
}
|
|
@@ -117,7 +119,7 @@ export class Stylesheet {
|
|
|
117
119
|
|
|
118
120
|
public static getVar( name: string ) : any {
|
|
119
121
|
if( !Stylesheet.doc_style ) {
|
|
120
|
-
Stylesheet.doc_style = getComputedStyle(
|
|
122
|
+
Stylesheet.doc_style = getComputedStyle( x4document.documentElement );
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
if( name[0]!='-' ) {
|
package/src/svgcomponent.ts
CHANGED
|
@@ -88,8 +88,11 @@ abstract class SVGItem {
|
|
|
88
88
|
* @param color
|
|
89
89
|
*/
|
|
90
90
|
|
|
91
|
-
stroke( color: string ): this {
|
|
91
|
+
stroke( color: string, width?: number ): this {
|
|
92
92
|
this.attr( 'stroke', color );
|
|
93
|
+
if( width!==undefined ) {
|
|
94
|
+
this.attr( 'stroke-width', width+'px' );
|
|
95
|
+
}
|
|
93
96
|
return this;
|
|
94
97
|
}
|
|
95
98
|
|
package/src/tabbar.ts
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
import { Component, Container, ContainerEventMap, CProps, EventHandler } from './component';
|
|
31
31
|
import { Button } from './button';
|
|
32
|
-
import { EvChange } from './
|
|
32
|
+
import { EvChange } from './x4events';
|
|
33
33
|
import { IconID } from './icon.js';
|
|
34
34
|
|
|
35
35
|
interface TabBarEventMap extends ContainerEventMap {
|
package/src/textarea.ts
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
30
|
import { Component, CProps, CEventMap } from './component'
|
|
31
|
-
import { EvChange, EventCallback } from './
|
|
31
|
+
import { EvChange, EventCallback } from './x4events'
|
|
32
32
|
import { asap } from './tools'
|
|
33
33
|
|
|
34
34
|
interface TextAreaEventMap extends CEventMap {
|
package/src/textedit.ts
CHANGED
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
|
+
import { x4document } from './x4dom'
|
|
31
|
+
|
|
30
32
|
import { Component, EvFocus, HtmlString } from './component'
|
|
31
33
|
import { Input, InputProps, InputEventMap } from './input'
|
|
32
34
|
import { IconID } from './icon'
|
|
@@ -36,7 +38,7 @@ import { Label } from './label'
|
|
|
36
38
|
import { PopupCalendar } from './calendar'
|
|
37
39
|
import { sprintf, parseIntlDate, formatIntlDate } from './tools';
|
|
38
40
|
import { Tooltip } from './tooltips'
|
|
39
|
-
import { EvClick, EvChange, EventCallback } from './
|
|
41
|
+
import { EvClick, EvChange, EventCallback } from './x4events';
|
|
40
42
|
|
|
41
43
|
import { _tr } from './i18n'
|
|
42
44
|
|
|
@@ -307,7 +309,7 @@ export class TextEdit<T extends TextEditProps = TextEditProps> extends Component
|
|
|
307
309
|
|
|
308
310
|
if (!this.m_error_tip) {
|
|
309
311
|
this.m_error_tip = new Tooltip({ cls: 'error' });
|
|
310
|
-
|
|
312
|
+
x4document.body.appendChild(this.m_error_tip._build());
|
|
311
313
|
}
|
|
312
314
|
|
|
313
315
|
let rc = this.m_ui_input.getBoundingRect();
|
package/src/tools.ts
CHANGED
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
|
+
import { x4document } from './x4dom'
|
|
31
|
+
|
|
30
32
|
import { _tr } from './i18n'; // you MUST create a file named translation.js
|
|
31
33
|
|
|
32
34
|
// :: ENVIRONMENT ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
@@ -104,6 +106,14 @@ export function pascalCase(string: string): string {
|
|
|
104
106
|
return result.replace(/ /g, '-');
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
export function camelCase( text: string ) {
|
|
110
|
+
let result = text.toLowerCase( );
|
|
111
|
+
result = result.replace( /[^a-zA-Z0-9]+(.)/g, (m,chr) => {
|
|
112
|
+
return chr.toUpperCase();
|
|
113
|
+
} );
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
|
|
107
117
|
// :: MISC CLASSES ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
108
118
|
|
|
109
119
|
export type Constructor<T> = new (...args: any[]) => T;
|
|
@@ -800,11 +810,11 @@ export function downloadData(data, mimetype: string, filename: string) {
|
|
|
800
810
|
let blob = new Blob([data], { type: mimetype });
|
|
801
811
|
let url = window.URL.createObjectURL(blob);
|
|
802
812
|
|
|
803
|
-
let a =
|
|
813
|
+
let a = x4document.createElement("a");
|
|
804
814
|
a.style['display'] = "none";
|
|
805
815
|
a.href = url;
|
|
806
816
|
a.download = filename;
|
|
807
|
-
|
|
817
|
+
x4document.body.appendChild(a);
|
|
808
818
|
|
|
809
819
|
a.click();
|
|
810
820
|
window.URL.revokeObjectURL(url);
|
|
@@ -894,7 +904,7 @@ export function waitFontLoading(name: string) {
|
|
|
894
904
|
// pitfall: if the font is already loaded, ne never end.
|
|
895
905
|
// @review that
|
|
896
906
|
|
|
897
|
-
let ct =
|
|
907
|
+
let ct = x4document.createElement('div');
|
|
898
908
|
|
|
899
909
|
ct.style.position = 'absolute';
|
|
900
910
|
ct.style.fontFamily = name;
|
|
@@ -902,7 +912,7 @@ export function waitFontLoading(name: string) {
|
|
|
902
912
|
ct.style.opacity = '0.001';
|
|
903
913
|
ct.innerText = 'X';
|
|
904
914
|
|
|
905
|
-
|
|
915
|
+
x4document.body.appendChild(ct);
|
|
906
916
|
|
|
907
917
|
return new Promise<void>((resolve) => {
|
|
908
918
|
|
|
@@ -912,7 +922,7 @@ export function waitFontLoading(name: string) {
|
|
|
912
922
|
let nrc = ct.getBoundingClientRect();
|
|
913
923
|
if (nrc.height != irc.height) {
|
|
914
924
|
clearInterval(tm);
|
|
915
|
-
|
|
925
|
+
x4document.body.removeChild(ct);
|
|
916
926
|
|
|
917
927
|
resolve();
|
|
918
928
|
}
|
package/src/tooltips.ts
CHANGED
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
|
+
import { x4document } from './x4dom'
|
|
31
|
+
|
|
30
32
|
import { Component } from './component'
|
|
31
33
|
import { Label } from './label'
|
|
32
34
|
import { Icon } from './icon'
|
|
@@ -79,7 +81,7 @@ export class Tooltip extends Component {
|
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
// @TODO: this is a minimal overflow problem solution
|
|
82
|
-
let rc =
|
|
84
|
+
let rc = x4document.body.getBoundingClientRect(),
|
|
83
85
|
rm = this.getBoundingRect();
|
|
84
86
|
|
|
85
87
|
if (halign == 'r') {
|
|
@@ -163,7 +165,7 @@ export function initTooltips(cb?: TooltipHandler) {
|
|
|
163
165
|
|
|
164
166
|
if (tooltip === undefined) {
|
|
165
167
|
tooltip = new Tooltip({});
|
|
166
|
-
|
|
168
|
+
x4document.body.appendChild(tooltip._build());
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
tooltip.text = tip;
|
|
@@ -183,7 +185,7 @@ export function initTooltips(cb?: TooltipHandler) {
|
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
187
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
x4document.body.addEventListener('mouseover', handle_mouse);
|
|
189
|
+
x4document.body.addEventListener('mouseout', handle_mouse);
|
|
190
|
+
x4document.body.addEventListener('mousemove', handle_mpos);
|
|
189
191
|
}
|
package/src/treeview.ts
CHANGED
|
@@ -32,7 +32,7 @@ import { HtmlString, Rect } from './tools';
|
|
|
32
32
|
import { Icon, IconID } from './icon';
|
|
33
33
|
import { Label } from './label';
|
|
34
34
|
import { HLayout, VLayout } from './layout';
|
|
35
|
-
import { EvClick, BasicEvent, EvDrag, EvSelectionChange, EvContextMenu } from './
|
|
35
|
+
import { EvClick, BasicEvent, EvDrag, EvSelectionChange, EvContextMenu } from './x4events';
|
|
36
36
|
|
|
37
37
|
export interface EvExpand extends BasicEvent {
|
|
38
38
|
node: TreeNode;
|
package/src/x4dom.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \_/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / _ \____ _|
|
|
6
|
+
* /__/ \__\ |_|
|
|
7
|
+
*
|
|
8
|
+
* @file x4events.ts
|
|
9
|
+
* @author Etienne Cochard
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
**/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* SSR preparation
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
interface IX4Document {
|
|
35
|
+
createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K];
|
|
36
|
+
createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element;
|
|
37
|
+
createTextNode(data: string): Text;
|
|
38
|
+
|
|
39
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
40
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
41
|
+
|
|
42
|
+
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
43
|
+
querySelector<E extends Element = Element>(selectors: string): E | null;
|
|
44
|
+
|
|
45
|
+
get body( ) : HTMLElement;
|
|
46
|
+
get activeElement( ): Element;
|
|
47
|
+
get location( ): Location;
|
|
48
|
+
get styleSheets( ): StyleSheetList;
|
|
49
|
+
get head( ): HTMLHeadElement;
|
|
50
|
+
get documentElement( ): HTMLElement;
|
|
51
|
+
|
|
52
|
+
set title( title: string );
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
export let x4document: IX4Document = document;
|
|
57
|
+
|