uil 4.2.1 → 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'];
@@ -723,9 +724,9 @@
723
724
  }
724
725
 
725
726
  if (o.fontSelect) color.textSelect = o.fontSelect;
726
- if (o.groupBorder) color.gborder = o.groupBorder;
727
- if (o.transparent) o.bg = 'none';
728
- if (o.bg) color.background = color.backgroundOver = o.bg;
727
+ if (o.groupBorder) color.gborder = o.groupBorder; //if( o.transparent ) o.bg = 'none'
728
+ //if( o.bg ) color.background = color.backgroundOver = o.bg
729
+
729
730
  if (o.bgOver) color.backgroundOver = o.bgOver;
730
731
 
731
732
  for (let m in color) {
@@ -740,50 +741,50 @@
740
741
  return color;
741
742
  },
742
743
  colors: {
744
+ sx: 4,
745
+ //4
746
+ sy: 2,
747
+ //2
748
+ radius: 2,
743
749
  content: 'none',
744
- background: 'rgba(50,50,50,0.3)',
745
- backgroundOver: 'rgba(50,50,50,0.4)',
750
+ background: 'rgba(50,50,50,0.15)',
751
+ backgroundOver: 'rgba(50,50,50,0.3)',
746
752
  title: '#CCC',
747
753
  titleoff: '#BBB',
748
754
  text: '#DDD',
749
755
  textOver: '#EEE',
750
756
  textSelect: '#FFF',
751
- //inputBg: 'rgba(0,0,0,0.25)',
752
- //itemBg:'rgba(0,0,0,0.25)',
753
757
  back: 'rgba(0,0,0,0.2)',
754
758
  backoff: 'rgba(0,0,0,0.3)',
755
- //inputOver: 'rgba(0,0,0,0.2)',
756
759
  // input and button border
757
760
  border: '#4c4c4c',
758
761
  borderSize: 1,
759
762
  gborder: 'none',
763
+ groups: 'none',
760
764
  button: '#3c3c3c',
761
765
  overoff: '#5c5c5c',
762
766
  over: '#024699',
763
767
  select: '#308AFF',
764
768
  action: '#FF3300',
765
769
  //fontFamily: 'Tahoma',
766
- fontFamily: 'Consolas, monaco, monospace',
770
+ fontFamily: 'Consolas, monospace',
767
771
  //fontFamily: "'Roboto Mono', 'Source Code Pro', Menlo, Courier, monospace",
768
772
  fontWeight: 'normal',
769
773
  fontShadow: 'none',
770
774
  //'#000',
771
775
  fontSize: 12,
772
- radius: 2,
773
776
  hide: 'rgba(0,0,0,0)'
774
777
  },
775
778
  // style css
776
779
  css: {
777
- //unselect: '-o-user-select:none; -ms-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -moz-user-select:none;',
778
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;',
779
- button: 'display:flex; justify-content:center; align-items:center; text-align:center;'
780
- /*txt: T.css.basic + 'font-family:'+ T.colors.fontFamily +'; font-size:'+T.colors.fontSize+'px; color:'+T.colors.text+'; padding:2px 10px; left:0; top:2px; height:16px; width:100px; overflow:hidden; white-space: nowrap;',
781
- txtselect: T.css.txt + 'display:flex; justify-content:left; align-items:center; text-align:left;' +'padding:2px 5px; border:1px dashed ' + T.colors.border + '; background:'+ T.colors.txtselectbg+';',
782
- item: T.css.txt + 'position:relative; background:rgba(0,0,0,0.2); margin-bottom:1px;',*/
783
-
781
+ button: 'display:flex; align-items:center; justify-content:center; text-align:center;',
782
+ middle: 'display:flex; align-items:center; justify-content:left; text-align:left; flex-direction: row-reverse;'
784
783
  },
785
784
  // svg path
786
785
  svgs: {
786
+ g1: 'M 6 4 L 0 4 0 6 6 6 6 4 M 6 0 L 0 0 0 2 6 2 6 0 Z',
787
+ g2: 'M 6 0 L 4 0 4 6 6 6 6 0 M 2 0 L 0 0 0 6 2 6 2 0 Z',
787
788
  group: 'M 7 7 L 7 8 8 8 8 7 7 7 M 5 7 L 5 8 6 8 6 7 5 7 M 3 7 L 3 8 4 8 4 7 3 7 M 7 5 L 7 6 8 6 8 5 7 5 M 6 6 L 6 5 5 5 5 6 6 6 M 7 3 L 7 4 8 4 8 3 7 3 M 6 4 L 6 3 5 3 5 4 6 4 M 3 5 L 3 6 4 6 4 5 3 5 M 3 3 L 3 4 4 4 4 3 3 3 Z',
788
789
  arrow: 'M 3 8 L 8 5 3 2 3 8 Z',
789
790
  arrowDown: 'M 5 8 L 8 3 2 3 5 8 Z',
@@ -803,7 +804,9 @@
803
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',
804
805
  none: 'M 9 5 L 5 5 5 9 9 9 9 5 Z',
805
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',
806
- 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'
807
810
  },
808
811
 
809
812
  rezone() {
@@ -836,15 +839,13 @@
836
839
 
837
840
  if (isNaN(size)) {
838
841
  if (size.search('em') === -1) size += 'px';
839
- } else size += 'px';
842
+ } else size += 'px'; //let align = 'display:flex; justify-content:left; align-items:center; text-align:left;'
840
843
 
841
- let align = 'display:flex; justify-content:left; align-items:center; text-align:left;';
842
- T.css.txt = T.css.basic + align + ' font-family:' + font + '; font-weight:' + weight + '; font-size:' + size + '; color:' + cc.text + '; padding:0px 10px; left:0; top:2px; height:16px; width:100px; overflow:hidden; white-space: nowrap; letter-spacing: normal;';
843
- if (shadow !== 'none') T.css.txt += ' text-shadow: 1px 1px 1px ' + shadow + ';';
844
- T.css.txtselect = T.css.txt + 'padding:0px 4px; border:1px dashed ' + cc.border + ';'; //T.css.item = T.css.txt + ' position:relative; margin-bottom:1px; '//display:block; padding:4px 4px;';//
845
844
 
846
- T.css.item = T.css.txt + ' position:relative; margin-bottom:1px; display:block; padding:2px 4px;'; //
847
- //console.log( T.css.txt )
845
+ T.css.txt = T.css.basic + T.css.middle + ' font-family:' + font + '; font-weight:' + weight + '; font-size:' + size + '; color:' + cc.text + '; padding:0px 8px; left:0; top:2px; height:16px; width:100px; overflow:hidden; white-space: nowrap; letter-spacing: normal;';
846
+ if (shadow !== 'none') T.css.txt += ' text-shadow: 1px 1px 1px ' + shadow + ';';
847
+ T.css.txtselect = T.css.txt + 'padding:0px 4px; border:1px dashed ' + cc.border + ';';
848
+ T.css.item = T.css.txt + 'padding:0px 4px; position:relative; margin-bottom:1px; ';
848
849
  },
849
850
  // note
850
851
  //https://developer.mozilla.org/fr/docs/Web/CSS/css_flexible_box_layout/aligning_items_in_a_flex_container
@@ -996,6 +997,7 @@
996
997
  // Color function
997
998
  // ----------------------
998
999
  ColorLuma: function (hex, l) {
1000
+ //if( hex.substring(0, 3) === 'rgba' ) hex = '#000';
999
1001
  if (hex === 'n') hex = '#000'; // validate hex string
1000
1002
 
1001
1003
  hex = String(hex).replace(/[^0-9a-f]/gi, '');
@@ -1598,6 +1600,40 @@
1598
1600
  }];
1599
1601
  break;
1600
1602
 
1603
+ case 'wav':
1604
+ t = [{
1605
+ accept: {
1606
+ 'audio/wav': '.wav'
1607
+ }
1608
+ }];
1609
+ break;
1610
+
1611
+ case 'mp3':
1612
+ t = [{
1613
+ accept: {
1614
+ 'audio/mpeg': '.mp3'
1615
+ }
1616
+ }];
1617
+ break;
1618
+
1619
+ case 'mp4':
1620
+ t = [{
1621
+ accept: {
1622
+ 'video/mp4': '.mp4'
1623
+ }
1624
+ }];
1625
+ break;
1626
+
1627
+ case 'bin':
1628
+ case 'hex':
1629
+ t = [{
1630
+ description: 'Binary Files',
1631
+ accept: {
1632
+ 'application/octet-stream': ['.bin', '.hex']
1633
+ }
1634
+ }];
1635
+ break;
1636
+
1601
1637
  case 'text':
1602
1638
  t = [{
1603
1639
  description: 'Text Files',
@@ -1612,7 +1648,17 @@
1612
1648
  t = [{
1613
1649
  description: 'JSON Files',
1614
1650
  accept: {
1615
- 'text/plain': ['.json']
1651
+ 'application/json': ['.json']
1652
+ }
1653
+ }]; //text/plain
1654
+
1655
+ break;
1656
+
1657
+ case 'js':
1658
+ t = [{
1659
+ description: 'JavaScript Files',
1660
+ accept: {
1661
+ 'text/javascript': ['.js']
1616
1662
  }
1617
1663
  }];
1618
1664
  break;
@@ -1892,6 +1938,8 @@
1892
1938
  this.isUI = o.isUI || false;
1893
1939
  this.group = o.group || null;
1894
1940
  this.isListen = false;
1941
+ this.top = 0;
1942
+ this.ytop = 0;
1895
1943
  this.isSelectable = o.selectable !== undefined ? o.selectable : false;
1896
1944
  this.unselectable = o.unselect !== undefined ? o.unselect : this.isSelectable;
1897
1945
  this.ontop = o.ontop ? o.ontop : false; // 'beforebegin' 'afterbegin' 'beforeend' 'afterend'
@@ -1903,7 +1951,8 @@
1903
1951
  x: 0,
1904
1952
  y: 0,
1905
1953
  w: 0,
1906
- h: 0
1954
+ h: 0,
1955
+ d: 0
1907
1956
  };
1908
1957
  this.local = new V2().neg();
1909
1958
  this.isCanvasOnly = false;
@@ -1919,7 +1968,7 @@
1919
1968
  this.fw = o.fw || 0;
1920
1969
  this.autoWidth = o.auto || true; // auto width or flex
1921
1970
 
1922
- this.isOpen = false; // open statu
1971
+ this.isOpen = false; //false// open statu
1923
1972
  // radius for toolbox
1924
1973
 
1925
1974
  this.radius = o.radius || this.colors.radius;
@@ -1969,14 +2018,19 @@
1969
2018
  this.c[0] = Tools.dom('div', this.css.basic + flexible + 'position:relative; height:20px;');
1970
2019
  this.s[0] = this.c[0].style; // bottom margin
1971
2020
 
1972
- this.margin = o.margin || 1;
2021
+ this.margin = this.colors.sy;
2022
+ this.mtop = 0;
2023
+ let marginDiv = Tools.isDivid(this.margin);
1973
2024
 
1974
2025
  if (this.isUI && this.margin) {
1975
- this.s[0].boxSizing = 'content-box'; //this.s[0].marginBottom = this.margin + 'px';
2026
+ this.s[0].boxSizing = 'content-box';
2027
+
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`)
1976
2031
 
1977
- if (this.margin * 0.5 === Math.floor(this.margin * 0.5)) {
1978
- this.s[0].borderTop = this.margin * 0.5 + 'px solid transparent';
1979
- this.s[0].borderBottom = this.margin * 0.5 + 'px solid transparent';
2032
+ this.s[0].borderTop = this.mtop + 'px solid transparent';
2033
+ this.s[0].borderBottom = this.mtop + 'px solid transparent';
1980
2034
  } else {
1981
2035
  this.s[0].borderBottom = this.margin + 'px solid transparent';
1982
2036
  }
@@ -1984,7 +2038,7 @@
1984
2038
 
1985
2039
 
1986
2040
  if (!this.simple) {
1987
- this.c[1] = Tools.dom('div', this.css.txt);
2041
+ this.c[1] = Tools.dom('div', this.css.txt + this.css.middle);
1988
2042
  this.s[1] = this.c[1].style;
1989
2043
  this.c[1].textContent = this.name;
1990
2044
  this.s[1].color = this.lock ? this.colors.titleoff : this.colors.title;
@@ -2007,7 +2061,8 @@
2007
2061
 
2008
2062
 
2009
2063
  init() {
2010
- this.zone.h = this.h;
2064
+ this.ytop = this.top + this.mtop;
2065
+ this.zone.h = this.h + this.margin;
2011
2066
  this.zone.w = this.w;
2012
2067
  let s = this.s; // style cache
2013
2068
 
@@ -2027,8 +2082,8 @@
2027
2082
 
2028
2083
  if (c[1] !== undefined && this.autoWidth) {
2029
2084
  s[1] = c[1].style;
2030
- s[1].height = this.h - 4 + 'px';
2031
- s[1].lineHeight = this.h - 8 + 'px';
2085
+ s[1].top = 1 + 'px';
2086
+ s[1].height = this.h - 2 + 'px';
2032
2087
  }
2033
2088
 
2034
2089
  let frag = Tools.frag;
@@ -2235,9 +2290,11 @@
2235
2290
  if (this.simple) {
2236
2291
  this.sb = this.w - this.sa;
2237
2292
  } else {
2238
- let pp = this.w * (this.p / 100);
2239
- this.sa = Math.floor(pp + 10);
2240
- this.sb = Math.floor(this.w - pp - 20);
2293
+ let pp = this.w * (this.p / 100); //this.sa = Math.floor( pp + 10 )
2294
+ //this.sb = Math.floor( this.w - pp - 20 )
2295
+
2296
+ this.sa = Math.floor(pp + 8);
2297
+ this.sb = Math.floor(this.w - pp - 16);
2241
2298
  }
2242
2299
  }
2243
2300
 
@@ -2287,6 +2344,10 @@
2287
2344
  case 5:
2288
2345
  s = 0.00001;
2289
2346
  break;
2347
+
2348
+ case 6:
2349
+ s = 0.000001;
2350
+ break;
2290
2351
  }
2291
2352
 
2292
2353
  this.step = o.step === undefined ? s : o.step;
@@ -2305,7 +2366,11 @@
2305
2366
  handleEvent(e) {
2306
2367
  if (this.lock) return;
2307
2368
  if (this.neverlock) Roots.lock = false;
2308
- 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
+
2309
2374
  return this[e.type](e);
2310
2375
  }
2311
2376
 
@@ -2413,7 +2478,7 @@
2413
2478
  } else {
2414
2479
  this.p = 0;
2415
2480
  if (this.c[1] !== undefined) this.c[1].textContent = '';
2416
- 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;');
2417
2482
  }
2418
2483
 
2419
2484
  this.stat = -1;
@@ -2533,7 +2598,7 @@
2533
2598
  s[3].left = w + 'px';
2534
2599
  } else {
2535
2600
  s[2].left = this.sa + 'px';
2536
- s[2].width = this.w - 20 + 'px';
2601
+ s[2].width = this.sb + 'px';
2537
2602
  }
2538
2603
  }
2539
2604
 
@@ -2545,6 +2610,7 @@
2545
2610
  this.value = o.value || '';
2546
2611
  this.values = o.value || this.txt;
2547
2612
  if (o.values) this.values = o.values;
2613
+ if (!o.values && !o.value) this.txt = '';
2548
2614
  this.onName = o.onName || null;
2549
2615
  this.on = false; // force button width
2550
2616
 
@@ -2571,19 +2637,18 @@
2571
2637
  this.stat[i] = sel ? 3 : 1;
2572
2638
  }
2573
2639
 
2574
- if (!o.value && !o.values) {
2575
- if (this.c[1] !== undefined) {
2576
- this.c[1].textContent = ''; //this.txt = ''
2577
- }
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 = '';
2578
2644
  }
2579
2645
 
2580
- if (!this.txt) this.p = 0;
2581
2646
  this.init();
2582
2647
  }
2583
2648
 
2584
2649
  onOff() {
2585
2650
  this.on = !this.on;
2586
- this.label(this.on ? this.onName : this.txt);
2651
+ this.label(this.on ? this.onName : this.value);
2587
2652
  }
2588
2653
 
2589
2654
  testZone(e) {
@@ -2723,16 +2788,20 @@
2723
2788
  let w = this.sb;
2724
2789
  let d = this.sa;
2725
2790
  let i = this.lng;
2726
- let dc = this.space;
2727
- let size = Math.floor((w - dc * (i - 1)) / i);
2791
+ let sx = this.colors.sx; //this.space;
2792
+ //let size = Math.floor( ( w-(dc*(i-1)) ) / i );
2793
+
2794
+ let size = (w - sx * (i - 1)) / i;
2728
2795
 
2729
2796
  if (this.bw) {
2730
- size = this.bw < size ? this.bw : size;
2731
- d = Math.floor((this.w - (size * i + dc * (i - 1))) * 0.5);
2797
+ size = this.bw < size ? this.bw : size; //d = Math.floor((this.w-( (size * i) + (dc * (i-1)) ))*0.5)
2798
+
2799
+ d = (this.w - (size * i + sx * (i - 1))) * 0.5;
2732
2800
  }
2733
2801
 
2734
2802
  while (i--) {
2735
- this.tmp[i] = [Math.floor(d + size * i + dc * i), size];
2803
+ //this.tmp[i] = [ Math.floor( d + ( size * i ) + ( dc * i )), size ];
2804
+ this.tmp[i] = [d + size * i + sx * i, size];
2736
2805
  this.tmp[i][2] = this.tmp[i][0] + this.tmp[i][1];
2737
2806
  s[i + 2].left = this.tmp[i][0] + 'px';
2738
2807
  s[i + 2].width = this.tmp[i][1] + 'px';
@@ -2755,7 +2824,6 @@
2755
2824
  this.pi90 = Tools.pi90;
2756
2825
  this.offset = new V2();
2757
2826
  this.h = o.h || this.w + 10;
2758
- this.top = 0;
2759
2827
  this.c[0].style.width = this.w + 'px';
2760
2828
  this.c[0].style.display = 'block';
2761
2829
 
@@ -2845,7 +2913,7 @@
2845
2913
 
2846
2914
  let off = this.offset;
2847
2915
  off.x = this.w * 0.5 - (e.clientX - this.zone.x);
2848
- 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);
2849
2917
  this.r = off.angle() - this.pi90;
2850
2918
  this.r = (this.r % this.twoPi + this.twoPi) % this.twoPi;
2851
2919
 
@@ -2932,15 +3000,16 @@
2932
3000
  this.offset = new V2();
2933
3001
  this.decal = new V2();
2934
3002
  this.pp = new V2();
2935
- 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;');
2936
- this.s[2] = this.c[2].style;
2937
- 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+';' )
2938
3004
 
2939
- if (this.up) {
2940
- this.s[2].top = 'auto';
2941
- this.s[2].bottom = '2px';
2942
- } //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'
2943
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';
2944
3013
 
2945
3014
  this.c[0].style.display = 'block';
2946
3015
  this.c[3] = this.getColorRing();
@@ -2960,8 +3029,8 @@
2960
3029
  this.tsl = Math.sqrt(3) * this.tr;
2961
3030
  this.hue = 0;
2962
3031
  this.d = 256;
2963
- this.setColor(this.value);
2964
3032
  this.init();
3033
+ this.setColor(this.value);
2965
3034
  if (o.open !== undefined) this.open();
2966
3035
  }
2967
3036
 
@@ -3016,7 +3085,7 @@
3016
3085
  if (name === 'color') {
3017
3086
  off = this.offset;
3018
3087
  off.x = e.clientX - (this.zone.x + this.decal.x + this.mid);
3019
- 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;
3020
3089
  d = off.length() * this.ratio;
3021
3090
  rr = off.angle();
3022
3091
  if (rr < 0) rr += 2 * T.PI;
@@ -3184,7 +3253,9 @@
3184
3253
  super.rSize();
3185
3254
  let s = this.s;
3186
3255
  s[2].width = this.sb + 'px';
3187
- 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;
3188
3259
  this.rSizeColor(this.cw);
3189
3260
  this.decal.x = Math.floor((this.w - this.wfixe) * 0.5); //s[3].left = this.decal.x + 'px';
3190
3261
  }
@@ -3252,11 +3323,13 @@
3252
3323
  this.txt = o.name || 'Fps';
3253
3324
  }
3254
3325
 
3255
- let fltop = Math.floor(this.h * 0.5) - 6;
3256
- this.c[1].textContent = this.txt;
3326
+ let fltop = Math.floor(this.h * 0.5) - 3;
3327
+ const ccc = this.colors;
3328
+ this.c[1].textContent = this.txt; //this.c[1].innerHTML = '&#160;' + this.txt
3329
+
3257
3330
  this.c[0].style.cursor = 'pointer';
3258
3331
  this.c[0].style.pointerEvents = 'auto';
3259
- let panelCss = 'display:none; left:10px; top:' + this.h + 'px; height:' + (this.hplus - 8) + 'px; box-sizing:border-box; background: rgba(0, 0, 0, 0.2); border:1px solid ' + this.colors.border + ';';
3332
+ let panelCss = 'display:none; left:10px; top:' + this.h + 'px; height:' + (this.hplus - 8) + 'px; box-sizing:border-box; background: rgba(0, 0, 0, 0.2); border:1px solid ' + ccc.border + ';';
3260
3333
  if (this.radius !== 0) panelCss += 'border-radius:' + this.radius + 'px;';
3261
3334
  this.c[2] = this.dom('path', this.css.basic + panelCss, {});
3262
3335
  this.c[2].setAttribute('viewBox', '0 0 ' + this.res + ' 50');
@@ -3266,23 +3339,25 @@
3266
3339
  //this.dom( 'path', null, { fill:'rgba(0,255,255,0.3)', 'stroke-width':1, stroke:'#0FF', 'vector-effect':'non-scaling-stroke' }, this.c[2] );
3267
3340
  // arrow
3268
3341
 
3269
- this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:10px; height:10px; left:4px; top:' + fltop + 'px;', {
3270
- d: this.svgs.arrow,
3271
- fill: this.colors.text,
3342
+ this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:6px; height:6px; left:0; top:' + fltop + 'px;', {
3343
+ d: this.svgs.g1,
3344
+ fill: ccc.text,
3272
3345
  stroke: 'none'
3273
- }); // result test
3346
+ }); //this.c[3] = this.dom( 'path', this.css.basic + 'position:absolute; width:10px; height:10px; left:4px; top:'+fltop+'px;', { d:this.svgs.arrow, fill:this.colors.text, stroke:'none'});
3347
+ // result test
3274
3348
 
3275
3349
  this.c[4] = this.dom('div', this.css.txt + 'position:absolute; left:10px; top:' + (this.h + 2) + 'px; display:none; width:100%; text-align:center;'); // bottom line
3276
3350
 
3277
3351
  if (o.bottomLine) this.c[4] = this.dom('div', this.css.basic + 'width:100%; bottom:0px; height:1px; background: rgba(255, 255, 255, 0.2);');
3278
3352
  this.isShow = false;
3279
- let s = this.s;
3280
- s[1].marginLeft = '10px';
3353
+ let s = this.s; //s[1].marginLeft = '10px';
3354
+
3281
3355
  s[1].lineHeight = this.h - 4;
3282
- s[1].color = this.colors.text; //s[1].fontWeight = 'bold';
3356
+ s[1].color = ccc.text; //s[1].paddingLeft = '18px';
3357
+ //s[1].fontWeight = 'bold';
3283
3358
 
3284
3359
  if (this.radius !== 0) s[0].borderRadius = this.radius + 'px';
3285
- if (this.colors.gborder !== 'none') s[0].border = '1px solid ' + this.colors.gborder;
3360
+ if (this.colors.gborder !== 'none') s[0].border = '1px solid ' + ccc.gborder;
3286
3361
  let j = 0;
3287
3362
 
3288
3363
  for (j = 0; j < this.names.length; j++) {
@@ -3386,7 +3461,7 @@
3386
3461
  open() {
3387
3462
  super.open();
3388
3463
  this.h = this.hplus + this.baseH;
3389
- this.setSvg(this.c[3], 'd', this.svgs.arrowDown);
3464
+ this.setSvg(this.c[3], 'd', this.svgs.g2);
3390
3465
 
3391
3466
  if (this.group !== null) {
3392
3467
  this.group.calc(this.hplus);
@@ -3402,7 +3477,7 @@
3402
3477
  close() {
3403
3478
  super.close();
3404
3479
  this.h = this.baseH;
3405
- this.setSvg(this.c[3], 'd', this.svgs.arrow);
3480
+ this.setSvg(this.c[3], 'd', this.svgs.g1);
3406
3481
 
3407
3482
  if (this.group !== null) {
3408
3483
  this.group.calc(-this.hplus);
@@ -3452,6 +3527,7 @@
3452
3527
  rSize() {
3453
3528
  let s = this.s;
3454
3529
  let w = this.w;
3530
+ s[3].left = this.sa + this.sb - 6 + 'px';
3455
3531
  s[0].width = w + 'px';
3456
3532
  s[1].width = w + 'px';
3457
3533
  s[2].left = 10 + 'px';
@@ -3680,7 +3756,7 @@
3680
3756
  nup = this.mode(this.isDown ? 2 : 1, name); //this.cursor( this.current !== -1 ? 'move' : 'pointer' );
3681
3757
 
3682
3758
  if (this.isDown) {
3683
- 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);
3684
3760
  this.update(true);
3685
3761
  }
3686
3762
  }
@@ -3747,54 +3823,61 @@
3747
3823
  this.current = -1;
3748
3824
  this.proto = null;
3749
3825
  this.isEmpty = true;
3750
- this.decal = 0;
3826
+ this.decal = o.group ? 8 : 0;
3751
3827
  this.baseH = this.h;
3752
- let fltop = Math.floor(this.h * 0.5) - 6;
3753
- this.isLine = o.line !== undefined ? o.line : false;
3754
- this.decal = 0;
3755
-
3756
- if (o.group) {
3757
- this.decal = o.group.decal ? o.group.decal : 0;
3758
- this.decal += 6;
3759
- }
3760
-
3828
+ let fltop = Math.floor(this.h * 0.5) - 3;
3829
+ const cc = this.colors;
3761
3830
  this.useFlex = true;
3762
3831
  let flexible = this.useFlex ? 'display:flex; flex-flow: row wrap;' : '';
3763
- this.c[2] = this.dom('div', this.css.basic + flexible + 'width:100%; left:0; height:auto; overflow:hidden; top:' + this.h + 'px'); //
3764
-
3765
- this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:10px; height:10px; left:0; top:' + fltop + 'px;', {
3766
- d: this.svgs.group,
3767
- fill: this.colors.text,
3832
+ this.c[2] = this.dom('div', this.css.basic + flexible + 'width:100%; left:0; height:auto; overflow:hidden; top:' + this.h + 'px');
3833
+ this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:6px; height:6px; left:0; top:' + fltop + 'px;', {
3834
+ d: this.svgs.g1,
3835
+ fill: cc.text,
3768
3836
  stroke: 'none'
3769
3837
  });
3770
- this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:10px; height:10px; left:' + (4 + this.decal) + 'px; top:' + fltop + 'px;', {
3771
- d: this.svgs.arrow,
3772
- fill: this.colors.text,
3773
- stroke: 'none'
3774
- }); // bottom line
3775
-
3776
- 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');
3777
- let s = this.s;
3778
- s[0].height = this.h + 'px';
3779
- s[1].height = this.h + 'px';
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;');
3840
+ this.s;
3780
3841
  this.c[1].name = 'group';
3781
- s[1].marginLeft = 10 + this.decal + 'px';
3782
- s[1].lineHeight = this.h - 4;
3783
- s[1].color = this.colors.text; //s[1].fontWeight = 'bold';
3784
-
3785
- if (this.radius !== 0) s[0].borderRadius = this.radius + 'px';
3786
3842
  this.init();
3787
3843
  this.setBG(o.bg);
3788
- if (o.open !== undefined) this.open();
3844
+ if (o.open) this.open();
3845
+ }
3846
+
3847
+ setBG(bg) {
3848
+ const cc = this.colors;
3849
+ const s = this.s;
3850
+ if (bg !== undefined) cc.groups = bg;
3851
+ if (cc.groups === 'none') cc.groups = cc.background;
3852
+ cc.background = 'none';
3853
+ s[0].background = 'none';
3854
+ s[1].background = cc.groups;
3855
+ s[2].background = cc.groups;
3856
+
3857
+ if (cc.gborder !== 'none') {
3858
+ s[1].border = cc.borderSize + 'px solid ' + cc.gborder;
3859
+ }
3860
+
3861
+ if (this.radius !== 0) {
3862
+ s[1].borderRadius = this.radius + 'px';
3863
+ s[2].borderRadius = this.radius + 'px';
3864
+ }
3865
+ /*let i = this.uis.length;
3866
+ while(i--){
3867
+ this.uis[i].setBG( 'none' );
3868
+ //this.uis[i].setBG( this.colors.background );
3869
+ }*/
3870
+
3789
3871
  }
3790
3872
 
3791
3873
  testZone(e) {
3792
3874
  let l = this.local;
3793
3875
  if (l.x === -1 && l.y === -1) return '';
3794
3876
  let name = '';
3795
- if (l.y < this.baseH) name = 'title';else {
3877
+ if (l.y < this.baseH + this.margin) name = 'title';else {
3796
3878
  if (this.isOpen) name = 'content';
3797
- }
3879
+ } //console.log(name)
3880
+
3798
3881
  return name;
3799
3882
  }
3800
3883
 
@@ -3829,13 +3912,20 @@
3829
3912
 
3830
3913
  switch (name) {
3831
3914
  case 'content':
3832
- this.cursor();
3915
+ //this.cursor()
3916
+ //if( this.marginDiv ) e.clientY -= this.margin * 0.5
3833
3917
  if (Roots.isMobile && type === 'mousedown') this.getNext(e, change);
3834
- 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
+
3835
3924
  if (!Roots.lock) this.getNext(e, change);
3836
3925
  break;
3837
3926
 
3838
3927
  case 'title':
3928
+ //this.cursor( this.isOpen ? 'n-resize':'s-resize' );
3839
3929
  this.cursor('pointer');
3840
3930
 
3841
3931
  if (type === 'mousedown') {
@@ -3865,16 +3955,6 @@
3865
3955
  } // ----------------------
3866
3956
 
3867
3957
 
3868
- setBG(bg) {
3869
- if (bg !== undefined) this.colors.background = bg;
3870
- this.c[0].style.background = this.colors.background;
3871
- let i = this.uis.length;
3872
-
3873
- while (i--) {
3874
- this.uis[i].setBG(this.colors.background);
3875
- }
3876
- }
3877
-
3878
3958
  add() {
3879
3959
  let a = arguments;
3880
3960
 
@@ -3896,7 +3976,9 @@
3896
3976
  }
3897
3977
  }
3898
3978
 
3899
- 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
+
3900
3982
  this.uis.push(u);
3901
3983
  this.isEmpty = false;
3902
3984
  return u;
@@ -3938,7 +4020,7 @@
3938
4020
  let id = this.uis.indexOf(n);
3939
4021
 
3940
4022
  if (id !== -1) {
3941
- this.calc(-(this.uis[id].h + 1));
4023
+ this.calc(-(this.uis[id].h + this.margin));
3942
4024
  this.c[2].removeChild(this.uis[id].c[0]);
3943
4025
  this.uis.splice(id, 1);
3944
4026
 
@@ -3951,23 +4033,61 @@
3951
4033
 
3952
4034
  open() {
3953
4035
  super.open();
3954
- this.setSvg(this.c[4], 'd', this.svgs.arrowDown);
3955
- this.rSizeContent();
3956
- this.h - this.baseH;
4036
+ this.setSvg(this.c[3], 'd', this.svgs.g2);
4037
+ this.rSizeContent(); //let t = this.h - this.baseH
4038
+
4039
+ const s = this.s;
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'
4044
+
4045
+ if (this.radius) {
4046
+ s[1].borderRadius = '0px';
4047
+ s[2].borderRadius = '0px';
4048
+ s[1].borderTopLeftRadius = this.radius + 'px';
4049
+ s[1].borderTopRightRadius = this.radius + 'px';
4050
+ s[2].borderBottomLeftRadius = this.radius + 'px';
4051
+ s[2].borderBottomRightRadius = this.radius + 'px';
4052
+ }
4053
+
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;
4057
+ s[2].border = cc.borderSize + 'px solid ' + cc.gborder;
4058
+ s[2].borderTop = 'none';
4059
+ s[1].borderBottom = cc.borderSize + 'px solid rgba(0,0,0,0)';
4060
+ }
4061
+
3957
4062
  this.parentHeight();
3958
4063
  }
3959
4064
 
3960
4065
  close() {
3961
- super.close();
3962
- this.h - this.baseH;
3963
- this.setSvg(this.c[4], 'd', this.svgs.arrow);
4066
+ super.close(); //let t = this.h - this.baseH
4067
+
4068
+ this.setSvg(this.c[3], 'd', this.svgs.g1);
3964
4069
  this.h = this.baseH;
3965
- this.s[0].height = this.h + 'px';
4070
+ const s = this.s;
4071
+ const cc = this.colors;
4072
+ s[0].height = this.h + 'px'; //s[1].height = (this.h-2) + 'px'
4073
+ //s[2].top = this.h + 'px'
4074
+
4075
+ s[2].top = this.h + this.mtop + 'px';
4076
+ s[4].background = 'none';
4077
+
4078
+ if (cc.gborder !== 'none') {
4079
+ s[4].border = 'none';
4080
+ s[2].border = 'none';
4081
+ s[1].border = cc.borderSize + 'px solid ' + cc.gborder;
4082
+ }
4083
+
4084
+ if (this.radius) s[1].borderRadius = this.radius + 'px';
3966
4085
  this.parentHeight();
3967
4086
  }
3968
4087
 
3969
4088
  calcUis() {
3970
- 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;
3971
4091
  this.s[0].height = this.h + 'px';
3972
4092
  }
3973
4093
 
@@ -3993,10 +4113,25 @@
3993
4113
  rSize() {
3994
4114
  super.rSize();
3995
4115
  let s = this.s;
3996
- s[3].left = this.sa + this.sb - 17 + 'px';
4116
+ this.w = this.w - this.decal;
4117
+ s[3].left = this.sa + this.sb - 6 + 'px';
3997
4118
  s[1].width = this.w + 'px';
3998
4119
  s[2].width = this.w + 'px';
4120
+ s[1].left = this.decal + 'px';
4121
+ s[2].left = this.decal + 'px';
3999
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;
4000
4135
  }
4001
4136
 
4002
4137
  }
@@ -4020,7 +4155,6 @@
4020
4155
 
4021
4156
  this.distance = this.diam * 0.5 * 0.25;
4022
4157
  this.h = o.h || this.w + 10;
4023
- this.top = 0;
4024
4158
  this.c[0].style.width = this.w + 'px';
4025
4159
 
4026
4160
  if (this.c[1] !== undefined) {
@@ -4120,7 +4254,7 @@
4120
4254
  //this.tmp.y = this.radius - ( e.clientY - this.zone.y - this.top );
4121
4255
 
4122
4256
  this.tmp.x = this.w * 0.5 - (e.clientX - this.zone.x);
4123
- 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);
4124
4258
  let distance = this.tmp.length();
4125
4259
 
4126
4260
  if (distance > this.distance) {
@@ -4201,7 +4335,6 @@
4201
4335
  this.cirRange = this.mPI * 2;
4202
4336
  this.offset = new V2();
4203
4337
  this.h = o.h || this.w + 10;
4204
- this.top = 0;
4205
4338
  this.c[0].style.width = this.w + 'px';
4206
4339
  this.c[0].style.display = 'block';
4207
4340
 
@@ -4304,7 +4437,7 @@
4304
4437
  //off.y = this.radius - ( e.clientY - this.zone.y - this.top );
4305
4438
 
4306
4439
  off.x = this.w * 0.5 - (e.clientX - this.zone.x);
4307
- 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);
4308
4441
  this.r = -Math.atan2(off.x, off.y);
4309
4442
  if (this.oldr !== null) this.r = Math.abs(this.r - this.oldr) > Math.PI ? this.oldr : this.r;
4310
4443
  this.r = this.r > this.mPI ? this.mPI : this.r;
@@ -4414,9 +4547,9 @@
4414
4547
  this.isWithImage = this.path !== '' ? true : false;
4415
4548
  this.preLoadComplete = false;
4416
4549
  this.tmpImage = {};
4417
- this.tmpUrl = []; //this.autoHeight = false;
4418
-
4419
- let align = o.align || 'center'; // scroll size
4550
+ this.tmpUrl = [];
4551
+ this.m = o.m !== undefined ? o.m : 5;
4552
+ let align = o.align || 'left'; // scroll size
4420
4553
 
4421
4554
  let ss = o.scrollSize || 10;
4422
4555
  this.ss = ss + 1;
@@ -4428,12 +4561,12 @@
4428
4561
  if (o.select !== undefined) o.selectable = o.select;
4429
4562
  if (o.selectable !== undefined) this.isSelectable = o.selectable;
4430
4563
  if (this.txt === '') this.p = 0;
4431
- let fltop = Math.floor(this.h * 0.5) - 5;
4564
+ let fltop = Math.floor(this.h * 0.5) - 3;
4432
4565
  let cc = this.colors;
4433
4566
  this.c[2] = this.dom('div', this.css.basic + 'top:0; display:none; border-radius:' + this.radius + 'px;');
4434
- this.c[3] = this.dom('div', this.css.item + 'position:absolute; text-align:' + align + '; line-height:' + (this.h - 4) + 'px; top:1px; background:' + cc.button + '; height:' + (this.h - 2) + 'px; border:1px solid ' + cc.border + '; border-radius:' + this.radius + 'px;');
4435
- this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:10px; height:10px; top:' + fltop + 'px;', {
4436
- d: this.svgs.arrow,
4567
+ this.c[3] = this.dom('div', this.css.item + 'padding:0px ' + this.m + 'px; margin-bottom:0px; position:absolute; justify-content:' + align + '; text-align:' + align + '; line-height:' + (this.h - 4) + 'px; top:1px; background:' + cc.button + '; height:' + (this.h - 2) + 'px; border:1px solid ' + cc.border + '; border-radius:' + this.radius + 'px;');
4568
+ this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:6px; height:6px; top:' + fltop + 'px;', {
4569
+ d: this.svgs.g1,
4437
4570
  fill: cc.text,
4438
4571
  stroke: 'none'
4439
4572
  });
@@ -4446,7 +4579,7 @@
4446
4579
  if (o.list) {
4447
4580
  if (o.list instanceof Array) {
4448
4581
  this.list = o.list;
4449
- } else {
4582
+ } else if (o.list instanceof Object) {
4450
4583
  this.refObject = o.list;
4451
4584
 
4452
4585
  for (let g in this.refObject) this.list.push(g);
@@ -4456,7 +4589,8 @@
4456
4589
  this.items = [];
4457
4590
  this.prevName = '';
4458
4591
  this.baseH = this.h;
4459
- this.itemHeight = o.itemHeight || this.h - 3; // force full list
4592
+ this.itemHeight = o.itemHeight || this.h; //(this.h-3);
4593
+ // force full list
4460
4594
 
4461
4595
  this.full = o.full || false;
4462
4596
  this.py = 0;
@@ -4471,8 +4605,7 @@
4471
4605
  if (this.up) {
4472
4606
  this.c[2].style.top = 'auto';
4473
4607
  this.c[3].style.top = 'auto';
4474
- this.c[4].style.top = 'auto'; //this.c[5].style.top = 'auto';
4475
-
4608
+ this.c[4].style.top = 'auto';
4476
4609
  this.c[2].style.bottom = this.h - 2 + 'px';
4477
4610
  this.c[3].style.bottom = '1px';
4478
4611
  this.c[4].style.bottom = fltop + 'px';
@@ -4512,18 +4645,12 @@
4512
4645
  this.dragstart = o.dragstart || null;
4513
4646
  this.dragend = o.dragend || null; //this.c[0].style.background = '#FF0000'
4514
4647
 
4515
- if (this.isWithImage) this.preloadImage(); // } else {
4516
- // populate list
4517
-
4648
+ if (this.isWithImage) this.preloadImage();
4518
4649
  this.setList(this.list);
4519
4650
  this.init();
4520
- if (this.isOpenOnStart) this.open(true); // }
4521
- }
4522
- /*send ( v ) {
4523
- super.send( v );
4524
- //Proto.prototype.send.call( this, v );
4525
- }*/
4526
- // image list
4651
+ if (this.isOpenOnStart) this.open(true);
4652
+ this.baseH += this.mtop;
4653
+ } // image list
4527
4654
 
4528
4655
 
4529
4656
  preloadImage() {
@@ -4680,10 +4807,9 @@
4680
4807
  // is item
4681
4808
  if (this.current) {
4682
4809
  this.value = this.list[this.current.id];
4683
- if (this.isSelectable) this.selected(); //this.value = this.refObject !== null ? this.refObject[this.list[this.current.id]] : this.list[this.current.id]
4684
- //this.value = this.current.textContent;
4810
+ if (this.isSelectable) this.selected(); //this.send( this.refObject !== null ? this.refObject[ this.list[this.current.id]] : this.value );
4685
4811
 
4686
- this.send(this.refObject !== null ? this.refObject[this.list[this.current.id]] : this.value);
4812
+ this.send(this.value);
4687
4813
 
4688
4814
  if (!this.listOnly) {
4689
4815
  this.close();
@@ -4709,7 +4835,8 @@
4709
4835
  this.modeScroll(1);
4710
4836
 
4711
4837
  if (this.isDown) {
4712
- this.modeScroll(2);
4838
+ this.modeScroll(2); //this.update( ( e.clientY - top ) - ( this.sh*0.5 ) );
4839
+
4713
4840
  let top = this.zone.y + this.baseH - 2;
4714
4841
  this.update(e.clientY - top - this.sh * 0.5);
4715
4842
  } //if(this.isDown) this.listmove(e);
@@ -4834,7 +4961,7 @@
4834
4961
 
4835
4962
  for (let i = 0; i < this.length; i++) {
4836
4963
  n = this.list[i];
4837
- item = this.dom('div', this.css.item + 'width:' + this.ww + 'px; height:' + this.itemHeight + 'px; line-height:' + (this.itemHeight - 5) + 'px; color:' + this.colors.text + '; background:' + this.colors.back + ';');
4964
+ item = this.dom('div', this.css.item + 'padding:0px ' + (this.m + 1) + 'px; width:' + this.ww + 'px; height:' + this.itemHeight + 'px; line-height:' + (this.itemHeight - 2) + 'px; color:' + this.colors.text + '; background:' + this.colors.back + ';');
4838
4965
  item.name = 'item' + i;
4839
4966
  item.id = i;
4840
4967
  item.select = false;
@@ -4847,15 +4974,18 @@
4847
4974
 
4848
4975
  if (this.miniCanvas) {
4849
4976
  let c = new Image();
4850
- c.src = this.tmpCanvas.toDataURL();
4977
+ c.src = this.tmpCanvas.toDataURL(); //item.style.marginLeft = (this.imageSize[0]+8)+'px'
4978
+
4851
4979
  /*let c = document.createElement('canvas')
4852
4980
  c.width = this.imageSize[0]
4853
4981
  c.height = this.imageSize[1]
4854
4982
  let ctx = c.getContext("2d")
4855
4983
  ctx.fillStyle = this.canvasBg
4856
4984
  ctx.fillRect(0, 0, this.imageSize[0], this.imageSize[1])*/
4985
+ //c.style.cssText = 'position:relative; pointer-events:none; display:inline-block; float:left; margin-left:0px; margin-right:5px; top:2px'
4986
+ // c.style.cssText =' flex-shrink: 0;'
4857
4987
 
4858
- c.style.cssText = 'position:relative; pointer-events:none; display:inline-block; float:left; margin-left:0px; margin-right:5px; top:2px'; //c.style.cssText = 'display:flex; align-content: flex-start; flex-wrap: wrap;'
4988
+ c.style.cssText = 'margin-right:4px;'; //c.style.cssText = 'display:flex; align-content: flex-start; flex-wrap: wrap;'
4859
4989
  //item.style.float = 'right'
4860
4990
 
4861
4991
  item.appendChild(c);
@@ -4921,8 +5051,10 @@
4921
5051
  this.canvas = document.createElement('canvas');
4922
5052
  this.canvas.width = this.imageSize[0];
4923
5053
  this.canvas.height = this.imageSize[1];
4924
- this.canvas.style.cssText = 'position:absolute; top:0px; left:0px;';
5054
+ this.canvas.style.cssText = 'margin-right:4px;';
4925
5055
  this.ctx = this.canvas.getContext("2d");
5056
+ this.c[3].style.textAlign = 'left';
5057
+ this.c[3].style.justifyContent = 'left';
4926
5058
  this.c[3].appendChild(this.canvas);
4927
5059
  }
4928
5060
 
@@ -4935,11 +5067,10 @@
4935
5067
  this.canvas = document.createElement('canvas');
4936
5068
  this.canvas.width = this.imageSize[0];
4937
5069
  this.canvas.height = this.imageSize[1];
4938
- (this.h - this.imageSize[1]) * 0.5;
4939
- this.canvas.style.cssText = 'position:relative; pointer-events:none; display:inline-block; float:left; margin-left:0px; margin-right:5px; top:2px'; //this.canvas.style.cssText = 'position:absolute; top:'+h+'px; left:5px;'
4940
-
5070
+ this.canvas.style.cssText = 'margin-right:4px;';
4941
5071
  this.ctx = this.canvas.getContext("2d");
4942
5072
  this.c[3].style.textAlign = 'left';
5073
+ this.c[3].style.justifyContent = 'left';
4943
5074
  this.c[3].appendChild(this.canvas);
4944
5075
  }
4945
5076
 
@@ -4982,9 +5113,9 @@
4982
5113
 
4983
5114
  if (this.up) {
4984
5115
  this.zone.y -= this.h - (this.baseH - 10);
4985
- this.setSvg(this.c[4], 'd', this.svgs.arrowUp);
5116
+ this.setSvg(this.c[4], 'd', this.svgs.g1);
4986
5117
  } else {
4987
- this.setSvg(this.c[4], 'd', this.svgs.arrowDown);
5118
+ this.setSvg(this.c[4], 'd', this.svgs.g2);
4988
5119
  }
4989
5120
 
4990
5121
  this.rSizeContent();
@@ -5000,7 +5131,7 @@
5000
5131
  this.h = this.baseH;
5001
5132
  this.s[0].height = this.h + 'px';
5002
5133
  this.s[2].display = 'none';
5003
- this.setSvg(this.c[4], 'd', this.svgs.arrow);
5134
+ this.setSvg(this.c[4], 'd', this.svgs.g1);
5004
5135
  this.zone.h = this.h;
5005
5136
  this.parentHeight(-t);
5006
5137
  } // -----
@@ -5027,7 +5158,7 @@
5027
5158
  s[2].left = d + 'px';
5028
5159
  s[3].width = w + 'px';
5029
5160
  s[3].left = d + 'px';
5030
- s[4].left = d + w - 17 + 'px';
5161
+ s[4].left = d + w - 15 + 'px';
5031
5162
  this.ww = w;
5032
5163
  if (this.max > this.maxHeight) this.ww = w - this.ss;
5033
5164
  if (this.isOpen) this.rSizeContent();
@@ -5068,8 +5199,8 @@
5068
5199
  if (o.value.y !== undefined) this.value[1] = o.value.y;
5069
5200
  if (o.value.z !== undefined) this.value[2] = o.value.z;
5070
5201
  if (o.value.w !== undefined) this.value[3] = o.value.w;
5071
- this.isVector = true;
5072
5202
  this.isSingle = false;
5203
+ this.isVector = true;
5073
5204
  }
5074
5205
  }
5075
5206
 
@@ -5090,7 +5221,7 @@
5090
5221
 
5091
5222
  while (i--) {
5092
5223
  if (this.isAngle) this.value[i] = (this.value[i] * 180 / Math.PI).toFixed(this.precision);
5093
- 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;');
5094
5225
  if (o.center) this.c[2 + i].style.textAlign = 'center';
5095
5226
  this.c[3 + i].textContent = this.value[i];
5096
5227
  this.c[3 + i].style.color = this.colors.text;
@@ -5100,10 +5231,10 @@
5100
5231
 
5101
5232
 
5102
5233
  this.selectId = 3 + this.lng;
5103
- 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
5104
5235
 
5105
5236
  this.cursorId = 4 + this.lng;
5106
- 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 + ';');
5107
5238
  this.init();
5108
5239
  }
5109
5240
 
@@ -5118,22 +5249,7 @@
5118
5249
  }
5119
5250
 
5120
5251
  return '';
5121
- }
5122
- /* mode: function ( n, name ) {
5123
- if( n === this.cMode[name] ) return false;
5124
- //let m;
5125
- /*switch(n){
5126
- case 0: m = this.colors.border; break;
5127
- case 1: m = this.colors.borderOver; break;
5128
- case 2: m = this.colors.borderSelect; break;
5129
- }*/
5130
-
5131
- /* this.reset();
5132
- //this.c[name+2].style.borderColor = m;
5133
- this.cMode[name] = n;
5134
- return true;
5135
- },*/
5136
- // ----------------------
5252
+ } // ----------------------
5137
5253
  // EVENTS
5138
5254
  // ----------------------
5139
5255
 
@@ -5159,18 +5275,11 @@
5159
5275
  }
5160
5276
 
5161
5277
  return false;
5162
- /*
5163
- if( name === '' ) return false;
5164
- this.current = name;
5165
- this.isDown = true;
5166
- this.prev = { x:e.clientX, y:e.clientY, d:0, v: this.isSingle ? parseFloat(this.value) : parseFloat( this.value[ this.current ] ) };
5167
- return this.mode( 2, name );*/
5168
5278
  }
5169
5279
 
5170
5280
  mouseup(e) {
5171
5281
  if (this.isDown) {
5172
- this.isDown = false; //this.current = -1;
5173
-
5282
+ this.isDown = false;
5174
5283
  this.prev = {
5175
5284
  x: 0,
5176
5285
  y: 0,
@@ -5181,20 +5290,6 @@
5181
5290
  }
5182
5291
 
5183
5292
  return false;
5184
- /*let name = this.testZone( e );
5185
- this.isDown = false;
5186
- if( this.current !== -1 ){
5187
- //let tm = this.current;
5188
- let td = this.prev.d;
5189
- this.current = -1;
5190
- this.prev = { x:0, y:0, d:0, v:0 };
5191
- if( !td ){
5192
- this.setInput( this.c[ 3 + name ] );
5193
- return true;//this.mode( 2, name );
5194
- } else {
5195
- return this.reset();//this.mode( 0, tm );
5196
- }
5197
- }*/
5198
5293
  }
5199
5294
 
5200
5295
  mousemove(e) {
@@ -5223,23 +5318,11 @@
5223
5318
  }
5224
5319
 
5225
5320
  return nup;
5226
- } //keydown: function ( e ) { return true; },
5227
- // ----------------------
5321
+ } // ----------------------
5228
5322
 
5229
5323
 
5230
5324
  reset() {
5231
- let nup = false; //this.isDown = false;
5232
- //this.current = 0;
5233
-
5234
- /* let i = this.lng;
5235
- while(i--){
5236
- if(this.cMode[i]!==0){
5237
- this.cMode[i] = 0;
5238
- //this.c[2+i].style.borderColor = this.colors.border;
5239
- nup = true;
5240
- }
5241
- }*/
5242
-
5325
+ let nup = false;
5243
5326
  return nup;
5244
5327
  }
5245
5328
 
@@ -5250,7 +5333,7 @@
5250
5333
  if (v.z !== undefined) this.value[2] = v.z;
5251
5334
  if (v.w !== undefined) this.value[3] = v.w;
5252
5335
  } else {
5253
- if (this.isSingle) this.value = [v];else this.value = v;
5336
+ this.value = this.isSingle ? [v] : v;
5254
5337
  }
5255
5338
 
5256
5339
  this.update();
@@ -5296,9 +5379,7 @@
5296
5379
  let s = this.s;
5297
5380
  let d = this.current !== -1 ? this.tmp[this.current][0] + 5 : 0;
5298
5381
  s[this.cursorId].width = '1px';
5299
- s[this.cursorId].left = d + c + 'px'; //s[2].left = ( d + e ) + 'px';
5300
- //s[2].width = w + 'px';
5301
-
5382
+ s[this.cursorId].left = d + c + 'px';
5302
5383
  s[this.selectId].left = d + e + 'px';
5303
5384
  s[this.selectId].width = w + 'px';
5304
5385
  this.c[this.selectId].innerHTML = t;
@@ -5331,7 +5412,7 @@
5331
5412
  }
5332
5413
 
5333
5414
  if (!force) return;
5334
- if (this.isSingle) this.send(ar[0]);else this.send(ar);
5415
+ this.send(this.isSingle ? ar[0] : ar);
5335
5416
  } // ----------------------
5336
5417
  // REZISE
5337
5418
  // ----------------------
@@ -5339,12 +5420,16 @@
5339
5420
 
5340
5421
  rSize() {
5341
5422
  super.rSize();
5342
- let w = Math.floor((this.sb + 5) / this.lng) - 5;
5423
+ let sx = this.colors.sx;
5424
+ let ss = sx * (this.lng - 1);
5425
+ let w = (this.sb - ss) / this.lng; //(( this.sb + sx ) / this.lng )-sx
5426
+
5343
5427
  let s = this.s;
5344
5428
  let i = this.lng;
5345
5429
 
5346
5430
  while (i--) {
5347
- this.tmp[i] = [Math.floor(this.sa + w * i + 5 * i), w];
5431
+ //this.tmp[i] = [ Math.floor( this.sa + ( w * i )+( 5 * i )), w ];
5432
+ this.tmp[i] = [this.sa + w * i + sx * i, w];
5348
5433
  this.tmp[i][2] = this.tmp[i][0] + this.tmp[i][1];
5349
5434
  s[3 + i].left = this.tmp[i][0] + 'px';
5350
5435
  s[3 + i].width = this.tmp[i][1] + 'px';
@@ -5381,27 +5466,29 @@
5381
5466
  this.c[2].style.lineHeight = this.h - 10 + 'px';
5382
5467
 
5383
5468
  if (this.model !== 0) {
5384
- let h1 = 4,
5469
+ let r1 = 4,
5470
+ h1 = 4,
5385
5471
  h2 = 8,
5386
- ww = this.h - 4,
5387
- ra = 20;
5472
+ ww = this.h - 6,
5473
+ ra = 16;
5388
5474
 
5389
5475
  if (this.model === 2) {
5390
- h1 = 4; //2
5391
-
5392
- h2 = 8;
5476
+ r1 = 0;
5477
+ h1 = 2;
5478
+ h2 = 4;
5393
5479
  ra = 2;
5394
- ww = (this.h - 4) * 0.5;
5480
+ ww = (this.h - 6) * 0.5;
5395
5481
  }
5396
5482
 
5397
5483
  if (this.model === 3) this.c[5].style.visible = 'none';
5398
- this.c[4].style.borderRadius = h1 + 'px';
5484
+ this.c[4].style.borderRadius = r1 + 'px';
5399
5485
  this.c[4].style.height = h2 + 'px';
5400
5486
  this.c[4].style.top = this.h * 0.5 - h1 + 'px';
5401
- this.c[5].style.borderRadius = h1 * 0.5 + 'px';
5487
+ this.c[5].style.borderRadius = r1 * 0.5 + 'px';
5402
5488
  this.c[5].style.height = h1 + 'px';
5403
- this.c[5].style.top = this.h * 0.5 - h1 * 0.5 + 'px';
5404
- this.c[6] = this.dom('div', this.css.basic + 'border-radius:' + ra + 'px; margin-left:' + -ww * 0.5 + 'px; border:1px solid ' + cc.border + '; background:' + cc.button + '; left:4px; top:2px; height:' + (this.h - 4) + 'px; width:' + ww + 'px;');
5489
+ this.c[5].style.top = this.h * 0.5 - h1 * 0.5 + 'px'; //this.c[6] = this.dom( 'div', this.css.basic + 'border-radius:'+ra+'px; margin-left:'+(-ww*0.5)+'px; border:1px solid '+cc.border+'; background:'+cc.button+'; left:4px; top:2px; height:'+(this.h-4)+'px; width:'+ww+'px;' );
5490
+
5491
+ this.c[6] = this.dom('div', this.css.basic + 'border-radius:' + ra + 'px; margin-left:' + -ww * 0.5 + 'px; background:' + cc.text + '; left:4px; top:3px; height:' + (this.h - 6) + 'px; width:' + ww + 'px;');
5405
5492
  }
5406
5493
 
5407
5494
  this.init();
@@ -5514,6 +5601,8 @@
5514
5601
  s[2].color = cc.text;
5515
5602
  s[4].background = cc.back;
5516
5603
  s[5].background = cc.text;
5604
+ if (this.model !== 0) s[6].background = cc.text; //cc.button;
5605
+
5517
5606
  break;
5518
5607
 
5519
5608
  case 1:
@@ -5522,17 +5611,9 @@
5522
5611
  s[2].color = cc.textOver;
5523
5612
  s[4].background = cc.back;
5524
5613
  s[5].background = cc.textOver;
5525
- break;
5614
+ if (this.model !== 0) s[6].background = cc.textOver; //cc.overoff;
5526
5615
 
5527
- /* case 2:
5528
- s[2].border = '1px solid ' + this.colors.borderSelect;
5529
- break;
5530
- case 3:
5531
- s[2].border = '1px dashed ' + this.colors.text;//this.colors.borderSelect;
5532
- break;
5533
- case 4:
5534
- s[2].border = '1px dashed ' + this.colors.hide;
5535
- break;*/
5616
+ break;
5536
5617
  }
5537
5618
  }
5538
5619
 
@@ -5577,14 +5658,14 @@
5577
5658
  this.isDown = false;
5578
5659
  let cc = this.colors; // text
5579
5660
 
5580
- 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;');
5581
5662
  this.c[2].textContent = this.value; // selection
5582
5663
 
5583
- 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
5584
5665
 
5585
- 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
5586
5667
 
5587
- 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 + ';');
5588
5669
  if (this.value === '') this.c[5].textContent = this.placeHolder;
5589
5670
  this.init();
5590
5671
  }
@@ -5788,8 +5869,7 @@
5788
5869
 
5789
5870
  mousemove(e) {
5790
5871
  let up = false;
5791
- let name = this.testZone(e); //let sel = false;
5792
- //console.log(name)
5872
+ let name = this.testZone(e);
5793
5873
 
5794
5874
  if (name === 'over') {
5795
5875
  this.cursor('pointer');
@@ -5951,8 +6031,7 @@
5951
6031
 
5952
6032
  mousemove(e) {
5953
6033
  let up = false;
5954
- let name = this.testZone(e); //let sel = false;
5955
- //console.log(name)
6034
+ let name = this.testZone(e);
5956
6035
 
5957
6036
  if (name === 'over') {
5958
6037
  this.cursor('pointer');
@@ -5985,7 +6064,7 @@
5985
6064
 
5986
6065
  if (this.img !== null) {
5987
6066
  if (this.objectLink !== null) this.objectLink[this.val] = v;
5988
- if (this.callback) this.callback(v, this.img, this.name);
6067
+ if (this.callback) this.callback(this.value, this.img, this.name);
5989
6068
  }
5990
6069
  }
5991
6070
 
@@ -6001,12 +6080,6 @@
6001
6080
  let cc = this.colors;
6002
6081
 
6003
6082
  if (this.stat !== n) {
6004
- /*if( n===1 ) this.isActif = false
6005
- if( n===3 ){
6006
- if( !this.isActif ){ this.isActif = true; n=4; this.onActif( this ); }
6007
- else { this.isActif = false; }
6008
- }
6009
- if( n===2 && this.isActif ) n = 4;*/
6010
6083
  this.stat = n;
6011
6084
 
6012
6085
  switch (n) {
@@ -6188,17 +6261,20 @@
6188
6261
  if (typeof this.values === 'string') this.values = [this.values];
6189
6262
  this.lng = this.values.length;
6190
6263
  this.value = o.value || null;
6264
+ let cc = this.colors;
6191
6265
  this.isSelectable = o.selectable || false;
6192
- this.spaces = o.spaces || [5, 3];
6266
+ this.spaces = o.spaces || [cc.sx, cc.sy];
6193
6267
  this.bsize = o.bsize || [90, 20];
6194
6268
  if (o.h) this.bsize[1] = o.h;
6195
6269
  this.bsizeMax = this.bsize[0];
6196
6270
  this.tmp = [];
6197
6271
  this.stat = [];
6198
6272
  this.grid = [2, Math.round(this.lng * 0.5)];
6199
- this.h = this.grid[1] * (this.bsize[1] + this.spaces[1]) + this.spaces[1];
6200
- this.c[1].textContent = '';
6201
- 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;');
6202
6278
  let n = 0,
6203
6279
  b,
6204
6280
  td,
@@ -6211,7 +6287,6 @@
6211
6287
  this.stat = [];
6212
6288
  this.tmpX = [];
6213
6289
  this.tmpY = [];
6214
- let cc = this.colors;
6215
6290
 
6216
6291
  for (let i = 0; i < this.grid[1]; i++) {
6217
6292
  tr = this.c[2].insertRow();
@@ -6241,7 +6316,8 @@
6241
6316
  if (j === 0) b.style.cssText += 'float:right;';else b.style.cssText += 'float:left;';
6242
6317
  n++;
6243
6318
  }
6244
- }
6319
+ } //this.s[0].border = 'none'
6320
+
6245
6321
 
6246
6322
  this.init();
6247
6323
  }
@@ -6249,6 +6325,7 @@
6249
6325
  testZone(e) {
6250
6326
  let l = this.local;
6251
6327
  if (l.x === -1 && l.y === -1) return -1;
6328
+ l.y += this.mtop;
6252
6329
  let tx = this.tmpX;
6253
6330
  let ty = this.tmpY;
6254
6331
  let id = -1;
@@ -6465,7 +6542,6 @@
6465
6542
 
6466
6543
  this.value = Array.isArray(o.value) && o.value.length == 2 ? o.value : [0, 0];
6467
6544
  this.h = o.h || this.w + 10;
6468
- this.top = 0;
6469
6545
  this.c[0].style.width = this.w + 'px'; // Title
6470
6546
 
6471
6547
  if (this.c[1] !== undefined) {
@@ -6474,7 +6550,8 @@
6474
6550
  this.c[1].style.justifyContent = 'center';
6475
6551
  this.top = 10;
6476
6552
  this.h += 10;
6477
- }
6553
+ } //this.top -= this.margin
6554
+
6478
6555
 
6479
6556
  let cc = this.colors; // Value
6480
6557
 
@@ -6525,7 +6602,7 @@
6525
6602
  mousemove(e) {
6526
6603
  if (!this.isDown) return;
6527
6604
  let x = this.w * 0.5 - (e.clientX - this.zone.x);
6528
- 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);
6529
6606
  let r = 256 / this.diam;
6530
6607
  x = -(x * r);
6531
6608
  y = -(y * r);
@@ -6643,7 +6720,7 @@
6643
6720
  o = a[2];
6644
6721
  o.name = a[1];
6645
6722
 
6646
- if (type === 'list') {
6723
+ if (type === 'list' && !o.list) {
6647
6724
  o.list = a[0][a[1]];
6648
6725
  } else o.value = a[0][a[1]];
6649
6726
  }
@@ -6809,7 +6886,9 @@
6809
6886
  this.mouse = new V2().neg();
6810
6887
  this.h = 0; //this.prevY = -1;
6811
6888
 
6812
- 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
6813
6892
 
6814
6893
  this.isWithClose = o.close !== undefined ? o.close : true;
6815
6894
  this.bh = !this.isWithClose ? 0 : this.size.h;
@@ -7232,7 +7311,7 @@
7232
7311
  while (i--) {
7233
7312
  if (this.uis[i].value === name) {
7234
7313
  this.uis[i].selected(true);
7235
- 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);
7236
7315
  }
7237
7316
  }
7238
7317
  } // ----------------------
@@ -7330,7 +7409,7 @@
7330
7409
 
7331
7410
  }
7332
7411
 
7333
- const REVISION = '4.2.1';
7412
+ const REVISION = '4.2.5';
7334
7413
 
7335
7414
  exports.Files = Files;
7336
7415
  exports.Gui = Gui;