uil 4.1.0 → 4.2.2
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/README.md +1 -1
- package/build/uil.js +433 -141
- package/build/uil.min.js +1 -1
- package/build/uil.module.js +463 -131
- package/package.json +1 -1
package/build/uil.js
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
wlock: false,
|
|
22
22
|
current: -1,
|
|
23
23
|
needReZone: true,
|
|
24
|
+
needResize: false,
|
|
24
25
|
isEventsInit: false,
|
|
25
26
|
isLeave: false,
|
|
26
27
|
downTime: 0,
|
|
@@ -133,7 +134,6 @@
|
|
|
133
134
|
R.isEventsInit = false;
|
|
134
135
|
},
|
|
135
136
|
resize: function () {
|
|
136
|
-
R.needReZone = true;
|
|
137
137
|
let i = R.ui.length,
|
|
138
138
|
u;
|
|
139
139
|
|
|
@@ -141,6 +141,9 @@
|
|
|
141
141
|
u = R.ui[i];
|
|
142
142
|
if (u.isGui && !u.isCanvasOnly && u.autoResize) u.calc();
|
|
143
143
|
}
|
|
144
|
+
|
|
145
|
+
R.needReZone = true;
|
|
146
|
+
R.needResize = false;
|
|
144
147
|
},
|
|
145
148
|
out: function () {
|
|
146
149
|
console.log('im am out');
|
|
@@ -160,6 +163,7 @@
|
|
|
160
163
|
handleEvent: function (event) {
|
|
161
164
|
//if(!event.type) return;
|
|
162
165
|
if (R.prevDefault.indexOf(event.type) !== -1) event.preventDefault();
|
|
166
|
+
if (R.needResize) R.resize();
|
|
163
167
|
R.findZone();
|
|
164
168
|
let e = R.e;
|
|
165
169
|
let leave = false;
|
|
@@ -720,8 +724,8 @@
|
|
|
720
724
|
|
|
721
725
|
if (o.fontSelect) color.textSelect = o.fontSelect;
|
|
722
726
|
if (o.groupBorder) color.gborder = o.groupBorder;
|
|
723
|
-
if (o.transparent) o.bg = 'none';
|
|
724
|
-
|
|
727
|
+
if (o.transparent) o.bg = 'none'; //if( o.bg ) color.background = color.backgroundOver = o.bg
|
|
728
|
+
|
|
725
729
|
if (o.bgOver) color.backgroundOver = o.bgOver;
|
|
726
730
|
|
|
727
731
|
for (let m in color) {
|
|
@@ -736,6 +740,8 @@
|
|
|
736
740
|
return color;
|
|
737
741
|
},
|
|
738
742
|
colors: {
|
|
743
|
+
sx: 3,
|
|
744
|
+
sy: 3,
|
|
739
745
|
content: 'none',
|
|
740
746
|
background: 'rgba(50,50,50,0.3)',
|
|
741
747
|
backgroundOver: 'rgba(50,50,50,0.4)',
|
|
@@ -753,24 +759,28 @@
|
|
|
753
759
|
border: '#4c4c4c',
|
|
754
760
|
borderSize: 1,
|
|
755
761
|
gborder: 'none',
|
|
762
|
+
groups: 'none',
|
|
756
763
|
button: '#3c3c3c',
|
|
757
764
|
overoff: '#5c5c5c',
|
|
758
765
|
over: '#024699',
|
|
759
766
|
select: '#308AFF',
|
|
760
767
|
action: '#FF3300',
|
|
761
768
|
//fontFamily: 'Tahoma',
|
|
762
|
-
fontFamily: 'Consolas,
|
|
769
|
+
fontFamily: 'Consolas, monospace',
|
|
770
|
+
//fontFamily: "'Roboto Mono', 'Source Code Pro', Menlo, Courier, monospace",
|
|
763
771
|
fontWeight: 'normal',
|
|
764
|
-
fontShadow: '
|
|
772
|
+
fontShadow: 'none',
|
|
773
|
+
//'#000',
|
|
765
774
|
fontSize: 12,
|
|
766
|
-
radius:
|
|
775
|
+
radius: 3,
|
|
767
776
|
hide: 'rgba(0,0,0,0)'
|
|
768
777
|
},
|
|
769
778
|
// style css
|
|
770
779
|
css: {
|
|
771
780
|
//unselect: '-o-user-select:none; -ms-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -moz-user-select:none;',
|
|
772
781
|
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;',
|
|
773
|
-
button: 'display:flex; justify-content:center; align-items:center; text-align:center;'
|
|
782
|
+
button: 'display:flex; justify-content:center; align-items:center; text-align:center;',
|
|
783
|
+
middle: 'display:flex; align-items:center;'
|
|
774
784
|
/*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;',
|
|
775
785
|
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+';',
|
|
776
786
|
item: T.css.txt + 'position:relative; background:rgba(0,0,0,0.2); margin-bottom:1px;',*/
|
|
@@ -778,6 +788,8 @@
|
|
|
778
788
|
},
|
|
779
789
|
// svg path
|
|
780
790
|
svgs: {
|
|
791
|
+
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',
|
|
792
|
+
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',
|
|
781
793
|
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',
|
|
782
794
|
arrow: 'M 3 8 L 8 5 3 2 3 8 Z',
|
|
783
795
|
arrowDown: 'M 5 8 L 8 3 2 3 5 8 Z',
|
|
@@ -796,8 +808,14 @@
|
|
|
796
808
|
texture: 'M 13 4 L 13 1 1 1 1 4 5 4 5 13 9 13 9 4 13 4 Z',
|
|
797
809
|
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',
|
|
798
810
|
none: 'M 9 5 L 5 5 5 9 9 9 9 5 Z',
|
|
799
|
-
cursor: 'M 4 7 L 1 10 1 12 2 13 4 13 7 10 9 14 14 0 0 5 4 7 Z'
|
|
811
|
+
cursor: 'M 4 7 L 1 10 1 12 2 13 4 13 7 10 9 14 14 0 0 5 4 7 Z',
|
|
812
|
+
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'
|
|
800
813
|
},
|
|
814
|
+
|
|
815
|
+
rezone() {
|
|
816
|
+
Roots.needReZone = true;
|
|
817
|
+
},
|
|
818
|
+
|
|
801
819
|
getImput: function () {
|
|
802
820
|
return Roots.input ? true : false;
|
|
803
821
|
},
|
|
@@ -821,12 +839,18 @@
|
|
|
821
839
|
if (shadow === undefined) shadow = cc.fontShadow;
|
|
822
840
|
if (weight === undefined) weight = cc.fontWeight;
|
|
823
841
|
if (color === undefined) color = cc.text;
|
|
842
|
+
|
|
843
|
+
if (isNaN(size)) {
|
|
844
|
+
if (size.search('em') === -1) size += 'px';
|
|
845
|
+
} else size += 'px';
|
|
846
|
+
|
|
824
847
|
let align = 'display:flex; justify-content:left; align-items:center; text-align:left;';
|
|
825
|
-
T.css.txt = T.css.basic + align + 'font-family:' + font + '; font-weight:' + weight + '; font-size:' + size + '
|
|
848
|
+
T.css.txt = T.css.basic + align + ' 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;';
|
|
826
849
|
if (shadow !== 'none') T.css.txt += ' text-shadow: 1px 1px 1px ' + shadow + ';';
|
|
827
850
|
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;';//
|
|
828
851
|
|
|
829
852
|
T.css.item = T.css.txt + ' position:relative; margin-bottom:1px; display:block; padding:2px 4px;'; //
|
|
853
|
+
//console.log( T.css.txt )
|
|
830
854
|
},
|
|
831
855
|
// note
|
|
832
856
|
//https://developer.mozilla.org/fr/docs/Web/CSS/css_flexible_box_layout/aligning_items_in_a_flex_container
|
|
@@ -1580,6 +1604,40 @@
|
|
|
1580
1604
|
}];
|
|
1581
1605
|
break;
|
|
1582
1606
|
|
|
1607
|
+
case 'wav':
|
|
1608
|
+
t = [{
|
|
1609
|
+
accept: {
|
|
1610
|
+
'audio/wav': '.wav'
|
|
1611
|
+
}
|
|
1612
|
+
}];
|
|
1613
|
+
break;
|
|
1614
|
+
|
|
1615
|
+
case 'mp3':
|
|
1616
|
+
t = [{
|
|
1617
|
+
accept: {
|
|
1618
|
+
'audio/mpeg': '.mp3'
|
|
1619
|
+
}
|
|
1620
|
+
}];
|
|
1621
|
+
break;
|
|
1622
|
+
|
|
1623
|
+
case 'mp4':
|
|
1624
|
+
t = [{
|
|
1625
|
+
accept: {
|
|
1626
|
+
'video/mp4': '.mp4'
|
|
1627
|
+
}
|
|
1628
|
+
}];
|
|
1629
|
+
break;
|
|
1630
|
+
|
|
1631
|
+
case 'bin':
|
|
1632
|
+
case 'hex':
|
|
1633
|
+
t = [{
|
|
1634
|
+
description: 'Binary Files',
|
|
1635
|
+
accept: {
|
|
1636
|
+
'application/octet-stream': ['.bin', '.hex']
|
|
1637
|
+
}
|
|
1638
|
+
}];
|
|
1639
|
+
break;
|
|
1640
|
+
|
|
1583
1641
|
case 'text':
|
|
1584
1642
|
t = [{
|
|
1585
1643
|
description: 'Text Files',
|
|
@@ -1594,7 +1652,17 @@
|
|
|
1594
1652
|
t = [{
|
|
1595
1653
|
description: 'JSON Files',
|
|
1596
1654
|
accept: {
|
|
1597
|
-
'
|
|
1655
|
+
'application/json': ['.json']
|
|
1656
|
+
}
|
|
1657
|
+
}]; //text/plain
|
|
1658
|
+
|
|
1659
|
+
break;
|
|
1660
|
+
|
|
1661
|
+
case 'js':
|
|
1662
|
+
t = [{
|
|
1663
|
+
description: 'JavaScript Files',
|
|
1664
|
+
accept: {
|
|
1665
|
+
'text/javascript': ['.js']
|
|
1598
1666
|
}
|
|
1599
1667
|
}];
|
|
1600
1668
|
break;
|
|
@@ -1665,6 +1733,7 @@
|
|
|
1665
1733
|
};
|
|
1666
1734
|
} catch (e) {
|
|
1667
1735
|
console.log(e);
|
|
1736
|
+
if (o.callback) o.callback(null);
|
|
1668
1737
|
}
|
|
1669
1738
|
}
|
|
1670
1739
|
|
|
@@ -1900,7 +1969,7 @@
|
|
|
1900
1969
|
this.fw = o.fw || 0;
|
|
1901
1970
|
this.autoWidth = o.auto || true; // auto width or flex
|
|
1902
1971
|
|
|
1903
|
-
this.isOpen = false; // open statu
|
|
1972
|
+
this.isOpen = false; //false// open statu
|
|
1904
1973
|
// radius for toolbox
|
|
1905
1974
|
|
|
1906
1975
|
this.radius = o.radius || this.colors.radius;
|
|
@@ -1927,7 +1996,7 @@
|
|
|
1927
1996
|
|
|
1928
1997
|
this.objectLink = null;
|
|
1929
1998
|
this.isSend = false;
|
|
1930
|
-
this.
|
|
1999
|
+
this.objectKey = null;
|
|
1931
2000
|
this.txt = o.name || '';
|
|
1932
2001
|
this.name = o.rename || this.txt;
|
|
1933
2002
|
this.target = o.target || null; // callback
|
|
@@ -1959,13 +2028,14 @@
|
|
|
1959
2028
|
this.s[0].borderTop = this.margin * 0.5 + 'px solid transparent';
|
|
1960
2029
|
this.s[0].borderBottom = this.margin * 0.5 + 'px solid transparent';
|
|
1961
2030
|
} else {
|
|
2031
|
+
//this.s[0].borderTop = (this.margin*0.5) + 'px solid transparent'
|
|
1962
2032
|
this.s[0].borderBottom = this.margin + 'px solid transparent';
|
|
1963
2033
|
}
|
|
1964
2034
|
} // with title
|
|
1965
2035
|
|
|
1966
2036
|
|
|
1967
2037
|
if (!this.simple) {
|
|
1968
|
-
this.c[1] = Tools.dom('div', this.css.txt);
|
|
2038
|
+
this.c[1] = Tools.dom('div', this.css.txt + this.css.middle);
|
|
1969
2039
|
this.s[1] = this.c[1].style;
|
|
1970
2040
|
this.c[1].textContent = this.name;
|
|
1971
2041
|
this.s[1].color = this.lock ? this.colors.titleoff : this.colors.title;
|
|
@@ -2008,8 +2078,9 @@
|
|
|
2008
2078
|
|
|
2009
2079
|
if (c[1] !== undefined && this.autoWidth) {
|
|
2010
2080
|
s[1] = c[1].style;
|
|
2011
|
-
s[1].
|
|
2012
|
-
s[1].
|
|
2081
|
+
s[1].top = 1 + 'px';
|
|
2082
|
+
s[1].height = this.h - 2 + 'px'; //s[1].height = (this.h-4) + 'px';
|
|
2083
|
+
// s[1].lineHeight = (this.h-8) + 'px';
|
|
2013
2084
|
}
|
|
2014
2085
|
|
|
2015
2086
|
let frag = Tools.frag;
|
|
@@ -2030,7 +2101,9 @@
|
|
|
2030
2101
|
this.c[0].style.pointerEvents = 'auto';
|
|
2031
2102
|
Roots.add(this);
|
|
2032
2103
|
}
|
|
2104
|
+
}
|
|
2033
2105
|
|
|
2106
|
+
addTransition() {
|
|
2034
2107
|
if (this.baseH && this.transition && this.isUI) {
|
|
2035
2108
|
this.c[0].style.transition = 'height ' + this.transition + 's ease-out';
|
|
2036
2109
|
}
|
|
@@ -2116,7 +2189,7 @@
|
|
|
2116
2189
|
if (this.objectLink === null) return;
|
|
2117
2190
|
if (this.isSend) return;
|
|
2118
2191
|
if (this.isEdit) return;
|
|
2119
|
-
this.setValue(this.objectLink[this.
|
|
2192
|
+
this.setValue(this.objectLink[this.objectKey]);
|
|
2120
2193
|
}
|
|
2121
2194
|
|
|
2122
2195
|
setValue(v) {
|
|
@@ -2164,8 +2237,8 @@
|
|
|
2164
2237
|
v = v || this.value;
|
|
2165
2238
|
if (v instanceof Array && v.length === 1) v = v[0];
|
|
2166
2239
|
this.isSend = true;
|
|
2167
|
-
if (this.objectLink !== null) this.objectLink[this.
|
|
2168
|
-
if (this.callback) this.callback(v, this.
|
|
2240
|
+
if (this.objectLink !== null) this.objectLink[this.objectKey] = v;
|
|
2241
|
+
if (this.callback) this.callback(v, this.objectKey);
|
|
2169
2242
|
this.isSend = false;
|
|
2170
2243
|
}
|
|
2171
2244
|
|
|
@@ -2173,7 +2246,7 @@
|
|
|
2173
2246
|
v = v || this.value;
|
|
2174
2247
|
if (v instanceof Array && v.length === 1) v = v[0];
|
|
2175
2248
|
if (this.endCallback) this.endCallback(v);
|
|
2176
|
-
if (this.objectLink !== null) this.objectLink[this.
|
|
2249
|
+
if (this.objectLink !== null) this.objectLink[this.objectKey] = v;
|
|
2177
2250
|
} // ----------------------
|
|
2178
2251
|
// clear node
|
|
2179
2252
|
// ----------------------
|
|
@@ -2214,9 +2287,11 @@
|
|
|
2214
2287
|
if (this.simple) {
|
|
2215
2288
|
this.sb = this.w - this.sa;
|
|
2216
2289
|
} else {
|
|
2217
|
-
let pp = this.w * (this.p / 100);
|
|
2218
|
-
this.
|
|
2219
|
-
|
|
2290
|
+
let pp = this.w * (this.p / 100); //this.sa = Math.floor( pp + 10 )
|
|
2291
|
+
//this.sb = Math.floor( this.w - pp - 20 )
|
|
2292
|
+
|
|
2293
|
+
this.sa = Math.floor(pp + 8);
|
|
2294
|
+
this.sb = Math.floor(this.w - pp - 16);
|
|
2220
2295
|
}
|
|
2221
2296
|
}
|
|
2222
2297
|
|
|
@@ -2315,9 +2390,9 @@
|
|
|
2315
2390
|
// ----------------------
|
|
2316
2391
|
|
|
2317
2392
|
|
|
2318
|
-
setReferency(obj,
|
|
2393
|
+
setReferency(obj, key) {
|
|
2319
2394
|
this.objectLink = obj;
|
|
2320
|
-
this.
|
|
2395
|
+
this.objectKey = key;
|
|
2321
2396
|
}
|
|
2322
2397
|
|
|
2323
2398
|
display(v = false) {
|
|
@@ -2330,12 +2405,14 @@
|
|
|
2330
2405
|
open() {
|
|
2331
2406
|
if (this.isOpen) return;
|
|
2332
2407
|
this.isOpen = true;
|
|
2408
|
+
Roots.needResize = true;
|
|
2333
2409
|
if (this.openCallback) this.openCallback();
|
|
2334
2410
|
}
|
|
2335
2411
|
|
|
2336
2412
|
close() {
|
|
2337
2413
|
if (!this.isOpen) return;
|
|
2338
2414
|
this.isOpen = false;
|
|
2415
|
+
Roots.needResize = true;
|
|
2339
2416
|
if (this.closeCallback) this.closeCallback();
|
|
2340
2417
|
}
|
|
2341
2418
|
|
|
@@ -2522,6 +2599,7 @@
|
|
|
2522
2599
|
this.value = o.value || '';
|
|
2523
2600
|
this.values = o.value || this.txt;
|
|
2524
2601
|
if (o.values) this.values = o.values;
|
|
2602
|
+
if (!o.values && !o.value) this.txt = '';
|
|
2525
2603
|
this.onName = o.onName || null;
|
|
2526
2604
|
this.on = false; // force button width
|
|
2527
2605
|
|
|
@@ -2550,12 +2628,11 @@
|
|
|
2550
2628
|
|
|
2551
2629
|
if (!o.value && !o.values) {
|
|
2552
2630
|
if (this.c[1] !== undefined) {
|
|
2553
|
-
this.c[1].textContent = '';
|
|
2554
|
-
this.txt = '';
|
|
2631
|
+
this.c[1].textContent = ''; //this.txt = ''
|
|
2555
2632
|
}
|
|
2556
2633
|
}
|
|
2557
2634
|
|
|
2558
|
-
if (
|
|
2635
|
+
if (this.txt === '') this.p = 0;
|
|
2559
2636
|
this.init();
|
|
2560
2637
|
}
|
|
2561
2638
|
|
|
@@ -2701,16 +2778,20 @@
|
|
|
2701
2778
|
let w = this.sb;
|
|
2702
2779
|
let d = this.sa;
|
|
2703
2780
|
let i = this.lng;
|
|
2704
|
-
let
|
|
2705
|
-
let size = Math.floor((w
|
|
2781
|
+
let sx = this.colors.sx; //this.space;
|
|
2782
|
+
//let size = Math.floor( ( w-(dc*(i-1)) ) / i );
|
|
2783
|
+
|
|
2784
|
+
let size = (w - sx * (i - 1)) / i;
|
|
2706
2785
|
|
|
2707
2786
|
if (this.bw) {
|
|
2708
|
-
size = this.bw < size ? this.bw : size;
|
|
2709
|
-
|
|
2787
|
+
size = this.bw < size ? this.bw : size; //d = Math.floor((this.w-( (size * i) + (dc * (i-1)) ))*0.5)
|
|
2788
|
+
|
|
2789
|
+
d = (this.w - (size * i + sx * (i - 1))) * 0.5;
|
|
2710
2790
|
}
|
|
2711
2791
|
|
|
2712
2792
|
while (i--) {
|
|
2713
|
-
this.tmp[i] = [Math.floor(d + size * i + dc * i), size];
|
|
2793
|
+
//this.tmp[i] = [ Math.floor( d + ( size * i ) + ( dc * i )), size ];
|
|
2794
|
+
this.tmp[i] = [d + size * i + sx * i, size];
|
|
2714
2795
|
this.tmp[i][2] = this.tmp[i][0] + this.tmp[i][1];
|
|
2715
2796
|
s[i + 2].left = this.tmp[i][0] + 'px';
|
|
2716
2797
|
s[i + 2].width = this.tmp[i][1] + 'px';
|
|
@@ -3230,11 +3311,13 @@
|
|
|
3230
3311
|
this.txt = o.name || 'Fps';
|
|
3231
3312
|
}
|
|
3232
3313
|
|
|
3233
|
-
let fltop = Math.floor(this.h * 0.5) -
|
|
3234
|
-
|
|
3314
|
+
let fltop = Math.floor(this.h * 0.5) - 3;
|
|
3315
|
+
const ccc = this.colors;
|
|
3316
|
+
this.c[1].textContent = this.txt; //this.c[1].innerHTML = ' ' + this.txt
|
|
3317
|
+
|
|
3235
3318
|
this.c[0].style.cursor = 'pointer';
|
|
3236
3319
|
this.c[0].style.pointerEvents = 'auto';
|
|
3237
|
-
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 ' +
|
|
3320
|
+
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 + ';';
|
|
3238
3321
|
if (this.radius !== 0) panelCss += 'border-radius:' + this.radius + 'px;';
|
|
3239
3322
|
this.c[2] = this.dom('path', this.css.basic + panelCss, {});
|
|
3240
3323
|
this.c[2].setAttribute('viewBox', '0 0 ' + this.res + ' 50');
|
|
@@ -3244,23 +3327,25 @@
|
|
|
3244
3327
|
//this.dom( 'path', null, { fill:'rgba(0,255,255,0.3)', 'stroke-width':1, stroke:'#0FF', 'vector-effect':'non-scaling-stroke' }, this.c[2] );
|
|
3245
3328
|
// arrow
|
|
3246
3329
|
|
|
3247
|
-
this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:
|
|
3248
|
-
d: this.svgs.
|
|
3249
|
-
fill:
|
|
3330
|
+
this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:6px; height:6px; left:0; top:' + fltop + 'px;', {
|
|
3331
|
+
d: this.svgs.g1,
|
|
3332
|
+
fill: ccc.text,
|
|
3250
3333
|
stroke: 'none'
|
|
3251
|
-
}); //
|
|
3334
|
+
}); //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'});
|
|
3335
|
+
// result test
|
|
3252
3336
|
|
|
3253
3337
|
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
|
|
3254
3338
|
|
|
3255
3339
|
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);');
|
|
3256
3340
|
this.isShow = false;
|
|
3257
|
-
let s = this.s;
|
|
3258
|
-
|
|
3341
|
+
let s = this.s; //s[1].marginLeft = '10px';
|
|
3342
|
+
|
|
3259
3343
|
s[1].lineHeight = this.h - 4;
|
|
3260
|
-
s[1].color =
|
|
3261
|
-
s[1].fontWeight = 'bold';
|
|
3344
|
+
s[1].color = ccc.text; //s[1].paddingLeft = '18px';
|
|
3345
|
+
//s[1].fontWeight = 'bold';
|
|
3346
|
+
|
|
3262
3347
|
if (this.radius !== 0) s[0].borderRadius = this.radius + 'px';
|
|
3263
|
-
if (this.colors.gborder !== 'none') s[0].border = '1px solid ' +
|
|
3348
|
+
if (this.colors.gborder !== 'none') s[0].border = '1px solid ' + ccc.gborder;
|
|
3264
3349
|
let j = 0;
|
|
3265
3350
|
|
|
3266
3351
|
for (j = 0; j < this.names.length; j++) {
|
|
@@ -3364,7 +3449,7 @@
|
|
|
3364
3449
|
open() {
|
|
3365
3450
|
super.open();
|
|
3366
3451
|
this.h = this.hplus + this.baseH;
|
|
3367
|
-
this.setSvg(this.c[3], 'd', this.svgs.
|
|
3452
|
+
this.setSvg(this.c[3], 'd', this.svgs.g2);
|
|
3368
3453
|
|
|
3369
3454
|
if (this.group !== null) {
|
|
3370
3455
|
this.group.calc(this.hplus);
|
|
@@ -3380,7 +3465,7 @@
|
|
|
3380
3465
|
close() {
|
|
3381
3466
|
super.close();
|
|
3382
3467
|
this.h = this.baseH;
|
|
3383
|
-
this.setSvg(this.c[3], 'd', this.svgs.
|
|
3468
|
+
this.setSvg(this.c[3], 'd', this.svgs.g1);
|
|
3384
3469
|
|
|
3385
3470
|
if (this.group !== null) {
|
|
3386
3471
|
this.group.calc(-this.hplus);
|
|
@@ -3430,6 +3515,7 @@
|
|
|
3430
3515
|
rSize() {
|
|
3431
3516
|
let s = this.s;
|
|
3432
3517
|
let w = this.w;
|
|
3518
|
+
s[3].left = this.sa + this.sb - 6 + 'px';
|
|
3433
3519
|
s[0].width = w + 'px';
|
|
3434
3520
|
s[1].width = w + 'px';
|
|
3435
3521
|
s[2].left = 10 + 'px';
|
|
@@ -3725,45 +3811,65 @@
|
|
|
3725
3811
|
this.current = -1;
|
|
3726
3812
|
this.proto = null;
|
|
3727
3813
|
this.isEmpty = true;
|
|
3728
|
-
this.decal = 0;
|
|
3814
|
+
this.decal = o.group ? 8 : 0;
|
|
3729
3815
|
this.baseH = this.h;
|
|
3730
|
-
let fltop = Math.floor(this.h * 0.5) -
|
|
3816
|
+
let fltop = Math.floor(this.h * 0.5) - 3;
|
|
3817
|
+
const cc = this.colors;
|
|
3731
3818
|
this.isLine = o.line !== undefined ? o.line : false;
|
|
3732
|
-
this.decal = 0;
|
|
3733
|
-
|
|
3734
|
-
if (o.group) {
|
|
3735
|
-
this.decal = o.group.decal ? o.group.decal : 0;
|
|
3736
|
-
this.decal += 6;
|
|
3737
|
-
}
|
|
3738
|
-
|
|
3739
3819
|
this.useFlex = true;
|
|
3740
3820
|
let flexible = this.useFlex ? 'display:flex; flex-flow: row wrap;' : '';
|
|
3741
|
-
this.c[2] = this.dom('div', this.css.basic + flexible + 'width:100%; left:0; height:auto; overflow:hidden; top:' + this.h + 'px');
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
fill: this.colors.text,
|
|
3746
|
-
stroke: 'none'
|
|
3747
|
-
});
|
|
3748
|
-
this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:10px; height:10px; left:' + (4 + this.decal) + 'px; top:' + fltop + 'px;', {
|
|
3749
|
-
d: this.svgs.arrow,
|
|
3750
|
-
fill: this.colors.text,
|
|
3821
|
+
this.c[2] = this.dom('div', this.css.basic + flexible + 'width:100%; left:0; height:auto; overflow:hidden; top:' + (this.h - 1) + 'px');
|
|
3822
|
+
this.c[3] = this.dom('path', this.css.basic + 'position:absolute; width:6px; height:6px; left:0; top:' + fltop + 'px;', {
|
|
3823
|
+
d: this.svgs.g1,
|
|
3824
|
+
fill: cc.text,
|
|
3751
3825
|
stroke: 'none'
|
|
3752
|
-
}); //
|
|
3826
|
+
}); //this.c[3] = this.dom( 'path', this.css.basic + 'position:absolute; width:10px; height:10px; left:0; top:'+fltop+'px;', { d:this.svgs.group, fill:cc.text, stroke:'none'})
|
|
3827
|
+
//this.c[3] = this.dom( 'path', this.css.basic + 'position:absolute; width:10px; height:10px; left:0; top:'+fltop+'px;', { d:this.svgs.group, fill:cc.text, stroke:'none'})
|
|
3828
|
+
//this.c[4] = this.dom( 'path', this.css.basic + 'position:absolute; width:10px; height:10px; left:'+(this.decal-1)+'px; top:'+fltop+'px;', { d:this.svgs.arrow, fill:cc.text, stroke:'none'})
|
|
3829
|
+
// bottom line
|
|
3830
|
+
|
|
3831
|
+
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'); //else this.c[5] = this.dom( 'div', this.css.basic + 'width:100%; left:0; height:auto; top:'+(this.h-1)+'px')
|
|
3753
3832
|
|
|
3754
|
-
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');
|
|
3755
3833
|
let s = this.s;
|
|
3756
3834
|
s[0].height = this.h + 'px';
|
|
3757
|
-
s[1].height = this.h + 'px';
|
|
3758
3835
|
this.c[1].name = 'group';
|
|
3759
|
-
|
|
3836
|
+
|
|
3837
|
+
if (cc.groups !== 'none') {
|
|
3838
|
+
s[1].background = cc.groups;
|
|
3839
|
+
s[1].border = cc.borderSize + 'px solid ' + cc.border;
|
|
3840
|
+
s[1].borderRadius = this.radius + 'px'; //s[5].border = '2px solid ' + '#000'
|
|
3841
|
+
//s[1].marginRight = 10+'px';
|
|
3842
|
+
} //this.c[1].innerHTML = this.dd + this.name
|
|
3843
|
+
//s[1].padding = '0px ' + (10+this.decal)+'px';
|
|
3844
|
+
|
|
3845
|
+
|
|
3760
3846
|
s[1].lineHeight = this.h - 4;
|
|
3761
|
-
s[1].color =
|
|
3762
|
-
|
|
3763
|
-
if (this.radius !== 0) s[0].borderRadius = this.radius + 'px';
|
|
3847
|
+
s[1].color = cc.text; //s[1].fontWeight = 'bold';
|
|
3848
|
+
|
|
3764
3849
|
this.init();
|
|
3850
|
+
|
|
3851
|
+
if (this.radius !== 0) {
|
|
3852
|
+
//s[0].borderRadius = this.radius+'px'
|
|
3853
|
+
s[1].borderRadius = this.radius + 'px';
|
|
3854
|
+
s[2].borderRadius = this.radius + 'px';
|
|
3855
|
+
} //s[1].paddingLeft = (10+this.decal)+'px'
|
|
3856
|
+
|
|
3857
|
+
|
|
3765
3858
|
this.setBG(o.bg);
|
|
3766
|
-
if (o.open
|
|
3859
|
+
if (o.open) this.open();
|
|
3860
|
+
}
|
|
3861
|
+
|
|
3862
|
+
setBG(bg) {
|
|
3863
|
+
this.colors;
|
|
3864
|
+
const s = this.s; //if( bg !== undefined ) this.colors.background = bg
|
|
3865
|
+
//this.c[0].style.background = this.colors.background;
|
|
3866
|
+
|
|
3867
|
+
s[1].background = bg; //this.colors.background
|
|
3868
|
+
|
|
3869
|
+
s[2].background = bg; //s[5].border = '1px solid ' + '#000'
|
|
3870
|
+
// s[5].background = '#000'
|
|
3871
|
+
|
|
3872
|
+
this.uis.length;
|
|
3767
3873
|
}
|
|
3768
3874
|
|
|
3769
3875
|
testZone(e) {
|
|
@@ -3843,16 +3949,6 @@
|
|
|
3843
3949
|
} // ----------------------
|
|
3844
3950
|
|
|
3845
3951
|
|
|
3846
|
-
setBG(bg) {
|
|
3847
|
-
if (bg !== undefined) this.colors.background = bg;
|
|
3848
|
-
this.c[0].style.background = this.colors.background;
|
|
3849
|
-
let i = this.uis.length;
|
|
3850
|
-
|
|
3851
|
-
while (i--) {
|
|
3852
|
-
this.uis[i].setBG(this.colors.background);
|
|
3853
|
-
}
|
|
3854
|
-
}
|
|
3855
|
-
|
|
3856
3952
|
add() {
|
|
3857
3953
|
let a = arguments;
|
|
3858
3954
|
|
|
@@ -3929,18 +4025,33 @@
|
|
|
3929
4025
|
|
|
3930
4026
|
open() {
|
|
3931
4027
|
super.open();
|
|
3932
|
-
this.setSvg(this.c[4], 'd', this.svgs.arrowDown)
|
|
4028
|
+
this.setSvg(this.c[3], 'd', this.svgs.g2); //this.setSvg( this.c[4], 'd', this.svgs.arrowDown )
|
|
4029
|
+
|
|
3933
4030
|
this.rSizeContent();
|
|
3934
4031
|
this.h - this.baseH;
|
|
4032
|
+
const s = this.s;
|
|
4033
|
+
|
|
4034
|
+
if (this.radius) {
|
|
4035
|
+
s[1].borderRadius = '0px';
|
|
4036
|
+
s[2].borderRadius = '0px';
|
|
4037
|
+
s[1].borderTopLeftRadius = this.radius + 'px';
|
|
4038
|
+
s[1].borderTopRightRadius = this.radius + 'px';
|
|
4039
|
+
s[2].borderBottomLeftRadius = this.radius + 'px';
|
|
4040
|
+
s[2].borderBottomRightRadius = this.radius + 'px';
|
|
4041
|
+
}
|
|
4042
|
+
|
|
3935
4043
|
this.parentHeight();
|
|
3936
4044
|
}
|
|
3937
4045
|
|
|
3938
4046
|
close() {
|
|
3939
4047
|
super.close();
|
|
3940
4048
|
this.h - this.baseH;
|
|
3941
|
-
this.setSvg(this.c[4], 'd', this.svgs.arrow)
|
|
4049
|
+
this.setSvg(this.c[3], 'd', this.svgs.g1); //this.setSvg( this.c[4], 'd', this.svgs.arrow )
|
|
4050
|
+
|
|
3942
4051
|
this.h = this.baseH;
|
|
3943
|
-
|
|
4052
|
+
const s = this.s;
|
|
4053
|
+
s[0].height = this.h + 'px';
|
|
4054
|
+
if (this.radius) s[1].borderRadius = this.radius + 'px';
|
|
3944
4055
|
this.parentHeight();
|
|
3945
4056
|
}
|
|
3946
4057
|
|
|
@@ -3971,9 +4082,15 @@
|
|
|
3971
4082
|
rSize() {
|
|
3972
4083
|
super.rSize();
|
|
3973
4084
|
let s = this.s;
|
|
3974
|
-
|
|
4085
|
+
this.w = this.w - this.decal;
|
|
4086
|
+
s[3].left = this.sa + this.sb - 6 + 'px'; //s[1].width = this.isbgGroup ? (this.w-5) + 'px' : this.w + 'px'
|
|
4087
|
+
|
|
3975
4088
|
s[1].width = this.w + 'px';
|
|
3976
|
-
s[2].width = this.w + 'px';
|
|
4089
|
+
s[2].width = this.w + 'px'; //s[1].width = (this.w - this.decal) + 'px'
|
|
4090
|
+
//s[2].width = (this.w - this.decal) + 'px'
|
|
4091
|
+
|
|
4092
|
+
s[1].left = this.decal + 'px';
|
|
4093
|
+
s[2].left = this.decal + 'px';
|
|
3977
4094
|
if (this.isOpen) this.rSizeContent();
|
|
3978
4095
|
}
|
|
3979
4096
|
|
|
@@ -4406,12 +4523,12 @@
|
|
|
4406
4523
|
if (o.select !== undefined) o.selectable = o.select;
|
|
4407
4524
|
if (o.selectable !== undefined) this.isSelectable = o.selectable;
|
|
4408
4525
|
if (this.txt === '') this.p = 0;
|
|
4409
|
-
let fltop = Math.floor(this.h * 0.5) -
|
|
4526
|
+
let fltop = Math.floor(this.h * 0.5) - 3;
|
|
4410
4527
|
let cc = this.colors;
|
|
4411
4528
|
this.c[2] = this.dom('div', this.css.basic + 'top:0; display:none; border-radius:' + this.radius + 'px;');
|
|
4412
4529
|
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;');
|
|
4413
|
-
this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:
|
|
4414
|
-
d: this.svgs.
|
|
4530
|
+
this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:6px; height:6px; top:' + fltop + 'px;', {
|
|
4531
|
+
d: this.svgs.g1,
|
|
4415
4532
|
fill: cc.text,
|
|
4416
4533
|
stroke: 'none'
|
|
4417
4534
|
});
|
|
@@ -4490,12 +4607,10 @@
|
|
|
4490
4607
|
this.dragstart = o.dragstart || null;
|
|
4491
4608
|
this.dragend = o.dragend || null; //this.c[0].style.background = '#FF0000'
|
|
4492
4609
|
|
|
4493
|
-
if (this.isWithImage) this.preloadImage();
|
|
4494
|
-
// populate list
|
|
4495
|
-
|
|
4610
|
+
if (this.isWithImage) this.preloadImage();
|
|
4496
4611
|
this.setList(this.list);
|
|
4497
4612
|
this.init();
|
|
4498
|
-
if (this.isOpenOnStart) this.open(true);
|
|
4613
|
+
if (this.isOpenOnStart) this.open(true);
|
|
4499
4614
|
}
|
|
4500
4615
|
/*send ( v ) {
|
|
4501
4616
|
super.send( v );
|
|
@@ -4960,9 +5075,9 @@
|
|
|
4960
5075
|
|
|
4961
5076
|
if (this.up) {
|
|
4962
5077
|
this.zone.y -= this.h - (this.baseH - 10);
|
|
4963
|
-
this.setSvg(this.c[4], 'd', this.svgs.
|
|
5078
|
+
this.setSvg(this.c[4], 'd', this.svgs.g1);
|
|
4964
5079
|
} else {
|
|
4965
|
-
this.setSvg(this.c[4], 'd', this.svgs.
|
|
5080
|
+
this.setSvg(this.c[4], 'd', this.svgs.g2);
|
|
4966
5081
|
}
|
|
4967
5082
|
|
|
4968
5083
|
this.rSizeContent();
|
|
@@ -4978,7 +5093,7 @@
|
|
|
4978
5093
|
this.h = this.baseH;
|
|
4979
5094
|
this.s[0].height = this.h + 'px';
|
|
4980
5095
|
this.s[2].display = 'none';
|
|
4981
|
-
this.setSvg(this.c[4], 'd', this.svgs.
|
|
5096
|
+
this.setSvg(this.c[4], 'd', this.svgs.g1);
|
|
4982
5097
|
this.zone.h = this.h;
|
|
4983
5098
|
this.parentHeight(-t);
|
|
4984
5099
|
} // -----
|
|
@@ -5005,7 +5120,7 @@
|
|
|
5005
5120
|
s[2].left = d + 'px';
|
|
5006
5121
|
s[3].width = w + 'px';
|
|
5007
5122
|
s[3].left = d + 'px';
|
|
5008
|
-
s[4].left = d + w -
|
|
5123
|
+
s[4].left = d + w - 15 + 'px';
|
|
5009
5124
|
this.ww = w;
|
|
5010
5125
|
if (this.max > this.maxHeight) this.ww = w - this.ss;
|
|
5011
5126
|
if (this.isOpen) this.rSizeContent();
|
|
@@ -5257,17 +5372,13 @@
|
|
|
5257
5372
|
|
|
5258
5373
|
if (this.objectLink !== null) {
|
|
5259
5374
|
if (this.isVector) {
|
|
5260
|
-
this.objectLink[this.
|
|
5261
|
-
/*this.objectLink[ this.val ].x = v[0];
|
|
5262
|
-
this.objectLink[ this.val ].y = v[1];
|
|
5263
|
-
this.objectLink[ this.val ].z = v[2];
|
|
5264
|
-
if( v[3] ) this.objectLink[ this.val ].w = v[3];*/
|
|
5375
|
+
this.objectLink[this.objectKey].fromArray(v);
|
|
5265
5376
|
} else {
|
|
5266
|
-
this.objectLink[this.
|
|
5377
|
+
this.objectLink[this.objectKey] = v;
|
|
5267
5378
|
}
|
|
5268
5379
|
}
|
|
5269
5380
|
|
|
5270
|
-
if (this.callback) this.callback(v, this.
|
|
5381
|
+
if (this.callback) this.callback(v, this.objectKey);
|
|
5271
5382
|
this.isSend = false;
|
|
5272
5383
|
} // ----------------------
|
|
5273
5384
|
// INPUT
|
|
@@ -5321,12 +5432,16 @@
|
|
|
5321
5432
|
|
|
5322
5433
|
rSize() {
|
|
5323
5434
|
super.rSize();
|
|
5324
|
-
let
|
|
5435
|
+
let sx = this.colors.sx;
|
|
5436
|
+
let ss = sx * (this.lng - 1);
|
|
5437
|
+
let w = (this.sb - ss) / this.lng; //(( this.sb + sx ) / this.lng )-sx
|
|
5438
|
+
|
|
5325
5439
|
let s = this.s;
|
|
5326
5440
|
let i = this.lng;
|
|
5327
5441
|
|
|
5328
5442
|
while (i--) {
|
|
5329
|
-
this.tmp[i] = [Math.floor(this.sa + w * i + 5 * i), w];
|
|
5443
|
+
//this.tmp[i] = [ Math.floor( this.sa + ( w * i )+( 5 * i )), w ];
|
|
5444
|
+
this.tmp[i] = [this.sa + w * i + sx * i, w];
|
|
5330
5445
|
this.tmp[i][2] = this.tmp[i][0] + this.tmp[i][1];
|
|
5331
5446
|
s[3 + i].left = this.tmp[i][0] + 'px';
|
|
5332
5447
|
s[3 + i].width = this.tmp[i][1] + 'px';
|
|
@@ -5363,27 +5478,29 @@
|
|
|
5363
5478
|
this.c[2].style.lineHeight = this.h - 10 + 'px';
|
|
5364
5479
|
|
|
5365
5480
|
if (this.model !== 0) {
|
|
5366
|
-
let
|
|
5481
|
+
let r1 = 4,
|
|
5482
|
+
h1 = 4,
|
|
5367
5483
|
h2 = 8,
|
|
5368
|
-
ww = this.h -
|
|
5369
|
-
ra =
|
|
5484
|
+
ww = this.h - 6,
|
|
5485
|
+
ra = 16;
|
|
5370
5486
|
|
|
5371
5487
|
if (this.model === 2) {
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
h2 =
|
|
5488
|
+
r1 = 0;
|
|
5489
|
+
h1 = 2;
|
|
5490
|
+
h2 = 4;
|
|
5375
5491
|
ra = 2;
|
|
5376
|
-
ww = (this.h -
|
|
5492
|
+
ww = (this.h - 6) * 0.5;
|
|
5377
5493
|
}
|
|
5378
5494
|
|
|
5379
5495
|
if (this.model === 3) this.c[5].style.visible = 'none';
|
|
5380
|
-
this.c[4].style.borderRadius =
|
|
5496
|
+
this.c[4].style.borderRadius = r1 + 'px';
|
|
5381
5497
|
this.c[4].style.height = h2 + 'px';
|
|
5382
5498
|
this.c[4].style.top = this.h * 0.5 - h1 + 'px';
|
|
5383
|
-
this.c[5].style.borderRadius =
|
|
5499
|
+
this.c[5].style.borderRadius = r1 * 0.5 + 'px';
|
|
5384
5500
|
this.c[5].style.height = h1 + 'px';
|
|
5385
|
-
this.c[5].style.top = this.h * 0.5 - h1 * 0.5 + 'px';
|
|
5386
|
-
|
|
5501
|
+
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;' );
|
|
5502
|
+
|
|
5503
|
+
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;');
|
|
5387
5504
|
}
|
|
5388
5505
|
|
|
5389
5506
|
this.init();
|
|
@@ -5496,6 +5613,8 @@
|
|
|
5496
5613
|
s[2].color = cc.text;
|
|
5497
5614
|
s[4].background = cc.back;
|
|
5498
5615
|
s[5].background = cc.text;
|
|
5616
|
+
if (this.model !== 0) s[6].background = cc.text; //cc.button;
|
|
5617
|
+
|
|
5499
5618
|
break;
|
|
5500
5619
|
|
|
5501
5620
|
case 1:
|
|
@@ -5504,17 +5623,9 @@
|
|
|
5504
5623
|
s[2].color = cc.textOver;
|
|
5505
5624
|
s[4].background = cc.back;
|
|
5506
5625
|
s[5].background = cc.textOver;
|
|
5507
|
-
|
|
5626
|
+
if (this.model !== 0) s[6].background = cc.textOver; //cc.overoff;
|
|
5508
5627
|
|
|
5509
|
-
|
|
5510
|
-
s[2].border = '1px solid ' + this.colors.borderSelect;
|
|
5511
|
-
break;
|
|
5512
|
-
case 3:
|
|
5513
|
-
s[2].border = '1px dashed ' + this.colors.text;//this.colors.borderSelect;
|
|
5514
|
-
break;
|
|
5515
|
-
case 4:
|
|
5516
|
-
s[2].border = '1px dashed ' + this.colors.hide;
|
|
5517
|
-
break;*/
|
|
5628
|
+
break;
|
|
5518
5629
|
}
|
|
5519
5630
|
}
|
|
5520
5631
|
|
|
@@ -5552,7 +5663,7 @@
|
|
|
5552
5663
|
constructor(o = {}) {
|
|
5553
5664
|
super(o);
|
|
5554
5665
|
this.cmode = 0;
|
|
5555
|
-
this.value = o.value
|
|
5666
|
+
this.value = o.value !== undefined ? o.value : '';
|
|
5556
5667
|
this.placeHolder = o.placeHolder || '';
|
|
5557
5668
|
this.allway = o.allway || false;
|
|
5558
5669
|
this.editable = o.edit !== undefined ? o.edit : true;
|
|
@@ -5719,17 +5830,18 @@
|
|
|
5719
5830
|
this.value = o.value || '';
|
|
5720
5831
|
this.isDown = false;
|
|
5721
5832
|
|
|
5722
|
-
this.onActif = o.onActif || function () {};
|
|
5833
|
+
this.onActif = o.onActif || function () {}; //let prefix = o.prefix || '';
|
|
5723
5834
|
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
this.c[2].style.color = this.fontColor;
|
|
5727
|
-
|
|
5835
|
+
|
|
5836
|
+
const cc = this.colors;
|
|
5837
|
+
this.c[2] = this.dom('div', this.css.txt + this.css.button + ' top:1px; background:' + cc.button + '; height:' + (this.h - 2) + 'px; border:' + cc.buttonBorder + '; border-radius:15px; width:30px; left:10px;'); //this.c[2].style.color = this.fontColor;
|
|
5838
|
+
|
|
5839
|
+
this.c[3] = this.dom('div', this.css.txtselect + 'height:' + (this.h - 4) + 'px; background:' + cc.inputBg + '; borderColor:' + cc.inputBorder + '; border-radius:' + this.radius + 'px;');
|
|
5728
5840
|
this.c[3].textContent = this.value;
|
|
5729
5841
|
let fltop = Math.floor(this.h * 0.5) - 7;
|
|
5730
5842
|
this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:14px; height:14px; left:5px; top:' + fltop + 'px;', {
|
|
5731
5843
|
d: this.svgs['cursor'],
|
|
5732
|
-
fill:
|
|
5844
|
+
fill: cc.text,
|
|
5733
5845
|
stroke: 'none'
|
|
5734
5846
|
});
|
|
5735
5847
|
this.stat = 1;
|
|
@@ -5828,13 +5940,13 @@
|
|
|
5828
5940
|
|
|
5829
5941
|
case 2:
|
|
5830
5942
|
this.s[2].color = cc.textOver;
|
|
5831
|
-
this.s[2].background = cc.
|
|
5943
|
+
this.s[2].background = cc.overoff;
|
|
5832
5944
|
break;
|
|
5833
5945
|
// over
|
|
5834
5946
|
|
|
5835
5947
|
case 3:
|
|
5836
|
-
this.s[2].color = cc.
|
|
5837
|
-
this.s[2].background = cc.
|
|
5948
|
+
this.s[2].color = cc.textOver;
|
|
5949
|
+
this.s[2].background = cc.action;
|
|
5838
5950
|
break;
|
|
5839
5951
|
// down
|
|
5840
5952
|
|
|
@@ -5871,6 +5983,177 @@
|
|
|
5871
5983
|
|
|
5872
5984
|
}
|
|
5873
5985
|
|
|
5986
|
+
class Bitmap extends Proto {
|
|
5987
|
+
constructor(o = {}) {
|
|
5988
|
+
super(o);
|
|
5989
|
+
this.value = o.value || '';
|
|
5990
|
+
this.refTexture = o.texture || null;
|
|
5991
|
+
this.img = null;
|
|
5992
|
+
this.isDown = false;
|
|
5993
|
+
this.neverlock = true;
|
|
5994
|
+
const cc = this.colors;
|
|
5995
|
+
this.c[2] = this.dom('div', this.css.txt + this.css.button + ' top:1px; background:' + cc.button + '; height:' + (this.h - 2) + 'px; border:' + cc.buttonBorder + '; border-radius:15px; width:30px; left:10px;');
|
|
5996
|
+
this.c[3] = this.dom('div', this.css.txtselect + 'height:' + (this.h - 4) + 'px; background:' + cc.inputBg + '; borderColor:' + cc.inputBorder + '; border-radius:' + this.radius + 'px;');
|
|
5997
|
+
this.c[3].textContent = this.value;
|
|
5998
|
+
let fltop = Math.floor(this.h * 0.5) - 7;
|
|
5999
|
+
this.c[4] = this.dom('path', this.css.basic + 'position:absolute; width:14px; height:14px; left:5px; top:' + fltop + 'px;', {
|
|
6000
|
+
d: this.svgs['load'],
|
|
6001
|
+
fill: cc.text,
|
|
6002
|
+
stroke: 'none'
|
|
6003
|
+
});
|
|
6004
|
+
this.stat = 1;
|
|
6005
|
+
this.init();
|
|
6006
|
+
}
|
|
6007
|
+
|
|
6008
|
+
testZone(e) {
|
|
6009
|
+
let l = this.local;
|
|
6010
|
+
if (l.x === -1 && l.y === -1) return '';
|
|
6011
|
+
if (l.x > this.sa && l.x < this.sa + 30) return 'over';
|
|
6012
|
+
return '0';
|
|
6013
|
+
} // ----------------------
|
|
6014
|
+
// EVENTS
|
|
6015
|
+
// ----------------------
|
|
6016
|
+
|
|
6017
|
+
|
|
6018
|
+
mouseup(e) {
|
|
6019
|
+
if (this.isDown) {
|
|
6020
|
+
//this.value = false;
|
|
6021
|
+
this.isDown = false; //this.send();
|
|
6022
|
+
|
|
6023
|
+
return this.mousemove(e);
|
|
6024
|
+
}
|
|
6025
|
+
|
|
6026
|
+
return false;
|
|
6027
|
+
}
|
|
6028
|
+
|
|
6029
|
+
mousedown(e) {
|
|
6030
|
+
let name = this.testZone(e);
|
|
6031
|
+
if (!name) return false;
|
|
6032
|
+
|
|
6033
|
+
if (name === 'over') {
|
|
6034
|
+
this.isDown = true;
|
|
6035
|
+
Files.load({
|
|
6036
|
+
callback: this.changeBitmap.bind(this)
|
|
6037
|
+
});
|
|
6038
|
+
} //this.value = this.values[ name-2 ];
|
|
6039
|
+
//this.send();
|
|
6040
|
+
|
|
6041
|
+
|
|
6042
|
+
return this.mousemove(e);
|
|
6043
|
+
}
|
|
6044
|
+
|
|
6045
|
+
mousemove(e) {
|
|
6046
|
+
let up = false;
|
|
6047
|
+
let name = this.testZone(e); //let sel = false;
|
|
6048
|
+
//console.log(name)
|
|
6049
|
+
|
|
6050
|
+
if (name === 'over') {
|
|
6051
|
+
this.cursor('pointer');
|
|
6052
|
+
up = this.mode(this.isDown ? 3 : 2);
|
|
6053
|
+
} else {
|
|
6054
|
+
up = this.reset();
|
|
6055
|
+
}
|
|
6056
|
+
|
|
6057
|
+
return up;
|
|
6058
|
+
} // ----------------------
|
|
6059
|
+
|
|
6060
|
+
|
|
6061
|
+
changeBitmap(img, fname) {
|
|
6062
|
+
if (img) {
|
|
6063
|
+
this.img = img;
|
|
6064
|
+
this.apply(fname);
|
|
6065
|
+
} else {
|
|
6066
|
+
this.img = null;
|
|
6067
|
+
this.apply('null');
|
|
6068
|
+
}
|
|
6069
|
+
} // ----------------------
|
|
6070
|
+
|
|
6071
|
+
|
|
6072
|
+
apply(v) {
|
|
6073
|
+
v = v || '';
|
|
6074
|
+
|
|
6075
|
+
if (v !== this.value) {
|
|
6076
|
+
this.value = v;
|
|
6077
|
+
this.c[3].textContent = this.value;
|
|
6078
|
+
|
|
6079
|
+
if (this.img !== null) {
|
|
6080
|
+
if (this.objectLink !== null) this.objectLink[this.val] = v;
|
|
6081
|
+
if (this.callback) this.callback(v, this.img, this.name);
|
|
6082
|
+
}
|
|
6083
|
+
}
|
|
6084
|
+
|
|
6085
|
+
this.mode(1);
|
|
6086
|
+
}
|
|
6087
|
+
|
|
6088
|
+
update() {
|
|
6089
|
+
this.mode(3);
|
|
6090
|
+
}
|
|
6091
|
+
|
|
6092
|
+
mode(n) {
|
|
6093
|
+
let change = false;
|
|
6094
|
+
let cc = this.colors;
|
|
6095
|
+
|
|
6096
|
+
if (this.stat !== n) {
|
|
6097
|
+
/*if( n===1 ) this.isActif = false
|
|
6098
|
+
if( n===3 ){
|
|
6099
|
+
if( !this.isActif ){ this.isActif = true; n=4; this.onActif( this ); }
|
|
6100
|
+
else { this.isActif = false; }
|
|
6101
|
+
}
|
|
6102
|
+
if( n===2 && this.isActif ) n = 4;*/
|
|
6103
|
+
this.stat = n;
|
|
6104
|
+
|
|
6105
|
+
switch (n) {
|
|
6106
|
+
case 1:
|
|
6107
|
+
this.s[2].color = cc.text;
|
|
6108
|
+
this.s[2].background = cc.button;
|
|
6109
|
+
break;
|
|
6110
|
+
// base
|
|
6111
|
+
|
|
6112
|
+
case 2:
|
|
6113
|
+
this.s[2].color = cc.textOver;
|
|
6114
|
+
this.s[2].background = cc.overoff;
|
|
6115
|
+
break;
|
|
6116
|
+
// over
|
|
6117
|
+
|
|
6118
|
+
case 3:
|
|
6119
|
+
this.s[2].color = cc.textOver;
|
|
6120
|
+
this.s[2].background = cc.over;
|
|
6121
|
+
break;
|
|
6122
|
+
// down
|
|
6123
|
+
|
|
6124
|
+
case 4:
|
|
6125
|
+
this.s[2].color = cc.textSelect;
|
|
6126
|
+
this.s[2].background = cc.select;
|
|
6127
|
+
break;
|
|
6128
|
+
// actif
|
|
6129
|
+
}
|
|
6130
|
+
|
|
6131
|
+
change = true;
|
|
6132
|
+
}
|
|
6133
|
+
|
|
6134
|
+
return change;
|
|
6135
|
+
}
|
|
6136
|
+
|
|
6137
|
+
reset() {
|
|
6138
|
+
this.cursor();
|
|
6139
|
+
return this.mode(this.isActif ? 4 : 1);
|
|
6140
|
+
}
|
|
6141
|
+
|
|
6142
|
+
text(txt) {
|
|
6143
|
+
this.c[3].textContent = txt;
|
|
6144
|
+
}
|
|
6145
|
+
|
|
6146
|
+
rSize() {
|
|
6147
|
+
super.rSize();
|
|
6148
|
+
let s = this.s;
|
|
6149
|
+
s[2].left = this.sa + 'px';
|
|
6150
|
+
s[3].left = this.sa + 40 + 'px';
|
|
6151
|
+
s[3].width = this.sb - 40 + 'px';
|
|
6152
|
+
s[4].left = this.sa + 8 + 'px';
|
|
6153
|
+
}
|
|
6154
|
+
|
|
6155
|
+
}
|
|
6156
|
+
|
|
5874
6157
|
//import { Proto } from '../core/Proto.js';
|
|
5875
6158
|
class Selector extends Button {
|
|
5876
6159
|
constructor(o = {}) {
|
|
@@ -6526,6 +6809,10 @@
|
|
|
6526
6809
|
n = new Select(o);
|
|
6527
6810
|
break;
|
|
6528
6811
|
|
|
6812
|
+
case 'bitmap':
|
|
6813
|
+
n = new Bitmap(o);
|
|
6814
|
+
break;
|
|
6815
|
+
|
|
6529
6816
|
case 'selector':
|
|
6530
6817
|
n = new Selector(o);
|
|
6531
6818
|
break;
|
|
@@ -6550,6 +6837,7 @@
|
|
|
6550
6837
|
}
|
|
6551
6838
|
|
|
6552
6839
|
if (n !== null) {
|
|
6840
|
+
Roots.needResize = true;
|
|
6553
6841
|
if (ref) n.setReferency(a[0], a[1]);
|
|
6554
6842
|
return n;
|
|
6555
6843
|
}
|
|
@@ -6678,7 +6966,7 @@
|
|
|
6678
6966
|
|
|
6679
6967
|
|
|
6680
6968
|
this.transition = o.transition || Tools.transition;
|
|
6681
|
-
if (this.transition) setTimeout(this.addTransition.bind(this),
|
|
6969
|
+
if (this.transition) setTimeout(this.addTransition.bind(this), 1000);
|
|
6682
6970
|
this.setWidth();
|
|
6683
6971
|
if (this.isCanvas) this.makeCanvas();
|
|
6684
6972
|
Roots.add(this);
|
|
@@ -6697,6 +6985,10 @@
|
|
|
6697
6985
|
this.content.style.transition = 'height ' + this.transition + 's ease-out';
|
|
6698
6986
|
this.bottom.style.transition = 'top ' + this.transition + 's ease-out'; //this.bottom.addEventListener("transitionend", Roots.resize, true);
|
|
6699
6987
|
}
|
|
6988
|
+
|
|
6989
|
+
let i = this.uis.length;
|
|
6990
|
+
|
|
6991
|
+
while (i--) this.uis[i].addTransition();
|
|
6700
6992
|
} // ----------------------
|
|
6701
6993
|
// CANVAS
|
|
6702
6994
|
// ----------------------
|
|
@@ -7131,7 +7423,7 @@
|
|
|
7131
7423
|
|
|
7132
7424
|
}
|
|
7133
7425
|
|
|
7134
|
-
const REVISION = '4.
|
|
7426
|
+
const REVISION = '4.2.2';
|
|
7135
7427
|
|
|
7136
7428
|
exports.Files = Files;
|
|
7137
7429
|
exports.Gui = Gui;
|