x4js 1.4.38 → 1.4.41
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 +11 -1
- package/lib/colorpicker.d.ts +2 -1
- package/lib/combobox.js +11 -2
- package/lib/dialog.js +5 -3
- package/lib/gridview.js +2 -0
- package/lib/listview.js +1 -0
- package/lib/spreadsheet.js +2 -2
- package/lib/x4.css +7 -6
- package/lib/x4events.d.ts +5 -2
- package/package.json +3 -2
- package/src/colorpicker.ts +2 -2
- package/src/combobox.ts +12 -2
- package/src/dialog.ts +6 -4
- package/src/gridview.ts +2 -0
- package/src/listview.ts +1 -0
- package/src/spreadsheet.ts +2 -2
- package/src/x4.less +8 -6
- package/src/x4events.ts +5 -2
package/README.md
CHANGED
|
@@ -2,4 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This is the x4 framework repository.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
X4 is a full typescript framework to develop Web or Desktop applications.
|
|
6
|
+
Included more than 50 controls like grids, charts, etc. Everything needed to push the limits of your creativity.
|
|
7
|
+
If these components are not enough, you can create your in few lines.
|
|
8
|
+
|
|
9
|
+
## Documentation
|
|
10
|
+
see [documentation](https://x4js.org/doc/)
|
|
11
|
+
## API
|
|
12
|
+
see [API](https://x4js.org/api/)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
[web site](https://x4js.org)
|
package/lib/colorpicker.d.ts
CHANGED
|
@@ -91,7 +91,8 @@ export interface ColorPickerEditorProps extends ColorPickerProps {
|
|
|
91
91
|
labelWidth?: number;
|
|
92
92
|
cust_colors?: Color[];
|
|
93
93
|
displayValue?: false;
|
|
94
|
-
change
|
|
94
|
+
change?: EventCallback<EvChange>;
|
|
95
|
+
name?: string;
|
|
95
96
|
}
|
|
96
97
|
export declare class ColorPickerEditor extends HLayout<ColorPickerEditorProps, ColorPickerEventMap> {
|
|
97
98
|
constructor(props: ColorPickerEditorProps);
|
package/lib/combobox.js
CHANGED
|
@@ -131,7 +131,7 @@ class ComboBox extends layout_1.HLayout {
|
|
|
131
131
|
*/
|
|
132
132
|
showPopup() {
|
|
133
133
|
let props = this.m_props;
|
|
134
|
-
if (props.readOnly) {
|
|
134
|
+
if (props.readOnly || this.hasClass("@disable")) {
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
137
|
// need creation ?
|
|
@@ -200,6 +200,11 @@ class ComboBox extends layout_1.HLayout {
|
|
|
200
200
|
this.m_props.value = item.id;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
+
else {
|
|
204
|
+
if (this.m_ui_input && this.m_ui_input instanceof input_1.Input) {
|
|
205
|
+
this.m_ui_input.value = "";
|
|
206
|
+
}
|
|
207
|
+
}
|
|
203
208
|
}
|
|
204
209
|
/**
|
|
205
210
|
*
|
|
@@ -218,13 +223,17 @@ class ComboBox extends layout_1.HLayout {
|
|
|
218
223
|
if ((0, tools_1.isFunction)(items)) {
|
|
219
224
|
items = items();
|
|
220
225
|
}
|
|
221
|
-
items.some((v) => {
|
|
226
|
+
const found = items.some((v) => {
|
|
222
227
|
if (v.id === id) {
|
|
223
228
|
this._setInput(v);
|
|
224
229
|
this.m_selection = v;
|
|
225
230
|
return true;
|
|
226
231
|
}
|
|
227
232
|
});
|
|
233
|
+
if (!found) {
|
|
234
|
+
this._setInput(null);
|
|
235
|
+
this.m_selection = null;
|
|
236
|
+
}
|
|
228
237
|
}
|
|
229
238
|
get input() {
|
|
230
239
|
return this.m_ui_input instanceof input_1.Input ? this.m_ui_input : null;
|
package/lib/dialog.js
CHANGED
|
@@ -149,7 +149,9 @@ class Dialog extends popup_1.Popup {
|
|
|
149
149
|
this.setStyleValue('height', this.m_props.dlgHeight + '%');
|
|
150
150
|
}
|
|
151
151
|
this.addClass('@resized');
|
|
152
|
-
this.m_el_title
|
|
152
|
+
if (this.m_el_title) {
|
|
153
|
+
this.m_el_title.setStyleValue("width", "auto");
|
|
154
|
+
}
|
|
153
155
|
if (this.m_props.maximized) {
|
|
154
156
|
this._maximize();
|
|
155
157
|
this.emit('size', (0, component_1.EvSize)(null));
|
|
@@ -344,9 +346,9 @@ class Dialog extends popup_1.Popup {
|
|
|
344
346
|
let { x, y } = (0, tools_1.getMousePos)(event, true);
|
|
345
347
|
let wrc = (0, component_1.flyWrap)(x4dom_1.x4document.body).getBoundingRect();
|
|
346
348
|
let rc = this.getBoundingRect(true);
|
|
347
|
-
let trc = this.m_el_title.getBoundingRect();
|
|
349
|
+
///let trc = this.m_el_title.getBoundingRect();
|
|
348
350
|
let dx = x - rc.left, dy = y - rc.top;
|
|
349
|
-
let cstyle = this.getComputedStyle();
|
|
351
|
+
//let cstyle = this.getComputedStyle();
|
|
350
352
|
//let topw = cstyle.parse('marginTop') + cstyle.parse('paddingTop') + cstyle.parse('borderTopWidth');
|
|
351
353
|
//let botw = cstyle.parse('marginBottom') + cstyle.parse('paddingBottom') + cstyle.parse('borderBottomWidth');
|
|
352
354
|
//let lftw = cstyle.parse('marginLeft') + cstyle.parse('paddingLeft') + cstyle.parse('borderLeftWidth');
|
package/lib/gridview.js
CHANGED
|
@@ -398,12 +398,14 @@ class GridView extends layout_1.VLayout {
|
|
|
398
398
|
_col.width = width;
|
|
399
399
|
if (_col.flex) {
|
|
400
400
|
_col.$hdr.removeClass('@flex');
|
|
401
|
+
_col.$ftr?.removeClass('@flex');
|
|
401
402
|
_col.flex = undefined;
|
|
402
403
|
updateFlex = true;
|
|
403
404
|
}
|
|
404
405
|
}
|
|
405
406
|
else if (width < 0 && !_col.flex) {
|
|
406
407
|
_col.$hdr.addClass('@flex');
|
|
408
|
+
_col.$ftr?.addClass('@flex');
|
|
407
409
|
_col.flex = 1;
|
|
408
410
|
updateFlex = true;
|
|
409
411
|
}
|
package/lib/listview.js
CHANGED
|
@@ -481,6 +481,7 @@ class PopupListView extends popup_1.Popup {
|
|
|
481
481
|
constructor(props) {
|
|
482
482
|
super({ tabIndex: false });
|
|
483
483
|
this.enableMask(false);
|
|
484
|
+
this.addClass("@non-maskable");
|
|
484
485
|
props.tabIndex = false;
|
|
485
486
|
this.m_list = new ListView(props);
|
|
486
487
|
//this.m_list.addClass( '@fit' );
|
package/lib/spreadsheet.js
CHANGED
|
@@ -895,8 +895,8 @@ class Spreadsheet extends layout_1.VLayout {
|
|
|
895
895
|
style: {
|
|
896
896
|
left: rc.left - prc.left,
|
|
897
897
|
top: rc.top - prc.top,
|
|
898
|
-
width: rc.width,
|
|
899
|
-
height: rc.height
|
|
898
|
+
width: rc.width - 1,
|
|
899
|
+
height: rc.height - 1
|
|
900
900
|
},
|
|
901
901
|
tabIndex: false,
|
|
902
902
|
value: cellvalue,
|
package/lib/x4.css
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
:root {
|
|
30
|
-
--x4-font: "
|
|
30
|
+
--x4-font: "Helvetica, Arial, Sans-Serif";
|
|
31
31
|
--x4-font-size: 13px;
|
|
32
32
|
--x4-base-color: #266888;
|
|
33
33
|
--x4-selection-color: #2458B3;
|
|
@@ -703,8 +703,8 @@ textarea::selection {
|
|
|
703
703
|
padding: 4px;
|
|
704
704
|
}
|
|
705
705
|
.x-menu-item:hover {
|
|
706
|
-
background-color:
|
|
707
|
-
color: var(--
|
|
706
|
+
background-color: var(--x4-hover-color);
|
|
707
|
+
color: var(--x4-hover-text);
|
|
708
708
|
}
|
|
709
709
|
.x-menu-item:hover .x-icon {
|
|
710
710
|
color: var(--gray-900);
|
|
@@ -1153,7 +1153,7 @@ textarea::selection {
|
|
|
1153
1153
|
.x-grid-view .x-row {
|
|
1154
1154
|
position: absolute;
|
|
1155
1155
|
width: calc(100% - 4px);
|
|
1156
|
-
border-bottom: 1px solid #
|
|
1156
|
+
border-bottom: 1px solid #d0d0d0;
|
|
1157
1157
|
align-items: center;
|
|
1158
1158
|
height: 2em;
|
|
1159
1159
|
}
|
|
@@ -1163,15 +1163,17 @@ textarea::selection {
|
|
|
1163
1163
|
}
|
|
1164
1164
|
.x-spreadsheet .x-cell,
|
|
1165
1165
|
.x-grid-view .x-cell {
|
|
1166
|
-
border-right: 1px solid #
|
|
1166
|
+
border-right: 1px solid #d0d0d0;
|
|
1167
1167
|
}
|
|
1168
1168
|
.x-spreadsheet .x-cell.center,
|
|
1169
1169
|
.x-grid-view .x-cell.center {
|
|
1170
1170
|
text-align: center;
|
|
1171
|
+
justify-content: center;
|
|
1171
1172
|
}
|
|
1172
1173
|
.x-spreadsheet .x-cell.right,
|
|
1173
1174
|
.x-grid-view .x-cell.right {
|
|
1174
1175
|
text-align: right;
|
|
1176
|
+
justify-content: right;
|
|
1175
1177
|
}
|
|
1176
1178
|
.x-spreadsheet:focus,
|
|
1177
1179
|
.x-grid-view:focus {
|
|
@@ -1217,7 +1219,6 @@ textarea::selection {
|
|
|
1217
1219
|
.x-spreadsheet .x-editor {
|
|
1218
1220
|
position: absolute;
|
|
1219
1221
|
min-height: 0;
|
|
1220
|
-
height: calc(100% - 1px);
|
|
1221
1222
|
margin: 0;
|
|
1222
1223
|
}
|
|
1223
1224
|
.x-spreadsheet .x-editor input {
|
package/lib/x4events.d.ts
CHANGED
|
@@ -70,10 +70,12 @@ export declare function EvChange(value: unknown, context?: any): EvChange;
|
|
|
70
70
|
* Selection Event
|
|
71
71
|
* value is the new selection or null
|
|
72
72
|
*/
|
|
73
|
+
interface X4Selection {
|
|
74
|
+
}
|
|
73
75
|
export interface EvSelectionChange extends BasicEvent {
|
|
74
|
-
readonly selection:
|
|
76
|
+
readonly selection: X4Selection;
|
|
75
77
|
}
|
|
76
|
-
export declare function EvSelectionChange(selection:
|
|
78
|
+
export declare function EvSelectionChange(selection: X4Selection, context?: any): EvSelectionChange;
|
|
77
79
|
/**
|
|
78
80
|
* ContextMenu Event
|
|
79
81
|
*/
|
|
@@ -264,3 +266,4 @@ export declare class EventSource<Q extends EventMap, T extends EventTypes = MapE
|
|
|
264
266
|
*/
|
|
265
267
|
removeAllListeners(eventName: string | null): void;
|
|
266
268
|
}
|
|
269
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x4js",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.41",
|
|
4
4
|
"description": "X4js core files",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"typescript",
|
|
14
|
-
"framework"
|
|
14
|
+
"framework",
|
|
15
|
+
"sap", "web", "desktop", "application"
|
|
15
16
|
],
|
|
16
17
|
"scripts": {
|
|
17
18
|
"build": "tsc && lessc src/x4.less >lib/x4.css",
|
package/src/colorpicker.ts
CHANGED
|
@@ -631,8 +631,8 @@ export interface ColorPickerEditorProps extends ColorPickerProps {
|
|
|
631
631
|
labelWidth?: number;
|
|
632
632
|
cust_colors?: Color[];
|
|
633
633
|
displayValue?: false,
|
|
634
|
-
|
|
635
|
-
|
|
634
|
+
change?: EventCallback<EvChange>;
|
|
635
|
+
name?: string;
|
|
636
636
|
}
|
|
637
637
|
|
|
638
638
|
export class ColorPickerEditor extends HLayout<ColorPickerEditorProps, ColorPickerEventMap> {
|
package/src/combobox.ts
CHANGED
|
@@ -191,7 +191,7 @@ export class ComboBox extends HLayout<ComboBoxProps,ComboBoxEventMap> {
|
|
|
191
191
|
showPopup() {
|
|
192
192
|
|
|
193
193
|
let props = this.m_props;
|
|
194
|
-
if (props.readOnly) {
|
|
194
|
+
if (props.readOnly || this.hasClass("@disable") ) {
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -278,6 +278,11 @@ export class ComboBox extends HLayout<ComboBoxProps,ComboBoxEventMap> {
|
|
|
278
278
|
this.m_props.value = item.id;
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
+
else {
|
|
282
|
+
if( this.m_ui_input && this.m_ui_input instanceof Input ) {
|
|
283
|
+
this.m_ui_input.value = "";
|
|
284
|
+
}
|
|
285
|
+
}
|
|
281
286
|
}
|
|
282
287
|
|
|
283
288
|
/**
|
|
@@ -303,13 +308,18 @@ export class ComboBox extends HLayout<ComboBoxProps,ComboBoxEventMap> {
|
|
|
303
308
|
items = items( );
|
|
304
309
|
}
|
|
305
310
|
|
|
306
|
-
items.some( (v) => {
|
|
311
|
+
const found = items.some( (v) => {
|
|
307
312
|
if (v.id === id) {
|
|
308
313
|
this._setInput( v );
|
|
309
314
|
this.m_selection = v;
|
|
310
315
|
return true;
|
|
311
316
|
}
|
|
312
317
|
});
|
|
318
|
+
|
|
319
|
+
if( !found ) {
|
|
320
|
+
this._setInput( null );
|
|
321
|
+
this.m_selection = null;
|
|
322
|
+
}
|
|
313
323
|
}
|
|
314
324
|
|
|
315
325
|
get input( ) : Input {
|
package/src/dialog.ts
CHANGED
|
@@ -233,7 +233,10 @@ export class Dialog<P extends DialogProps = DialogProps, E extends DialogBoxEven
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
this.addClass('@resized');
|
|
236
|
-
|
|
236
|
+
|
|
237
|
+
if( this.m_el_title ) {
|
|
238
|
+
this.m_el_title.setStyleValue( "width", "auto" );
|
|
239
|
+
}
|
|
237
240
|
|
|
238
241
|
if (this.m_props.maximized) {
|
|
239
242
|
this._maximize();
|
|
@@ -463,13 +466,12 @@ export class Dialog<P extends DialogProps = DialogProps, E extends DialogBoxEven
|
|
|
463
466
|
|
|
464
467
|
let wrc = flyWrap(x4document.body).getBoundingRect();
|
|
465
468
|
let rc = this.getBoundingRect(true);
|
|
466
|
-
let trc = this.m_el_title.getBoundingRect();
|
|
469
|
+
///let trc = this.m_el_title.getBoundingRect();
|
|
467
470
|
|
|
468
471
|
let dx = x - rc.left,
|
|
469
472
|
dy = y - rc.top;
|
|
470
473
|
|
|
471
|
-
let cstyle = this.getComputedStyle();
|
|
472
|
-
|
|
474
|
+
//let cstyle = this.getComputedStyle();
|
|
473
475
|
//let topw = cstyle.parse('marginTop') + cstyle.parse('paddingTop') + cstyle.parse('borderTopWidth');
|
|
474
476
|
//let botw = cstyle.parse('marginBottom') + cstyle.parse('paddingBottom') + cstyle.parse('borderBottomWidth');
|
|
475
477
|
//let lftw = cstyle.parse('marginLeft') + cstyle.parse('paddingLeft') + cstyle.parse('borderLeftWidth');
|
package/src/gridview.ts
CHANGED
|
@@ -555,12 +555,14 @@ export class GridView extends VLayout<GridViewProps, GridViewEventMap> {
|
|
|
555
555
|
_col.width = width;
|
|
556
556
|
if( _col.flex ) {
|
|
557
557
|
_col.$hdr.removeClass( '@flex' );
|
|
558
|
+
_col.$ftr?.removeClass( '@flex' );
|
|
558
559
|
_col.flex = undefined;
|
|
559
560
|
updateFlex = true;
|
|
560
561
|
}
|
|
561
562
|
}
|
|
562
563
|
else if( width<0 && !_col.flex ) {
|
|
563
564
|
_col.$hdr.addClass( '@flex' );
|
|
565
|
+
_col.$ftr?.addClass( '@flex' );
|
|
564
566
|
_col.flex = 1;
|
|
565
567
|
updateFlex = true;
|
|
566
568
|
}
|
package/src/listview.ts
CHANGED
package/src/spreadsheet.ts
CHANGED
|
@@ -1201,8 +1201,8 @@ export class Spreadsheet extends VLayout<SpreadsheetProps, SpreadsheetEventSet>
|
|
|
1201
1201
|
style: {
|
|
1202
1202
|
left: rc.left - prc.left,
|
|
1203
1203
|
top: rc.top - prc.top,
|
|
1204
|
-
width: rc.width,
|
|
1205
|
-
height: rc.height
|
|
1204
|
+
width: rc.width - 1,
|
|
1205
|
+
height: rc.height - 1
|
|
1206
1206
|
},
|
|
1207
1207
|
tabIndex: false,
|
|
1208
1208
|
value: cellvalue,
|
package/src/x4.less
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
**/
|
|
31
31
|
|
|
32
32
|
:root {
|
|
33
|
-
--x4-font: "
|
|
33
|
+
--x4-font: "Helvetica, Arial, Sans-Serif";
|
|
34
34
|
--x4-font-size: 13px;
|
|
35
35
|
|
|
36
36
|
--x4-base-color: #266888;
|
|
@@ -878,8 +878,9 @@ textarea {
|
|
|
878
878
|
}
|
|
879
879
|
|
|
880
880
|
&:hover {
|
|
881
|
-
background-color:
|
|
882
|
-
color: var(
|
|
881
|
+
background-color: var( --x4-hover-color);
|
|
882
|
+
color: var(--x4-hover-text);
|
|
883
|
+
|
|
883
884
|
.x-icon {
|
|
884
885
|
color: var( --gray-900 );
|
|
885
886
|
}
|
|
@@ -1401,7 +1402,7 @@ textarea {
|
|
|
1401
1402
|
.x-row {
|
|
1402
1403
|
position: absolute;
|
|
1403
1404
|
width: calc( 100% - @bwidth ); // todo: border of 1st col
|
|
1404
|
-
border-bottom: 1px solid #
|
|
1405
|
+
border-bottom: 1px solid #d0d0d0;
|
|
1405
1406
|
align-items: center;
|
|
1406
1407
|
height: @def-height;
|
|
1407
1408
|
|
|
@@ -1411,14 +1412,16 @@ textarea {
|
|
|
1411
1412
|
}
|
|
1412
1413
|
|
|
1413
1414
|
.x-cell {
|
|
1414
|
-
border-right: 1px solid #
|
|
1415
|
+
border-right: 1px solid #d0d0d0;
|
|
1415
1416
|
|
|
1416
1417
|
&.center {
|
|
1417
1418
|
text-align: center;
|
|
1419
|
+
justify-content: center;
|
|
1418
1420
|
}
|
|
1419
1421
|
|
|
1420
1422
|
&.right {
|
|
1421
1423
|
text-align: right;
|
|
1424
|
+
justify-content: right;
|
|
1422
1425
|
}
|
|
1423
1426
|
}
|
|
1424
1427
|
|
|
@@ -1486,7 +1489,6 @@ textarea {
|
|
|
1486
1489
|
.x-editor {
|
|
1487
1490
|
position: absolute;
|
|
1488
1491
|
min-height: 0;
|
|
1489
|
-
height: calc( 100% - 1px );
|
|
1490
1492
|
margin: 0;
|
|
1491
1493
|
|
|
1492
1494
|
input {
|
package/src/x4events.ts
CHANGED
|
@@ -108,11 +108,14 @@ export function EvChange(value: unknown, context = null ) {
|
|
|
108
108
|
* value is the new selection or null
|
|
109
109
|
*/
|
|
110
110
|
|
|
111
|
+
interface X4Selection {
|
|
112
|
+
}
|
|
113
|
+
|
|
111
114
|
export interface EvSelectionChange extends BasicEvent {
|
|
112
|
-
readonly selection:
|
|
115
|
+
readonly selection: X4Selection;
|
|
113
116
|
}
|
|
114
117
|
|
|
115
|
-
export function EvSelectionChange( selection:
|
|
118
|
+
export function EvSelectionChange( selection: X4Selection, context = null ) {
|
|
116
119
|
return BasicEvent<EvSelectionChange>( { selection, context } );
|
|
117
120
|
}
|
|
118
121
|
|