lexgui 0.7.10 → 0.7.11
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/build/extensions/timeline.js +73 -99
- package/build/lexgui.js +281 -260
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +305 -284
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +21 -1
- package/examples/editor.html +2 -2
- package/package.json +1 -1
package/build/lexgui.module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// This is a generated file. Do not edit.
|
|
1
|
+
// This is a generated file. Do not edit.
|
|
2
2
|
// Lexgui.js @jxarco
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
const LX = {
|
|
10
|
-
version: "0.7.
|
|
10
|
+
version: "0.7.11",
|
|
11
11
|
ready: false,
|
|
12
12
|
extensions: [], // Store extensions used
|
|
13
13
|
signals: {}, // Events and triggers
|
|
@@ -647,10 +647,11 @@ class TreeEvent {
|
|
|
647
647
|
static NODE_VISIBILITY = 7;
|
|
648
648
|
static NODE_CARETCHANGED = 8;
|
|
649
649
|
|
|
650
|
-
constructor( type, node, value ) {
|
|
650
|
+
constructor( type, node, value, event ) {
|
|
651
651
|
this.type = type || TreeEvent.NONE;
|
|
652
652
|
this.node = node;
|
|
653
653
|
this.value = value;
|
|
654
|
+
this.event = event;
|
|
654
655
|
this.multiple = false; // Multiple selection
|
|
655
656
|
this.panel = null;
|
|
656
657
|
}
|
|
@@ -4569,8 +4570,8 @@ Element.prototype.ignore = function( eventName, callbackName ) {
|
|
|
4569
4570
|
callbackName = callbackName ?? ( "_on" + eventName );
|
|
4570
4571
|
const callback = this[ callbackName ];
|
|
4571
4572
|
this.removeEventListener( eventName, callback );
|
|
4572
|
-
};
|
|
4573
|
-
|
|
4573
|
+
};
|
|
4574
|
+
|
|
4574
4575
|
// icons.js @jxarco
|
|
4575
4576
|
|
|
4576
4577
|
const RAW_ICONS = {
|
|
@@ -4751,8 +4752,8 @@ LX.LucideIconAlias = {
|
|
|
4751
4752
|
"RotateRight": "RotateCw",
|
|
4752
4753
|
"RotateBack": "RotateCcw",
|
|
4753
4754
|
"RotateLeft": "RotateCcw",
|
|
4754
|
-
};
|
|
4755
|
-
|
|
4755
|
+
};
|
|
4756
|
+
|
|
4756
4757
|
// utils.js @jxarco
|
|
4757
4758
|
|
|
4758
4759
|
function clamp( num, min, max ) { return Math.min( Math.max( num, min ), max ); }
|
|
@@ -6735,8 +6736,8 @@ function drawSpline( ctx, pts, t )
|
|
|
6735
6736
|
ctx.restore();
|
|
6736
6737
|
}
|
|
6737
6738
|
|
|
6738
|
-
LX.drawSpline = drawSpline;
|
|
6739
|
-
|
|
6739
|
+
LX.drawSpline = drawSpline;
|
|
6740
|
+
|
|
6740
6741
|
// area.js @jxarco
|
|
6741
6742
|
|
|
6742
6743
|
class AreaOverlayButtons {
|
|
@@ -7886,8 +7887,8 @@ class Area {
|
|
|
7886
7887
|
}
|
|
7887
7888
|
}
|
|
7888
7889
|
}
|
|
7889
|
-
LX.Area = Area;
|
|
7890
|
-
|
|
7890
|
+
LX.Area = Area;
|
|
7891
|
+
|
|
7891
7892
|
// base_component.js @jxarco
|
|
7892
7893
|
|
|
7893
7894
|
/**
|
|
@@ -7945,8 +7946,8 @@ class BaseComponent {
|
|
|
7945
7946
|
BaseComponent.PROGRESS
|
|
7946
7947
|
];
|
|
7947
7948
|
|
|
7948
|
-
constructor( type, name, value, options = {} )
|
|
7949
|
-
|
|
7949
|
+
constructor( type, name, value, options = {} )
|
|
7950
|
+
{
|
|
7950
7951
|
this.type = type;
|
|
7951
7952
|
this.name = name;
|
|
7952
7953
|
this.options = options;
|
|
@@ -8044,13 +8045,14 @@ class BaseComponent {
|
|
|
8044
8045
|
this.options = options;
|
|
8045
8046
|
}
|
|
8046
8047
|
|
|
8047
|
-
static _dispatchEvent( element, type, data, bubbles, cancelable )
|
|
8048
|
+
static _dispatchEvent( element, type, data, bubbles, cancelable )
|
|
8049
|
+
{
|
|
8048
8050
|
let event = new CustomEvent( type, { 'detail': data, 'bubbles': bubbles, 'cancelable': cancelable } );
|
|
8049
8051
|
element.dispatchEvent( event );
|
|
8050
8052
|
}
|
|
8051
8053
|
|
|
8052
|
-
_addResetProperty( container, callback )
|
|
8053
|
-
|
|
8054
|
+
_addResetProperty( container, callback )
|
|
8055
|
+
{
|
|
8054
8056
|
const domEl = LX.makeIcon( "Undo2", { iconClass: "ml-0 mr-1 px-1", title: "Reset" } );
|
|
8055
8057
|
domEl.style.display = "none";
|
|
8056
8058
|
domEl.addEventListener( "click", callback );
|
|
@@ -8058,7 +8060,8 @@ class BaseComponent {
|
|
|
8058
8060
|
return domEl;
|
|
8059
8061
|
}
|
|
8060
8062
|
|
|
8061
|
-
_canPaste()
|
|
8063
|
+
_canPaste()
|
|
8064
|
+
{
|
|
8062
8065
|
let pasteAllowed = this.type === BaseComponent.CUSTOM ?
|
|
8063
8066
|
( navigator.clipboard.customIdx !== undefined && this.customIdx == navigator.clipboard.customIdx ) : navigator.clipboard.type === this.type;
|
|
8064
8067
|
|
|
@@ -8072,8 +8075,8 @@ class BaseComponent {
|
|
|
8072
8075
|
return pasteAllowed;
|
|
8073
8076
|
}
|
|
8074
8077
|
|
|
8075
|
-
_trigger( event, callback, scope = this )
|
|
8076
|
-
|
|
8078
|
+
_trigger( event, callback, scope = this )
|
|
8079
|
+
{
|
|
8077
8080
|
if( !callback )
|
|
8078
8081
|
{
|
|
8079
8082
|
return;
|
|
@@ -8082,8 +8085,8 @@ class BaseComponent {
|
|
|
8082
8085
|
callback.call( scope, event.value, event.domEvent, event.name );
|
|
8083
8086
|
}
|
|
8084
8087
|
|
|
8085
|
-
value()
|
|
8086
|
-
|
|
8088
|
+
value()
|
|
8089
|
+
{
|
|
8087
8090
|
if( this.onGetValue )
|
|
8088
8091
|
{
|
|
8089
8092
|
return this.onGetValue();
|
|
@@ -8092,8 +8095,8 @@ class BaseComponent {
|
|
|
8092
8095
|
console.warn( "Can't get value of " + this.typeName() );
|
|
8093
8096
|
}
|
|
8094
8097
|
|
|
8095
|
-
set( value, skipCallback, event )
|
|
8096
|
-
|
|
8098
|
+
set( value, skipCallback, event )
|
|
8099
|
+
{
|
|
8097
8100
|
if( this.onSetValue )
|
|
8098
8101
|
{
|
|
8099
8102
|
let resetButton = this.root.querySelector( ".lexcomponentname .lexicon" );
|
|
@@ -8101,12 +8104,13 @@ class BaseComponent {
|
|
|
8101
8104
|
{
|
|
8102
8105
|
resetButton.style.display = ( value != this.value() ? "block" : "none" );
|
|
8103
8106
|
|
|
8104
|
-
const equalInitial = value.constructor === Array ? (function arraysEqual(a, b) {
|
|
8105
|
-
if
|
|
8106
|
-
if
|
|
8107
|
-
if
|
|
8108
|
-
for
|
|
8109
|
-
|
|
8107
|
+
const equalInitial = value.constructor === Array ? (function arraysEqual( a, b ) {
|
|
8108
|
+
if( a === b ) return true;
|
|
8109
|
+
if( a == null || b == null ) return false;
|
|
8110
|
+
if( a.length !== b.length ) return false;
|
|
8111
|
+
for( var i = 0; i < a.length; ++i )
|
|
8112
|
+
{
|
|
8113
|
+
if( a[ i ] !== b[ i ] ) return false;
|
|
8110
8114
|
}
|
|
8111
8115
|
return true;
|
|
8112
8116
|
})( value, this._initialValue ) : ( value == this._initialValue );
|
|
@@ -8117,11 +8121,11 @@ class BaseComponent {
|
|
|
8117
8121
|
return this.onSetValue( value, skipCallback ?? false, event );
|
|
8118
8122
|
}
|
|
8119
8123
|
|
|
8120
|
-
console.warn(
|
|
8124
|
+
console.warn( `Can't set value of ${ this.typeName() }`);
|
|
8121
8125
|
}
|
|
8122
8126
|
|
|
8123
|
-
oncontextmenu( e )
|
|
8124
|
-
|
|
8127
|
+
oncontextmenu( e )
|
|
8128
|
+
{
|
|
8125
8129
|
if( BaseComponent.NO_CONTEXT_TYPES.includes( this.type ) )
|
|
8126
8130
|
{
|
|
8127
8131
|
return;
|
|
@@ -8133,14 +8137,16 @@ class BaseComponent {
|
|
|
8133
8137
|
});
|
|
8134
8138
|
}
|
|
8135
8139
|
|
|
8136
|
-
copy()
|
|
8140
|
+
copy()
|
|
8141
|
+
{
|
|
8137
8142
|
navigator.clipboard.type = this.type;
|
|
8138
8143
|
navigator.clipboard.customIdx = this.customIdx;
|
|
8139
8144
|
navigator.clipboard.data = this.value();
|
|
8140
8145
|
navigator.clipboard.writeText( navigator.clipboard.data );
|
|
8141
8146
|
}
|
|
8142
8147
|
|
|
8143
|
-
paste()
|
|
8148
|
+
paste()
|
|
8149
|
+
{
|
|
8144
8150
|
if( !this._canPaste() )
|
|
8145
8151
|
{
|
|
8146
8152
|
return;
|
|
@@ -8149,8 +8155,8 @@ class BaseComponent {
|
|
|
8149
8155
|
this.set( navigator.clipboard.data );
|
|
8150
8156
|
}
|
|
8151
8157
|
|
|
8152
|
-
typeName()
|
|
8153
|
-
|
|
8158
|
+
typeName()
|
|
8159
|
+
{
|
|
8154
8160
|
switch( this.type )
|
|
8155
8161
|
{
|
|
8156
8162
|
case BaseComponent.TEXT: return "Text";
|
|
@@ -8202,8 +8208,8 @@ function ADD_CUSTOM_COMPONENT( customComponentName, options = {} )
|
|
|
8202
8208
|
{
|
|
8203
8209
|
let customIdx = LX.guidGenerator();
|
|
8204
8210
|
|
|
8205
|
-
LX.Panel.prototype[ 'add' + customComponentName ] = function( name, instance, callback )
|
|
8206
|
-
|
|
8211
|
+
LX.Panel.prototype[ 'add' + customComponentName ] = function( name, instance, callback )
|
|
8212
|
+
{
|
|
8207
8213
|
const userParams = Array.from( arguments ).slice( 3 );
|
|
8208
8214
|
|
|
8209
8215
|
let component = new BaseComponent( BaseComponent.CUSTOM, name, null, options );
|
|
@@ -8389,8 +8395,8 @@ LX.ADD_CUSTOM_COMPONENT = ADD_CUSTOM_COMPONENT;
|
|
|
8389
8395
|
|
|
8390
8396
|
class NodeTree {
|
|
8391
8397
|
|
|
8392
|
-
constructor( domEl, data, options )
|
|
8393
|
-
|
|
8398
|
+
constructor( domEl, data, options )
|
|
8399
|
+
{
|
|
8394
8400
|
this.domEl = domEl;
|
|
8395
8401
|
this.data = data;
|
|
8396
8402
|
this.onevent = options.onevent;
|
|
@@ -8412,8 +8418,8 @@ class NodeTree {
|
|
|
8412
8418
|
}
|
|
8413
8419
|
}
|
|
8414
8420
|
|
|
8415
|
-
_createItem( parent, node, level = 0, selectedId )
|
|
8416
|
-
|
|
8421
|
+
_createItem( parent, node, level = 0, selectedId )
|
|
8422
|
+
{
|
|
8417
8423
|
const that = this;
|
|
8418
8424
|
const nodeFilterInput = this.domEl.querySelector( ".lexnodetreefilter" );
|
|
8419
8425
|
|
|
@@ -8439,7 +8445,7 @@ class NodeTree {
|
|
|
8439
8445
|
if( this.options.onlyFolders )
|
|
8440
8446
|
{
|
|
8441
8447
|
let hasFolders = false;
|
|
8442
|
-
node.children.forEach( c => hasFolders |= (c.type == 'folder') );
|
|
8448
|
+
node.children.forEach( c => hasFolders |= ( c.type == 'folder' ) );
|
|
8443
8449
|
isParent = !!hasFolders;
|
|
8444
8450
|
}
|
|
8445
8451
|
|
|
@@ -8519,7 +8525,7 @@ class NodeTree {
|
|
|
8519
8525
|
node.closed = false;
|
|
8520
8526
|
if( that.onevent )
|
|
8521
8527
|
{
|
|
8522
|
-
const event = new LX.TreeEvent( LX.TreeEvent.NODE_CARETCHANGED, node, node.closed );
|
|
8528
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_CARETCHANGED, node, node.closed, e );
|
|
8523
8529
|
that.onevent( event );
|
|
8524
8530
|
}
|
|
8525
8531
|
that.frefresh( node.id );
|
|
@@ -8527,13 +8533,13 @@ class NodeTree {
|
|
|
8527
8533
|
|
|
8528
8534
|
if( that.onevent )
|
|
8529
8535
|
{
|
|
8530
|
-
const event = new LX.TreeEvent(LX.TreeEvent.NODE_SELECTED,
|
|
8536
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_SELECTED, node, this.selected, e );
|
|
8531
8537
|
event.multiple = e.shiftKey;
|
|
8532
8538
|
that.onevent( event );
|
|
8533
8539
|
}
|
|
8534
8540
|
});
|
|
8535
8541
|
|
|
8536
|
-
item.addEventListener("dblclick", function() {
|
|
8542
|
+
item.addEventListener("dblclick", function(e) {
|
|
8537
8543
|
|
|
8538
8544
|
if( that.options.rename ?? true )
|
|
8539
8545
|
{
|
|
@@ -8544,7 +8550,7 @@ class NodeTree {
|
|
|
8544
8550
|
|
|
8545
8551
|
if( that.onevent )
|
|
8546
8552
|
{
|
|
8547
|
-
const event = new LX.TreeEvent( LX.TreeEvent.NODE_DBLCLICKED, node );
|
|
8553
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_DBLCLICKED, node, null, e );
|
|
8548
8554
|
that.onevent( event );
|
|
8549
8555
|
}
|
|
8550
8556
|
});
|
|
@@ -8558,10 +8564,10 @@ class NodeTree {
|
|
|
8558
8564
|
return;
|
|
8559
8565
|
}
|
|
8560
8566
|
|
|
8561
|
-
const event = new LX.TreeEvent(LX.TreeEvent.NODE_CONTEXTMENU,
|
|
8567
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_CONTEXTMENU, node, this.selected, e );
|
|
8562
8568
|
event.multiple = this.selected.length > 1;
|
|
8563
8569
|
|
|
8564
|
-
LX.addContextMenu( event.multiple ? "Selected Nodes" : event.node.id, event.
|
|
8570
|
+
LX.addContextMenu( event.multiple ? "Selected Nodes" : event.node.id, event.event, m => {
|
|
8565
8571
|
event.panel = m;
|
|
8566
8572
|
});
|
|
8567
8573
|
|
|
@@ -8610,7 +8616,7 @@ class NodeTree {
|
|
|
8610
8616
|
|
|
8611
8617
|
if( ok && that.onevent )
|
|
8612
8618
|
{
|
|
8613
|
-
const event = new LX.TreeEvent( LX.TreeEvent.NODE_DELETED, node,
|
|
8619
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_DELETED, node, [ node ], null );
|
|
8614
8620
|
that.onevent( event );
|
|
8615
8621
|
}
|
|
8616
8622
|
|
|
@@ -8643,7 +8649,7 @@ class NodeTree {
|
|
|
8643
8649
|
// Send event now so we have the info in selected array..
|
|
8644
8650
|
if( nodesDeleted.length && that.onevent )
|
|
8645
8651
|
{
|
|
8646
|
-
const event = new LX.TreeEvent( LX.TreeEvent.NODE_DELETED,
|
|
8652
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_DELETED, node, nodesDeleted, e );
|
|
8647
8653
|
event.multiple = nodesDeleted.length > 1;
|
|
8648
8654
|
that.onevent( event );
|
|
8649
8655
|
}
|
|
@@ -8685,7 +8691,7 @@ class NodeTree {
|
|
|
8685
8691
|
|
|
8686
8692
|
if( that.onevent )
|
|
8687
8693
|
{
|
|
8688
|
-
const event = new LX.TreeEvent(LX.TreeEvent.NODE_RENAMED, node, this.value);
|
|
8694
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_RENAMED, node, this.value, e );
|
|
8689
8695
|
that.onevent( event );
|
|
8690
8696
|
}
|
|
8691
8697
|
|
|
@@ -8759,7 +8765,7 @@ class NodeTree {
|
|
|
8759
8765
|
// Trigger node dragger event
|
|
8760
8766
|
if( that.onevent )
|
|
8761
8767
|
{
|
|
8762
|
-
const event = new LX.TreeEvent(LX.TreeEvent.NODE_DRAGGED, dragged, target);
|
|
8768
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_DRAGGED, dragged, target, e );
|
|
8763
8769
|
that.onevent( event );
|
|
8764
8770
|
}
|
|
8765
8771
|
|
|
@@ -8800,7 +8806,7 @@ class NodeTree {
|
|
|
8800
8806
|
|
|
8801
8807
|
if( that.onevent )
|
|
8802
8808
|
{
|
|
8803
|
-
const event = new LX.TreeEvent(LX.TreeEvent.NODE_CARETCHANGED, node, node.closed);
|
|
8809
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_CARETCHANGED, node, node.closed, e );
|
|
8804
8810
|
that.onevent( event );
|
|
8805
8811
|
}
|
|
8806
8812
|
that.frefresh( node.id );
|
|
@@ -8817,28 +8823,34 @@ class NodeTree {
|
|
|
8817
8823
|
for( let i = 0; i < node.actions.length; ++i )
|
|
8818
8824
|
{
|
|
8819
8825
|
const action = node.actions[ i ];
|
|
8820
|
-
const
|
|
8821
|
-
|
|
8826
|
+
const actionBtn = new LX.Button( null, "", ( swapValue, event ) => {
|
|
8827
|
+
event.stopPropagation();
|
|
8822
8828
|
if( action.callback )
|
|
8823
8829
|
{
|
|
8824
|
-
action.callback( node,
|
|
8825
|
-
e.stopPropagation();
|
|
8830
|
+
action.callback( node, swapValue, event );
|
|
8826
8831
|
}
|
|
8827
|
-
});
|
|
8832
|
+
}, { icon: action.icon, swap: action.swap, title: action.name, hideName:true, className: "p-0 m-0", buttonClass: "p-0 m-0 bg-none" } );
|
|
8833
|
+
actionBtn.root.style.minWidth = "fit-content";
|
|
8834
|
+
actionBtn.root.style.margin = "0"; // adding classes does not work
|
|
8835
|
+
actionBtn.root.style.padding = "0"; // adding classes does not work
|
|
8836
|
+
const _btn = actionBtn.root.querySelector("button");
|
|
8837
|
+
_btn.style.minWidth = "fit-content";
|
|
8838
|
+
_btn.style.margin = "0"; // adding classes does not work
|
|
8839
|
+
_btn.style.padding = "0"; // adding classes does not work
|
|
8828
8840
|
|
|
8829
|
-
inputContainer.appendChild(
|
|
8841
|
+
inputContainer.appendChild( actionBtn.root );
|
|
8830
8842
|
}
|
|
8831
8843
|
}
|
|
8832
8844
|
|
|
8833
8845
|
if( !node.skipVisibility ?? false )
|
|
8834
8846
|
{
|
|
8835
|
-
const visibilityBtn = new LX.Button( null, "", ( swapValue,
|
|
8836
|
-
|
|
8847
|
+
const visibilityBtn = new LX.Button( null, "", ( swapValue, e ) => {
|
|
8848
|
+
e.stopPropagation();
|
|
8837
8849
|
node.visible = node.visible === undefined ? false : !node.visible;
|
|
8838
8850
|
// Trigger visibility event
|
|
8839
8851
|
if( that.onevent )
|
|
8840
8852
|
{
|
|
8841
|
-
const event = new LX.TreeEvent( LX.TreeEvent.NODE_VISIBILITY, node, node.visible );
|
|
8853
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_VISIBILITY, node, node.visible, e );
|
|
8842
8854
|
that.onevent( event );
|
|
8843
8855
|
}
|
|
8844
8856
|
}, { icon: node.visible ? "Eye" : "EyeOff", swap: node.visible ? "EyeOff" : "Eye", title: "Toggle visible", className: "p-0 m-0", buttonClass: "bg-none" } );
|
|
@@ -8894,22 +8906,35 @@ class NodeTree {
|
|
|
8894
8906
|
}
|
|
8895
8907
|
|
|
8896
8908
|
/* Refreshes the tree and focuses current element */
|
|
8897
|
-
frefresh( id )
|
|
8898
|
-
|
|
8909
|
+
frefresh( id )
|
|
8910
|
+
{
|
|
8899
8911
|
this.refresh();
|
|
8900
|
-
var el = this.domEl.querySelector(
|
|
8912
|
+
var el = this.domEl.querySelector( `#${ id }` );
|
|
8901
8913
|
if( el )
|
|
8902
8914
|
{
|
|
8903
8915
|
el.focus();
|
|
8904
8916
|
}
|
|
8905
8917
|
}
|
|
8906
8918
|
|
|
8907
|
-
select( id )
|
|
8919
|
+
select( id )
|
|
8920
|
+
{
|
|
8921
|
+
const nodeFilter = this.domEl.querySelector( ".lexnodetreefilter" );
|
|
8922
|
+
if( nodeFilter )
|
|
8923
|
+
{
|
|
8924
|
+
nodeFilter.value = "";
|
|
8925
|
+
}
|
|
8908
8926
|
|
|
8909
8927
|
this.refresh( null, id );
|
|
8910
8928
|
|
|
8911
8929
|
this.domEl.querySelectorAll( ".selected" ).forEach( i => i.classList.remove( "selected" ) );
|
|
8912
8930
|
|
|
8931
|
+
// Unselect
|
|
8932
|
+
if( !id )
|
|
8933
|
+
{
|
|
8934
|
+
this.selected.length = 0;
|
|
8935
|
+
return;
|
|
8936
|
+
}
|
|
8937
|
+
|
|
8913
8938
|
// Element should exist, since tree was refreshed to show it
|
|
8914
8939
|
const el = this.domEl.querySelector( "#" + id );
|
|
8915
8940
|
console.assert( el, "NodeTree: Can't select node " + id );
|
|
@@ -8919,8 +8944,8 @@ class NodeTree {
|
|
|
8919
8944
|
el.focus();
|
|
8920
8945
|
}
|
|
8921
8946
|
|
|
8922
|
-
deleteNode( node )
|
|
8923
|
-
|
|
8947
|
+
deleteNode( node )
|
|
8948
|
+
{
|
|
8924
8949
|
const dataAsArray = ( this.data.constructor === Array );
|
|
8925
8950
|
|
|
8926
8951
|
// Can be either Array or Object type data
|
|
@@ -8956,10 +8981,10 @@ LX.NodeTree = NodeTree;
|
|
|
8956
8981
|
* @description Blank Component
|
|
8957
8982
|
*/
|
|
8958
8983
|
|
|
8959
|
-
class Blank extends BaseComponent
|
|
8960
|
-
|
|
8961
|
-
constructor( width, height )
|
|
8962
|
-
|
|
8984
|
+
class Blank extends BaseComponent
|
|
8985
|
+
{
|
|
8986
|
+
constructor( width, height )
|
|
8987
|
+
{
|
|
8963
8988
|
super( BaseComponent.BLANK );
|
|
8964
8989
|
|
|
8965
8990
|
this.root.style.width = width ?? "auto";
|
|
@@ -8974,10 +8999,10 @@ LX.Blank = Blank;
|
|
|
8974
8999
|
* @description Title Component
|
|
8975
9000
|
*/
|
|
8976
9001
|
|
|
8977
|
-
class Title extends BaseComponent
|
|
8978
|
-
|
|
8979
|
-
constructor( name, options = {} )
|
|
8980
|
-
|
|
9002
|
+
class Title extends BaseComponent
|
|
9003
|
+
{
|
|
9004
|
+
constructor( name, options = {} )
|
|
9005
|
+
{
|
|
8981
9006
|
console.assert( name, "Can't create Title Component without text!" );
|
|
8982
9007
|
|
|
8983
9008
|
// Note: Titles are not registered in Panel.components by now
|
|
@@ -9018,10 +9043,10 @@ LX.Title = Title;
|
|
|
9018
9043
|
* @description TextInput Component
|
|
9019
9044
|
*/
|
|
9020
9045
|
|
|
9021
|
-
class TextInput extends BaseComponent
|
|
9022
|
-
|
|
9023
|
-
constructor( name, value, callback, options = {} )
|
|
9024
|
-
|
|
9046
|
+
class TextInput extends BaseComponent
|
|
9047
|
+
{
|
|
9048
|
+
constructor( name, value, callback, options = {} )
|
|
9049
|
+
{
|
|
9025
9050
|
super( BaseComponent.TEXT, name, String( value ), options );
|
|
9026
9051
|
|
|
9027
9052
|
this.onGetValue = () => {
|
|
@@ -9108,7 +9133,7 @@ class TextInput extends BaseComponent {
|
|
|
9108
9133
|
});
|
|
9109
9134
|
}
|
|
9110
9135
|
|
|
9111
|
-
wValue.addEventListener( "mousedown", function( e ){
|
|
9136
|
+
wValue.addEventListener( "mousedown", function( e ) {
|
|
9112
9137
|
e.stopImmediatePropagation();
|
|
9113
9138
|
e.stopPropagation();
|
|
9114
9139
|
});
|
|
@@ -9158,10 +9183,10 @@ LX.TextInput = TextInput;
|
|
|
9158
9183
|
* @description TextArea Component
|
|
9159
9184
|
*/
|
|
9160
9185
|
|
|
9161
|
-
class TextArea extends BaseComponent
|
|
9162
|
-
|
|
9163
|
-
constructor( name, value, callback, options = {} )
|
|
9164
|
-
|
|
9186
|
+
class TextArea extends BaseComponent
|
|
9187
|
+
{
|
|
9188
|
+
constructor( name, value, callback, options = {} )
|
|
9189
|
+
{
|
|
9165
9190
|
super( BaseComponent.TEXTAREA, name, value, options );
|
|
9166
9191
|
|
|
9167
9192
|
this.onGetValue = () => {
|
|
@@ -9259,10 +9284,10 @@ LX.TextArea = TextArea;
|
|
|
9259
9284
|
* @description Button Component
|
|
9260
9285
|
*/
|
|
9261
9286
|
|
|
9262
|
-
class Button extends BaseComponent
|
|
9263
|
-
|
|
9264
|
-
constructor( name, value, callback, options = {} )
|
|
9265
|
-
|
|
9287
|
+
class Button extends BaseComponent
|
|
9288
|
+
{
|
|
9289
|
+
constructor( name, value, callback, options = {} )
|
|
9290
|
+
{
|
|
9266
9291
|
super( BaseComponent.BUTTON, name, null, options );
|
|
9267
9292
|
|
|
9268
9293
|
this.onGetValue = () => {
|
|
@@ -9481,10 +9506,10 @@ LX.Button = Button;
|
|
|
9481
9506
|
* @description ComboButtons Component
|
|
9482
9507
|
*/
|
|
9483
9508
|
|
|
9484
|
-
class ComboButtons extends BaseComponent
|
|
9485
|
-
|
|
9486
|
-
constructor( name, values, options = {} )
|
|
9487
|
-
|
|
9509
|
+
class ComboButtons extends BaseComponent
|
|
9510
|
+
{
|
|
9511
|
+
constructor( name, values, options = {} )
|
|
9512
|
+
{
|
|
9488
9513
|
const shouldSelect = !( options.noSelection ?? false );
|
|
9489
9514
|
let shouldToggle = shouldSelect && ( options.toggle ?? false );
|
|
9490
9515
|
|
|
@@ -9642,10 +9667,10 @@ LX.ComboButtons = ComboButtons;
|
|
|
9642
9667
|
* @description Card Component
|
|
9643
9668
|
*/
|
|
9644
9669
|
|
|
9645
|
-
class Card extends BaseComponent
|
|
9646
|
-
|
|
9647
|
-
constructor( name, options = {} )
|
|
9648
|
-
|
|
9670
|
+
class Card extends BaseComponent
|
|
9671
|
+
{
|
|
9672
|
+
constructor( name, options = {} )
|
|
9673
|
+
{
|
|
9649
9674
|
options.hideName = true;
|
|
9650
9675
|
|
|
9651
9676
|
super( BaseComponent.CARD, name, null, options );
|
|
@@ -9705,10 +9730,10 @@ LX.Card = Card;
|
|
|
9705
9730
|
* @description Form Component
|
|
9706
9731
|
*/
|
|
9707
9732
|
|
|
9708
|
-
class Form extends BaseComponent
|
|
9709
|
-
|
|
9710
|
-
constructor( name, data, callback, options = {} )
|
|
9711
|
-
|
|
9733
|
+
class Form extends BaseComponent
|
|
9734
|
+
{
|
|
9735
|
+
constructor( name, data, callback, options = {} )
|
|
9736
|
+
{
|
|
9712
9737
|
if( data.constructor != Object )
|
|
9713
9738
|
{
|
|
9714
9739
|
console.error( "Form data must be an Object" );
|
|
@@ -9820,10 +9845,10 @@ LX.Form = Form;
|
|
|
9820
9845
|
* @description Select Component
|
|
9821
9846
|
*/
|
|
9822
9847
|
|
|
9823
|
-
class Select extends BaseComponent
|
|
9824
|
-
|
|
9825
|
-
constructor( name, values, value, callback, options = {} )
|
|
9826
|
-
|
|
9848
|
+
class Select extends BaseComponent
|
|
9849
|
+
{
|
|
9850
|
+
constructor( name, values, value, callback, options = {} )
|
|
9851
|
+
{
|
|
9827
9852
|
super( BaseComponent.SELECT, name, value, options );
|
|
9828
9853
|
|
|
9829
9854
|
this.onGetValue = () => {
|
|
@@ -10232,10 +10257,10 @@ LX.Select = Select;
|
|
|
10232
10257
|
* @description Curve Component
|
|
10233
10258
|
*/
|
|
10234
10259
|
|
|
10235
|
-
class Curve extends BaseComponent
|
|
10236
|
-
|
|
10237
|
-
constructor( name, values, callback, options = {} )
|
|
10238
|
-
|
|
10260
|
+
class Curve extends BaseComponent
|
|
10261
|
+
{
|
|
10262
|
+
constructor( name, values, callback, options = {} )
|
|
10263
|
+
{
|
|
10239
10264
|
let defaultValues = JSON.parse( JSON.stringify( values ) );
|
|
10240
10265
|
|
|
10241
10266
|
super( BaseComponent.CURVE, name, defaultValues, options );
|
|
@@ -10293,10 +10318,10 @@ LX.Curve = Curve;
|
|
|
10293
10318
|
* @description Dial Component
|
|
10294
10319
|
*/
|
|
10295
10320
|
|
|
10296
|
-
class Dial extends BaseComponent
|
|
10297
|
-
|
|
10298
|
-
constructor( name, values, callback, options = {} )
|
|
10299
|
-
|
|
10321
|
+
class Dial extends BaseComponent
|
|
10322
|
+
{
|
|
10323
|
+
constructor( name, values, callback, options = {} )
|
|
10324
|
+
{
|
|
10300
10325
|
let defaultValues = JSON.parse( JSON.stringify( values ) );
|
|
10301
10326
|
|
|
10302
10327
|
super( BaseComponent.DIAL, name, defaultValues, options );
|
|
@@ -10350,10 +10375,10 @@ LX.Dial = Dial;
|
|
|
10350
10375
|
* @description Layers Component
|
|
10351
10376
|
*/
|
|
10352
10377
|
|
|
10353
|
-
class Layers extends BaseComponent
|
|
10354
|
-
|
|
10355
|
-
constructor( name, value, callback, options = {} )
|
|
10356
|
-
|
|
10378
|
+
class Layers extends BaseComponent
|
|
10379
|
+
{
|
|
10380
|
+
constructor( name, value, callback, options = {} )
|
|
10381
|
+
{
|
|
10357
10382
|
super( BaseComponent.LAYERS, name, value, options );
|
|
10358
10383
|
|
|
10359
10384
|
this.onGetValue = () => {
|
|
@@ -10434,10 +10459,10 @@ LX.Layers = Layers;
|
|
|
10434
10459
|
* @description ItemArray Component
|
|
10435
10460
|
*/
|
|
10436
10461
|
|
|
10437
|
-
class ItemArray extends BaseComponent
|
|
10438
|
-
|
|
10439
|
-
constructor( name, values = [], callback, options = {} )
|
|
10440
|
-
|
|
10462
|
+
class ItemArray extends BaseComponent
|
|
10463
|
+
{
|
|
10464
|
+
constructor( name, values = [], callback, options = {} )
|
|
10465
|
+
{
|
|
10441
10466
|
options.nameWidth = "100%";
|
|
10442
10467
|
|
|
10443
10468
|
super( BaseComponent.ARRAY, name, null, options );
|
|
@@ -10552,10 +10577,10 @@ LX.ItemArray = ItemArray;
|
|
|
10552
10577
|
* @description List Component
|
|
10553
10578
|
*/
|
|
10554
10579
|
|
|
10555
|
-
class List extends BaseComponent
|
|
10556
|
-
|
|
10557
|
-
constructor( name, values, value, callback, options = {} )
|
|
10558
|
-
|
|
10580
|
+
class List extends BaseComponent
|
|
10581
|
+
{
|
|
10582
|
+
constructor( name, values, value, callback, options = {} )
|
|
10583
|
+
{
|
|
10559
10584
|
super( BaseComponent.LIST, name, value, options );
|
|
10560
10585
|
|
|
10561
10586
|
this.onGetValue = () => {
|
|
@@ -10652,10 +10677,10 @@ LX.List = List;
|
|
|
10652
10677
|
* @description Tags Component
|
|
10653
10678
|
*/
|
|
10654
10679
|
|
|
10655
|
-
class Tags extends BaseComponent
|
|
10656
|
-
|
|
10657
|
-
constructor( name, value, callback, options = {} )
|
|
10658
|
-
|
|
10680
|
+
class Tags extends BaseComponent
|
|
10681
|
+
{
|
|
10682
|
+
constructor( name, value, callback, options = {} )
|
|
10683
|
+
{
|
|
10659
10684
|
value = value.replace( /\s/g, '' ).split( ',' );
|
|
10660
10685
|
|
|
10661
10686
|
let defaultValue = [].concat( value );
|
|
@@ -10741,10 +10766,10 @@ LX.Tags = Tags;
|
|
|
10741
10766
|
* @description Checkbox Component
|
|
10742
10767
|
*/
|
|
10743
10768
|
|
|
10744
|
-
class Checkbox extends BaseComponent
|
|
10745
|
-
|
|
10746
|
-
constructor( name, value, callback, options = {} )
|
|
10747
|
-
|
|
10769
|
+
class Checkbox extends BaseComponent
|
|
10770
|
+
{
|
|
10771
|
+
constructor( name, value, callback, options = {} )
|
|
10772
|
+
{
|
|
10748
10773
|
if( !name && !options.label )
|
|
10749
10774
|
{
|
|
10750
10775
|
throw( "Set Component Name or at least a label!" );
|
|
@@ -10824,10 +10849,10 @@ LX.Checkbox = Checkbox;
|
|
|
10824
10849
|
* @description Toggle Component
|
|
10825
10850
|
*/
|
|
10826
10851
|
|
|
10827
|
-
class Toggle extends BaseComponent
|
|
10828
|
-
|
|
10829
|
-
constructor( name, value, callback, options = {} )
|
|
10830
|
-
|
|
10852
|
+
class Toggle extends BaseComponent
|
|
10853
|
+
{
|
|
10854
|
+
constructor( name, value, callback, options = {} )
|
|
10855
|
+
{
|
|
10831
10856
|
if( !name && !options.label )
|
|
10832
10857
|
{
|
|
10833
10858
|
throw( "Set Component Name or at least a label!" );
|
|
@@ -10908,10 +10933,10 @@ LX.Toggle = Toggle;
|
|
|
10908
10933
|
* @description RadioGroup Component
|
|
10909
10934
|
*/
|
|
10910
10935
|
|
|
10911
|
-
class RadioGroup extends BaseComponent
|
|
10912
|
-
|
|
10913
|
-
constructor( name, label, values, callback, options = {} )
|
|
10914
|
-
|
|
10936
|
+
class RadioGroup extends BaseComponent
|
|
10937
|
+
{
|
|
10938
|
+
constructor( name, label, values, callback, options = {} )
|
|
10939
|
+
{
|
|
10915
10940
|
super( BaseComponent.RADIO, name, null, options );
|
|
10916
10941
|
|
|
10917
10942
|
let currentIndex = null;
|
|
@@ -10987,10 +11012,10 @@ LX.RadioGroup = RadioGroup;
|
|
|
10987
11012
|
* @description ColorInput Component
|
|
10988
11013
|
*/
|
|
10989
11014
|
|
|
10990
|
-
class ColorInput extends BaseComponent
|
|
10991
|
-
|
|
10992
|
-
constructor( name, value, callback, options = {} )
|
|
10993
|
-
|
|
11015
|
+
class ColorInput extends BaseComponent
|
|
11016
|
+
{
|
|
11017
|
+
constructor( name, value, callback, options = {} )
|
|
11018
|
+
{
|
|
10994
11019
|
value = value ?? "#000000";
|
|
10995
11020
|
|
|
10996
11021
|
const useAlpha = options.useAlpha ??
|
|
@@ -11110,10 +11135,10 @@ LX.ColorInput = ColorInput;
|
|
|
11110
11135
|
* @description RangeInput Component
|
|
11111
11136
|
*/
|
|
11112
11137
|
|
|
11113
|
-
class RangeInput extends BaseComponent
|
|
11114
|
-
|
|
11115
|
-
constructor( name, value, callback, options = {} )
|
|
11116
|
-
|
|
11138
|
+
class RangeInput extends BaseComponent
|
|
11139
|
+
{
|
|
11140
|
+
constructor( name, value, callback, options = {} )
|
|
11141
|
+
{
|
|
11117
11142
|
const ogValue = LX.deepCopy( value );
|
|
11118
11143
|
|
|
11119
11144
|
super( BaseComponent.RANGE, name, LX.deepCopy( ogValue ), options );
|
|
@@ -11324,10 +11349,10 @@ LX.RangeInput = RangeInput;
|
|
|
11324
11349
|
* @description NumberInput Component
|
|
11325
11350
|
*/
|
|
11326
11351
|
|
|
11327
|
-
class NumberInput extends BaseComponent
|
|
11328
|
-
|
|
11329
|
-
constructor( name, value, callback, options = {} )
|
|
11330
|
-
|
|
11352
|
+
class NumberInput extends BaseComponent
|
|
11353
|
+
{
|
|
11354
|
+
constructor( name, value, callback, options = {} )
|
|
11355
|
+
{
|
|
11331
11356
|
super( BaseComponent.NUMBER, name, value, options );
|
|
11332
11357
|
|
|
11333
11358
|
this.onGetValue = () => {
|
|
@@ -11546,10 +11571,10 @@ LX.NumberInput = NumberInput;
|
|
|
11546
11571
|
* @description Vector Component
|
|
11547
11572
|
*/
|
|
11548
11573
|
|
|
11549
|
-
class Vector extends BaseComponent
|
|
11550
|
-
|
|
11551
|
-
constructor( numComponents, name, value, callback, options = {} )
|
|
11552
|
-
|
|
11574
|
+
class Vector extends BaseComponent
|
|
11575
|
+
{
|
|
11576
|
+
constructor( numComponents, name, value, callback, options = {} )
|
|
11577
|
+
{
|
|
11553
11578
|
numComponents = LX.clamp( numComponents, 2, 4 );
|
|
11554
11579
|
value = value ?? new Array( numComponents ).fill( 0 );
|
|
11555
11580
|
|
|
@@ -11796,10 +11821,10 @@ LX.Vector = Vector;
|
|
|
11796
11821
|
* @description SizeInput Component
|
|
11797
11822
|
*/
|
|
11798
11823
|
|
|
11799
|
-
class SizeInput extends BaseComponent
|
|
11800
|
-
|
|
11801
|
-
constructor( name, value, callback, options = {} )
|
|
11802
|
-
|
|
11824
|
+
class SizeInput extends BaseComponent
|
|
11825
|
+
{
|
|
11826
|
+
constructor( name, value, callback, options = {} )
|
|
11827
|
+
{
|
|
11803
11828
|
super( BaseComponent.SIZE, name, value, options );
|
|
11804
11829
|
|
|
11805
11830
|
this.onGetValue = () => {
|
|
@@ -11884,10 +11909,10 @@ LX.SizeInput = SizeInput;
|
|
|
11884
11909
|
* @description OTPInput Component
|
|
11885
11910
|
*/
|
|
11886
11911
|
|
|
11887
|
-
class OTPInput extends BaseComponent
|
|
11888
|
-
|
|
11889
|
-
constructor( name, value, callback, options = {} )
|
|
11890
|
-
|
|
11912
|
+
class OTPInput extends BaseComponent
|
|
11913
|
+
{
|
|
11914
|
+
constructor( name, value, callback, options = {} )
|
|
11915
|
+
{
|
|
11891
11916
|
const pattern = options.pattern ?? "xxx-xxx";
|
|
11892
11917
|
const patternSize = ( pattern.match(/x/g) || [] ).length;
|
|
11893
11918
|
|
|
@@ -12042,10 +12067,10 @@ LX.OTPInput = OTPInput;
|
|
|
12042
12067
|
* @description Pad Component
|
|
12043
12068
|
*/
|
|
12044
12069
|
|
|
12045
|
-
class Pad extends BaseComponent
|
|
12046
|
-
|
|
12047
|
-
constructor( name, value, callback, options = {} )
|
|
12048
|
-
|
|
12070
|
+
class Pad extends BaseComponent
|
|
12071
|
+
{
|
|
12072
|
+
constructor( name, value, callback, options = {} )
|
|
12073
|
+
{
|
|
12049
12074
|
super( BaseComponent.PAD, name, null, options );
|
|
12050
12075
|
|
|
12051
12076
|
this.onGetValue = () => {
|
|
@@ -12162,10 +12187,10 @@ LX.Pad = Pad;
|
|
|
12162
12187
|
* @description Progress Component
|
|
12163
12188
|
*/
|
|
12164
12189
|
|
|
12165
|
-
class Progress extends BaseComponent
|
|
12166
|
-
|
|
12167
|
-
constructor( name, value, options = {} )
|
|
12168
|
-
|
|
12190
|
+
class Progress extends BaseComponent
|
|
12191
|
+
{
|
|
12192
|
+
constructor( name, value, options = {} )
|
|
12193
|
+
{
|
|
12169
12194
|
super( BaseComponent.PROGRESS, name, value, options );
|
|
12170
12195
|
|
|
12171
12196
|
this.onGetValue = () => {
|
|
@@ -12299,10 +12324,10 @@ LX.Progress = Progress;
|
|
|
12299
12324
|
* @description FileInput Component
|
|
12300
12325
|
*/
|
|
12301
12326
|
|
|
12302
|
-
class FileInput extends BaseComponent
|
|
12303
|
-
|
|
12304
|
-
constructor( name, callback, options = { } )
|
|
12305
|
-
|
|
12327
|
+
class FileInput extends BaseComponent
|
|
12328
|
+
{
|
|
12329
|
+
constructor( name, callback, options = { } )
|
|
12330
|
+
{
|
|
12306
12331
|
super( BaseComponent.FILE, name, null, options );
|
|
12307
12332
|
|
|
12308
12333
|
let local = options.local ?? true;
|
|
@@ -12384,10 +12409,10 @@ LX.FileInput = FileInput;
|
|
|
12384
12409
|
* @description Tree Component
|
|
12385
12410
|
*/
|
|
12386
12411
|
|
|
12387
|
-
class Tree extends BaseComponent
|
|
12388
|
-
|
|
12389
|
-
constructor( name, data, options = {} )
|
|
12390
|
-
|
|
12412
|
+
class Tree extends BaseComponent
|
|
12413
|
+
{
|
|
12414
|
+
constructor( name, data, options = {} )
|
|
12415
|
+
{
|
|
12391
12416
|
options.hideName = true;
|
|
12392
12417
|
|
|
12393
12418
|
super( BaseComponent.TREE, name, null, options );
|
|
@@ -12466,10 +12491,10 @@ LX.Tree = Tree;
|
|
|
12466
12491
|
* @description TabSections Component
|
|
12467
12492
|
*/
|
|
12468
12493
|
|
|
12469
|
-
class TabSections extends BaseComponent
|
|
12470
|
-
|
|
12471
|
-
constructor( name, tabs, options = {} )
|
|
12472
|
-
|
|
12494
|
+
class TabSections extends BaseComponent
|
|
12495
|
+
{
|
|
12496
|
+
constructor( name, tabs, options = {} )
|
|
12497
|
+
{
|
|
12473
12498
|
options.hideName = true;
|
|
12474
12499
|
|
|
12475
12500
|
super( BaseComponent.TABS, name, null, options );
|
|
@@ -12573,10 +12598,10 @@ LX.TabSections = TabSections;
|
|
|
12573
12598
|
* @description Counter Component
|
|
12574
12599
|
*/
|
|
12575
12600
|
|
|
12576
|
-
class Counter extends BaseComponent
|
|
12577
|
-
|
|
12578
|
-
constructor( name, value, callback, options = { } )
|
|
12579
|
-
|
|
12601
|
+
class Counter extends BaseComponent
|
|
12602
|
+
{
|
|
12603
|
+
constructor( name, value, callback, options = { } )
|
|
12604
|
+
{
|
|
12580
12605
|
super( BaseComponent.COUNTER, name, value, options );
|
|
12581
12606
|
|
|
12582
12607
|
this.onGetValue = () => {
|
|
@@ -12643,10 +12668,10 @@ LX.Counter = Counter;
|
|
|
12643
12668
|
* @description Table Component
|
|
12644
12669
|
*/
|
|
12645
12670
|
|
|
12646
|
-
class Table extends BaseComponent
|
|
12647
|
-
|
|
12648
|
-
constructor( name, data, options = { } )
|
|
12649
|
-
|
|
12671
|
+
class Table extends BaseComponent
|
|
12672
|
+
{
|
|
12673
|
+
constructor( name, data, options = { } )
|
|
12674
|
+
{
|
|
12650
12675
|
if( !data )
|
|
12651
12676
|
{
|
|
12652
12677
|
throw( "Data is needed to create a table!" );
|
|
@@ -12679,12 +12704,12 @@ class Table extends BaseComponent {
|
|
|
12679
12704
|
data.body = data.body ?? [];
|
|
12680
12705
|
data.checkMap = { };
|
|
12681
12706
|
data.colVisibilityMap = { };
|
|
12682
|
-
data.head.forEach( (col, index) => { data.colVisibilityMap[ index ] = true; });
|
|
12707
|
+
data.head.forEach( ( col, index ) => { data.colVisibilityMap[ index ] = true; });
|
|
12683
12708
|
this.data = data;
|
|
12684
12709
|
|
|
12685
|
-
const compareFn = ( idx, order, a, b) => {
|
|
12686
|
-
if
|
|
12687
|
-
else if
|
|
12710
|
+
const compareFn = ( idx, order, a, b ) => {
|
|
12711
|
+
if( a[ idx ] < b[ idx ] ) return -order;
|
|
12712
|
+
else if( a[ idx ] > b[ idx ] ) return order;
|
|
12688
12713
|
return 0;
|
|
12689
12714
|
};
|
|
12690
12715
|
|
|
@@ -12854,10 +12879,10 @@ class Table extends BaseComponent {
|
|
|
12854
12879
|
icon: "Check",
|
|
12855
12880
|
callback: () => {
|
|
12856
12881
|
data.colVisibilityMap[ idx ] = !data.colVisibilityMap[ idx ];
|
|
12857
|
-
const cells = table.querySelectorAll(`tr > *:nth-child(${idx + this.rowOffsetCount + 1})`);
|
|
12858
|
-
cells.forEach(cell => {
|
|
12859
|
-
cell.style.display = (cell.style.display === "none") ? "" : "none";
|
|
12860
|
-
});
|
|
12882
|
+
const cells = table.querySelectorAll( `tr > *:nth-child(${idx + this.rowOffsetCount + 1})` );
|
|
12883
|
+
cells.forEach( cell => {
|
|
12884
|
+
cell.style.display = ( cell.style.display === "none" ) ? "" : "none";
|
|
12885
|
+
} );
|
|
12861
12886
|
}
|
|
12862
12887
|
};
|
|
12863
12888
|
if( !data.colVisibilityMap[ idx ] ) delete item.icon;
|
|
@@ -12952,9 +12977,9 @@ class Table extends BaseComponent {
|
|
|
12952
12977
|
name: "Hide", icon: "EyeOff", callback: () => {
|
|
12953
12978
|
data.colVisibilityMap[ idx ] = false;
|
|
12954
12979
|
const cells = table.querySelectorAll(`tr > *:nth-child(${idx + this.rowOffsetCount + 1})`);
|
|
12955
|
-
cells.forEach(cell => {
|
|
12956
|
-
cell.style.display = (cell.style.display === "none") ? "" : "none";
|
|
12957
|
-
});
|
|
12980
|
+
cells.forEach( cell => {
|
|
12981
|
+
cell.style.display = ( cell.style.display === "none" ) ? "" : "none";
|
|
12982
|
+
} );
|
|
12958
12983
|
}
|
|
12959
12984
|
}
|
|
12960
12985
|
);
|
|
@@ -13326,10 +13351,10 @@ class Table extends BaseComponent {
|
|
|
13326
13351
|
const idx = parseInt( v );
|
|
13327
13352
|
if( !data.colVisibilityMap[ idx ] )
|
|
13328
13353
|
{
|
|
13329
|
-
const cells = table.querySelectorAll(`tr > *:nth-child(${idx + this.rowOffsetCount + 1})`);
|
|
13330
|
-
cells.forEach(cell => {
|
|
13331
|
-
cell.style.display = (cell.style.display === "none") ? "" : "none";
|
|
13332
|
-
});
|
|
13354
|
+
const cells = table.querySelectorAll( `tr > *:nth-child(${idx + this.rowOffsetCount + 1})` );
|
|
13355
|
+
cells.forEach( cell => {
|
|
13356
|
+
cell.style.display = ( cell.style.display === "none" ) ? "" : "none";
|
|
13357
|
+
} );
|
|
13333
13358
|
}
|
|
13334
13359
|
}
|
|
13335
13360
|
};
|
|
@@ -13339,8 +13364,8 @@ class Table extends BaseComponent {
|
|
|
13339
13364
|
LX.doAsync( this.onResize.bind( this ) );
|
|
13340
13365
|
}
|
|
13341
13366
|
|
|
13342
|
-
getSelectedRows()
|
|
13343
|
-
|
|
13367
|
+
getSelectedRows()
|
|
13368
|
+
{
|
|
13344
13369
|
const selectedRows = [];
|
|
13345
13370
|
|
|
13346
13371
|
for( const row of this.data.body )
|
|
@@ -13355,8 +13380,8 @@ class Table extends BaseComponent {
|
|
|
13355
13380
|
return selectedRows;
|
|
13356
13381
|
}
|
|
13357
13382
|
|
|
13358
|
-
_setCentered( v )
|
|
13359
|
-
|
|
13383
|
+
_setCentered( v )
|
|
13384
|
+
{
|
|
13360
13385
|
if( v.constructor == Boolean )
|
|
13361
13386
|
{
|
|
13362
13387
|
const container = this.root.querySelector( ".lextable" );
|
|
@@ -13389,10 +13414,10 @@ LX.Table = Table;
|
|
|
13389
13414
|
* @description DatePicker Component
|
|
13390
13415
|
*/
|
|
13391
13416
|
|
|
13392
|
-
class DatePicker extends BaseComponent
|
|
13393
|
-
|
|
13394
|
-
constructor( name, dateValue, callback, options = { } )
|
|
13395
|
-
|
|
13417
|
+
class DatePicker extends BaseComponent
|
|
13418
|
+
{
|
|
13419
|
+
constructor( name, dateValue, callback, options = { } )
|
|
13420
|
+
{
|
|
13396
13421
|
super( BaseComponent.DATE, name, null, options );
|
|
13397
13422
|
|
|
13398
13423
|
const dateAsRange = ( dateValue?.constructor === Array );
|
|
@@ -13507,10 +13532,10 @@ LX.DatePicker = DatePicker;
|
|
|
13507
13532
|
* @description Map2D Component
|
|
13508
13533
|
*/
|
|
13509
13534
|
|
|
13510
|
-
class Map2D extends BaseComponent
|
|
13511
|
-
|
|
13512
|
-
constructor( name, points, callback, options = {} )
|
|
13513
|
-
|
|
13535
|
+
class Map2D extends BaseComponent
|
|
13536
|
+
{
|
|
13537
|
+
constructor( name, points, callback, options = {} )
|
|
13538
|
+
{
|
|
13514
13539
|
super( BaseComponent.MAP2D, name, null, options );
|
|
13515
13540
|
|
|
13516
13541
|
this.onGetValue = () => {
|
|
@@ -13554,13 +13579,13 @@ LX.Map2D = Map2D;
|
|
|
13554
13579
|
* @description Rate Component
|
|
13555
13580
|
*/
|
|
13556
13581
|
|
|
13557
|
-
class Rate extends BaseComponent
|
|
13558
|
-
|
|
13559
|
-
constructor( name, value, callback, options = {} )
|
|
13560
|
-
|
|
13582
|
+
class Rate extends BaseComponent
|
|
13583
|
+
{
|
|
13584
|
+
constructor( name, value, callback, options = {} )
|
|
13585
|
+
{
|
|
13561
13586
|
const allowHalf = options.allowHalf ?? false;
|
|
13562
13587
|
|
|
13563
|
-
if( !allowHalf)
|
|
13588
|
+
if( !allowHalf )
|
|
13564
13589
|
{
|
|
13565
13590
|
value = Math.floor( value );
|
|
13566
13591
|
}
|
|
@@ -13668,8 +13693,8 @@ class Rate extends BaseComponent {
|
|
|
13668
13693
|
}
|
|
13669
13694
|
}
|
|
13670
13695
|
|
|
13671
|
-
LX.Rate = Rate;
|
|
13672
|
-
|
|
13696
|
+
LX.Rate = Rate;
|
|
13697
|
+
|
|
13673
13698
|
// panel.js @jxarco
|
|
13674
13699
|
|
|
13675
13700
|
/**
|
|
@@ -14868,8 +14893,8 @@ class Panel {
|
|
|
14868
14893
|
}
|
|
14869
14894
|
}
|
|
14870
14895
|
|
|
14871
|
-
LX.Panel = Panel;
|
|
14872
|
-
|
|
14896
|
+
LX.Panel = Panel;
|
|
14897
|
+
|
|
14873
14898
|
// branch.js @jxarco
|
|
14874
14899
|
|
|
14875
14900
|
/**
|
|
@@ -15093,8 +15118,8 @@ class Branch {
|
|
|
15093
15118
|
}
|
|
15094
15119
|
}
|
|
15095
15120
|
}
|
|
15096
|
-
LX.Branch = Branch;
|
|
15097
|
-
|
|
15121
|
+
LX.Branch = Branch;
|
|
15122
|
+
|
|
15098
15123
|
// menubar.js @jxarco
|
|
15099
15124
|
|
|
15100
15125
|
/**
|
|
@@ -15103,8 +15128,8 @@ LX.Branch = Branch;
|
|
|
15103
15128
|
|
|
15104
15129
|
class Menubar {
|
|
15105
15130
|
|
|
15106
|
-
constructor( items, options = {} )
|
|
15107
|
-
|
|
15131
|
+
constructor( items, options = {} )
|
|
15132
|
+
{
|
|
15108
15133
|
this.root = document.createElement( "div" );
|
|
15109
15134
|
this.root.className = "lexmenubar";
|
|
15110
15135
|
|
|
@@ -15121,8 +15146,8 @@ class Menubar {
|
|
|
15121
15146
|
this.createEntries();
|
|
15122
15147
|
}
|
|
15123
15148
|
|
|
15124
|
-
_resetMenubar( focus )
|
|
15125
|
-
|
|
15149
|
+
_resetMenubar( focus )
|
|
15150
|
+
{
|
|
15126
15151
|
this.root.querySelectorAll(".lexmenuentry").forEach( e => {
|
|
15127
15152
|
e.classList.remove( 'selected' );
|
|
15128
15153
|
delete e.dataset[ "built" ];
|
|
@@ -15142,8 +15167,8 @@ class Menubar {
|
|
|
15142
15167
|
* @method createEntries
|
|
15143
15168
|
*/
|
|
15144
15169
|
|
|
15145
|
-
createEntries()
|
|
15146
|
-
|
|
15170
|
+
createEntries()
|
|
15171
|
+
{
|
|
15147
15172
|
for( let item of this.items )
|
|
15148
15173
|
{
|
|
15149
15174
|
let key = item.name;
|
|
@@ -15209,7 +15234,8 @@ class Menubar {
|
|
|
15209
15234
|
* @param {String} name
|
|
15210
15235
|
*/
|
|
15211
15236
|
|
|
15212
|
-
getButton( name )
|
|
15237
|
+
getButton( name )
|
|
15238
|
+
{
|
|
15213
15239
|
return this.buttons[ name ];
|
|
15214
15240
|
}
|
|
15215
15241
|
|
|
@@ -15218,26 +15244,23 @@ class Menubar {
|
|
|
15218
15244
|
* @param {Object} item: parent item
|
|
15219
15245
|
* @param {Array} tokens: split path strings
|
|
15220
15246
|
*/
|
|
15221
|
-
getSubitem( item, tokens )
|
|
15222
|
-
|
|
15223
|
-
|
|
15224
|
-
let path = tokens[ 0 ];
|
|
15225
|
-
|
|
15226
|
-
for( let i = 0; i < item.length; i++ )
|
|
15247
|
+
getSubitem( item, tokens )
|
|
15248
|
+
{
|
|
15249
|
+
for( const s of item )
|
|
15227
15250
|
{
|
|
15228
|
-
if(
|
|
15251
|
+
if ( s?.name != tokens[ 0 ] )
|
|
15229
15252
|
{
|
|
15230
|
-
|
|
15231
|
-
|
|
15232
|
-
subitem = item[ i ];
|
|
15233
|
-
return subitem;
|
|
15234
|
-
}
|
|
15235
|
-
else
|
|
15236
|
-
{
|
|
15237
|
-
tokens.splice( 0, 1 );
|
|
15238
|
-
return this.getSubitem( item[ i ][ path ], tokens );
|
|
15239
|
-
}
|
|
15253
|
+
continue;
|
|
15254
|
+
}
|
|
15240
15255
|
|
|
15256
|
+
if( tokens.length == 1 )
|
|
15257
|
+
{
|
|
15258
|
+
return s;
|
|
15259
|
+
}
|
|
15260
|
+
else if ( s.submenu )
|
|
15261
|
+
{
|
|
15262
|
+
tokens.shift();
|
|
15263
|
+
return this.getSubitem( s.submenu, tokens );
|
|
15241
15264
|
}
|
|
15242
15265
|
}
|
|
15243
15266
|
}
|
|
@@ -15246,12 +15269,11 @@ class Menubar {
|
|
|
15246
15269
|
* @method getItem
|
|
15247
15270
|
* @param {String} path
|
|
15248
15271
|
*/
|
|
15249
|
-
getItem( path )
|
|
15250
|
-
|
|
15251
|
-
//
|
|
15252
|
-
const tokens = path.split(
|
|
15253
|
-
|
|
15254
|
-
return this.getSubitem(this.items, tokens)
|
|
15272
|
+
getItem( path )
|
|
15273
|
+
{
|
|
15274
|
+
// Process path
|
|
15275
|
+
const tokens = path.split( '/' );
|
|
15276
|
+
return this.getSubitem( this.items, tokens );
|
|
15255
15277
|
}
|
|
15256
15278
|
|
|
15257
15279
|
/**
|
|
@@ -15262,8 +15284,8 @@ class Menubar {
|
|
|
15262
15284
|
* @param {Object} options
|
|
15263
15285
|
*/
|
|
15264
15286
|
|
|
15265
|
-
setButtonIcon( name, icon, callback, options = {} )
|
|
15266
|
-
|
|
15287
|
+
setButtonIcon( name, icon, callback, options = {} )
|
|
15288
|
+
{
|
|
15267
15289
|
if( !name )
|
|
15268
15290
|
{
|
|
15269
15291
|
throw( "Set Button Name!" );
|
|
@@ -15318,8 +15340,8 @@ class Menubar {
|
|
|
15318
15340
|
* @param {Object} options
|
|
15319
15341
|
*/
|
|
15320
15342
|
|
|
15321
|
-
setButtonImage( name, src, callback, options = {} )
|
|
15322
|
-
|
|
15343
|
+
setButtonImage( name, src, callback, options = {} )
|
|
15344
|
+
{
|
|
15323
15345
|
if( !name )
|
|
15324
15346
|
{
|
|
15325
15347
|
throw( "Set Button Name!" );
|
|
@@ -15328,14 +15350,14 @@ class Menubar {
|
|
|
15328
15350
|
let button = this.buttons[ name ];
|
|
15329
15351
|
if( button )
|
|
15330
15352
|
{
|
|
15331
|
-
button.querySelector('img').src = src;
|
|
15353
|
+
button.querySelector( 'img' ).src = src;
|
|
15332
15354
|
return;
|
|
15333
15355
|
}
|
|
15334
15356
|
|
|
15335
15357
|
// Otherwise, create it
|
|
15336
|
-
button = document.createElement('div');
|
|
15358
|
+
button = document.createElement( 'div' );
|
|
15337
15359
|
const disabled = options.disabled ?? false;
|
|
15338
|
-
button.className = "lexmenubutton main" + (disabled ? " disabled" : "");
|
|
15360
|
+
button.className = "lexmenubutton main" + ( disabled ? " disabled" : "" );
|
|
15339
15361
|
button.title = name;
|
|
15340
15362
|
button.innerHTML = "<a><image src='" + src + "' class='lexicon' style='height:32px;'></a>";
|
|
15341
15363
|
|
|
@@ -15359,11 +15381,11 @@ class Menubar {
|
|
|
15359
15381
|
|
|
15360
15382
|
const _b = button.querySelector('a');
|
|
15361
15383
|
|
|
15362
|
-
_b.addEventListener( "mousedown",
|
|
15384
|
+
_b.addEventListener( "mousedown", e => {
|
|
15363
15385
|
e.preventDefault();
|
|
15364
15386
|
});
|
|
15365
15387
|
|
|
15366
|
-
_b.addEventListener( "mouseup",
|
|
15388
|
+
_b.addEventListener( "mouseup", e => {
|
|
15367
15389
|
if( callback && !disabled )
|
|
15368
15390
|
{
|
|
15369
15391
|
callback.call( this, _b, e );
|
|
@@ -15380,8 +15402,8 @@ class Menubar {
|
|
|
15380
15402
|
* float: center (Default), right
|
|
15381
15403
|
*/
|
|
15382
15404
|
|
|
15383
|
-
addButtons( buttons, options = {} )
|
|
15384
|
-
|
|
15405
|
+
addButtons( buttons, options = {} )
|
|
15406
|
+
{
|
|
15385
15407
|
if( !buttons )
|
|
15386
15408
|
{
|
|
15387
15409
|
throw( "No buttons to add!" );
|
|
@@ -15408,9 +15430,8 @@ class Menubar {
|
|
|
15408
15430
|
}
|
|
15409
15431
|
}
|
|
15410
15432
|
|
|
15411
|
-
for(
|
|
15433
|
+
for( const data of buttons )
|
|
15412
15434
|
{
|
|
15413
|
-
const data = buttons[ i ];
|
|
15414
15435
|
const title = data.title;
|
|
15415
15436
|
const button = new LX.Button( title, data.label, data.callback, {
|
|
15416
15437
|
title,
|
|
@@ -15430,8 +15451,8 @@ class Menubar {
|
|
|
15430
15451
|
}
|
|
15431
15452
|
}
|
|
15432
15453
|
}
|
|
15433
|
-
LX.Menubar = Menubar;
|
|
15434
|
-
|
|
15454
|
+
LX.Menubar = Menubar;
|
|
15455
|
+
|
|
15435
15456
|
// sidebar.js @jxarco
|
|
15436
15457
|
|
|
15437
15458
|
/**
|
|
@@ -16155,8 +16176,8 @@ class Sidebar {
|
|
|
16155
16176
|
}
|
|
16156
16177
|
}
|
|
16157
16178
|
}
|
|
16158
|
-
LX.Sidebar = Sidebar;
|
|
16159
|
-
|
|
16179
|
+
LX.Sidebar = Sidebar;
|
|
16180
|
+
|
|
16160
16181
|
// asset_view.js @jxarco
|
|
16161
16182
|
|
|
16162
16183
|
class AssetViewEvent {
|
|
@@ -17108,8 +17129,8 @@ class AssetView {
|
|
|
17108
17129
|
}
|
|
17109
17130
|
}
|
|
17110
17131
|
|
|
17111
|
-
LX.AssetView = AssetView;
|
|
17112
|
-
|
|
17132
|
+
LX.AssetView = AssetView;
|
|
17133
|
+
|
|
17113
17134
|
// tour.js @jxarco
|
|
17114
17135
|
|
|
17115
17136
|
class Tour {
|
|
@@ -17407,6 +17428,6 @@ class Tour {
|
|
|
17407
17428
|
} );
|
|
17408
17429
|
}
|
|
17409
17430
|
}
|
|
17410
|
-
LX.Tour = Tour;
|
|
17411
|
-
|
|
17412
|
-
export { ADD_CUSTOM_COMPONENT, Area, AssetView, AssetViewEvent, BaseComponent, Branch, LX, Menubar, Panel, Sidebar, Tour };
|
|
17431
|
+
LX.Tour = Tour;
|
|
17432
|
+
|
|
17433
|
+
export { ADD_CUSTOM_COMPONENT, Area, AssetView, AssetViewEvent, BaseComponent, Branch, LX, Menubar, Panel, Sidebar, Tour };
|