x4js 1.5.40 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/README.txt +1 -1
- package/lib/changelog.txt +3 -0
- package/lib/cjs/{index.js → x4js.js} +7 -7
- package/lib/cjs/x4js.js.map +7 -0
- package/lib/esm/{index.mjs → x4js.mjs} +18 -12
- package/lib/esm/x4js.mjs.map +7 -0
- package/lib/src/MIT-license.md +1 -1
- package/lib/src/action.ts +1 -1
- package/lib/src/app_sockets.ts +1 -1
- package/lib/src/application.ts +3 -3
- package/lib/src/autocomplete.ts +1 -1
- package/lib/src/base64.ts +1 -1
- package/lib/src/base_component.ts +1 -1
- package/lib/src/button.ts +1 -1
- package/lib/src/calendar.ts +2 -2
- package/lib/src/canvas.ts +9 -4
- package/lib/src/cardview.ts +9 -8
- package/lib/src/checkbox.ts +1 -1
- package/lib/src/color.ts +4 -4
- package/lib/src/colorpicker.ts +18 -8
- package/lib/src/combobox.ts +7 -7
- package/lib/src/component.ts +45 -41
- package/lib/src/copyright.txt +1 -1
- package/lib/src/datastore.ts +1 -1
- package/lib/src/dialog.ts +2 -2
- package/lib/src/dom_events.ts +1 -1
- package/lib/src/drag_manager.ts +4 -4
- package/lib/src/drawtext.ts +1 -1
- package/lib/src/fileupload.ts +4 -4
- package/lib/src/form.ts +2 -2
- package/lib/src/formatters.ts +1 -1
- package/lib/src/gridview.ts +1 -1
- package/lib/src/i18n.ts +1 -1
- package/lib/src/icon.ts +1 -1
- package/lib/src/image.ts +1 -1
- package/lib/src/index.ts +1 -1
- package/lib/src/input.ts +1 -1
- package/lib/src/label.ts +1 -1
- package/lib/src/layout.ts +1 -1
- package/lib/src/link.ts +1 -1
- package/lib/src/listview.ts +1 -1
- package/lib/src/md5.ts +1 -1
- package/lib/src/menu.ts +1 -1
- package/lib/src/messagebox.ts +1 -1
- package/lib/src/panel.ts +1 -1
- package/lib/src/popup.ts +1 -1
- package/lib/src/property_editor.ts +1 -1
- package/lib/src/radiobtn.ts +1 -1
- package/lib/src/rating.ts +1 -1
- package/lib/src/request.ts +1 -1
- package/lib/src/router.ts +1 -1
- package/lib/src/settings.ts +1 -1
- package/lib/src/sidebarview.ts +1 -1
- package/lib/src/spreadsheet.ts +1 -1
- package/lib/src/styles.ts +1 -1
- package/lib/src/svgcomponent.ts +13 -8
- package/lib/src/tabbar.ts +1 -1
- package/lib/src/tabview.ts +1 -1
- package/lib/src/textarea.ts +1 -1
- package/lib/src/textedit.ts +1 -1
- package/lib/src/toaster.ts +1 -1
- package/lib/src/tools.ts +1 -1
- package/lib/src/tooltips.ts +1 -1
- package/lib/src/treeview.ts +1 -1
- package/lib/src/version.ts +2 -2
- package/lib/src/x4.less +1 -1
- package/lib/src/x4dom.ts +1 -1
- package/lib/src/x4events.ts +10 -10
- package/lib/src/x4js.ts +89 -0
- package/lib/src/x4react.ts +1 -1
- package/lib/styles/x4.css +1 -1
- package/lib/styles/x4.less +1 -1
- package/lib/types/x4js.d.ts +6762 -0
- package/package.json +10 -8
- package/lib/cjs/index.js.map +0 -7
- package/lib/esm/index.js.map +0 -7
- package/lib/esm/index.mjs.map +0 -7
- package/lib/types/action.d.ts +0 -57
- package/lib/types/app_sockets.d.ts +0 -29
- package/lib/types/application.d.ts +0 -108
- package/lib/types/autocomplete.d.ts +0 -63
- package/lib/types/base_component.d.ts +0 -88
- package/lib/types/button.d.ts +0 -151
- package/lib/types/calendar.d.ts +0 -82
- package/lib/types/canvas.d.ts +0 -92
- package/lib/types/cardview.d.ts +0 -87
- package/lib/types/checkbox.d.ts +0 -77
- package/lib/types/color.d.ts +0 -148
- package/lib/types/colorpicker.d.ts +0 -107
- package/lib/types/combobox.d.ts +0 -111
- package/lib/types/component.d.ts +0 -603
- package/lib/types/datastore.d.ts +0 -396
- package/lib/types/dialog.d.ts +0 -175
- package/lib/types/dom_events.d.ts +0 -302
- package/lib/types/drag_manager.d.ts +0 -58
- package/lib/types/drawtext.d.ts +0 -48
- package/lib/types/fileupload.d.ts +0 -64
- package/lib/types/form.d.ts +0 -142
- package/lib/types/formatters.d.ts +0 -35
- package/lib/types/gridview.d.ts +0 -175
- package/lib/types/i18n.d.ts +0 -73
- package/lib/types/icon.d.ts +0 -71
- package/lib/types/image.d.ts +0 -56
- package/lib/types/index.d.ts +0 -84
- package/lib/types/input.d.ts +0 -97
- package/lib/types/label.d.ts +0 -67
- package/lib/types/layout.d.ts +0 -89
- package/lib/types/link.d.ts +0 -50
- package/lib/types/listview.d.ts +0 -178
- package/lib/types/md5.d.ts +0 -61
- package/lib/types/menu.d.ts +0 -130
- package/lib/types/messagebox.d.ts +0 -69
- package/lib/types/panel.d.ts +0 -47
- package/lib/types/popup.d.ts +0 -75
- package/lib/types/property_editor.d.ts +0 -71
- package/lib/types/radiobtn.d.ts +0 -73
- package/lib/types/rating.d.ts +0 -53
- package/lib/types/request.d.ts +0 -52
- package/lib/types/router.d.ts +0 -67
- package/lib/types/settings.d.ts +0 -37
- package/lib/types/sidebarview.d.ts +0 -51
- package/lib/types/spreadsheet.d.ts +0 -222
- package/lib/types/styles.d.ts +0 -85
- package/lib/types/svgcomponent.d.ts +0 -216
- package/lib/types/tabbar.d.ts +0 -58
- package/lib/types/tabview.d.ts +0 -49
- package/lib/types/textarea.d.ts +0 -77
- package/lib/types/textedit.d.ts +0 -126
- package/lib/types/toaster.d.ts +0 -42
- package/lib/types/tools.d.ts +0 -394
- package/lib/types/tooltips.d.ts +0 -46
- package/lib/types/treeview.d.ts +0 -144
- package/lib/types/version.d.ts +0 -29
- package/lib/types/x4dom.d.ts +0 -49
- package/lib/types/x4events.d.ts +0 -269
- package/lib/types/x4react.d.ts +0 -41
package/lib/src/MIT-license.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MIT LICENSE #
|
|
2
2
|
|
|
3
|
-
**Copyright (c) 2019-
|
|
3
|
+
**Copyright (c) 2019-2023 R-libre ingenierie**
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
|
|
6
6
|
in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
package/lib/src/action.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file action.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
package/lib/src/app_sockets.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file app_sockets.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
package/lib/src/application.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file application.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
|
@@ -160,7 +160,7 @@ export class Application<P extends ApplicationProps = ApplicationProps, E extend
|
|
|
160
160
|
return this.m_user_data;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
public get history( ) {
|
|
163
|
+
public get history( ): null {
|
|
164
164
|
//if( !this.m_history ) {
|
|
165
165
|
// this.m_history = new NavigationHistory( );
|
|
166
166
|
//}
|
|
@@ -247,7 +247,7 @@ export class Application<P extends ApplicationProps = ApplicationProps, E extend
|
|
|
247
247
|
const tch = ev.touches[0];
|
|
248
248
|
let fake: any = {type: "dblclick" };
|
|
249
249
|
for( const n in tch ) {
|
|
250
|
-
fake[n] = tch[n];
|
|
250
|
+
fake[n] = (tch as any)[n];
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
// ignore -> private: dirty x2
|
package/lib/src/autocomplete.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file autocomplete.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
package/lib/src/base64.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file base64.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file base_component.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
package/lib/src/button.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file button.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
package/lib/src/calendar.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file calendar.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
|
@@ -170,7 +170,7 @@ export class Calendar extends VLayout<CalendarProps, CalendarEventMap>
|
|
|
170
170
|
cls += ' out';
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
const mkItem = ( dte ) => {
|
|
173
|
+
const mkItem = ( dte: Date ) => {
|
|
174
174
|
return new HLayout({
|
|
175
175
|
cls,
|
|
176
176
|
flex: 1,
|
package/lib/src/canvas.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file canvas.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
|
@@ -30,6 +30,11 @@
|
|
|
30
30
|
import { Component, CProps, CEventMap, html } from './component'
|
|
31
31
|
import { BasicEvent, EventCallback } from './x4events'
|
|
32
32
|
|
|
33
|
+
interface IPoint {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
interface EvPaint extends BasicEvent {
|
|
34
39
|
ctx: CanvasPainter;
|
|
35
40
|
}
|
|
@@ -108,14 +113,14 @@ function smoothLine( this: CanvasRenderingContext2D, points: any[], path: Canvas
|
|
|
108
113
|
return;
|
|
109
114
|
}
|
|
110
115
|
|
|
111
|
-
function midPointBtw(p1, p2) {
|
|
116
|
+
function midPointBtw(p1: IPoint, p2: IPoint ) {
|
|
112
117
|
return {
|
|
113
118
|
x: p1.x + (p2.x - p1.x) / 2,
|
|
114
119
|
y: p1.y + (p2.y - p1.y) / 2
|
|
115
120
|
};
|
|
116
121
|
}
|
|
117
122
|
|
|
118
|
-
function getQuadraticXY(t, sx, sy, cp1x, cp1y, ex, ey) {
|
|
123
|
+
function getQuadraticXY(t: number, sx: number, sy: number, cp1x: number, cp1y: number, ex: number, ey: number) : IPoint {
|
|
119
124
|
return {
|
|
120
125
|
x: (1 - t) * (1 - t) * sx + 2 * (1 - t) * t * cp1x + t * t * ex,
|
|
121
126
|
y: (1 - t) * (1 - t) * sy + 2 * (1 - t) * t * cp1y + t * t * ey
|
|
@@ -212,7 +217,7 @@ function smoothLineEx(this: CanvasRenderingContext2D, _points: any[], tension: n
|
|
|
212
217
|
parse(pts, cache, 4);
|
|
213
218
|
}
|
|
214
219
|
|
|
215
|
-
function parse(pts, cache, l) {
|
|
220
|
+
function parse(pts: number[], cache: Float32Array, l: number) {
|
|
216
221
|
|
|
217
222
|
for (var i = 2, t; i < l; i += 2) {
|
|
218
223
|
|
package/lib/src/cardview.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file cardview.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
|
@@ -85,7 +85,7 @@ export class CardView<P extends CardViewProps = CardViewProps, E extends CardVie
|
|
|
85
85
|
/** @ignore */
|
|
86
86
|
render() {
|
|
87
87
|
|
|
88
|
-
let pages = [];
|
|
88
|
+
let pages: any[] = [];
|
|
89
89
|
this.m_cards.forEach((p) => {
|
|
90
90
|
if (p.page) {
|
|
91
91
|
pages.push(p.page);
|
|
@@ -171,7 +171,7 @@ export class CardView<P extends CardViewProps = CardViewProps, E extends CardVie
|
|
|
171
171
|
*
|
|
172
172
|
*/
|
|
173
173
|
|
|
174
|
-
private _initTabs(pages): any {
|
|
174
|
+
private _initTabs(pages: ICardViewItem[] ): any {
|
|
175
175
|
|
|
176
176
|
if (!pages) {
|
|
177
177
|
return;
|
|
@@ -185,10 +185,11 @@ export class CardView<P extends CardViewProps = CardViewProps, E extends CardVie
|
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
let card: ICardItemEx = {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
let card: ICardItemEx = {
|
|
189
|
+
...p,
|
|
190
|
+
selector: this._prepareSelector(p),
|
|
191
|
+
active: false
|
|
192
|
+
}
|
|
192
193
|
|
|
193
194
|
this.m_cards.push(card);
|
|
194
195
|
|
|
@@ -196,7 +197,7 @@ export class CardView<P extends CardViewProps = CardViewProps, E extends CardVie
|
|
|
196
197
|
active = p.name;
|
|
197
198
|
}
|
|
198
199
|
|
|
199
|
-
if (
|
|
200
|
+
if (card.active) {
|
|
200
201
|
active = p.name;
|
|
201
202
|
}
|
|
202
203
|
});
|
package/lib/src/checkbox.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file checkbox.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
package/lib/src/color.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file color.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import { Stylesheet } from './styles'
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
const colorValues = {
|
|
33
|
+
const colorValues: any = {
|
|
34
34
|
'lightsalmon': 0xFFFFA07A,
|
|
35
35
|
'lightseagreen': 0xFF20B2AA,
|
|
36
36
|
'lightskyblue': 0xFF87CEFA,
|
|
@@ -180,7 +180,7 @@ const colorValues = {
|
|
|
180
180
|
export class Color
|
|
181
181
|
{
|
|
182
182
|
private m_value:number;
|
|
183
|
-
private static custom: Color
|
|
183
|
+
private static custom: Record<string,Color> = {};
|
|
184
184
|
|
|
185
185
|
/**
|
|
186
186
|
* @example
|
|
@@ -451,7 +451,7 @@ export class Color
|
|
|
451
451
|
r = g = b = l; // achromatic
|
|
452
452
|
}
|
|
453
453
|
else{
|
|
454
|
-
function hue2rgb(p, q, t){
|
|
454
|
+
function hue2rgb(p: number, q: number, t: number){
|
|
455
455
|
if(t < 0) t += 1.0;
|
|
456
456
|
if(t > 1) t -= 1.0;
|
|
457
457
|
if(t < 1/6) return p + (q - p) * 6 * t;
|
package/lib/src/colorpicker.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file colorpicker.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
|
@@ -123,11 +123,11 @@ export class ColorPicker extends Container<ColorPickerProps, ColorPickerEventMap
|
|
|
123
123
|
|
|
124
124
|
this.addClass("pal-mode");
|
|
125
125
|
|
|
126
|
-
let selector = null;
|
|
127
|
-
let cur = null;
|
|
126
|
+
let selector: VLayout = null;
|
|
127
|
+
let cur: Component = null;
|
|
128
128
|
|
|
129
|
-
let main_sel = [];
|
|
130
|
-
let sub_sel = [];
|
|
129
|
+
let main_sel: Component[] = [];
|
|
130
|
+
let sub_sel: Component[] = [];
|
|
131
131
|
|
|
132
132
|
const ccolor = this.m_baseColor.value();
|
|
133
133
|
|
|
@@ -158,7 +158,7 @@ export class ColorPicker extends Container<ColorPickerProps, ColorPickerEventMap
|
|
|
158
158
|
main_sel.push(el);
|
|
159
159
|
});
|
|
160
160
|
|
|
161
|
-
function fillSubs( colors ) {
|
|
161
|
+
function fillSubs( colors: Variation[] ) {
|
|
162
162
|
sub_sel = [];
|
|
163
163
|
colors.forEach(mc => {
|
|
164
164
|
let clr = new Color(mc.hex);
|
|
@@ -550,7 +550,7 @@ export class ColorPickerBox extends Dialog<ColorPickerBoxProps, ColorPickerBoxEv
|
|
|
550
550
|
});
|
|
551
551
|
}
|
|
552
552
|
|
|
553
|
-
private _makeCustoms(cc) {
|
|
553
|
+
private _makeCustoms(cc: Color[] ) {
|
|
554
554
|
|
|
555
555
|
let custom = null;
|
|
556
556
|
|
|
@@ -735,7 +735,17 @@ export class ColorPickerEditor extends HLayout<ColorPickerEditorProps, ColorPick
|
|
|
735
735
|
|
|
736
736
|
// :: Material colors scheme ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
737
737
|
|
|
738
|
-
|
|
738
|
+
interface Variation {
|
|
739
|
+
weight: number;
|
|
740
|
+
hex: number;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
interface Variations {
|
|
744
|
+
color: string;
|
|
745
|
+
variations: Variation[];
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
const materialColors: Variations[] = [
|
|
739
749
|
{
|
|
740
750
|
color: "Red",
|
|
741
751
|
variations: [
|
package/lib/src/combobox.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file combobox.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c) 2019-
|
|
11
|
+
* Copyright (c) 2019-2023 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
14
|
* of this software and associated documentation files (the "Software"), to deal
|
|
@@ -87,10 +87,10 @@ export interface ComboBoxProps extends CProps<ComboBoxEventMap> {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
abstract class InputLike extends Component {
|
|
90
|
-
abstract setValue( text: string );
|
|
90
|
+
abstract setValue( text: string ): void;
|
|
91
91
|
abstract getValue( ): string;
|
|
92
|
-
abstract showError( text: string );
|
|
93
|
-
abstract clearError( );
|
|
92
|
+
abstract showError( text: string ): void;
|
|
93
|
+
abstract clearError( ): void;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
|
|
@@ -131,7 +131,7 @@ export class ComboBox extends HLayout<ComboBoxProps,ComboBoxEventMap> {
|
|
|
131
131
|
this.m_lockchg = false;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
_onKey(e) {
|
|
134
|
+
_onKey(e: KeyboardEvent ) {
|
|
135
135
|
if (this.m_popvis) {
|
|
136
136
|
if (e.key == "ArrowUp" || e.key == "ArrowDown") {
|
|
137
137
|
this.m_lockpop = true;
|
|
@@ -379,12 +379,12 @@ export class ComboBox extends HLayout<ComboBoxProps,ComboBoxEventMap> {
|
|
|
379
379
|
*
|
|
380
380
|
*/
|
|
381
381
|
|
|
382
|
-
private _setInput( item, fireEv = false ) {
|
|
382
|
+
private _setInput( item: ListViewItem, fireEv = false ) {
|
|
383
383
|
|
|
384
384
|
if( item ) {
|
|
385
385
|
if( this.m_ui_input ) {
|
|
386
386
|
if( this.m_ui_input instanceof Input ) {
|
|
387
|
-
this.m_ui_input.value = item.text;
|
|
387
|
+
this.m_ui_input.value = item.text as string;
|
|
388
388
|
// fires a change event
|
|
389
389
|
if( fireEv ) {
|
|
390
390
|
this.m_ui_input.dom.dispatchEvent( new Event('input') );
|