uil 4.0.7 → 4.0.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.
@@ -1653,6 +1653,9 @@ const T = {
1653
1653
  case 'logo':
1654
1654
  t[1]="<path id='logoin' fill='"+color+"' stroke='none' d='"+T.logoFill_d+"'/>";
1655
1655
  break;
1656
+ case 'donate':
1657
+ t[1]="<path id='logoin' fill='"+color+"' stroke='none' d='"+T.logo_donate+"'/>";
1658
+ break;
1656
1659
  case 'neo':
1657
1660
  t[1]="<path id='logoin' fill='"+color+"' stroke='none' d='"+T.logo_neo+"'/>";
1658
1661
  break;
@@ -1692,6 +1695,23 @@ const T = {
1692
1695
  134 166 Q 134 178.4 142.85 187.15 151.6 196 164 196 176.45 196 185.25 187.15 194 178.4 194 166 L 194 52 Z
1693
1696
  `,
1694
1697
 
1698
+ logo_donate:`
1699
+ M 171.3 80.3 Q 179.5 62.15 171.3 45.8 164.1 32.5 141.35 30.1 L 94.35 30.1 Q 89.35 30.4 88.3 35.15 L 70.5 148.05 Q 70.2 152.5 73.7 152.6 L 100.95 152.6 107 111.6 Q 108.75
1700
+ 106.55 112.6 106.45 130.45 108.05 145.3 103.9 163.35 98.75 171.3 80.3 M 179.8 71.5 Q 178.6 79.75 174.9 87.85 168.45 102.9 151.9 109.15 140.65 113.95 117.55 113 113.15
1701
+ 112.75 111 117.45 L 102.7 169.95 Q 102.45 173.8 105.5 173.85 L 128.95 173.85 Q 132.2 174.2 133.35 169.65 L 138.3 139.95 Q 139.75 135.6 143.1 135.5 146.6 135.75 150.6 135.65
1702
+ 154.55 135.5 157.35 135.1 160.15 134.7 166.75 132.35 181.35 127.4 187.9 111.2 194.25 95.75 189.5 81.95 186.75 74.85 179.8 71.5 M 103.5 209.9 Q 103.5 202.85 99.7 198.85 95.95
1703
+ 194.75 89.4 194.75 82.8 194.75 79.05 198.85 75.3 202.9 75.3 209.9 75.3 216.85 79.05 220.95 82.8 225.05 89.4 225.05 95.95 225.05 99.7 221 103.5 216.95 103.5 209.9 M 95.45 205.5
1704
+ Q 95.95 207.3 95.95 209.9 95.95 212.65 95.45 214.35 94.95 216 94 217.3 93.1 218.45 91.9 219 90.7 219.55 89.4 219.55 88.15 219.55 86.95 219.05 85.75 218.55 84.8 217.3 83.9 216.15
1705
+ 83.4 214.35 82.85 212.6 82.85 209.9 82.85 207.3 83.4 205.45 83.95 203.55 84.85 202.45 85.9 201.2 86.95 200.75 88.05 200.25 89.4 200.25 90.7 200.25 91.85 200.8 93.05 201.3 94 202.5
1706
+ 94.9 203.65 95.45 205.5 M 153.3 195.35 L 145.3 195.35 135.5 224.45 142.8 224.45 144.6 218.5 153.75 218.5 155.6 224.45 163.1 224.45 153.3 195.35 M 152.15 213.25 L 146.25 213.25
1707
+ 149.2 203.65 152.15 213.25 M 116.75 195.35 L 107.8 195.35 107.8 224.45 114.5 224.45 114.5 204.2 125.7 224.45 132.75 224.45 132.75 195.35 126.05 195.35 126.05 212.05 116.75 195.35 M
1708
+ 66.5 197.65 Q 64.15 196.15 61.45 195.75 58.8 195.35 55.75 195.35 L 46.7 195.35 46.7 224.45 55.8 224.45 Q 58.8 224.45 61.5 224.05 64.15 223.6 66.4 222.15 69.15 220.45 70.9 217.2
1709
+ 72.7 214 72.7 209.95 72.7 205.7 71 202.6 69.35 199.5 66.5 197.65 M 64.2 205 Q 65.2 207 65.2 209.9 65.2 212.75 64.25 214.75 63.3 216.75 61.5 217.85 60 218.85 58.3 218.9 56.6 219
1710
+ 54.15 219 L 54 219 54 200.8 54.15 200.8 Q 56.4 200.8 58.05 200.9 59.7 200.95 61.15 201.75 63.2 202.95 64.2 205 M 210.2 195.35 L 190.5 195.35 190.5 224.45 210.2 224.45 210.2 218.9
1711
+ 197.75 218.9 197.75 211.55 209.2 211.55 209.2 206 197.75 206 197.75 200.9 210.2 200.9 210.2 195.35 M 187.5 195.35 L 163 195.35 163 200.9 171.6 200.9 171.6 224.45 178.9 224.45 178.9
1712
+ 200.9 187.5 200.9 187.5 195.35 Z
1713
+ `,
1714
+
1695
1715
  };
1696
1716
 
1697
1717
  T.setText();
@@ -2088,16 +2108,9 @@ class Proto {
2088
2108
 
2089
2109
  this.isListen = false;
2090
2110
 
2091
-
2092
-
2093
-
2094
- //this.parentGroup = null;
2095
-
2096
- //if( o.select !== undefined ) o.selectable = o.select
2097
2111
  this.isSelectable = o.selectable !== undefined ? o.selectable : false;
2098
2112
  this.unselectable = o.unselect !== undefined ? o.unselect : this.isSelectable;
2099
2113
 
2100
-
2101
2114
  this.ontop = o.ontop ? o.ontop : false; // 'beforebegin' 'afterbegin' 'beforeend' 'afterend'
2102
2115
 
2103
2116
  this.css = this.main ? this.main.css : Tools.css;
@@ -2126,12 +2139,7 @@ class Proto {
2126
2139
 
2127
2140
  // decale for canvas only
2128
2141
  this.fw = o.fw || 0;
2129
- /*this.dc = 0
2130
- if(this.isUI){
2131
- if( this.main.isCanvasOnly && this.fw) this.dc = (this.main.zone.w - this.w)*0.5
2132
- }*/
2133
2142
 
2134
-
2135
2143
  this.autoWidth = o.auto || true;// auto width or flex
2136
2144
  this.isOpen = false;// open statu
2137
2145
 
@@ -2194,13 +2202,10 @@ class Proto {
2194
2202
  this.s = [];
2195
2203
 
2196
2204
 
2197
- //this.c[0] = Tools.dom( 'div', this.css.basic + this.css.button +'align-self:stretch; position:relative; height:20px; overflow:hidden;'); //float:left;
2198
- //this.c[0] = Tools.dom( 'div', 'order: 1;' ); //
2199
2205
  this.useFlex = this.isUI ? this.main.useFlex : false;
2200
- let flexible = this.useFlex ? 'disply:flex; justify-content:center; align-items:center; text-align:center; flex: 1 100%;' : 'float:left;';
2206
+ let flexible = this.useFlex ? 'display:flex; justify-content:center; align-items:center; text-align:center; flex: 1 100%;' : 'float:left;';
2201
2207
 
2202
2208
  this.c[0] = Tools.dom( 'div', this.css.basic + flexible + 'position:relative; height:20px;');
2203
- //this.c[0] = Tools.dom( 'div', this.css.basic +'position:relative; height:20px; align-self: auto;');
2204
2209
 
2205
2210
 
2206
2211
  this.s[0] = this.c[0].style;
@@ -2630,8 +2635,6 @@ class Proto {
2630
2635
 
2631
2636
  handleEvent( e ) {
2632
2637
 
2633
- //if(!this.s) return false
2634
-
2635
2638
  if( this.lock ) return
2636
2639
 
2637
2640
  if( this.neverlock ) Roots.lock = false;
@@ -2643,26 +2646,13 @@ class Proto {
2643
2646
  }
2644
2647
 
2645
2648
  wheel( e ) { return false; }
2646
-
2647
2649
  mousedown( e ) { return false; }
2648
-
2649
2650
  mousemove( e ) { return false; }
2650
-
2651
2651
  mouseup( e ) { return false; }
2652
-
2653
2652
  keydown( e ) { return false; }
2654
-
2655
2653
  keyup( e ) { return false; }
2656
2654
 
2657
2655
 
2658
- /*dragstart ( e ) { return false; }
2659
- dragover ( e ) { return false; }
2660
- dragenter ( e ) { return false; }
2661
- dragleave ( e ) { return false; }
2662
- dragend ( e ) { return false; }
2663
- drop ( e ) { return false; }*/
2664
-
2665
-
2666
2656
  // ----------------------
2667
2657
  // object referency
2668
2658
  // ----------------------
@@ -2674,12 +2664,8 @@ class Proto {
2674
2664
 
2675
2665
  }
2676
2666
 
2677
- display( v ) {
2678
-
2679
- v = v || false;
2667
+ display( v = false ) {
2680
2668
  this.s[0].visibility = v ? 'visible' : 'hidden';
2681
- //this.s[0].display = v ? (this.useFlex? 'flex':'block') : 'none'
2682
-
2683
2669
  }
2684
2670
 
2685
2671
  // ----------------------
@@ -2913,17 +2899,16 @@ class Button extends Proto {
2913
2899
 
2914
2900
  this.on = false;
2915
2901
 
2916
- this.customSize = o.forceWidth || -1;
2902
+ // force button width
2903
+ this.bw = o.forceWidth || 0;
2904
+ if(o.bw) this.bw = o.bw;
2905
+ this.space = o.space || 3;
2917
2906
 
2918
2907
  if( typeof this.values === 'string' ) this.values = [ this.values ];
2919
2908
 
2920
2909
  this.isDown = false;
2921
2910
  this.neverlock = true;
2922
- this.isLoadButton = o.loader || false;
2923
- this.isDragButton = o.drag || false;
2924
2911
  this.res = 0;
2925
-
2926
- if( this.isDragButton ) this.isLoadButton = true;
2927
2912
 
2928
2913
  this.lng = this.values.length;
2929
2914
  this.tmp = [];
@@ -2945,23 +2930,13 @@ class Button extends Proto {
2945
2930
  }
2946
2931
 
2947
2932
  if( !o.value && !o.values ){
2948
- if( this.c[1] !== undefined ) {
2949
- this.txt = '';
2933
+ if( this.c[1] !== undefined ) {
2950
2934
  this.c[1].textContent = '';
2935
+ this.txt = '';
2951
2936
  }
2952
2937
  }
2953
2938
  if( !this.txt ) this.p = 0;
2954
2939
 
2955
- //
2956
-
2957
- if( this.isLoadButton ) this.initLoader();
2958
- if( this.isDragButton ){
2959
- this.lng ++;
2960
- this.initDrager();
2961
- }
2962
-
2963
- //if( this.onName !== '' ) this.values[0] = this.on;
2964
-
2965
2940
  this.init();
2966
2941
 
2967
2942
  }
@@ -3002,7 +2977,7 @@ class Button extends Proto {
3002
2977
  if( this.value === this.values[this.res] && this.unselectable ) this.value = '';
3003
2978
  else this.value = this.values[this.res];
3004
2979
  if( this.onName !== null ) this.onOff();
3005
- if( !this.isLoadButton ) this.send();
2980
+ this.send();
3006
2981
  }
3007
2982
 
3008
2983
  return this.mousemove( e )
@@ -3099,121 +3074,6 @@ class Button extends Proto {
3099
3074
 
3100
3075
  }
3101
3076
 
3102
- // ----------------------
3103
-
3104
- dragover ( e ) {
3105
-
3106
- e.preventDefault();
3107
-
3108
- this.s[4].borderColor = this.colors.select;
3109
- this.s[4].color = this.colors.select;
3110
-
3111
- }
3112
-
3113
- dragend ( e ) {
3114
-
3115
- e.preventDefault();
3116
-
3117
- this.s[4].borderColor = this.color.text;
3118
- this.s[4].color = this.color.text;
3119
-
3120
- }
3121
-
3122
- drop ( e ) {
3123
-
3124
- e.preventDefault();
3125
-
3126
- this.dragend(e);
3127
- this.fileSelect( e.dataTransfer.files[0] );
3128
-
3129
- }
3130
-
3131
- initDrager () {
3132
-
3133
- this.c[4] = this.dom( 'div', this.css.txt +' text-align:center; line-height:'+(this.h-8)+'px; border:1px dashed '+this.color.text+'; top:2px; height:'+(this.h-4)+'px; border-radius:'+this.radius+'px; pointer-events:auto;' );// cursor:default;
3134
- this.c[4].textContent = 'DRAG';
3135
-
3136
- this.c[4].addEventListener( 'dragover', function(e){ this.dragover(e); }.bind(this), false );
3137
- this.c[4].addEventListener( 'dragend', function(e){ this.dragend(e); }.bind(this), false );
3138
- this.c[4].addEventListener( 'dragleave', function(e){ this.dragend(e); }.bind(this), false );
3139
- this.c[4].addEventListener( 'drop', function(e){ this.drop(e); }.bind(this), false );
3140
-
3141
- //this.c[2].events = [ ];
3142
- //this.c[4].events = [ 'dragover', 'dragend', 'dragleave', 'drop' ];
3143
-
3144
-
3145
- }
3146
-
3147
- addLoader( n, callbackLoad ){
3148
-
3149
- this.callbackLoad = callbackLoad;
3150
-
3151
- let l = this.dom( 'input', this.css.basic +'top:0px; opacity:0; height:100%; width:100%; pointer-events:auto; cursor:pointer;' );//
3152
- l.name = 'loader';
3153
- l.type = "file";
3154
- l.addEventListener( 'change', function(e){ this.fileSelect( e.target.files[0] ); }.bind(this), false );
3155
-
3156
- this.c[n].appendChild( l );
3157
-
3158
- return this
3159
-
3160
- }
3161
-
3162
- initLoader () {
3163
-
3164
- this.c[3] = this.dom( 'input', this.css.basic +'top:0px; opacity:0; height:'+(this.h)+'px; pointer-events:auto; cursor:pointer;' );//
3165
- this.c[3].name = 'loader';
3166
- this.c[3].type = "file";
3167
-
3168
- this.c[3].addEventListener( 'change', function(e){ this.fileSelect( e.target.files[0] ); }.bind(this), false );
3169
- //this.c[3].addEventListener( 'mousedown', function(e){ }.bind(this), false );
3170
-
3171
- //this.c[2].events = [ ];
3172
- //this.c[3].events = [ 'change', 'mouseover', 'mousedown', 'mouseup', 'mouseout' ];
3173
-
3174
- //this.hide = document.createElement('input');
3175
-
3176
- }
3177
-
3178
- fileSelect ( file ) {
3179
-
3180
- let dataUrl = [ 'png', 'jpg', 'mp4', 'webm', 'ogg' ];
3181
- let dataBuf = [ 'sea', 'z', 'hex', 'bvh', 'BVH', 'glb' ];
3182
-
3183
- //if( ! e.target.files ) return;
3184
-
3185
- //let file = e.target.files[0];
3186
-
3187
- //this.c[3].type = "null";
3188
- // console.log( this.c[4] )
3189
-
3190
- if( file === undefined ) return;
3191
-
3192
- let reader = new FileReader();
3193
- let fname = file.name;
3194
- let type = fname.substring(fname.lastIndexOf('.')+1, fname.length );
3195
-
3196
- if( dataUrl.indexOf( type ) !== -1 ) reader.readAsDataURL( file );
3197
- else if( dataBuf.indexOf( type ) !== -1 ) reader.readAsArrayBuffer( file );//reader.readAsArrayBuffer( file );
3198
- else reader.readAsText( file );
3199
-
3200
- // if( type === 'png' || type === 'jpg' || type === 'mp4' || type === 'webm' || type === 'ogg' ) reader.readAsDataURL( file );
3201
- //else if( type === 'z' ) reader.readAsBinaryString( file );
3202
- //else if( type === 'sea' || type === 'bvh' || type === 'BVH' || type === 'z') reader.readAsArrayBuffer( file );
3203
- //else if( ) reader.readAsArrayBuffer( file );
3204
- //else reader.readAsText( file );
3205
-
3206
- reader.onload = function (e) {
3207
-
3208
- if( this.callbackLoad ) this.callbackLoad( e.target.result, fname, type );
3209
-
3210
- //if( this.callback ) this.callback( e.target.result, fname, type );
3211
- //this.c[3].type = "file";
3212
- //this.send( e.target.result );
3213
- }.bind(this);
3214
-
3215
- }
3216
-
3217
3077
  label ( string, n ) {
3218
3078
 
3219
3079
  n = n || 2;
@@ -3240,13 +3100,12 @@ class Button extends Proto {
3240
3100
  let d = this.sa;
3241
3101
 
3242
3102
  let i = this.lng;
3243
- let dc = 3;
3103
+ let dc = this.space;
3244
3104
  let size = Math.floor( ( w-(dc*(i-1)) ) / i );
3245
3105
 
3246
- if( this.customSize !== -1 ){
3247
- size = this.customSize;
3248
- // d = (this.s-size)*0.5
3249
-
3106
+ if( this.bw ){
3107
+ size = this.bw < size ? this.bw : size;
3108
+ d = Math.floor((this.w-( (size * i) + (dc * (i-1)) ))*0.5);
3250
3109
  }
3251
3110
 
3252
3111
  while( i-- ){
@@ -3259,16 +3118,6 @@ class Button extends Proto {
3259
3118
 
3260
3119
  }
3261
3120
 
3262
- if( this.isDragButton ){
3263
- s[4].left = (d+size+dc) + 'px';
3264
- s[4].width = size + 'px';
3265
- }
3266
-
3267
- if( this.isLoadButton ){
3268
- s[3].left = d + 'px';
3269
- s[3].width = size + 'px';
3270
- }
3271
-
3272
3121
  }
3273
3122
 
3274
3123
  }
@@ -3536,7 +3385,7 @@ class Color extends Proto {
3536
3385
  }
3537
3386
 
3538
3387
  //this.c[0].style.textAlign = 'center';
3539
- //this.c[0].style.flex = '1 0 auto'
3388
+ this.c[0].style.display = 'block';
3540
3389
 
3541
3390
  this.c[3] = this.getColorRing();
3542
3391
  this.c[3].style.visibility = 'hidden';
@@ -4551,14 +4400,12 @@ class Group extends Proto {
4551
4400
 
4552
4401
  this.ADD = o.add;
4553
4402
 
4554
- this.uis = [];
4555
-
4556
- this.isEmpty = true;
4557
-
4558
4403
  this.autoHeight = true;
4559
- this.current = -1;
4560
- this.targetIn = null;
4561
4404
 
4405
+ this.uis = [];
4406
+ this.current = -1;
4407
+ this.proto = null;
4408
+ this.isEmpty = true;
4562
4409
  this.decal = 0;
4563
4410
 
4564
4411
  this.baseH = this.h;
@@ -4584,9 +4431,6 @@ class Group extends Proto {
4584
4431
  if( this.isLine ) this.c[5] = this.dom( 'div', this.css.basic + 'background:rgba(255, 255, 255, 0.2); width:100%; left:0; height:1px; bottom:0px');
4585
4432
 
4586
4433
  let s = this.s;
4587
-
4588
-
4589
-
4590
4434
  s[0].height = this.h + 'px';
4591
4435
  s[1].height = this.h + 'px';
4592
4436
  this.c[1].name = 'group';
@@ -4596,28 +4440,13 @@ class Group extends Proto {
4596
4440
  s[1].color = this.colors.text;
4597
4441
  s[1].fontWeight = 'bold';
4598
4442
 
4599
- if( this.radius !== 0 ) s[0].borderRadius = this.radius+'px';
4600
- //if( o.border ) s[0].border = '1px solid ' + o.border;
4601
-
4602
-
4603
- /*if(this.decal){
4604
- s[0].boxSizing = 'border-box';
4605
- s[0].backgroundClip = 'border-box';
4606
- s[0].border = (this.decal/3)+'px solid ' + o.group.colors.background;
4607
- }*/
4608
-
4609
-
4610
-
4611
-
4443
+ if( this.radius !== 0 ) s[0].borderRadius = this.radius+'px';
4612
4444
  this.init();
4613
4445
 
4614
4446
  this.setBG( o.bg );
4615
4447
 
4616
4448
  if( o.open !== undefined ) this.open();
4617
4449
 
4618
-
4619
- //s[0].background = this.bg;
4620
-
4621
4450
  }
4622
4451
 
4623
4452
  testZone ( e ) {
@@ -4639,12 +4468,13 @@ class Group extends Proto {
4639
4468
  clearTarget () {
4640
4469
 
4641
4470
  if( this.current === -1 ) return false;
4642
-
4643
- // if(!this.targetIn ) return;
4644
- this.targetIn .uiout();
4645
- this.targetIn .reset();
4471
+ if( this.proto.s ){
4472
+ // if no s target is delete !!
4473
+ this.proto.uiout();
4474
+ this.proto.reset();
4475
+ }
4476
+ this.proto = null;
4646
4477
  this.current = -1;
4647
- this.targetIn = null;
4648
4478
  this.cursor();
4649
4479
  return true;
4650
4480
 
@@ -4665,7 +4495,7 @@ class Group extends Proto {
4665
4495
  let type = e.type;
4666
4496
 
4667
4497
  let change = false;
4668
- let targetChange = false;
4498
+ let protoChange = false;
4669
4499
 
4670
4500
  let name = this.testZone( e );
4671
4501
 
@@ -4678,9 +4508,7 @@ class Group extends Proto {
4678
4508
 
4679
4509
  if( Roots.isMobile && type === 'mousedown' ) this.getNext( e, change );
4680
4510
 
4681
- if( this.targetIn ) targetChange = this.targetIn .handleEvent( e );
4682
-
4683
- //if( type === 'mousemove' ) change = this.styles('def');
4511
+ if( this.proto ) protoChange = this.proto.handleEvent( e );
4684
4512
 
4685
4513
  if( !Roots.lock ) this.getNext( e, change );
4686
4514
 
@@ -4697,7 +4525,7 @@ class Group extends Proto {
4697
4525
  }
4698
4526
 
4699
4527
  if( this.isDown ) change = true;
4700
- if( targetChange ) change = true;
4528
+ if( protoChange ) change = true;
4701
4529
 
4702
4530
  return change;
4703
4531
 
@@ -4713,41 +4541,14 @@ class Group extends Proto {
4713
4541
  }
4714
4542
 
4715
4543
  if( next !== -1 ){
4716
- this.targetIn = this.uis[ this.current ];
4717
- this.targetIn .uiover();
4544
+ this.proto = this.uis[ this.current ];
4545
+ this.proto.uiover();
4718
4546
  }
4719
4547
 
4720
4548
  }
4721
4549
 
4722
4550
  // ----------------------
4723
4551
 
4724
- /*calcH () {
4725
-
4726
- let lng = this.uis.length, i, u, h=0, px=0, tmph=0;
4727
- for( i = 0; i < lng; i++){
4728
- u = this.uis[i];
4729
- if( !u.autoWidth ){
4730
-
4731
- if(px===0) h += u.h+1;
4732
- else {
4733
- if(tmph<u.h) h += u.h-tmph;
4734
- }
4735
- tmph = u.h;
4736
-
4737
- //tmph = tmph < u.h ? u.h : tmph;
4738
- px += u.w;
4739
- if( px+u.w > this.w ) px = 0;
4740
-
4741
- }
4742
- else h += u.h+1;
4743
- }
4744
-
4745
- return h;
4746
- }*/
4747
-
4748
-
4749
-
4750
-
4751
4552
  setBG ( bg ) {
4752
4553
 
4753
4554
  if( bg !== undefined ) this.colors.background = bg;
@@ -4780,15 +4581,10 @@ class Group extends Proto {
4780
4581
  }
4781
4582
  }
4782
4583
 
4783
- //let n = add.apply( this, a );
4784
4584
  let u = this.ADD.apply( this, a );
4785
4585
 
4786
4586
  this.uis.push( u );
4787
4587
 
4788
- //this.calc()
4789
-
4790
-
4791
-
4792
4588
  this.isEmpty = false;
4793
4589
 
4794
4590
  return u;
@@ -4809,9 +4605,7 @@ class Group extends Proto {
4809
4605
 
4810
4606
  this.clear();
4811
4607
  if( this.isUI ) this.main.calc();
4812
-
4813
4608
  super.dispose();
4814
- //Proto.prototype.clear.call( this );
4815
4609
 
4816
4610
  }
4817
4611
 
@@ -4895,12 +4689,6 @@ class Group extends Proto {
4895
4689
 
4896
4690
  this.s[0].height = this.h + 'px';
4897
4691
 
4898
- //console.log('G', this.h)
4899
-
4900
- //if( !this.isOpen ) return;
4901
-
4902
- //this.h = Roots.calcUis( this.uis, this.zone, this.zone.y + this.baseH )+this.baseH;
4903
-
4904
4692
  }
4905
4693
 
4906
4694
  parentHeight ( t ) {
@@ -4912,22 +4700,9 @@ class Group extends Proto {
4912
4700
 
4913
4701
  calc ( y ) {
4914
4702
 
4915
- if( !this.isOpen ) return;
4916
-
4917
- /*
4918
-
4919
- if( y !== undefined ){
4920
- this.h += y;
4921
- if( this.isUI ) this.main.calc( y );
4922
- } else {
4923
- this.h = this.calcH() + this.baseH;
4924
- }
4925
- this.s[0].height = this.h + 'px';*/
4926
-
4927
- // if(this.isOpen)
4703
+ if( !this.isOpen ) return
4928
4704
  if( this.isUI ) this.main.calc();
4929
4705
  else this.calcUis();
4930
-
4931
4706
  this.s[0].height = this.h + 'px';
4932
4707
 
4933
4708
  }
@@ -4940,8 +4715,6 @@ class Group extends Proto {
4940
4715
  this.uis[i].rSize();
4941
4716
  }
4942
4717
 
4943
- //this.calc()
4944
-
4945
4718
  }
4946
4719
 
4947
4720
  rSize () {
@@ -8159,7 +7932,7 @@ class Gui {
8159
7932
  this.screen = null;
8160
7933
  this.plane = o.plane || null;
8161
7934
 
8162
- this.isEmpty = true;
7935
+
8163
7936
 
8164
7937
  // color
8165
7938
  if( o.config ) o.colors = o.config;
@@ -8223,9 +7996,9 @@ class Gui {
8223
7996
  this.isScroll = false;
8224
7997
 
8225
7998
  this.uis = [];
8226
-
8227
7999
  this.current = -1;
8228
- this.target = null;
8000
+ this.proto = null;
8001
+ this.isEmpty = true;
8229
8002
  this.decal = 0;
8230
8003
  this.ratio = 1;
8231
8004
  this.oy = 0;
@@ -8390,9 +8163,11 @@ class Gui {
8390
8163
  }
8391
8164
 
8392
8165
  hide ( b ) {
8166
+ this.content.style.visibility = b ? 'hidden' : 'visible';
8167
+ }
8393
8168
 
8394
- this.content.style.display = b ? 'none' : 'block';
8395
-
8169
+ display( v = false ) {
8170
+ this.content.style.visibility = v ? 'visible' : 'hidden';
8396
8171
  }
8397
8172
 
8398
8173
  onChange ( f ) {
@@ -8458,13 +8233,13 @@ class Gui {
8458
8233
  clearTarget () {
8459
8234
 
8460
8235
  if( this.current === -1 ) return false;
8461
- if( this.target.s ){
8236
+ if( this.proto.s ){
8462
8237
  // if no s target is delete !!
8463
- this.target.uiout();
8464
- this.target.reset();
8238
+ this.proto.uiout();
8239
+ this.proto.reset();
8465
8240
  }
8466
8241
 
8467
- this.target = null;
8242
+ this.proto = null;
8468
8243
  this.current = -1;
8469
8244
 
8470
8245
  ///console.log(this.isDown)//if(this.isDown)Roots.clearInput();
@@ -8507,7 +8282,7 @@ class Gui {
8507
8282
  let type = e.type;
8508
8283
 
8509
8284
  let change = false;
8510
- let targetChange = false;
8285
+ let protoChange = false;
8511
8286
 
8512
8287
  let name = this.testZone( e );
8513
8288
 
@@ -8526,10 +8301,10 @@ class Gui {
8526
8301
 
8527
8302
  if( Roots.isMobile && type === 'mousedown' ) this.getNext( e, change );
8528
8303
 
8529
- if( this.target ) targetChange = this.target.handleEvent( e );
8304
+ if( this.proto ) protoChange = this.proto.handleEvent( e );
8530
8305
 
8531
8306
  if( type === 'mousemove' ) change = this.mode('def');
8532
- if( type === 'wheel' && !targetChange && this.isScroll ) change = this.onWheel( e );
8307
+ if( type === 'wheel' && !protoChange && this.isScroll ) change = this.onWheel( e );
8533
8308
 
8534
8309
  if( !Roots.lock ) {
8535
8310
  this.getNext( e, change );
@@ -8564,7 +8339,7 @@ class Gui {
8564
8339
  }
8565
8340
 
8566
8341
  if( this.isDown ) change = true;
8567
- if( targetChange ) change = true;
8342
+ if( protoChange ) change = true;
8568
8343
 
8569
8344
  if( type === 'keyup' ) change = true;
8570
8345
  if( type === 'keydown' ) change = true;
@@ -8588,8 +8363,8 @@ class Gui {
8588
8363
  }
8589
8364
 
8590
8365
  if( next !== -1 ){
8591
- this.target = this.uis[ this.current ];
8592
- this.target.uiover();
8366
+ this.proto = this.uis[ this.current ];
8367
+ this.proto.uiover();
8593
8368
  }
8594
8369
 
8595
8370
  }
@@ -8662,17 +8437,6 @@ class Gui {
8662
8437
  if( ontop ) this.uis.unshift( u );
8663
8438
  else this.uis.push( u );
8664
8439
 
8665
- /*if( !u.autoWidth ){
8666
- let y = u.c[0].getBoundingClientRect().top;
8667
- if( this.prevY !== y ){
8668
- this.calc( u.h + 1 );
8669
- this.prevY = y;
8670
- }
8671
- }else{
8672
- this.prevY = 0;//-1;
8673
- this.calc( u.h + 1 );
8674
- }*/
8675
-
8676
8440
  this.calc();
8677
8441
 
8678
8442
  this.isEmpty = false;
@@ -8681,18 +8445,6 @@ class Gui {
8681
8445
 
8682
8446
  }
8683
8447
 
8684
- /*applyCalc () {
8685
-
8686
- //console.log(this.uis.length, this.tmpH )
8687
-
8688
- this.calc( this.tmpH );
8689
- //this.tmpH = 0;
8690
- this.tmpAdd = null;
8691
-
8692
- }*/
8693
-
8694
-
8695
-
8696
8448
  // remove one node
8697
8449
 
8698
8450
  remove ( n ) {
@@ -8727,19 +8479,12 @@ class Gui {
8727
8479
  item = this.uis.pop();
8728
8480
  this.inner.removeChild( item.c[0] );
8729
8481
  item.dispose();
8730
-
8731
- //this.uis[i].clear()
8732
8482
  }
8733
8483
 
8734
8484
  this.uis = [];
8735
8485
  this.isEmpty = true;
8736
- //this.zone = { x:0, y:0, w:this.size.w, h:0 };
8737
- //this.setWidth()
8738
- //Roots.listens = [];
8739
8486
  this.calc();
8740
8487
 
8741
-
8742
-
8743
8488
  }
8744
8489
 
8745
8490
  clear() {
@@ -8756,11 +8501,11 @@ class Gui {
8756
8501
 
8757
8502
  }
8758
8503
 
8504
+
8759
8505
  // ----------------------
8760
8506
  // ITEMS SPECIAL
8761
8507
  // ----------------------
8762
8508
 
8763
-
8764
8509
  resetItem () {
8765
8510
 
8766
8511
  if( !this.isItemMode ) return;
@@ -8775,12 +8520,11 @@ class Gui {
8775
8520
  if( !this.isItemMode ) return;
8776
8521
 
8777
8522
  name = name || '';
8778
-
8779
8523
  this.resetItem();
8780
8524
 
8781
8525
  if( !name ){
8782
8526
  this.update(0);
8783
- return;
8527
+ return
8784
8528
  }
8785
8529
 
8786
8530
  let i = this.uis.length;
@@ -8814,8 +8558,6 @@ class Gui {
8814
8558
  this.ratio = this.maxView / this.total;
8815
8559
  this.sh = this.maxView * this.ratio;
8816
8560
 
8817
- //if( this.sh < 20 ) this.sh = 20;
8818
-
8819
8561
  this.range = this.maxView - this.sh;
8820
8562
 
8821
8563
  this.oy = Tools.clamp( this.oy, 0, this.range );
@@ -8874,7 +8616,7 @@ class Gui {
8874
8616
 
8875
8617
  let diff = this.h - this.maxHeight;
8876
8618
 
8877
- if( diff > 1 ){ //this.h > this.maxHeight ){
8619
+ if( diff > 1 ){
8878
8620
 
8879
8621
  this.isScroll = true;
8880
8622
  this.zone.h = this.maxHeight + this.bh;
@@ -8887,8 +8629,6 @@ class Gui {
8887
8629
 
8888
8630
  }
8889
8631
 
8890
- //if( this.forceHeight ) this.zone.h = this.forceHeight
8891
-
8892
8632
  this.upScroll( this.isScroll );
8893
8633
 
8894
8634
  this.innerContent.style.height = this.zone.h - this.bh + 'px';
@@ -8898,11 +8638,7 @@ class Gui {
8898
8638
 
8899
8639
  if( this.forceHeight && this.lockHeight ) this.content.style.height = this.forceHeight + 'px';
8900
8640
 
8901
- //console.log( this.zone, this.bh )
8902
-
8903
- //if( this.isOpen ) this.calcUis()
8904
8641
  if( this.isCanvas ) this.draw( true );
8905
- //else if( !this.transition ) this.rezone()
8906
8642
 
8907
8643
  }
8908
8644
 
@@ -8916,20 +8652,12 @@ class Gui {
8916
8652
 
8917
8653
  this.zone.w = Math.floor( this.zone.w );
8918
8654
 
8919
- //console.log( this.zone.w )
8920
-
8921
8655
  this.content.style.width = this.zone.w + 'px';
8922
8656
 
8923
8657
  if( this.isCenter ) this.content.style.marginLeft = -(Math.floor(this.zone.w*0.5)) + 'px';
8924
8658
 
8925
8659
  this.setItemWidth( this.zone.w - this.sw );
8926
8660
 
8927
- //this.setHeight();
8928
- //this.calc()
8929
-
8930
- //if( this.isCanvasOnly ) Roots.needReZone = true;
8931
- //Roots.resize();
8932
-
8933
8661
  }
8934
8662
 
8935
8663
  setItemWidth ( w ) {
@@ -8944,6 +8672,6 @@ class Gui {
8944
8672
 
8945
8673
  }
8946
8674
 
8947
- const REVISION = '4.0.7';
8675
+ const REVISION = '4.0.8';
8948
8676
 
8949
8677
  export { Files, Gui, Proto, REVISION, Tools, add };