x4js 1.5.40 → 1.6.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.
- package/README.md +1 -1
- package/changelog.txt +23 -0
- package/lib/README.txt +1 -1
- package/lib/changelog.txt +3 -0
- package/lib/cjs/{index.js → x4js.js} +3 -3
- package/lib/cjs/x4js.js.map +7 -0
- package/lib/esm/{index.mjs → x4js.mjs} +3 -3
- package/lib/esm/{index.mjs.map → x4js.mjs.map} +1 -1
- package/lib/src/MIT-license.md +1 -1
- package/lib/src/action.ts +1 -1
- package/lib/src/app_sockets.ts +1 -1
- package/lib/src/application.ts +1 -1
- package/lib/src/autocomplete.ts +1 -1
- package/lib/src/base64.ts +1 -1
- package/lib/src/base_component.ts +1 -1
- package/lib/src/button.ts +1 -1
- package/lib/src/calendar.ts +1 -1
- package/lib/src/canvas.ts +1 -1
- package/lib/src/cardview.ts +1 -1
- package/lib/src/checkbox.ts +1 -1
- package/lib/src/color.ts +1 -1
- package/lib/src/colorpicker.ts +1 -1
- package/lib/src/combobox.ts +1 -1
- package/lib/src/component.ts +1 -1
- package/lib/src/copyright.txt +1 -1
- package/lib/src/datastore.ts +1 -1
- package/lib/src/dialog.ts +1 -1
- package/lib/src/dom_events.ts +1 -1
- package/lib/src/drag_manager.ts +1 -1
- package/lib/src/drawtext.ts +1 -1
- package/lib/src/fileupload.ts +1 -1
- package/lib/src/form.ts +1 -1
- package/lib/src/formatters.ts +1 -1
- package/lib/src/gridview.ts +1 -1
- package/lib/src/i18n.ts +1 -1
- package/lib/src/icon.ts +1 -1
- package/lib/src/image.ts +1 -1
- package/lib/src/index.ts +1 -1
- package/lib/src/input.ts +1 -1
- package/lib/src/label.ts +1 -1
- package/lib/src/layout.ts +1 -1
- package/lib/src/link.ts +1 -1
- package/lib/src/listview.ts +1 -1
- package/lib/src/md5.ts +1 -1
- package/lib/src/menu.ts +1 -1
- package/lib/src/messagebox.ts +1 -1
- package/lib/src/panel.ts +1 -1
- package/lib/src/popup.ts +1 -1
- package/lib/src/property_editor.ts +1 -1
- package/lib/src/radiobtn.ts +1 -1
- package/lib/src/rating.ts +1 -1
- package/lib/src/request.ts +1 -1
- package/lib/src/router.ts +1 -1
- package/lib/src/settings.ts +1 -1
- package/lib/src/sidebarview.ts +1 -1
- package/lib/src/spreadsheet.ts +1 -1
- package/lib/src/styles.ts +1 -1
- package/lib/src/svgcomponent.ts +1 -1
- package/lib/src/tabbar.ts +1 -1
- package/lib/src/tabview.ts +1 -1
- package/lib/src/textarea.ts +1 -1
- package/lib/src/textedit.ts +1 -1
- package/lib/src/toaster.ts +1 -1
- package/lib/src/tools.ts +1 -1
- package/lib/src/tooltips.ts +1 -1
- package/lib/src/treeview.ts +1 -1
- package/lib/src/version.ts +2 -2
- package/lib/src/x4.less +1 -1
- package/lib/src/x4dom.ts +1 -1
- package/lib/src/x4events.ts +1 -1
- package/lib/src/x4js.ts +89 -0
- package/lib/src/x4react.ts +1 -1
- package/lib/styles/x4.css +1 -1
- package/lib/styles/x4.less +1 -1
- package/lib/types/x4js.d.ts +6762 -0
- package/package.json +10 -8
- package/lib/cjs/index.js.map +0 -7
- package/lib/esm/index.js.map +0 -7
- package/lib/types/action.d.ts +0 -57
- package/lib/types/app_sockets.d.ts +0 -29
- package/lib/types/application.d.ts +0 -108
- package/lib/types/autocomplete.d.ts +0 -63
- package/lib/types/base_component.d.ts +0 -88
- package/lib/types/button.d.ts +0 -151
- package/lib/types/calendar.d.ts +0 -82
- package/lib/types/canvas.d.ts +0 -92
- package/lib/types/cardview.d.ts +0 -87
- package/lib/types/checkbox.d.ts +0 -77
- package/lib/types/color.d.ts +0 -148
- package/lib/types/colorpicker.d.ts +0 -107
- package/lib/types/combobox.d.ts +0 -111
- package/lib/types/component.d.ts +0 -603
- package/lib/types/datastore.d.ts +0 -396
- package/lib/types/dialog.d.ts +0 -175
- package/lib/types/dom_events.d.ts +0 -302
- package/lib/types/drag_manager.d.ts +0 -58
- package/lib/types/drawtext.d.ts +0 -48
- package/lib/types/fileupload.d.ts +0 -64
- package/lib/types/form.d.ts +0 -142
- package/lib/types/formatters.d.ts +0 -35
- package/lib/types/gridview.d.ts +0 -175
- package/lib/types/i18n.d.ts +0 -73
- package/lib/types/icon.d.ts +0 -71
- package/lib/types/image.d.ts +0 -56
- package/lib/types/index.d.ts +0 -84
- package/lib/types/input.d.ts +0 -97
- package/lib/types/label.d.ts +0 -67
- package/lib/types/layout.d.ts +0 -89
- package/lib/types/link.d.ts +0 -50
- package/lib/types/listview.d.ts +0 -178
- package/lib/types/md5.d.ts +0 -61
- package/lib/types/menu.d.ts +0 -130
- package/lib/types/messagebox.d.ts +0 -69
- package/lib/types/panel.d.ts +0 -47
- package/lib/types/popup.d.ts +0 -75
- package/lib/types/property_editor.d.ts +0 -71
- package/lib/types/radiobtn.d.ts +0 -73
- package/lib/types/rating.d.ts +0 -53
- package/lib/types/request.d.ts +0 -52
- package/lib/types/router.d.ts +0 -67
- package/lib/types/settings.d.ts +0 -37
- package/lib/types/sidebarview.d.ts +0 -51
- package/lib/types/spreadsheet.d.ts +0 -222
- package/lib/types/styles.d.ts +0 -85
- package/lib/types/svgcomponent.d.ts +0 -216
- package/lib/types/tabbar.d.ts +0 -58
- package/lib/types/tabview.d.ts +0 -49
- package/lib/types/textarea.d.ts +0 -77
- package/lib/types/textedit.d.ts +0 -126
- package/lib/types/toaster.d.ts +0 -42
- package/lib/types/tools.d.ts +0 -394
- package/lib/types/tooltips.d.ts +0 -46
- package/lib/types/treeview.d.ts +0 -144
- package/lib/types/version.d.ts +0 -29
- package/lib/types/x4dom.d.ts +0 -49
- package/lib/types/x4events.d.ts +0 -269
- package/lib/types/x4react.d.ts +0 -41
package/lib/types/textedit.d.ts
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \_/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / _ \____ _|
|
|
6
|
-
* /__/ \__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file textedit.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
|
-
import { Component, EvFocus, HtmlString } from './component';
|
|
30
|
-
import { Input, InputProps, InputEventMap, EditType } from './input';
|
|
31
|
-
import { IconID } from './icon';
|
|
32
|
-
import { EvClick, EvChange, EventCallback } from './x4events';
|
|
33
|
-
type ValidationFunction = (value: string) => string;
|
|
34
|
-
interface TextEditEventMap extends InputEventMap {
|
|
35
|
-
click: EvClick;
|
|
36
|
-
change: EvChange;
|
|
37
|
-
focus: EvFocus;
|
|
38
|
-
}
|
|
39
|
-
export interface TextEditProps extends InputProps<TextEditEventMap> {
|
|
40
|
-
label?: string | HtmlString;
|
|
41
|
-
labelWidth?: number;
|
|
42
|
-
labelAlign?: 'left' | 'right' | 'top';
|
|
43
|
-
required?: boolean;
|
|
44
|
-
spellcheck?: boolean;
|
|
45
|
-
icon?: IconID;
|
|
46
|
-
pattern?: string;
|
|
47
|
-
uppercase?: boolean;
|
|
48
|
-
format?: string | 'native';
|
|
49
|
-
autosel?: boolean;
|
|
50
|
-
gadgets?: Component[];
|
|
51
|
-
validator?: ValidationFunction;
|
|
52
|
-
change?: EventCallback<EvChange>;
|
|
53
|
-
click?: EventCallback<EvClick>;
|
|
54
|
-
focus?: EventCallback<EvFocus>;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* TextEdit is a single line editor, it can have a label and an error descriptor.
|
|
58
|
-
*/
|
|
59
|
-
export declare class TextEdit<T extends TextEditProps = TextEditProps, E extends TextEditEventMap = TextEditEventMap> extends Component<T, E> {
|
|
60
|
-
private m_cal_popup;
|
|
61
|
-
protected m_ui_input: Input;
|
|
62
|
-
constructor(props: T);
|
|
63
|
-
componentCreated(): void;
|
|
64
|
-
focus(): void;
|
|
65
|
-
/** @ignore */
|
|
66
|
-
render(props: TextEditProps): void;
|
|
67
|
-
enable(ena?: boolean): void;
|
|
68
|
-
disable(): void;
|
|
69
|
-
private _btnClick;
|
|
70
|
-
/**
|
|
71
|
-
* select the value format for input/output on textedit of type date
|
|
72
|
-
* cf. formatIntlDate / parseIntlDate
|
|
73
|
-
* @param fmt
|
|
74
|
-
*/
|
|
75
|
-
setDateStoreFormat(fmt: string): void;
|
|
76
|
-
setStoreValue(value: any): void;
|
|
77
|
-
getStoreValue(): any;
|
|
78
|
-
private _date_get_hook;
|
|
79
|
-
private _date_set_hook;
|
|
80
|
-
showError(text: string): void;
|
|
81
|
-
clearError(): void;
|
|
82
|
-
get value(): string;
|
|
83
|
-
getValue(): string;
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
*/
|
|
87
|
-
set value(value: string);
|
|
88
|
-
setValue(value: string): void;
|
|
89
|
-
/**
|
|
90
|
-
* select all the text
|
|
91
|
-
*/
|
|
92
|
-
selectAll(): void;
|
|
93
|
-
select(start: number, length?: number): void;
|
|
94
|
-
getSelection(): {
|
|
95
|
-
start: number;
|
|
96
|
-
length: number;
|
|
97
|
-
};
|
|
98
|
-
set readOnly(ro: boolean);
|
|
99
|
-
get label(): string | HtmlString;
|
|
100
|
-
set label(text: string | HtmlString);
|
|
101
|
-
/**
|
|
102
|
-
* content changed
|
|
103
|
-
* todo: should move into Input
|
|
104
|
-
*/
|
|
105
|
-
private _change;
|
|
106
|
-
/**
|
|
107
|
-
* getting focus
|
|
108
|
-
*/
|
|
109
|
-
private _focus;
|
|
110
|
-
/**
|
|
111
|
-
* loosing focus
|
|
112
|
-
* @param value
|
|
113
|
-
*/
|
|
114
|
-
private _blur;
|
|
115
|
-
/**
|
|
116
|
-
* todo: should move into Input
|
|
117
|
-
* @returns
|
|
118
|
-
*/
|
|
119
|
-
validate(): boolean;
|
|
120
|
-
protected _validate(value: string): boolean;
|
|
121
|
-
_date_validator(value: string): string;
|
|
122
|
-
private _showDatePicker;
|
|
123
|
-
get input(): Input;
|
|
124
|
-
get type(): EditType;
|
|
125
|
-
}
|
|
126
|
-
export {};
|
package/lib/types/toaster.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \_/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / _ \____ _|
|
|
6
|
-
* /__/ \__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file toaster.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
|
-
import { IconID } from './icon';
|
|
30
|
-
import { Popup, PopupProps } from './popup';
|
|
31
|
-
export interface ToasterProps extends PopupProps {
|
|
32
|
-
message: string;
|
|
33
|
-
icon?: IconID;
|
|
34
|
-
}
|
|
35
|
-
export declare class Toaster extends Popup<ToasterProps> {
|
|
36
|
-
private m_message;
|
|
37
|
-
private m_icon;
|
|
38
|
-
constructor(props: ToasterProps);
|
|
39
|
-
/** @ignore */
|
|
40
|
-
render(): void;
|
|
41
|
-
show(): void;
|
|
42
|
-
}
|
package/lib/types/tools.d.ts
DELETED
|
@@ -1,394 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \_/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / _ \____ _|
|
|
6
|
-
* /__/ \__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file tools.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
|
-
* @return true is the device has touch
|
|
31
|
-
*/
|
|
32
|
-
export declare function isTouchDevice(): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* round to a given number of decimals
|
|
35
|
-
* @param num numbre to round
|
|
36
|
-
* @param ndec number of decimals
|
|
37
|
-
* @returns number rounded
|
|
38
|
-
*/
|
|
39
|
-
export declare function roundTo(num: number, ndec: number): number;
|
|
40
|
-
/**
|
|
41
|
-
* parse an intl formatted number
|
|
42
|
-
* understand grouping and ',' separator
|
|
43
|
-
* @review us format: grouping = ','
|
|
44
|
-
* @param num
|
|
45
|
-
*/
|
|
46
|
-
export declare function parseIntlFloat(num: string): number;
|
|
47
|
-
/**
|
|
48
|
-
* inverse of camel case
|
|
49
|
-
* theThingToCase -> the-thing-to-case
|
|
50
|
-
* @param {String} str
|
|
51
|
-
*/
|
|
52
|
-
export declare function pascalCase(string: string): string;
|
|
53
|
-
export declare function camelCase(text: string): string;
|
|
54
|
-
export type Constructor<T> = new (...args: any[]) => T;
|
|
55
|
-
export declare class Point {
|
|
56
|
-
x: number;
|
|
57
|
-
y: number;
|
|
58
|
-
constructor(x?: number, y?: number);
|
|
59
|
-
}
|
|
60
|
-
export declare class Size {
|
|
61
|
-
width: number;
|
|
62
|
-
height: number;
|
|
63
|
-
constructor(w?: number, h?: number);
|
|
64
|
-
}
|
|
65
|
-
export declare class Rect {
|
|
66
|
-
left: number;
|
|
67
|
-
top: number;
|
|
68
|
-
width: number;
|
|
69
|
-
height: number;
|
|
70
|
-
constructor();
|
|
71
|
-
constructor(rc: Rect);
|
|
72
|
-
constructor(rc: DOMRect);
|
|
73
|
-
constructor(left: number, top: number, width: number, height: number);
|
|
74
|
-
set(left: number, top: number, width: number, height: number): void;
|
|
75
|
-
get bottom(): number;
|
|
76
|
-
set bottom(bottom: number);
|
|
77
|
-
get right(): number;
|
|
78
|
-
set right(right: number);
|
|
79
|
-
get topLeft(): Point;
|
|
80
|
-
get bottomRight(): Point;
|
|
81
|
-
get size(): Size;
|
|
82
|
-
moveTo(left: number, top: number): this;
|
|
83
|
-
movedTo(left: number, top: number): Rect;
|
|
84
|
-
moveBy(dx: number, dy: number): this;
|
|
85
|
-
movedBy(dx: number, dy: number): Rect;
|
|
86
|
-
isEmpty(): boolean;
|
|
87
|
-
normalize(): this;
|
|
88
|
-
normalized(): Rect;
|
|
89
|
-
/**
|
|
90
|
-
* @deprecated
|
|
91
|
-
*/
|
|
92
|
-
containsPt(x: number, y: number): boolean;
|
|
93
|
-
contains(pt: Point): boolean;
|
|
94
|
-
contains(rc: Rect): boolean;
|
|
95
|
-
touches(rc: Rect): boolean;
|
|
96
|
-
inflate(dx: number, dy?: number): void;
|
|
97
|
-
inflatedBy(dx: number, dy?: number): Rect;
|
|
98
|
-
combine(rc: Rect): void;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* replace {0..9} by given arguments
|
|
102
|
-
* @param format string
|
|
103
|
-
* @param args
|
|
104
|
-
*
|
|
105
|
-
* @example ```ts
|
|
106
|
-
*
|
|
107
|
-
* console.log( sprintf( 'here is arg 1 {1} and arg 0 {0}', 'argument 0', 'argument 1' ) )
|
|
108
|
-
*/
|
|
109
|
-
export declare function sprintf(format: string, ...args: any[]): string;
|
|
110
|
-
/**
|
|
111
|
-
* replace special characters for display
|
|
112
|
-
* @param unsafe
|
|
113
|
-
*
|
|
114
|
-
* console.log( escapeHtml('<div style="width:50px; height: 50px; background-color:red"></div>') );
|
|
115
|
-
*/
|
|
116
|
-
export declare function escapeHtml(unsafe: string, nl_br?: boolean): string;
|
|
117
|
-
/**
|
|
118
|
-
* replace special characters for display
|
|
119
|
-
* @author Steven Levithan <http://slevithan.com/>
|
|
120
|
-
* @param unsafe
|
|
121
|
-
*
|
|
122
|
-
* console.log( removeHtmlTags('<h1>sss</h1>') );
|
|
123
|
-
*/
|
|
124
|
-
export declare function removeHtmlTags(unsafe: string, nl_br?: boolean): string;
|
|
125
|
-
/**
|
|
126
|
-
* change the current locale for misc translations (date...)
|
|
127
|
-
* @param locale
|
|
128
|
-
*/
|
|
129
|
-
export declare function _date_set_locale(locale: string): void;
|
|
130
|
-
/**
|
|
131
|
-
*
|
|
132
|
-
* @param date
|
|
133
|
-
* @param options
|
|
134
|
-
* @example
|
|
135
|
-
* let date = new Date( );
|
|
136
|
-
* let options = { day: 'numeric', month: 'numeric', year: 'numeric', hour: 'numeric', minute: 'numeric' };
|
|
137
|
-
* let text = date_format( date, options );
|
|
138
|
-
*/
|
|
139
|
-
export declare function date_format(date: Date, options?: any): string;
|
|
140
|
-
/**
|
|
141
|
-
*
|
|
142
|
-
* @param date
|
|
143
|
-
* @param options
|
|
144
|
-
*/
|
|
145
|
-
export declare function date_diff(date1: Date, date2: Date, options?: any): string;
|
|
146
|
-
export declare function date_to_sql(date: Date, withHours: boolean): string;
|
|
147
|
-
/**
|
|
148
|
-
* construct a date from an utc date time (sql format)
|
|
149
|
-
* YYYY-MM-DD HH:MM:SS
|
|
150
|
-
*/
|
|
151
|
-
export declare function date_sql_utc(date: string): Date;
|
|
152
|
-
/**
|
|
153
|
-
* return a number that is a representation of the date
|
|
154
|
-
* this number can be compared with another hash
|
|
155
|
-
*/
|
|
156
|
-
export declare function date_hash(date: Date): number;
|
|
157
|
-
/**
|
|
158
|
-
* return a copy of a date
|
|
159
|
-
*/
|
|
160
|
-
export declare function date_clone(date: Date): Date;
|
|
161
|
-
/**
|
|
162
|
-
* return the week number of a date
|
|
163
|
-
*/
|
|
164
|
-
export declare function date_calc_weeknum(date: Date): number;
|
|
165
|
-
/**
|
|
166
|
-
* parse a date according to the given format
|
|
167
|
-
* @param value - string date to parse
|
|
168
|
-
* @param fmts - format list - i18 tranlation by default
|
|
169
|
-
* allowed format specifiers:
|
|
170
|
-
* d or D: date (1 or 2 digits)
|
|
171
|
-
* m or M: month (1 or 2 digits)
|
|
172
|
-
* y or Y: year (2 or 4 digits)
|
|
173
|
-
* h or H: hours (1 or 2 digits)
|
|
174
|
-
* i or I: minutes (1 or 2 digits)
|
|
175
|
-
* s or S: seconds (1 or 2 digits)
|
|
176
|
-
* <space>: 1 or more spaces
|
|
177
|
-
* any other char: <0 or more spaces><the char><0 or more spaces>
|
|
178
|
-
* each specifiers is separated from other by a pipe (|)
|
|
179
|
-
* more specific at first
|
|
180
|
-
* @example
|
|
181
|
-
* 'd/m/y|d m Y|dmy|y-m-d h:i:s|y-m-d'
|
|
182
|
-
*/
|
|
183
|
-
export declare function parseIntlDate(value: string, fmts?: string): Date;
|
|
184
|
-
/**
|
|
185
|
-
* format a date as string
|
|
186
|
-
* @param date - date to format
|
|
187
|
-
* @param fmt - format
|
|
188
|
-
* format specifiers:
|
|
189
|
-
* d: date
|
|
190
|
-
* D: 2 digits date padded with 0
|
|
191
|
-
* j: day of week short mode 'mon'
|
|
192
|
-
* J: day of week long mode 'monday'
|
|
193
|
-
* w: week number
|
|
194
|
-
* m: month
|
|
195
|
-
* M: 2 digits month padded with 0
|
|
196
|
-
* o: month short mode 'jan'
|
|
197
|
-
* O: month long mode 'january'
|
|
198
|
-
* y or Y: year
|
|
199
|
-
* h: hour (24 format)
|
|
200
|
-
* H: 2 digits hour (24 format) padded with 0
|
|
201
|
-
* i: minutes
|
|
202
|
-
* I: 2 digits minutes padded with 0
|
|
203
|
-
* s: seconds
|
|
204
|
-
* S: 2 digits seconds padded with 0
|
|
205
|
-
* a: am or pm
|
|
206
|
-
* anything else is inserted
|
|
207
|
-
* if you need to insert some text, put it between {}
|
|
208
|
-
*
|
|
209
|
-
* @example
|
|
210
|
-
*
|
|
211
|
-
* 01/01/1970 11:25:00 with '{this is my demo date formatter: }H-i*M'
|
|
212
|
-
* "this is my demo date formatter: 11-25*january"
|
|
213
|
-
*/
|
|
214
|
-
export declare function formatIntlDate(date: Date, fmt?: string): string;
|
|
215
|
-
export declare function calcAge(birth: Date, ref?: Date): number;
|
|
216
|
-
/**
|
|
217
|
-
* date object patch
|
|
218
|
-
*/
|
|
219
|
-
declare global {
|
|
220
|
-
interface Date {
|
|
221
|
-
hash(): number;
|
|
222
|
-
clone(): Date;
|
|
223
|
-
weekNum(): number;
|
|
224
|
-
format(format: string): string;
|
|
225
|
-
isSameDay(date: Date): boolean;
|
|
226
|
-
addDays(days: number): any;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
*
|
|
231
|
-
* @param data data to export
|
|
232
|
-
* @param mimetype - 'text/plain'
|
|
233
|
-
*/
|
|
234
|
-
export declare function downloadData(data: any, mimetype: string, filename: string): void;
|
|
235
|
-
/**
|
|
236
|
-
* check if a value is a string
|
|
237
|
-
* @param val
|
|
238
|
-
*/
|
|
239
|
-
export declare function isString(val: any): val is string;
|
|
240
|
-
/**
|
|
241
|
-
* check is a value is an array
|
|
242
|
-
* @param val
|
|
243
|
-
*/
|
|
244
|
-
export declare function isArray(val: any): val is any[];
|
|
245
|
-
/**
|
|
246
|
-
*
|
|
247
|
-
*/
|
|
248
|
-
export declare function isFunction(val: any): val is Function;
|
|
249
|
-
/**
|
|
250
|
-
*
|
|
251
|
-
*/
|
|
252
|
-
export declare function isLiteralObject(val: any): boolean;
|
|
253
|
-
/**
|
|
254
|
-
* prepend 0 to a value to a given length
|
|
255
|
-
* @param value
|
|
256
|
-
* @param length
|
|
257
|
-
*/
|
|
258
|
-
export declare function pad(what: unknown, size: number, ch?: string): string;
|
|
259
|
-
/**
|
|
260
|
-
* return true if val is a finite number
|
|
261
|
-
*/
|
|
262
|
-
export declare function isNumber(val: any): val is number;
|
|
263
|
-
/**
|
|
264
|
-
*
|
|
265
|
-
* @param name
|
|
266
|
-
*/
|
|
267
|
-
export declare function waitFontLoading(name: string): Promise<void>;
|
|
268
|
-
/**
|
|
269
|
-
*
|
|
270
|
-
* @param fn
|
|
271
|
-
* @param tm
|
|
272
|
-
*
|
|
273
|
-
* @example:
|
|
274
|
-
*
|
|
275
|
-
* defer( ( ) => {
|
|
276
|
-
* console.log( x );
|
|
277
|
-
* } )( );
|
|
278
|
-
*/
|
|
279
|
-
export declare function deferCall(fn: Function, tm?: number, ...args: any[]): void;
|
|
280
|
-
/**
|
|
281
|
-
*
|
|
282
|
-
*/
|
|
283
|
-
export declare function asap(cb: (time: number) => void): void;
|
|
284
|
-
/**
|
|
285
|
-
* micro md to html
|
|
286
|
-
*
|
|
287
|
-
* understand:
|
|
288
|
-
* **bold**
|
|
289
|
-
* *italic*
|
|
290
|
-
*
|
|
291
|
-
* > quote
|
|
292
|
-
* - list
|
|
293
|
-
* # title lvl 1
|
|
294
|
-
* ## title lvl 2
|
|
295
|
-
* ### title lvl 3 ...
|
|
296
|
-
*
|
|
297
|
-
*/
|
|
298
|
-
export declare function markdownToHtml(text: string): string;
|
|
299
|
-
/**
|
|
300
|
-
*
|
|
301
|
-
*/
|
|
302
|
-
export declare class NetworkError extends Error {
|
|
303
|
-
private m_code;
|
|
304
|
-
constructor(response: Response);
|
|
305
|
-
constructor(code: number, text: string);
|
|
306
|
-
get code(): number;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* return the mouse pos in client coordinates
|
|
310
|
-
* handle correctly touch & mouse
|
|
311
|
-
*/
|
|
312
|
-
export declare function getMousePos(ev: UIEvent, fromDoc: boolean): Point;
|
|
313
|
-
/**
|
|
314
|
-
* clamp a value
|
|
315
|
-
* @param v - value to clamp
|
|
316
|
-
* @param min - min value
|
|
317
|
-
* @param max - max value
|
|
318
|
-
* @returns clamped value
|
|
319
|
-
*/
|
|
320
|
-
export declare function clamp(v: number, min: number, max: number): number;
|
|
321
|
-
/**
|
|
322
|
-
*
|
|
323
|
-
*/
|
|
324
|
-
export interface IDisposable {
|
|
325
|
-
dispose(): any;
|
|
326
|
-
}
|
|
327
|
-
export declare class HtmlString extends String {
|
|
328
|
-
constructor(text: string);
|
|
329
|
-
static from(text: string): HtmlString;
|
|
330
|
-
}
|
|
331
|
-
export declare function html(a: any, ...b: any[]): HtmlString;
|
|
332
|
-
export declare function isHtmlString(val: any): val is HtmlString;
|
|
333
|
-
export declare class Clipboard {
|
|
334
|
-
static copy(data: any): void;
|
|
335
|
-
static paste(cb: (data: string) => void): void;
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Calculates the CRC32 checksum of a string.
|
|
339
|
-
* taken from: https://gist.github.com/wqli78/1330293/6d85cc967f32cccfcbad94ae7d088a3dcfc14bd9
|
|
340
|
-
*
|
|
341
|
-
* @param {String} str
|
|
342
|
-
* @param {Boolean} hex
|
|
343
|
-
* @return {String} checksum
|
|
344
|
-
* @api public
|
|
345
|
-
*/
|
|
346
|
-
export declare function crc32(str: any): number;
|
|
347
|
-
/**
|
|
348
|
-
* taken from this excellent article:
|
|
349
|
-
* https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/
|
|
350
|
-
*
|
|
351
|
-
* @example:
|
|
352
|
-
* class MyClass extends mix(MyBaseClass).with(Mixin1, Mixin2) {
|
|
353
|
-
* }
|
|
354
|
-
**/
|
|
355
|
-
export declare const mix: (superclass: any) => MixinBuilder;
|
|
356
|
-
declare class MixinBuilder {
|
|
357
|
-
private superclass;
|
|
358
|
-
constructor(superclass: any);
|
|
359
|
-
with(...mixins: any[]): any;
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* @example
|
|
363
|
-
*
|
|
364
|
-
* ```
|
|
365
|
-
* const cls = classNames( 'class1 class2', {
|
|
366
|
-
* 'class3': false,
|
|
367
|
-
* 'class4': true,
|
|
368
|
-
* });
|
|
369
|
-
*
|
|
370
|
-
* // even shorter
|
|
371
|
-
* const class1 = true, class2 = false;
|
|
372
|
-
* const cls = classNames( { class1, class2 } ); // cls = "class1"
|
|
373
|
-
*
|
|
374
|
-
* ```
|
|
375
|
-
*
|
|
376
|
-
* @returns
|
|
377
|
-
*/
|
|
378
|
-
export declare function classNames(...args: (string | any)[]): string;
|
|
379
|
-
/**
|
|
380
|
-
*
|
|
381
|
-
*/
|
|
382
|
-
interface PasswordRule {
|
|
383
|
-
chars: string;
|
|
384
|
-
min: number;
|
|
385
|
-
}
|
|
386
|
-
export declare function generatePassword(length: number, rules?: PasswordRule[]): string;
|
|
387
|
-
/**
|
|
388
|
-
* taken from live-server
|
|
389
|
-
* https://github.com/tapio/live-server
|
|
390
|
-
* @param host
|
|
391
|
-
* @param port
|
|
392
|
-
*/
|
|
393
|
-
export declare function installHMR(host?: string, port?: string, reloadCallback?: Function): void;
|
|
394
|
-
export {};
|
package/lib/types/tooltips.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \_/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / _ \____ _|
|
|
6
|
-
* /__/ \__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file tooltips.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
|
-
import { Component } from './component';
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
export declare class Tooltip extends Component {
|
|
34
|
-
private m_text;
|
|
35
|
-
set text(text: any);
|
|
36
|
-
/** @ignore */
|
|
37
|
-
render(): void;
|
|
38
|
-
/**
|
|
39
|
-
* display the menu at a specific position
|
|
40
|
-
* @param x
|
|
41
|
-
* @param y
|
|
42
|
-
*/
|
|
43
|
-
displayAt(x: number, y: number, align?: string): void;
|
|
44
|
-
}
|
|
45
|
-
export type TooltipHandler = (text: string) => void;
|
|
46
|
-
export declare function initTooltips(cb?: TooltipHandler): void;
|