x4js 2.0.26 → 2.0.30
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/.vscode/launch.json +14 -0
- package/.vscode/settings.json +2 -0
- package/ai-comments.txt +97 -0
- package/demo/assets/house-light.svg +1 -0
- package/demo/assets/radio.svg +4 -0
- package/demo/index.html +12 -0
- package/demo/main.scss +23 -0
- package/demo/main.ts +324 -0
- package/demo/package.json +26 -0
- package/demo/scss.d.ts +4 -0
- package/demo/svg.d.ts +1 -0
- package/demo/tsconfig.json +14 -0
- package/lib/types/x4js.d.ts +0 -2374
- package/package.json +23 -47
- package/prepack.mjs +3 -0
- package/scripts/prepack.mjs +342 -0
- package/src/colors.scss +246 -0
- package/src/components/boxes/boxes.module.scss +1 -1
- package/src/components/boxes/boxes.ts +139 -28
- package/src/components/button/button.ts +80 -33
- package/src/components/combobox/combobox.ts +1 -1
- package/src/components/dialog/dialog.ts +4 -0
- package/src/components/gauge/gauge.module.scss +3 -0
- package/src/components/gauge/gauge.ts +1 -1
- package/src/components/gridview/gridview.ts +106 -8
- package/src/components/icon/icon.ts +42 -14
- package/src/components/input/input.ts +155 -76
- package/src/components/keyboard/keyboard.module.scss +1 -1
- package/src/components/keyboard/keyboard.ts +31 -9
- package/src/components/label/label.module.scss +9 -0
- package/src/components/label/label.ts +10 -6
- package/src/components/link/link.module.scss +44 -0
- package/src/components/link/link.ts +7 -1
- package/src/components/listbox/listbox.module.scss +18 -4
- package/src/components/listbox/listbox.ts +34 -15
- package/src/components/menu/menu.module.scss +14 -2
- package/src/components/menu/menu.ts +1 -1
- package/src/components/messages/messages.ts +13 -5
- package/src/components/panel/panel.module.scss +7 -0
- package/src/components/popup/popup.ts +14 -10
- package/src/components/propgrid/propgrid.ts +13 -3
- package/src/components/shared.scss +4 -0
- package/src/components/spreadsheet/spreadsheet.module.scss +308 -0
- package/src/components/spreadsheet/spreadsheet.ts +1223 -0
- package/src/components/tabs/tabs.module.scss +1 -0
- package/src/components/textarea/textarea.ts +8 -2
- package/src/components/textedit/textedit.ts +7 -0
- package/src/components/themes.scss +2 -0
- package/src/components/tooltips/tooltips.ts +15 -3
- package/src/core/component.ts +358 -162
- package/src/core/core_application.ts +129 -32
- package/src/core/core_colors.ts +382 -119
- package/src/core/core_data.ts +73 -86
- package/src/core/core_dom.ts +10 -0
- package/src/core/core_dragdrop.ts +32 -7
- package/src/core/core_element.ts +111 -4
- package/src/core/core_events.ts +48 -11
- package/src/core/core_i18n.ts +2 -0
- package/src/core/core_pdf.ts +454 -0
- package/src/core/core_router.ts +64 -5
- package/src/core/core_state.ts +1 -0
- package/src/core/core_styles.ts +11 -12
- package/src/core/core_svg.ts +348 -51
- package/src/core/core_tools.ts +105 -17
- package/src/x4.ts +1 -0
- package/src/x4tsx.d.ts +2 -1
- package/tsconfig.json +11 -0
- package/lib/README.txt +0 -20
- package/lib/cjs/x4.css +0 -1
- package/lib/cjs/x4.js +0 -2
- package/lib/esm/x4.css +0 -1
- package/lib/esm/x4.mjs +0 -2
- package/lib/styles/x4.css +0 -1
|
@@ -32,6 +32,7 @@ interface TextAreaProps extends BaseProps {
|
|
|
32
32
|
value?: string;
|
|
33
33
|
resize?: boolean;
|
|
34
34
|
readonly?: boolean;
|
|
35
|
+
trim?: boolean;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
|
|
@@ -39,7 +40,7 @@ interface TextAreaProps extends BaseProps {
|
|
|
39
40
|
*
|
|
40
41
|
*/
|
|
41
42
|
|
|
42
|
-
class SimpleTextArea extends Component {
|
|
43
|
+
class SimpleTextArea extends Component<TextAreaProps> {
|
|
43
44
|
|
|
44
45
|
constructor( props: TextAreaProps ) {
|
|
45
46
|
super( { ...props, tag: "textarea" } );
|
|
@@ -61,7 +62,12 @@ class SimpleTextArea extends Component {
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
getText( ) {
|
|
64
|
-
|
|
65
|
+
let text = (this.dom as HTMLTextAreaElement).value;
|
|
66
|
+
if( this.props.trim!==false ) {
|
|
67
|
+
text = text.trim();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return text;
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
queryInterface<T>(name: string): T {
|
|
@@ -88,7 +88,14 @@ export class TextEdit extends HBox {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
const gadgets = props.inputGadgets ?? [];
|
|
91
|
+
gadgets.forEach( g => {
|
|
92
|
+
g.addClass( "gadget" );
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
|
|
91
96
|
const iprops: InputProps = { ...props, id: props.inputId, attrs: props.inputAttrs, width: props.inputWidth };
|
|
97
|
+
// no propagation...
|
|
98
|
+
delete iprops.cls;
|
|
92
99
|
|
|
93
100
|
this.setContent( [
|
|
94
101
|
props.label ? new HBox( { id: "label", width: props.labelWidth, content: [
|
|
@@ -33,6 +33,7 @@ $color--interval: 8.4%;
|
|
|
33
33
|
--color-primary-a90: #{darken($color--base, $color--interval * 4)};
|
|
34
34
|
--color-primary-a100: #000000;
|
|
35
35
|
|
|
36
|
+
--color-danger-a30: #{lighten(#c01010,30%)};
|
|
36
37
|
--color-danger-a50: #c01010;
|
|
37
38
|
--color-danger-a60: #{darken(#c01010,10%)};
|
|
38
39
|
|
|
@@ -46,6 +47,7 @@ $color--interval: 8.4%;
|
|
|
46
47
|
// Backgrounds
|
|
47
48
|
--background-primary: var(--color-primary-a0); // Fond principal
|
|
48
49
|
--background-secondary: var(--color-primary-a10); // Fond secondaire
|
|
50
|
+
--background-ternary: #f4f4f4; // Fond secondaire
|
|
49
51
|
|
|
50
52
|
// Texts
|
|
51
53
|
--text-primary: var(--color-primary-a100); // Texte principal
|
|
@@ -28,6 +28,7 @@ import icon from "./comments-question.svg"
|
|
|
28
28
|
|
|
29
29
|
let last_hit: HTMLElement = null;
|
|
30
30
|
let tooltip: Tooltip = null;
|
|
31
|
+
let mouse_pos: Point = {x:0, y:0 };
|
|
31
32
|
|
|
32
33
|
const timer = new Timer( );
|
|
33
34
|
|
|
@@ -53,15 +54,20 @@ export function initTooltips( ) {
|
|
|
53
54
|
|
|
54
55
|
}, true );
|
|
55
56
|
|
|
56
|
-
document.addEventListener( "mouseleave", ( ev:
|
|
57
|
+
document.addEventListener( "mouseleave", ( ev: MouseEvent ) => {
|
|
57
58
|
//console.log( "leave", ev.target );
|
|
58
|
-
|
|
59
59
|
if( last_hit && ev.target==last_hit ) {
|
|
60
60
|
last_hit = null;
|
|
61
61
|
closeTT( );
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
}, true );
|
|
65
|
+
|
|
66
|
+
document.addEventListener( "mousemove", ( ev: MouseEvent ) => {
|
|
67
|
+
if( last_hit ) {
|
|
68
|
+
mouse_pos = { x:ev.pageX, y:ev.pageY }
|
|
69
|
+
}
|
|
70
|
+
});
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
function showTT( text: string, rc: Rect, pt: Point ) {
|
|
@@ -71,8 +77,14 @@ function showTT( text: string, rc: Rect, pt: Point ) {
|
|
|
71
77
|
|
|
72
78
|
timer.setTimeout( null, 300, ( ) => {
|
|
73
79
|
tooltip.setText( unsafeHtml(text) );
|
|
80
|
+
|
|
81
|
+
let y = mouse_pos.y;
|
|
82
|
+
if( rc.contains(mouse_pos) ) {
|
|
83
|
+
y = rc.bottom;
|
|
84
|
+
}
|
|
85
|
+
|
|
74
86
|
//tooltip.displayNear( rc, "top left", "bottom left", {x:0,y:4} );
|
|
75
|
-
tooltip.displayAt(
|
|
87
|
+
tooltip.displayAt( mouse_pos.x+17, y+5 );
|
|
76
88
|
} );
|
|
77
89
|
}
|
|
78
90
|
|