x4js 2.0.18 → 2.0.21
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 -0
- package/lib/cjs/x4.css +1 -1
- package/lib/cjs/x4.js +2 -2
- package/lib/esm/x4.css +1 -1
- package/lib/esm/x4.mjs +2 -2
- package/lib/styles/x4.css +1 -1
- package/lib/types/x4js.d.ts +92 -77
- package/package.json +1 -1
- package/src/components/boxes/boxes.ts +35 -3
- package/src/components/breadcrumb/breadcrumb.ts +4 -4
- package/src/components/btngroup/btngroup.ts +4 -4
- package/src/components/button/button.ts +2 -2
- package/src/components/calendar/calendar.ts +1 -1
- package/src/components/canvas/canvas.ts +2 -2
- package/src/components/checkbox/checkbox.ts +4 -4
- package/src/components/colorinput/colorinput.ts +3 -3
- package/src/components/combobox/combobox.module.scss +13 -0
- package/src/components/combobox/combobox.ts +10 -3
- package/src/components/dialog/dialog.ts +7 -7
- package/src/components/form/form.ts +5 -5
- package/src/components/gridview/gridview.ts +12 -9
- package/src/components/header/header.module.scss +2 -1
- package/src/components/header/header.ts +22 -10
- package/src/components/icon/icon.module.scss +1 -0
- package/src/components/icon/icon.ts +1 -1
- package/src/components/image/image.ts +3 -3
- package/src/components/input/input.ts +2 -2
- package/src/components/keyboard/keyboard.ts +5 -5
- package/src/components/label/label.module.scss +6 -1
- package/src/components/label/label.ts +1 -1
- package/src/components/listbox/listbox.module.scss +35 -31
- package/src/components/listbox/listbox.ts +53 -15
- package/src/components/messages/messages.ts +15 -1
- package/src/components/notification/notification.ts +8 -8
- package/src/components/popup/popup.ts +14 -3
- package/src/components/progress/progress.ts +1 -1
- package/src/components/propgrid/propgrid.ts +5 -3
- package/src/components/radio/radio.ts +2 -2
- package/src/components/rating/rating.ts +6 -6
- package/src/components/select/select.ts +1 -1
- package/src/components/sizers/sizer.ts +5 -5
- package/src/components/slider/slider.ts +3 -3
- package/src/components/switch/switch.ts +3 -3
- package/src/components/tabs/tabs.module.scss +2 -2
- package/src/components/tabs/tabs.ts +29 -5
- package/src/components/textarea/textarea.ts +1 -1
- package/src/components/textedit/textedit.ts +2 -2
- package/src/components/tickline/tickline.ts +1 -1
- package/src/components/tooltips/tooltips.ts +2 -2
- package/src/components/treeview/treeview.module.scss +9 -1
- package/src/components/treeview/treeview.ts +53 -14
- package/src/components/viewport/viewport.ts +1 -1
- package/src/core/component.ts +46 -9
- package/src/core/core_application.ts +3 -3
- package/src/core/core_data.ts +12 -12
- package/src/core/core_element.ts +1 -1
- package/src/core/core_react.ts +2 -2
- package/src/core/core_router.ts +2 -2
- package/src/core/core_state.ts +1 -1
- package/src/core/core_styles.ts +1 -1
- package/src/core/core_tools.ts +2 -0
- package/lib/src/components/base.scss +0 -25
- package/lib/src/components/boxes/boxes.module.scss +0 -54
- package/lib/src/components/boxes/boxes.ts +0 -370
- package/lib/src/components/breadcrumb/breadcrumb.scss +0 -56
- package/lib/src/components/breadcrumb/breadcrumb.ts +0 -93
- package/lib/src/components/breadcrumb/chevron-right.svg +0 -1
- package/lib/src/components/btngroup/btngroup.module.scss +0 -41
- package/lib/src/components/btngroup/btngroup.ts +0 -153
- package/lib/src/components/button/button.module.scss +0 -173
- package/lib/src/components/button/button.ts +0 -185
- package/lib/src/components/calendar/calendar-check-sharp-light.svg +0 -1
- package/lib/src/components/calendar/calendar.module.scss +0 -163
- package/lib/src/components/calendar/calendar.ts +0 -327
- package/lib/src/components/calendar/chevron-left-sharp-light.svg +0 -1
- package/lib/src/components/calendar/chevron-right-sharp-light.svg +0 -1
- package/lib/src/components/canvas/canvas.module.scss +0 -25
- package/lib/src/components/canvas/canvas.ts +0 -189
- package/lib/src/components/canvas/canvas_ex.ts +0 -276
- package/lib/src/components/checkbox/check.svg +0 -4
- package/lib/src/components/checkbox/checkbox.module.scss +0 -142
- package/lib/src/components/checkbox/checkbox.ts +0 -140
- package/lib/src/components/colorinput/colorinput.module.scss +0 -65
- package/lib/src/components/colorinput/colorinput.ts +0 -91
- package/lib/src/components/colorinput/crosshairs-simple-sharp-light.svg +0 -1
- package/lib/src/components/colorpicker/colorpicker.module.scss +0 -133
- package/lib/src/components/colorpicker/colorpicker.ts +0 -482
- package/lib/src/components/combobox/combobox.module.scss +0 -133
- package/lib/src/components/combobox/combobox.ts +0 -275
- package/lib/src/components/combobox/updown.svg +0 -4
- package/lib/src/components/components.ts +0 -42
- package/lib/src/components/dialog/dialog.module.scss +0 -104
- package/lib/src/components/dialog/dialog.ts +0 -229
- package/lib/src/components/dialog/xmark-sharp-light.svg +0 -1
- package/lib/src/components/filedrop/cloud-arrow-up.svg +0 -1
- package/lib/src/components/filedrop/filedrop.module.scss +0 -70
- package/lib/src/components/filedrop/filedrop.ts +0 -131
- package/lib/src/components/form/form.module.scss +0 -38
- package/lib/src/components/form/form.ts +0 -172
- package/lib/src/components/gridview/arrow-down-light.svg +0 -1
- package/lib/src/components/gridview/arrow-up-light.svg +0 -1
- package/lib/src/components/gridview/gridview.module.scss +0 -324
- package/lib/src/components/gridview/gridview.ts +0 -1175
- package/lib/src/components/header/header.module.scss +0 -40
- package/lib/src/components/header/header.ts +0 -130
- package/lib/src/components/icon/icon.module.scss +0 -31
- package/lib/src/components/icon/icon.ts +0 -137
- package/lib/src/components/image/image.module.scss +0 -28
- package/lib/src/components/image/image.ts +0 -168
- package/lib/src/components/input/input.module.scss +0 -74
- package/lib/src/components/input/input.ts +0 -422
- package/lib/src/components/keyboard/arrow-up.svg +0 -1
- package/lib/src/components/keyboard/delete-left.svg +0 -1
- package/lib/src/components/keyboard/eye-slash.svg +0 -1
- package/lib/src/components/keyboard/keyboard.module.scss +0 -134
- package/lib/src/components/keyboard/keyboard.ts +0 -526
- package/lib/src/components/label/label.module.scss +0 -76
- package/lib/src/components/label/label.ts +0 -97
- package/lib/src/components/link/link.ts +0 -81
- package/lib/src/components/listbox/listbox.module.scss +0 -161
- package/lib/src/components/listbox/listbox.ts +0 -539
- package/lib/src/components/menu/caret-right-solid.svg +0 -1
- package/lib/src/components/menu/menu.module.scss +0 -117
- package/lib/src/components/menu/menu.ts +0 -174
- package/lib/src/components/messages/circle-exclamation.svg +0 -1
- package/lib/src/components/messages/messages.module.scss +0 -92
- package/lib/src/components/messages/messages.ts +0 -215
- package/lib/src/components/messages/pen-field.svg +0 -1
- package/lib/src/components/normalize.scss +0 -391
- package/lib/src/components/notification/circle-check-solid.svg +0 -1
- package/lib/src/components/notification/circle-exclamation-solid.svg +0 -1
- package/lib/src/components/notification/circle-notch-light.svg +0 -1
- package/lib/src/components/notification/notification.module.scss +0 -84
- package/lib/src/components/notification/notification.ts +0 -107
- package/lib/src/components/notification/xmark-sharp-light.svg +0 -1
- package/lib/src/components/panel/panel.module.scss +0 -60
- package/lib/src/components/panel/panel.ts +0 -58
- package/lib/src/components/popup/popup.module.scss +0 -51
- package/lib/src/components/popup/popup.ts +0 -442
- package/lib/src/components/progress/progress.module.scss +0 -57
- package/lib/src/components/progress/progress.ts +0 -44
- package/lib/src/components/propgrid/folder-closed.svg +0 -1
- package/lib/src/components/propgrid/folder-open.svg +0 -1
- package/lib/src/components/propgrid/progrid.module.scss +0 -112
- package/lib/src/components/propgrid/propgrid.ts +0 -288
- package/lib/src/components/propgrid/updown.svg +0 -4
- package/lib/src/components/radio/radio.module.scss +0 -147
- package/lib/src/components/radio/radio.svg +0 -4
- package/lib/src/components/radio/radio.ts +0 -142
- package/lib/src/components/rating/rating.module.scss +0 -23
- package/lib/src/components/rating/rating.ts +0 -131
- package/lib/src/components/rating/star-sharp-light.svg +0 -1
- package/lib/src/components/rating/star-sharp-solid.svg +0 -1
- package/lib/src/components/select/select.module.scss +0 -9
- package/lib/src/components/select/select.ts +0 -134
- package/lib/src/components/shared.scss +0 -137
- package/lib/src/components/sizers/sizer.module.scss +0 -90
- package/lib/src/components/sizers/sizer.ts +0 -132
- package/lib/src/components/slider/slider.module.scss +0 -118
- package/lib/src/components/slider/slider.ts +0 -198
- package/lib/src/components/switch/switch.module.scss +0 -127
- package/lib/src/components/switch/switch.ts +0 -62
- package/lib/src/components/tabs/tabs.module.scss +0 -45
- package/lib/src/components/tabs/tabs.ts +0 -205
- package/lib/src/components/textarea/textarea.module.scss +0 -63
- package/lib/src/components/textarea/textarea.ts +0 -125
- package/lib/src/components/textedit/textedit.module.scss +0 -116
- package/lib/src/components/textedit/textedit.ts +0 -115
- package/lib/src/components/themes.scss +0 -88
- package/lib/src/components/tickline/tickline.module.scss +0 -26
- package/lib/src/components/tickline/tickline.ts +0 -82
- package/lib/src/components/tooltips/circle-info-sharp-light.svg +0 -1
- package/lib/src/components/tooltips/comments-question.svg +0 -1
- package/lib/src/components/tooltips/tooltips.scss +0 -72
- package/lib/src/components/tooltips/tooltips.ts +0 -109
- package/lib/src/components/treeview/chevron-down-light.svg +0 -1
- package/lib/src/components/treeview/treeview.module.scss +0 -185
- package/lib/src/components/treeview/treeview.ts +0 -445
- package/lib/src/components/viewport/viewport.module.scss +0 -32
- package/lib/src/components/viewport/viewport.ts +0 -41
- package/lib/src/core/component.ts +0 -1066
- package/lib/src/core/core_application.ts +0 -265
- package/lib/src/core/core_colors.ts +0 -250
- package/lib/src/core/core_data.ts +0 -1310
- package/lib/src/core/core_dom.ts +0 -471
- package/lib/src/core/core_dragdrop.ts +0 -201
- package/lib/src/core/core_element.ts +0 -115
- package/lib/src/core/core_events.ts +0 -177
- package/lib/src/core/core_i18n.ts +0 -393
- package/lib/src/core/core_react.ts +0 -79
- package/lib/src/core/core_router.ts +0 -237
- package/lib/src/core/core_state.ts +0 -62
- package/lib/src/core/core_styles.ts +0 -214
- package/lib/src/core/core_svg.ts +0 -712
- package/lib/src/core/core_tools.ts +0 -906
- package/lib/src/types/scss.d.ts +0 -4
- package/lib/src/types/svg.d.ts +0 -1
- package/lib/src/types/x4react.d.ts +0 -9
- package/lib/src/x4.scss +0 -19
- package/lib/src/x4.ts +0 -35
- package/lib/src/x4tsx.d.ts +0 -25
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
outline: none;
|
|
47
47
|
|
|
48
48
|
&>.x4header {
|
|
49
|
-
border-bottom: 1px solid var( --
|
|
49
|
+
border-bottom: 1px solid var( --border );
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
&>.body {
|
|
@@ -59,45 +59,45 @@
|
|
|
59
59
|
|
|
60
60
|
&> .x4viewport {
|
|
61
61
|
display: table;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.x4item {
|
|
65
|
+
@extend .flex;
|
|
62
66
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
padding: 4px;
|
|
67
|
-
background-color: transparent;
|
|
68
|
-
color: var( --color-gray-9 );
|
|
67
|
+
padding: 4px;
|
|
68
|
+
background-color: transparent;
|
|
69
|
+
color: var( --text-primary );
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
71
|
+
&> .x4label {
|
|
72
|
+
color: inherit;
|
|
73
|
+
padding: 2px 6px;
|
|
74
|
+
|
|
75
|
+
#icon {
|
|
76
|
+
color: var( --listbox-icon-color );
|
|
77
|
+
fill: var( --listbox-icon-color );
|
|
78
78
|
}
|
|
79
|
+
}
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
&:hover {
|
|
82
|
+
background-color: var( --listbox-item-background-hover );
|
|
83
|
+
}
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
&.selected {
|
|
86
|
+
background-color: var( --listbox-item-background-sel );
|
|
87
|
+
color: var( --listbox-item-color-sel );
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
89
|
+
&> .x4label {
|
|
90
|
+
#icon {
|
|
91
|
+
color: var( --listbox-item-color-sel );
|
|
92
|
+
fill: var( --listbox-item-color-sel );
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
//&:active{
|
|
97
|
-
//background-color: var( --color-80 );
|
|
98
|
-
//color: var(--color-0);
|
|
99
|
-
//}
|
|
100
95
|
}
|
|
96
|
+
|
|
97
|
+
//&:active{
|
|
98
|
+
//background-color: var( --color-80 );
|
|
99
|
+
//color: var(--color-0);
|
|
100
|
+
//}
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -138,6 +138,10 @@
|
|
|
138
138
|
&:focus {
|
|
139
139
|
background-color: var( --ol-button-background-hover );
|
|
140
140
|
}
|
|
141
|
+
|
|
142
|
+
&:disabled {
|
|
143
|
+
color: var( --disabled-color-dark );
|
|
144
|
+
}
|
|
141
145
|
}
|
|
142
146
|
}
|
|
143
147
|
}
|
|
@@ -15,12 +15,14 @@
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
import { Component, ComponentEvent, ComponentEvents, componentFromDOM, ComponentProps, EvChange, EvClick, EvContextMenu, EvDblClick, EvSelectionChange } from '../../core/component';
|
|
18
|
-
import { EventCallback } from '../../core/core_events
|
|
19
|
-
import { kbNav, class_ns, isArray, UnsafeHtml } from '
|
|
18
|
+
import { EventCallback } from '../../core/core_events';
|
|
19
|
+
import { kbNav, class_ns, isArray, UnsafeHtml, asap } from '../../core/core_tools';
|
|
20
20
|
|
|
21
21
|
import { ScrollView, Viewport } from '../viewport/viewport';
|
|
22
|
-
import {
|
|
23
|
-
|
|
22
|
+
import { Header } from '../header/header';
|
|
23
|
+
|
|
24
|
+
import { HBox } from '../boxes/boxes';
|
|
25
|
+
import { Label } from '../label/label';
|
|
24
26
|
|
|
25
27
|
import "./listbox.module.scss"
|
|
26
28
|
|
|
@@ -55,7 +57,7 @@ interface ListboxEvents extends ComponentEvents {
|
|
|
55
57
|
interface ListboxProps extends Omit<ComponentProps,'content'> {
|
|
56
58
|
items?: ListItem[];
|
|
57
59
|
renderer?: ( item: ListItem ) => Component;
|
|
58
|
-
|
|
60
|
+
header?: Header;
|
|
59
61
|
footer?: Component,
|
|
60
62
|
checkable?: true,
|
|
61
63
|
multisel?: true,
|
|
@@ -98,8 +100,12 @@ export class Listbox extends Component<ListboxProps,ListboxEvents> {
|
|
|
98
100
|
props.footer.setAttribute( "id", "footer" );
|
|
99
101
|
}
|
|
100
102
|
|
|
103
|
+
if( props.header ) {
|
|
104
|
+
props.header.setAttribute( "id", "header" );
|
|
105
|
+
}
|
|
106
|
+
|
|
101
107
|
this.setContent( [
|
|
102
|
-
|
|
108
|
+
props.header ? props.header : null,
|
|
103
109
|
scroller,
|
|
104
110
|
props.footer,
|
|
105
111
|
] );
|
|
@@ -342,7 +348,12 @@ export class Listbox extends Component<ListboxProps,ListboxEvents> {
|
|
|
342
348
|
|
|
343
349
|
if( !ids.length ) {
|
|
344
350
|
if( this._multisel.size ) {
|
|
345
|
-
|
|
351
|
+
if( notify ) {
|
|
352
|
+
this.clearSelection( );
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
this._clearSelection( );
|
|
356
|
+
}
|
|
346
357
|
}
|
|
347
358
|
|
|
348
359
|
return;
|
|
@@ -361,7 +372,9 @@ export class Listbox extends Component<ListboxProps,ListboxEvents> {
|
|
|
361
372
|
}
|
|
362
373
|
});
|
|
363
374
|
|
|
364
|
-
|
|
375
|
+
if( notify ) {
|
|
376
|
+
this.fire( "selectionChange", { selection: this.getSelection(), empty: this._multisel.size==0 } );
|
|
377
|
+
}
|
|
365
378
|
}
|
|
366
379
|
}
|
|
367
380
|
|
|
@@ -411,15 +424,29 @@ export class Listbox extends Component<ListboxProps,ListboxEvents> {
|
|
|
411
424
|
|
|
412
425
|
this.clearSelection( );
|
|
413
426
|
this._view.clearContent( );
|
|
414
|
-
this._items = items;
|
|
427
|
+
this._items = items ?? [];
|
|
415
428
|
|
|
416
|
-
|
|
429
|
+
let upsel = false;
|
|
430
|
+
|
|
431
|
+
if( this._items.length ) {
|
|
417
432
|
const content = items.map( x => this.renderItem(x) );
|
|
418
433
|
this._view.setContent( content );
|
|
419
434
|
|
|
420
435
|
if( keepSel ) {
|
|
421
436
|
this.select( oldSel );
|
|
422
437
|
}
|
|
438
|
+
else {
|
|
439
|
+
upsel = true;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
upsel = true;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
if( upsel ) {
|
|
447
|
+
this.setTimeout( "sel", 100, ( ) => {
|
|
448
|
+
this.fire( "selectionChange", { selection: [], empty: true } );
|
|
449
|
+
} );
|
|
423
450
|
}
|
|
424
451
|
}
|
|
425
452
|
|
|
@@ -452,7 +479,7 @@ export class Listbox extends Component<ListboxProps,ListboxEvents> {
|
|
|
452
479
|
*
|
|
453
480
|
*/
|
|
454
481
|
|
|
455
|
-
filter( filter: string ) {
|
|
482
|
+
filter( filter: string | RegExp ) {
|
|
456
483
|
const childs = this._view.enumChildComponents( false );
|
|
457
484
|
|
|
458
485
|
if( !filter ) {
|
|
@@ -460,13 +487,24 @@ export class Listbox extends Component<ListboxProps,ListboxEvents> {
|
|
|
460
487
|
}
|
|
461
488
|
else {
|
|
462
489
|
// get list of visible items
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
490
|
+
let filtred: Set<ListboxID>;
|
|
491
|
+
|
|
492
|
+
if( filter instanceof RegExp ) {
|
|
493
|
+
const f = filter as RegExp;
|
|
494
|
+
filtred = new Set( this._items
|
|
495
|
+
.filter( x => f.test(x.text as string) )
|
|
496
|
+
.map( x => x.id ) );
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
const f = filter.toUpperCase( );
|
|
500
|
+
filtred = new Set( this._items
|
|
501
|
+
.filter( x => x.text.toUpperCase().includes(f) )
|
|
502
|
+
.map( x => x.id ) );
|
|
503
|
+
}
|
|
466
504
|
|
|
467
505
|
// now hide all elements not in list
|
|
468
506
|
childs.forEach( x => {
|
|
469
|
-
x.show( filtred.
|
|
507
|
+
x.show( filtred.has( x.getInternalData( "id" ) ) );
|
|
470
508
|
});
|
|
471
509
|
}
|
|
472
510
|
}
|
|
@@ -16,7 +16,7 @@ import "./messages.module.scss";
|
|
|
16
16
|
|
|
17
17
|
import error_icon from "./circle-exclamation.svg";
|
|
18
18
|
import pen_icon from "./pen-field.svg";
|
|
19
|
-
import { Component } from '
|
|
19
|
+
import { Component } from '../../core/component';
|
|
20
20
|
|
|
21
21
|
export interface MessageBoxProps extends DialogProps {
|
|
22
22
|
message: string;
|
|
@@ -209,7 +209,21 @@ export class PromptBox extends Dialog<DialogProps>
|
|
|
209
209
|
|
|
210
210
|
box.show();
|
|
211
211
|
} );
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
static show( msg: string | UnsafeHtml, editor: Component, title: string, callback: ( btn: string ) => boolean | Promise<boolean> | Promise<void> ) {
|
|
212
215
|
|
|
216
|
+
const box = this._create( msg, editor, title );
|
|
217
|
+
|
|
218
|
+
box.on( "btnclick", ( ev ) => {
|
|
219
|
+
asap( async ( ) => {
|
|
220
|
+
if( await callback( ev.button )!==false ) {
|
|
221
|
+
box.close()
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
box.show();
|
|
213
227
|
}
|
|
214
228
|
}
|
|
215
229
|
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
|
-
import { ComponentProps } from '../../core/component
|
|
18
|
-
import { class_ns, Rect, UnsafeHtml } from '../../core/core_tools
|
|
17
|
+
import { ComponentProps } from '../../core/component';
|
|
18
|
+
import { class_ns, Rect, UnsafeHtml } from '../../core/core_tools';
|
|
19
19
|
|
|
20
|
-
import { Popup } from '../popup/popup
|
|
21
|
-
import { HBox, VBox } from '../boxes/boxes
|
|
22
|
-
import { Icon } from '../icon/icon
|
|
23
|
-
import { Label } from '../label/label
|
|
24
|
-
import { Button } from '../button/button
|
|
20
|
+
import { Popup } from '../popup/popup';
|
|
21
|
+
import { HBox, VBox } from '../boxes/boxes';
|
|
22
|
+
import { Icon } from '../icon/icon';
|
|
23
|
+
import { Label } from '../label/label';
|
|
24
|
+
import { Button } from '../button/button';
|
|
25
25
|
|
|
26
26
|
import "./notification.module.scss";
|
|
27
27
|
|
|
@@ -72,7 +72,7 @@ export class Notification extends Popup {
|
|
|
72
72
|
const _icon = new Icon( { iconId: icon } );
|
|
73
73
|
if( props.loading ) {
|
|
74
74
|
_icon.addClass( "rotate" );
|
|
75
|
-
this.props.modal = true;
|
|
75
|
+
//this.props.modal = true;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
this.setContent( new HBox( {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { Component, ComponentEvent, ComponentEvents, ComponentProps, componentFromDOM, makeUniqueComponentId } from "../../core/component"
|
|
18
18
|
|
|
19
19
|
import { CSizer } from '../sizers/sizer';
|
|
20
|
-
import { Rect, Point, class_ns, asap } from '../../core/core_tools
|
|
20
|
+
import { Rect, Point, class_ns, asap } from '../../core/core_tools';
|
|
21
21
|
import { Box } from '../boxes/boxes'
|
|
22
22
|
|
|
23
23
|
import "./popup.module.scss"
|
|
@@ -178,8 +178,19 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
|
|
|
178
178
|
this.__remove( );
|
|
179
179
|
|
|
180
180
|
if( this._ismodal ) {
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
// modal1.show()
|
|
182
|
+
// modal2.show()
|
|
183
|
+
// modal1.hide()
|
|
184
|
+
if( modal_stack[modal_stack.length-1]!=this ) {
|
|
185
|
+
const idx = modal_stack.findIndex( x => x===this );
|
|
186
|
+
if( idx>=0 ) {
|
|
187
|
+
modal_stack.splice( idx, 1 );
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
modal_stack.pop( );
|
|
192
|
+
this._hideModalMask( );
|
|
193
|
+
}
|
|
183
194
|
}
|
|
184
195
|
|
|
185
196
|
// remove from popup list
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
|
-
import { class_ns } from '
|
|
17
|
+
import { class_ns } from '../../core/core_tools';
|
|
18
18
|
import { Component, ComponentProps } from '../../core/component';
|
|
19
19
|
|
|
20
20
|
import "./progress.module.scss";
|
|
@@ -22,7 +22,7 @@ import { Input, InputProps } from "../input/input"
|
|
|
22
22
|
import { ListItem } from "../listbox/listbox"
|
|
23
23
|
import { Label, SimpleText } from "../label/label"
|
|
24
24
|
import { class_ns, isFunction } from '../../core/core_tools';
|
|
25
|
-
import { Icon } from '../components
|
|
25
|
+
import { Icon } from '../components'
|
|
26
26
|
|
|
27
27
|
import "./progrid.module.scss"
|
|
28
28
|
import updown_icon from "./updown.svg"
|
|
@@ -81,7 +81,7 @@ export class PropertyGrid extends VBox {
|
|
|
81
81
|
|
|
82
82
|
setItems( _grps: PropertyGroup[] ) {
|
|
83
83
|
|
|
84
|
-
this.groups = _grps;
|
|
84
|
+
this.groups = _grps.filter( x => !!x );
|
|
85
85
|
//this.groups.sort( (a,b) => {return a.title>b.title ? 1 : 0} );
|
|
86
86
|
|
|
87
87
|
let items: Component[] = [];
|
|
@@ -89,7 +89,9 @@ export class PropertyGrid extends VBox {
|
|
|
89
89
|
for( const g of this.groups ) {
|
|
90
90
|
items.push( this.makeGroupHeader(g) );
|
|
91
91
|
g.items.forEach( i => {
|
|
92
|
-
|
|
92
|
+
if( i ) {
|
|
93
|
+
items.push( this.makePropertyRow(i) );
|
|
94
|
+
}
|
|
93
95
|
});
|
|
94
96
|
}
|
|
95
97
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
import { Component, ComponentEvents, ComponentProps, EvChange, makeUniqueComponentId } from '../../core/component';
|
|
18
|
-
import { class_ns } from '
|
|
19
|
-
import { EventCallback } from '
|
|
18
|
+
import { class_ns } from '../../core/core_tools';
|
|
19
|
+
import { EventCallback } from '../../core/core_events';
|
|
20
20
|
|
|
21
21
|
import { Label } from '../label/label';
|
|
22
22
|
import { Input } from '../input/input'
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
|
-
import { Component, ComponentEvents, componentFromDOM, ComponentProps, EvChange } from '../../core/component
|
|
18
|
-
import { EventCallback } from '../../core/core_events
|
|
19
|
-
import { HBox } from '../boxes/boxes
|
|
20
|
-
import { Input } from '../input/input
|
|
21
|
-
import { Icon } from '../icon/icon
|
|
17
|
+
import { Component, ComponentEvents, componentFromDOM, ComponentProps, EvChange } from '../../core/component';
|
|
18
|
+
import { EventCallback } from '../../core/core_events';
|
|
19
|
+
import { HBox } from '../boxes/boxes';
|
|
20
|
+
import { Input } from '../input/input';
|
|
21
|
+
import { Icon } from '../icon/icon';
|
|
22
22
|
|
|
23
23
|
import "./rating.module.scss"
|
|
24
24
|
import star_icon from "./star-sharp-solid.svg"
|
|
25
|
-
import { class_ns } from '
|
|
25
|
+
import { class_ns } from '../../core/core_tools';
|
|
26
26
|
|
|
27
27
|
interface RatingEventMap extends ComponentEvents {
|
|
28
28
|
change: EvChange;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
import { EventCallback } from '../../core/core_events
|
|
18
|
+
import { EventCallback } from '../../core/core_events';
|
|
19
19
|
import { Component, ComponentEvent, ComponentProps, EvChange, EvFocus } from '../../core/component';
|
|
20
20
|
import { class_ns } from '../../core/core_tools';
|
|
21
21
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
import { Component, ComponentEvent, ComponentEvents, ComponentProps, componentFromDOM } from '../../core/component';
|
|
18
|
-
import { class_ns, Point } from '../../core/core_tools
|
|
18
|
+
import { class_ns, Point } from '../../core/core_tools';
|
|
19
19
|
|
|
20
20
|
import "./sizer.module.scss"
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ import "./sizer.module.scss"
|
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
interface EvSizeChange extends ComponentEvent {
|
|
26
|
+
export interface EvSizeChange extends ComponentEvent {
|
|
27
27
|
size: number;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ interface CSizerEvent extends ComponentEvents {
|
|
|
33
33
|
stop: ComponentEvent;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
type SizerType = "left" | "top" | "right" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
36
|
+
type SizerType = "left" | "top" | "right" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right" ;
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
*
|
|
@@ -117,11 +117,11 @@ export class CSizer extends Component<ComponentProps,CSizerEvent> {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
if( this._type.includes("right") ) {
|
|
120
|
-
//nr.left = rc.left;
|
|
121
120
|
nr.width = (pt.x-rc.left);
|
|
122
|
-
|
|
121
|
+
}
|
|
123
122
|
|
|
124
123
|
this._ref.setStyle( nr );
|
|
124
|
+
//this._ref.setStyleValue( "flexGrow", 0 );
|
|
125
125
|
|
|
126
126
|
const nrc = this._ref.getBoundingRect( );
|
|
127
127
|
this.fire( "resize", { size: horz ? nrc.width : nrc.height })
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
|
-
import { EventCallback } from '
|
|
17
|
+
import { EventCallback } from '../../core/core_events';
|
|
18
18
|
import { Component, ComponentEvents, ComponentProps, EvChange } from '../../core/component';
|
|
19
|
-
import { class_ns, Rect } from '../../core/core_tools
|
|
19
|
+
import { class_ns, Rect } from '../../core/core_tools';
|
|
20
20
|
|
|
21
21
|
import { HBox } from '../boxes/boxes';
|
|
22
|
-
import { Input } from '../input/input
|
|
22
|
+
import { Input } from '../input/input';
|
|
23
23
|
|
|
24
24
|
import './slider.module.scss';
|
|
25
25
|
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
import { Component, ComponentProps, makeUniqueComponentId } from '../../core/component';
|
|
18
18
|
|
|
19
|
-
//import { Checkbox } from '@controls/controls
|
|
19
|
+
//import { Checkbox } from '@controls/controls';
|
|
20
20
|
import { Input } from '../input/input';
|
|
21
21
|
import { Label } from '../label/label';
|
|
22
|
-
import { HBox } from '../boxes/boxes
|
|
22
|
+
import { HBox } from '../boxes/boxes';
|
|
23
23
|
|
|
24
24
|
import "./switch.module.scss";
|
|
25
|
-
import { class_ns } from '
|
|
25
|
+
import { class_ns } from '../../core/core_tools';
|
|
26
26
|
|
|
27
27
|
interface SwitchProps extends ComponentProps {
|
|
28
28
|
label: string;
|
|
@@ -20,7 +20,7 @@ import { Button, ButtonProps } from '../button/button';
|
|
|
20
20
|
import { HBox, VBox, StackBox } from '../boxes/boxes';
|
|
21
21
|
|
|
22
22
|
import "./tabs.module.scss"
|
|
23
|
-
import { class_ns } from '
|
|
23
|
+
import { class_ns } from '../../core/core_tools';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
@@ -32,6 +32,7 @@ export interface TabItem {
|
|
|
32
32
|
title: string;
|
|
33
33
|
icon?: string;
|
|
34
34
|
content: Component;
|
|
35
|
+
cls?: string; // button class
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
/**
|
|
@@ -44,6 +45,10 @@ class CTab extends Button {
|
|
|
44
45
|
super( props );
|
|
45
46
|
|
|
46
47
|
this.addClass( "outline" );
|
|
48
|
+
if( item.cls ) {
|
|
49
|
+
this.addClass( item.cls );
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
this.setIcon( item.icon );
|
|
48
53
|
this.setText( item.title );
|
|
49
54
|
this.setData( "tabname", item.name );
|
|
@@ -100,7 +105,6 @@ class CTabList extends HBox<TablistProps,TablistEvents> {
|
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
107
|
|
|
103
|
-
|
|
104
108
|
setItems( items: TabItem[ ] ) {
|
|
105
109
|
this.clearContent( );
|
|
106
110
|
items.forEach( tab => {
|
|
@@ -114,8 +118,11 @@ class CTabList extends HBox<TablistProps,TablistEvents> {
|
|
|
114
118
|
}, tab ) );
|
|
115
119
|
}
|
|
116
120
|
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
removeItem( name: string ) {
|
|
122
|
+
const tab = this.query<Button>( `[data-tabname="${name}"]` );
|
|
123
|
+
if( tab ) {
|
|
124
|
+
this.removeChild( tab );
|
|
125
|
+
}
|
|
119
126
|
}
|
|
120
127
|
}
|
|
121
128
|
|
|
@@ -197,9 +204,26 @@ export class Tabs extends VBox<TabsProps> {
|
|
|
197
204
|
this._list.addItem( item );
|
|
198
205
|
this._stack.addItem( { name: item.name, content: item.content } );
|
|
199
206
|
|
|
200
|
-
if( this.
|
|
207
|
+
if( this._stack.getPageCount( )==1 ) {
|
|
201
208
|
this.selectTab( item.name );
|
|
202
209
|
}
|
|
203
210
|
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
*
|
|
214
|
+
*/
|
|
215
|
+
|
|
216
|
+
removeTab( name: string ) {
|
|
217
|
+
this._list.removeItem( name );
|
|
218
|
+
this._stack.removeItem( name );
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
*
|
|
223
|
+
*/
|
|
224
|
+
|
|
225
|
+
enumTabs( ): string[] {
|
|
226
|
+
return this._stack.enumPageNames( );
|
|
227
|
+
}
|
|
204
228
|
}
|
|
205
229
|
|
|
@@ -21,7 +21,7 @@ import { Label } from '../label/label';
|
|
|
21
21
|
import { VBox } from '../boxes/boxes';
|
|
22
22
|
|
|
23
23
|
import "./textarea.module.scss";
|
|
24
|
-
import { class_ns, IFormElement } from '
|
|
24
|
+
import { class_ns, IFormElement } from '../../core/core_tools';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
|
-
//import { EventCallback } from '
|
|
17
|
+
//import { EventCallback } from '../../core/core_events';
|
|
18
18
|
import { Component, makeUniqueComponentId } from '../../core/component';
|
|
19
19
|
import { class_ns, UnsafeHtml } from '../../core/core_tools';
|
|
20
20
|
|
|
@@ -41,7 +41,7 @@ interface TextEditBase {
|
|
|
41
41
|
inputAttrs?: any;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
type TextEditProps = TextEditInputs & TextEditBase;
|
|
44
|
+
export type TextEditProps = TextEditInputs & TextEditBase;
|
|
45
45
|
|
|
46
46
|
/*
|
|
47
47
|
not enougth precise
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SvgBuilder, SvgComponent } from '../../core/core_svg';
|
|
2
2
|
import { Color } from '../../core/core_colors';
|
|
3
|
-
import { Component, ComponentProps } from '
|
|
3
|
+
import { Component, ComponentProps } from '../../core/component';
|
|
4
4
|
|
|
5
5
|
import "./tickline.module.scss"
|
|
6
6
|
|
|
@@ -18,8 +18,8 @@ import { Component, componentFromDOM, wrapDOM } from '../../core/component';
|
|
|
18
18
|
import { class_ns, ITipHandler, Point, Rect, Timer, UnsafeHtml, unsafeHtml } from '../../core/core_tools';
|
|
19
19
|
|
|
20
20
|
import { HBox } from '../boxes/boxes';
|
|
21
|
-
import { Popup, PopupProps } from '../popup/popup
|
|
22
|
-
import { Icon } from '../icon/icon
|
|
21
|
+
import { Popup, PopupProps } from '../popup/popup';
|
|
22
|
+
import { Icon } from '../icon/icon';
|
|
23
23
|
|
|
24
24
|
import "./tooltips.scss"
|
|
25
25
|
|
|
@@ -161,7 +161,15 @@
|
|
|
161
161
|
#icon {
|
|
162
162
|
color: var( --button-icon-color );
|
|
163
163
|
}
|
|
164
|
-
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&:focus {
|
|
167
|
+
background-color: var( --ol-button-background-hover );
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&:disabled {
|
|
171
|
+
color: var( --disabled-color-dark );
|
|
172
|
+
}
|
|
165
173
|
}
|
|
166
174
|
}
|
|
167
175
|
}
|