x4js 2.2.57 → 2.2.59
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/btngroup/btngroup.ts +2 -0
- package/src/components/monaco/monaco.ts +8 -0
- package/src/components/popup/popup.ts +0 -4
- package/src/components/propgrid/propgrid.ts +5 -5
- package/src/components/treeview/treeview.ts +1 -0
- package/src/core/core_tools.ts +22 -9
package/package.json
CHANGED
|
@@ -37,6 +37,7 @@ type predefined = `ok${ "" | `.${string}`}`
|
|
|
37
37
|
| `no${ "" | `.${string}`}`
|
|
38
38
|
| `retry${ "" | `.${string}`}`
|
|
39
39
|
| `abort${ "" | `.${string}`}`
|
|
40
|
+
| `save${ "" | `.${string}`}`
|
|
40
41
|
| "-" | ">>" // - = Flex
|
|
41
42
|
| "~"; // space
|
|
42
43
|
|
|
@@ -120,6 +121,7 @@ export class BtnGroup extends Box<BtnGroupProps,BtnGroupEvents> {
|
|
|
120
121
|
case "no": title = _tr.global.no; break;
|
|
121
122
|
case "yes": title = _tr.global.yes; break;
|
|
122
123
|
case "retry": title = _tr.global.retry; break;
|
|
124
|
+
case "save": title = _tr.global.save; break;
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
b = new Button( { cls, id: txt, label: title, click: ( ) => {
|
|
@@ -131,5 +131,13 @@ export class MonacoEditor extends Component<MonacoEditorProps> {
|
|
|
131
131
|
await this._start( );
|
|
132
132
|
return this._monaco;
|
|
133
133
|
}
|
|
134
|
+
|
|
135
|
+
getText( ) : string {
|
|
136
|
+
return this._editor.getValue( );
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
setText( text: string ) {
|
|
140
|
+
return this._editor.setValue( text );
|
|
141
|
+
}
|
|
134
142
|
}
|
|
135
143
|
|
|
@@ -145,15 +145,11 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
|
|
|
145
145
|
this._do_show( ); // to compute size
|
|
146
146
|
|
|
147
147
|
const fixpos = ( ) => {
|
|
148
|
-
console.log( "fixpos" );
|
|
149
|
-
|
|
150
148
|
const orc = this.getBoundingRect( );
|
|
151
149
|
this.setStyle( {
|
|
152
150
|
left: ((window.innerWidth - orc.width) / 2) +'px',
|
|
153
151
|
top: ((window.innerHeight - orc.height) / 2) +'px',
|
|
154
152
|
} );
|
|
155
|
-
|
|
156
|
-
console.log( orc );
|
|
157
153
|
}
|
|
158
154
|
|
|
159
155
|
asap( fixpos );
|
|
@@ -197,7 +197,7 @@ export class PropertyGrid extends VBox {
|
|
|
197
197
|
editor = new Input({
|
|
198
198
|
type: "checkbox",
|
|
199
199
|
id: item.name,
|
|
200
|
-
name: item.name,
|
|
200
|
+
//name: item.name,
|
|
201
201
|
checked: value as boolean,
|
|
202
202
|
dom_events: {
|
|
203
203
|
change: ( e: Event ) => {
|
|
@@ -212,7 +212,7 @@ export class PropertyGrid extends VBox {
|
|
|
212
212
|
value: value as ListboxID,
|
|
213
213
|
id: item.name,
|
|
214
214
|
items: item.options,
|
|
215
|
-
name: item.name,
|
|
215
|
+
//name: item.name,
|
|
216
216
|
change: ( e: EvChange ) => {
|
|
217
217
|
item.callback?.( item.name, e.value );
|
|
218
218
|
}
|
|
@@ -222,7 +222,7 @@ export class PropertyGrid extends VBox {
|
|
|
222
222
|
editor = new Input({
|
|
223
223
|
type: 'password',
|
|
224
224
|
id: item.name,
|
|
225
|
-
name: item.name,
|
|
225
|
+
//name: item.name,
|
|
226
226
|
value: String(value),
|
|
227
227
|
focus: ( e: EvFocus ) => {
|
|
228
228
|
if( e.focus_out ) {
|
|
@@ -235,7 +235,7 @@ export class PropertyGrid extends VBox {
|
|
|
235
235
|
editor = new Input({
|
|
236
236
|
type: 'number',
|
|
237
237
|
id: item.name,
|
|
238
|
-
name: item.name,
|
|
238
|
+
//name: item.name,
|
|
239
239
|
value: String(value),
|
|
240
240
|
step: item.step,
|
|
241
241
|
min: item.min,
|
|
@@ -273,7 +273,7 @@ export class PropertyGrid extends VBox {
|
|
|
273
273
|
editor = new Input({
|
|
274
274
|
type: 'text',
|
|
275
275
|
id: item.name,
|
|
276
|
-
name: item.name,
|
|
276
|
+
//name: item.name,
|
|
277
277
|
value: value as string,
|
|
278
278
|
focus: ( e: EvFocus ) => {
|
|
279
279
|
if( e.focus_out ) {
|
package/src/core/core_tools.ts
CHANGED
|
@@ -982,18 +982,31 @@ export function setWaitCursor(wait: boolean) {
|
|
|
982
982
|
* return the focusable elements from a given node
|
|
983
983
|
*/
|
|
984
984
|
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
'button:not([tabindex="-1"]):not([disabled])',
|
|
985
|
+
const FOCUSABLE = [
|
|
986
|
+
'button:not([tabindex="-1"])',
|
|
988
987
|
'[href]',
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
988
|
+
'input',
|
|
989
|
+
'select',
|
|
990
|
+
'textarea',
|
|
992
991
|
'[tabindex]:not([tabindex="-1"])'
|
|
993
|
-
]
|
|
992
|
+
] .map( x => x+':not(:disabled):not([inert])' )
|
|
993
|
+
.join( ',' );
|
|
994
|
+
|
|
995
|
+
export function getFocusableElements(root: Element) {
|
|
996
|
+
const focusable = Array.from(root.querySelectorAll(FOCUSABLE));
|
|
994
997
|
|
|
995
|
-
|
|
996
|
-
|
|
998
|
+
return focusable.filter( x => {
|
|
999
|
+
// check visibility
|
|
1000
|
+
if( (x as HTMLElement).offsetParent == null ) {
|
|
1001
|
+
return false;
|
|
1002
|
+
}
|
|
1003
|
+
// check :inert | :disable
|
|
1004
|
+
if( x.closest('[inert]') || x.closest(":disabled") ) {
|
|
1005
|
+
return false;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return true;
|
|
1009
|
+
});
|
|
997
1010
|
}
|
|
998
1011
|
|
|
999
1012
|
/**
|