x4js 1.5.40 → 1.6.1

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 (137) hide show
  1. package/README.md +1 -1
  2. package/lib/README.txt +1 -1
  3. package/lib/changelog.txt +3 -0
  4. package/lib/cjs/{index.js → x4js.js} +7 -7
  5. package/lib/cjs/x4js.js.map +7 -0
  6. package/lib/esm/{index.mjs → x4js.mjs} +18 -12
  7. package/lib/esm/x4js.mjs.map +7 -0
  8. package/lib/src/MIT-license.md +1 -1
  9. package/lib/src/action.ts +1 -1
  10. package/lib/src/app_sockets.ts +1 -1
  11. package/lib/src/application.ts +3 -3
  12. package/lib/src/autocomplete.ts +1 -1
  13. package/lib/src/base64.ts +1 -1
  14. package/lib/src/base_component.ts +1 -1
  15. package/lib/src/button.ts +1 -1
  16. package/lib/src/calendar.ts +2 -2
  17. package/lib/src/canvas.ts +9 -4
  18. package/lib/src/cardview.ts +9 -8
  19. package/lib/src/checkbox.ts +1 -1
  20. package/lib/src/color.ts +4 -4
  21. package/lib/src/colorpicker.ts +18 -8
  22. package/lib/src/combobox.ts +7 -7
  23. package/lib/src/component.ts +45 -41
  24. package/lib/src/copyright.txt +1 -1
  25. package/lib/src/datastore.ts +1 -1
  26. package/lib/src/dialog.ts +2 -2
  27. package/lib/src/dom_events.ts +1 -1
  28. package/lib/src/drag_manager.ts +4 -4
  29. package/lib/src/drawtext.ts +1 -1
  30. package/lib/src/fileupload.ts +4 -4
  31. package/lib/src/form.ts +2 -2
  32. package/lib/src/formatters.ts +1 -1
  33. package/lib/src/gridview.ts +1 -1
  34. package/lib/src/i18n.ts +1 -1
  35. package/lib/src/icon.ts +1 -1
  36. package/lib/src/image.ts +1 -1
  37. package/lib/src/index.ts +1 -1
  38. package/lib/src/input.ts +1 -1
  39. package/lib/src/label.ts +1 -1
  40. package/lib/src/layout.ts +1 -1
  41. package/lib/src/link.ts +1 -1
  42. package/lib/src/listview.ts +1 -1
  43. package/lib/src/md5.ts +1 -1
  44. package/lib/src/menu.ts +1 -1
  45. package/lib/src/messagebox.ts +1 -1
  46. package/lib/src/panel.ts +1 -1
  47. package/lib/src/popup.ts +1 -1
  48. package/lib/src/property_editor.ts +1 -1
  49. package/lib/src/radiobtn.ts +1 -1
  50. package/lib/src/rating.ts +1 -1
  51. package/lib/src/request.ts +1 -1
  52. package/lib/src/router.ts +1 -1
  53. package/lib/src/settings.ts +1 -1
  54. package/lib/src/sidebarview.ts +1 -1
  55. package/lib/src/spreadsheet.ts +1 -1
  56. package/lib/src/styles.ts +1 -1
  57. package/lib/src/svgcomponent.ts +13 -8
  58. package/lib/src/tabbar.ts +1 -1
  59. package/lib/src/tabview.ts +1 -1
  60. package/lib/src/textarea.ts +1 -1
  61. package/lib/src/textedit.ts +1 -1
  62. package/lib/src/toaster.ts +1 -1
  63. package/lib/src/tools.ts +1 -1
  64. package/lib/src/tooltips.ts +1 -1
  65. package/lib/src/treeview.ts +1 -1
  66. package/lib/src/version.ts +2 -2
  67. package/lib/src/x4.less +1 -1
  68. package/lib/src/x4dom.ts +1 -1
  69. package/lib/src/x4events.ts +10 -10
  70. package/lib/src/x4js.ts +89 -0
  71. package/lib/src/x4react.ts +1 -1
  72. package/lib/styles/x4.css +1 -1
  73. package/lib/styles/x4.less +1 -1
  74. package/lib/types/x4js.d.ts +6762 -0
  75. package/package.json +10 -8
  76. package/lib/cjs/index.js.map +0 -7
  77. package/lib/esm/index.js.map +0 -7
  78. package/lib/esm/index.mjs.map +0 -7
  79. package/lib/types/action.d.ts +0 -57
  80. package/lib/types/app_sockets.d.ts +0 -29
  81. package/lib/types/application.d.ts +0 -108
  82. package/lib/types/autocomplete.d.ts +0 -63
  83. package/lib/types/base_component.d.ts +0 -88
  84. package/lib/types/button.d.ts +0 -151
  85. package/lib/types/calendar.d.ts +0 -82
  86. package/lib/types/canvas.d.ts +0 -92
  87. package/lib/types/cardview.d.ts +0 -87
  88. package/lib/types/checkbox.d.ts +0 -77
  89. package/lib/types/color.d.ts +0 -148
  90. package/lib/types/colorpicker.d.ts +0 -107
  91. package/lib/types/combobox.d.ts +0 -111
  92. package/lib/types/component.d.ts +0 -603
  93. package/lib/types/datastore.d.ts +0 -396
  94. package/lib/types/dialog.d.ts +0 -175
  95. package/lib/types/dom_events.d.ts +0 -302
  96. package/lib/types/drag_manager.d.ts +0 -58
  97. package/lib/types/drawtext.d.ts +0 -48
  98. package/lib/types/fileupload.d.ts +0 -64
  99. package/lib/types/form.d.ts +0 -142
  100. package/lib/types/formatters.d.ts +0 -35
  101. package/lib/types/gridview.d.ts +0 -175
  102. package/lib/types/i18n.d.ts +0 -73
  103. package/lib/types/icon.d.ts +0 -71
  104. package/lib/types/image.d.ts +0 -56
  105. package/lib/types/index.d.ts +0 -84
  106. package/lib/types/input.d.ts +0 -97
  107. package/lib/types/label.d.ts +0 -67
  108. package/lib/types/layout.d.ts +0 -89
  109. package/lib/types/link.d.ts +0 -50
  110. package/lib/types/listview.d.ts +0 -178
  111. package/lib/types/md5.d.ts +0 -61
  112. package/lib/types/menu.d.ts +0 -130
  113. package/lib/types/messagebox.d.ts +0 -69
  114. package/lib/types/panel.d.ts +0 -47
  115. package/lib/types/popup.d.ts +0 -75
  116. package/lib/types/property_editor.d.ts +0 -71
  117. package/lib/types/radiobtn.d.ts +0 -73
  118. package/lib/types/rating.d.ts +0 -53
  119. package/lib/types/request.d.ts +0 -52
  120. package/lib/types/router.d.ts +0 -67
  121. package/lib/types/settings.d.ts +0 -37
  122. package/lib/types/sidebarview.d.ts +0 -51
  123. package/lib/types/spreadsheet.d.ts +0 -222
  124. package/lib/types/styles.d.ts +0 -85
  125. package/lib/types/svgcomponent.d.ts +0 -216
  126. package/lib/types/tabbar.d.ts +0 -58
  127. package/lib/types/tabview.d.ts +0 -49
  128. package/lib/types/textarea.d.ts +0 -77
  129. package/lib/types/textedit.d.ts +0 -126
  130. package/lib/types/toaster.d.ts +0 -42
  131. package/lib/types/tools.d.ts +0 -394
  132. package/lib/types/tooltips.d.ts +0 -46
  133. package/lib/types/treeview.d.ts +0 -144
  134. package/lib/types/version.d.ts +0 -29
  135. package/lib/types/x4dom.d.ts +0 -49
  136. package/lib/types/x4events.d.ts +0 -269
  137. package/lib/types/x4react.d.ts +0 -41
@@ -1,87 +0,0 @@
1
- /**
2
- * ___ ___ __
3
- * \ \/ / / _
4
- * \ / /_| |_
5
- * / \____ _|
6
- * /__/\__\ |_|
7
- *
8
- * @file cardview.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, CProps, CEventMap } from './component';
30
- import { EvChange } from './x4events';
31
- import { IconID } from './icon';
32
- export type PageOrCallback = Component | (() => Component);
33
- export interface ICardViewItem {
34
- icon?: IconID;
35
- name: string;
36
- title: string;
37
- page: PageOrCallback;
38
- }
39
- interface CardViewEventMap extends CEventMap {
40
- change?: EvChange;
41
- }
42
- export interface CardViewProps extends CProps<CardViewEventMap> {
43
- pages: ICardViewItem[];
44
- active?: string;
45
- }
46
- interface ICardItemEx extends ICardViewItem {
47
- selector: Component;
48
- active: boolean;
49
- }
50
- /**
51
- * Standard CardView class
52
- * a card view is composed of multiples pages with only one visible at a time.
53
- * pages can be selected by a component (like tabs ou sidebar).
54
- * or by code.
55
- */
56
- export declare class CardView<P extends CardViewProps = CardViewProps, E extends CardViewEventMap = CardViewEventMap> extends Component<P, E> {
57
- protected m_cards: ICardItemEx[];
58
- protected m_ipage: string;
59
- protected m_cpage: ICardItemEx;
60
- constructor(props: P);
61
- /** @ignore */
62
- render(): void;
63
- /**
64
- * switch to a specific card
65
- * @param name - card name as define in constructor
66
- */
67
- switchTo(name?: string): void;
68
- /**
69
- *
70
- */
71
- setPages(pages: ICardViewItem[]): void;
72
- /**
73
- *
74
- */
75
- private _initTabs;
76
- protected _updateSelector(): void;
77
- /**
78
- * prepare the cardinfo
79
- * can be used by derivations to create & set selectors
80
- */
81
- protected _prepareSelector(card: ICardViewItem): Component;
82
- /**
83
- *
84
- */
85
- protected _preparePage(page: Component): void;
86
- }
87
- export {};
@@ -1,77 +0,0 @@
1
- /**
2
- * ___ ___ __
3
- * \ \/ / / _
4
- * \ / /_| |_
5
- * / \____ _|
6
- * /__/\__\ |_|
7
- *
8
- * @file checkbox.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 { CEventMap, Component, CProps } from './component';
30
- import { EvChange, EventCallback } from './x4events';
31
- import { HtmlString } from './tools';
32
- interface CheckBoxEventMap extends CEventMap {
33
- change?: EvChange;
34
- }
35
- interface CheckBoxProps extends CProps<CheckBoxEventMap> {
36
- name?: string;
37
- text?: string | HtmlString;
38
- checked?: boolean;
39
- value?: string;
40
- slider?: boolean;
41
- labelWidth?: number;
42
- labelAlign?: 'left' | 'right';
43
- align?: 'left' | 'right';
44
- change?: EventCallback<EvChange>;
45
- }
46
- /**
47
- * Standard CheckBox
48
- */
49
- export declare class CheckBox extends Component<CheckBoxProps, CheckBoxEventMap> {
50
- constructor(props: CheckBoxProps);
51
- /** @ignore */
52
- render(props: CheckBoxProps): void;
53
- /**
54
- * check state changed
55
- */
56
- private _change;
57
- /**
58
- * focus gained/loosed
59
- */
60
- private _setFocus;
61
- /**
62
- * @return the checked value
63
- */
64
- get check(): boolean;
65
- /**
66
- * change the checked value
67
- * @param {boolean} ck new checked value
68
- */
69
- set check(ck: boolean);
70
- get text(): string | HtmlString;
71
- set text(text: string | HtmlString);
72
- /**
73
- * toggle the checkbox
74
- */
75
- toggle(): void;
76
- }
77
- export {};
@@ -1,148 +0,0 @@
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
- }
@@ -1,107 +0,0 @@
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 {};
@@ -1,111 +0,0 @@
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
- import { Component, CProps, ContainerEventMap } from './component';
30
- import { EvChange, EvSelectionChange, EventCallback } from './x4events';
31
- import { Input } from './input';
32
- import { HLayout } from './layout';
33
- import { ListViewItem, EvCancel, PopulateItems } from './listview';
34
- import { DataStore, DataView, Record } from './datastore';
35
- import { HtmlString } from './tools';
36
- export interface ComboStoreProxyProps {
37
- store: DataView | DataStore;
38
- display: (rec: Record) => string | HtmlString;
39
- }
40
- export interface ComboItemRender {
41
- (itm: ListViewItem): Component;
42
- }
43
- interface ComboBoxEventMap extends ContainerEventMap {
44
- readonly change: EvChange;
45
- readonly selectionChange?: EvSelectionChange;
46
- readonly cancel?: EvCancel;
47
- }
48
- export interface ComboBoxProps extends CProps<ComboBoxEventMap> {
49
- tabIndex?: number | boolean;
50
- name?: string;
51
- readOnly?: boolean;
52
- required?: true;
53
- label?: string;
54
- labelWidth?: number;
55
- labelAlign?: 'left' | 'right';
56
- items?: ListViewItem[] | PopulateItems;
57
- value?: any;
58
- renderer?: ComboItemRender;
59
- selectionChange?: EventCallback<EvSelectionChange>;
60
- editable?: boolean;
61
- }
62
- /**
63
- * @review use textedit
64
- */
65
- export declare class ComboBox extends HLayout<ComboBoxProps, ComboBoxEventMap> {
66
- private m_ui_input;
67
- private m_ui_button;
68
- private m_popup;
69
- private m_lockpop;
70
- private m_lockchg;
71
- private m_popvis;
72
- private m_selection;
73
- constructor(props: ComboBoxProps);
74
- _onKey(e: any): void;
75
- set items(items: ListViewItem[]);
76
- /** @ignore */
77
- render(props: ComboBoxProps): void;
78
- componentDisposed(): void;
79
- /**
80
- * display the popup
81
- */
82
- showPopup(filter_items?: boolean): ListViewItem[];
83
- /**
84
- *
85
- */
86
- validate(): boolean;
87
- showError(text: string): void;
88
- clearError(): void;
89
- /** @ignore
90
- */
91
- private _selectItem;
92
- /**
93
- *
94
- */
95
- private _setInput;
96
- /**
97
- *
98
- */
99
- get value(): any;
100
- get valueText(): string | HtmlString;
101
- /**
102
- *
103
- */
104
- set value(id: any);
105
- get input(): Input;
106
- _checkFocus(): void;
107
- _hidePopup(): void;
108
- static storeProxy(props: ComboStoreProxyProps): PopulateItems;
109
- focus(): void;
110
- }
111
- export {};