x4js 1.5.22 → 1.5.24

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.
Files changed (70) hide show
  1. package/lib/cjs/index.js +9 -9
  2. package/lib/cjs/index.js.map +3 -3
  3. package/lib/esm/index.mjs +15731 -9
  4. package/lib/esm/index.mjs.map +3 -3
  5. package/lib/src/component.ts +18 -12
  6. package/lib/src/datastore.ts +45 -57
  7. package/lib/src/drag_manager.ts +23 -6
  8. package/lib/src/layout.ts +13 -1
  9. package/lib/src/router.ts +50 -9
  10. package/lib/src/version.ts +1 -1
  11. package/lib/types/action.d.ts +57 -0
  12. package/lib/types/app_sockets.d.ts +29 -0
  13. package/lib/types/application.d.ts +104 -0
  14. package/lib/types/autocomplete.d.ts +58 -0
  15. package/lib/types/base_component.d.ts +88 -0
  16. package/lib/types/button.d.ts +151 -0
  17. package/lib/types/calendar.d.ts +82 -0
  18. package/lib/types/canvas.d.ts +92 -0
  19. package/lib/types/cardview.d.ts +87 -0
  20. package/lib/types/checkbox.d.ts +77 -0
  21. package/lib/types/color.d.ts +148 -0
  22. package/lib/types/colorpicker.d.ts +107 -0
  23. package/lib/types/combobox.d.ts +107 -0
  24. package/lib/types/component.d.ts +601 -0
  25. package/lib/types/datastore.d.ts +396 -0
  26. package/lib/types/dialog.d.ts +175 -0
  27. package/lib/types/dom_events.d.ts +302 -0
  28. package/lib/types/drag_manager.d.ts +58 -0
  29. package/lib/types/drawtext.d.ts +48 -0
  30. package/lib/types/fileupload.d.ts +64 -0
  31. package/lib/types/form.d.ts +133 -0
  32. package/lib/types/formatters.d.ts +35 -0
  33. package/lib/types/gridview.d.ts +175 -0
  34. package/lib/types/i18n.d.ts +73 -0
  35. package/lib/types/icon.d.ts +64 -0
  36. package/lib/types/image.d.ts +55 -0
  37. package/lib/types/index.d.ts +84 -5896
  38. package/lib/types/input.d.ts +91 -0
  39. package/lib/types/label.d.ts +58 -0
  40. package/lib/types/layout.d.ts +89 -0
  41. package/lib/types/link.d.ts +50 -0
  42. package/lib/types/listview.d.ts +178 -0
  43. package/lib/types/md5.d.ts +61 -0
  44. package/lib/types/menu.d.ts +130 -0
  45. package/lib/types/messagebox.d.ts +69 -0
  46. package/lib/types/panel.d.ts +47 -0
  47. package/lib/types/popup.d.ts +75 -0
  48. package/lib/types/property_editor.d.ts +71 -0
  49. package/lib/types/radiobtn.d.ts +73 -0
  50. package/lib/types/rating.d.ts +53 -0
  51. package/lib/types/request.d.ts +52 -0
  52. package/lib/types/router.d.ts +67 -0
  53. package/lib/types/settings.d.ts +37 -0
  54. package/lib/types/sidebarview.d.ts +49 -0
  55. package/lib/types/spreadsheet.d.ts +222 -0
  56. package/lib/types/styles.d.ts +85 -0
  57. package/lib/types/svgcomponent.d.ts +215 -0
  58. package/lib/types/tabbar.d.ts +58 -0
  59. package/lib/types/tabview.d.ts +49 -0
  60. package/lib/types/textarea.d.ts +77 -0
  61. package/lib/types/textedit.d.ts +123 -0
  62. package/lib/types/toaster.d.ts +42 -0
  63. package/lib/types/tools.d.ts +394 -0
  64. package/lib/types/tooltips.d.ts +46 -0
  65. package/lib/types/treeview.d.ts +144 -0
  66. package/lib/types/version.d.ts +29 -0
  67. package/lib/types/x4dom.d.ts +49 -0
  68. package/lib/types/x4events.d.ts +269 -0
  69. package/lib/types/x4react.d.ts +41 -0
  70. package/package.json +1 -1
@@ -0,0 +1,148 @@
1
+ /**
2
+ * ___ ___ __
3
+ * \ \/ / / _
4
+ * \ / /_| |_
5
+ * / \____ _|
6
+ * /__/\__\ |_|
7
+ *
8
+ * @file color.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
+ export declare class Color {
30
+ private m_value;
31
+ private static custom;
32
+ /**
33
+ * @example
34
+ * ```ts
35
+ * let c = new Color( 255, 255, 255, 0.2 );
36
+ * let d = new Color( "fff" );
37
+ * let e = new Color( "css:selection-color" );
38
+ * let f = new Color( "rgba(255,0,255,0.6)" );
39
+ * ```
40
+ */
41
+ constructor();
42
+ constructor(value: number | string);
43
+ constructor(value: number | string, alpha: number);
44
+ constructor(r: number, g: number, b: number);
45
+ constructor(r: number, g: number, b: number, a: number);
46
+ /**
47
+ *
48
+ */
49
+ private _shade;
50
+ /**
51
+ * return a color darken by percent
52
+ * @param percent
53
+ */
54
+ darken(percent: number): Color;
55
+ /**
56
+ * return a color lighten by percent
57
+ * @param percent
58
+ */
59
+ lighten(percent: number): Color;
60
+ /**
61
+ * mix 2 colors
62
+ * @param {rgb} c1 - color 1
63
+ * @param {rgb} c2 - color 2
64
+ * @param {float} percent - 0.0 to 1.0
65
+ * @example
66
+ * ```js
67
+ * let clr = Color.mix( color1, color2, 0.5 );
68
+ * ```
69
+ */
70
+ static mix(c1: Color, c2: Color, p: number): Color;
71
+ /**
72
+ * split the color into it's base element r,g,b & a (!a 1-255)
73
+ */
74
+ private _split;
75
+ /**
76
+ * change the alpha value
77
+ */
78
+ fadeout(percent: number): Color;
79
+ /**
80
+ *
81
+ */
82
+ static fromHSV(h: number, s: number, v: number, a?: number): Color;
83
+ /**
84
+ *
85
+ */
86
+ static toHSV(c: Color): {
87
+ h: any;
88
+ s: number;
89
+ v: number;
90
+ a: number;
91
+ };
92
+ /**
93
+ *
94
+ */
95
+ static fromHLS(h: number, l: number, s: number): Color;
96
+ /**
97
+ *
98
+ */
99
+ static toHLS(color: Color): {
100
+ h: number;
101
+ l: number;
102
+ s: any;
103
+ };
104
+ /**
105
+ * get the red value of the color
106
+ */
107
+ red(): number;
108
+ /**
109
+ * get the green value of the color
110
+ */
111
+ green(): number;
112
+ /**
113
+ * get the blue value of the color
114
+ */
115
+ blue(): number;
116
+ /**
117
+ * get the alpha value of the color
118
+ */
119
+ alpha(): number;
120
+ /**
121
+ *
122
+ */
123
+ value(): number;
124
+ /**
125
+ * convert the color into string value
126
+ */
127
+ toString(): string;
128
+ toHex(with_alpha?: boolean): string;
129
+ static addCustomColor(name: string, value: Color): void;
130
+ static addCssColor(name: string): void;
131
+ static parse(str: string): Color;
132
+ private _getCustomColor;
133
+ static contrastColor(color: Color): Color;
134
+ /**
135
+ *
136
+ */
137
+ static WHITE: Color;
138
+ /**
139
+ *
140
+ */
141
+ static BLACK: Color;
142
+ /**
143
+ *
144
+ */
145
+ static NONE: Color;
146
+ static valueFromColorName(name: string): Color;
147
+ static fromCssVar(varName: string): string;
148
+ }
@@ -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,107 @@
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, EvCancel, PopulateItems } 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[] | PopulateItems;
59
+ value?: any;
60
+ renderer?: ComboItemRender;
61
+ selectionChange?: EventCallback<EvSelectionChange>;
62
+ editable?: boolean;
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_lockpop;
72
+ private m_lockchg;
73
+ private m_popvis;
74
+ private m_selection;
75
+ constructor(props: ComboBoxProps);
76
+ _onKey(e: any): void;
77
+ set items(items: ListViewItem[]);
78
+ /** @ignore */
79
+ render(props: ComboBoxProps): void;
80
+ componentDisposed(): void;
81
+ /**
82
+ * display the popup
83
+ */
84
+ showPopup(filter_items?: boolean): ListViewItem[];
85
+ /** @ignore
86
+ */
87
+ private _selectItem;
88
+ /**
89
+ *
90
+ */
91
+ private _setInput;
92
+ /**
93
+ *
94
+ */
95
+ get value(): any;
96
+ get valueText(): string | HtmlString;
97
+ /**
98
+ *
99
+ */
100
+ set value(id: any);
101
+ get input(): Input;
102
+ _checkFocus(): void;
103
+ _hidePopup(): void;
104
+ static storeProxy(props: ComboStoreProxyProps): PopulateItems;
105
+ focus(): void;
106
+ }
107
+ export {};