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
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
|
-
import { asap, class_ns, isArray, isNumber, isString } from '
|
|
17
|
+
import { asap, class_ns, isArray, isNumber, isString } from '../../core/core_tools';
|
|
18
18
|
import { Component, ComponentContent, ComponentEvents, ComponentProps, EvSelectionChange } from "../../core/component"
|
|
19
19
|
|
|
20
20
|
import "./boxes.module.scss";
|
|
21
|
-
import { EventCallback } from '
|
|
21
|
+
import { EventCallback } from '../../core/core_events';
|
|
22
22
|
|
|
23
23
|
export interface BoxProps extends ComponentProps {
|
|
24
24
|
tag?: string;
|
|
@@ -122,6 +122,18 @@ export class StackBox<P extends StackBoxProps = StackBoxProps, E extends StackeB
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
removeItem( name: string ) {
|
|
126
|
+
const index = this._items.findIndex( x => x.name==name );
|
|
127
|
+
if( index>=0 ) {
|
|
128
|
+
const pg = this._items[index];
|
|
129
|
+
if( pg?.page ) {
|
|
130
|
+
this.removeChild( pg.page );
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
this._items.splice( index, 1 );
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
125
137
|
select( name: string ) {
|
|
126
138
|
let sel = this.query( `:scope > .selected` );
|
|
127
139
|
if( sel ) {
|
|
@@ -143,7 +155,7 @@ export class StackBox<P extends StackBoxProps = StackBoxProps, E extends StackeB
|
|
|
143
155
|
sel.setClass( "selected", true );
|
|
144
156
|
}
|
|
145
157
|
|
|
146
|
-
asap( ( ) => this.fire( "pageChange", { selection: pg.name, empty: !sel } ) );
|
|
158
|
+
asap( ( ) => this.fire( "pageChange", { selection: [pg.name], empty: !sel } ) );
|
|
147
159
|
}
|
|
148
160
|
|
|
149
161
|
return pg?.page;
|
|
@@ -177,6 +189,26 @@ export class StackBox<P extends StackBoxProps = StackBoxProps, E extends StackeB
|
|
|
177
189
|
return pg ? pg.content : null;
|
|
178
190
|
}
|
|
179
191
|
|
|
192
|
+
/**
|
|
193
|
+
*
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
getPageCount( ) {
|
|
197
|
+
return this._items.length;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
*
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
enumPageNames( ) {
|
|
205
|
+
return this._items.map( x => x.name );
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
*
|
|
210
|
+
*/
|
|
211
|
+
|
|
180
212
|
getItem( name: string ) {
|
|
181
213
|
const pg = this._items.find( x => x.name==name );
|
|
182
214
|
return pg;
|
|
@@ -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 { class_ns } from '
|
|
18
|
-
import { parseRoute, Router } from '
|
|
17
|
+
import { class_ns } from '../../core/core_tools';
|
|
18
|
+
import { parseRoute, Router } from '../../core/core_router';
|
|
19
19
|
|
|
20
20
|
import { BoxProps, Button, HBox, Icon } from '../components';
|
|
21
|
-
import { Component, ComponentEvents, EvClick } from '
|
|
22
|
-
import { EventCallback } from '
|
|
21
|
+
import { Component, ComponentEvents, EvClick } from '../../core/component';
|
|
22
|
+
import { EventCallback } from '../../core/core_events';
|
|
23
23
|
|
|
24
24
|
import "./breadcrumb.scss"
|
|
25
25
|
|
|
@@ -20,12 +20,12 @@ import { class_ns, isString } from '../../core/core_tools';
|
|
|
20
20
|
import { _tr } from '../../core/core_i18n'
|
|
21
21
|
|
|
22
22
|
import { Button } from '../button/button';
|
|
23
|
-
import { Box } from '../boxes/boxes
|
|
24
|
-
import { Label } from '../label/label
|
|
25
|
-
import { EvBtnClick } from '../dialog/dialog
|
|
23
|
+
import { Box } from '../boxes/boxes';
|
|
24
|
+
import { Label } from '../label/label';
|
|
25
|
+
import { EvBtnClick } from '../dialog/dialog';
|
|
26
26
|
|
|
27
27
|
import "./btngroup.module.scss"
|
|
28
|
-
import { Input } from '../components
|
|
28
|
+
import { Input } from '../components';
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* accept "ok" or "ok.<classname>"
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
import { Component, ComponentEvents, ComponentProps, EvClick } from "../../core/component"
|
|
18
|
-
import { EventCallback } from '../../core/core_events
|
|
19
|
-
import { class_ns, UnsafeHtml } from '../../core/core_tools
|
|
18
|
+
import { EventCallback } from '../../core/core_events';
|
|
19
|
+
import { class_ns, UnsafeHtml } from '../../core/core_tools';
|
|
20
20
|
|
|
21
21
|
import { Icon } from "../icon/icon"
|
|
22
22
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { Component, ComponentEvents, ComponentProps, EvChange, Flex } from '../../core/component'
|
|
18
18
|
import { class_ns, date_clone, date_hash, formatIntlDate, Point, unsafeHtml } from "../../core/core_tools"
|
|
19
19
|
import { _tr } from '../../core/core_i18n';
|
|
20
|
-
import { EventCallback } from '../../core/core_events
|
|
20
|
+
import { EventCallback } from '../../core/core_events';
|
|
21
21
|
|
|
22
22
|
import { Button } from '../button/button';
|
|
23
23
|
import { Label } from '../label/label';
|
|
@@ -14,10 +14,10 @@
|
|
|
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, ComponentEvent, ComponentEvents, ComponentProps } from '../../core/component';
|
|
19
19
|
import { EventCallback } from "../../core/core_events"
|
|
20
|
-
import { CanvasEx, createPainter } from './canvas_ex
|
|
20
|
+
import { CanvasEx, createPainter } from './canvas_ex';
|
|
21
21
|
|
|
22
22
|
import './canvas.module.scss'
|
|
23
23
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Component, ComponentEvents, ComponentProps, EvChange, makeUniqueComponentId } from '../../core/component
|
|
2
|
-
import { EventCallback } from '../../core/core_events
|
|
1
|
+
import { Component, ComponentEvents, ComponentProps, EvChange, makeUniqueComponentId } from '../../core/component';
|
|
2
|
+
import { EventCallback } from '../../core/core_events';
|
|
3
3
|
|
|
4
4
|
import { Input } from '../input/input';
|
|
5
5
|
import { Label } from '../label/label';
|
|
6
6
|
|
|
7
|
-
import { svgLoader } from '../icon/icon
|
|
7
|
+
import { svgLoader } from '../icon/icon';
|
|
8
8
|
|
|
9
9
|
import "./checkbox.module.scss"
|
|
10
10
|
import icon from "./check.svg";
|
|
11
|
-
import { class_ns } from '
|
|
11
|
+
import { class_ns } from '../../core/core_tools';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Checkbox events
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
import { Component } from '../../core/component';
|
|
18
|
-
import { isFeatureAvailable, class_ns } from '../../core/core_tools
|
|
18
|
+
import { isFeatureAvailable, class_ns } from '../../core/core_tools';
|
|
19
19
|
import { Color } from '../../core/core_colors';
|
|
20
20
|
|
|
21
21
|
import { BoxProps, HBox } from '../boxes/boxes';
|
|
22
|
-
import { Input } from '../input/input
|
|
23
|
-
import { Button } from '../button/button
|
|
22
|
+
import { Input } from '../input/input';
|
|
23
|
+
import { Button } from '../button/button';
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
import "./colorinput.module.scss"
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
--combobox-btn-background: inherit;
|
|
27
27
|
--combobox-btn-color: var( --text-secondary );
|
|
28
28
|
--combobox-btn-color-hover: var( --text-primary );
|
|
29
|
+
|
|
30
|
+
--combo-tree-indent: 1em;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
.x4dropdownlist {
|
|
@@ -33,6 +35,8 @@
|
|
|
33
35
|
@extend .hbox;
|
|
34
36
|
|
|
35
37
|
max-height: 250px;
|
|
38
|
+
max-width: 50vw;
|
|
39
|
+
|
|
36
40
|
position: absolute;
|
|
37
41
|
background-color: var( --dropdown-background );
|
|
38
42
|
border: 1px solid var( --dropdown-border );
|
|
@@ -47,6 +51,15 @@
|
|
|
47
51
|
|
|
48
52
|
.x4item {
|
|
49
53
|
white-space: nowrap;
|
|
54
|
+
|
|
55
|
+
&.level-1 { padding-left: calc(var(--combo-tree-indent) * 1 ); }
|
|
56
|
+
&.level-2 { padding-left: calc(var(--combo-tree-indent) * 2 ); }
|
|
57
|
+
&.level-3 { padding-left: calc(var(--combo-tree-indent) * 3 ); }
|
|
58
|
+
&.level-4 { padding-left: calc(var(--combo-tree-indent) * 4 ); }
|
|
59
|
+
&.level-5 { padding-left: calc(var(--combo-tree-indent) * 5 ); }
|
|
60
|
+
&.level-6 { padding-left: calc(var(--combo-tree-indent) * 6 ); }
|
|
61
|
+
&.level-7 { padding-left: calc(var(--combo-tree-indent) * 7 ); }
|
|
62
|
+
&.level-8 { padding-left: calc(var(--combo-tree-indent) * 8 ); }
|
|
50
63
|
}
|
|
51
64
|
}
|
|
52
65
|
}
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
import { Component, ComponentEvents, ComponentProps, EvSelectionChange, makeUniqueComponentId } from '../../core/component';
|
|
18
|
-
import { class_ns, IComponentInterface, IFormElement, kbNav } from '
|
|
19
|
-
import { EventCallback } from '
|
|
18
|
+
import { class_ns, IComponentInterface, IFormElement, kbNav } from '../../core/core_tools';
|
|
19
|
+
import { EventCallback } from '../../core/core_events';
|
|
20
20
|
|
|
21
21
|
import { Listbox, ListboxID, ListItem } from '../listbox/listbox';
|
|
22
|
-
import { Popup, PopupEvents, PopupProps } from '../popup/popup
|
|
22
|
+
import { Popup, PopupEvents, PopupProps } from '../popup/popup';
|
|
23
23
|
import { Label } from '../label/label';
|
|
24
24
|
import { Input } from '../input/input';
|
|
25
25
|
import { Button } from '../button/button';
|
|
@@ -128,6 +128,9 @@ export class Combobox extends Component<ComboboxProps,ComboboxEvents> {
|
|
|
128
128
|
|
|
129
129
|
const _select = ( sel: ListboxID ) => {
|
|
130
130
|
const itm = list.getItem(sel);
|
|
131
|
+
if( itm ) {
|
|
132
|
+
list.select( sel, false );
|
|
133
|
+
}
|
|
131
134
|
|
|
132
135
|
//TODO: unsafehtml
|
|
133
136
|
//@ts-ignore
|
|
@@ -270,6 +273,10 @@ export class Combobox extends Component<ComboboxProps,ComboboxEvents> {
|
|
|
270
273
|
|
|
271
274
|
return super.queryInterface( name );
|
|
272
275
|
}
|
|
276
|
+
|
|
277
|
+
getInput( ) {
|
|
278
|
+
return this._input;
|
|
279
|
+
}
|
|
273
280
|
}
|
|
274
281
|
|
|
275
282
|
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
import { Form } from "../form/form.js"
|
|
18
|
-
import { PopupEvents, PopupProps, Popup } from '../popup/popup
|
|
18
|
+
import { PopupEvents, PopupProps, Popup } from '../popup/popup';
|
|
19
19
|
import { BtnGroup, BtnGroupItem } from "../btngroup/btngroup"
|
|
20
|
-
import { HBox } from '../boxes/boxes
|
|
21
|
-
import { Label } from '../label/label
|
|
22
|
-
import { CoreEvent, EventCallback } from '
|
|
23
|
-
import { class_ns, getFocusableElements, IComponentInterface, isString, ITabHandler } from '
|
|
24
|
-
import { ComponentEvent } from '../../core/component
|
|
25
|
-
import { Button } from '../button/button
|
|
20
|
+
import { HBox } from '../boxes/boxes';
|
|
21
|
+
import { Label } from '../label/label';
|
|
22
|
+
import { CoreEvent, EventCallback } from '../../core/core_events';
|
|
23
|
+
import { class_ns, getFocusableElements, IComponentInterface, isString, ITabHandler } from '../../core/core_tools';
|
|
24
|
+
import { ComponentEvent } from '../../core/component';
|
|
25
|
+
import { Button } from '../button/button';
|
|
26
26
|
|
|
27
27
|
import "./dialog.module.scss"
|
|
28
28
|
import close_icon from "./xmark-sharp-light.svg";
|
|
@@ -14,13 +14,13 @@
|
|
|
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, IFormElement } from '
|
|
17
|
+
import { class_ns, IFormElement } from '../../core/core_tools';
|
|
18
18
|
import { Box, BoxProps } from '../boxes/boxes';
|
|
19
19
|
|
|
20
20
|
import "./form.module.scss"
|
|
21
21
|
|
|
22
22
|
//type FormValue = string | number | boolean;
|
|
23
|
-
export type FormValues = Record<string,
|
|
23
|
+
export type FormValues = Record<string,any>;
|
|
24
24
|
|
|
25
25
|
export interface FormProps extends BoxProps {
|
|
26
26
|
autoComplete?: boolean;
|
|
@@ -81,8 +81,8 @@ export class Form<P extends FormProps = FormProps> extends Box<P> {
|
|
|
81
81
|
*
|
|
82
82
|
*/
|
|
83
83
|
|
|
84
|
-
getValues( ):
|
|
85
|
-
const result:
|
|
84
|
+
getValues<T extends FormValues = FormValues>( ): T {
|
|
85
|
+
const result: any = {}
|
|
86
86
|
const items = this._get_inputs( );
|
|
87
87
|
|
|
88
88
|
items.forEach( x => {
|
|
@@ -94,7 +94,7 @@ export class Form<P extends FormProps = FormProps> extends Box<P> {
|
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
return result;
|
|
97
|
+
return result as T;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import { Component, ComponentContent, ComponentEvents, ComponentProps, EvClick, EvContextMenu, EvDblClick, EvSelectionChange, componentFromDOM } from '../../core/component';
|
|
19
19
|
import { class_ns, isNumber, isString, setWaitCursor } from '../../core/core_tools';
|
|
20
|
-
import { DataModel, DataStore, DataView, DataRecord,
|
|
20
|
+
import { DataModel, DataStore, DataView, DataRecord, EvViewChange } from '../../core/core_data';
|
|
21
21
|
import { EventCallback } from '../../core/core_events';
|
|
22
22
|
import { kbNav } from '../../core/core_tools';
|
|
23
23
|
|
|
@@ -43,7 +43,7 @@ const SCROLL_LIMIT = 200;
|
|
|
43
43
|
*
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
|
-
interface GridColumn {
|
|
46
|
+
export interface GridColumn {
|
|
47
47
|
id: any;
|
|
48
48
|
title: string;
|
|
49
49
|
width: number;
|
|
@@ -499,14 +499,15 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
|
|
|
499
499
|
|
|
500
500
|
private _sortCol(col: number, ascending?: boolean ) {
|
|
501
501
|
|
|
502
|
-
setWaitCursor(true);
|
|
503
|
-
|
|
504
502
|
// to allow cursor
|
|
505
503
|
this.setTimeout("sort", 50, () => {
|
|
506
504
|
let asc = true;
|
|
507
505
|
|
|
508
506
|
// already sorted ?
|
|
509
|
-
const scol = this.query(`.col-header [data-col="${col}"`);
|
|
507
|
+
const scol = this.query(`.col-header .cell[data-col="${col}"]`);
|
|
508
|
+
if( !scol ) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
510
511
|
|
|
511
512
|
if( ascending===undefined ) {
|
|
512
513
|
if (scol.hasClass("sorted")) {
|
|
@@ -541,6 +542,8 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
|
|
|
541
542
|
}
|
|
542
543
|
}
|
|
543
544
|
|
|
545
|
+
setWaitCursor(true);
|
|
546
|
+
|
|
544
547
|
this._dataview.sort([{
|
|
545
548
|
field: cdata.id,
|
|
546
549
|
ascending: asc,
|
|
@@ -828,7 +831,7 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
|
|
|
828
831
|
}
|
|
829
832
|
}
|
|
830
833
|
|
|
831
|
-
const maxr = this._dataview.getCount();
|
|
834
|
+
const maxr = this._dataview ? this._dataview.getCount() : 0;
|
|
832
835
|
let maxh = maxr;
|
|
833
836
|
|
|
834
837
|
if (maxr < SCROLL_LIMIT) {
|
|
@@ -874,7 +877,7 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
|
|
|
874
877
|
|
|
875
878
|
// WHEEL
|
|
876
879
|
this.addDOMEvent("wheel", (ev: WheelEvent) => {
|
|
877
|
-
if (ev.deltaY && this._dataview.getCount() >= SCROLL_LIMIT) {
|
|
880
|
+
if (ev.deltaY && this._dataview && this._dataview.getCount() >= SCROLL_LIMIT) {
|
|
878
881
|
this._viewport.dom.scrollBy(0, ev.deltaY < 0 ? -1 : 1);
|
|
879
882
|
ev.stopPropagation();
|
|
880
883
|
ev.preventDefault();
|
|
@@ -1032,7 +1035,7 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
|
|
|
1032
1035
|
const rc = this.getBoundingRect();
|
|
1033
1036
|
|
|
1034
1037
|
// rows
|
|
1035
|
-
const rowc = this._dataview.getCount();
|
|
1038
|
+
const rowc = this._dataview ? this._dataview.getCount() : 0;
|
|
1036
1039
|
const mul = rowc < SCROLL_LIMIT ? this._row_height : 1;
|
|
1037
1040
|
|
|
1038
1041
|
const start = Math.floor(this._top / mul);
|
|
@@ -1132,7 +1135,7 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
|
|
|
1132
1135
|
});
|
|
1133
1136
|
|
|
1134
1137
|
const rec = this._dataview.getByIndex( rowid );
|
|
1135
|
-
this.fire("selectionChange", { selection: rec, empty: false } );
|
|
1138
|
+
this.fire("selectionChange", { selection: [rec], empty: false } );
|
|
1136
1139
|
}
|
|
1137
1140
|
|
|
1138
1141
|
/**
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
:root {
|
|
4
4
|
--header-background-hover: rgba(100,100,100,0.1);
|
|
5
5
|
--header-sizer-hover: var( --border-hover );
|
|
6
|
+
--header-color: var( --text-primary );
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
.x4header {
|
|
9
|
-
@extend .flex;
|
|
10
10
|
width: 100%;
|
|
11
11
|
|
|
12
12
|
overflow: hidden;
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
white-space: nowrap;
|
|
27
27
|
text-overflow: ellipsis;
|
|
28
28
|
overflow: hidden;
|
|
29
|
+
color: var( --header-color );
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
&:hover {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { class_ns } from '
|
|
2
|
-
import { Component, ComponentProps } from '../../core/component
|
|
3
|
-
import { HBox } from '../boxes/boxes
|
|
4
|
-
import { Label } from '../label/label
|
|
5
|
-
import { CSizer } from '../sizers/sizer
|
|
1
|
+
import { class_ns } from '../../core/core_tools';
|
|
2
|
+
import { Component, ComponentProps } from '../../core/component';
|
|
3
|
+
import { HBox } from '../boxes/boxes';
|
|
4
|
+
import { Label } from '../label/label';
|
|
5
|
+
import { CSizer } from '../sizers/sizer';
|
|
6
6
|
|
|
7
7
|
import "./header.module.scss"
|
|
8
8
|
|
|
@@ -15,10 +15,18 @@ interface HeaderItem {
|
|
|
15
15
|
|
|
16
16
|
interface HeaderProps extends Omit<ComponentProps,"content"> {
|
|
17
17
|
items: HeaderItem[]
|
|
18
|
+
target?: Component; // target element to set header col variable width var( --hdr-item-{name}-width )
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
/**
|
|
22
|
+
* by default when a header item is resized, the 'target' style '--{name}-width' is updated
|
|
23
|
+
* if you listbox has a header and 3 cols named A, B, C then in your css, use
|
|
21
24
|
*
|
|
25
|
+
* .my-listbox {
|
|
26
|
+
* --A-width: 10px;
|
|
27
|
+
* --B-width: 50px;
|
|
28
|
+
* --C-width: 100px;
|
|
29
|
+
* }
|
|
22
30
|
*/
|
|
23
31
|
|
|
24
32
|
@class_ns( "x4" )
|
|
@@ -94,13 +102,13 @@ export class Header extends HBox<HeaderProps> {
|
|
|
94
102
|
|
|
95
103
|
const rc = this.getBoundingRect( );
|
|
96
104
|
|
|
97
|
-
let
|
|
105
|
+
let rest = (rc.width-filled-10);
|
|
98
106
|
const unit = Math.ceil( rest/count );
|
|
99
107
|
|
|
100
|
-
console.log( "filled", filled );
|
|
101
|
-
console.log( "count", count );
|
|
102
|
-
console.log( "rest", rest );
|
|
103
|
-
console.log( "unit", unit );
|
|
108
|
+
//console.log( "filled", filled );
|
|
109
|
+
//console.log( "count", count );
|
|
110
|
+
//console.log( "rest", rest );
|
|
111
|
+
//console.log( "unit", unit );
|
|
104
112
|
|
|
105
113
|
let fullw = 0;
|
|
106
114
|
this._els.forEach( c => {
|
|
@@ -116,6 +124,10 @@ export class Header extends HBox<HeaderProps> {
|
|
|
116
124
|
}
|
|
117
125
|
|
|
118
126
|
c.setWidth( width );
|
|
127
|
+
|
|
128
|
+
const item = c.getInternalData<HeaderItem>( 'data' );
|
|
129
|
+
this.props.target?.setStyleVariable( `--${item.name}-width`, width + "px");
|
|
130
|
+
|
|
119
131
|
fullw += width;
|
|
120
132
|
} );
|
|
121
133
|
|
|
@@ -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 "./icon.module.scss"
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
import { class_ns } from '../../core/core_tools';
|
|
18
18
|
import { Component, ComponentEvents, ComponentProps } from '../../core/component';
|
|
19
|
-
import { EventCallback, CoreEvent } from '../../core/core_events
|
|
20
|
-
import { dragManager } from '../../core/core_dragdrop
|
|
19
|
+
import { EventCallback, CoreEvent } from '../../core/core_events';
|
|
20
|
+
import { dragManager } from '../../core/core_dragdrop';
|
|
21
21
|
|
|
22
22
|
import { EvDropChange, FileDialog } from '../filedrop/filedrop';
|
|
23
23
|
import { Menu } from '../menu/menu';
|
|
@@ -25,7 +25,7 @@ import { Menu } from '../menu/menu';
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
import "./image.module.scss"
|
|
28
|
-
import { _tr } from '
|
|
28
|
+
import { _tr } from '../../core/core_i18n';
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
interface ImageEvents extends ComponentEvents {
|
|
@@ -14,9 +14,9 @@
|
|
|
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, ComponentEvent, ComponentProps, EvChange, EvFocus } from '../../core/component';
|
|
19
|
-
import { class_ns, formatIntlDate, IComponentInterface, IFormElement, isString } from '../../core/core_tools
|
|
19
|
+
import { class_ns, formatIntlDate, IComponentInterface, IFormElement, isString } from '../../core/core_tools';
|
|
20
20
|
|
|
21
21
|
import "./input.module.scss"
|
|
22
22
|
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
|
-
import { Component, ComponentProps, Flex } from '
|
|
18
|
-
import { Box, BoxProps, Button, HBox, VBox } from '../components
|
|
19
|
-
import { _tr } from '
|
|
17
|
+
import { Component, ComponentProps, Flex } from '../../core/component';
|
|
18
|
+
import { Box, BoxProps, Button, HBox, VBox } from '../components';
|
|
19
|
+
import { _tr } from '../../core/core_i18n';
|
|
20
20
|
|
|
21
21
|
import "./keyboard.module.scss"
|
|
22
|
-
import { class_ns } from '
|
|
23
|
-
import { Application } from '
|
|
22
|
+
import { class_ns } from '../../core/core_tools';
|
|
23
|
+
import { Application } from '../../core/core_application';
|
|
24
24
|
|
|
25
25
|
import icon_bksp from "./delete-left.svg";
|
|
26
26
|
import icon_shift from "./arrow-up.svg";
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
--label-background: transparent;
|
|
21
21
|
--label-color: var( --text-ternary );
|
|
22
22
|
--label-icon-color: rgb(0 0 0 / 44%);
|
|
23
|
+
--label-color-disa: var( --disabled-color-dark );
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
.x4label {
|
|
@@ -66,11 +67,15 @@
|
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
|
|
70
70
|
.x4simpletext {
|
|
71
71
|
text-align: left;
|
|
72
72
|
&.al-center { text-align: center; }
|
|
73
73
|
&.al-right { text-align: right; }
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
[disabled] .x4label,
|
|
77
|
+
[disabled] .x4simpletext {
|
|
78
|
+
color: var(--label-color-disa);
|
|
79
|
+
}
|
|
80
|
+
|
|
76
81
|
|
|
@@ -18,7 +18,7 @@ import { Component, ComponentProps } from "../../core/component"
|
|
|
18
18
|
import { Icon } from "../icon/icon"
|
|
19
19
|
|
|
20
20
|
import "./label.module.scss";
|
|
21
|
-
import { class_ns, UnsafeHtml } from '../../core/core_tools
|
|
21
|
+
import { class_ns, UnsafeHtml } from '../../core/core_tools';
|
|
22
22
|
|
|
23
23
|
export interface LabelProps extends ComponentProps {
|
|
24
24
|
text?: string | UnsafeHtml;
|