x4js 2.2.29 → 2.2.31
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
CHANGED
|
@@ -15,7 +15,7 @@ interface MonacoEditorProps extends ComponentProps {
|
|
|
15
15
|
export class MonacoEditor extends Component<MonacoEditorProps> {
|
|
16
16
|
|
|
17
17
|
static initCount = 0;
|
|
18
|
-
static basePath: string = "./
|
|
18
|
+
static basePath: string = "./monaco";
|
|
19
19
|
static monaco: typeof Monaco;
|
|
20
20
|
static initCbs: Function[] = [];
|
|
21
21
|
|
|
@@ -26,7 +26,7 @@ export class MonacoEditor extends Component<MonacoEditorProps> {
|
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
this.monaco = (await import( "
|
|
29
|
+
this.monaco = (await import( this.basePath+"/monaco.js" )).default;
|
|
30
30
|
this.initCount++;
|
|
31
31
|
|
|
32
32
|
globalThis.MonacoEnvironment = {
|
|
@@ -55,6 +55,7 @@ export class MonacoEditor extends Component<MonacoEditorProps> {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
+
// custom append css
|
|
58
59
|
const link = document.createElement('link');
|
|
59
60
|
link.rel = 'stylesheet';
|
|
60
61
|
link.href = MonacoEditor.basePath+'/monaco.css';
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
# using monaco in x4
|
|
2
2
|
|
|
3
3
|
you must copy ./bin/* in your destination folder ex. monaco folder
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
fr x4build update your package.json this this
|
|
9
|
+
|
|
10
|
+
{
|
|
11
|
+
...
|
|
12
|
+
"x4build": {
|
|
13
|
+
"copy": [
|
|
14
|
+
{ "from": "./node_modules/x4js/src/components/monaco/bin", "to": "monaco" }
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
...
|
|
18
|
+
}
|
|
@@ -39,9 +39,11 @@ export interface PropertyValue {
|
|
|
39
39
|
value: IValue | IValueCB;
|
|
40
40
|
options?: ListItem[];
|
|
41
41
|
callback: ( name: string, value: any ) => void;
|
|
42
|
-
step?: number; // for numbers
|
|
43
42
|
live?: boolean; // for live update
|
|
44
43
|
cls?: string;
|
|
44
|
+
step?: number; // for numbers
|
|
45
|
+
min?: number;
|
|
46
|
+
max?: number;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
export interface PropertyGroup {
|
|
@@ -215,6 +217,8 @@ export class PropertyGrid extends VBox {
|
|
|
215
217
|
name: item.name,
|
|
216
218
|
value: String(value),
|
|
217
219
|
step: item.step,
|
|
220
|
+
min: item.min,
|
|
221
|
+
max: item.max,
|
|
218
222
|
focus: ( e: EvFocus ) => {
|
|
219
223
|
if( e.focus_out ) {
|
|
220
224
|
item.callback?.( item.name, (editor as Input).getNumValue() );
|