x4js 1.4.3 → 1.4.4
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/index.d.ts +55 -0
- package/lib/index.js +55 -56
- package/lib/router.d.ts +1 -8
- package/lib/router.js +1 -1
- package/package.json +2 -1
- package/src/index.ts +55 -0
- package/src/router.ts +1 -1
- package/tsconfig.json +2 -1
- package/lib/application.d.ts +0 -95
- package/lib/application.js +0 -137
- package/lib/base64.d.ts +0 -31
- package/lib/base64.js +0 -135
- package/lib/base_component.d.ts +0 -64
- package/lib/base_component.js +0 -77
- package/lib/button.d.ts +0 -145
- package/lib/button.js +0 -235
- package/lib/calendar.d.ts +0 -77
- package/lib/calendar.js +0 -236
- package/lib/canvas.d.ts +0 -88
- package/lib/canvas.js +0 -354
- package/lib/cardview.d.ts +0 -83
- package/lib/cardview.js +0 -152
- package/lib/checkbox.d.ts +0 -72
- package/lib/checkbox.js +0 -126
- package/lib/color.d.ts +0 -144
- package/lib/color.js +0 -584
- package/lib/component.d.ts +0 -572
- package/lib/component.js +0 -1712
- package/lib/dom_events.d.ts +0 -284
- package/lib/dom_events.js +0 -13
- package/lib/hosts/host.d.ts +0 -44
- package/lib/hosts/host.js +0 -69
- package/lib/i18n.d.ts +0 -67
- package/lib/i18n.js +0 -169
- package/lib/icon.d.ts +0 -56
- package/lib/icon.js +0 -173
- package/lib/input.d.ts +0 -86
- package/lib/input.js +0 -172
- package/lib/label.d.ts +0 -54
- package/lib/label.js +0 -86
- package/lib/layout.d.ts +0 -77
- package/lib/layout.js +0 -261
- package/lib/list.txt +0 -56
- package/lib/menu.d.ts +0 -122
- package/lib/menu.js +0 -276
- package/lib/popup.d.ts +0 -71
- package/lib/popup.js +0 -373
- package/lib/settings.d.ts +0 -33
- package/lib/settings.js +0 -63
- package/lib/styles.d.ts +0 -81
- package/lib/styles.js +0 -262
- package/lib/tools.d.ts +0 -382
- package/lib/tools.js +0 -1096
- package/lib/x4_events.d.ts +0 -253
- package/lib/x4_events.js +0 -363
- package/list.txt +0 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export * from "./application";
|
|
2
|
+
export * from "./base_component";
|
|
3
|
+
export * from "./base64";
|
|
4
|
+
export * from "./button";
|
|
5
|
+
export * from "./calendar";
|
|
6
|
+
export * from "./canvas";
|
|
7
|
+
export * from "./cardview";
|
|
8
|
+
export * from "./checkbox";
|
|
9
|
+
export * from "./color";
|
|
10
|
+
export * from "./colorpicker";
|
|
11
|
+
export * from "./combobox";
|
|
12
|
+
export * from "./component";
|
|
13
|
+
export * from "./datastore";
|
|
14
|
+
export * from "./dialog";
|
|
15
|
+
export * from "./dom_events";
|
|
16
|
+
export * from "./drag_manager";
|
|
17
|
+
export * from "./drawtext";
|
|
18
|
+
export * from "./fileupload";
|
|
19
|
+
export * from "./form";
|
|
20
|
+
export * from "./formatters";
|
|
21
|
+
export * from "./gridview";
|
|
22
|
+
export * from "./i18n";
|
|
23
|
+
export * from "./icon";
|
|
24
|
+
export * from "./image";
|
|
25
|
+
export * from "./input";
|
|
26
|
+
export * from "./label";
|
|
27
|
+
export * from "./layout";
|
|
28
|
+
export * from "./link";
|
|
29
|
+
export * from "./listview";
|
|
30
|
+
export * from "./md5";
|
|
31
|
+
export * from "./menu";
|
|
32
|
+
export * from "./messagebox";
|
|
33
|
+
export * from "./panel";
|
|
34
|
+
export * from "./popup";
|
|
35
|
+
export * from "./property_editor";
|
|
36
|
+
export * from "./radiobtn";
|
|
37
|
+
export * from "./rating";
|
|
38
|
+
export * from "./request";
|
|
39
|
+
export * from "./router";
|
|
40
|
+
export * from "./settings";
|
|
41
|
+
export * from "./sidebarview";
|
|
42
|
+
export * from "./smartedit";
|
|
43
|
+
export * from "./spreadsheet";
|
|
44
|
+
export * from "./styles";
|
|
45
|
+
export * from "./svgcomponent";
|
|
46
|
+
export * from "./tabbar";
|
|
47
|
+
export * from "./tabview";
|
|
48
|
+
export * from "./textarea";
|
|
49
|
+
export * from "./textedit";
|
|
50
|
+
export * from "./texthiliter";
|
|
51
|
+
export * from "./toaster";
|
|
52
|
+
export * from "./tools";
|
|
53
|
+
export * from "./tooltips";
|
|
54
|
+
export * from "./treeview";
|
|
55
|
+
export * from "./x4_events";
|
package/lib/index.js
CHANGED
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
export * from "application
|
|
2
|
-
export * from "base_component
|
|
3
|
-
export * from "base64
|
|
4
|
-
export * from "button
|
|
5
|
-
export * from "calendar
|
|
6
|
-
export * from "canvas
|
|
7
|
-
export * from "cardview
|
|
8
|
-
export * from "checkbox
|
|
9
|
-
export * from "color
|
|
10
|
-
export * from "colorpicker
|
|
11
|
-
export * from "combobox
|
|
12
|
-
export * from "component
|
|
13
|
-
export * from "datastore
|
|
14
|
-
export * from "dialog
|
|
15
|
-
export * from "dom_events
|
|
16
|
-
export * from "drag_manager
|
|
17
|
-
export * from "drawtext
|
|
18
|
-
export * from "fileupload
|
|
19
|
-
export * from "form
|
|
20
|
-
export * from "formatters
|
|
21
|
-
export * from "gridview
|
|
22
|
-
export * from "i18n
|
|
23
|
-
export * from "icon
|
|
24
|
-
export * from "image
|
|
25
|
-
export * from "
|
|
26
|
-
export * from "
|
|
27
|
-
export * from "
|
|
28
|
-
export * from "
|
|
29
|
-
export * from "
|
|
30
|
-
export * from "
|
|
31
|
-
export * from "
|
|
32
|
-
export * from "
|
|
33
|
-
export * from "
|
|
34
|
-
export * from "
|
|
35
|
-
export * from "
|
|
36
|
-
export * from "
|
|
37
|
-
export * from "
|
|
38
|
-
export * from "
|
|
39
|
-
export * from "
|
|
40
|
-
export * from "
|
|
41
|
-
export * from "
|
|
42
|
-
export * from "
|
|
43
|
-
export * from "
|
|
44
|
-
export * from "
|
|
45
|
-
export * from "
|
|
46
|
-
export * from "
|
|
47
|
-
export * from "
|
|
48
|
-
export * from "
|
|
49
|
-
export * from "
|
|
50
|
-
export * from "
|
|
51
|
-
export * from "
|
|
52
|
-
export * from "
|
|
53
|
-
export * from "
|
|
54
|
-
export * from "
|
|
55
|
-
export * from "
|
|
56
|
-
export * from "x4_events.js"
|
|
1
|
+
export * from "./application";
|
|
2
|
+
export * from "./base_component";
|
|
3
|
+
export * from "./base64";
|
|
4
|
+
export * from "./button";
|
|
5
|
+
export * from "./calendar";
|
|
6
|
+
export * from "./canvas";
|
|
7
|
+
export * from "./cardview";
|
|
8
|
+
export * from "./checkbox";
|
|
9
|
+
export * from "./color";
|
|
10
|
+
export * from "./colorpicker";
|
|
11
|
+
export * from "./combobox";
|
|
12
|
+
export * from "./component";
|
|
13
|
+
export * from "./datastore";
|
|
14
|
+
export * from "./dialog";
|
|
15
|
+
export * from "./dom_events";
|
|
16
|
+
export * from "./drag_manager";
|
|
17
|
+
export * from "./drawtext";
|
|
18
|
+
export * from "./fileupload";
|
|
19
|
+
export * from "./form";
|
|
20
|
+
export * from "./formatters";
|
|
21
|
+
export * from "./gridview";
|
|
22
|
+
export * from "./i18n";
|
|
23
|
+
export * from "./icon";
|
|
24
|
+
export * from "./image";
|
|
25
|
+
export * from "./input";
|
|
26
|
+
export * from "./label";
|
|
27
|
+
export * from "./layout";
|
|
28
|
+
export * from "./link";
|
|
29
|
+
export * from "./listview";
|
|
30
|
+
export * from "./md5";
|
|
31
|
+
export * from "./menu";
|
|
32
|
+
export * from "./messagebox";
|
|
33
|
+
export * from "./panel";
|
|
34
|
+
export * from "./popup";
|
|
35
|
+
export * from "./property_editor";
|
|
36
|
+
export * from "./radiobtn";
|
|
37
|
+
export * from "./rating";
|
|
38
|
+
export * from "./request";
|
|
39
|
+
export * from "./router";
|
|
40
|
+
export * from "./settings";
|
|
41
|
+
export * from "./sidebarview";
|
|
42
|
+
export * from "./smartedit";
|
|
43
|
+
export * from "./spreadsheet";
|
|
44
|
+
export * from "./styles";
|
|
45
|
+
export * from "./svgcomponent";
|
|
46
|
+
export * from "./tabbar";
|
|
47
|
+
export * from "./tabview";
|
|
48
|
+
export * from "./textarea";
|
|
49
|
+
export * from "./textedit";
|
|
50
|
+
export * from "./texthiliter";
|
|
51
|
+
export * from "./toaster";
|
|
52
|
+
export * from "./tools";
|
|
53
|
+
export * from "./tooltips";
|
|
54
|
+
export * from "./treeview";
|
|
55
|
+
export * from "./x4_events";
|
package/lib/router.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
declare
|
|
2
|
-
path: string;
|
|
3
|
-
}) => void;
|
|
4
|
-
interface Route {
|
|
5
|
-
uri: string;
|
|
6
|
-
callback: Callback;
|
|
7
|
-
}
|
|
8
|
-
declare class Router {
|
|
1
|
+
export declare class Router {
|
|
9
2
|
private routes;
|
|
10
3
|
constructor();
|
|
11
4
|
get(uri: any, callback: any): void;
|
package/lib/router.js
CHANGED
package/package.json
CHANGED
package/src/index.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export * from "./application"
|
|
2
|
+
export * from "./base_component"
|
|
3
|
+
export * from "./base64"
|
|
4
|
+
export * from "./button"
|
|
5
|
+
export * from "./calendar"
|
|
6
|
+
export * from "./canvas"
|
|
7
|
+
export * from "./cardview"
|
|
8
|
+
export * from "./checkbox"
|
|
9
|
+
export * from "./color"
|
|
10
|
+
export * from "./colorpicker"
|
|
11
|
+
export * from "./combobox"
|
|
12
|
+
export * from "./component"
|
|
13
|
+
export * from "./datastore"
|
|
14
|
+
export * from "./dialog"
|
|
15
|
+
export * from "./dom_events"
|
|
16
|
+
export * from "./drag_manager"
|
|
17
|
+
export * from "./drawtext"
|
|
18
|
+
export * from "./fileupload"
|
|
19
|
+
export * from "./form"
|
|
20
|
+
export * from "./formatters"
|
|
21
|
+
export * from "./gridview"
|
|
22
|
+
export * from "./i18n"
|
|
23
|
+
export * from "./icon"
|
|
24
|
+
export * from "./image"
|
|
25
|
+
export * from "./input"
|
|
26
|
+
export * from "./label"
|
|
27
|
+
export * from "./layout"
|
|
28
|
+
export * from "./link"
|
|
29
|
+
export * from "./listview"
|
|
30
|
+
export * from "./md5"
|
|
31
|
+
export * from "./menu"
|
|
32
|
+
export * from "./messagebox"
|
|
33
|
+
export * from "./panel"
|
|
34
|
+
export * from "./popup"
|
|
35
|
+
export * from "./property_editor"
|
|
36
|
+
export * from "./radiobtn"
|
|
37
|
+
export * from "./rating"
|
|
38
|
+
export * from "./request"
|
|
39
|
+
export * from "./router"
|
|
40
|
+
export * from "./settings"
|
|
41
|
+
export * from "./sidebarview"
|
|
42
|
+
export * from "./smartedit"
|
|
43
|
+
export * from "./spreadsheet"
|
|
44
|
+
export * from "./styles"
|
|
45
|
+
export * from "./svgcomponent"
|
|
46
|
+
export * from "./tabbar"
|
|
47
|
+
export * from "./tabview"
|
|
48
|
+
export * from "./textarea"
|
|
49
|
+
export * from "./textedit"
|
|
50
|
+
export * from "./texthiliter"
|
|
51
|
+
export * from "./toaster"
|
|
52
|
+
export * from "./tools"
|
|
53
|
+
export * from "./tooltips"
|
|
54
|
+
export * from "./treeview"
|
|
55
|
+
export * from "./x4_events"
|
package/src/router.ts
CHANGED
package/tsconfig.json
CHANGED
package/lib/application.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file application.ts
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* This program is free software; you can redistribute it and/or modify
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
17
|
-
*
|
|
18
|
-
* This program is distributed in the hope that it will be useful,
|
|
19
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21
|
-
* GNU General Public License for more details.
|
|
22
|
-
*
|
|
23
|
-
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
|
-
**/
|
|
25
|
-
import { EvMessage } from './x4_events';
|
|
26
|
-
import { BaseComponent, BaseComponentEventMap, BaseComponentProps } from './base_component';
|
|
27
|
-
import { Component } from './component';
|
|
28
|
-
import { Settings } from './settings';
|
|
29
|
-
interface ApplicationEventMap extends BaseComponentEventMap {
|
|
30
|
-
message: EvMessage;
|
|
31
|
-
global: EvMessage;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
export interface ApplicationProps extends BaseComponentProps<ApplicationEventMap> {
|
|
37
|
-
app_name: string;
|
|
38
|
-
app_version: string;
|
|
39
|
-
app_uid: string;
|
|
40
|
-
locale: string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Represents an x4 application, which is typically a single page app.
|
|
44
|
-
* You should inherit Application to define yours.
|
|
45
|
-
* Application derives from BaseComponent so you can use that to implement a global messaging system.
|
|
46
|
-
* @example ```ts
|
|
47
|
-
*
|
|
48
|
-
* // in yout main caode
|
|
49
|
-
* let app = new Application( );
|
|
50
|
-
*
|
|
51
|
-
* app.events.close.on( ( ev ) => {
|
|
52
|
-
* ... do something
|
|
53
|
-
* });
|
|
54
|
-
*
|
|
55
|
-
* // somewhere else in the source
|
|
56
|
-
* function xxx( ) {
|
|
57
|
-
* let app = Application.instance( );
|
|
58
|
-
* app.events.close.emit( new Events.close() );
|
|
59
|
-
* }
|
|
60
|
-
*/
|
|
61
|
-
export declare class Application<P extends ApplicationProps = ApplicationProps, E extends ApplicationEventMap = ApplicationEventMap> extends BaseComponent<P, E> {
|
|
62
|
-
private static self;
|
|
63
|
-
/**
|
|
64
|
-
* the application singleton
|
|
65
|
-
*/
|
|
66
|
-
static instance(): Application;
|
|
67
|
-
private m_mainView;
|
|
68
|
-
private m_app_name;
|
|
69
|
-
private m_app_version;
|
|
70
|
-
private m_app_uid;
|
|
71
|
-
private m_local_storage;
|
|
72
|
-
private m_user_data;
|
|
73
|
-
constructor(props: P);
|
|
74
|
-
ApplicationCreated(): void;
|
|
75
|
-
get app_name(): string;
|
|
76
|
-
get app_uid(): string;
|
|
77
|
-
get app_version(): string;
|
|
78
|
-
get local_storage(): Settings;
|
|
79
|
-
get user_data(): any;
|
|
80
|
-
get history(): any;
|
|
81
|
-
/**
|
|
82
|
-
* define the application root object (MainView)
|
|
83
|
-
* @example ```ts
|
|
84
|
-
*
|
|
85
|
-
* let myApp = new Application( ... );
|
|
86
|
-
* let mainView = new VLayout( ... );
|
|
87
|
-
* myApp.setMainView( mainView );
|
|
88
|
-
*/
|
|
89
|
-
set mainView(root: Component);
|
|
90
|
-
get mainView(): Component;
|
|
91
|
-
setTitle(title: string): void;
|
|
92
|
-
disableZoomWheel(): void;
|
|
93
|
-
enterModal(enter: boolean): void;
|
|
94
|
-
}
|
|
95
|
-
export {};
|
package/lib/application.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file application.ts
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* This program is free software; you can redistribute it and/or modify
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
17
|
-
*
|
|
18
|
-
* This program is distributed in the hope that it will be useful,
|
|
19
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21
|
-
* GNU General Public License for more details.
|
|
22
|
-
*
|
|
23
|
-
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
|
-
**/
|
|
25
|
-
import { BaseComponent } from './base_component';
|
|
26
|
-
import { Settings } from './settings';
|
|
27
|
-
import { deferCall } from './tools';
|
|
28
|
-
/**
|
|
29
|
-
* Represents an x4 application, which is typically a single page app.
|
|
30
|
-
* You should inherit Application to define yours.
|
|
31
|
-
* Application derives from BaseComponent so you can use that to implement a global messaging system.
|
|
32
|
-
* @example ```ts
|
|
33
|
-
*
|
|
34
|
-
* // in yout main caode
|
|
35
|
-
* let app = new Application( );
|
|
36
|
-
*
|
|
37
|
-
* app.events.close.on( ( ev ) => {
|
|
38
|
-
* ... do something
|
|
39
|
-
* });
|
|
40
|
-
*
|
|
41
|
-
* // somewhere else in the source
|
|
42
|
-
* function xxx( ) {
|
|
43
|
-
* let app = Application.instance( );
|
|
44
|
-
* app.events.close.emit( new Events.close() );
|
|
45
|
-
* }
|
|
46
|
-
*/
|
|
47
|
-
export class Application extends BaseComponent {
|
|
48
|
-
static self = null;
|
|
49
|
-
/**
|
|
50
|
-
* the application singleton
|
|
51
|
-
*/
|
|
52
|
-
static instance() {
|
|
53
|
-
return Application.self;
|
|
54
|
-
}
|
|
55
|
-
m_mainView;
|
|
56
|
-
m_app_name;
|
|
57
|
-
m_app_version;
|
|
58
|
-
m_app_uid;
|
|
59
|
-
m_local_storage;
|
|
60
|
-
m_user_data;
|
|
61
|
-
constructor(props) {
|
|
62
|
-
console.assert(Application.self === null, 'application is a singleton');
|
|
63
|
-
super(props);
|
|
64
|
-
this.m_app_name = props.app_name ?? 'application';
|
|
65
|
-
this.m_app_version = props.app_version ?? '1.0';
|
|
66
|
-
this.m_app_uid = props.app_uid ?? 'application';
|
|
67
|
-
let settings_name = `${this.m_app_name}.${this.m_app_version}.settings`;
|
|
68
|
-
this.m_local_storage = new Settings(settings_name);
|
|
69
|
-
this.m_user_data = {};
|
|
70
|
-
Application.self = this;
|
|
71
|
-
if ('onload' in globalThis) {
|
|
72
|
-
globalThis.addEventListener('load', () => {
|
|
73
|
-
this.ApplicationCreated();
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
this.ApplicationCreated();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
ApplicationCreated() {
|
|
81
|
-
}
|
|
82
|
-
get app_name() {
|
|
83
|
-
return this.m_app_name;
|
|
84
|
-
}
|
|
85
|
-
get app_uid() {
|
|
86
|
-
return this.m_app_uid;
|
|
87
|
-
}
|
|
88
|
-
get app_version() {
|
|
89
|
-
return this.m_app_version;
|
|
90
|
-
}
|
|
91
|
-
get local_storage() {
|
|
92
|
-
return this.m_local_storage;
|
|
93
|
-
}
|
|
94
|
-
get user_data() {
|
|
95
|
-
return this.m_user_data;
|
|
96
|
-
}
|
|
97
|
-
get history() {
|
|
98
|
-
//if( !this.m_history ) {
|
|
99
|
-
// this.m_history = new NavigationHistory( );
|
|
100
|
-
//}
|
|
101
|
-
//
|
|
102
|
-
//return this.m_history;
|
|
103
|
-
debugger;
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* define the application root object (MainView)
|
|
108
|
-
* @example ```ts
|
|
109
|
-
*
|
|
110
|
-
* let myApp = new Application( ... );
|
|
111
|
-
* let mainView = new VLayout( ... );
|
|
112
|
-
* myApp.setMainView( mainView );
|
|
113
|
-
*/
|
|
114
|
-
set mainView(root) {
|
|
115
|
-
this.m_mainView = root;
|
|
116
|
-
deferCall(() => {
|
|
117
|
-
document.body.appendChild(root._build());
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
get mainView() {
|
|
121
|
-
return this.m_mainView;
|
|
122
|
-
}
|
|
123
|
-
setTitle(title) {
|
|
124
|
-
document.title = this.m_app_name + ' > ' + title;
|
|
125
|
-
}
|
|
126
|
-
disableZoomWheel() {
|
|
127
|
-
window.addEventListener('wheel', function (ev) {
|
|
128
|
-
if (ev.ctrlKey) {
|
|
129
|
-
ev.preventDefault();
|
|
130
|
-
//ev.stopPropagation( );
|
|
131
|
-
}
|
|
132
|
-
}, { passive: false, capture: true });
|
|
133
|
-
}
|
|
134
|
-
enterModal(enter) {
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
;
|
package/lib/base64.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file base64.ts
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* This program is free software; you can redistribute it and/or modify
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
17
|
-
*
|
|
18
|
-
* This program is distributed in the hope that it will be useful,
|
|
19
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21
|
-
* GNU General Public License for more details.
|
|
22
|
-
*
|
|
23
|
-
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
|
-
**/
|
|
25
|
-
export declare class Base64 {
|
|
26
|
-
lookup: any;
|
|
27
|
-
static encode(s: string | Uint8Array): string;
|
|
28
|
-
static decode(s: string): string;
|
|
29
|
-
private static _toUtf8;
|
|
30
|
-
private static _fromUtf8;
|
|
31
|
-
}
|
package/lib/base64.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file base64.ts
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* This program is free software; you can redistribute it and/or modify
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
17
|
-
*
|
|
18
|
-
* This program is distributed in the hope that it will be useful,
|
|
19
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21
|
-
* GNU General Public License for more details.
|
|
22
|
-
*
|
|
23
|
-
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
|
-
**/
|
|
25
|
-
const _alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
26
|
-
let _lookup = null;
|
|
27
|
-
export class Base64 {
|
|
28
|
-
lookup = null;
|
|
29
|
-
static encode(s) {
|
|
30
|
-
let buffer;
|
|
31
|
-
if (s instanceof Uint8Array) {
|
|
32
|
-
buffer = [];
|
|
33
|
-
s.forEach((v) => {
|
|
34
|
-
buffer.push(v);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
buffer = Base64._toUtf8(s);
|
|
39
|
-
}
|
|
40
|
-
let position = -1;
|
|
41
|
-
let len = buffer.length;
|
|
42
|
-
let nan1, nan2;
|
|
43
|
-
let enc = [, , ,];
|
|
44
|
-
let result = '';
|
|
45
|
-
while (++position < len) {
|
|
46
|
-
nan1 = buffer[position + 1], nan2 = buffer[position + 2];
|
|
47
|
-
enc[0] = buffer[position] >> 2;
|
|
48
|
-
enc[1] = ((buffer[position] & 3) << 4) | (buffer[++position] >> 4);
|
|
49
|
-
if (isNaN(nan1)) {
|
|
50
|
-
enc[2] = enc[3] = 64;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
enc[2] = ((buffer[position] & 15) << 2) | (buffer[++position] >> 6);
|
|
54
|
-
enc[3] = (isNaN(nan2)) ? 64 : buffer[position] & 63;
|
|
55
|
-
}
|
|
56
|
-
result += _alphabet[enc[0]] + _alphabet[enc[1]] + _alphabet[enc[2]] + _alphabet[enc[3]];
|
|
57
|
-
}
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
60
|
-
static decode(s) {
|
|
61
|
-
let buffer = Base64._fromUtf8(s);
|
|
62
|
-
let position = 0;
|
|
63
|
-
let len = buffer.length;
|
|
64
|
-
let result = '';
|
|
65
|
-
while (position < len) {
|
|
66
|
-
if (buffer[position] < 128) {
|
|
67
|
-
result += String.fromCharCode(buffer[position++]);
|
|
68
|
-
}
|
|
69
|
-
else if (buffer[position] > 191 && buffer[position] < 224) {
|
|
70
|
-
result += String.fromCharCode(((buffer[position++] & 31) << 6) | (buffer[position++] & 63));
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
result += String.fromCharCode(((buffer[position++] & 15) << 12) | ((buffer[position++] & 63) << 6) | (buffer[position++] & 63));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return result;
|
|
77
|
-
}
|
|
78
|
-
static _toUtf8(s) {
|
|
79
|
-
let position = -1;
|
|
80
|
-
let len = s.length;
|
|
81
|
-
let chr;
|
|
82
|
-
let buffer = [];
|
|
83
|
-
if (/^[\x00-\x7f]*$/.test(s)) {
|
|
84
|
-
while (++position < len) {
|
|
85
|
-
buffer.push(s.charCodeAt(position));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
while (++position < len) {
|
|
90
|
-
chr = s.charCodeAt(position);
|
|
91
|
-
if (chr < 128) {
|
|
92
|
-
buffer.push(chr);
|
|
93
|
-
}
|
|
94
|
-
else if (chr < 2048) {
|
|
95
|
-
buffer.push((chr >> 6) | 192, (chr & 63) | 128);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
buffer.push((chr >> 12) | 224, ((chr >> 6) & 63) | 128, (chr & 63) | 128);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return buffer;
|
|
103
|
-
}
|
|
104
|
-
static _fromUtf8(s) {
|
|
105
|
-
let position = -1;
|
|
106
|
-
let len;
|
|
107
|
-
let buffer = [];
|
|
108
|
-
let enc = [, , ,];
|
|
109
|
-
if (!_lookup) {
|
|
110
|
-
len = _alphabet.length;
|
|
111
|
-
_lookup = {};
|
|
112
|
-
while (++position < len) {
|
|
113
|
-
_lookup[_alphabet[position]] = position;
|
|
114
|
-
}
|
|
115
|
-
position = -1;
|
|
116
|
-
}
|
|
117
|
-
len = s.length;
|
|
118
|
-
while (position < len) {
|
|
119
|
-
enc[0] = _lookup[s.charAt(++position)];
|
|
120
|
-
enc[1] = _lookup[s.charAt(++position)];
|
|
121
|
-
buffer.push((enc[0] << 2) | (enc[1] >> 4));
|
|
122
|
-
enc[2] = _lookup[s.charAt(++position)];
|
|
123
|
-
if (enc[2] == 64) {
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
buffer.push(((enc[1] & 15) << 4) | (enc[2] >> 2));
|
|
127
|
-
enc[3] = _lookup[s.charAt(++position)];
|
|
128
|
-
if (enc[3] == 64) {
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
buffer.push(((enc[2] & 3) << 6) | enc[3]);
|
|
132
|
-
}
|
|
133
|
-
return buffer;
|
|
134
|
-
}
|
|
135
|
-
}
|