x4js 1.5.21 → 1.5.23
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/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.mjs +1 -1
- package/lib/esm/index.mjs.map +1 -1
- package/lib/src/version.ts +1 -1
- package/lib/types/action.d.ts +57 -0
- package/lib/types/app_sockets.d.ts +29 -0
- package/lib/types/application.d.ts +104 -0
- package/lib/types/autocomplete.d.ts +58 -0
- package/lib/types/base_component.d.ts +88 -0
- package/lib/types/button.d.ts +151 -0
- package/lib/types/calendar.d.ts +82 -0
- package/lib/types/canvas.d.ts +92 -0
- package/lib/types/cardview.d.ts +87 -0
- package/lib/types/checkbox.d.ts +77 -0
- package/lib/types/color.d.ts +148 -0
- package/lib/types/colorpicker.d.ts +107 -0
- package/lib/types/combobox.d.ts +107 -0
- package/lib/types/component.d.ts +601 -0
- package/lib/types/datastore.d.ts +396 -0
- package/lib/types/dialog.d.ts +175 -0
- package/lib/types/dom_events.d.ts +302 -0
- package/lib/types/drag_manager.d.ts +54 -0
- package/lib/types/drawtext.d.ts +48 -0
- package/lib/types/fileupload.d.ts +64 -0
- package/lib/types/form.d.ts +133 -0
- package/lib/types/formatters.d.ts +35 -0
- package/lib/types/gridview.d.ts +175 -0
- package/lib/types/i18n.d.ts +73 -0
- package/lib/types/icon.d.ts +64 -0
- package/lib/types/image.d.ts +55 -0
- package/lib/types/index.d.ts +84 -0
- package/lib/types/input.d.ts +91 -0
- package/lib/types/label.d.ts +58 -0
- package/lib/types/layout.d.ts +87 -0
- package/lib/types/link.d.ts +50 -0
- package/lib/types/listview.d.ts +178 -0
- package/lib/types/md5.d.ts +61 -0
- package/lib/types/menu.d.ts +130 -0
- package/lib/types/messagebox.d.ts +69 -0
- package/lib/types/panel.d.ts +47 -0
- package/lib/types/popup.d.ts +75 -0
- package/lib/types/property_editor.d.ts +71 -0
- package/lib/types/radiobtn.d.ts +73 -0
- package/lib/types/rating.d.ts +53 -0
- package/lib/types/request.d.ts +52 -0
- package/lib/types/router.d.ts +42 -0
- package/lib/types/settings.d.ts +37 -0
- package/lib/types/sidebarview.d.ts +49 -0
- package/lib/types/spreadsheet.d.ts +222 -0
- package/lib/types/styles.d.ts +85 -0
- package/lib/types/svgcomponent.d.ts +215 -0
- package/lib/types/tabbar.d.ts +58 -0
- package/lib/types/tabview.d.ts +49 -0
- package/lib/types/textarea.d.ts +77 -0
- package/lib/types/textedit.d.ts +123 -0
- package/lib/types/toaster.d.ts +42 -0
- package/lib/types/tools.d.ts +394 -0
- package/lib/types/tooltips.d.ts +46 -0
- package/lib/types/treeview.d.ts +144 -0
- package/lib/types/version.d.ts +29 -0
- package/lib/types/x4dom.d.ts +49 -0
- package/lib/types/x4events.d.ts +269 -0
- package/lib/types/x4react.d.ts +41 -0
- package/package.json +3 -2
|
@@ -0,0 +1,87 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,77 @@
|
|
|
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 {};
|
|
@@ -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 {};
|