uil 4.2.0 → 4.2.3

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
@@ -723,9 +723,9 @@
723
723
  }
724
724
 
725
725
  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;
726
+ if (o.groupBorder) color.gborder = o.groupBorder; //if( o.transparent ) o.bg = 'none'
727
+ //if( o.bg ) color.background = color.backgroundOver = o.bg
728
+
729
729
  if (o.bgOver) color.backgroundOver = o.bgOver;
730
730
 
731
731
  for (let m in color) {
@@ -740,48 +740,48 @@
740
740
  return color;
741
741
  },
742
742
  colors: {
743
+ sx: 3,
744
+ sy: 3,
743
745
  content: 'none',
744
- background: 'rgba(50,50,50,0.3)',
745
- backgroundOver: 'rgba(50,50,50,0.4)',
746
+ background: 'rgba(50,50,50,0.15)',
747
+ backgroundOver: 'rgba(50,50,50,0.3)',
746
748
  title: '#CCC',
747
749
  titleoff: '#BBB',
748
750
  text: '#DDD',
749
751
  textOver: '#EEE',
750
752
  textSelect: '#FFF',
751
- //inputBg: 'rgba(0,0,0,0.25)',
752
- //itemBg:'rgba(0,0,0,0.25)',
753
753
  back: 'rgba(0,0,0,0.2)',
754
754
  backoff: 'rgba(0,0,0,0.3)',
755
- //inputOver: 'rgba(0,0,0,0.2)',
756
755
  // input and button border
757
756
  border: '#4c4c4c',
758
757
  borderSize: 1,
759
758
  gborder: 'none',
759
+ groups: 'none',
760
760
  button: '#3c3c3c',
761
761
  overoff: '#5c5c5c',
762
762
  over: '#024699',
763
763
  select: '#308AFF',
764
764
  action: '#FF3300',
765
765
  //fontFamily: 'Tahoma',
766
- fontFamily: 'Consolas,monaco,monospace',
766
+ fontFamily: 'Consolas, monospace',
767
+ //fontFamily: "'Roboto Mono', 'Source Code Pro', Menlo, Courier, monospace",
767
768
  fontWeight: 'normal',
768
- fontShadow: '#000',
769
+ fontShadow: 'none',
770
+ //'#000',
769
771
  fontSize: 12,
770
772
  radius: 4,
771
773
  hide: 'rgba(0,0,0,0)'
772
774
  },
773
775
  // style css
774
776
  css: {
775
- //unselect: '-o-user-select:none; -ms-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -moz-user-select:none;',
776
777
  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;',
777
- button: 'display:flex; justify-content:center; align-items:center; text-align:center;'
778
- /*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;',
779
- 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+';',
780
- item: T.css.txt + 'position:relative; background:rgba(0,0,0,0.2); margin-bottom:1px;',*/
781
-
778
+ 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
780
  },
783
781
  // svg path
784
782
  svgs: {
783
+ 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',
784
+ 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',
785
785
  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',
786
786
  arrow: 'M 3 8 L 8 5 3 2 3 8 Z',
787
787
  arrowDown: 'M 5 8 L 8 3 2 3 5 8 Z',
@@ -831,12 +831,16 @@
831
831
  if (shadow === undefined) shadow = cc.fontShadow;
832
832
  if (weight === undefined) weight = cc.fontWeight;
833
833
  if (color === undefined) color = cc.text;
834
- let align = 'display:flex; justify-content:left; align-items:center; text-align:left;';
835
- T.css.txt = T.css.basic + align + 'font-family:' + font + '; font-weight:' + weight + '; font-size:' + size + 'px; color:' + cc.text + '; padding:0px 10px; left:0; top:2px; height:16px; width:100px; overflow:hidden; white-space: nowrap;';
836
- if (shadow !== 'none') T.css.txt += ' text-shadow: 1px 1px 1px ' + shadow + ';';
837
- 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;';//
838
834
 
839
- T.css.item = T.css.txt + ' position:relative; margin-bottom:1px; display:block; padding:2px 4px;'; //
835
+ if (isNaN(size)) {
836
+ if (size.search('em') === -1) size += 'px';
837
+ } else size += 'px'; //let align = 'display:flex; justify-content:left; align-items:center; text-align:left;'
838
+
839
+
840
+ 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;';
841
+ if (shadow !== 'none') T.css.txt += ' text-shadow: 1px 1px 1px ' + shadow + ';';
842
+ T.css.txtselect = T.css.txt + 'padding:0px 4px; border:1px dashed ' + cc.border + ';';
843
+ T.css.item = T.css.txt + 'padding:0px 4px; position:relative; margin-bottom:1px; ';
840
844
  },
841
845
  // note
842
846
  //https://developer.mozilla.org/fr/docs/Web/CSS/css_flexible_box_layout/aligning_items_in_a_flex_container
@@ -1590,6 +1594,40 @@
1590
1594
  }];
1591
1595
  break;
1592
1596
 
1597
+ case 'wav':
1598
+ t = [{
1599
+ accept: {
1600
+ 'audio/wav': '.wav'
1601
+ }
1602
+ }];
1603
+ break;
1604
+
1605
+ case 'mp3':
1606
+ t = [{
1607
+ accept: {
1608
+ 'audio/mpeg': '.mp3'
1609
+ }
1610
+ }];
1611
+ break;
1612
+
1613
+ case 'mp4':
1614
+ t = [{
1615
+ accept: {
1616
+ 'video/mp4': '.mp4'
1617
+ }
1618
+ }];
1619
+ break;
1620
+
1621
+ case 'bin':
1622
+ case 'hex':
1623
+ t = [{
1624
+ description: 'Binary Files',
1625
+ accept: {
1626
+ 'application/octet-stream': ['.bin', '.hex']
1627
+ }
1628
+ }];
1629
+ break;
1630
+
1593
1631
  case 'text':
1594
1632
  t = [{
1595
1633
  description: 'Text Files',
@@ -1604,7 +1642,17 @@
1604
1642
  t = [{
1605
1643
  description: 'JSON Files',
1606
1644
  accept: {
1607
- 'text/plain': ['.json']
1645
+ 'application/json': ['.json']
1646
+ }
1647
+ }]; //text/plain
1648
+
1649
+ break;
1650
+
1651
+ case 'js':
1652
+ t = [{
1653
+ description: 'JavaScript Files',
1654
+ accept: {
1655
+ 'text/javascript': ['.js']
1608
1656
  }
1609
1657
  }];
1610
1658
  break;
@@ -1911,7 +1959,7 @@
1911
1959
  this.fw = o.fw || 0;
1912
1960
  this.autoWidth = o.auto || true; // auto width or flex
1913
1961
 
1914
- this.isOpen = false; // open statu
1962
+ this.isOpen = false; //false// open statu
1915
1963
  // radius for toolbox
1916
1964
 
1917
1965
  this.radius = o.radius || this.colors.radius;
@@ -1970,13 +2018,14 @@
1970
2018
  this.s[0].borderTop = this.margin * 0.5 + 'px solid transparent';
1971
2019
  this.s[0].borderBottom = this.margin * 0.5 + 'px solid transparent';
1972
2020
  } else {
2021
+ //this.s[0].borderTop = (this.margin*0.5) + 'px solid transparent'
1973
2022
  this.s[0].borderBottom = this.margin + 'px solid transparent';
1974
2023
  }
1975
2024
  } // with title
1976
2025
 
1977
2026
 
1978
2027
  if (!this.simple) {
1979
- this.c[1] = Tools.dom('div', this.css.txt);
2028
+ this.c[1] = Tools.dom('div', this.css.txt + this.css.middle);
1980
2029
  this.s[1] = this.c[1].style;
1981
2030
  this.c[1].textContent = this.name;
1982
2031
  this.s[1].color = this.lock ? this.colors.titleoff : this.colors.title;
@@ -2019,8 +2068,9 @@
2019
2068
 
2020
2069
  if (c[1] !== undefined && this.autoWidth) {
2021
2070
  s[1] = c[1].style;
2022
- s[1].height = this.h - 4 + 'px';
2023
- s[1].lineHeight = this.h - 8 + 'px';
2071
+ 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';
2024
2074
  }
2025
2075
 
2026
2076
  let frag = Tools.frag;
@@ -2227,9 +2277,11 @@
2227
2277
  if (this.simple) {
2228
2278
  this.sb = this.w - this.sa;
2229
2279
  } else {
2230
- let pp = this.w * (this.p / 100);
2231
- this.sa = Math.floor(pp + 10);
2232
- this.sb = Math.floor(this.w - pp - 20);
2280
+ let pp = this.w * (this.p / 100); //this.sa = Math.floor( pp + 10 )
2281
+ //this.sb = Math.floor( this.w - pp - 20 )
2282
+
2283
+ this.sa = Math.floor(pp + 8);
2284
+ this.sb = Math.floor(this.w - pp - 16);
2233
2285
  }
2234
2286
  }
2235
2287
 
@@ -2342,15 +2394,15 @@
2342
2394
 
2343
2395
  open() {
2344
2396
  if (this.isOpen) return;
2345
- this.isOpen = true; //Roots.needResize = true
2346
-
2397
+ this.isOpen = true;
2398
+ Roots.needResize = true;
2347
2399
  if (this.openCallback) this.openCallback();
2348
2400
  }
2349
2401
 
2350
2402
  close() {
2351
2403
  if (!this.isOpen) return;
2352
- this.isOpen = false; //Roots.needResize = true
2353
-
2404
+ this.isOpen = false;
2405
+ Roots.needResize = true;
2354
2406
  if (this.closeCallback) this.closeCallback();
2355
2407
  }
2356
2408
 
@@ -2537,6 +2589,7 @@
2537
2589
  this.value = o.value || '';
2538
2590
  this.values = o.value || this.txt;
2539
2591
  if (o.values) this.values = o.values;
2592
+ if (!o.values && !o.value) this.txt = '';
2540
2593
  this.onName = o.onName || null;
2541
2594
  this.on = false; // force button width
2542
2595
 
@@ -2569,7 +2622,7 @@
2569
2622
  }
2570
2623
  }
2571
2624
 
2572
- if (!this.txt) this.p = 0;
2625
+ if (this.txt === '') this.p = 0;
2573
2626
  this.init();
2574
2627
  }
2575
2628
 
@@ -2715,16 +2768,20 @@
2715
2768
  let w = this.sb;
2716
2769
  let d = this.sa;
2717
2770
  let i = this.lng;
2718
- let dc = this.space;
2719
- let size = Math.floor((w - dc * (i - 1)) / i);
2771
+ let sx = this.colors.sx; //this.space;
2772
+ //let size = Math.floor( ( w-(dc*(i-1)) ) / i );
2773
+
2774
+ let size = (w - sx * (i - 1)) / i;
2720
2775
 
2721
2776
  if (this.bw) {
2722
- size = this.bw < size ? this.bw : size;
2723
- d = Math.floor((this.w - (size * i + dc * (i - 1))) * 0.5);
2777
+ size = this.bw < size ? this.bw : size; //d = Math.floor((this.w-( (size * i) + (dc * (i-1)) ))*0.5)
2778
+
2779
+ d = (this.w - (size * i + sx * (i - 1))) * 0.5;
2724
2780
  }
2725
2781
 
2726
2782
  while (i--) {
2727
- this.tmp[i] = [Math.floor(d + size * i + dc * i), size];
2783
+ //this.tmp[i] = [ Math.floor( d + ( size * i ) + ( dc * i )), size ];
2784
+ this.tmp[i] = [d + size * i + sx * i, size];
2728
2785
  this.tmp[i][2] = this.tmp[i][0] + this.tmp[i][1];
2729
2786
  s[i + 2].left = this.tmp[i][0] + 'px';
2730
2787
  s[i + 2].width = this.tmp[i][1] + 'px';
@@ -3244,11 +3301,13 @@
3244
3301
  this.txt = o.name || 'Fps';
3245
3302
  }
3246
3303
 
3247
- let fltop = Math.floor(this.h * 0.5) - 6;
3248
- this.c[1].textContent = this.txt;
3304
+ let fltop = Math.floor(this.h * 0.5) - 3;
3305
+ const ccc = this.colors;
3306
+ this.c[1].textContent = this.txt; //this.c[1].innerHTML = '&#160;' + this.txt
3307
+
3249
3308
  this.c[0].style.cursor = 'pointer';
3250
3309
  this.c[0].style.pointerEvents = 'auto';
3251
- 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 + ';';
3310
+ 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 + ';';
3252
3311
  if (this.radius !== 0) panelCss += 'border-radius:' + this.radius + 'px;';
3253
3312
  this.c[2] = this.dom('path', this.css.basic + panelCss, {});
3254
3313
  this.c[2].setAttribute('viewBox', '0 0 ' + this.res + ' 50');
@@ -3258,23 +3317,25 @@
3258
3317
  //this.dom( 'path', null, { fill:'rgba(0,255,255,0.3)', 'stroke-width':1, stroke:'#0FF', 'vector-effect':'non-scaling-stroke' }, this.c[2] );
3259
3318
  // arrow
3260
3319
 
3261
- this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:10px; height:10px; left:4px; top:' + fltop + 'px;', {
3262
- d: this.svgs.arrow,
3263
- fill: this.colors.text,
3320
+ this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:6px; height:6px; left:0; top:' + fltop + 'px;', {
3321
+ d: this.svgs.g1,
3322
+ fill: ccc.text,
3264
3323
  stroke: 'none'
3265
- }); // result test
3324
+ }); //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'});
3325
+ // result test
3266
3326
 
3267
3327
  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
3268
3328
 
3269
3329
  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);');
3270
3330
  this.isShow = false;
3271
- let s = this.s;
3272
- s[1].marginLeft = '10px';
3331
+ let s = this.s; //s[1].marginLeft = '10px';
3332
+
3273
3333
  s[1].lineHeight = this.h - 4;
3274
- s[1].color = this.colors.text;
3275
- s[1].fontWeight = 'bold';
3334
+ s[1].color = ccc.text; //s[1].paddingLeft = '18px';
3335
+ //s[1].fontWeight = 'bold';
3336
+
3276
3337
  if (this.radius !== 0) s[0].borderRadius = this.radius + 'px';
3277
- if (this.colors.gborder !== 'none') s[0].border = '1px solid ' + this.colors.gborder;
3338
+ if (this.colors.gborder !== 'none') s[0].border = '1px solid ' + ccc.gborder;
3278
3339
  let j = 0;
3279
3340
 
3280
3341
  for (j = 0; j < this.names.length; j++) {
@@ -3378,7 +3439,7 @@
3378
3439
  open() {
3379
3440
  super.open();
3380
3441
  this.h = this.hplus + this.baseH;
3381
- this.setSvg(this.c[3], 'd', this.svgs.arrowDown);
3442
+ this.setSvg(this.c[3], 'd', this.svgs.g2);
3382
3443
 
3383
3444
  if (this.group !== null) {
3384
3445
  this.group.calc(this.hplus);
@@ -3394,7 +3455,7 @@
3394
3455
  close() {
3395
3456
  super.close();
3396
3457
  this.h = this.baseH;
3397
- this.setSvg(this.c[3], 'd', this.svgs.arrow);
3458
+ this.setSvg(this.c[3], 'd', this.svgs.g1);
3398
3459
 
3399
3460
  if (this.group !== null) {
3400
3461
  this.group.calc(-this.hplus);
@@ -3444,6 +3505,7 @@
3444
3505
  rSize() {
3445
3506
  let s = this.s;
3446
3507
  let w = this.w;
3508
+ s[3].left = this.sa + this.sb - 6 + 'px';
3447
3509
  s[0].width = w + 'px';
3448
3510
  s[1].width = w + 'px';
3449
3511
  s[2].left = 10 + 'px';
@@ -3739,45 +3801,49 @@
3739
3801
  this.current = -1;
3740
3802
  this.proto = null;
3741
3803
  this.isEmpty = true;
3742
- this.decal = 0;
3804
+ this.decal = o.group ? 8 : 0;
3743
3805
  this.baseH = this.h;
3744
- let fltop = Math.floor(this.h * 0.5) - 6;
3745
- this.isLine = o.line !== undefined ? o.line : false;
3746
- this.decal = 0;
3747
-
3748
- if (o.group) {
3749
- this.decal = o.group.decal ? o.group.decal : 0;
3750
- this.decal += 6;
3751
- }
3752
-
3806
+ let fltop = Math.floor(this.h * 0.5) - 3;
3807
+ const cc = this.colors;
3753
3808
  this.useFlex = true;
3754
3809
  let flexible = this.useFlex ? 'display:flex; flex-flow: row wrap;' : '';
3755
- this.c[2] = this.dom('div', this.css.basic + flexible + 'width:100%; left:0; height:auto; overflow:hidden; top:' + this.h + 'px'); //
3756
-
3757
- this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:10px; height:10px; left:0; top:' + fltop + 'px;', {
3758
- d: this.svgs.group,
3759
- fill: this.colors.text,
3810
+ this.c[2] = this.dom('div', this.css.basic + flexible + 'width:100%; left:0; height:auto; overflow:hidden; top:' + this.h + 'px');
3811
+ this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:6px; height:6px; left:0; top:' + fltop + 'px;', {
3812
+ d: this.svgs.g1,
3813
+ fill: cc.text,
3760
3814
  stroke: 'none'
3761
3815
  });
3762
- this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:10px; height:10px; left:' + (4 + this.decal) + 'px; top:' + fltop + 'px;', {
3763
- d: this.svgs.arrow,
3764
- fill: this.colors.text,
3765
- stroke: 'none'
3766
- }); // bottom line
3767
-
3768
- 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');
3769
- let s = this.s;
3770
- s[0].height = this.h + 'px';
3771
- s[1].height = this.h + 'px';
3816
+ this.s;
3772
3817
  this.c[1].name = 'group';
3773
- s[1].marginLeft = 10 + this.decal + 'px';
3774
- s[1].lineHeight = this.h - 4;
3775
- s[1].color = this.colors.text;
3776
- s[1].fontWeight = 'bold';
3777
- if (this.radius !== 0) s[0].borderRadius = this.radius + 'px';
3778
3818
  this.init();
3779
3819
  this.setBG(o.bg);
3780
- if (o.open !== undefined) this.open();
3820
+ if (o.open) this.open();
3821
+ }
3822
+
3823
+ setBG(bg) {
3824
+ const cc = this.colors;
3825
+ const s = this.s;
3826
+ if (bg !== undefined) cc.groups = bg;
3827
+ if (cc.groups === 'none') cc.groups = cc.background;
3828
+ cc.background = 'none';
3829
+ s[0].background = 'none';
3830
+ s[1].background = cc.groups;
3831
+ s[2].background = cc.groups;
3832
+
3833
+ if (cc.gborder !== 'none') {
3834
+ s[1].border = cc.borderSize + 'px solid ' + cc.gborder;
3835
+ }
3836
+
3837
+ if (this.radius !== 0) {
3838
+ s[1].borderRadius = this.radius + 'px';
3839
+ s[2].borderRadius = this.radius + 'px';
3840
+ }
3841
+ /*let i = this.uis.length;
3842
+ while(i--){
3843
+ this.uis[i].setBG( 'none' );
3844
+ //this.uis[i].setBG( this.colors.background );
3845
+ }*/
3846
+
3781
3847
  }
3782
3848
 
3783
3849
  testZone(e) {
@@ -3857,16 +3923,6 @@
3857
3923
  } // ----------------------
3858
3924
 
3859
3925
 
3860
- setBG(bg) {
3861
- if (bg !== undefined) this.colors.background = bg;
3862
- this.c[0].style.background = this.colors.background;
3863
- let i = this.uis.length;
3864
-
3865
- while (i--) {
3866
- this.uis[i].setBG(this.colors.background);
3867
- }
3868
- }
3869
-
3870
3926
  add() {
3871
3927
  let a = arguments;
3872
3928
 
@@ -3943,18 +3999,48 @@
3943
3999
 
3944
4000
  open() {
3945
4001
  super.open();
3946
- this.setSvg(this.c[4], 'd', this.svgs.arrowDown);
4002
+ this.setSvg(this.c[3], 'd', this.svgs.g2);
3947
4003
  this.rSizeContent();
3948
4004
  this.h - this.baseH;
4005
+ const s = this.s;
4006
+ const cc = this.colors;
4007
+ s[2].top = this.h - 1 + 'px';
4008
+
4009
+ if (this.radius) {
4010
+ s[1].borderRadius = '0px';
4011
+ s[2].borderRadius = '0px';
4012
+ s[1].borderTopLeftRadius = this.radius + 'px';
4013
+ s[1].borderTopRightRadius = this.radius + 'px';
4014
+ s[2].borderBottomLeftRadius = this.radius + 'px';
4015
+ s[2].borderBottomRightRadius = this.radius + 'px';
4016
+ }
4017
+
4018
+ if (cc.gborder !== 'none') {
4019
+ s[2].border = cc.borderSize + 'px solid ' + cc.gborder;
4020
+ s[2].borderTop = 'none';
4021
+ s[1].borderBottom = cc.borderSize + 'px solid rgba(0,0,0,0)';
4022
+ }
4023
+
3949
4024
  this.parentHeight();
3950
4025
  }
3951
4026
 
3952
4027
  close() {
3953
4028
  super.close();
3954
4029
  this.h - this.baseH;
3955
- this.setSvg(this.c[4], 'd', this.svgs.arrow);
4030
+ this.setSvg(this.c[3], 'd', this.svgs.g1);
3956
4031
  this.h = this.baseH;
3957
- this.s[0].height = this.h + 'px';
4032
+ const s = this.s;
4033
+ const cc = this.colors;
4034
+ s[0].height = this.h + 'px'; //s[1].height = (this.h-2) + 'px'
4035
+
4036
+ s[2].top = this.h + 'px';
4037
+
4038
+ if (cc.gborder !== 'none') {
4039
+ s[2].border = 'none';
4040
+ s[1].border = cc.borderSize + 'px solid ' + cc.gborder;
4041
+ }
4042
+
4043
+ if (this.radius) s[1].borderRadius = this.radius + 'px';
3958
4044
  this.parentHeight();
3959
4045
  }
3960
4046
 
@@ -3985,9 +4071,13 @@
3985
4071
  rSize() {
3986
4072
  super.rSize();
3987
4073
  let s = this.s;
3988
- s[3].left = this.sa + this.sb - 17 + 'px';
4074
+ 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
+
3989
4077
  s[1].width = this.w + 'px';
3990
4078
  s[2].width = this.w + 'px';
4079
+ s[1].left = this.decal + 'px';
4080
+ s[2].left = this.decal + 'px';
3991
4081
  if (this.isOpen) this.rSizeContent();
3992
4082
  }
3993
4083
 
@@ -4406,9 +4496,9 @@
4406
4496
  this.isWithImage = this.path !== '' ? true : false;
4407
4497
  this.preLoadComplete = false;
4408
4498
  this.tmpImage = {};
4409
- this.tmpUrl = []; //this.autoHeight = false;
4410
-
4411
- let align = o.align || 'center'; // scroll size
4499
+ this.tmpUrl = [];
4500
+ this.m = o.m !== undefined ? o.m : 5;
4501
+ let align = o.align || 'left'; // scroll size
4412
4502
 
4413
4503
  let ss = o.scrollSize || 10;
4414
4504
  this.ss = ss + 1;
@@ -4420,12 +4510,12 @@
4420
4510
  if (o.select !== undefined) o.selectable = o.select;
4421
4511
  if (o.selectable !== undefined) this.isSelectable = o.selectable;
4422
4512
  if (this.txt === '') this.p = 0;
4423
- let fltop = Math.floor(this.h * 0.5) - 5;
4513
+ let fltop = Math.floor(this.h * 0.5) - 3;
4424
4514
  let cc = this.colors;
4425
4515
  this.c[2] = this.dom('div', this.css.basic + 'top:0; display:none; border-radius:' + this.radius + 'px;');
4426
- 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;');
4427
- this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:10px; height:10px; top:' + fltop + 'px;', {
4428
- d: this.svgs.arrow,
4516
+ 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;');
4517
+ this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:6px; height:6px; top:' + fltop + 'px;', {
4518
+ d: this.svgs.g1,
4429
4519
  fill: cc.text,
4430
4520
  stroke: 'none'
4431
4521
  });
@@ -4438,7 +4528,7 @@
4438
4528
  if (o.list) {
4439
4529
  if (o.list instanceof Array) {
4440
4530
  this.list = o.list;
4441
- } else {
4531
+ } else if (o.list instanceof Object) {
4442
4532
  this.refObject = o.list;
4443
4533
 
4444
4534
  for (let g in this.refObject) this.list.push(g);
@@ -4448,7 +4538,8 @@
4448
4538
  this.items = [];
4449
4539
  this.prevName = '';
4450
4540
  this.baseH = this.h;
4451
- this.itemHeight = o.itemHeight || this.h - 3; // force full list
4541
+ this.itemHeight = o.itemHeight || this.h; //(this.h-3);
4542
+ // force full list
4452
4543
 
4453
4544
  this.full = o.full || false;
4454
4545
  this.py = 0;
@@ -4463,8 +4554,7 @@
4463
4554
  if (this.up) {
4464
4555
  this.c[2].style.top = 'auto';
4465
4556
  this.c[3].style.top = 'auto';
4466
- this.c[4].style.top = 'auto'; //this.c[5].style.top = 'auto';
4467
-
4557
+ this.c[4].style.top = 'auto';
4468
4558
  this.c[2].style.bottom = this.h - 2 + 'px';
4469
4559
  this.c[3].style.bottom = '1px';
4470
4560
  this.c[4].style.bottom = fltop + 'px';
@@ -4504,18 +4594,11 @@
4504
4594
  this.dragstart = o.dragstart || null;
4505
4595
  this.dragend = o.dragend || null; //this.c[0].style.background = '#FF0000'
4506
4596
 
4507
- if (this.isWithImage) this.preloadImage(); // } else {
4508
- // populate list
4509
-
4597
+ if (this.isWithImage) this.preloadImage();
4510
4598
  this.setList(this.list);
4511
4599
  this.init();
4512
- if (this.isOpenOnStart) this.open(true); // }
4513
- }
4514
- /*send ( v ) {
4515
- super.send( v );
4516
- //Proto.prototype.send.call( this, v );
4517
- }*/
4518
- // image list
4600
+ if (this.isOpenOnStart) this.open(true);
4601
+ } // image list
4519
4602
 
4520
4603
 
4521
4604
  preloadImage() {
@@ -4672,10 +4755,9 @@
4672
4755
  // is item
4673
4756
  if (this.current) {
4674
4757
  this.value = this.list[this.current.id];
4675
- if (this.isSelectable) this.selected(); //this.value = this.refObject !== null ? this.refObject[this.list[this.current.id]] : this.list[this.current.id]
4676
- //this.value = this.current.textContent;
4758
+ if (this.isSelectable) this.selected(); //this.send( this.refObject !== null ? this.refObject[ this.list[this.current.id]] : this.value );
4677
4759
 
4678
- this.send(this.refObject !== null ? this.refObject[this.list[this.current.id]] : this.value);
4760
+ this.send(this.value);
4679
4761
 
4680
4762
  if (!this.listOnly) {
4681
4763
  this.close();
@@ -4826,7 +4908,7 @@
4826
4908
 
4827
4909
  for (let i = 0; i < this.length; i++) {
4828
4910
  n = this.list[i];
4829
- 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 + ';');
4911
+ 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 + ';');
4830
4912
  item.name = 'item' + i;
4831
4913
  item.id = i;
4832
4914
  item.select = false;
@@ -4839,15 +4921,18 @@
4839
4921
 
4840
4922
  if (this.miniCanvas) {
4841
4923
  let c = new Image();
4842
- c.src = this.tmpCanvas.toDataURL();
4924
+ c.src = this.tmpCanvas.toDataURL(); //item.style.marginLeft = (this.imageSize[0]+8)+'px'
4925
+
4843
4926
  /*let c = document.createElement('canvas')
4844
4927
  c.width = this.imageSize[0]
4845
4928
  c.height = this.imageSize[1]
4846
4929
  let ctx = c.getContext("2d")
4847
4930
  ctx.fillStyle = this.canvasBg
4848
4931
  ctx.fillRect(0, 0, this.imageSize[0], this.imageSize[1])*/
4932
+ //c.style.cssText = 'position:relative; pointer-events:none; display:inline-block; float:left; margin-left:0px; margin-right:5px; top:2px'
4933
+ // c.style.cssText =' flex-shrink: 0;'
4849
4934
 
4850
- 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;'
4935
+ c.style.cssText = 'margin-right:4px;'; //c.style.cssText = 'display:flex; align-content: flex-start; flex-wrap: wrap;'
4851
4936
  //item.style.float = 'right'
4852
4937
 
4853
4938
  item.appendChild(c);
@@ -4913,8 +4998,10 @@
4913
4998
  this.canvas = document.createElement('canvas');
4914
4999
  this.canvas.width = this.imageSize[0];
4915
5000
  this.canvas.height = this.imageSize[1];
4916
- this.canvas.style.cssText = 'position:absolute; top:0px; left:0px;';
5001
+ this.canvas.style.cssText = 'margin-right:4px;';
4917
5002
  this.ctx = this.canvas.getContext("2d");
5003
+ this.c[3].style.textAlign = 'left';
5004
+ this.c[3].style.justifyContent = 'left';
4918
5005
  this.c[3].appendChild(this.canvas);
4919
5006
  }
4920
5007
 
@@ -4927,11 +5014,10 @@
4927
5014
  this.canvas = document.createElement('canvas');
4928
5015
  this.canvas.width = this.imageSize[0];
4929
5016
  this.canvas.height = this.imageSize[1];
4930
- (this.h - this.imageSize[1]) * 0.5;
4931
- 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;'
4932
-
5017
+ this.canvas.style.cssText = 'margin-right:4px;';
4933
5018
  this.ctx = this.canvas.getContext("2d");
4934
5019
  this.c[3].style.textAlign = 'left';
5020
+ this.c[3].style.justifyContent = 'left';
4935
5021
  this.c[3].appendChild(this.canvas);
4936
5022
  }
4937
5023
 
@@ -4974,9 +5060,9 @@
4974
5060
 
4975
5061
  if (this.up) {
4976
5062
  this.zone.y -= this.h - (this.baseH - 10);
4977
- this.setSvg(this.c[4], 'd', this.svgs.arrowUp);
5063
+ this.setSvg(this.c[4], 'd', this.svgs.g1);
4978
5064
  } else {
4979
- this.setSvg(this.c[4], 'd', this.svgs.arrowDown);
5065
+ this.setSvg(this.c[4], 'd', this.svgs.g2);
4980
5066
  }
4981
5067
 
4982
5068
  this.rSizeContent();
@@ -4992,7 +5078,7 @@
4992
5078
  this.h = this.baseH;
4993
5079
  this.s[0].height = this.h + 'px';
4994
5080
  this.s[2].display = 'none';
4995
- this.setSvg(this.c[4], 'd', this.svgs.arrow);
5081
+ this.setSvg(this.c[4], 'd', this.svgs.g1);
4996
5082
  this.zone.h = this.h;
4997
5083
  this.parentHeight(-t);
4998
5084
  } // -----
@@ -5019,7 +5105,7 @@
5019
5105
  s[2].left = d + 'px';
5020
5106
  s[3].width = w + 'px';
5021
5107
  s[3].left = d + 'px';
5022
- s[4].left = d + w - 17 + 'px';
5108
+ s[4].left = d + w - 15 + 'px';
5023
5109
  this.ww = w;
5024
5110
  if (this.max > this.maxHeight) this.ww = w - this.ss;
5025
5111
  if (this.isOpen) this.rSizeContent();
@@ -5331,12 +5417,16 @@
5331
5417
 
5332
5418
  rSize() {
5333
5419
  super.rSize();
5334
- let w = Math.floor((this.sb + 5) / this.lng) - 5;
5420
+ let sx = this.colors.sx;
5421
+ let ss = sx * (this.lng - 1);
5422
+ let w = (this.sb - ss) / this.lng; //(( this.sb + sx ) / this.lng )-sx
5423
+
5335
5424
  let s = this.s;
5336
5425
  let i = this.lng;
5337
5426
 
5338
5427
  while (i--) {
5339
- this.tmp[i] = [Math.floor(this.sa + w * i + 5 * i), w];
5428
+ //this.tmp[i] = [ Math.floor( this.sa + ( w * i )+( 5 * i )), w ];
5429
+ this.tmp[i] = [this.sa + w * i + sx * i, w];
5340
5430
  this.tmp[i][2] = this.tmp[i][0] + this.tmp[i][1];
5341
5431
  s[3 + i].left = this.tmp[i][0] + 'px';
5342
5432
  s[3 + i].width = this.tmp[i][1] + 'px';
@@ -5373,27 +5463,29 @@
5373
5463
  this.c[2].style.lineHeight = this.h - 10 + 'px';
5374
5464
 
5375
5465
  if (this.model !== 0) {
5376
- let h1 = 4,
5466
+ let r1 = 4,
5467
+ h1 = 4,
5377
5468
  h2 = 8,
5378
- ww = this.h - 4,
5379
- ra = 20;
5469
+ ww = this.h - 6,
5470
+ ra = 16;
5380
5471
 
5381
5472
  if (this.model === 2) {
5382
- h1 = 4; //2
5383
-
5384
- h2 = 8;
5473
+ r1 = 0;
5474
+ h1 = 2;
5475
+ h2 = 4;
5385
5476
  ra = 2;
5386
- ww = (this.h - 4) * 0.5;
5477
+ ww = (this.h - 6) * 0.5;
5387
5478
  }
5388
5479
 
5389
5480
  if (this.model === 3) this.c[5].style.visible = 'none';
5390
- this.c[4].style.borderRadius = h1 + 'px';
5481
+ this.c[4].style.borderRadius = r1 + 'px';
5391
5482
  this.c[4].style.height = h2 + 'px';
5392
5483
  this.c[4].style.top = this.h * 0.5 - h1 + 'px';
5393
- this.c[5].style.borderRadius = h1 * 0.5 + 'px';
5484
+ this.c[5].style.borderRadius = r1 * 0.5 + 'px';
5394
5485
  this.c[5].style.height = h1 + 'px';
5395
- this.c[5].style.top = this.h * 0.5 - h1 * 0.5 + 'px';
5396
- 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;');
5486
+ 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;' );
5487
+
5488
+ 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;');
5397
5489
  }
5398
5490
 
5399
5491
  this.init();
@@ -5506,6 +5598,8 @@
5506
5598
  s[2].color = cc.text;
5507
5599
  s[4].background = cc.back;
5508
5600
  s[5].background = cc.text;
5601
+ if (this.model !== 0) s[6].background = cc.text; //cc.button;
5602
+
5509
5603
  break;
5510
5604
 
5511
5605
  case 1:
@@ -5514,17 +5608,9 @@
5514
5608
  s[2].color = cc.textOver;
5515
5609
  s[4].background = cc.back;
5516
5610
  s[5].background = cc.textOver;
5517
- break;
5611
+ if (this.model !== 0) s[6].background = cc.textOver; //cc.overoff;
5518
5612
 
5519
- /* case 2:
5520
- s[2].border = '1px solid ' + this.colors.borderSelect;
5521
- break;
5522
- case 3:
5523
- s[2].border = '1px dashed ' + this.colors.text;//this.colors.borderSelect;
5524
- break;
5525
- case 4:
5526
- s[2].border = '1px dashed ' + this.colors.hide;
5527
- break;*/
5613
+ break;
5528
5614
  }
5529
5615
  }
5530
5616
 
@@ -5943,8 +6029,7 @@
5943
6029
 
5944
6030
  mousemove(e) {
5945
6031
  let up = false;
5946
- let name = this.testZone(e); //let sel = false;
5947
- //console.log(name)
6032
+ let name = this.testZone(e);
5948
6033
 
5949
6034
  if (name === 'over') {
5950
6035
  this.cursor('pointer');
@@ -5977,7 +6062,7 @@
5977
6062
 
5978
6063
  if (this.img !== null) {
5979
6064
  if (this.objectLink !== null) this.objectLink[this.val] = v;
5980
- if (this.callback) this.callback(v, this.img, this.name);
6065
+ if (this.callback) this.callback(this.value, this.img, this.name);
5981
6066
  }
5982
6067
  }
5983
6068
 
@@ -5993,12 +6078,6 @@
5993
6078
  let cc = this.colors;
5994
6079
 
5995
6080
  if (this.stat !== n) {
5996
- /*if( n===1 ) this.isActif = false
5997
- if( n===3 ){
5998
- if( !this.isActif ){ this.isActif = true; n=4; this.onActif( this ); }
5999
- else { this.isActif = false; }
6000
- }
6001
- if( n===2 && this.isActif ) n = 4;*/
6002
6081
  this.stat = n;
6003
6082
 
6004
6083
  switch (n) {
@@ -6635,7 +6714,7 @@
6635
6714
  o = a[2];
6636
6715
  o.name = a[1];
6637
6716
 
6638
- if (type === 'list') {
6717
+ if (type === 'list' && !o.list) {
6639
6718
  o.list = a[0][a[1]];
6640
6719
  } else o.value = a[0][a[1]];
6641
6720
  }
@@ -7322,7 +7401,7 @@
7322
7401
 
7323
7402
  }
7324
7403
 
7325
- const REVISION = '4.2.0';
7404
+ const REVISION = '4.2.3';
7326
7405
 
7327
7406
  exports.Files = Files;
7328
7407
  exports.Gui = Gui;