x4js 1.4.53 → 1.5.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/lib/cjs/action.d.ts +57 -0
- package/lib/cjs/application.d.ts +104 -0
- package/lib/cjs/autocomplete.d.ts +58 -0
- package/lib/cjs/base_component.d.ts +88 -0
- package/lib/cjs/button.d.ts +151 -0
- package/lib/cjs/calendar.d.ts +81 -0
- package/lib/cjs/canvas.d.ts +92 -0
- package/lib/cjs/cardview.d.ts +87 -0
- package/lib/cjs/checkbox.d.ts +77 -0
- package/lib/cjs/color.d.ts +148 -0
- package/lib/cjs/colorpicker.d.ts +107 -0
- package/lib/cjs/combobox.d.ts +101 -0
- package/lib/cjs/component.d.ts +601 -0
- package/lib/cjs/datastore.d.ts +396 -0
- package/lib/cjs/dialog.d.ts +175 -0
- package/lib/cjs/dom_events.d.ts +302 -0
- package/lib/cjs/drag_manager.d.ts +54 -0
- package/lib/cjs/drawtext.d.ts +48 -0
- package/lib/cjs/fileupload.d.ts +64 -0
- package/lib/cjs/form.d.ts +126 -0
- package/lib/cjs/formatters.d.ts +35 -0
- package/lib/cjs/gridview.d.ts +175 -0
- package/lib/cjs/i18n.d.ts +73 -0
- package/lib/cjs/icon.d.ts +64 -0
- package/lib/cjs/image.d.ts +55 -0
- package/lib/cjs/index.d.ts +83 -0
- package/lib/cjs/input.d.ts +91 -0
- package/lib/cjs/label.d.ts +58 -0
- package/lib/cjs/layout.d.ts +87 -0
- package/lib/cjs/link.d.ts +50 -0
- package/lib/cjs/listview.d.ts +178 -0
- package/lib/cjs/md5.d.ts +61 -0
- package/lib/cjs/menu.d.ts +130 -0
- package/lib/cjs/messagebox.d.ts +68 -0
- package/lib/cjs/panel.d.ts +47 -0
- package/lib/cjs/popup.d.ts +75 -0
- package/lib/cjs/property_editor.d.ts +71 -0
- package/lib/cjs/radiobtn.d.ts +72 -0
- package/lib/cjs/rating.d.ts +53 -0
- package/lib/cjs/request.d.ts +52 -0
- package/lib/cjs/router.d.ts +42 -0
- package/lib/cjs/settings.d.ts +37 -0
- package/lib/cjs/sidebarview.d.ts +49 -0
- package/lib/cjs/spreadsheet.d.ts +218 -0
- package/lib/cjs/styles.d.ts +85 -0
- package/lib/cjs/svgcomponent.d.ts +191 -0
- package/lib/cjs/tabbar.d.ts +58 -0
- package/lib/cjs/tabview.d.ts +49 -0
- package/lib/cjs/textarea.d.ts +63 -0
- package/lib/cjs/textedit.d.ts +123 -0
- package/lib/cjs/toaster.d.ts +42 -0
- package/lib/cjs/tools.d.ts +394 -0
- package/lib/cjs/tooltips.d.ts +46 -0
- package/lib/cjs/treeview.d.ts +132 -0
- package/lib/cjs/version.d.ts +29 -0
- package/lib/cjs/x4dom.d.ts +49 -0
- package/lib/cjs/x4events.d.ts +269 -0
- package/lib/cjs/x4react.d.ts +41 -0
- package/lib/esm/action.d.ts +57 -0
- package/lib/esm/application.d.ts +104 -0
- package/lib/esm/autocomplete.d.ts +58 -0
- package/lib/esm/base_component.d.ts +88 -0
- package/lib/esm/button.d.ts +151 -0
- package/lib/esm/calendar.d.ts +81 -0
- package/lib/esm/canvas.d.ts +92 -0
- package/lib/esm/cardview.d.ts +87 -0
- package/lib/esm/checkbox.d.ts +77 -0
- package/lib/esm/color.d.ts +148 -0
- package/lib/esm/colorpicker.d.ts +107 -0
- package/lib/esm/combobox.d.ts +101 -0
- package/lib/esm/component.d.ts +601 -0
- package/lib/esm/datastore.d.ts +396 -0
- package/lib/esm/dialog.d.ts +175 -0
- package/lib/esm/dom_events.d.ts +302 -0
- package/lib/esm/drag_manager.d.ts +54 -0
- package/lib/esm/drawtext.d.ts +48 -0
- package/lib/esm/fileupload.d.ts +64 -0
- package/lib/esm/form.d.ts +126 -0
- package/lib/esm/formatters.d.ts +35 -0
- package/lib/esm/gridview.d.ts +175 -0
- package/lib/esm/i18n.d.ts +73 -0
- package/lib/esm/icon.d.ts +64 -0
- package/lib/esm/image.d.ts +55 -0
- package/lib/esm/index.d.ts +83 -0
- package/lib/esm/input.d.ts +91 -0
- package/lib/esm/label.d.ts +58 -0
- package/lib/esm/layout.d.ts +87 -0
- package/lib/esm/link.d.ts +50 -0
- package/lib/esm/listview.d.ts +178 -0
- package/lib/esm/md5.d.ts +61 -0
- package/lib/esm/menu.d.ts +130 -0
- package/lib/esm/messagebox.d.ts +68 -0
- package/lib/esm/panel.d.ts +47 -0
- package/lib/esm/popup.d.ts +75 -0
- package/lib/esm/property_editor.d.ts +71 -0
- package/lib/esm/radiobtn.d.ts +72 -0
- package/lib/esm/rating.d.ts +53 -0
- package/lib/esm/request.d.ts +52 -0
- package/lib/esm/router.d.ts +42 -0
- package/lib/esm/settings.d.ts +37 -0
- package/lib/esm/sidebarview.d.ts +49 -0
- package/lib/esm/spreadsheet.d.ts +218 -0
- package/lib/esm/styles.d.ts +85 -0
- package/lib/esm/svgcomponent.d.ts +191 -0
- package/lib/esm/tabbar.d.ts +58 -0
- package/lib/esm/tabview.d.ts +49 -0
- package/lib/esm/textarea.d.ts +63 -0
- package/lib/esm/textedit.d.ts +123 -0
- package/lib/esm/toaster.d.ts +42 -0
- package/lib/esm/tools.d.ts +394 -0
- package/lib/esm/tooltips.d.ts +46 -0
- package/lib/esm/treeview.d.ts +132 -0
- package/lib/esm/version.d.ts +29 -0
- package/lib/esm/x4dom.d.ts +49 -0
- package/lib/esm/x4events.d.ts +269 -0
- package/lib/esm/x4react.d.ts +41 -0
- package/lib/ts_src/MIT-license.md +14 -0
- package/lib/ts_src/action.ts +88 -0
- package/lib/ts_src/alpha.jpg +0 -0
- package/lib/ts_src/application.ts +251 -0
- package/lib/ts_src/autocomplete.ts +197 -0
- package/lib/ts_src/base64.ts +166 -0
- package/lib/ts_src/base_component.ts +152 -0
- package/lib/ts_src/button.ts +355 -0
- package/lib/ts_src/calendar.ts +322 -0
- package/lib/ts_src/canvas.ts +505 -0
- package/lib/ts_src/cardview.ts +227 -0
- package/lib/ts_src/checkbox.ts +187 -0
- package/lib/ts_src/color.ts +752 -0
- package/lib/ts_src/colorpicker.ts +1639 -0
- package/lib/ts_src/combobox.ts +362 -0
- package/lib/ts_src/component.ts +2329 -0
- package/lib/ts_src/datastore.ts +1322 -0
- package/lib/ts_src/dialog.ts +656 -0
- package/lib/ts_src/dom_events.ts +315 -0
- package/lib/ts_src/drag_manager.ts +199 -0
- package/lib/ts_src/drawtext.ts +355 -0
- package/lib/ts_src/fileupload.ts +213 -0
- package/lib/ts_src/form.ts +366 -0
- package/lib/ts_src/formatters.ts +105 -0
- package/lib/ts_src/gridview.ts +1185 -0
- package/lib/ts_src/i18n.ts +346 -0
- package/lib/ts_src/icon.ts +329 -0
- package/lib/ts_src/image.ts +204 -0
- package/lib/ts_src/index.ts +88 -0
- package/lib/ts_src/input.ts +249 -0
- package/lib/ts_src/label.ts +128 -0
- package/lib/ts_src/layout.ts +430 -0
- package/lib/ts_src/link.ts +86 -0
- package/lib/ts_src/listview.ts +762 -0
- package/lib/ts_src/md5.ts +438 -0
- package/lib/ts_src/menu.ts +425 -0
- package/lib/ts_src/messagebox.ts +203 -0
- package/lib/ts_src/panel.ts +86 -0
- package/lib/ts_src/popup.ts +494 -0
- package/lib/ts_src/property_editor.ts +337 -0
- package/lib/ts_src/radiobtn.ts +196 -0
- package/lib/ts_src/rating.ts +135 -0
- package/lib/ts_src/request.ts +300 -0
- package/lib/ts_src/router.ts +185 -0
- package/lib/ts_src/settings.ts +77 -0
- package/lib/ts_src/sidebarview.ts +103 -0
- package/lib/ts_src/spreadsheet.ts +1442 -0
- package/lib/ts_src/styles.ts +343 -0
- package/lib/ts_src/svgcomponent.ts +537 -0
- package/lib/ts_src/tabbar.ts +151 -0
- package/lib/ts_src/tabview.ts +110 -0
- package/lib/ts_src/textarea.ts +187 -0
- package/lib/ts_src/textedit.ts +544 -0
- package/lib/ts_src/toaster.ts +80 -0
- package/lib/ts_src/tools.ts +1468 -0
- package/lib/ts_src/tooltips.ts +191 -0
- package/lib/ts_src/treeview.ts +675 -0
- package/lib/ts_src/version.ts +30 -0
- package/lib/ts_src/x4.less +2236 -0
- package/lib/ts_src/x4dom.ts +57 -0
- package/lib/ts_src/x4events.ts +585 -0
- package/lib/ts_src/x4react.ts +90 -0
- package/package.json +3 -2
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / \____ _|
|
|
6
|
+
* /__/\__\ |_|
|
|
7
|
+
*
|
|
8
|
+
* @file colorpicker.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
|
+
* ARGH this code is awfull
|
|
31
|
+
*/
|
|
32
|
+
import { Container, ContainerProps, ContainerEventMap } from './component';
|
|
33
|
+
import { Dialog, DialogBoxEventMap, DialogProps } from './dialog';
|
|
34
|
+
import { EvChange, EventCallback } from './x4events';
|
|
35
|
+
import { HLayout } from './layout';
|
|
36
|
+
import { Color } from './color';
|
|
37
|
+
interface ColorPickerEventMap extends ContainerEventMap {
|
|
38
|
+
change: EvChange;
|
|
39
|
+
}
|
|
40
|
+
export interface ColorPickerProps extends ContainerProps<ColorPickerEventMap> {
|
|
41
|
+
color: Color;
|
|
42
|
+
hasAlpha?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare class ColorPicker extends Container<ColorPickerProps, ColorPickerEventMap> {
|
|
45
|
+
private m_colorSel;
|
|
46
|
+
private m_colorHue;
|
|
47
|
+
private m_colorAlpha;
|
|
48
|
+
private m_sample;
|
|
49
|
+
private m_selMark;
|
|
50
|
+
private m_hueMark;
|
|
51
|
+
private m_alphaMark;
|
|
52
|
+
private m_baseHSV;
|
|
53
|
+
private m_baseColor;
|
|
54
|
+
private m_transpCk;
|
|
55
|
+
private m_colorEdit;
|
|
56
|
+
private m_palmode;
|
|
57
|
+
static last_palmode: boolean;
|
|
58
|
+
constructor(props: ColorPickerProps);
|
|
59
|
+
private _showCtx;
|
|
60
|
+
render(props: ColorPickerProps): void;
|
|
61
|
+
set color(clr: Color);
|
|
62
|
+
get color(): Color;
|
|
63
|
+
private _selChange;
|
|
64
|
+
private _hueChange;
|
|
65
|
+
private _alphaChange;
|
|
66
|
+
private _updateColor;
|
|
67
|
+
private _change;
|
|
68
|
+
}
|
|
69
|
+
interface ColorPickerBoxEventMap extends DialogBoxEventMap {
|
|
70
|
+
change: EvChange;
|
|
71
|
+
}
|
|
72
|
+
export interface ColorPickerBoxProps extends DialogProps<ColorPickerBoxEventMap> {
|
|
73
|
+
color: Color;
|
|
74
|
+
hasAlpha?: boolean;
|
|
75
|
+
cust_colors?: Color[];
|
|
76
|
+
change?: EventCallback<EvChange>;
|
|
77
|
+
}
|
|
78
|
+
export declare class ColorPickerBox extends Dialog<ColorPickerBoxProps, ColorPickerBoxEventMap> {
|
|
79
|
+
private m_picker;
|
|
80
|
+
constructor(props: ColorPickerBoxProps);
|
|
81
|
+
private _makeCustoms;
|
|
82
|
+
set color(clr: Color);
|
|
83
|
+
get color(): Color;
|
|
84
|
+
/**
|
|
85
|
+
* display a messagebox
|
|
86
|
+
*/
|
|
87
|
+
static show(props: string | ColorPickerBoxProps): ColorPickerBox;
|
|
88
|
+
}
|
|
89
|
+
export interface ColorPickerEditorProps extends ColorPickerProps {
|
|
90
|
+
label?: string;
|
|
91
|
+
labelWidth?: number;
|
|
92
|
+
cust_colors?: Color[];
|
|
93
|
+
displayValue?: false;
|
|
94
|
+
change?: EventCallback<EvChange>;
|
|
95
|
+
name?: string;
|
|
96
|
+
}
|
|
97
|
+
export declare class ColorPickerEditor extends HLayout<ColorPickerEditorProps, ColorPickerEventMap> {
|
|
98
|
+
constructor(props: ColorPickerEditorProps);
|
|
99
|
+
render(props: ColorPickerEditorProps): void;
|
|
100
|
+
set value(color: Color);
|
|
101
|
+
get value(): Color;
|
|
102
|
+
set custom_colors(v: Color[]);
|
|
103
|
+
private _showPicker;
|
|
104
|
+
private _change;
|
|
105
|
+
private _isTransp;
|
|
106
|
+
}
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / \____ _|
|
|
6
|
+
* /__/\__\ |_|
|
|
7
|
+
*
|
|
8
|
+
* @file combobox.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
|
+
* TODO: replace custom combo list by listview or gridview
|
|
31
|
+
*/
|
|
32
|
+
import { Component, CProps, ContainerEventMap } from './component';
|
|
33
|
+
import { EvChange, EvSelectionChange, EventCallback } from './x4events';
|
|
34
|
+
import { Input } from './input';
|
|
35
|
+
import { HLayout } from './layout';
|
|
36
|
+
import { ListViewItem, PopulateItems, EvCancel } from './listview';
|
|
37
|
+
import { DataStore, DataView, Record } from './datastore';
|
|
38
|
+
import { HtmlString } from './tools';
|
|
39
|
+
export interface ComboStoreProxyProps {
|
|
40
|
+
store: DataView | DataStore;
|
|
41
|
+
display: (rec: Record) => string | HtmlString;
|
|
42
|
+
}
|
|
43
|
+
export interface ComboItemRender {
|
|
44
|
+
(itm: ListViewItem): Component;
|
|
45
|
+
}
|
|
46
|
+
interface ComboBoxEventMap extends ContainerEventMap {
|
|
47
|
+
readonly change: EvChange;
|
|
48
|
+
readonly selectionChange?: EvSelectionChange;
|
|
49
|
+
readonly cancel?: EvCancel;
|
|
50
|
+
}
|
|
51
|
+
export interface ComboBoxProps extends CProps<ComboBoxEventMap> {
|
|
52
|
+
tabIndex?: number | boolean;
|
|
53
|
+
name?: string;
|
|
54
|
+
readOnly?: boolean;
|
|
55
|
+
label?: string;
|
|
56
|
+
labelWidth?: number;
|
|
57
|
+
labelAlign?: 'left' | 'right';
|
|
58
|
+
items?: ListViewItem[];
|
|
59
|
+
populate?: PopulateItems;
|
|
60
|
+
value?: any;
|
|
61
|
+
renderer?: ComboItemRender;
|
|
62
|
+
selectionChange?: EventCallback<EvSelectionChange>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @review use textedit
|
|
66
|
+
*/
|
|
67
|
+
export declare class ComboBox extends HLayout<ComboBoxProps, ComboBoxEventMap> {
|
|
68
|
+
private m_ui_input;
|
|
69
|
+
private m_ui_button;
|
|
70
|
+
private m_popup;
|
|
71
|
+
private m_selection;
|
|
72
|
+
private m_defer_sel;
|
|
73
|
+
constructor(props: ComboBoxProps);
|
|
74
|
+
set items(items: ListViewItem[]);
|
|
75
|
+
/** @ignore */
|
|
76
|
+
render(props: ComboBoxProps): void;
|
|
77
|
+
componentDisposed(): void;
|
|
78
|
+
/**
|
|
79
|
+
* display the popup
|
|
80
|
+
*/
|
|
81
|
+
showPopup(): void;
|
|
82
|
+
/** @ignore
|
|
83
|
+
*/
|
|
84
|
+
private _selectItem;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
private _setInput;
|
|
89
|
+
/**
|
|
90
|
+
*
|
|
91
|
+
*/
|
|
92
|
+
get value(): any;
|
|
93
|
+
get valueText(): string | HtmlString;
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
*/
|
|
97
|
+
set value(id: any);
|
|
98
|
+
get input(): Input;
|
|
99
|
+
static storeProxy(props: ComboStoreProxyProps): PopulateItems;
|
|
100
|
+
}
|
|
101
|
+
export {};
|