x4js 2.2.47 → 2.2.50
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 +4 -3
- package/package.json +3 -2
- package/src/components/boxes/boxes.module.scss +1 -0
- package/src/components/breadcrumb/breadcrumb.ts +7 -0
- package/src/components/btngroup/btngroup.module.scss +1 -1
- package/src/components/button/button.ts +15 -5
- package/src/components/calendar/calendar.ts +19 -1
- package/src/components/checkbox/checkbox.ts +11 -0
- package/src/components/colorinput/colorinput.ts +6 -1
- package/src/components/colorpicker/colorpicker.ts +2 -2
- package/src/components/combobox/combobox.ts +14 -0
- package/src/components/dialog/dialog.ts +6 -2
- package/src/components/filedrop/filedrop.ts +10 -0
- package/src/components/form/form.ts +4 -1
- package/src/components/gauge/gauge.ts +9 -0
- package/src/components/gridview/gridview.ts +28 -1
- package/src/components/header/header.ts +6 -6
- package/src/components/image/image.ts +5 -0
- package/src/components/input/input.module.scss +5 -0
- package/src/components/input/input.ts +9 -0
- package/src/components/keyboard/keyboard.ts +8 -0
- package/src/components/label/label.ts +7 -1
- package/src/components/link/link.ts +4 -0
- package/src/components/listbox/listbox.ts +22 -9
- package/src/components/menu/menu.ts +10 -1
- package/src/components/messages/messages.ts +6 -0
- package/src/components/notification/notification.ts +13 -0
- package/src/components/panel/panel.ts +5 -1
- package/src/components/popup/popup.module.scss +1 -0
- package/src/components/popup/popup.ts +60 -34
- package/src/components/progress/progress.ts +8 -0
- package/src/components/propgrid/progrid.module.scss +11 -5
- package/src/components/propgrid/propgrid.ts +36 -16
- package/src/components/rating/rating.ts +6 -0
- package/src/components/select/select.ts +1 -0
- package/src/components/sizers/sizer.ts +23 -8
- package/src/components/slider/slider.ts +7 -0
- package/src/components/spreadsheet/spreadsheet.ts +28 -1
- package/src/components/switch/switch.ts +7 -0
- package/src/components/tabs/tabs.ts +6 -0
- package/src/components/tag/tag.ts +11 -0
- package/src/components/textarea/textarea.ts +6 -0
- package/src/components/textedit/textedit.ts +10 -0
- package/src/components/tickline/tickline.ts +9 -0
- package/src/components/tooltips/tooltips.ts +12 -2
- package/src/components/treeview/treeview.ts +14 -0
- package/src/components/viewport/viewport.ts +8 -0
- package/src/core/component.ts +44 -43
- package/src/core/core_application.ts +16 -4
- package/src/core/core_data.ts +1 -4
- package/src/core/core_dom.ts +49 -31
- package/src/core/core_element.ts +141 -39
- package/src/core/core_pdf.ts +1 -0
- package/src/core/core_svg.ts +2 -2
- package/src/core/core_tools.ts +1 -5
- package/src/x4doc.ts +23 -0
package/README.md
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
**A TypeScript framework for people who build applications, not markup.**
|
|
3
3
|
|
|
4
4
|
## Home page
|
|
5
|
-
see [home](https://x4js.org)
|
|
5
|
+
see [X4 home page](https://x4js.org)
|
|
6
6
|
|
|
7
7
|
## API Documentation
|
|
8
|
-
see [
|
|
9
|
-
|
|
8
|
+
see [GitHib](https://rlibre.github.io/x4/index.html)
|
|
9
|
+
|
|
10
|
+
see [AI context](./aicontext.md)
|
|
10
11
|
|
|
11
12
|
---
|
|
12
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x4js",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.50",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/x4.ts",
|
|
6
6
|
"module": "src/x4.ts",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"typescript": "^5.8.3",
|
|
37
37
|
"typedoc": "^0.28.19",
|
|
38
|
-
"typedoc-plugin-markdown": "
|
|
38
|
+
"typedoc-plugin-markdown": "latest",
|
|
39
|
+
"typedoc-plugin-missing-exports": "latest"
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -24,6 +24,7 @@ import { Icon } from "../icon/icon"
|
|
|
24
24
|
import "./button.module.scss";
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
|
|
27
28
|
/**
|
|
28
29
|
* Button events
|
|
29
30
|
*/
|
|
@@ -76,13 +77,22 @@ export interface ButtonProps extends ComponentProps {
|
|
|
76
77
|
/**
|
|
77
78
|
* Represents a clickable button component.
|
|
78
79
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
80
|
+
* @cssvar
|
|
81
|
+
* ```
|
|
82
|
+
* --button-background
|
|
83
|
+
* --button-color
|
|
84
|
+
* --button-background-hover
|
|
85
|
+
* --button-color-hover
|
|
86
|
+
* --button-background-active
|
|
87
|
+
* --button-color-active
|
|
88
|
+
* --button-background-focus
|
|
89
|
+
* --button-color-focus
|
|
90
|
+
* --button-background-disabled
|
|
91
|
+
* --button-color-disabled
|
|
92
|
+
* --button-icon-color
|
|
93
|
+
* ```
|
|
83
94
|
*/
|
|
84
95
|
|
|
85
|
-
|
|
86
96
|
@class_ns( "x4" )
|
|
87
97
|
export class Button extends Component<ButtonProps,ButtonEvents> {
|
|
88
98
|
|
|
@@ -48,7 +48,25 @@ interface CalendarProps extends ComponentProps {
|
|
|
48
48
|
* default calendar control
|
|
49
49
|
*
|
|
50
50
|
* fires:
|
|
51
|
-
*
|
|
51
|
+
* EventChange ( value = Date )
|
|
52
|
+
*
|
|
53
|
+
* @cssvar
|
|
54
|
+
* ```
|
|
55
|
+
* --calendar-btn-background
|
|
56
|
+
* --calendar-btn-color
|
|
57
|
+
* --calendar-btn-color
|
|
58
|
+
* --calendar-week-color
|
|
59
|
+
* --calendar-week-color-hover
|
|
60
|
+
* --calendard-day-background-hover
|
|
61
|
+
* --calendard-day-color-hover
|
|
62
|
+
* --calendar-sel-background
|
|
63
|
+
* --calendar-sel-color
|
|
64
|
+
* --calendar-today-background
|
|
65
|
+
* --calendar-today-color
|
|
66
|
+
* --calendar-today-border
|
|
67
|
+
* --calendar-header-color
|
|
68
|
+
* --calendar-out-color
|
|
69
|
+
* ```
|
|
52
70
|
*/
|
|
53
71
|
|
|
54
72
|
@class_ns( "x4" )
|
|
@@ -31,6 +31,17 @@ interface CheckboxProps extends ComponentProps {
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Checkbox component that can be checked or unchecked.
|
|
34
|
+
*
|
|
35
|
+
* @cssvar
|
|
36
|
+
* ```
|
|
37
|
+
* --checkbox-background-check
|
|
38
|
+
* --checkbox-background-check-hover
|
|
39
|
+
* --checkbox-background-disabled
|
|
40
|
+
* --checkbox-background-disabled-check
|
|
41
|
+
* --checkbox-color-disabled
|
|
42
|
+
* --checkbox-check-border
|
|
43
|
+
* --checkbox-check-border-hover
|
|
44
|
+
* ```
|
|
34
45
|
*/
|
|
35
46
|
|
|
36
47
|
@class_ns( "x4" )
|
|
@@ -163,7 +163,7 @@ export class Saturation extends Box<BoxProps,CommonEvents> {
|
|
|
163
163
|
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
|
-
*
|
|
166
|
+
* @internal
|
|
167
167
|
*/
|
|
168
168
|
|
|
169
169
|
@class_ns( "x4" )
|
|
@@ -240,7 +240,7 @@ class HueSlider extends Box<BoxProps,CommonEvents> {
|
|
|
240
240
|
|
|
241
241
|
|
|
242
242
|
/**
|
|
243
|
-
*
|
|
243
|
+
* @internal
|
|
244
244
|
*/
|
|
245
245
|
|
|
246
246
|
@class_ns( "x4" )
|
|
@@ -87,6 +87,20 @@ interface ComboboxProps extends Omit<ComponentProps,"content"> {
|
|
|
87
87
|
selectionChange?: EventCallback<EvSelectionChange>,
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
/**
|
|
91
|
+
* @cssvar
|
|
92
|
+
* ```
|
|
93
|
+
* --dropdown-border
|
|
94
|
+
* --dropdown-background
|
|
95
|
+
* --combobox-border
|
|
96
|
+
* --combobox-border-focus
|
|
97
|
+
* --combobox-btn-background
|
|
98
|
+
* --combobox-btn-color
|
|
99
|
+
* --combobox-btn-color-hover
|
|
100
|
+
* --combo-tree-indent
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
|
|
90
104
|
@class_ns( "x4" )
|
|
91
105
|
export class Combobox extends Component<ComboboxProps,ComboboxEvents> {
|
|
92
106
|
|
|
@@ -50,7 +50,11 @@ interface DialogEvents extends PopupEvents {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* @cssvar
|
|
54
|
+
* ```
|
|
55
|
+
* --color-dialog-caption
|
|
56
|
+
* --color-dialog-caption-text
|
|
57
|
+
* ```
|
|
54
58
|
*/
|
|
55
59
|
|
|
56
60
|
@class_ns("x4")
|
|
@@ -85,7 +89,7 @@ export class Dialog<P extends DialogProps = DialogProps, E extends DialogEvents
|
|
|
85
89
|
this.fire("btnclick", { button: props.closable } );
|
|
86
90
|
}
|
|
87
91
|
else {
|
|
88
|
-
this.
|
|
92
|
+
this.fire("btnclick", { button: props.buttons[0] } );
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
}) : null,
|
|
@@ -36,6 +36,16 @@ interface FileDialogProps extends ComponentProps {
|
|
|
36
36
|
callback: LoadCallback;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* @cssvar
|
|
41
|
+
* ```
|
|
42
|
+
* --filedrop-border
|
|
43
|
+
* --filedrop-icon-color
|
|
44
|
+
* --filedrop-border-drop-hover
|
|
45
|
+
* --filedrop-icon-color-hover
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
|
|
39
49
|
export class FileDialog extends Component {
|
|
40
50
|
|
|
41
51
|
constructor( props: FileDialogProps ) {
|
|
@@ -40,6 +40,15 @@ export const simpleColorStop = [
|
|
|
40
40
|
'var(--gauge-base-color)'
|
|
41
41
|
]
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* @cssvar
|
|
45
|
+
* ```
|
|
46
|
+
* --gauge-base-color
|
|
47
|
+
* --gauge-needle-back
|
|
48
|
+
* --gauge-needle-dot
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
|
|
43
52
|
@class_ns( "x4" )
|
|
44
53
|
export class Gauge extends Component<GaugeProps> {
|
|
45
54
|
|
|
@@ -95,7 +95,34 @@ export interface GridviewProps extends ComponentProps {
|
|
|
95
95
|
*/
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* @cssvar
|
|
99
|
+
* ```
|
|
100
|
+
* --gridview-background
|
|
101
|
+
* --gridview-border
|
|
102
|
+
* --gridview-header-cell-background
|
|
103
|
+
* --gridview-header-cell-color
|
|
104
|
+
* --gridview-header-cell-vline
|
|
105
|
+
* --gridview-header-cell-border
|
|
106
|
+
* --grid-check-background
|
|
107
|
+
* --grid-check-color
|
|
108
|
+
* --grid-check-background-hover
|
|
109
|
+
* --grid-check-color-hover
|
|
110
|
+
* --grid-perc-background
|
|
111
|
+
* --grid-perc-color
|
|
112
|
+
* --grid-perc-background-hover
|
|
113
|
+
* --grid-perc-color-hover
|
|
114
|
+
* --gridview-cell-color
|
|
115
|
+
* --gridview-cell-color-sel
|
|
116
|
+
* --gridview-cell-vline
|
|
117
|
+
* --gridview-row-background
|
|
118
|
+
* --gridview-row-odd-background
|
|
119
|
+
* --gridview-row-border
|
|
120
|
+
* --gridview-row-background-hover
|
|
121
|
+
* --gridview-row-background-hover-sel
|
|
122
|
+
* --gridview-row-background-sel
|
|
123
|
+
* --gridview-row-color-sel
|
|
124
|
+
* --gridview-fix-border
|
|
125
|
+
* ```
|
|
99
126
|
*/
|
|
100
127
|
|
|
101
128
|
@class_ns("x4")
|
|
@@ -20,13 +20,13 @@ interface HeaderProps extends Omit<ComponentProps,"content"> {
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
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
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* @cssvar
|
|
25
|
+
* ```
|
|
26
|
+
* --header-background-hover
|
|
27
|
+
* --header-sizer-hover
|
|
28
|
+
* --header-color
|
|
29
|
+
* ```
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
@class_ns( "x4" )
|
|
@@ -32,6 +32,7 @@ interface ImageEvents extends ComponentEvents {
|
|
|
32
32
|
change: EvDropChange;
|
|
33
33
|
clear: CoreEvent;
|
|
34
34
|
}
|
|
35
|
+
|
|
35
36
|
export interface ImageProps extends ComponentProps {
|
|
36
37
|
src: string;
|
|
37
38
|
fit?: "contain" | "cover" | "fill" | "scale-down";
|
|
@@ -49,6 +50,10 @@ export interface ImageProps extends ComponentProps {
|
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
*
|
|
53
|
+
* @cssvar
|
|
54
|
+
* ```
|
|
55
|
+
* --image-border-drop-hover
|
|
56
|
+
* ```
|
|
52
57
|
*/
|
|
53
58
|
|
|
54
59
|
@class_ns( "x4" )
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
:root {
|
|
18
|
+
--input-background: rgba(255, 255, 255, 0.6);
|
|
19
|
+
--input-color: black;
|
|
20
|
+
|
|
18
21
|
--input-sel-background: var( --accent-background );
|
|
19
22
|
--input-sel-color: var( --accent-color );
|
|
20
23
|
--input-placeholder: var( --disabled-background );
|
|
@@ -28,6 +31,8 @@ input.x4input {
|
|
|
28
31
|
outline: none;
|
|
29
32
|
|
|
30
33
|
border: none;
|
|
34
|
+
background-color: var( --input-background );
|
|
35
|
+
color: var( --input-color );
|
|
31
36
|
|
|
32
37
|
&::selection {
|
|
33
38
|
background-color: var( --input-sel-background );
|
|
@@ -198,6 +198,15 @@ interface InputEvents extends ComponentEvent {
|
|
|
198
198
|
* change: (e) => console.log("Checked:", e.value)
|
|
199
199
|
* });
|
|
200
200
|
* ```
|
|
201
|
+
*
|
|
202
|
+
* @cssvar
|
|
203
|
+
* ```
|
|
204
|
+
* --input-sel-background
|
|
205
|
+
* --input-sel-color
|
|
206
|
+
* --input-placeholder
|
|
207
|
+
* --input-error
|
|
208
|
+
* --input-checkbox-color
|
|
209
|
+
* ```
|
|
201
210
|
*/
|
|
202
211
|
|
|
203
212
|
@class_ns( "x4" )
|
|
@@ -99,6 +99,14 @@ interface KeyboardProps extends BoxProps {
|
|
|
99
99
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* @cssvar
|
|
104
|
+
* ```
|
|
105
|
+
* --keyboard-key-background
|
|
106
|
+
* --keyboard-hilite-color
|
|
107
|
+
* --keyboard-zoom
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
102
110
|
@class_ns( "x4" )
|
|
103
111
|
export class Keyboard extends HBox<KeyboardProps>
|
|
104
112
|
{
|
|
@@ -75,7 +75,20 @@ export interface ListboxProps extends Omit<ComponentProps,'content'> {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* @cssvar
|
|
79
|
+
* ```
|
|
80
|
+
* --listbox-item-color
|
|
81
|
+
* --listbox-icon-color
|
|
82
|
+
* --listbox-item-color-disabled
|
|
83
|
+
* --listbox-item-color-sel
|
|
84
|
+
* --listbox-item-background-sel
|
|
85
|
+
* --listbox-item-color-sel-disabled
|
|
86
|
+
* --listbox-item-color-hover
|
|
87
|
+
* --listbox-item-background-hover
|
|
88
|
+
* --listbox-background
|
|
89
|
+
* --listbox-border
|
|
90
|
+
* --listbox-border-focus
|
|
91
|
+
* ```
|
|
79
92
|
*/
|
|
80
93
|
|
|
81
94
|
@class_ns( "x4" )
|
|
@@ -485,30 +498,30 @@ export class Listbox extends Component<ListboxProps,ListboxEvents> {
|
|
|
485
498
|
|
|
486
499
|
defaultRenderer( item: ListItem ): Component {
|
|
487
500
|
|
|
488
|
-
const mk_col = (
|
|
489
|
-
const c = item.sub_cols[index];
|
|
501
|
+
const mk_col = ( c: any, index: number ) => {
|
|
490
502
|
if( c===undefined || c===null ) {
|
|
491
503
|
return null;
|
|
492
504
|
}
|
|
493
505
|
|
|
494
506
|
if( c instanceof Component ) {
|
|
507
|
+
c.addClass( "column" );
|
|
495
508
|
return c;
|
|
496
509
|
}
|
|
497
510
|
|
|
498
511
|
return new SimpleText( { cls: `column ref-c${index+2}`, text: c } )
|
|
499
512
|
}
|
|
500
513
|
|
|
501
|
-
|
|
514
|
+
const content = [
|
|
515
|
+
new Label( { cls: `column ref-c1`, icon: item.iconId, text: item.text } ),
|
|
516
|
+
];
|
|
517
|
+
|
|
502
518
|
if( item.sub_cols ) {
|
|
503
|
-
|
|
519
|
+
content.push( ...(item.sub_cols.map( mk_col )) );
|
|
504
520
|
}
|
|
505
521
|
|
|
506
522
|
return new HBox( {
|
|
507
523
|
cls: item.cls,
|
|
508
|
-
content
|
|
509
|
-
new Label( { cls: `column ref-c1`, icon: item.iconId, text: item.text } ),
|
|
510
|
-
...cols,
|
|
511
|
-
],
|
|
524
|
+
content
|
|
512
525
|
} )
|
|
513
526
|
}
|
|
514
527
|
|
|
@@ -47,7 +47,16 @@ export interface MenuProps extends Omit<PopupProps,"content"> {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* @cssvar
|
|
51
|
+
* ```
|
|
52
|
+
* --menu-background
|
|
53
|
+
* --menu-border
|
|
54
|
+
* --menuitem-color
|
|
55
|
+
* --menuitem-background-active
|
|
56
|
+
* --menuitem-color-active
|
|
57
|
+
* --menuitem-background-hover
|
|
58
|
+
* --menuitem-color-hover
|
|
59
|
+
* ```
|
|
51
60
|
*/
|
|
52
61
|
|
|
53
62
|
@class_ns( "x4" )
|
|
@@ -43,6 +43,19 @@ interface NotificationProps extends ComponentProps {
|
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
*
|
|
46
|
+
* @example:
|
|
47
|
+
* const not = new Notification( { title: "Yooo", text: "You win !", mode: "danger" })
|
|
48
|
+
* not.display( 3000 )
|
|
49
|
+
*
|
|
50
|
+
*
|
|
51
|
+
* @cssvar
|
|
52
|
+
* ```
|
|
53
|
+
* --notification-border
|
|
54
|
+
* --notification-background
|
|
55
|
+
* --notification-icon-default
|
|
56
|
+
* --notification-icon-success
|
|
57
|
+
* --notification-icon-danger
|
|
58
|
+
* ```
|
|
46
59
|
*/
|
|
47
60
|
|
|
48
61
|
@class_ns( "x4" )
|