uil 4.2.3 → 4.2.5

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/uil.js CHANGED
@@ -181,9 +181,7 @@
181
181
  e.type = 'mouseup';
182
182
  }
183
183
 
184
- if (event.type === 'pointerleave') {
185
- R.isLeave = true;
186
- }
184
+ if (event.type === 'pointerleave') R.isLeave = true;
187
185
  if (event.type === 'pointerdown') e.type = 'mousedown';
188
186
  if (event.type === 'pointerup') e.type = 'mouseup';
189
187
 
@@ -229,7 +227,8 @@
229
227
  if (R.ID.isCanvasOnly) {
230
228
  e.clientX = R.ID.mouse.x;
231
229
  e.clientY = R.ID.mouse.y;
232
- }
230
+ } //if( R.ID.marginDiv ) e.clientY -= R.ID.margin * 0.5
231
+
233
232
 
234
233
  R.ID.handleEvent(e);
235
234
  }
@@ -283,40 +282,38 @@
283
282
  // ----------------------
284
283
  // GUI / GROUP FUNCTION
285
284
  // ----------------------
286
- calcUis: function (uis, zone, py) {
285
+ calcUis: (uis, zone, py) => {
287
286
  //console.log('calc_uis')
288
287
  let i = uis.length,
289
288
  u,
290
289
  px = 0,
291
290
  n = 0,
292
- tw;
291
+ tw,
292
+ m;
293
293
  let height = 0;
294
- let m = 1;
295
294
 
296
295
  while (i--) {
297
296
  u = uis[n];
298
297
  n++;
299
298
  if (u.isGroup) u.calcUis();
299
+ m = u.margin; //div = u.marginDiv
300
+
300
301
  u.zone.w = u.w;
301
- u.zone.h = u.h;
302
- m = u.margin;
302
+ u.zone.h = u.h + m;
303
303
 
304
304
  if (!u.autoWidth) {
305
- if (px === 0) {
306
- height += u.h + m;
307
- }
308
-
305
+ if (px === 0) height += u.h + m;
309
306
  u.zone.x = zone.x + px;
310
- u.zone.y = py;
311
- tw = R.getWidth(u);
312
- if (tw) u.zone.w = u.w = tw; // focrce width if content is canvas
313
- else if (u.fw) u.zone.w = u.w = u.fw; //console.log( u.name, u.zone.w, u.w, zone, tw )
314
- //console.log( tw )
307
+ u.zone.y = py; // + u.mtop
308
+ //if(div) u.zone.y += m * 0.5
315
309
 
310
+ tw = R.getWidth(u);
311
+ if (tw) u.zone.w = u.w = tw;else if (u.fw) u.zone.w = u.w = u.fw;
316
312
  px += u.zone.w;
317
313
 
318
314
  if (px >= zone.w) {
319
- py += u.h + m;
315
+ py += u.h + m; //if(div) py += m * 0.5
316
+
320
317
  px = 0;
321
318
  }
322
319
  } else {
@@ -359,8 +356,11 @@
359
356
  if (x === undefined || y === undefined) return false;
360
357
  let z = o.zone;
361
358
  let mx = x - z.x;
362
- let my = y - z.y;
363
- let over = mx >= 0 && my >= 0 && mx <= z.w && my <= z.h;
359
+ let my = y - z.y; //if( this.marginDiv ) e.clientY -= this.margin * 0.5
360
+ //if( o.group && o.group.marginDiv ) my += o.group.margin * 0.5
361
+
362
+ let over = mx >= 0 && my >= 0 && mx <= z.w && my <= z.h; //if( o.marginDiv ) my -= o.margin * 0.5
363
+
364
364
  if (over) o.local.set(mx, my);else o.local.neg();
365
365
  return over;
366
366
  },
@@ -667,11 +667,12 @@
667
667
  pi60: Math.PI / 3,
668
668
  torad: Math.PI / 180,
669
669
  todeg: 180 / Math.PI,
670
- clamp: function (v, min, max) {
670
+ clamp: (v, min, max) => {
671
671
  v = v < min ? min : v;
672
672
  v = v > max ? max : v;
673
673
  return v;
674
674
  },
675
+ isDivid: v => v * 0.5 === Math.floor(v * 0.5),
675
676
  size: {
676
677
  w: 240,
677
678
  h: 20,
@@ -681,7 +682,7 @@
681
682
  // ----------------------
682
683
  // COLOR
683
684
  // ----------------------
684
- defineColor: function (o, cc = T.colors) {
685
+ defineColor: (o, cc = T.colors) => {
685
686
  let color = { ...cc
686
687
  };
687
688
  let textChange = ['fontFamily', 'fontWeight', 'fontShadow', 'fontSize'];
@@ -740,8 +741,11 @@
740
741
  return color;
741
742
  },
742
743
  colors: {
743
- sx: 3,
744
- sy: 3,
744
+ sx: 4,
745
+ //4
746
+ sy: 2,
747
+ //2
748
+ radius: 2,
745
749
  content: 'none',
746
750
  background: 'rgba(50,50,50,0.15)',
747
751
  backgroundOver: 'rgba(50,50,50,0.3)',
@@ -769,14 +773,13 @@
769
773
  fontShadow: 'none',
770
774
  //'#000',
771
775
  fontSize: 12,
772
- radius: 4,
773
776
  hide: 'rgba(0,0,0,0)'
774
777
  },
775
778
  // style css
776
779
  css: {
777
780
  basic: 'position:absolute; pointer-events:none; box-sizing:border-box; margin:0; padding:0; overflow:hidden; ' + '-o-user-select:none; -ms-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -moz-user-select:none;',
778
781
  button: 'display:flex; align-items:center; justify-content:center; text-align:center;',
779
- middle: 'display:flex; align-items:center; justify-content:left; text-align:left; flex-direction: row-reverse;'
782
+ middle: 'display:flex; align-items:center; justify-content:left; text-align:left; flex-direction: row-reverse;'
780
783
  },
781
784
  // svg path
782
785
  svgs: {
@@ -801,7 +804,9 @@
801
804
  object: 'M 10 1 L 7 4 4 1 1 1 1 13 4 13 4 5 7 8 10 5 10 13 13 13 13 1 10 1 Z',
802
805
  none: 'M 9 5 L 5 5 5 9 9 9 9 5 Z',
803
806
  cursor: 'M 4 7 L 1 10 1 12 2 13 4 13 7 10 9 14 14 0 0 5 4 7 Z',
804
- load: 'M 14 8 L 12 8 12 12 2 12 2 8 0 8 0 14 14 14 14 8 M 8 5 L 8 0 6 0 6 5 3 5 7 9 11 5 8 5 Z'
807
+ load: 'M 13 8 L 11.5 6.5 9 9 9 3 5 3 5 9 2.5 6.5 1 8 7 14 13 8 M 9 2 L 9 0 5 0 5 2 9 2 Z',
808
+ save: 'M 9 12 L 5 12 5 14 9 14 9 12 M 11.5 7.5 L 13 6 7 0 1 6 2.5 7.5 5 5 5 11 9 11 9 5 11.5 7.5 Z',
809
+ extern: 'M 14 14 L 14 0 0 0 0 14 14 14 M 12 6 L 12 12 2 12 2 6 12 6 M 12 2 L 12 4 2 4 2 2 12 2 Z'
805
810
  },
806
811
 
807
812
  rezone() {
@@ -992,6 +997,7 @@
992
997
  // Color function
993
998
  // ----------------------
994
999
  ColorLuma: function (hex, l) {
1000
+ //if( hex.substring(0, 3) === 'rgba' ) hex = '#000';
995
1001
  if (hex === 'n') hex = '#000'; // validate hex string
996
1002
 
997
1003
  hex = String(hex).replace(/[^0-9a-f]/gi, '');
@@ -1932,6 +1938,8 @@
1932
1938
  this.isUI = o.isUI || false;
1933
1939
  this.group = o.group || null;
1934
1940
  this.isListen = false;
1941
+ this.top = 0;
1942
+ this.ytop = 0;
1935
1943
  this.isSelectable = o.selectable !== undefined ? o.selectable : false;
1936
1944
  this.unselectable = o.unselect !== undefined ? o.unselect : this.isSelectable;
1937
1945
  this.ontop = o.ontop ? o.ontop : false; // 'beforebegin' 'afterbegin' 'beforeend' 'afterend'
@@ -1943,7 +1951,8 @@
1943
1951
  x: 0,
1944
1952
  y: 0,
1945
1953
  w: 0,
1946
- h: 0
1954
+ h: 0,
1955
+ d: 0
1947
1956
  };
1948
1957
  this.local = new V2().neg();
1949
1958
  this.isCanvasOnly = false;
@@ -2009,16 +2018,20 @@
2009
2018
  this.c[0] = Tools.dom('div', this.css.basic + flexible + 'position:relative; height:20px;');
2010
2019
  this.s[0] = this.c[0].style; // bottom margin
2011
2020
 
2012
- this.margin = o.margin || 1;
2021
+ this.margin = this.colors.sy;
2022
+ this.mtop = 0;
2023
+ let marginDiv = Tools.isDivid(this.margin);
2013
2024
 
2014
2025
  if (this.isUI && this.margin) {
2015
- this.s[0].boxSizing = 'content-box'; //this.s[0].marginBottom = this.margin + 'px';
2026
+ this.s[0].boxSizing = 'content-box';
2016
2027
 
2017
- if (this.margin * 0.5 === Math.floor(this.margin * 0.5)) {
2018
- this.s[0].borderTop = this.margin * 0.5 + 'px solid transparent';
2019
- this.s[0].borderBottom = this.margin * 0.5 + 'px solid transparent';
2028
+ if (marginDiv) {
2029
+ this.mtop = this.margin * 0.5; //this.s[0].borderTop = '${this.mtop}px solid transparent'
2030
+ //console.log(`${this.mtop}px solid transparent`)
2031
+
2032
+ this.s[0].borderTop = this.mtop + 'px solid transparent';
2033
+ this.s[0].borderBottom = this.mtop + 'px solid transparent';
2020
2034
  } else {
2021
- //this.s[0].borderTop = (this.margin*0.5) + 'px solid transparent'
2022
2035
  this.s[0].borderBottom = this.margin + 'px solid transparent';
2023
2036
  }
2024
2037
  } // with title
@@ -2048,7 +2061,8 @@
2048
2061
 
2049
2062
 
2050
2063
  init() {
2051
- this.zone.h = this.h;
2064
+ this.ytop = this.top + this.mtop;
2065
+ this.zone.h = this.h + this.margin;
2052
2066
  this.zone.w = this.w;
2053
2067
  let s = this.s; // style cache
2054
2068
 
@@ -2069,8 +2083,7 @@
2069
2083
  if (c[1] !== undefined && this.autoWidth) {
2070
2084
  s[1] = c[1].style;
2071
2085
  s[1].top = 1 + 'px';
2072
- s[1].height = this.h - 2 + 'px'; //s[1].height = (this.h-4) + 'px';
2073
- // s[1].lineHeight = (this.h-8) + 'px';
2086
+ s[1].height = this.h - 2 + 'px';
2074
2087
  }
2075
2088
 
2076
2089
  let frag = Tools.frag;
@@ -2331,6 +2344,10 @@
2331
2344
  case 5:
2332
2345
  s = 0.00001;
2333
2346
  break;
2347
+
2348
+ case 6:
2349
+ s = 0.000001;
2350
+ break;
2334
2351
  }
2335
2352
 
2336
2353
  this.step = o.step === undefined ? s : o.step;
@@ -2349,7 +2366,11 @@
2349
2366
  handleEvent(e) {
2350
2367
  if (this.lock) return;
2351
2368
  if (this.neverlock) Roots.lock = false;
2352
- if (!this[e.type]) return console.error(e.type, 'this type of event no existe !');
2369
+ if (!this[e.type]) return console.error(e.type, 'this type of event no existe !'); // TODO !!!!
2370
+ //if( this.marginDiv ) z.d -= this.margin * 0.5
2371
+ //if( this.marginDiv ) e.clientY -= this.margin * 0.5
2372
+ //if( this.group && this.group.marginDiv ) e.clientY -= this.group.margin * 0.5
2373
+
2353
2374
  return this[e.type](e);
2354
2375
  }
2355
2376
 
@@ -2457,7 +2478,7 @@
2457
2478
  } else {
2458
2479
  this.p = 0;
2459
2480
  if (this.c[1] !== undefined) this.c[1].textContent = '';
2460
- this.c[2] = this.dom('div', this.css.txt + this.css.button + 'top:1px; background:' + cc.button + '; height:' + (this.h - 2) + 'px; border:1px solid ' + cc.border + '; border-radius:' + this.radius + 'px;');
2481
+ this.c[2] = this.dom('div', this.css.txt + this.css.button + 'top:1px; background:' + cc.button + '; height:' + (this.h - 2) + 'px; border:' + cc.borderSize + 'px solid ' + cc.border + '; border-radius:' + this.radius + 'px;');
2461
2482
  }
2462
2483
 
2463
2484
  this.stat = -1;
@@ -2577,7 +2598,7 @@
2577
2598
  s[3].left = w + 'px';
2578
2599
  } else {
2579
2600
  s[2].left = this.sa + 'px';
2580
- s[2].width = this.w - 20 + 'px';
2601
+ s[2].width = this.sb + 'px';
2581
2602
  }
2582
2603
  }
2583
2604
 
@@ -2616,19 +2637,18 @@
2616
2637
  this.stat[i] = sel ? 3 : 1;
2617
2638
  }
2618
2639
 
2619
- if (!o.value && !o.values) {
2620
- if (this.c[1] !== undefined) {
2621
- this.c[1].textContent = ''; //this.txt = ''
2622
- }
2640
+ if (this.txt === '') this.p = 0;
2641
+
2642
+ if (!o.value && !o.values || this.p === 0) {
2643
+ if (this.c[1] !== undefined) this.c[1].textContent = '';
2623
2644
  }
2624
2645
 
2625
- if (this.txt === '') this.p = 0;
2626
2646
  this.init();
2627
2647
  }
2628
2648
 
2629
2649
  onOff() {
2630
2650
  this.on = !this.on;
2631
- this.label(this.on ? this.onName : this.txt);
2651
+ this.label(this.on ? this.onName : this.value);
2632
2652
  }
2633
2653
 
2634
2654
  testZone(e) {
@@ -2804,7 +2824,6 @@
2804
2824
  this.pi90 = Tools.pi90;
2805
2825
  this.offset = new V2();
2806
2826
  this.h = o.h || this.w + 10;
2807
- this.top = 0;
2808
2827
  this.c[0].style.width = this.w + 'px';
2809
2828
  this.c[0].style.display = 'block';
2810
2829
 
@@ -2894,7 +2913,7 @@
2894
2913
 
2895
2914
  let off = this.offset;
2896
2915
  off.x = this.w * 0.5 - (e.clientX - this.zone.x);
2897
- off.y = this.diam * 0.5 - (e.clientY - this.zone.y - this.top);
2916
+ off.y = this.diam * 0.5 - (e.clientY - this.zone.y - this.ytop);
2898
2917
  this.r = off.angle() - this.pi90;
2899
2918
  this.r = (this.r % this.twoPi + this.twoPi) % this.twoPi;
2900
2919
 
@@ -2981,15 +3000,16 @@
2981
3000
  this.offset = new V2();
2982
3001
  this.decal = new V2();
2983
3002
  this.pp = new V2();
2984
- this.c[2] = this.dom('div', this.css.txt + 'height:' + (this.h - 4) + 'px;' + 'border-radius:' + this.radius + 'px; line-height:' + (this.h - 8) + 'px;');
2985
- this.s[2] = this.c[2].style;
2986
- this.s[2].textShadow = 'none';
3003
+ let cc = this.colors; // this.c[2] = this.dom( 'div', this.css.txt + this.css.middle + 'top:1px; height:'+(this.h-2)+'px;' + 'border-radius:'+this.radius+'px; text-shadow:none; border:'+cc.borderSize+'px solid '+cc.border+';' )
2987
3004
 
2988
- if (this.up) {
2989
- this.s[2].top = 'auto';
2990
- this.s[2].bottom = '2px';
2991
- } //this.c[0].style.textAlign = 'center';
3005
+ this.c[2] = this.dom('div', `${this.css.txt} ${this.css.middle} top:1px; height:${this.h - 2}px; border-radius:${this.radius}px; text-shadow:none; border:${cc.borderSize}px solid ${cc.border};`); //this.s[2] = this.c[2].style;
3006
+ //this.s[2].textShadow = 'none'
2992
3007
 
3008
+ /*if( this.up ){
3009
+ this.s[2].top = 'auto';
3010
+ this.s[2].bottom = '2px';
3011
+ }*/
3012
+ //this.c[0].style.textAlign = 'center';
2993
3013
 
2994
3014
  this.c[0].style.display = 'block';
2995
3015
  this.c[3] = this.getColorRing();
@@ -3009,8 +3029,8 @@
3009
3029
  this.tsl = Math.sqrt(3) * this.tr;
3010
3030
  this.hue = 0;
3011
3031
  this.d = 256;
3012
- this.setColor(this.value);
3013
3032
  this.init();
3033
+ this.setColor(this.value);
3014
3034
  if (o.open !== undefined) this.open();
3015
3035
  }
3016
3036
 
@@ -3065,7 +3085,7 @@
3065
3085
  if (name === 'color') {
3066
3086
  off = this.offset;
3067
3087
  off.x = e.clientX - (this.zone.x + this.decal.x + this.mid);
3068
- off.y = e.clientY - (this.zone.y + this.decal.y + this.mid);
3088
+ off.y = e.clientY - (this.zone.y + this.decal.y + this.mid) - this.ytop;
3069
3089
  d = off.length() * this.ratio;
3070
3090
  rr = off.angle();
3071
3091
  if (rr < 0) rr += 2 * T.PI;
@@ -3233,7 +3253,9 @@
3233
3253
  super.rSize();
3234
3254
  let s = this.s;
3235
3255
  s[2].width = this.sb + 'px';
3236
- s[2].left = this.sa + 'px';
3256
+ s[2].left = this.sa + 'px'; //console.log(this.sb)
3257
+
3258
+ this.cw = this.sb > 256 ? 256 : this.sb;
3237
3259
  this.rSizeColor(this.cw);
3238
3260
  this.decal.x = Math.floor((this.w - this.wfixe) * 0.5); //s[3].left = this.decal.x + 'px';
3239
3261
  }
@@ -3734,7 +3756,7 @@
3734
3756
  nup = this.mode(this.isDown ? 2 : 1, name); //this.cursor( this.current !== -1 ? 'move' : 'pointer' );
3735
3757
 
3736
3758
  if (this.isDown) {
3737
- this.v[name] = this.clamp(1 - (e.clientY - this.zone.y - this.top - 10) / this.gh, 0, 1);
3759
+ this.v[name] = this.clamp(1 - (e.clientY - this.zone.y - this.ytop - 10) / this.gh, 0, 1);
3738
3760
  this.update(true);
3739
3761
  }
3740
3762
  }
@@ -3813,6 +3835,8 @@
3813
3835
  fill: cc.text,
3814
3836
  stroke: 'none'
3815
3837
  });
3838
+ let bh = this.mtop === 0 ? this.margin : this.mtop;
3839
+ this.c[4] = this.dom('div', this.css.basic + 'width:100%; left:0; height:' + (bh + 1) + 'px; top:' + (this.h - 1) + 'px; background:none;');
3816
3840
  this.s;
3817
3841
  this.c[1].name = 'group';
3818
3842
  this.init();
@@ -3850,9 +3874,10 @@
3850
3874
  let l = this.local;
3851
3875
  if (l.x === -1 && l.y === -1) return '';
3852
3876
  let name = '';
3853
- if (l.y < this.baseH) name = 'title';else {
3877
+ if (l.y < this.baseH + this.margin) name = 'title';else {
3854
3878
  if (this.isOpen) name = 'content';
3855
- }
3879
+ } //console.log(name)
3880
+
3856
3881
  return name;
3857
3882
  }
3858
3883
 
@@ -3887,13 +3912,20 @@
3887
3912
 
3888
3913
  switch (name) {
3889
3914
  case 'content':
3890
- this.cursor();
3915
+ //this.cursor()
3916
+ //if( this.marginDiv ) e.clientY -= this.margin * 0.5
3891
3917
  if (Roots.isMobile && type === 'mousedown') this.getNext(e, change);
3892
- if (this.proto) protoChange = this.proto.handleEvent(e);
3918
+
3919
+ if (this.proto) {
3920
+ //e.clientY -= this.margin
3921
+ protoChange = this.proto.handleEvent(e);
3922
+ }
3923
+
3893
3924
  if (!Roots.lock) this.getNext(e, change);
3894
3925
  break;
3895
3926
 
3896
3927
  case 'title':
3928
+ //this.cursor( this.isOpen ? 'n-resize':'s-resize' );
3897
3929
  this.cursor('pointer');
3898
3930
 
3899
3931
  if (type === 'mousedown') {
@@ -3944,7 +3976,9 @@
3944
3976
  }
3945
3977
  }
3946
3978
 
3947
- let u = this.ADD.apply(this, a);
3979
+ let u = this.ADD.apply(this, a); //u.margin += this.margin
3980
+ //console.log( u.margin )
3981
+
3948
3982
  this.uis.push(u);
3949
3983
  this.isEmpty = false;
3950
3984
  return u;
@@ -3986,7 +4020,7 @@
3986
4020
  let id = this.uis.indexOf(n);
3987
4021
 
3988
4022
  if (id !== -1) {
3989
- this.calc(-(this.uis[id].h + 1));
4023
+ this.calc(-(this.uis[id].h + this.margin));
3990
4024
  this.c[2].removeChild(this.uis[id].c[0]);
3991
4025
  this.uis.splice(id, 1);
3992
4026
 
@@ -4000,11 +4034,13 @@
4000
4034
  open() {
4001
4035
  super.open();
4002
4036
  this.setSvg(this.c[3], 'd', this.svgs.g2);
4003
- this.rSizeContent();
4004
- this.h - this.baseH;
4037
+ this.rSizeContent(); //let t = this.h - this.baseH
4038
+
4005
4039
  const s = this.s;
4006
- const cc = this.colors;
4007
- s[2].top = this.h - 1 + 'px';
4040
+ const cc = this.colors; //s[2].top = (this.h-1) + 'px'
4041
+
4042
+ s[2].top = this.h + this.mtop + 'px';
4043
+ s[4].background = cc.groups; //'#0f0'
4008
4044
 
4009
4045
  if (this.radius) {
4010
4046
  s[1].borderRadius = '0px';
@@ -4016,6 +4052,8 @@
4016
4052
  }
4017
4053
 
4018
4054
  if (cc.gborder !== 'none') {
4055
+ s[4].borderLeft = cc.borderSize + 'px solid ' + cc.gborder;
4056
+ s[4].borderRight = cc.borderSize + 'px solid ' + cc.gborder;
4019
4057
  s[2].border = cc.borderSize + 'px solid ' + cc.gborder;
4020
4058
  s[2].borderTop = 'none';
4021
4059
  s[1].borderBottom = cc.borderSize + 'px solid rgba(0,0,0,0)';
@@ -4025,17 +4063,20 @@
4025
4063
  }
4026
4064
 
4027
4065
  close() {
4028
- super.close();
4029
- this.h - this.baseH;
4066
+ super.close(); //let t = this.h - this.baseH
4067
+
4030
4068
  this.setSvg(this.c[3], 'd', this.svgs.g1);
4031
4069
  this.h = this.baseH;
4032
4070
  const s = this.s;
4033
4071
  const cc = this.colors;
4034
4072
  s[0].height = this.h + 'px'; //s[1].height = (this.h-2) + 'px'
4073
+ //s[2].top = this.h + 'px'
4035
4074
 
4036
- s[2].top = this.h + 'px';
4075
+ s[2].top = this.h + this.mtop + 'px';
4076
+ s[4].background = 'none';
4037
4077
 
4038
4078
  if (cc.gborder !== 'none') {
4079
+ s[4].border = 'none';
4039
4080
  s[2].border = 'none';
4040
4081
  s[1].border = cc.borderSize + 'px solid ' + cc.gborder;
4041
4082
  }
@@ -4045,7 +4086,8 @@
4045
4086
  }
4046
4087
 
4047
4088
  calcUis() {
4048
- if (!this.isOpen) this.h = this.baseH;else this.h = Roots.calcUis(this.uis, this.zone, this.zone.y + this.baseH) + this.baseH;
4089
+ if (!this.isOpen) this.h = this.baseH; //else this.h = Roots.calcUis( this.uis, this.zone, this.zone.y + this.baseH ) + this.baseH;
4090
+ else this.h = Roots.calcUis(this.uis, this.zone, this.zone.y + this.baseH + this.margin) + this.baseH;
4049
4091
  this.s[0].height = this.h + 'px';
4050
4092
  }
4051
4093
 
@@ -4072,13 +4114,24 @@
4072
4114
  super.rSize();
4073
4115
  let s = this.s;
4074
4116
  this.w = this.w - this.decal;
4075
- s[3].left = this.sa + this.sb - 6 + 'px'; //s[1].width = this.isbgGroup ? (this.w-5) + 'px' : this.w + 'px'
4076
-
4117
+ s[3].left = this.sa + this.sb - 6 + 'px';
4077
4118
  s[1].width = this.w + 'px';
4078
4119
  s[2].width = this.w + 'px';
4079
4120
  s[1].left = this.decal + 'px';
4080
4121
  s[2].left = this.decal + 'px';
4081
4122
  if (this.isOpen) this.rSizeContent();
4123
+ } //
4124
+
4125
+
4126
+ uiout() {
4127
+ if (this.lock) return;
4128
+ if (this.s) this.s[0].background = this.colors.background;
4129
+ }
4130
+
4131
+ uiover() {
4132
+ if (this.lock) return; //if( this.isOpen ) return;
4133
+
4134
+ if (this.s) this.s[0].background = this.colors.backgroundOver;
4082
4135
  }
4083
4136
 
4084
4137
  }
@@ -4102,7 +4155,6 @@
4102
4155
 
4103
4156
  this.distance = this.diam * 0.5 * 0.25;
4104
4157
  this.h = o.h || this.w + 10;
4105
- this.top = 0;
4106
4158
  this.c[0].style.width = this.w + 'px';
4107
4159
 
4108
4160
  if (this.c[1] !== undefined) {
@@ -4202,7 +4254,7 @@
4202
4254
  //this.tmp.y = this.radius - ( e.clientY - this.zone.y - this.top );
4203
4255
 
4204
4256
  this.tmp.x = this.w * 0.5 - (e.clientX - this.zone.x);
4205
- this.tmp.y = this.diam * 0.5 - (e.clientY - this.zone.y - this.top);
4257
+ this.tmp.y = this.diam * 0.5 - (e.clientY - this.zone.y - this.ytop);
4206
4258
  let distance = this.tmp.length();
4207
4259
 
4208
4260
  if (distance > this.distance) {
@@ -4283,7 +4335,6 @@
4283
4335
  this.cirRange = this.mPI * 2;
4284
4336
  this.offset = new V2();
4285
4337
  this.h = o.h || this.w + 10;
4286
- this.top = 0;
4287
4338
  this.c[0].style.width = this.w + 'px';
4288
4339
  this.c[0].style.display = 'block';
4289
4340
 
@@ -4386,7 +4437,7 @@
4386
4437
  //off.y = this.radius - ( e.clientY - this.zone.y - this.top );
4387
4438
 
4388
4439
  off.x = this.w * 0.5 - (e.clientX - this.zone.x);
4389
- off.y = this.diam * 0.5 - (e.clientY - this.zone.y - this.top);
4440
+ off.y = this.diam * 0.5 - (e.clientY - this.zone.y - this.ytop);
4390
4441
  this.r = -Math.atan2(off.x, off.y);
4391
4442
  if (this.oldr !== null) this.r = Math.abs(this.r - this.oldr) > Math.PI ? this.oldr : this.r;
4392
4443
  this.r = this.r > this.mPI ? this.mPI : this.r;
@@ -4598,6 +4649,7 @@
4598
4649
  this.setList(this.list);
4599
4650
  this.init();
4600
4651
  if (this.isOpenOnStart) this.open(true);
4652
+ this.baseH += this.mtop;
4601
4653
  } // image list
4602
4654
 
4603
4655
 
@@ -4783,7 +4835,8 @@
4783
4835
  this.modeScroll(1);
4784
4836
 
4785
4837
  if (this.isDown) {
4786
- this.modeScroll(2);
4838
+ this.modeScroll(2); //this.update( ( e.clientY - top ) - ( this.sh*0.5 ) );
4839
+
4787
4840
  let top = this.zone.y + this.baseH - 2;
4788
4841
  this.update(e.clientY - top - this.sh * 0.5);
4789
4842
  } //if(this.isDown) this.listmove(e);
@@ -5146,8 +5199,8 @@
5146
5199
  if (o.value.y !== undefined) this.value[1] = o.value.y;
5147
5200
  if (o.value.z !== undefined) this.value[2] = o.value.z;
5148
5201
  if (o.value.w !== undefined) this.value[3] = o.value.w;
5149
- this.isVector = true;
5150
5202
  this.isSingle = false;
5203
+ this.isVector = true;
5151
5204
  }
5152
5205
  }
5153
5206
 
@@ -5168,7 +5221,7 @@
5168
5221
 
5169
5222
  while (i--) {
5170
5223
  if (this.isAngle) this.value[i] = (this.value[i] * 180 / Math.PI).toFixed(this.precision);
5171
- this.c[3 + i] = this.dom('div', this.css.txtselect + ' height:' + (this.h - 4) + 'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border + '; border-radius:' + this.radius + 'px;');
5224
+ this.c[3 + i] = this.dom('div', this.css.txtselect + 'top:1px; height:' + (this.h - 2) + 'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border + '; border-radius:' + this.radius + 'px;');
5172
5225
  if (o.center) this.c[2 + i].style.textAlign = 'center';
5173
5226
  this.c[3 + i].textContent = this.value[i];
5174
5227
  this.c[3 + i].style.color = this.colors.text;
@@ -5178,10 +5231,10 @@
5178
5231
 
5179
5232
 
5180
5233
  this.selectId = 3 + this.lng;
5181
- this.c[this.selectId] = this.dom('div', this.css.txtselect + 'position:absolute; top:4px; height:' + (this.h - 8) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;'); // cursor
5234
+ this.c[this.selectId] = this.dom('div', this.css.txtselect + 'position:absolute; top:2px; height:' + (this.h - 4) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;'); // cursor
5182
5235
 
5183
5236
  this.cursorId = 4 + this.lng;
5184
- this.c[this.cursorId] = this.dom('div', this.css.basic + 'top:4px; height:' + (this.h - 8) + 'px; width:0px; background:' + cc.text + ';');
5237
+ this.c[this.cursorId] = this.dom('div', this.css.basic + 'top:2px; height:' + (this.h - 4) + 'px; width:0px; background:' + cc.text + ';');
5185
5238
  this.init();
5186
5239
  }
5187
5240
 
@@ -5196,22 +5249,7 @@
5196
5249
  }
5197
5250
 
5198
5251
  return '';
5199
- }
5200
- /* mode: function ( n, name ) {
5201
- if( n === this.cMode[name] ) return false;
5202
- //let m;
5203
- /*switch(n){
5204
- case 0: m = this.colors.border; break;
5205
- case 1: m = this.colors.borderOver; break;
5206
- case 2: m = this.colors.borderSelect; break;
5207
- }*/
5208
-
5209
- /* this.reset();
5210
- //this.c[name+2].style.borderColor = m;
5211
- this.cMode[name] = n;
5212
- return true;
5213
- },*/
5214
- // ----------------------
5252
+ } // ----------------------
5215
5253
  // EVENTS
5216
5254
  // ----------------------
5217
5255
 
@@ -5237,18 +5275,11 @@
5237
5275
  }
5238
5276
 
5239
5277
  return false;
5240
- /*
5241
- if( name === '' ) return false;
5242
- this.current = name;
5243
- this.isDown = true;
5244
- this.prev = { x:e.clientX, y:e.clientY, d:0, v: this.isSingle ? parseFloat(this.value) : parseFloat( this.value[ this.current ] ) };
5245
- return this.mode( 2, name );*/
5246
5278
  }
5247
5279
 
5248
5280
  mouseup(e) {
5249
5281
  if (this.isDown) {
5250
- this.isDown = false; //this.current = -1;
5251
-
5282
+ this.isDown = false;
5252
5283
  this.prev = {
5253
5284
  x: 0,
5254
5285
  y: 0,
@@ -5259,20 +5290,6 @@
5259
5290
  }
5260
5291
 
5261
5292
  return false;
5262
- /*let name = this.testZone( e );
5263
- this.isDown = false;
5264
- if( this.current !== -1 ){
5265
- //let tm = this.current;
5266
- let td = this.prev.d;
5267
- this.current = -1;
5268
- this.prev = { x:0, y:0, d:0, v:0 };
5269
- if( !td ){
5270
- this.setInput( this.c[ 3 + name ] );
5271
- return true;//this.mode( 2, name );
5272
- } else {
5273
- return this.reset();//this.mode( 0, tm );
5274
- }
5275
- }*/
5276
5293
  }
5277
5294
 
5278
5295
  mousemove(e) {
@@ -5301,23 +5318,11 @@
5301
5318
  }
5302
5319
 
5303
5320
  return nup;
5304
- } //keydown: function ( e ) { return true; },
5305
- // ----------------------
5321
+ } // ----------------------
5306
5322
 
5307
5323
 
5308
5324
  reset() {
5309
- let nup = false; //this.isDown = false;
5310
- //this.current = 0;
5311
-
5312
- /* let i = this.lng;
5313
- while(i--){
5314
- if(this.cMode[i]!==0){
5315
- this.cMode[i] = 0;
5316
- //this.c[2+i].style.borderColor = this.colors.border;
5317
- nup = true;
5318
- }
5319
- }*/
5320
-
5325
+ let nup = false;
5321
5326
  return nup;
5322
5327
  }
5323
5328
 
@@ -5328,7 +5333,7 @@
5328
5333
  if (v.z !== undefined) this.value[2] = v.z;
5329
5334
  if (v.w !== undefined) this.value[3] = v.w;
5330
5335
  } else {
5331
- if (this.isSingle) this.value = [v];else this.value = v;
5336
+ this.value = this.isSingle ? [v] : v;
5332
5337
  }
5333
5338
 
5334
5339
  this.update();
@@ -5374,9 +5379,7 @@
5374
5379
  let s = this.s;
5375
5380
  let d = this.current !== -1 ? this.tmp[this.current][0] + 5 : 0;
5376
5381
  s[this.cursorId].width = '1px';
5377
- s[this.cursorId].left = d + c + 'px'; //s[2].left = ( d + e ) + 'px';
5378
- //s[2].width = w + 'px';
5379
-
5382
+ s[this.cursorId].left = d + c + 'px';
5380
5383
  s[this.selectId].left = d + e + 'px';
5381
5384
  s[this.selectId].width = w + 'px';
5382
5385
  this.c[this.selectId].innerHTML = t;
@@ -5409,7 +5412,7 @@
5409
5412
  }
5410
5413
 
5411
5414
  if (!force) return;
5412
- if (this.isSingle) this.send(ar[0]);else this.send(ar);
5415
+ this.send(this.isSingle ? ar[0] : ar);
5413
5416
  } // ----------------------
5414
5417
  // REZISE
5415
5418
  // ----------------------
@@ -5655,14 +5658,14 @@
5655
5658
  this.isDown = false;
5656
5659
  let cc = this.colors; // text
5657
5660
 
5658
- this.c[2] = this.dom('div', this.css.txtselect + 'height:' + (this.h - 4) + 'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border + '; border-radius:' + this.radius + 'px;');
5661
+ this.c[2] = this.dom('div', this.css.txtselect + 'top:1px; height:' + (this.h - 2) + 'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border + '; border-radius:' + this.radius + 'px;');
5659
5662
  this.c[2].textContent = this.value; // selection
5660
5663
 
5661
- this.c[3] = this.dom('div', this.css.txtselect + 'position:absolute; top:4px; height:' + (this.h - 8) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;'); // cursor
5664
+ this.c[3] = this.dom('div', this.css.txtselect + 'position:absolute; top:2px; height:' + (this.h - 4) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;'); // cursor
5662
5665
 
5663
- this.c[4] = this.dom('div', this.css.basic + 'top:4px; height:' + (this.h - 8) + 'px; width:0px; background:' + cc.text + ';'); // fake
5666
+ this.c[4] = this.dom('div', this.css.basic + 'top:2px; height:' + (this.h - 4) + 'px; width:0px; background:' + cc.text + ';'); // fake
5664
5667
 
5665
- this.c[5] = this.dom('div', this.css.txtselect + 'height:' + (this.h - 4) + 'px; justify-content: center; font-style: italic; color:' + cc.border + ';');
5668
+ this.c[5] = this.dom('div', this.css.txtselect + 'top:1px; height:' + (this.h - 2) + 'px; border:none; justify-content: center; font-style: italic; color:' + cc.border + ';');
5666
5669
  if (this.value === '') this.c[5].textContent = this.placeHolder;
5667
5670
  this.init();
5668
5671
  }
@@ -5866,8 +5869,7 @@
5866
5869
 
5867
5870
  mousemove(e) {
5868
5871
  let up = false;
5869
- let name = this.testZone(e); //let sel = false;
5870
- //console.log(name)
5872
+ let name = this.testZone(e);
5871
5873
 
5872
5874
  if (name === 'over') {
5873
5875
  this.cursor('pointer');
@@ -6259,17 +6261,20 @@
6259
6261
  if (typeof this.values === 'string') this.values = [this.values];
6260
6262
  this.lng = this.values.length;
6261
6263
  this.value = o.value || null;
6264
+ let cc = this.colors;
6262
6265
  this.isSelectable = o.selectable || false;
6263
- this.spaces = o.spaces || [5, 3];
6266
+ this.spaces = o.spaces || [cc.sx, cc.sy];
6264
6267
  this.bsize = o.bsize || [90, 20];
6265
6268
  if (o.h) this.bsize[1] = o.h;
6266
6269
  this.bsizeMax = this.bsize[0];
6267
6270
  this.tmp = [];
6268
6271
  this.stat = [];
6269
6272
  this.grid = [2, Math.round(this.lng * 0.5)];
6270
- this.h = this.grid[1] * (this.bsize[1] + this.spaces[1]) + this.spaces[1];
6271
- this.c[1].textContent = '';
6272
- this.c[2] = this.dom('table', this.css.basic + 'width:100%; top:' + (this.spaces[1] - 2) + 'px; height:auto; border-collapse:separate; border:none; border-spacing: ' + (this.spaces[0] - 2) + 'px ' + (this.spaces[1] - 2) + 'px;');
6273
+ this.h = this.grid[1] * this.bsize[1] + this.grid[1] * this.spaces[1] + 4 - this.mtop * 2; //+ (this.spaces[1] - this.mtop);
6274
+
6275
+ this.c[1].textContent = ''; //this.c[2] = this.dom( 'table', this.css.basic + 'width:100%; top:'+(this.spaces[1]-2)+'px; height:auto; border-collapse:separate; border:none; border-spacing: '+(this.spaces[0]-2)+'px '+(this.spaces[1]-2)+'px;' );
6276
+
6277
+ this.c[2] = this.dom('table', this.css.basic + 'width:100%; border-spacing: ' + (this.spaces[0] - 2) + 'px ' + this.spaces[1] + 'px; border:none;');
6273
6278
  let n = 0,
6274
6279
  b,
6275
6280
  td,
@@ -6282,7 +6287,6 @@
6282
6287
  this.stat = [];
6283
6288
  this.tmpX = [];
6284
6289
  this.tmpY = [];
6285
- let cc = this.colors;
6286
6290
 
6287
6291
  for (let i = 0; i < this.grid[1]; i++) {
6288
6292
  tr = this.c[2].insertRow();
@@ -6312,7 +6316,8 @@
6312
6316
  if (j === 0) b.style.cssText += 'float:right;';else b.style.cssText += 'float:left;';
6313
6317
  n++;
6314
6318
  }
6315
- }
6319
+ } //this.s[0].border = 'none'
6320
+
6316
6321
 
6317
6322
  this.init();
6318
6323
  }
@@ -6320,6 +6325,7 @@
6320
6325
  testZone(e) {
6321
6326
  let l = this.local;
6322
6327
  if (l.x === -1 && l.y === -1) return -1;
6328
+ l.y += this.mtop;
6323
6329
  let tx = this.tmpX;
6324
6330
  let ty = this.tmpY;
6325
6331
  let id = -1;
@@ -6536,7 +6542,6 @@
6536
6542
 
6537
6543
  this.value = Array.isArray(o.value) && o.value.length == 2 ? o.value : [0, 0];
6538
6544
  this.h = o.h || this.w + 10;
6539
- this.top = 0;
6540
6545
  this.c[0].style.width = this.w + 'px'; // Title
6541
6546
 
6542
6547
  if (this.c[1] !== undefined) {
@@ -6545,7 +6550,8 @@
6545
6550
  this.c[1].style.justifyContent = 'center';
6546
6551
  this.top = 10;
6547
6552
  this.h += 10;
6548
- }
6553
+ } //this.top -= this.margin
6554
+
6549
6555
 
6550
6556
  let cc = this.colors; // Value
6551
6557
 
@@ -6596,7 +6602,7 @@
6596
6602
  mousemove(e) {
6597
6603
  if (!this.isDown) return;
6598
6604
  let x = this.w * 0.5 - (e.clientX - this.zone.x);
6599
- let y = this.diam * 0.5 - (e.clientY - this.zone.y - this.top);
6605
+ let y = this.diam * 0.5 - (e.clientY - this.zone.y - this.ytop);
6600
6606
  let r = 256 / this.diam;
6601
6607
  x = -(x * r);
6602
6608
  y = -(y * r);
@@ -6880,7 +6886,9 @@
6880
6886
  this.mouse = new V2().neg();
6881
6887
  this.h = 0; //this.prevY = -1;
6882
6888
 
6883
- this.sw = 0; // bottom and close height
6889
+ this.sw = 0;
6890
+ this.margin = this.colors.sy;
6891
+ this.marginDiv = Tools.isDivid(this.margin); // bottom and close height
6884
6892
 
6885
6893
  this.isWithClose = o.close !== undefined ? o.close : true;
6886
6894
  this.bh = !this.isWithClose ? 0 : this.size.h;
@@ -7303,7 +7311,7 @@
7303
7311
  while (i--) {
7304
7312
  if (this.uis[i].value === name) {
7305
7313
  this.uis[i].selected(true);
7306
- if (this.isScroll) this.update(i * (this.uis[i].h + 1) * this.ratio);
7314
+ if (this.isScroll) this.update(i * (this.uis[i].h + this.margin) * this.ratio);
7307
7315
  }
7308
7316
  }
7309
7317
  } // ----------------------
@@ -7401,7 +7409,7 @@
7401
7409
 
7402
7410
  }
7403
7411
 
7404
- const REVISION = '4.2.3';
7412
+ const REVISION = '4.2.5';
7405
7413
 
7406
7414
  exports.Files = Files;
7407
7415
  exports.Gui = Gui;