x4js 2.2.6 → 2.2.8
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/package.json +1 -1
- package/src/components/base.scss +1 -1
- package/src/components/boxes/boxes.module.scss +1 -1
- package/src/components/boxes/boxes.ts +1 -1
- package/src/components/breadcrumb/breadcrumb.ts +1 -1
- package/src/components/btngroup/btngroup.module.scss +1 -1
- package/src/components/btngroup/btngroup.ts +1 -1
- package/src/components/button/button.module.scss +1 -1
- package/src/components/button/button.ts +1 -1
- package/src/components/calendar/calendar.module.scss +1 -1
- package/src/components/calendar/calendar.ts +1 -1
- package/src/components/checkbox/checkbox.module.scss +1 -1
- package/src/components/colorinput/colorinput.module.scss +1 -1
- package/src/components/colorinput/colorinput.ts +1 -1
- package/src/components/colorpicker/colorpicker.module.scss +1 -1
- package/src/components/colorpicker/colorpicker.ts +1 -1
- package/src/components/combobox/combobox.module.scss +1 -1
- package/src/components/combobox/combobox.ts +1 -1
- package/src/components/dialog/dialog.module.scss +1 -1
- package/src/components/dialog/dialog.ts +1 -1
- package/src/components/filedrop/filedrop.module.scss +1 -1
- package/src/components/filedrop/filedrop.ts +1 -1
- package/src/components/form/form.module.scss +1 -1
- package/src/components/form/form.ts +1 -1
- package/src/components/gridview/gridview.module.scss +1 -1
- package/src/components/gridview/gridview.ts +1 -1
- package/src/components/icon/icon.module.scss +1 -1
- package/src/components/icon/icon.ts +4 -1
- package/src/components/image/image.module.scss +1 -1
- package/src/components/image/image.ts +1 -1
- package/src/components/input/input.module.scss +1 -1
- package/src/components/input/input.ts +1 -1
- package/src/components/keyboard/keyboard.module.scss +1 -1
- package/src/components/keyboard/keyboard.ts +1 -1
- package/src/components/label/label.module.scss +1 -1
- package/src/components/label/label.ts +1 -1
- package/src/components/link/link.ts +1 -1
- package/src/components/listbox/listbox.module.scss +1 -1
- package/src/components/listbox/listbox.ts +1 -1
- package/src/components/menu/menu.module.scss +1 -1
- package/src/components/menu/menu.ts +1 -1
- package/src/components/messages/messages.module.scss +1 -1
- package/src/components/monaco/bin/codicon-LN6W7LCM.ttf +0 -0
- package/src/components/monaco/bin/monaco.css +1 -0
- package/src/components/monaco/bin/monaco.d.ts +8696 -0
- package/src/components/monaco/bin/monaco.js +1242 -0
- package/src/components/monaco/bin/workers/css.worker.js +93 -0
- package/src/components/monaco/bin/workers/editor.worker.js +26 -0
- package/src/components/monaco/bin/workers/html.worker.js +470 -0
- package/src/components/monaco/bin/workers/json.worker.js +58 -0
- package/src/components/monaco/bin/workers/ts.worker.js +67736 -0
- package/src/components/monaco/monaco.module.scss +22 -0
- package/src/components/monaco/monaco.ts +111 -0
- package/src/components/monaco/readme.md +3 -0
- package/src/components/monaco/sources/build.js +41 -0
- package/src/components/monaco/sources/demo.js +57 -0
- package/src/components/monaco/sources/editor.worker.ts +1 -0
- package/src/components/monaco/sources/index.ts +7 -0
- package/src/components/monaco/sources/package.json +7 -0
- package/src/components/monaco/sources/test.html +9 -0
- package/src/components/monaco/sources/tsconfig.json +16 -0
- package/src/components/normalize.scss +1 -1
- package/src/components/notification/notification.module.scss +1 -1
- package/src/components/notification/notification.ts +1 -1
- package/src/components/panel/panel.module.scss +1 -1
- package/src/components/panel/panel.ts +1 -1
- package/src/components/popup/popup.module.scss +1 -1
- package/src/components/popup/popup.ts +1 -1
- package/src/components/progress/progress.module.scss +1 -1
- package/src/components/progress/progress.ts +1 -1
- package/src/components/propgrid/propgrid.ts +1 -1
- package/src/components/radio/radio.module.scss +1 -1
- package/src/components/radio/radio.ts +1 -1
- package/src/components/rating/rating.ts +1 -1
- package/src/components/shared.scss +1 -1
- package/src/components/sizers/sizer.module.scss +9 -5
- package/src/components/sizers/sizer.ts +20 -14
- package/src/components/slider/slider.module.scss +1 -1
- package/src/components/slider/slider.ts +1 -1
- package/src/components/spreadsheet/spreadsheet.module.scss +1 -1
- package/src/components/spreadsheet/spreadsheet.ts +1 -1
- package/src/components/switch/switch.module.scss +1 -1
- package/src/components/switch/switch.ts +1 -1
- package/src/components/tabs/tabs.ts +1 -1
- package/src/components/textarea/textarea.module.scss +1 -1
- package/src/components/textarea/textarea.ts +1 -1
- package/src/components/textedit/textedit.module.scss +1 -1
- package/src/components/textedit/textedit.ts +1 -1
- package/src/components/themes.scss +1 -1
- package/src/components/tickline/tickline.module.scss +1 -1
- package/src/components/tooltips/tooltips.scss +1 -1
- package/src/components/tooltips/tooltips.ts +1 -1
- package/src/components/treeview/treeview.module.scss +6 -2
- package/src/components/treeview/treeview.ts +1 -1
- package/src/components/viewport/viewport.module.scss +1 -1
- package/src/components/viewport/viewport.ts +1 -1
- package/src/core/component.ts +1 -1
- package/src/core/core_application.ts +2 -1
- package/src/core/core_colors.ts +1 -1
- package/src/core/core_data.ts +1 -1
- package/src/core/core_dom.ts +1 -1
- package/src/core/core_dragdrop.ts +1 -1
- package/src/core/core_element.ts +1 -1
- package/src/core/core_events.ts +1 -1
- package/src/core/core_i18n.ts +1 -1
- package/src/core/core_router.ts +1 -1
- package/src/core/core_styles.ts +1 -1
- package/src/core/core_svg.ts +1 -1
- package/src/core/core_tools.ts +1 -1
- package/src/x4.scss +1 -1
- package/src/x4.ts +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / \____ _|
|
|
6
|
+
* /__/\__\ |_|
|
|
7
|
+
*
|
|
8
|
+
* @file monacoeditor.module.scss
|
|
9
|
+
* @author Etienne Cochard
|
|
10
|
+
*
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
|
+
*
|
|
13
|
+
* Use of this source code is governed by an MIT-style license
|
|
14
|
+
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
.x4monacoeditor {
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-template-rows: 1fr;
|
|
20
|
+
grid-template-columns: 1fr;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { class_ns, Component, ComponentProps } from '../../x4.js';
|
|
2
|
+
|
|
3
|
+
import Monaco from './bin/monaco';
|
|
4
|
+
import "./monaco.module.scss"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
interface MonacoEditorProps extends ComponentProps {
|
|
8
|
+
language: "typescript" | "javascript" | "json" | "css" | "html";
|
|
9
|
+
theme?: string;
|
|
10
|
+
content?: string;
|
|
11
|
+
options?: Monaco.editor.IEditorOptions & Monaco.editor.IGlobalEditorOptions;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@class_ns( "x4" )
|
|
15
|
+
export class MonacoEditor extends Component<MonacoEditorProps> {
|
|
16
|
+
|
|
17
|
+
static initCount = 0;
|
|
18
|
+
static basePath: string = "./bin";
|
|
19
|
+
static monaco: typeof Monaco;
|
|
20
|
+
static initCbs: Function[] = [];
|
|
21
|
+
|
|
22
|
+
private _editor: Monaco.editor.IStandaloneCodeEditor;
|
|
23
|
+
|
|
24
|
+
static async start( ) {
|
|
25
|
+
if( this.initCount ) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
this.monaco = (await import( "./bin/monaco.js" )).default;
|
|
30
|
+
this.initCount++;
|
|
31
|
+
|
|
32
|
+
globalThis.MonacoEnvironment = {
|
|
33
|
+
getWorkerUrl: function (_moduleId, label) {
|
|
34
|
+
let workerPath: string;
|
|
35
|
+
|
|
36
|
+
if (label == 'json') {
|
|
37
|
+
workerPath = 'json.worker.js';
|
|
38
|
+
}
|
|
39
|
+
else if (label == 'css' || label == 'scss' || label == 'less') {
|
|
40
|
+
workerPath = 'css.worker.js';
|
|
41
|
+
}
|
|
42
|
+
else if (label == 'html' ) {
|
|
43
|
+
workerPath = 'html.worker.js';
|
|
44
|
+
}
|
|
45
|
+
else if (label === 'typescript' || label === 'javascript') {
|
|
46
|
+
workerPath = 'ts.worker.js';
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
workerPath = "editor.worker.js";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const fullpath = MonacoEditor.basePath+'/workers/'+workerPath;
|
|
53
|
+
console.log( `getting "${label} path: ${fullpath}` );
|
|
54
|
+
return fullpath;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const link = document.createElement('link');
|
|
59
|
+
link.rel = 'stylesheet';
|
|
60
|
+
link.href = MonacoEditor.basePath+'/monaco.css';
|
|
61
|
+
link.type = 'text/css';
|
|
62
|
+
document.head.appendChild(link);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static addTypelib( name: string, code: string ) {
|
|
66
|
+
const register = ( ) => {
|
|
67
|
+
///@ts-ignore
|
|
68
|
+
const ts = MonacoEditor.monaco.languages.typescript;
|
|
69
|
+
///@ts-ignore
|
|
70
|
+
ts.typescriptDefaults.addExtraLib( code, `ts:filename/${name}`);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if( MonacoEditor.monaco ) {
|
|
74
|
+
register( );
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
this.initCbs.push( register );
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
constructor( props: MonacoEditorProps ) {
|
|
82
|
+
const content = props.content;
|
|
83
|
+
delete props.content;
|
|
84
|
+
|
|
85
|
+
super( props );
|
|
86
|
+
|
|
87
|
+
MonacoEditor.start( )
|
|
88
|
+
.then( ( ) => {
|
|
89
|
+
MonacoEditor.initCbs.forEach( x => x() );
|
|
90
|
+
|
|
91
|
+
this._editor = MonacoEditor.monaco.editor.create( this.dom as HTMLElement, {
|
|
92
|
+
value: content,
|
|
93
|
+
language: props.language,
|
|
94
|
+
theme: props.theme,
|
|
95
|
+
//automaticLayout: true,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
if( props.options ) {
|
|
99
|
+
this._editor.updateOptions( props.options );
|
|
100
|
+
}
|
|
101
|
+
} );
|
|
102
|
+
|
|
103
|
+
this.addDOMEvent( "resized", ( ) => {
|
|
104
|
+
//const rc = this.getBoundingRect( );
|
|
105
|
+
if( this._editor ) {
|
|
106
|
+
this._editor.layout();
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
|
|
3
|
+
const MONACO_DIR = 'node_modules/monaco-editor/esm/vs';
|
|
4
|
+
|
|
5
|
+
const commonConfig = {
|
|
6
|
+
bundle: true,
|
|
7
|
+
minify: true,
|
|
8
|
+
format: 'esm',
|
|
9
|
+
target: 'es2022',
|
|
10
|
+
logLevel: 'info',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
async function build() {
|
|
14
|
+
// 1. Build des Workers (obligatoires pour la coloration/validation)
|
|
15
|
+
// On génère uniquement les workers dont on a besoin
|
|
16
|
+
await esbuild.build({
|
|
17
|
+
...commonConfig,
|
|
18
|
+
entryPoints: {
|
|
19
|
+
'editor.worker': `${MONACO_DIR}/editor/editor.worker.js`,
|
|
20
|
+
'ts.worker': `${MONACO_DIR}/language/typescript/ts.worker.js`,
|
|
21
|
+
'css.worker': `${MONACO_DIR}/language/css/css.worker.js`,
|
|
22
|
+
'html.worker': `${MONACO_DIR}/language/html/html.worker.js`,
|
|
23
|
+
'json.worker': `${MONACO_DIR}/language/json/json.worker.js`,
|
|
24
|
+
},
|
|
25
|
+
outdir: 'dist/workers',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// 2. Build de l'application principale
|
|
29
|
+
await esbuild.build({
|
|
30
|
+
...commonConfig,
|
|
31
|
+
entryPoints: ['index.ts'],
|
|
32
|
+
outfile: 'dist/monaco.js',
|
|
33
|
+
globalName: 'monaco',
|
|
34
|
+
loader: {
|
|
35
|
+
'.ttf': 'file',
|
|
36
|
+
'.css': 'css',
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
build();
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import monaco from './dist/monaco.js';
|
|
2
|
+
|
|
3
|
+
const myLibCode = `
|
|
4
|
+
declare namespace MyAPI {
|
|
5
|
+
/**
|
|
6
|
+
* Calcule une performance optimale.
|
|
7
|
+
* @param value Le coefficient d'entrée.
|
|
8
|
+
*/
|
|
9
|
+
function compute(value: number): string;
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
const myLibUri = 'ts:filename/myapi.d.ts';
|
|
14
|
+
|
|
15
|
+
const ts = (monaco.languages).typescript;
|
|
16
|
+
ts.typescriptDefaults.addExtraLib(myLibCode, myLibUri);
|
|
17
|
+
|
|
18
|
+
// Facultatif : Créer un modèle pour que l'éditeur "voie" le fichier
|
|
19
|
+
// Utile si tu veux que le "Go to Definition" fonctionne vers ce fichier
|
|
20
|
+
monaco.editor.createModel(myLibCode, 'typescript', monaco.Uri.parse(myLibUri));
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const el = document.getElementById("container");
|
|
24
|
+
|
|
25
|
+
globalThis.MonacoEnvironment = {
|
|
26
|
+
getWorkerUrl: function (_moduleId, label) {
|
|
27
|
+
if (label === 'json') return './dist/workers/json.worker.js';
|
|
28
|
+
if (label === 'css' || label === 'scss' || label === 'less') return './dist/workers/css.worker.js';
|
|
29
|
+
if (label === 'html') return './dist/workers/html.worker.js';
|
|
30
|
+
if (label === 'typescript' || label === 'javascript') return './dist/workers/ts.worker.js';
|
|
31
|
+
return './dist/workers/editor.worker.js';
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
monaco.languages["typescript"].typescriptDefaults.setCompilerOptions({
|
|
36
|
+
target: monaco.languages.typescript.ScriptTarget.ESNext,
|
|
37
|
+
allowNonTsExtensions: true,
|
|
38
|
+
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
|
|
39
|
+
module: monaco.languages.typescript.ModuleKind.CommonJS,
|
|
40
|
+
noEmit: true,
|
|
41
|
+
typeRoots: ["node_modules/@types"]
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
monaco.editor.create(el, {
|
|
45
|
+
value: `
|
|
46
|
+
function test( ) {
|
|
47
|
+
for( let i=0; i<1000; i++ ) {
|
|
48
|
+
console.log( "i", i );
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
test( );
|
|
53
|
+
`,
|
|
54
|
+
language: 'typescript',
|
|
55
|
+
theme: 'vs-dark'
|
|
56
|
+
});
|
|
57
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/esm/vs/editor/editor.worker.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor';
|
|
2
|
+
|
|
3
|
+
import 'monaco-editor/esm/vs/language/html/monaco.contribution.js';
|
|
4
|
+
import 'monaco-editor/esm/vs/language/css/monaco.contribution.js';
|
|
5
|
+
import 'monaco-editor/esm/vs/language/typescript/monaco.contribution.js';
|
|
6
|
+
|
|
7
|
+
export default monaco;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"moduleResolution": "node",
|
|
4
|
+
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"baseUrl": ".",
|
|
8
|
+
"paths": {
|
|
9
|
+
"monaco-editor/*": [
|
|
10
|
+
"node_modules/monaco-editor/*"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"skipLibCheck": true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file normalize.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file notification.module.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file notification.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file panel.module.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file panel.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file popup.module.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file popup.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file progress.module.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file progress.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file propgrid.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file radio.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file radio.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file rating.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file shared.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file sizer.module.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -26,8 +26,10 @@
|
|
|
26
26
|
cursor: ns-resize;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
&.vsize,
|
|
30
|
-
&.
|
|
29
|
+
&.vsize-next,
|
|
30
|
+
&.vsize-prev,
|
|
31
|
+
&.hsize-next,
|
|
32
|
+
&.hsize-prev {
|
|
31
33
|
position: relative;
|
|
32
34
|
align-self: stretch;
|
|
33
35
|
min-width: 4px;
|
|
@@ -38,11 +40,13 @@
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
&.hsize
|
|
43
|
+
&.hsize-next,
|
|
44
|
+
&.hsize-prev {
|
|
42
45
|
cursor: ew-resize;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
|
-
&.vsize
|
|
48
|
+
&.vsize-next,
|
|
49
|
+
&.vsize-prev {
|
|
46
50
|
cursor: ns-resize;
|
|
47
51
|
}
|
|
48
52
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file sizer.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -33,7 +33,8 @@ 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
|
+
| "hsize-prev" | "hsize-next" | "vsize-prev" | "vsize-next";
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
*
|
|
@@ -57,8 +58,13 @@ export class CSizer extends Component<ComponentProps,CSizerEvent> {
|
|
|
57
58
|
this.setCapture( e.pointerId );
|
|
58
59
|
|
|
59
60
|
let targ = target;
|
|
60
|
-
if( !targ
|
|
61
|
-
|
|
61
|
+
if( !targ ) {
|
|
62
|
+
if( type=='hsize-next' || type=='vsize-next' ) {
|
|
63
|
+
targ = this.nextElement( );
|
|
64
|
+
}
|
|
65
|
+
else if( type=='hsize-prev' || type=='vsize-prev' ) {
|
|
66
|
+
targ = this.prevElement( );
|
|
67
|
+
}
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
this._ref = targ ?? componentFromDOM( this.dom.parentElement );
|
|
@@ -66,14 +72,14 @@ export class CSizer extends Component<ComponentProps,CSizerEvent> {
|
|
|
66
72
|
this._delta = {x:0,y:0};
|
|
67
73
|
const rc = this._ref.getBoundingRect();
|
|
68
74
|
|
|
69
|
-
if( this._type=="hsize" || this._type.includes("left") ) {
|
|
75
|
+
if( this._type=="hsize-next" || this._type.includes("left") ) {
|
|
70
76
|
this._delta.x = e.pageX-rc.left;
|
|
71
77
|
}
|
|
72
78
|
else {
|
|
73
79
|
this._delta.x = e.pageX-(rc.left+rc.width);
|
|
74
80
|
}
|
|
75
81
|
|
|
76
|
-
if( this._type=="vsize" || this._type.includes("top") ) {
|
|
82
|
+
if( this._type=="vsize-next" || this._type.includes("top") ) {
|
|
77
83
|
this._delta.y = e.pageY-rc.top;
|
|
78
84
|
}
|
|
79
85
|
else {
|
|
@@ -110,11 +116,11 @@ export class CSizer extends Component<ComponentProps,CSizerEvent> {
|
|
|
110
116
|
nr.height = (rc.top+rc.height)-pt.y;
|
|
111
117
|
horz = false;
|
|
112
118
|
}
|
|
113
|
-
else if( this._type=="vsize" ) {
|
|
119
|
+
else if( this._type=="vsize-next" ) {
|
|
114
120
|
nr.height = (rc.top+rc.height)-pt.y;
|
|
115
121
|
horz = false;
|
|
116
122
|
}
|
|
117
|
-
else if( this._type.includes("bottom") ) {
|
|
123
|
+
else if( this._type.includes("bottom") || this._type=='vsize-prev' ) {
|
|
118
124
|
//nr.top = rc.top;
|
|
119
125
|
nr.height = (pt.y-rc.top);
|
|
120
126
|
horz = false;
|
|
@@ -123,10 +129,10 @@ export class CSizer extends Component<ComponentProps,CSizerEvent> {
|
|
|
123
129
|
nr.left = pt.x;
|
|
124
130
|
nr.width = ((rc.left+rc.width)-pt.x);
|
|
125
131
|
}
|
|
126
|
-
else if( this._type=="hsize" ) {
|
|
132
|
+
else if( this._type=="hsize-next" ) {
|
|
127
133
|
nr.width = ((rc.left+rc.width)-pt.x);
|
|
128
134
|
}
|
|
129
|
-
else if( this._type.includes("right") ) {
|
|
135
|
+
else if( this._type.includes("right") || this._type=='hsize-prev' ) {
|
|
130
136
|
nr.width = (pt.x-rc.left);
|
|
131
137
|
}
|
|
132
138
|
|
|
@@ -143,14 +149,14 @@ export class CSizer extends Component<ComponentProps,CSizerEvent> {
|
|
|
143
149
|
|
|
144
150
|
@class_ns( "x4" )
|
|
145
151
|
export class HSizer extends CSizer {
|
|
146
|
-
constructor( ) {
|
|
147
|
-
super( "hsize" );
|
|
152
|
+
constructor( next = true ) {
|
|
153
|
+
super( next ? "hsize-next" : "hsize-prev" );
|
|
148
154
|
}
|
|
149
155
|
}
|
|
150
156
|
|
|
151
157
|
@class_ns( "x4" )
|
|
152
158
|
export class VSizer extends CSizer {
|
|
153
|
-
constructor( ) {
|
|
154
|
-
super( "vsize" );
|
|
159
|
+
constructor( next = true ) {
|
|
160
|
+
super( next ? "vsize-next" : "vsize-prev" );
|
|
155
161
|
}
|
|
156
162
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file slider.module.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file slider.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file spreadsheet.module.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file spreadsheet.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file switch.module.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file switch.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file tabs.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file textarea.module.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file textarea.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @file textedit.module.scss
|
|
9
9
|
* @author Etienne Cochard
|
|
10
10
|
*
|
|
11
|
-
* @copyright (c)
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|