lexgui 0.6.8 → 0.6.9
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/components/timeline.js +14 -7
- package/build/lexgui.css +25 -2
- package/build/lexgui.js +158 -51
- package/build/lexgui.min.css +1 -1
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +180 -73
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +23 -1
- package/demo.js +2 -2
- package/examples/all_widgets.html +5 -4
- package/examples/editor.html +18 -16
- package/package.json +1 -1
|
@@ -2633,7 +2633,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
2633
2633
|
*
|
|
2634
2634
|
* @param {int} trackIdx
|
|
2635
2635
|
* @param {array} newValues array of values for each keyframe. It should be a flat array of size track.dim*numKeyframes. Check ADDKEY_VALUESINARRAYS flag
|
|
2636
|
-
* @param {array of numbers} newTimes
|
|
2636
|
+
* @param {array of numbers} newTimes must be ordered ascendently
|
|
2637
2637
|
* @param {number} timeOffset
|
|
2638
2638
|
* @param {int} flags
|
|
2639
2639
|
* KeyFramesTimeline.ADDKEY_VALUESINARRAYS: if set, newValues is an array of arrays, one for each entry [ [1,2,3], [5,6,7] ]. Times is still a flat array of values [ 0, 0.2 ]
|
|
@@ -2656,8 +2656,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
2656
2656
|
|
|
2657
2657
|
let newIdx = newTimes.length-1;
|
|
2658
2658
|
let oldIdx = trackTimes.length-1;
|
|
2659
|
-
|
|
2660
|
-
let t1 = performance.now();
|
|
2659
|
+
let resultIndices = [];
|
|
2661
2660
|
if ( KeyFramesTimeline.ADDKEY_VALUESINARRAYS & flags ){
|
|
2662
2661
|
|
|
2663
2662
|
for( let i = times.length-1; i > -1; --i ){
|
|
@@ -2672,6 +2671,8 @@ class KeyFramesTimeline extends Timeline {
|
|
|
2672
2671
|
track.hovered.splice(oldIdx+1, 0, false);
|
|
2673
2672
|
track.selected.splice(oldIdx+1, 0, false);
|
|
2674
2673
|
track.edited.splice(oldIdx+1, 0, true);
|
|
2674
|
+
|
|
2675
|
+
resultIndices.push(i);
|
|
2675
2676
|
continue;
|
|
2676
2677
|
}
|
|
2677
2678
|
|
|
@@ -2695,6 +2696,8 @@ class KeyFramesTimeline extends Timeline {
|
|
|
2695
2696
|
track.hovered.splice(oldIdx+1, 0, false);
|
|
2696
2697
|
track.selected.splice(oldIdx+1, 0, false);
|
|
2697
2698
|
track.edited.splice(oldIdx+1, 0, true);
|
|
2699
|
+
|
|
2700
|
+
resultIndices.push(i);
|
|
2698
2701
|
continue;
|
|
2699
2702
|
}
|
|
2700
2703
|
|
|
@@ -2715,8 +2718,11 @@ class KeyFramesTimeline extends Timeline {
|
|
|
2715
2718
|
this.setDuration(newTimes[newTimes.length - 1] + timeOffset);
|
|
2716
2719
|
}
|
|
2717
2720
|
|
|
2718
|
-
if(this.onUpdateTrack)
|
|
2721
|
+
if(this.onUpdateTrack){
|
|
2719
2722
|
this.onUpdateTrack( [trackIdx] );
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
return resultIndices;
|
|
2720
2726
|
}
|
|
2721
2727
|
|
|
2722
2728
|
deleteSelectedContent(skipCallback = false) {
|
|
@@ -3099,6 +3105,7 @@ class ClipsTimeline extends Timeline {
|
|
|
3099
3105
|
setAnimationClip( animation, needsToProcess ){
|
|
3100
3106
|
super.setAnimationClip(animation, needsToProcess);
|
|
3101
3107
|
this.changeSelectedItems();
|
|
3108
|
+
return this.animationClip;
|
|
3102
3109
|
}
|
|
3103
3110
|
|
|
3104
3111
|
// OVERRIDE
|
|
@@ -3297,10 +3304,10 @@ class ClipsTimeline extends Timeline {
|
|
|
3297
3304
|
const track = this.animationClip.tracks[this.lastClipsSelected[0][0]];
|
|
3298
3305
|
let clip = track.clips[this.lastClipsSelected[0][1]];
|
|
3299
3306
|
if( this.dragClipMode == "fadein" ) {
|
|
3300
|
-
clip.fadein = Math.min(Math.max(clip.fadein + delta, clip.start), clip.fadeout);
|
|
3307
|
+
clip.fadein = Math.min(Math.max(clip.fadein + delta, clip.start), clip.fadeout ?? (clip.start+clip.duration) );
|
|
3301
3308
|
}
|
|
3302
3309
|
else if( this.dragClipMode == "fadeout" ) {
|
|
3303
|
-
clip.fadeout = Math.max(Math.min(clip.fadeout + delta, clip.start+clip.duration), clip.fadein);
|
|
3310
|
+
clip.fadeout = Math.max(Math.min(clip.fadeout + delta, clip.start+clip.duration), clip.fadein ?? clip.start );
|
|
3304
3311
|
}
|
|
3305
3312
|
else if( this.dragClipMode == "duration" ) {
|
|
3306
3313
|
let duration = Math.max(0, clip.duration + delta);
|
|
@@ -3715,7 +3722,7 @@ class ClipsTimeline extends Timeline {
|
|
|
3715
3722
|
const fadeinX = this.pixelsPerSecond * (clip.fadein - clip.start);
|
|
3716
3723
|
ctx.roundRect(x, y + offset, fadeinX, trackHeight, {tl: 5, bl: 5, tr:0, br:0}, true);
|
|
3717
3724
|
}
|
|
3718
|
-
if ( clip.
|
|
3725
|
+
if ( clip.fadeout != undefined ){
|
|
3719
3726
|
const fadeoutX = this.pixelsPerSecond * (clip.start + clip.duration - (clip.fadeout));
|
|
3720
3727
|
ctx.roundRect( x + w - fadeoutX, y + offset, fadeoutX, trackHeight, {tl: 0, bl: 0, tr:5, br:5}, true);
|
|
3721
3728
|
}
|
package/build/lexgui.css
CHANGED
|
@@ -1889,7 +1889,7 @@ dialog .lexselect .lexselectoptions {
|
|
|
1889
1889
|
|
|
1890
1890
|
.lexselect .lexselectlabel {
|
|
1891
1891
|
width: 100%;
|
|
1892
|
-
color: var(--global-text-
|
|
1892
|
+
color: var(--global-text-tertiary);
|
|
1893
1893
|
padding-inline: 0.6rem;
|
|
1894
1894
|
padding-block: 0.2rem;
|
|
1895
1895
|
min-height: 20px;
|
|
@@ -2966,6 +2966,10 @@ meter:-moz-meter-sub-sub-optimum::-moz-meter-bar {
|
|
|
2966
2966
|
font-size: var(--global-font-size-lg);
|
|
2967
2967
|
}
|
|
2968
2968
|
|
|
2969
|
+
.lexmenubar .lexmenubuttons.left {
|
|
2970
|
+
margin-left: unset;
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2969
2973
|
.lexmenubar .lexmenubuttons.right {
|
|
2970
2974
|
margin-left: unset;
|
|
2971
2975
|
margin-right: 12px;
|
|
@@ -3565,6 +3569,20 @@ meter:-moz-meter-sub-sub-optimum::-moz-meter-bar {
|
|
|
3565
3569
|
margin-right: 0px;
|
|
3566
3570
|
}
|
|
3567
3571
|
|
|
3572
|
+
.lexoverlayseparator {
|
|
3573
|
+
background-color: var(--global-color-tertiary);
|
|
3574
|
+
opacity: 0.9;
|
|
3575
|
+
width: 2px;
|
|
3576
|
+
height: calc(100% + 0.5em);
|
|
3577
|
+
margin-top: -0.25em;
|
|
3578
|
+
}
|
|
3579
|
+
|
|
3580
|
+
.lexoverlaybuttonscontainer.vertical .lexoverlayseparator {
|
|
3581
|
+
width: calc(100% + 0.5em);
|
|
3582
|
+
height: 2px;
|
|
3583
|
+
margin-left: -0.25em;
|
|
3584
|
+
}
|
|
3585
|
+
|
|
3568
3586
|
/* Area Tabs */
|
|
3569
3587
|
|
|
3570
3588
|
.lexareatabs {
|
|
@@ -3994,6 +4012,11 @@ meter:-moz-meter-sub-sub-optimum::-moz-meter-bar {
|
|
|
3994
4012
|
align-content: center;
|
|
3995
4013
|
}
|
|
3996
4014
|
|
|
4015
|
+
.lextable td.empty-row {
|
|
4016
|
+
text-align: center;
|
|
4017
|
+
padding-block: 16px;
|
|
4018
|
+
}
|
|
4019
|
+
|
|
3997
4020
|
.lextable th {
|
|
3998
4021
|
--th-color: var(--global-text-secondary);
|
|
3999
4022
|
font-weight: 600;
|
|
@@ -4101,7 +4124,7 @@ meter:-moz-meter-sub-sub-optimum::-moz-meter-bar {
|
|
|
4101
4124
|
grid-column: span 2;
|
|
4102
4125
|
}
|
|
4103
4126
|
|
|
4104
|
-
.lexcustomcontainer span {
|
|
4127
|
+
.lexcustomcontainer button.custom span {
|
|
4105
4128
|
align-items: center;
|
|
4106
4129
|
display: flex;
|
|
4107
4130
|
justify-content: space-between;
|
package/build/lexgui.js
CHANGED
|
@@ -14,7 +14,7 @@ console.warn( 'Script _build/lexgui.js_ is depracated and will be removed soon.
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
const LX = {
|
|
17
|
-
version: "0.6.
|
|
17
|
+
version: "0.6.9",
|
|
18
18
|
ready: false,
|
|
19
19
|
components: [], // Specific pre-build components
|
|
20
20
|
signals: {}, // Events and triggers
|
|
@@ -5077,7 +5077,7 @@ LX.makeCodeSnippet = makeCodeSnippet;
|
|
|
5077
5077
|
* @param {Array} keys
|
|
5078
5078
|
* @param {String} extraClass
|
|
5079
5079
|
*/
|
|
5080
|
-
function makeKbd( keys, extraClass = "" )
|
|
5080
|
+
function makeKbd( keys, useSpecialKeys = true, extraClass = "" )
|
|
5081
5081
|
{
|
|
5082
5082
|
const specialKeys = {
|
|
5083
5083
|
"Ctrl": '⌃',
|
|
@@ -5099,7 +5099,7 @@ function makeKbd( keys, extraClass = "" )
|
|
|
5099
5099
|
|
|
5100
5100
|
for( const k of keys )
|
|
5101
5101
|
{
|
|
5102
|
-
LX.makeContainer( ["auto", "auto"], "self-center text-xs fg-secondary select-none", specialKeys[ k ] ?? k, kbd );
|
|
5102
|
+
LX.makeContainer( ["auto", "auto"], "self-center text-xs fg-secondary select-none " + extraClass, useSpecialKeys ? specialKeys[ k ] ?? k : k, kbd );
|
|
5103
5103
|
}
|
|
5104
5104
|
|
|
5105
5105
|
return kbd;
|
|
@@ -6805,6 +6805,7 @@ class Area {
|
|
|
6805
6805
|
this.attach( container );
|
|
6806
6806
|
|
|
6807
6807
|
const float = options.float;
|
|
6808
|
+
let floatClass = "";
|
|
6808
6809
|
|
|
6809
6810
|
if( float )
|
|
6810
6811
|
{
|
|
@@ -6814,15 +6815,17 @@ class Area {
|
|
|
6814
6815
|
switch( t )
|
|
6815
6816
|
{
|
|
6816
6817
|
case 'h': break;
|
|
6817
|
-
case 'v':
|
|
6818
|
+
case 'v': floatClass += " vertical"; break;
|
|
6818
6819
|
case 't': break;
|
|
6819
|
-
case 'm':
|
|
6820
|
-
case 'b':
|
|
6820
|
+
case 'm': floatClass += " middle"; break;
|
|
6821
|
+
case 'b': floatClass += " bottom"; break;
|
|
6821
6822
|
case 'l': break;
|
|
6822
|
-
case 'c':
|
|
6823
|
-
case 'r':
|
|
6823
|
+
case 'c': floatClass += " center"; break;
|
|
6824
|
+
case 'r': floatClass += " right"; break;
|
|
6824
6825
|
}
|
|
6825
6826
|
}
|
|
6827
|
+
|
|
6828
|
+
container.className += ` ${ floatClass }`;
|
|
6826
6829
|
}
|
|
6827
6830
|
|
|
6828
6831
|
const _addButton = function( b, group, last ) {
|
|
@@ -6897,6 +6900,15 @@ class Area {
|
|
|
6897
6900
|
|
|
6898
6901
|
for( let b of buttons )
|
|
6899
6902
|
{
|
|
6903
|
+
if( b === null )
|
|
6904
|
+
{
|
|
6905
|
+
// Add a separator
|
|
6906
|
+
const separator = document.createElement("div");
|
|
6907
|
+
separator.className = "lexoverlayseparator" + floatClass;
|
|
6908
|
+
overlayPanel.root.appendChild( separator );
|
|
6909
|
+
continue;
|
|
6910
|
+
}
|
|
6911
|
+
|
|
6900
6912
|
if( b.constructor === Array )
|
|
6901
6913
|
{
|
|
6902
6914
|
for( let i = 0; i < b.length; ++i )
|
|
@@ -7428,8 +7440,7 @@ function ADD_CUSTOM_WIDGET( customWidgetName, options = {} )
|
|
|
7428
7440
|
if( customWidgetsDom ) customWidgetsDom.remove();
|
|
7429
7441
|
|
|
7430
7442
|
container = document.createElement('div');
|
|
7431
|
-
container.className = "lexcustomcontainer";
|
|
7432
|
-
container.style.width = "100%";
|
|
7443
|
+
container.className = "lexcustomcontainer w-full";
|
|
7433
7444
|
element.appendChild( container );
|
|
7434
7445
|
element.dataset["opened"] = false;
|
|
7435
7446
|
|
|
@@ -7623,9 +7634,9 @@ class NodeTree {
|
|
|
7623
7634
|
|
|
7624
7635
|
if( this.options.onlyFolders )
|
|
7625
7636
|
{
|
|
7626
|
-
let
|
|
7627
|
-
node.children.forEach( c =>
|
|
7628
|
-
isParent = !!
|
|
7637
|
+
let hasFolders = false;
|
|
7638
|
+
node.children.forEach( c => hasFolders |= (c.type == 'folder') );
|
|
7639
|
+
isParent = !!hasFolders;
|
|
7629
7640
|
}
|
|
7630
7641
|
|
|
7631
7642
|
let item = document.createElement('li');
|
|
@@ -7790,23 +7801,15 @@ class NodeTree {
|
|
|
7790
7801
|
} );
|
|
7791
7802
|
|
|
7792
7803
|
event.panel.add( "Delete", { callback: () => {
|
|
7793
|
-
// It's the root node
|
|
7794
|
-
if( !node.parent )
|
|
7795
|
-
{
|
|
7796
|
-
return;
|
|
7797
|
-
}
|
|
7798
7804
|
|
|
7799
|
-
|
|
7805
|
+
const ok = that.deleteNode( node );
|
|
7806
|
+
|
|
7807
|
+
if( ok && that.onevent )
|
|
7800
7808
|
{
|
|
7801
7809
|
const event = new LX.TreeEvent( LX.TreeEvent.NODE_DELETED, node, e );
|
|
7802
7810
|
that.onevent( event );
|
|
7803
7811
|
}
|
|
7804
7812
|
|
|
7805
|
-
// Delete nodes now
|
|
7806
|
-
let childs = node.parent.children;
|
|
7807
|
-
const index = childs.indexOf( node );
|
|
7808
|
-
childs.splice( index, 1 );
|
|
7809
|
-
|
|
7810
7813
|
this.refresh();
|
|
7811
7814
|
} } );
|
|
7812
7815
|
}
|
|
@@ -7823,23 +7826,26 @@ class NodeTree {
|
|
|
7823
7826
|
|
|
7824
7827
|
if( e.key == "Delete" )
|
|
7825
7828
|
{
|
|
7826
|
-
|
|
7827
|
-
|
|
7829
|
+
const nodesDeleted = [];
|
|
7830
|
+
|
|
7831
|
+
for( let _node of this.selected )
|
|
7828
7832
|
{
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7833
|
+
if( that.deleteNode( _node ) )
|
|
7834
|
+
{
|
|
7835
|
+
nodesDeleted.push( _node );
|
|
7836
|
+
}
|
|
7832
7837
|
}
|
|
7833
7838
|
|
|
7834
|
-
//
|
|
7835
|
-
|
|
7839
|
+
// Send event now so we have the info in selected array..
|
|
7840
|
+
if( nodesDeleted.length && that.onevent )
|
|
7836
7841
|
{
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7842
|
+
const event = new LX.TreeEvent( LX.TreeEvent.NODE_DELETED, nodesDeleted.length > 1 ? nodesDeleted : node, e );
|
|
7843
|
+
event.multiple = nodesDeleted.length > 1;
|
|
7844
|
+
that.onevent( event );
|
|
7840
7845
|
}
|
|
7841
7846
|
|
|
7842
7847
|
this.selected.length = 0;
|
|
7848
|
+
|
|
7843
7849
|
this.refresh();
|
|
7844
7850
|
}
|
|
7845
7851
|
else if( e.key == "ArrowUp" || e.key == "ArrowDown" ) // Unique or zero selected
|
|
@@ -8108,6 +8114,35 @@ class NodeTree {
|
|
|
8108
8114
|
this.selected = [ el.treeData ];
|
|
8109
8115
|
el.focus();
|
|
8110
8116
|
}
|
|
8117
|
+
|
|
8118
|
+
deleteNode( node ) {
|
|
8119
|
+
|
|
8120
|
+
const dataAsArray = ( this.data.constructor === Array );
|
|
8121
|
+
|
|
8122
|
+
// Can be either Array or Object type data
|
|
8123
|
+
if( node.parent )
|
|
8124
|
+
{
|
|
8125
|
+
let childs = node.parent.children;
|
|
8126
|
+
const index = childs.indexOf( node );
|
|
8127
|
+
childs.splice( index, 1 );
|
|
8128
|
+
}
|
|
8129
|
+
else
|
|
8130
|
+
{
|
|
8131
|
+
if( dataAsArray )
|
|
8132
|
+
{
|
|
8133
|
+
const index = this.data.indexOf( node );
|
|
8134
|
+
console.assert( index > -1, "NodeTree: Can't delete root node " + node.id + " from data array!" );
|
|
8135
|
+
this.data.splice( index, 1 );
|
|
8136
|
+
}
|
|
8137
|
+
else
|
|
8138
|
+
{
|
|
8139
|
+
console.warn( "NodeTree: Can't delete root node from object data!" );
|
|
8140
|
+
return false;
|
|
8141
|
+
}
|
|
8142
|
+
}
|
|
8143
|
+
|
|
8144
|
+
return true;
|
|
8145
|
+
}
|
|
8111
8146
|
}
|
|
8112
8147
|
|
|
8113
8148
|
LX.NodeTree = NodeTree;
|
|
@@ -8475,18 +8510,38 @@ class Button extends Widget {
|
|
|
8475
8510
|
wValue.classList.add( "selected" );
|
|
8476
8511
|
}
|
|
8477
8512
|
|
|
8478
|
-
if( options.
|
|
8479
|
-
{
|
|
8480
|
-
const icon = LX.makeIcon( options.icon );
|
|
8481
|
-
wValue.prepend( icon );
|
|
8482
|
-
wValue.classList.add( "justify-center" );
|
|
8483
|
-
}
|
|
8484
|
-
else if( options.img )
|
|
8513
|
+
if( options.img )
|
|
8485
8514
|
{
|
|
8486
8515
|
let img = document.createElement( 'img' );
|
|
8487
8516
|
img.src = options.img;
|
|
8488
8517
|
wValue.prepend( img );
|
|
8489
8518
|
}
|
|
8519
|
+
else if( options.icon )
|
|
8520
|
+
{
|
|
8521
|
+
const icon = LX.makeIcon( options.icon );
|
|
8522
|
+
const iconPosition = options.iconPosition ?? "cover";
|
|
8523
|
+
|
|
8524
|
+
// Default
|
|
8525
|
+
if( iconPosition == "cover" || ( options.swap !== undefined ) )
|
|
8526
|
+
{
|
|
8527
|
+
wValue.prepend( icon );
|
|
8528
|
+
}
|
|
8529
|
+
else
|
|
8530
|
+
{
|
|
8531
|
+
wValue.innerHTML = `<span>${ ( value || "" ) }</span>`;
|
|
8532
|
+
|
|
8533
|
+
if( iconPosition == "start" )
|
|
8534
|
+
{
|
|
8535
|
+
wValue.querySelector( "span" ).prepend( icon );
|
|
8536
|
+
}
|
|
8537
|
+
else // "end"
|
|
8538
|
+
{
|
|
8539
|
+
wValue.querySelector( "span" ).appendChild( icon );
|
|
8540
|
+
}
|
|
8541
|
+
}
|
|
8542
|
+
|
|
8543
|
+
wValue.classList.add( "justify-center" );
|
|
8544
|
+
}
|
|
8490
8545
|
else
|
|
8491
8546
|
{
|
|
8492
8547
|
wValue.innerHTML = `<span>${ ( value || "" ) }</span>`;
|
|
@@ -8942,8 +8997,8 @@ class Select extends Widget {
|
|
|
8942
8997
|
value = newValue;
|
|
8943
8998
|
|
|
8944
8999
|
let item = null;
|
|
8945
|
-
const
|
|
8946
|
-
|
|
9000
|
+
const listOptionsNodes = listOptions.childNodes;
|
|
9001
|
+
listOptionsNodes.forEach( e => {
|
|
8947
9002
|
e.classList.remove( "selected" );
|
|
8948
9003
|
if( e.getAttribute( "value" ) == newValue )
|
|
8949
9004
|
{
|
|
@@ -8963,6 +9018,22 @@ class Select extends Widget {
|
|
|
8963
9018
|
list.refresh( filteredOptions );
|
|
8964
9019
|
}
|
|
8965
9020
|
|
|
9021
|
+
// Update suboptions menu
|
|
9022
|
+
const suboptions = this.root.querySelector( ".lexcustomcontainer" );
|
|
9023
|
+
const suboptionsFunc = options[ `on_${ value }` ];
|
|
9024
|
+
suboptions.toggleAttribute( "hidden", !suboptionsFunc );
|
|
9025
|
+
|
|
9026
|
+
if( suboptionsFunc )
|
|
9027
|
+
{
|
|
9028
|
+
suboptions.innerHTML = "";
|
|
9029
|
+
const suboptionsPanel = new LX.Panel();
|
|
9030
|
+
suboptionsPanel.queue( suboptions );
|
|
9031
|
+
suboptionsFunc.call(this, suboptionsPanel);
|
|
9032
|
+
suboptionsPanel.clearQueue();
|
|
9033
|
+
}
|
|
9034
|
+
|
|
9035
|
+
this.root.dataset["opened"] = ( !!suboptionsFunc );
|
|
9036
|
+
|
|
8966
9037
|
if( !skipCallback )
|
|
8967
9038
|
{
|
|
8968
9039
|
this._trigger( new LX.IEvent( name, value, event ), callback );
|
|
@@ -9259,6 +9330,25 @@ class Select extends Widget {
|
|
|
9259
9330
|
|
|
9260
9331
|
container.appendChild( listDialog );
|
|
9261
9332
|
|
|
9333
|
+
// Element suboptions
|
|
9334
|
+
let suboptions = document.createElement( "div" );
|
|
9335
|
+
suboptions.className = "lexcustomcontainer w-full";
|
|
9336
|
+
|
|
9337
|
+
const suboptionsFunc = options[ `on_${ value }` ];
|
|
9338
|
+
suboptions.toggleAttribute( "hidden", !suboptionsFunc );
|
|
9339
|
+
|
|
9340
|
+
if( suboptionsFunc )
|
|
9341
|
+
{
|
|
9342
|
+
suboptions.innerHTML = "";
|
|
9343
|
+
const suboptionsPanel = new LX.Panel();
|
|
9344
|
+
suboptionsPanel.queue( suboptions );
|
|
9345
|
+
suboptionsFunc.call( this, suboptionsPanel );
|
|
9346
|
+
suboptionsPanel.clearQueue();
|
|
9347
|
+
}
|
|
9348
|
+
|
|
9349
|
+
this.root.appendChild( suboptions );
|
|
9350
|
+
this.root.dataset["opened"] = ( !!suboptionsFunc );
|
|
9351
|
+
|
|
9262
9352
|
LX.doAsync( this.onResize.bind( this ) );
|
|
9263
9353
|
}
|
|
9264
9354
|
|
|
@@ -10362,6 +10452,7 @@ class NumberInput extends Widget {
|
|
|
10362
10452
|
slider.step = options.step ?? 1;
|
|
10363
10453
|
slider.type = "range";
|
|
10364
10454
|
slider.value = value;
|
|
10455
|
+
slider.disabled = this.disabled;
|
|
10365
10456
|
|
|
10366
10457
|
slider.addEventListener( "input", ( e ) => {
|
|
10367
10458
|
this.set( slider.valueAsNumber, false, e );
|
|
@@ -11449,7 +11540,7 @@ class TabSections extends Widget {
|
|
|
11449
11540
|
let tabEl = document.createElement( "div" );
|
|
11450
11541
|
tabEl.className = "lextab " + (i == tabs.length - 1 ? "last" : "") + ( isSelected ? "selected" : "" );
|
|
11451
11542
|
tabEl.innerHTML = ( showNames ? tab.name : "" );
|
|
11452
|
-
tabEl.appendChild( LX.makeIcon( tab.icon ?? "Hash", { title: tab.name } ) );
|
|
11543
|
+
tabEl.appendChild( LX.makeIcon( tab.icon ?? "Hash", { title: tab.name, iconClass: tab.iconClass, svgClass: tab.svgClass } ) );
|
|
11453
11544
|
|
|
11454
11545
|
let infoContainer = document.createElement( "div" );
|
|
11455
11546
|
infoContainer.id = tab.name.replace( /\s/g, '' );
|
|
@@ -11485,7 +11576,7 @@ class TabSections extends Widget {
|
|
|
11485
11576
|
// Push to tab space
|
|
11486
11577
|
const creationPanel = new LX.Panel();
|
|
11487
11578
|
creationPanel.queue( infoContainer );
|
|
11488
|
-
tab.onCreate.call(this, creationPanel);
|
|
11579
|
+
tab.onCreate.call( this, creationPanel, infoContainer );
|
|
11489
11580
|
creationPanel.clearQueue();
|
|
11490
11581
|
}
|
|
11491
11582
|
}
|
|
@@ -11804,7 +11895,9 @@ class Table extends Widget {
|
|
|
11804
11895
|
const body = table.querySelector( "tbody" );
|
|
11805
11896
|
for( const el of body.childNodes )
|
|
11806
11897
|
{
|
|
11807
|
-
|
|
11898
|
+
const rowId = el.getAttribute( "rowId" );
|
|
11899
|
+
if( !rowId ) continue;
|
|
11900
|
+
data.checkMap[ rowId ] = this.checked;
|
|
11808
11901
|
el.querySelector( "input[type='checkbox']" ).checked = this.checked;
|
|
11809
11902
|
}
|
|
11810
11903
|
});
|
|
@@ -12015,8 +12108,8 @@ class Table extends Widget {
|
|
|
12015
12108
|
}
|
|
12016
12109
|
|
|
12017
12110
|
const row = document.createElement( 'tr' );
|
|
12018
|
-
const rowId = LX.getSupportedDOMName( bodyData.join( '-' ) );
|
|
12019
|
-
row.setAttribute( "rowId", rowId
|
|
12111
|
+
const rowId = LX.getSupportedDOMName( bodyData.join( '-' ) ).substr(0, 32);
|
|
12112
|
+
row.setAttribute( "rowId", rowId );
|
|
12020
12113
|
|
|
12021
12114
|
if( options.sortable ?? false )
|
|
12022
12115
|
{
|
|
@@ -12132,7 +12225,7 @@ class Table extends Widget {
|
|
|
12132
12225
|
}
|
|
12133
12226
|
else if( action == "menu" )
|
|
12134
12227
|
{
|
|
12135
|
-
button = LX.makeIcon( "
|
|
12228
|
+
button = LX.makeIcon( "EllipsisVertical", { title: "Menu" } );
|
|
12136
12229
|
button.addEventListener( 'click', function( event ) {
|
|
12137
12230
|
if( !options.onMenuAction )
|
|
12138
12231
|
{
|
|
@@ -12171,6 +12264,17 @@ class Table extends Widget {
|
|
|
12171
12264
|
|
|
12172
12265
|
body.appendChild( row );
|
|
12173
12266
|
}
|
|
12267
|
+
|
|
12268
|
+
if( body.childNodes.length == 0 )
|
|
12269
|
+
{
|
|
12270
|
+
const row = document.createElement( 'tr' );
|
|
12271
|
+
const td = document.createElement( 'td' );
|
|
12272
|
+
td.setAttribute( "colspan", data.head.length + this.rowOffsetCount + 1 ); // +1 for rowActions
|
|
12273
|
+
td.className = "empty-row";
|
|
12274
|
+
td.innerHTML = "No results.";
|
|
12275
|
+
row.appendChild( td );
|
|
12276
|
+
body.appendChild( row );
|
|
12277
|
+
}
|
|
12174
12278
|
}
|
|
12175
12279
|
|
|
12176
12280
|
for( const v in data.colVisibilityMap )
|
|
@@ -12955,6 +13059,7 @@ class Panel {
|
|
|
12955
13059
|
* hideName: Don't use name as label [false]
|
|
12956
13060
|
* disabled: Make the widget disabled [false]
|
|
12957
13061
|
* icon: Icon class to show as button value
|
|
13062
|
+
* iconPosition: Icon position (cover|start|end)
|
|
12958
13063
|
* fileInput: Button click requests a file
|
|
12959
13064
|
* fileInputType: Type of the requested file
|
|
12960
13065
|
* img: Path to image to show as button value
|
|
@@ -13446,6 +13551,8 @@ class Panel {
|
|
|
13446
13551
|
* @param {Array} tabs Contains objects with {
|
|
13447
13552
|
* name: Name of the tab (if icon, use as title)
|
|
13448
13553
|
* icon: Icon to be used as the tab icon (optional)
|
|
13554
|
+
* iconClass: Class to be added to the icon (optional)
|
|
13555
|
+
* svgClass: Class to be added to the inner SVG of the icon (optional)
|
|
13449
13556
|
* onCreate: Func to be called at tab creation
|
|
13450
13557
|
* onSelect: Func to be called on select tab (optional)
|
|
13451
13558
|
* }
|
|
@@ -14045,7 +14152,7 @@ class Menubar {
|
|
|
14045
14152
|
this.buttonContainer.className = "lexmenubuttons";
|
|
14046
14153
|
this.buttonContainer.classList.add( options.float ?? "center" );
|
|
14047
14154
|
|
|
14048
|
-
if( options.
|
|
14155
|
+
if( options.float == "right" )
|
|
14049
14156
|
{
|
|
14050
14157
|
this.buttonContainer.right = true;
|
|
14051
14158
|
}
|
|
@@ -14064,7 +14171,7 @@ class Menubar {
|
|
|
14064
14171
|
{
|
|
14065
14172
|
const data = buttons[ i ];
|
|
14066
14173
|
const title = data.title;
|
|
14067
|
-
const button = new LX.Button( title,
|
|
14174
|
+
const button = new LX.Button( title, data.label, data.callback, { title, buttonClass: "bg-none", disabled: data.disabled, icon: data.icon, hideName: true, swap: data.swap, iconPosition: "start" } );
|
|
14068
14175
|
this.buttonContainer.appendChild( button.root );
|
|
14069
14176
|
|
|
14070
14177
|
if( title )
|