x4js 2.0.13 → 2.0.14
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/.vscode/launch.json +14 -0
- package/README.md +5 -0
- package/{lib/src/demo → demo}/main.scss +3 -1
- package/{lib/src/demo/main.tsx → demo/main.ts} +37 -36
- package/demo/package.json +26 -0
- package/demo/scss.d.ts +4 -0
- package/demo/svg.d.ts +1 -0
- package/demo/tsconfig.json +14 -0
- package/lib/README.txt +5 -0
- package/lib/cjs/x4.css +1 -1
- package/lib/cjs/x4.js +2 -1
- package/lib/esm/x4.css +1 -1
- package/lib/esm/x4.mjs +2 -1
- package/lib/src/components/boxes/boxes.module.scss +17 -0
- package/lib/src/components/boxes/boxes.ts +162 -13
- package/lib/src/components/breadcrumb/breadcrumb.scss +56 -28
- package/lib/src/components/breadcrumb/breadcrumb.ts +93 -84
- package/lib/src/components/btngroup/btngroup.module.scss +12 -0
- package/lib/src/components/btngroup/btngroup.ts +41 -8
- package/lib/src/components/button/button.module.scss +23 -5
- package/lib/src/components/button/button.ts +72 -4
- package/lib/src/components/canvas/canvas.module.scss +25 -0
- package/lib/src/components/canvas/canvas.ts +189 -0
- package/lib/src/components/canvas/canvas_ex.ts +269 -0
- package/lib/src/components/checkbox/checkbox.ts +18 -4
- package/lib/src/components/combobox/combobox.module.scss +24 -15
- package/lib/src/components/combobox/combobox.ts +107 -24
- package/lib/src/components/components.ts +7 -0
- package/lib/src/components/dialog/dialog.module.scss +37 -3
- package/lib/src/components/dialog/dialog.ts +149 -31
- package/lib/src/components/filedrop/cloud-arrow-up.svg +1 -0
- package/lib/src/components/filedrop/filedrop.module.scss +70 -0
- package/lib/src/components/filedrop/filedrop.ts +131 -0
- package/lib/src/components/form/form.module.scss +4 -0
- package/lib/src/components/form/form.ts +137 -6
- package/lib/src/components/gridview/arrow-down-light.svg +1 -0
- package/lib/src/components/gridview/arrow-up-light.svg +1 -0
- package/lib/src/components/gridview/gridview.module.scss +324 -0
- package/lib/src/components/gridview/gridview.ts +1175 -0
- package/lib/src/components/icon/icon.module.scss +1 -1
- package/lib/src/components/icon/icon.ts +4 -1
- package/lib/src/components/image/image.module.scss +8 -1
- package/lib/src/components/image/image.ts +105 -6
- package/lib/src/components/input/input.module.scss +8 -3
- package/lib/src/components/input/input.ts +137 -14
- package/lib/src/components/keyboard/arrow-up.svg +1 -0
- package/lib/src/components/keyboard/delete-left.svg +1 -0
- package/lib/src/components/keyboard/eye-slash.svg +1 -0
- package/lib/src/components/keyboard/keyboard.module.scss +134 -0
- package/lib/src/components/keyboard/keyboard.ts +525 -0
- package/lib/src/components/label/label.module.scss +22 -4
- package/lib/src/components/label/label.ts +33 -0
- package/lib/src/components/link/link.ts +81 -78
- package/lib/src/components/listbox/listbox.module.scss +61 -3
- package/lib/src/components/listbox/listbox.ts +164 -56
- package/lib/src/components/menu/menu.module.scss +10 -1
- package/lib/src/components/menu/menu.ts +4 -1
- package/lib/src/components/messages/messages.module.scss +44 -0
- package/lib/src/components/messages/messages.ts +164 -18
- package/lib/src/components/messages/pen-field.svg +1 -0
- package/lib/src/components/normalize.scss +5 -0
- package/lib/src/components/notification/notification.module.scss +4 -2
- package/lib/src/components/notification/notification.ts +2 -4
- package/lib/src/components/panel/panel.module.scss +12 -0
- package/lib/src/components/popup/popup.module.scss +4 -2
- package/lib/src/components/popup/popup.ts +136 -92
- package/lib/src/components/propgrid/folder-closed.svg +1 -0
- package/lib/src/components/propgrid/folder-open.svg +1 -0
- package/lib/src/components/propgrid/progrid.module.scss +108 -0
- package/lib/src/components/propgrid/propgrid.ts +271 -0
- package/lib/src/components/propgrid/updown.svg +4 -0
- package/lib/src/components/radio/radio.module.scss +147 -0
- package/lib/src/components/radio/radio.svg +4 -0
- package/lib/src/components/radio/radio.ts +142 -0
- package/lib/src/components/select/select.module.scss +9 -0
- package/lib/src/components/select/select.ts +134 -0
- package/lib/src/components/shared.scss +47 -0
- package/lib/src/components/sizers/sizer.ts +9 -2
- package/lib/src/components/slider/slider.module.scss +77 -30
- package/lib/src/components/slider/slider.ts +72 -22
- package/lib/src/components/tabs/tabs.module.scss +1 -2
- package/lib/src/components/tabs/tabs.ts +43 -12
- package/lib/src/components/textarea/textarea.module.scss +6 -2
- package/lib/src/components/textarea/textarea.ts +73 -8
- package/lib/src/components/textedit/textedit.module.scss +3 -1
- package/lib/src/components/textedit/textedit.ts +31 -4
- package/lib/src/components/themes.scss +7 -0
- package/lib/src/components/tickline/tickline.module.scss +26 -0
- package/lib/src/components/tickline/tickline.ts +82 -0
- package/lib/src/components/tooltips/comments-question.svg +1 -0
- package/lib/src/components/tooltips/tooltips.scss +30 -9
- package/lib/src/components/tooltips/tooltips.ts +10 -5
- package/lib/src/components/treeview/treeview.module.scss +129 -60
- package/lib/src/components/treeview/treeview.ts +47 -12
- package/lib/src/components/viewport/viewport.module.scss +7 -0
- package/lib/src/core/component.ts +102 -32
- package/lib/src/core/core_application.ts +222 -2
- package/lib/src/core/core_colors.ts +2 -2
- package/lib/src/{components/grid/datastore.ts → core/core_data.ts} +261 -250
- package/lib/src/core/core_dragdrop.ts +3 -3
- package/lib/src/core/core_element.ts +13 -1
- package/lib/src/core/core_events.ts +28 -0
- package/lib/src/core/core_i18n.ts +18 -2
- package/lib/src/core/core_react.ts +79 -0
- package/lib/src/core/core_router.ts +23 -7
- package/lib/src/core/core_styles.ts +5 -5
- package/lib/src/core/core_svg.ts +173 -12
- package/lib/src/core/core_tools.ts +305 -87
- package/lib/src/x4tsx.d.ts +25 -0
- package/lib/styles/x4.css +1 -1
- package/lib/types/x4js.d.ts +767 -92
- package/package.json +4 -4
- package/scripts/build.mjs +378 -0
- package/scripts/prepack.mjs +346 -0
- package/src/components/base.scss +25 -0
- package/src/components/boxes/boxes.module.scss +54 -0
- package/src/components/boxes/boxes.ts +278 -0
- package/src/components/breadcrumb/breadcrumb.scss +56 -0
- package/src/components/breadcrumb/breadcrumb.ts +93 -0
- package/src/components/breadcrumb/chevron-right.svg +1 -0
- package/src/components/btngroup/btngroup.module.scss +41 -0
- package/src/components/btngroup/btngroup.ts +153 -0
- package/src/components/button/button.module.scss +173 -0
- package/src/components/button/button.ts +185 -0
- package/src/components/calendar/calendar-check-sharp-light.svg +1 -0
- package/src/components/calendar/calendar.module.scss +163 -0
- package/src/components/calendar/calendar.ts +327 -0
- package/src/components/calendar/chevron-left-sharp-light.svg +1 -0
- package/src/components/calendar/chevron-right-sharp-light.svg +1 -0
- package/src/components/canvas/canvas.module.scss +25 -0
- package/src/components/canvas/canvas.ts +189 -0
- package/src/components/canvas/canvas_ex.ts +269 -0
- package/src/components/checkbox/check.svg +4 -0
- package/src/components/checkbox/checkbox.module.scss +142 -0
- package/src/components/checkbox/checkbox.ts +140 -0
- package/src/components/colorinput/colorinput.module.scss +65 -0
- package/src/components/colorinput/colorinput.ts +91 -0
- package/src/components/colorinput/crosshairs-simple-sharp-light.svg +1 -0
- package/src/components/colorpicker/colorpicker.module.scss +133 -0
- package/src/components/colorpicker/colorpicker.ts +482 -0
- package/src/components/combobox/combobox.module.scss +133 -0
- package/src/components/combobox/combobox.ts +275 -0
- package/src/components/combobox/updown.svg +4 -0
- package/src/components/components.ts +41 -0
- package/src/components/dialog/dialog.module.scss +105 -0
- package/src/components/dialog/dialog.ts +212 -0
- package/src/components/dialog/xmark-sharp-light.svg +1 -0
- package/src/components/filedrop/cloud-arrow-up.svg +1 -0
- package/src/components/filedrop/filedrop.module.scss +70 -0
- package/src/components/filedrop/filedrop.ts +131 -0
- package/src/components/form/form.module.scss +38 -0
- package/src/components/form/form.ts +172 -0
- package/src/components/gridview/arrow-down-light.svg +1 -0
- package/src/components/gridview/arrow-up-light.svg +1 -0
- package/src/components/gridview/gridview.module.scss +324 -0
- package/src/components/gridview/gridview.ts +1175 -0
- package/src/components/header/header.module.scss +40 -0
- package/src/components/header/header.ts +130 -0
- package/src/components/icon/icon.module.scss +30 -0
- package/src/components/icon/icon.ts +139 -0
- package/src/components/image/image.module.scss +28 -0
- package/src/components/image/image.ts +168 -0
- package/src/components/input/input.module.scss +74 -0
- package/src/components/input/input.ts +398 -0
- package/src/components/keyboard/arrow-up.svg +1 -0
- package/src/components/keyboard/delete-left.svg +1 -0
- package/src/components/keyboard/eye-slash.svg +1 -0
- package/src/components/keyboard/keyboard.module.scss +134 -0
- package/src/components/keyboard/keyboard.ts +525 -0
- package/src/components/label/label.module.scss +76 -0
- package/src/components/label/label.ts +97 -0
- package/src/components/link/link.ts +81 -0
- package/src/components/listbox/listbox.module.scss +161 -0
- package/src/components/listbox/listbox.ts +539 -0
- package/src/components/menu/caret-right-solid.svg +1 -0
- package/src/components/menu/menu.module.scss +117 -0
- package/src/components/menu/menu.ts +174 -0
- package/src/components/messages/circle-exclamation.svg +1 -0
- package/src/components/messages/messages.module.scss +92 -0
- package/src/components/messages/messages.ts +215 -0
- package/src/components/messages/pen-field.svg +1 -0
- package/src/components/normalize.scss +391 -0
- package/src/components/notification/circle-check-solid.svg +1 -0
- package/src/components/notification/circle-exclamation-solid.svg +1 -0
- package/src/components/notification/circle-notch-light.svg +1 -0
- package/src/components/notification/notification.module.scss +84 -0
- package/src/components/notification/notification.ts +107 -0
- package/src/components/notification/xmark-sharp-light.svg +1 -0
- package/src/components/panel/panel.module.scss +60 -0
- package/src/components/panel/panel.ts +58 -0
- package/src/components/popup/popup.module.scss +45 -0
- package/src/components/popup/popup.ts +440 -0
- package/src/components/progress/progress.module.scss +57 -0
- package/src/components/progress/progress.ts +44 -0
- package/src/components/propgrid/folder-closed.svg +1 -0
- package/src/components/propgrid/folder-open.svg +1 -0
- package/src/components/propgrid/progrid.module.scss +108 -0
- package/src/components/propgrid/propgrid.ts +271 -0
- package/src/components/propgrid/updown.svg +4 -0
- package/src/components/radio/radio.module.scss +147 -0
- package/src/components/radio/radio.svg +4 -0
- package/src/components/radio/radio.ts +142 -0
- package/src/components/rating/rating.module.scss +23 -0
- package/src/components/rating/rating.ts +131 -0
- package/src/components/rating/star-sharp-light.svg +1 -0
- package/src/components/rating/star-sharp-solid.svg +1 -0
- package/src/components/select/select.module.scss +9 -0
- package/src/components/select/select.ts +134 -0
- package/src/components/shared.scss +137 -0
- package/src/components/sizers/sizer.module.scss +90 -0
- package/src/components/sizers/sizer.ts +131 -0
- package/src/components/slider/slider.module.scss +118 -0
- package/src/components/slider/slider.ts +198 -0
- package/src/components/switch/switch.module.scss +127 -0
- package/src/components/switch/switch.ts +62 -0
- package/src/components/tabs/tabs.module.scss +45 -0
- package/src/components/tabs/tabs.ts +199 -0
- package/src/components/textarea/textarea.module.scss +63 -0
- package/src/components/textarea/textarea.ts +125 -0
- package/src/components/textedit/textedit.module.scss +116 -0
- package/src/components/textedit/textedit.ts +110 -0
- package/src/components/themes.scss +88 -0
- package/src/components/tickline/tickline.module.scss +26 -0
- package/src/components/tickline/tickline.ts +82 -0
- package/src/components/tooltips/circle-info-sharp-light.svg +1 -0
- package/src/components/tooltips/comments-question.svg +1 -0
- package/src/components/tooltips/tooltips.scss +72 -0
- package/src/components/tooltips/tooltips.ts +109 -0
- package/src/components/treeview/chevron-down-light.svg +1 -0
- package/src/components/treeview/treeview.module.scss +185 -0
- package/src/components/treeview/treeview.ts +445 -0
- package/src/components/viewport/viewport.module.scss +32 -0
- package/src/components/viewport/viewport.ts +41 -0
- package/src/core/component.ts +1072 -0
- package/src/core/core_application.ts +264 -0
- package/src/core/core_colors.ts +250 -0
- package/src/core/core_data.ts +1309 -0
- package/src/core/core_dom.ts +471 -0
- package/src/core/core_dragdrop.ts +201 -0
- package/src/core/core_element.ts +110 -0
- package/src/core/core_events.ts +177 -0
- package/src/core/core_i18n.ts +393 -0
- package/src/core/core_react.ts +79 -0
- package/src/core/core_router.ts +237 -0
- package/src/core/core_styles.ts +214 -0
- package/src/core/core_svg.ts +711 -0
- package/src/core/core_tools.ts +906 -0
- package/src/types/scss.d.ts +4 -0
- package/src/types/svg.d.ts +1 -0
- package/src/types/x4react.d.ts +9 -0
- package/src/x4.scss +19 -0
- package/src/x4tsx.d.ts +25 -0
- package/tsconfig.json +14 -0
- package/lib/src/components/grid/gridview.ts +0 -1108
- package/lib/src/components/grid/memdb.ts +0 -325
- /package/{lib/src/demo → demo}/assets/house-light.svg +0 -0
- /package/{lib/src/demo → demo}/assets/radio.svg +0 -0
- /package/{lib/src/demo → demo}/index.html +0 -0
package/lib/types/x4js.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
13
13
|
*
|
|
14
14
|
* AUTOGENERATED CODE, DO NOT MODIFY
|
|
15
|
-
* generated on
|
|
15
|
+
* generated on Tue Apr 22 2025
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
|
|
@@ -55,6 +55,16 @@ declare module 'x4js' {
|
|
|
55
55
|
constructor( l: number, t: number, w: number, h: number );
|
|
56
56
|
constructor( l: Rect );
|
|
57
57
|
constructor( l: number | IRect, t: number, w: number, h: number );
|
|
58
|
+
contains( pt: Point ): boolean;
|
|
59
|
+
contains( rc: Rect ): boolean;
|
|
60
|
+
contains( arg: any ): boolean;
|
|
61
|
+
touches( rc: Rect ): boolean;
|
|
62
|
+
normalize( ): this;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface Size {
|
|
66
|
+
w: number;
|
|
67
|
+
h: number;
|
|
58
68
|
}
|
|
59
69
|
|
|
60
70
|
export interface Point {
|
|
@@ -62,12 +72,26 @@ declare module 'x4js' {
|
|
|
62
72
|
y: number;
|
|
63
73
|
}
|
|
64
74
|
|
|
75
|
+
export interface Size {
|
|
76
|
+
w: number;
|
|
77
|
+
h: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
65
80
|
export interface IComponentInterface {
|
|
66
81
|
}
|
|
67
82
|
|
|
68
83
|
export interface IFormElement extends IComponentInterface {
|
|
69
84
|
getRawValue( ): any;
|
|
70
85
|
setRawValue( v: any ): void;
|
|
86
|
+
isValid( ): boolean;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface ITabHandler extends IComponentInterface {
|
|
90
|
+
focusNext( next: boolean ): boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface ITipHandler extends IComponentInterface {
|
|
94
|
+
getTip( ): string;
|
|
71
95
|
}
|
|
72
96
|
|
|
73
97
|
interface Features {
|
|
@@ -75,7 +99,7 @@ declare module 'x4js' {
|
|
|
75
99
|
}
|
|
76
100
|
|
|
77
101
|
export class Timer {
|
|
78
|
-
_timers: Map<string,any>;
|
|
102
|
+
_timers: Map<string, any>;
|
|
79
103
|
setTimeout( name: string, time: number, callback: Function ): void;
|
|
80
104
|
clearTimeout( name: string ): void;
|
|
81
105
|
setInterval( name: string, time: number, callback: Function ): void;
|
|
@@ -83,6 +107,15 @@ declare module 'x4js' {
|
|
|
83
107
|
clearAllTimeouts( ): void;
|
|
84
108
|
}
|
|
85
109
|
|
|
110
|
+
enum kbNav {
|
|
111
|
+
first,
|
|
112
|
+
prev,
|
|
113
|
+
pgdn,
|
|
114
|
+
pgup,
|
|
115
|
+
next,
|
|
116
|
+
last,
|
|
117
|
+
}
|
|
118
|
+
|
|
86
119
|
// ---------------------------------------
|
|
87
120
|
// from /src/core/core_events.ts
|
|
88
121
|
|
|
@@ -106,6 +139,7 @@ declare module 'x4js' {
|
|
|
106
139
|
_registry: Map<string,EventCallback[]>;
|
|
107
140
|
constructor( source: unknown );
|
|
108
141
|
addListener<K extends keyof E>( name: K, callback: ( ev: E[K] ) => void, capturing: any ): void;
|
|
142
|
+
removeListener<K extends keyof E>( name: K, callback: (ev: E[K]) => any ): void;
|
|
109
143
|
fire<K extends keyof E>( name: K, evx: E[K] ): void;
|
|
110
144
|
}
|
|
111
145
|
|
|
@@ -123,6 +157,7 @@ declare module 'x4js' {
|
|
|
123
157
|
clearInterval( name: string ): void;
|
|
124
158
|
clearTimeouts( ): void;
|
|
125
159
|
on<K extends keyof E>( name: K, listener: ( ev: E[K] ) => void ): void;
|
|
160
|
+
off<K extends keyof E>( name: K, listener: ( ev: E[K] ) => void ): void;
|
|
126
161
|
fire<K extends keyof E>( name: K, ev: E[K] ): void;
|
|
127
162
|
}
|
|
128
163
|
|
|
@@ -259,7 +294,7 @@ declare module 'x4js' {
|
|
|
259
294
|
|
|
260
295
|
type ComponentAttributes = Record<string,string|number|boolean>;
|
|
261
296
|
|
|
262
|
-
type ComponentContent = Component | string | UnsafeHtml |
|
|
297
|
+
type ComponentContent = Component | Component[] | string | string[] | UnsafeHtml | UnsafeHtml[] | number | boolean;
|
|
263
298
|
|
|
264
299
|
export interface ComponentProps {
|
|
265
300
|
tag?: string;
|
|
@@ -275,6 +310,7 @@ declare module 'x4js' {
|
|
|
275
310
|
height?: string | number;
|
|
276
311
|
disabled?: true;
|
|
277
312
|
hidden?: true;
|
|
313
|
+
flex?: boolean | number;
|
|
278
314
|
tooltip?: string;
|
|
279
315
|
existingDOM?: HTMLElement;
|
|
280
316
|
}
|
|
@@ -289,7 +325,7 @@ declare module 'x4js' {
|
|
|
289
325
|
dom: Element;
|
|
290
326
|
props: P;
|
|
291
327
|
clsprefix: string;
|
|
292
|
-
store: Map<string|Symbol,any>;
|
|
328
|
+
#store: Map<string|Symbol,any>;
|
|
293
329
|
constructor( props: P );
|
|
294
330
|
hasClass( cls: string ): void;
|
|
295
331
|
addClass( cls: string ): void;
|
|
@@ -301,6 +337,7 @@ declare module 'x4js' {
|
|
|
301
337
|
setAttribute( name: string, value: string | number | boolean ): void;
|
|
302
338
|
getAttribute( name: string ): string;
|
|
303
339
|
getData( name: string ): string;
|
|
340
|
+
getIntData( name: string ): number;
|
|
304
341
|
setData( name: string, value: string ): void;
|
|
305
342
|
setInternalData( name: string|Symbol, value: any ): this;
|
|
306
343
|
getInternalData( name: string|Symbol ): any;
|
|
@@ -325,18 +362,20 @@ declare module 'x4js' {
|
|
|
325
362
|
getComputedStyle( ): void;
|
|
326
363
|
setCapture( pointerId: number ): void;
|
|
327
364
|
releaseCapture( pointerId: number ): void;
|
|
328
|
-
getBoundingRect( ):
|
|
329
|
-
focus( ):
|
|
365
|
+
getBoundingRect( ): IRect;
|
|
366
|
+
focus( ): this;
|
|
367
|
+
hasFocus( ): void;
|
|
330
368
|
scrollIntoView( arg: boolean | ScrollIntoViewOptions ): void;
|
|
331
369
|
isVisible( ): void;
|
|
332
|
-
show( vis: any ):
|
|
333
|
-
hide( ):
|
|
334
|
-
enable( ena: any ):
|
|
335
|
-
disable( ):
|
|
370
|
+
show( vis: any ): this;
|
|
371
|
+
hide( ): this;
|
|
372
|
+
enable( ena: any ): this;
|
|
373
|
+
disable( ): this;
|
|
336
374
|
isDisabled( ): void;
|
|
337
375
|
nextElement<T extends Component = Component>( ): T;
|
|
338
376
|
prevElement<T extends Component = Component>( ): T;
|
|
339
377
|
parentElement<T extends Component>( cls: Constructor<T> ): T;
|
|
378
|
+
parentElement<T extends Component>( dom: Node, cls: Constructor<T> ): T;
|
|
340
379
|
firstChild<T extends Component = Component>( ): T;
|
|
341
380
|
lastChild<T extends Component = Component>( ): T;
|
|
342
381
|
enumChildComponents( recursive: boolean ): void;
|
|
@@ -355,6 +394,10 @@ declare module 'x4js' {
|
|
|
355
394
|
constructor( );
|
|
356
395
|
}
|
|
357
396
|
|
|
397
|
+
export class Space extends Component {
|
|
398
|
+
constructor( width: number|string, cls: string );
|
|
399
|
+
}
|
|
400
|
+
|
|
358
401
|
export interface EvClick extends ComponentEvent {
|
|
359
402
|
}
|
|
360
403
|
|
|
@@ -362,11 +405,16 @@ declare module 'x4js' {
|
|
|
362
405
|
value: any;
|
|
363
406
|
}
|
|
364
407
|
|
|
408
|
+
export interface EvFocus extends ComponentEvent {
|
|
409
|
+
focus_out: boolean;
|
|
410
|
+
}
|
|
411
|
+
|
|
365
412
|
interface ISelection {
|
|
366
413
|
}
|
|
367
414
|
|
|
368
415
|
export interface EvSelectionChange extends ComponentEvent {
|
|
369
416
|
selection: ISelection;
|
|
417
|
+
empty: boolean;
|
|
370
418
|
}
|
|
371
419
|
|
|
372
420
|
export interface EvContextMenu extends ComponentEvent {
|
|
@@ -436,7 +484,7 @@ declare module 'x4js' {
|
|
|
436
484
|
|
|
437
485
|
type DropCallback = ( command: 'enter' | 'leave' | 'drag' | 'drop', el: Component, infos: DropInfo ) => void;
|
|
438
486
|
|
|
439
|
-
type FilterCallback = ( el: Component ) => boolean;
|
|
487
|
+
type FilterCallback = ( el: Component, data: DataTransfer ) => boolean;
|
|
440
488
|
|
|
441
489
|
class DragManager {
|
|
442
490
|
dragSource: Component;
|
|
@@ -467,6 +515,7 @@ declare module 'x4js' {
|
|
|
467
515
|
}
|
|
468
516
|
|
|
469
517
|
interface RouterEvents extends EventMap {
|
|
518
|
+
change: EvChange;
|
|
470
519
|
error: EvError;
|
|
471
520
|
}
|
|
472
521
|
|
|
@@ -488,6 +537,7 @@ declare module 'x4js' {
|
|
|
488
537
|
_dom: SVGElement;
|
|
489
538
|
constructor( tag: string );
|
|
490
539
|
getDom( ): void;
|
|
540
|
+
reset( ): void;
|
|
491
541
|
stroke( color: string, width: number ): this;
|
|
492
542
|
strokeWidth( width: number ): this;
|
|
493
543
|
strokeCap( cap: "butt" | "round" | "sqaure" ): void;
|
|
@@ -495,11 +545,15 @@ declare module 'x4js' {
|
|
|
495
545
|
antiAlias( set: boolean ): void;
|
|
496
546
|
fill( color: string ): this;
|
|
497
547
|
no_fill( ): this;
|
|
548
|
+
getAttr( name: string ): string;
|
|
549
|
+
getNumAttr( name: string ): void;
|
|
498
550
|
setAttr( name: string, value: string ): this;
|
|
499
551
|
setStyle<K extends keyof CSSStyleDeclaration>( name: K, value: string | number ): this;
|
|
500
|
-
addClass( cls: string ):
|
|
552
|
+
addClass( cls: string ): this;
|
|
553
|
+
removeClass( cls: string ): this;
|
|
501
554
|
clip( id: string ): this;
|
|
502
555
|
transform( tr: string ): this;
|
|
556
|
+
clear_transform( ): void;
|
|
503
557
|
rotate( deg: number, cx: number, cy: number ): this;
|
|
504
558
|
translate( dx: number, dy: number ): this;
|
|
505
559
|
scale( x: number ): this;
|
|
@@ -510,10 +564,12 @@ declare module 'x4js' {
|
|
|
510
564
|
_path: string;
|
|
511
565
|
constructor( );
|
|
512
566
|
_update( ): this;
|
|
567
|
+
reset( ): void;
|
|
513
568
|
moveTo( x: number, y: number ): this;
|
|
514
569
|
lineTo( x: number, y: number ): this;
|
|
570
|
+
curveTo( x1: number, y1: number, x2: number, y2: number, x3: number, y3: number ): void;
|
|
515
571
|
closePath( ): this;
|
|
516
|
-
arc( x: number, y: number, r: number, start: number, end: number ): this;
|
|
572
|
+
arc( x: number, y: number, r: number, start: number, end: number, clockwise: any ): this;
|
|
517
573
|
}
|
|
518
574
|
|
|
519
575
|
export class SvgText extends SvgItem {
|
|
@@ -525,6 +581,10 @@ declare module 'x4js' {
|
|
|
525
581
|
verticalAlign( align: 'top' | 'center' | 'bottom' | 'baseline' ): this;
|
|
526
582
|
}
|
|
527
583
|
|
|
584
|
+
export class SvgIcon extends SvgItem {
|
|
585
|
+
constructor( svg: string );
|
|
586
|
+
}
|
|
587
|
+
|
|
528
588
|
export class SvgShape extends SvgItem {
|
|
529
589
|
constructor( tag: string );
|
|
530
590
|
}
|
|
@@ -542,34 +602,42 @@ declare module 'x4js' {
|
|
|
542
602
|
export class SvgGroup extends SvgItem {
|
|
543
603
|
constructor( tag: any );
|
|
544
604
|
append<K extends SvgItem>( item: K ): K;
|
|
605
|
+
appendItems<K extends SvgItem>( items: K[] ): void;
|
|
545
606
|
path( ): SvgPath;
|
|
546
607
|
text( x: number, y: number, txt: string ): void;
|
|
547
|
-
ellipse( x: number, y: number, r1: number, r2:
|
|
608
|
+
ellipse( x: number, y: number, r1: number, r2: number ): SvgShape;
|
|
609
|
+
circle( x: number, y: number, r1: number ): SvgShape;
|
|
610
|
+
icon( svg: string, x: number, y: number, w: number, h: number ): SvgIcon;
|
|
548
611
|
rect( x: number, y: number, w: number, h: number ): SvgShape;
|
|
549
|
-
group(
|
|
612
|
+
group( id: string ): void;
|
|
550
613
|
linear_gradient( x1: number_or_perc, y1: number_or_perc, x2: number_or_perc, y2: number_or_perc ): void;
|
|
551
614
|
clear( ): void;
|
|
552
615
|
}
|
|
553
616
|
|
|
554
617
|
export class SvgBuilder extends SvgGroup {
|
|
555
618
|
g_clip_id: any;
|
|
619
|
+
g_pat_id: any;
|
|
556
620
|
constructor( );
|
|
557
621
|
addClip( x: number, y: number, w: number, h: number ): void;
|
|
622
|
+
addPattern( x: number, y: number, w: number, h: number ): void;
|
|
558
623
|
}
|
|
559
624
|
|
|
560
625
|
interface SvgProps extends ComponentProps {
|
|
561
626
|
viewbox?: string;
|
|
562
|
-
svg
|
|
627
|
+
svg: SvgBuilder;
|
|
563
628
|
}
|
|
564
629
|
|
|
565
630
|
export class SvgComponent<P extends SvgProps = SvgProps> extends Component<P> {
|
|
566
631
|
constructor( props: P );
|
|
632
|
+
setSvg( bld: SvgBuilder ): void;
|
|
633
|
+
addItems( items: SvgItem[] ): void;
|
|
567
634
|
}
|
|
568
635
|
|
|
569
636
|
// ---------------------------------------
|
|
570
637
|
// from /src/components/boxes/boxes.ts
|
|
571
638
|
|
|
572
639
|
export interface BoxProps extends ComponentProps {
|
|
640
|
+
tag?: string;
|
|
573
641
|
}
|
|
574
642
|
|
|
575
643
|
@class_ns( "x4" ) export class Box<P extends BoxProps=BoxProps, E extends ComponentEvents=ComponentEvents> extends Component<P,E> {
|
|
@@ -582,9 +650,11 @@ declare module 'x4js' {
|
|
|
582
650
|
constructor( p: P );
|
|
583
651
|
}
|
|
584
652
|
|
|
653
|
+
type ContentBuilder = ( ) => Component;
|
|
654
|
+
|
|
585
655
|
interface StackItem {
|
|
586
656
|
name: string;
|
|
587
|
-
content: Component;
|
|
657
|
+
content: Component | ContentBuilder;
|
|
588
658
|
}
|
|
589
659
|
|
|
590
660
|
interface StackedLayoutProps extends Omit<ComponentProps,"content"> {
|
|
@@ -592,15 +662,42 @@ declare module 'x4js' {
|
|
|
592
662
|
items: StackItem[];
|
|
593
663
|
}
|
|
594
664
|
|
|
595
|
-
interface
|
|
665
|
+
interface StackItemEx extends StackItem {
|
|
596
666
|
page: Component;
|
|
597
667
|
}
|
|
598
668
|
|
|
599
669
|
@class_ns( "x4" ) export class StackBox extends Box<StackedLayoutProps> {
|
|
600
|
-
_items:
|
|
670
|
+
_items: StackItemEx[];
|
|
601
671
|
constructor( props: StackedLayoutProps );
|
|
672
|
+
addItem( item: StackItem ): void;
|
|
602
673
|
select( name: string ): void;
|
|
603
|
-
_createPage( page:
|
|
674
|
+
_createPage( page: StackItemEx ): void;
|
|
675
|
+
getPage( name: string ): void;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export interface GridboxProps extends BoxProps {
|
|
679
|
+
rows?: number | string | string[];
|
|
680
|
+
columns?: number | string | string[];
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
@class_ns("x4") export class GridBox<P extends GridboxProps=GridboxProps, E extends ComponentEvents=ComponentEvents> extends Box<P,E> {
|
|
684
|
+
constructor( props: P );
|
|
685
|
+
setRows( r: number | string | string[] ): void;
|
|
686
|
+
setCols( r: number | string | string[] ): void;
|
|
687
|
+
setRowCount( n: number ): void;
|
|
688
|
+
setColCount( n: number ): void;
|
|
689
|
+
setTemplate( t: string[] ): void;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
interface MasonryProps extends Omit<BoxProps,"content"> {
|
|
693
|
+
items: Component[];
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
@class_ns("x4") export class MasonryBox extends Box<MasonryProps> {
|
|
697
|
+
constructor( props: MasonryProps );
|
|
698
|
+
resizeItem( item: Component ): void;
|
|
699
|
+
resizeAllItems( ): void;
|
|
700
|
+
setItems( items: Component[] ): void;
|
|
604
701
|
}
|
|
605
702
|
|
|
606
703
|
// ---------------------------------------
|
|
@@ -611,9 +708,10 @@ declare module 'x4js' {
|
|
|
611
708
|
}
|
|
612
709
|
|
|
613
710
|
interface BreadcrumbElement {
|
|
711
|
+
name?: string;
|
|
614
712
|
icon?: string;
|
|
615
|
-
name: string;
|
|
616
713
|
label: string;
|
|
714
|
+
click?: ( name: string ) => void;
|
|
617
715
|
}
|
|
618
716
|
|
|
619
717
|
interface BreadcrumbsProps extends BoxProps {
|
|
@@ -623,6 +721,7 @@ declare module 'x4js' {
|
|
|
623
721
|
|
|
624
722
|
@class_ns( "x4" ) export class Breadcrumbs extends HBox<BreadcrumbsProps,BreadcrumbEvents> {
|
|
625
723
|
constructor( props: BreadcrumbsProps );
|
|
724
|
+
setItems( elements: BreadcrumbElement[ ] ): void;
|
|
626
725
|
}
|
|
627
726
|
|
|
628
727
|
// ---------------------------------------
|
|
@@ -657,12 +756,18 @@ declare module 'x4js' {
|
|
|
657
756
|
export interface ButtonProps extends ComponentProps {
|
|
658
757
|
label?: string;
|
|
659
758
|
icon?: string;
|
|
759
|
+
tabindex?: boolean | number;
|
|
760
|
+
autorepeat?: number | boolean;
|
|
660
761
|
click?: EventCallback<EvClick>;
|
|
661
762
|
}
|
|
662
763
|
|
|
663
764
|
@class_ns( "x4" ) export class Button extends Component<ButtonProps,ButtonEvents> {
|
|
765
|
+
#text: Component;
|
|
664
766
|
constructor( props: ButtonProps );
|
|
665
767
|
_on_click( ev: MouseEvent ): void;
|
|
768
|
+
_on_mouse( e: PointerEvent ): void;
|
|
769
|
+
click( ): void;
|
|
770
|
+
_on_keydown( e: KeyboardEvent ): void;
|
|
666
771
|
setText( text: string | UnsafeHtml ): void;
|
|
667
772
|
setIcon( icon: string ): void;
|
|
668
773
|
}
|
|
@@ -683,19 +788,36 @@ declare module 'x4js' {
|
|
|
683
788
|
setIcon( icon: string ): void;
|
|
684
789
|
}
|
|
685
790
|
|
|
791
|
+
export interface SimpleTextProps extends ComponentProps {
|
|
792
|
+
text: string | UnsafeHtml;
|
|
793
|
+
align?: "left" | "center" | "right";
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
@class_ns( "x4" ) export class SimpleText extends Component<SimpleTextProps> {
|
|
797
|
+
constructor( p: SimpleTextProps );
|
|
798
|
+
setText( text: string | UnsafeHtml ): void;
|
|
799
|
+
}
|
|
800
|
+
|
|
686
801
|
// ---------------------------------------
|
|
687
802
|
// from /src/components/form/form.ts
|
|
688
803
|
|
|
689
|
-
type
|
|
690
|
-
|
|
691
|
-
type FormValues = Record<string,FormValue>;
|
|
804
|
+
type FormValues = Record<string,string>;
|
|
692
805
|
|
|
693
806
|
export interface FormProps extends BoxProps {
|
|
807
|
+
autoComplete?: boolean;
|
|
694
808
|
}
|
|
695
809
|
|
|
810
|
+
type ValidationFn = ( values: FormValues, is_valid: boolean ) => boolean;
|
|
811
|
+
|
|
696
812
|
@class_ns( "x4" ) export class Form<P extends FormProps = FormProps> extends Box<P> {
|
|
813
|
+
validator: ValidationFn;
|
|
814
|
+
constructor( props: P );
|
|
815
|
+
_get_inputs( ): void;
|
|
697
816
|
setValues( values: FormValues ): void;
|
|
698
817
|
getValues( ): FormValues;
|
|
818
|
+
setAutoComplete( on: any ): void;
|
|
819
|
+
setValidator( validator: ValidationFn ): void;
|
|
820
|
+
validate( ): FormValues;
|
|
699
821
|
}
|
|
700
822
|
|
|
701
823
|
// ---------------------------------------
|
|
@@ -707,13 +829,17 @@ declare module 'x4js' {
|
|
|
707
829
|
|
|
708
830
|
interface CSizerEvent extends ComponentEvents {
|
|
709
831
|
resize: EvSizeChange;
|
|
832
|
+
start: ComponentEvent;
|
|
833
|
+
stop: ComponentEvent;
|
|
710
834
|
}
|
|
711
835
|
|
|
836
|
+
type SizerType = "left" | "top" | "right" | "bottom";
|
|
837
|
+
|
|
712
838
|
@class_ns( "x4" ) export class CSizer extends Component<ComponentProps,CSizerEvent> {
|
|
713
|
-
_type:
|
|
839
|
+
_type: SizerType;
|
|
714
840
|
_ref: Component;
|
|
715
841
|
_delta: Point;
|
|
716
|
-
constructor( type:
|
|
842
|
+
constructor( type: SizerType, target: Component );
|
|
717
843
|
_onMouseMove( e: PointerEvent ): void;
|
|
718
844
|
}
|
|
719
845
|
|
|
@@ -726,31 +852,35 @@ declare module 'x4js' {
|
|
|
726
852
|
}
|
|
727
853
|
|
|
728
854
|
export interface PopupProps extends ComponentProps {
|
|
729
|
-
modal?: boolean;
|
|
730
855
|
autoClose?: boolean | string;
|
|
731
856
|
sizable?: boolean;
|
|
732
857
|
movable?: boolean;
|
|
733
858
|
}
|
|
734
859
|
|
|
735
|
-
@class_ns( "x4" ) export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = PopupEvents> extends
|
|
736
|
-
_isopen: any;
|
|
860
|
+
@class_ns( "x4" ) export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = PopupEvents> extends Box<P,E> {
|
|
737
861
|
_isshown: any;
|
|
862
|
+
_ismodal: any;
|
|
738
863
|
constructor( props: P );
|
|
739
864
|
displayNear( rc: Rect, dst: any, src: any, offset: any ): void;
|
|
740
865
|
displayCenter( ): void;
|
|
741
866
|
displayAt( x: number, y: number ): void;
|
|
742
|
-
_show( ): void;
|
|
743
|
-
show( show: any ): void;
|
|
744
867
|
isOpen( ): void;
|
|
868
|
+
_do_hide( ): void;
|
|
869
|
+
_do_show( ): void;
|
|
870
|
+
__show( ): void;
|
|
871
|
+
__hide( ): void;
|
|
872
|
+
__append( ): void;
|
|
873
|
+
__remove( ): void;
|
|
874
|
+
show( show: any ): this;
|
|
745
875
|
close( ): void;
|
|
746
876
|
_dismiss: any;
|
|
747
877
|
dismiss( after: any ): void;
|
|
748
|
-
_showModalMask( ): void;
|
|
749
|
-
_updateModalMask( ): void;
|
|
750
878
|
_createSizers( ): void;
|
|
879
|
+
_showModalMask( ): void;
|
|
880
|
+
_hideModalMask( ): void;
|
|
751
881
|
}
|
|
752
882
|
|
|
753
|
-
|
|
883
|
+
export class CMover {
|
|
754
884
|
ref: Component;
|
|
755
885
|
delta: Point;
|
|
756
886
|
self: boolean;
|
|
@@ -764,9 +894,11 @@ declare module 'x4js' {
|
|
|
764
894
|
export interface DialogProps extends PopupProps {
|
|
765
895
|
icon?: string;
|
|
766
896
|
title: string;
|
|
767
|
-
form
|
|
897
|
+
form?: Form;
|
|
768
898
|
buttons: BtnGroupItem[];
|
|
769
|
-
closable?: boolean;
|
|
899
|
+
closable?: boolean | string;
|
|
900
|
+
modal?: boolean;
|
|
901
|
+
btnclick?: EventCallback<EvBtnClick>;
|
|
770
902
|
}
|
|
771
903
|
|
|
772
904
|
export interface EvBtnClick extends CoreEvent {
|
|
@@ -778,18 +910,23 @@ declare module 'x4js' {
|
|
|
778
910
|
close: ComponentEvent;
|
|
779
911
|
}
|
|
780
912
|
|
|
781
|
-
@class_ns(
|
|
913
|
+
@class_ns("x4") export class Dialog<P extends DialogProps = DialogProps, E extends DialogEvents = DialogEvents> extends Popup<P, E> {
|
|
914
|
+
form: Form;
|
|
782
915
|
constructor( props: P );
|
|
783
|
-
|
|
784
|
-
|
|
916
|
+
focusNext( next: boolean ): boolean;
|
|
917
|
+
setContent( form: Form ): void;
|
|
918
|
+
getForm( ): void;
|
|
919
|
+
getValues( ): void;
|
|
920
|
+
getButton( name: string ): void;
|
|
921
|
+
queryInterface<T extends IComponentInterface>( name: string ): T;
|
|
785
922
|
}
|
|
786
923
|
|
|
787
924
|
// ---------------------------------------
|
|
788
925
|
// from /src/components/btngroup/btngroup.ts
|
|
789
926
|
|
|
790
|
-
type predefined = `ok${ "" | `.${string}`}` | `cancel${ "" | `.${string}`}` | `yes${ "" | `.${string}`}` | `no${ "" | `.${string}`}` | `retry${ "" | `.${string}`}` | `abort${ "" | `.${string}`}` | "-";
|
|
927
|
+
type predefined = `ok${ "" | `.${string}`}` | `cancel${ "" | `.${string}`}` | `yes${ "" | `.${string}`}` | `no${ "" | `.${string}`}` | `retry${ "" | `.${string}`}` | `abort${ "" | `.${string}`}` | "-" | ">>" | "~";
|
|
791
928
|
|
|
792
|
-
type BtnGroupItem = predefined | Button | Label;
|
|
929
|
+
type BtnGroupItem = predefined | Button | Label | Input;
|
|
793
930
|
|
|
794
931
|
interface BtnGroupEvents extends ComponentEvents {
|
|
795
932
|
btnclick: EvBtnClick;
|
|
@@ -806,6 +943,7 @@ declare module 'x4js' {
|
|
|
806
943
|
@class_ns( "x4" ) export class BtnGroup extends Box<BtnGroupProps,BtnGroupEvents> {
|
|
807
944
|
constructor( props: BtnGroupProps );
|
|
808
945
|
setButtons( btns: BtnGroupItem[] ): void;
|
|
946
|
+
getButton( id: string ): void;
|
|
809
947
|
}
|
|
810
948
|
|
|
811
949
|
// ---------------------------------------
|
|
@@ -872,6 +1010,9 @@ declare module 'x4js' {
|
|
|
872
1010
|
|
|
873
1011
|
export interface BaseProps extends ComponentProps {
|
|
874
1012
|
name?: string;
|
|
1013
|
+
autofocus?: boolean;
|
|
1014
|
+
focus?: EventCallback<EvFocus>;
|
|
1015
|
+
change?: EventCallback<EvChange>;
|
|
875
1016
|
}
|
|
876
1017
|
|
|
877
1018
|
interface CheckboxProps extends BaseProps {
|
|
@@ -917,27 +1058,39 @@ declare module 'x4js' {
|
|
|
917
1058
|
}
|
|
918
1059
|
|
|
919
1060
|
export interface TextInputProps extends BaseProps {
|
|
920
|
-
type: "text" | "email" | "password";
|
|
1061
|
+
type: "text" | "email" | "password" | "date" | "number";
|
|
921
1062
|
readonly?: boolean;
|
|
922
1063
|
required?: boolean;
|
|
923
1064
|
pattern?: string;
|
|
924
|
-
value
|
|
1065
|
+
value?: string | number;
|
|
925
1066
|
placeholder?: string;
|
|
926
1067
|
spellcheck?: boolean;
|
|
1068
|
+
minlength?: number;
|
|
1069
|
+
maxlength?: number;
|
|
927
1070
|
}
|
|
928
1071
|
|
|
929
1072
|
type InputProps = CheckboxProps | RadioProps | TextInputProps | RangeProps | DateProps | NumberProps | FileProps;
|
|
930
1073
|
|
|
931
|
-
|
|
1074
|
+
interface InputEvents extends ComponentEvent {
|
|
1075
|
+
focus: EvFocus;
|
|
1076
|
+
change: EvChange;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
@class_ns( "x4" ) export class Input extends Component<InputProps,InputEvents> {
|
|
932
1080
|
constructor( props: InputProps );
|
|
1081
|
+
on_focus( ev: FocusEvent, focus_out: boolean ): void;
|
|
1082
|
+
on_change( ev: InputEvent ): void;
|
|
933
1083
|
getValue( ): void;
|
|
934
1084
|
setValue( value: string ): void;
|
|
935
1085
|
getNumValue( ): void;
|
|
936
|
-
setNumValue( value: number ): void;
|
|
1086
|
+
setNumValue( value: number, ndec: any ): void;
|
|
1087
|
+
getCheck( ): void;
|
|
1088
|
+
setCheck( ck: boolean ): void;
|
|
937
1089
|
setReadOnly( ro: boolean ): void;
|
|
938
1090
|
selectAll( ): void;
|
|
939
1091
|
select( start: number, length: number ): void;
|
|
940
1092
|
getSelection( ): void;
|
|
1093
|
+
isValid( ): void;
|
|
941
1094
|
queryInterface<T extends IComponentInterface>( name: string ): T;
|
|
942
1095
|
}
|
|
943
1096
|
|
|
@@ -952,12 +1105,14 @@ declare module 'x4js' {
|
|
|
952
1105
|
label: string;
|
|
953
1106
|
checked?: boolean;
|
|
954
1107
|
value?: boolean | number | string;
|
|
1108
|
+
name?: string;
|
|
955
1109
|
change?: EventCallback<EvChange>;
|
|
956
1110
|
}
|
|
957
1111
|
|
|
958
1112
|
@class_ns( "x4" ) export class Checkbox extends Component<CheckboxProps,CheckBoxEvents> {
|
|
959
1113
|
_input: Input;
|
|
960
1114
|
constructor( props: CheckboxProps );
|
|
1115
|
+
_on_click( ev: MouseEvent ): void;
|
|
961
1116
|
_on_change( ): void;
|
|
962
1117
|
getCheck( ): void;
|
|
963
1118
|
setCheck( ck: boolean ): void;
|
|
@@ -1080,18 +1235,11 @@ declare module 'x4js' {
|
|
|
1080
1235
|
// ---------------------------------------
|
|
1081
1236
|
// from /src/components/listbox/listbox.ts
|
|
1082
1237
|
|
|
1083
|
-
enum kbNav {
|
|
1084
|
-
first,
|
|
1085
|
-
prev,
|
|
1086
|
-
next,
|
|
1087
|
-
last,
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
1238
|
type ListboxID = number | string;
|
|
1091
1239
|
|
|
1092
1240
|
export interface ListItem {
|
|
1093
1241
|
id: ListboxID;
|
|
1094
|
-
text: string;
|
|
1242
|
+
text: string | UnsafeHtml;
|
|
1095
1243
|
iconId?: string;
|
|
1096
1244
|
data?: any;
|
|
1097
1245
|
cls?: string;
|
|
@@ -1108,30 +1256,39 @@ declare module 'x4js' {
|
|
|
1108
1256
|
interface ListboxProps extends Omit<ComponentProps,'content'> {
|
|
1109
1257
|
items?: ListItem[];
|
|
1110
1258
|
renderer?: ( item: ListItem ) => Component;
|
|
1259
|
+
footer?: Component;
|
|
1111
1260
|
checkable?: true;
|
|
1261
|
+
multisel?: true;
|
|
1262
|
+
dblClick?: EventCallback<EvDblClick>;
|
|
1263
|
+
selectionChange?: EventCallback<EvSelectionChange>;
|
|
1264
|
+
contextMenu?: EventCallback<EvContextMenu>;
|
|
1112
1265
|
}
|
|
1113
1266
|
|
|
1114
1267
|
@class_ns( "x4" ) export class Listbox extends Component<ListboxProps,ListboxEvents> {
|
|
1115
1268
|
_view: Viewport;
|
|
1116
|
-
|
|
1117
|
-
|
|
1269
|
+
_lastsel: ListboxID;
|
|
1270
|
+
_multisel: Set<ListboxID>;
|
|
1118
1271
|
_items: ListItem[];
|
|
1119
1272
|
preventFocus: any;
|
|
1120
1273
|
constructor( props: ListboxProps );
|
|
1121
1274
|
_on_key( ev: KeyboardEvent ): void;
|
|
1122
1275
|
navigate( sens: kbNav ): void;
|
|
1123
|
-
|
|
1276
|
+
_itemWithID( id: ListboxID ): void;
|
|
1277
|
+
_on_click( ev: MouseEvent ): void;
|
|
1124
1278
|
_on_ctx_menu( ev: MouseEvent ): void;
|
|
1125
|
-
_selectItem( id: ListboxID, item: Component ): void;
|
|
1126
|
-
|
|
1279
|
+
_selectItem( id: ListboxID, item: Component, mode: "single" | "toggle" ): void;
|
|
1280
|
+
getItem( id: ListboxID ): ListItem;
|
|
1281
|
+
select( ids: ListboxID | ListboxID[], notify: any ): void;
|
|
1127
1282
|
_findItemIndex( id: ListboxID ): void;
|
|
1283
|
+
_clearSelection( ): void;
|
|
1128
1284
|
clearSelection( ): void;
|
|
1129
|
-
setItems( items: ListItem[] ): void;
|
|
1285
|
+
setItems( items: ListItem[], keepSel: any ): void;
|
|
1130
1286
|
renderItem( item: ListItem ): void;
|
|
1131
1287
|
defaultRenderer( item: ListItem ): Component;
|
|
1132
1288
|
filter( filter: string ): void;
|
|
1133
1289
|
appendItem( item: ListItem, prepend: any, select: any ): void;
|
|
1134
1290
|
updateItem( id: any, item: ListItem ): void;
|
|
1291
|
+
getSelection( ): void;
|
|
1135
1292
|
}
|
|
1136
1293
|
|
|
1137
1294
|
// ---------------------------------------
|
|
@@ -1145,22 +1302,29 @@ declare module 'x4js' {
|
|
|
1145
1302
|
items: ListItem[];
|
|
1146
1303
|
}
|
|
1147
1304
|
|
|
1148
|
-
@class_ns( "x4" ) class
|
|
1305
|
+
@class_ns( "x4" ) export class DropdownList extends Popup<DropdownProps,DropdownEvents> {
|
|
1149
1306
|
_list: Listbox;
|
|
1150
1307
|
constructor( props: DropdownProps, content: ListItem[] );
|
|
1151
1308
|
getList( ): void;
|
|
1152
1309
|
}
|
|
1153
1310
|
|
|
1311
|
+
interface ComboboxEvents extends ComponentEvents {
|
|
1312
|
+
selectionChange: EvSelectionChange;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1154
1315
|
interface ComboboxProps extends Omit<ComponentProps,"content"> {
|
|
1155
1316
|
label?: string;
|
|
1317
|
+
name?: string;
|
|
1318
|
+
value?: string;
|
|
1156
1319
|
labelWidth?: number | string;
|
|
1157
1320
|
readonly?: boolean;
|
|
1321
|
+
required?: boolean;
|
|
1158
1322
|
items: ListItem[];
|
|
1323
|
+
selectionChange?: EventCallback<EvSelectionChange>;
|
|
1159
1324
|
}
|
|
1160
1325
|
|
|
1161
|
-
@class_ns( "x4" ) export class Combobox extends Component<ComboboxProps> {
|
|
1162
|
-
|
|
1163
|
-
_label: Label;
|
|
1326
|
+
@class_ns( "x4" ) export class Combobox extends Component<ComboboxProps,ComboboxEvents> {
|
|
1327
|
+
_popup: DropdownList;
|
|
1164
1328
|
_input: Input;
|
|
1165
1329
|
_button: Button;
|
|
1166
1330
|
_prevent_close: any;
|
|
@@ -1171,33 +1335,230 @@ declare module 'x4js' {
|
|
|
1171
1335
|
_on_focusout( ): void;
|
|
1172
1336
|
_on_click( ): void;
|
|
1173
1337
|
showDropDown( ): void;
|
|
1338
|
+
setItems( items: ListItem[] ): void;
|
|
1339
|
+
getValue( ): void;
|
|
1340
|
+
setValue( value: string ): void;
|
|
1341
|
+
selectItem( index: ListboxID ): void;
|
|
1342
|
+
getSelection( ): void;
|
|
1343
|
+
_getList( ): void;
|
|
1344
|
+
queryInterface<T extends IComponentInterface>( name: string ): T;
|
|
1174
1345
|
}
|
|
1175
1346
|
|
|
1176
1347
|
// ---------------------------------------
|
|
1177
|
-
// from /src/components/
|
|
1348
|
+
// from /src/components/filedrop/filedrop.ts
|
|
1178
1349
|
|
|
1179
|
-
|
|
1350
|
+
type LoadCallback = ( files: FileList ) => void;
|
|
1351
|
+
|
|
1352
|
+
interface FileDialogProps extends ComponentProps {
|
|
1353
|
+
accept: string;
|
|
1354
|
+
multiple?: boolean;
|
|
1355
|
+
callback: LoadCallback;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
export class FileDialog extends Component {
|
|
1359
|
+
constructor( props: FileDialogProps );
|
|
1360
|
+
showDialog( ): void;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
export interface EvDropChange extends CoreEvent {
|
|
1364
|
+
files: FileList;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
interface FileDropEvents extends ComponentEvents {
|
|
1368
|
+
change: EvDropChange;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
interface FileDropProps extends ComponentProps {
|
|
1372
|
+
label?: string | UnsafeHtml;
|
|
1373
|
+
icon?: string;
|
|
1374
|
+
multiple?: boolean;
|
|
1375
|
+
accept: string;
|
|
1376
|
+
change: EventCallback<EvDropChange>;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
@class_ns( "x4" ) export class FileDrop extends VBox<FileDropProps,FileDropEvents> {
|
|
1380
|
+
constructor( props: FileDropProps );
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
// ---------------------------------------
|
|
1384
|
+
// from /src/core/core_data.ts
|
|
1385
|
+
|
|
1386
|
+
type DataRecordID = any;
|
|
1387
|
+
|
|
1388
|
+
type DataFieldValue = string | Date | number | boolean;
|
|
1389
|
+
|
|
1390
|
+
type ChangeCallback = (type: string, id?: DataRecordID) => void;
|
|
1391
|
+
|
|
1392
|
+
type CalcCallback = () => string;
|
|
1393
|
+
|
|
1394
|
+
type FieldType = 'string' | 'int' | 'float' | 'date' | 'bool' | 'array' | 'object' | 'any' | 'calc';
|
|
1395
|
+
|
|
1396
|
+
type DataIndex = Uint32Array;
|
|
1397
|
+
|
|
1398
|
+
export interface EvDataChange extends CoreEvent {
|
|
1399
|
+
change_type: 'create' | 'update' | 'delete' | 'data' | 'change';
|
|
1400
|
+
id?: DataRecordID;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
export interface MetaData {
|
|
1404
|
+
type?: FieldType;
|
|
1405
|
+
prec?: number;
|
|
1406
|
+
required?: boolean;
|
|
1407
|
+
calc?: (rec: DataRecord) => any;
|
|
1408
|
+
model?: DataModel;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
export interface FieldInfo extends MetaData {
|
|
1180
1412
|
name: string;
|
|
1181
|
-
title: string;
|
|
1182
|
-
iconId?: string;
|
|
1183
|
-
width?: number;
|
|
1184
1413
|
}
|
|
1185
1414
|
|
|
1186
|
-
|
|
1187
|
-
|
|
1415
|
+
class MetaInfos {
|
|
1416
|
+
name: string;
|
|
1417
|
+
id: string;
|
|
1418
|
+
fields: FieldInfo[];
|
|
1419
|
+
constructor( name: string );
|
|
1188
1420
|
}
|
|
1189
1421
|
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1422
|
+
interface ModelConstructor {
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
export class DataModel {
|
|
1426
|
+
getFields( ): FieldInfo[];
|
|
1427
|
+
validate( record: DataRecord ): Error[];
|
|
1428
|
+
getFieldIndex( name: string ): number;
|
|
1429
|
+
serialize( input: DataRecord ): any;
|
|
1430
|
+
unSerialize( data: any, id: DataRecordID ): DataRecord;
|
|
1431
|
+
_convertField( field: FieldInfo, input: any ): any;
|
|
1432
|
+
getID( rec: DataRecord ): any;
|
|
1433
|
+
getRaw( name: string | number, rec: DataRecord ): any;
|
|
1434
|
+
getField( name: string, rec: DataRecord ): string;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
export class DataRecord {
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
interface DataEventMap extends EventMap {
|
|
1441
|
+
change?: EvChange;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
type DataSolver = ( data: any ) => DataRecord[];
|
|
1445
|
+
|
|
1446
|
+
export interface DataProxyProps {
|
|
1447
|
+
url: string;
|
|
1448
|
+
params?: string[];
|
|
1449
|
+
solver?: DataSolver;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
export class DataProxy extends CoreElement<DataEventMap> {
|
|
1453
|
+
m_props: DataProxyProps;
|
|
1454
|
+
constructor( props: DataProxyProps );
|
|
1455
|
+
load( url: string ): void;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
interface DataStoreProps {
|
|
1459
|
+
model: DataModel;
|
|
1460
|
+
data?: any[];
|
|
1461
|
+
url?: string;
|
|
1462
|
+
autoload?: false;
|
|
1463
|
+
solver?: DataSolver;
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
interface DataStoreEventMap extends EventMap {
|
|
1467
|
+
data_change: EvDataChange;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
export class DataStore extends EventSource<DataStoreEventMap> {
|
|
1471
|
+
m_model: DataModel;
|
|
1472
|
+
m_fields: FieldInfo[];
|
|
1473
|
+
m_records: DataRecord[];
|
|
1474
|
+
m_proxy: DataProxy;
|
|
1475
|
+
m_rec_index: DataIndex;
|
|
1476
|
+
constructor( props: DataStoreProps );
|
|
1477
|
+
load( url: string ): void;
|
|
1478
|
+
reload( ): void;
|
|
1479
|
+
setData( records: any[] ): void;
|
|
1480
|
+
setRawData( records: DataRecord[] ): void;
|
|
1481
|
+
_rebuildIndex( ): void;
|
|
1482
|
+
update( rec: DataRecord ): void;
|
|
1483
|
+
append( rec: DataRecord | any ): void;
|
|
1484
|
+
getMaxId( ): void;
|
|
1485
|
+
delete( id: DataRecordID ): boolean;
|
|
1486
|
+
indexOfId( id: DataRecordID ): number;
|
|
1487
|
+
getById( id: DataRecordID ): DataRecord;
|
|
1488
|
+
getByIndex( index: number ): DataRecord;
|
|
1489
|
+
_getRecord( index: number ): DataRecord;
|
|
1490
|
+
moveTo( other: DataStore ): void;
|
|
1491
|
+
createView( opts: DataViewProps ): DataView;
|
|
1492
|
+
createIndex( filter: FilterInfo ): DataIndex;
|
|
1493
|
+
sortIndex( index: DataIndex, sort: SortProp[] ): void;
|
|
1494
|
+
forEach( cb: ( rec: DataRecord, index: number ) => any ): void;
|
|
1495
|
+
export( ): void;
|
|
1496
|
+
changed( ): void;
|
|
1497
|
+
getModel( ): void;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
export interface EvViewChange extends CoreEvent {
|
|
1501
|
+
change_type: "change" | "filter" | "sort";
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
interface DataViewEventMap extends EventMap {
|
|
1505
|
+
view_change: EvViewChange;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
interface DataViewProps {
|
|
1509
|
+
store?: DataStore;
|
|
1510
|
+
filter?: FilterInfo;
|
|
1511
|
+
order?: string | SortProp[] | SortProp;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
type FilterFunc = ( rec: DataRecord ) => boolean;
|
|
1515
|
+
|
|
1516
|
+
export interface FilterInfo {
|
|
1517
|
+
op: '<' | '<=' | '=' | '>=' | '>' | '<>' | 'empty-result' | FilterFunc;
|
|
1518
|
+
field?: string;
|
|
1519
|
+
value?: string | RegExp;
|
|
1520
|
+
caseSensitive?: boolean;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
export interface SortProp {
|
|
1524
|
+
field: string;
|
|
1525
|
+
ascending: boolean;
|
|
1526
|
+
numeric?: boolean;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
export class DataView extends CoreElement<DataViewEventMap> {
|
|
1530
|
+
m_index: DataIndex;
|
|
1531
|
+
m_store: DataStore;
|
|
1532
|
+
m_model: DataModel;
|
|
1533
|
+
m_sort: SortProp[];
|
|
1534
|
+
m_filter: FilterInfo;
|
|
1535
|
+
m_props: DataViewProps;
|
|
1536
|
+
constructor( props: DataViewProps );
|
|
1537
|
+
_storeChange( ev: EvDataChange ): void;
|
|
1538
|
+
filter( filter: FilterInfo ): number;
|
|
1539
|
+
_filter( filter: FilterInfo, notify: boolean ): number;
|
|
1540
|
+
sort( props: SortProp[] ): void;
|
|
1541
|
+
_sort( props: SortProp[], notify: boolean ): void;
|
|
1542
|
+
getStore( ): void;
|
|
1543
|
+
getCount( ): void;
|
|
1544
|
+
indexOfId( id: DataRecordID ): number;
|
|
1545
|
+
getByIndex( index: number ): DataRecord;
|
|
1546
|
+
getIdByIndex( index: number ): DataRecordID;
|
|
1547
|
+
getRecId( rec: DataRecord ): DataRecordID;
|
|
1548
|
+
getById( id: DataRecordID ): DataRecord;
|
|
1549
|
+
getModel( ): void;
|
|
1550
|
+
changed( ): void;
|
|
1551
|
+
forEach( cb: ( rec: DataRecord, index: number ) => any ): void;
|
|
1196
1552
|
}
|
|
1197
1553
|
|
|
1198
1554
|
// ---------------------------------------
|
|
1199
1555
|
// from /src/components/image/image.ts
|
|
1200
1556
|
|
|
1557
|
+
interface ImageEvents extends ComponentEvents {
|
|
1558
|
+
change: EvDropChange;
|
|
1559
|
+
clear: CoreEvent;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1201
1562
|
export interface ImageProps extends ComponentProps {
|
|
1202
1563
|
src: string;
|
|
1203
1564
|
fit?: "contain" | "cover" | "fill" | "scale-down";
|
|
@@ -1205,12 +1566,169 @@ declare module 'x4js' {
|
|
|
1205
1566
|
lazy?: boolean;
|
|
1206
1567
|
alt?: string;
|
|
1207
1568
|
draggable?: boolean;
|
|
1569
|
+
candrop?: boolean;
|
|
1570
|
+
accept?: string;
|
|
1571
|
+
change?: EventCallback<EvDropChange>;
|
|
1572
|
+
clear?: EventCallback<CoreEvent>;
|
|
1208
1573
|
}
|
|
1209
1574
|
|
|
1210
|
-
@class_ns( "x4" ) export class Image extends Component<
|
|
1575
|
+
@class_ns( "x4" ) export class Image<P extends ImageProps = ImageProps, E extends ImageEvents = ImageEvents> extends Component<P,E> {
|
|
1211
1576
|
_img: Component;
|
|
1212
|
-
constructor( props:
|
|
1577
|
+
constructor( props: P );
|
|
1213
1578
|
setImage( src: string ): void;
|
|
1579
|
+
setBase64( mime: string, base64: string ): void;
|
|
1580
|
+
clear( ): void;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
// ---------------------------------------
|
|
1584
|
+
// from /src/components/gridview/gridview.ts
|
|
1585
|
+
|
|
1586
|
+
type CellRenderer = (rec: DataRecord) => Component;
|
|
1587
|
+
|
|
1588
|
+
type CellClassifier = (data: any, rec: DataRecord, col: string ) => string;
|
|
1589
|
+
|
|
1590
|
+
type ColType = "number" | "money" | "checkbox" | "date" | "string" | "image" | "percent" | "icon";
|
|
1591
|
+
|
|
1592
|
+
interface GridColumn {
|
|
1593
|
+
id: any;
|
|
1594
|
+
title: string;
|
|
1595
|
+
width: number;
|
|
1596
|
+
fixed?: boolean;
|
|
1597
|
+
flex?: number;
|
|
1598
|
+
align?: 'left' | 'center' | 'right';
|
|
1599
|
+
header_align?: 'left' | 'center' | 'right';
|
|
1600
|
+
renderer?: CellRenderer;
|
|
1601
|
+
formatter?: (input: any) => string;
|
|
1602
|
+
type?: ColType;
|
|
1603
|
+
cls?: string;
|
|
1604
|
+
sortable?: boolean;
|
|
1605
|
+
footer_val?: string;
|
|
1606
|
+
classifier?: CellClassifier;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
interface GridColumnEx extends GridColumn {
|
|
1610
|
+
sens?: "up" | "dn";
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
export interface GridviewEvents extends ComponentEvents {
|
|
1614
|
+
click?: EvClick;
|
|
1615
|
+
dblClick?: EvDblClick;
|
|
1616
|
+
contextMenu?: EvContextMenu;
|
|
1617
|
+
selectionChange?: EvSelectionChange;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
export interface GridviewProps extends ComponentProps {
|
|
1621
|
+
footer?: boolean;
|
|
1622
|
+
store: DataStore;
|
|
1623
|
+
columns: GridColumn[];
|
|
1624
|
+
click?: EventCallback<EvClick>;
|
|
1625
|
+
dblClick?: EventCallback<EvDblClick>;
|
|
1626
|
+
contextMenu?: EventCallback<EvContextMenu>;
|
|
1627
|
+
selectionChange?: EventCallback<EvSelectionChange>;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
@class_ns("x4") export class Gridview<P extends GridviewProps = GridviewProps, E extends GridviewEvents = GridviewEvents> extends Component<P,E> {
|
|
1631
|
+
_dataview: DataView;
|
|
1632
|
+
_datamodel: DataModel;
|
|
1633
|
+
_columns: GridColumnEx[];
|
|
1634
|
+
_lock: number;
|
|
1635
|
+
_dirty: number;
|
|
1636
|
+
_row_height: number;
|
|
1637
|
+
_left: number;
|
|
1638
|
+
_top: number;
|
|
1639
|
+
_body: Component;
|
|
1640
|
+
_viewport: Component;
|
|
1641
|
+
_fheader: Box;
|
|
1642
|
+
_hheader: Box;
|
|
1643
|
+
_vheader: Box;
|
|
1644
|
+
_ffooter: Box;
|
|
1645
|
+
_footer: Box;
|
|
1646
|
+
_vis_rows: Map<number, { h: Component, r: Component }>;
|
|
1647
|
+
_start: number;
|
|
1648
|
+
_end: number;
|
|
1649
|
+
_selection: Set<number>;
|
|
1650
|
+
_num_fmt: any;
|
|
1651
|
+
_mny_fmt: any;
|
|
1652
|
+
_dte_fmt: any;
|
|
1653
|
+
_has_fixed: boolean;
|
|
1654
|
+
_has_footer: boolean;
|
|
1655
|
+
constructor( props: P );
|
|
1656
|
+
_on_key( ev: KeyboardEvent ): void;
|
|
1657
|
+
navigate( sens: kbNav ): void;
|
|
1658
|
+
_scrollToIndex( index: number, block: any ): void;
|
|
1659
|
+
setStore( store: DataStore ): void;
|
|
1660
|
+
getView( ): DataView;
|
|
1661
|
+
lock( lock: boolean ): void;
|
|
1662
|
+
_getColCount( ): void;
|
|
1663
|
+
_getCol( index: number ): void;
|
|
1664
|
+
_buildColHeader( fixed: boolean ): void;
|
|
1665
|
+
_buildColFooter( fixed: boolean ): void;
|
|
1666
|
+
_sortCol( col: number, ascending: boolean ): void;
|
|
1667
|
+
sortCol( colIdx: any, ascending: boolean ): void;
|
|
1668
|
+
_renderCell( rec: DataRecord, column: GridColumnEx, extra_cls: string[] ): ComponentContent;
|
|
1669
|
+
_buildRow( rowid: number, rec: DataRecord, top: number ): void;
|
|
1670
|
+
_buildRowHeader( rowid: number, rec: DataRecord, top: number ): void;
|
|
1671
|
+
_updateFlexs( ): void;
|
|
1672
|
+
_computeFullSize( ): void;
|
|
1673
|
+
_init( ): void;
|
|
1674
|
+
_on_dblclk( e: UIEvent, row: number ): void;
|
|
1675
|
+
_update( force: any ): void;
|
|
1676
|
+
_clearSelection( ): void;
|
|
1677
|
+
_addSelection( rowid: number ): void;
|
|
1678
|
+
getSelection( ): void;
|
|
1679
|
+
getFirstSel( ): void;
|
|
1680
|
+
selectItem( id: any ): void;
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
// ---------------------------------------
|
|
1684
|
+
// from /src/components/header/header.ts
|
|
1685
|
+
|
|
1686
|
+
interface HeaderItem {
|
|
1687
|
+
name: string;
|
|
1688
|
+
title: string;
|
|
1689
|
+
iconId?: string;
|
|
1690
|
+
width?: number;
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
interface HeaderProps extends Omit<ComponentProps,"content"> {
|
|
1694
|
+
items: HeaderItem[];
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
@class_ns( "x4" ) export class Header extends HBox<HeaderProps> {
|
|
1698
|
+
_els: Component[];
|
|
1699
|
+
_vwp: Component;
|
|
1700
|
+
constructor( props: HeaderProps );
|
|
1701
|
+
_calc_sizes( ): void;
|
|
1702
|
+
_on_resize( ): void;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
// ---------------------------------------
|
|
1706
|
+
// from /src/components/keyboard/keyboard.ts
|
|
1707
|
+
|
|
1708
|
+
interface KeyboardProps extends BoxProps {
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
@class_ns( "x4" ) export class Keyboard extends HBox<KeyboardProps> {
|
|
1712
|
+
mode: "lower" | "upper" | "number" | "date";
|
|
1713
|
+
locale: string;
|
|
1714
|
+
keyboard: Box;
|
|
1715
|
+
visible: boolean;
|
|
1716
|
+
input: HTMLInputElement;
|
|
1717
|
+
constructor( props: KeyboardProps );
|
|
1718
|
+
handleKey( e: UIEvent ): void;
|
|
1719
|
+
_focusNext( ): void;
|
|
1720
|
+
_switchMode( m: "lower" | "upper" | "number" | "date" ): void;
|
|
1721
|
+
_redraw( ): void;
|
|
1722
|
+
_scrollIntoView( el: HTMLElement ): void;
|
|
1723
|
+
_updateVis: any;
|
|
1724
|
+
showOn( el: Component ): void;
|
|
1725
|
+
handleFocus( target: Element, enter: boolean ): void;
|
|
1726
|
+
_insertChar( caret: any, text: string, ch: string ): void;
|
|
1727
|
+
_backspace( caret: any, text: string ): void;
|
|
1728
|
+
_getCaret( ): void;
|
|
1729
|
+
_restoreCaretPos( caret: any ): void;
|
|
1730
|
+
fireKey( key: number, cb: Function ): void;
|
|
1731
|
+
_createContent( ): void;
|
|
1214
1732
|
}
|
|
1215
1733
|
|
|
1216
1734
|
// ---------------------------------------
|
|
@@ -1222,7 +1740,8 @@ declare module 'x4js' {
|
|
|
1222
1740
|
|
|
1223
1741
|
interface LinkProps extends ComponentProps {
|
|
1224
1742
|
href: string;
|
|
1225
|
-
text
|
|
1743
|
+
text?: string | UnsafeHtml;
|
|
1744
|
+
icon?: string;
|
|
1226
1745
|
click?: EventCallback<EvClick>;
|
|
1227
1746
|
}
|
|
1228
1747
|
|
|
@@ -1241,10 +1760,23 @@ declare module 'x4js' {
|
|
|
1241
1760
|
}
|
|
1242
1761
|
|
|
1243
1762
|
@class_ns( "x4" ) export class MessageBox extends Dialog<DialogProps> {
|
|
1244
|
-
m_label: Label;
|
|
1245
1763
|
constructor( props: DialogProps );
|
|
1246
|
-
|
|
1247
|
-
show( msg: string | UnsafeHtml ): MessageBox;
|
|
1764
|
+
_create( msg: string | UnsafeHtml, buttons: BtnGroupItem[], title: string ): void;
|
|
1765
|
+
show( msg: string | UnsafeHtml, buttons: BtnGroupItem[], title: string ): MessageBox;
|
|
1766
|
+
showAsync( msg: string | UnsafeHtml, buttons: BtnGroupItem[], title: string ): Promise<string>;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
@class_ns( "x4" ) export class InputBox extends Dialog<DialogProps> {
|
|
1770
|
+
constructor( props: DialogProps );
|
|
1771
|
+
getValue( ): void;
|
|
1772
|
+
_create( msg: string | UnsafeHtml, value: string, title: string ): void;
|
|
1773
|
+
showAsync( msg: string | UnsafeHtml, value: string, title: string ): Promise<string>;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
@class_ns( "x4" ) export class PromptBox extends Dialog<DialogProps> {
|
|
1777
|
+
constructor( props: DialogProps );
|
|
1778
|
+
_create( msg: string | UnsafeHtml, editor: Component, title: string ): void;
|
|
1779
|
+
showAsync( msg: string | UnsafeHtml, editor: Component, title: string ): Promise<string>;
|
|
1248
1780
|
}
|
|
1249
1781
|
|
|
1250
1782
|
// ---------------------------------------
|
|
@@ -1297,6 +1829,103 @@ declare module 'x4js' {
|
|
|
1297
1829
|
setValue( value: number ): void;
|
|
1298
1830
|
}
|
|
1299
1831
|
|
|
1832
|
+
// ---------------------------------------
|
|
1833
|
+
// from /src/components/select/select.ts
|
|
1834
|
+
|
|
1835
|
+
export interface SelectProps extends ComponentProps {
|
|
1836
|
+
name?: string;
|
|
1837
|
+
value: string;
|
|
1838
|
+
items: ListItem[];
|
|
1839
|
+
multiple?: boolean;
|
|
1840
|
+
change?: EventCallback<EvChange>;
|
|
1841
|
+
focus?: EventCallback<EvFocus>;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
interface SelectEvents extends ComponentEvent {
|
|
1845
|
+
focus: EvFocus;
|
|
1846
|
+
change: EvChange;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
@class_ns( "x4" ) export class Select extends Component<SelectProps,SelectEvents> {
|
|
1850
|
+
constructor( props: SelectProps );
|
|
1851
|
+
on_focus( ev: FocusEvent, focus_out: boolean ): void;
|
|
1852
|
+
on_change( ev: InputEvent ): void;
|
|
1853
|
+
setItems( items: ListItem[] ): void;
|
|
1854
|
+
getValue( ): void;
|
|
1855
|
+
setValue( value: string ): void;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
// ---------------------------------------
|
|
1859
|
+
// from /src/components/propgrid/propgrid.ts
|
|
1860
|
+
|
|
1861
|
+
type IValue = boolean | number | string;
|
|
1862
|
+
|
|
1863
|
+
type IValueCB = ( name: string) => IValue;
|
|
1864
|
+
|
|
1865
|
+
export interface PropertyValue {
|
|
1866
|
+
type: 'boolean' | 'number' | 'string' | 'password' | 'options';
|
|
1867
|
+
title?: string;
|
|
1868
|
+
desc?: string;
|
|
1869
|
+
name?: string;
|
|
1870
|
+
value: IValue | IValueCB;
|
|
1871
|
+
options?: ListItem[];
|
|
1872
|
+
callback: ( name: string, value: any ) => void;
|
|
1873
|
+
step?: number;
|
|
1874
|
+
live?: boolean;
|
|
1875
|
+
cls?: string;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
export interface PropertyGroup {
|
|
1879
|
+
title: string;
|
|
1880
|
+
desc?: string;
|
|
1881
|
+
icon?: string;
|
|
1882
|
+
cls?: string;
|
|
1883
|
+
collapsible?: boolean;
|
|
1884
|
+
items: PropertyValue[];
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
export interface PropertyProps extends ComponentProps {
|
|
1888
|
+
groups: PropertyGroup[];
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
@class_ns( "x4" ) export class PropertyGrid extends VBox {
|
|
1892
|
+
root: Component;
|
|
1893
|
+
groups: PropertyGroup[];
|
|
1894
|
+
constructor( props: PropertyProps );
|
|
1895
|
+
setItems( _grps: PropertyGroup[] ): void;
|
|
1896
|
+
makeGroupHeader( g: PropertyGroup ): void;
|
|
1897
|
+
makePropertyRow( item: PropertyValue ): void;
|
|
1898
|
+
setPropValue( name: string, value: any ): void;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
// ---------------------------------------
|
|
1902
|
+
// from /src/components/radio/radio.ts
|
|
1903
|
+
|
|
1904
|
+
interface RadioEvents extends ComponentEvents {
|
|
1905
|
+
change?: EvChange;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
interface RadioProps extends ComponentProps {
|
|
1909
|
+
label: string;
|
|
1910
|
+
icon?: string;
|
|
1911
|
+
name: string;
|
|
1912
|
+
value: number | string;
|
|
1913
|
+
checked?: boolean;
|
|
1914
|
+
change?: EventCallback<EvChange>;
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
@class_ns( "x4" ) export class Radio extends Component<RadioProps,RadioEvents> {
|
|
1918
|
+
_check: HBox;
|
|
1919
|
+
_input: Input;
|
|
1920
|
+
_label: Label;
|
|
1921
|
+
constructor( props: RadioProps );
|
|
1922
|
+
_on_click( ev: MouseEvent ): void;
|
|
1923
|
+
_on_change( ): void;
|
|
1924
|
+
setCheck( ck: boolean ): void;
|
|
1925
|
+
setLabel( text: string ): void;
|
|
1926
|
+
getValue( ): void;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1300
1929
|
// ---------------------------------------
|
|
1301
1930
|
// from /src/components/rating/rating.ts
|
|
1302
1931
|
|
|
@@ -1325,14 +1954,27 @@ declare module 'x4js' {
|
|
|
1325
1954
|
}
|
|
1326
1955
|
|
|
1327
1956
|
// ---------------------------------------
|
|
1328
|
-
// from /src/components/
|
|
1957
|
+
// from /src/components/tickline/tickline.ts
|
|
1329
1958
|
|
|
1330
|
-
interface
|
|
1331
|
-
|
|
1959
|
+
interface TickLineProps extends ComponentProps {
|
|
1960
|
+
values: number[];
|
|
1961
|
+
min?: number;
|
|
1962
|
+
max?: number;
|
|
1963
|
+
color?: Color;
|
|
1964
|
+
background?: Color;
|
|
1965
|
+
type: "bars" | "line";
|
|
1332
1966
|
}
|
|
1333
1967
|
|
|
1968
|
+
export class TickLine extends Component<TickLineProps> {
|
|
1969
|
+
constructor( props: TickLineProps );
|
|
1970
|
+
update( ): void;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
// ---------------------------------------
|
|
1974
|
+
// from /src/components/slider/slider.ts
|
|
1975
|
+
|
|
1334
1976
|
interface SliderEvents extends ComponentEvents {
|
|
1335
|
-
change:
|
|
1977
|
+
change: EvChange;
|
|
1336
1978
|
}
|
|
1337
1979
|
|
|
1338
1980
|
interface SliderProps extends ComponentProps {
|
|
@@ -1340,6 +1982,8 @@ declare module 'x4js' {
|
|
|
1340
1982
|
min: number;
|
|
1341
1983
|
max: number;
|
|
1342
1984
|
step?: number;
|
|
1985
|
+
vertical?: boolean;
|
|
1986
|
+
change?: EventCallback<EvChange>;
|
|
1343
1987
|
}
|
|
1344
1988
|
|
|
1345
1989
|
@class_ns( "x4" ) export class Slider extends Component<SliderProps,SliderEvents> {
|
|
@@ -1350,10 +1994,14 @@ declare module 'x4js' {
|
|
|
1350
1994
|
_range: Input;
|
|
1351
1995
|
constructor( props: SliderProps );
|
|
1352
1996
|
_on_mousedown( ev: PointerEvent ): void;
|
|
1997
|
+
_getMinMax( ): void;
|
|
1353
1998
|
_on_mousemove( ev: PointerEvent ): void;
|
|
1354
1999
|
_update( ): void;
|
|
1355
2000
|
_on_mouseup( ev: PointerEvent ): void;
|
|
1356
2001
|
_on_key( ev: KeyboardEvent ): void;
|
|
2002
|
+
setMin( min: number ): void;
|
|
2003
|
+
setMax( max: number ): void;
|
|
2004
|
+
setValue( v: number ): void;
|
|
1357
2005
|
}
|
|
1358
2006
|
|
|
1359
2007
|
// ---------------------------------------
|
|
@@ -1376,7 +2024,7 @@ declare module 'x4js' {
|
|
|
1376
2024
|
name: string;
|
|
1377
2025
|
title: string;
|
|
1378
2026
|
icon?: string;
|
|
1379
|
-
|
|
2027
|
+
content: Component;
|
|
1380
2028
|
}
|
|
1381
2029
|
|
|
1382
2030
|
@class_ns( "x4" ) class CTab extends Button {
|
|
@@ -1397,10 +2045,12 @@ declare module 'x4js' {
|
|
|
1397
2045
|
|
|
1398
2046
|
@class_ns( "x4" ) class CTabList extends HBox<TablistProps,TablistEvents> {
|
|
1399
2047
|
_selitem: Button;
|
|
1400
|
-
|
|
1401
|
-
constructor( props: TablistProps, content: TabItem[] );
|
|
2048
|
+
constructor( props: TablistProps, items: TabItem[] );
|
|
1402
2049
|
_on_click( ev: EvClick ): void;
|
|
1403
2050
|
select( name: string ): void;
|
|
2051
|
+
setItems( items: TabItem[ ] ): void;
|
|
2052
|
+
addItem( tab: TabItem ): void;
|
|
2053
|
+
getTabCount( ): void;
|
|
1404
2054
|
}
|
|
1405
2055
|
|
|
1406
2056
|
interface TabsProps extends Omit<ComponentProps,"content"> {
|
|
@@ -1414,6 +2064,8 @@ declare module 'x4js' {
|
|
|
1414
2064
|
constructor( props: TabsProps );
|
|
1415
2065
|
selectTab( name: string ): void;
|
|
1416
2066
|
_onclick( ev: TablistClickEvent ): void;
|
|
2067
|
+
getTab( name: string ): void;
|
|
2068
|
+
addTab( item: TabItem ): void;
|
|
1417
2069
|
}
|
|
1418
2070
|
|
|
1419
2071
|
// ---------------------------------------
|
|
@@ -1423,11 +2075,22 @@ declare module 'x4js' {
|
|
|
1423
2075
|
label?: string;
|
|
1424
2076
|
value?: string;
|
|
1425
2077
|
resize?: boolean;
|
|
2078
|
+
readonly?: boolean;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
class SimpleTextArea extends Component {
|
|
2082
|
+
constructor( props: TextAreaProps );
|
|
2083
|
+
setText( text: string ): void;
|
|
2084
|
+
getText( ): void;
|
|
2085
|
+
queryInterface<T>( name: string ): T;
|
|
1426
2086
|
}
|
|
1427
2087
|
|
|
1428
2088
|
@class_ns( "x4" ) export class TextArea extends VBox {
|
|
1429
|
-
_input:
|
|
2089
|
+
_input: SimpleTextArea;
|
|
1430
2090
|
constructor( props: TextAreaProps );
|
|
2091
|
+
setText( text: string ): void;
|
|
2092
|
+
getText( ): void;
|
|
2093
|
+
queryInterface<T>( name: string ): T;
|
|
1431
2094
|
}
|
|
1432
2095
|
|
|
1433
2096
|
// ---------------------------------------
|
|
@@ -1437,16 +2100,25 @@ declare module 'x4js' {
|
|
|
1437
2100
|
label: string | UnsafeHtml;
|
|
1438
2101
|
labelWidth?: number;
|
|
1439
2102
|
inputId?: string;
|
|
1440
|
-
type?: "text" | "email" | "password";
|
|
2103
|
+
type?: "text" | "email" | "password" | "date" | "number";
|
|
2104
|
+
name?: string;
|
|
1441
2105
|
readonly?: boolean;
|
|
1442
2106
|
required?: boolean;
|
|
1443
2107
|
value: string | number;
|
|
1444
2108
|
placeholder?: string;
|
|
2109
|
+
autofocus?: boolean;
|
|
1445
2110
|
inputGadgets?: Component[];
|
|
2111
|
+
inputAttrs?: any;
|
|
2112
|
+
focus?: EventCallback<EvFocus>;
|
|
2113
|
+
change?: EventCallback<EvChange>;
|
|
1446
2114
|
}
|
|
1447
2115
|
|
|
1448
2116
|
@class_ns( "x4" ) export class TextEdit extends HBox {
|
|
2117
|
+
input: Input;
|
|
1449
2118
|
constructor( props: TextEditProps );
|
|
2119
|
+
getValue( ): void;
|
|
2120
|
+
setValue( value: string ): void;
|
|
2121
|
+
getInput( ): void;
|
|
1450
2122
|
}
|
|
1451
2123
|
|
|
1452
2124
|
// ---------------------------------------
|
|
@@ -1479,6 +2151,7 @@ declare module 'x4js' {
|
|
|
1479
2151
|
|
|
1480
2152
|
interface TreeviewProps extends Omit<ComponentProps,"content"> {
|
|
1481
2153
|
items: TreeItem[];
|
|
2154
|
+
footer?: Component;
|
|
1482
2155
|
}
|
|
1483
2156
|
|
|
1484
2157
|
interface ChangeEvent extends ComponentEvent {
|
|
@@ -1486,7 +2159,7 @@ declare module 'x4js' {
|
|
|
1486
2159
|
}
|
|
1487
2160
|
|
|
1488
2161
|
interface TreeviewEvents extends ComponentEvents {
|
|
1489
|
-
|
|
2162
|
+
selectionChange?: EvSelectionChange;
|
|
1490
2163
|
}
|
|
1491
2164
|
|
|
1492
2165
|
@class_ns( "x4" ) class CTreeViewItem extends Box {
|
|
@@ -1501,6 +2174,7 @@ declare module 'x4js' {
|
|
|
1501
2174
|
}
|
|
1502
2175
|
|
|
1503
2176
|
@class_ns( "x4" ) export class Treeview extends Component<TreeviewProps,TreeviewEvents> {
|
|
2177
|
+
_view: Viewport;
|
|
1504
2178
|
_selection: ListboxID;
|
|
1505
2179
|
_selitem: Component;
|
|
1506
2180
|
_items: TreeItem[];
|
|
@@ -1514,6 +2188,7 @@ declare module 'x4js' {
|
|
|
1514
2188
|
_selectItem( id: ListboxID, item: Component ): void;
|
|
1515
2189
|
_findItem( id: ListboxID ): void;
|
|
1516
2190
|
clearSelection( ): void;
|
|
2191
|
+
getSelection( ): void;
|
|
1517
2192
|
}
|
|
1518
2193
|
|
|
1519
2194
|
// ---------------------------------------
|