uil 4.0.0 → 4.0.4

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.
Files changed (46) hide show
  1. package/README.md +5 -1
  2. package/build/uil.js +33 -45
  3. package/build/uil.min.js +1 -1
  4. package/build/uil.module.js +45 -58
  5. package/package.json +6 -10
  6. package/examples/js/BufferGeometryUtils.js +0 -921
  7. package/examples/js/SimplexNoise.js +0 -324
  8. package/examples/js/controls/OrbitControls.js +0 -1215
  9. package/examples/js/controls/OrbitControls_.js +0 -1042
  10. package/examples/js/libs/sea3d.min.js +0 -373
  11. package/examples/js/libs/three.min.js +0 -6
  12. package/examples/js/math.js +0 -447
  13. package/examples/js/objects/Landscape.js +0 -778
  14. package/examples/js/objects/Lensflare.js +0 -372
  15. package/examples/js/objects/SuperSky.js +0 -297
  16. package/examples/js/objects/Water.js +0 -329
  17. package/src/Uil.js +0 -6
  18. package/src/Uil_dev.js +0 -15
  19. package/src/core/Gui.js +0 -807
  20. package/src/core/Proto.js +0 -679
  21. package/src/core/Roots.js +0 -864
  22. package/src/core/Tools.js +0 -830
  23. package/src/core/V2.js +0 -131
  24. package/src/core/add.js +0 -85
  25. package/src/polyfills.js +0 -85
  26. package/src/proto/Bool.js +0 -147
  27. package/src/proto/Button.js +0 -357
  28. package/src/proto/Circular.js +0 -230
  29. package/src/proto/Color.js +0 -411
  30. package/src/proto/Empty.js +0 -15
  31. package/src/proto/Fps.js +0 -327
  32. package/src/proto/Graph.js +0 -310
  33. package/src/proto/Grid.js +0 -297
  34. package/src/proto/Group.js +0 -430
  35. package/src/proto/Item.js +0 -120
  36. package/src/proto/Joystick.js +0 -241
  37. package/src/proto/Knob.js +0 -262
  38. package/src/proto/List.js +0 -789
  39. package/src/proto/Numeric.js +0 -417
  40. package/src/proto/Pad2D.js +0 -268
  41. package/src/proto/Rubric.js +0 -0
  42. package/src/proto/Select.js +0 -178
  43. package/src/proto/Selector.js +0 -13
  44. package/src/proto/Slide.js +0 -267
  45. package/src/proto/TextInput.js +0 -181
  46. package/src/proto/Title.js +0 -61
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <p align="center"><a href="http://lo-th.github.io/uil/"><img src="http://lo-th.github.io/uil/examples/assets/uil.png"/></a><br>UIL v4.0</p>
1
+ <p align="center"><a href="http://lo-th.github.io/uil/"><img src="http://lo-th.github.io/uil/examples/assets/uil.jpg"/></a><br>UIL v4.0.4</p>
2
2
 
3
3
  uil.js is a lightweight ui for javascript with a complete 3d display support.<br>
4
4
  totally customizable, only 6 events, auto resize<br>
@@ -55,3 +55,7 @@ ui.clear();
55
55
  [**uil to three**](http://lo-th.github.io/uil/examples/uil_3d.html)
56
56
 
57
57
  [**uil to three 2**](http://lo-th.github.io/uil/examples/uil_3d_2.html)
58
+
59
+ **7 - uil is on npm**
60
+ ```sh
61
+ npm i uil
package/build/uil.js CHANGED
@@ -28,7 +28,7 @@
28
28
  prevDefault: ['contextmenu', 'wheel'],
29
29
  pointerEvent: ['pointerdown', 'pointermove', 'pointerup'],
30
30
  eventOut: ['pointercancel', 'pointerout', 'pointerleave'],
31
- xmlserializer: new XMLSerializer(),
31
+ xmlserializer: null,
32
32
  tmpTime: null,
33
33
  tmpImage: null,
34
34
  oldCursor: 'auto',
@@ -391,7 +391,8 @@
391
391
  // CANVAS
392
392
  // ----------------------
393
393
  toCanvas: function (o, w, h, force) {
394
- // prevent exesive redraw
394
+ if (!R.xmlserializer) R.xmlserializer = new XMLSerializer(); // prevent exesive redraw
395
+
395
396
  if (force && R.tmpTime !== null) {
396
397
  clearTimeout(R.tmpTime);
397
398
  R.tmpTime = null;
@@ -1960,26 +1961,25 @@
1960
1961
  // ----------------------
1961
1962
 
1962
1963
 
1963
- clear(nofull) {
1964
+ dispose() {
1964
1965
  if (this.isListen) Roots.removeListen(this);
1965
1966
  Tools.clear(this.c[0]);
1966
1967
 
1967
- if (!nofull) {
1968
- if (this.target !== null) {
1969
- if (this.group !== null) this.group.clearOne(this);else this.target.removeChild(this.c[0]);
1970
- } else {
1971
- if (this.isUI) this.main.clearOne(this);else document.body.removeChild(this.c[0]);
1972
- }
1973
-
1974
- if (!this.isUI) Roots.remove(this);
1968
+ if (this.target !== null) {
1969
+ if (this.group !== null) this.group.clearOne(this);else this.target.removeChild(this.c[0]);
1970
+ } else {
1971
+ if (this.isUI) this.main.clearOne(this);else document.body.removeChild(this.c[0]);
1975
1972
  }
1976
1973
 
1974
+ if (!this.isUI) Roots.remove(this);
1977
1975
  this.c = null;
1978
1976
  this.s = null;
1979
1977
  this.callback = null;
1980
1978
  this.target = null;
1981
1979
  this.isListen = false;
1982
- } // ----------------------
1980
+ }
1981
+
1982
+ clear() {} // ----------------------
1983
1983
  // change size
1984
1984
  // ----------------------
1985
1985
 
@@ -2111,7 +2111,7 @@
2111
2111
 
2112
2112
  display(v) {
2113
2113
  v = v || false;
2114
- this.s[0].display = v ? this.useFlex ? 'flex' : 'block' : 'none';
2114
+ this.s[0].visibility = v ? 'visible' : 'hidden'; //this.s[0].display = v ? (this.useFlex? 'flex':'block') : 'none'
2115
2115
  } // ----------------------
2116
2116
  // resize height
2117
2117
  // ----------------------
@@ -2312,7 +2312,7 @@
2312
2312
  this.value = o.value || '';
2313
2313
  this.values = o.value || this.txt;
2314
2314
  if (o.values) this.values = o.values;
2315
- this.onName = o.onName || '';
2315
+ this.onName = o.onName || null;
2316
2316
  this.on = false;
2317
2317
  this.customSize = o.forceWidth || -1;
2318
2318
  if (typeof this.values === 'string') this.values = [this.values];
@@ -2351,15 +2351,15 @@
2351
2351
  if (this.isDragButton) {
2352
2352
  this.lng++;
2353
2353
  this.initDrager();
2354
- }
2354
+ } //if( this.onName !== '' ) this.values[0] = this.on;
2355
+
2355
2356
 
2356
- if (this.onName !== '') this.values[0] = this.on;
2357
2357
  this.init();
2358
2358
  }
2359
2359
 
2360
2360
  onOff() {
2361
2361
  this.on = !this.on;
2362
- this.c[2].innerHTML = this.on ? this.onName : this.txt;
2362
+ this.label(this.on ? this.onName : this.txt);
2363
2363
  }
2364
2364
 
2365
2365
  testZone(e) {
@@ -2384,6 +2384,7 @@
2384
2384
 
2385
2385
  if (this.res !== -1) {
2386
2386
  if (this.value === this.values[this.res] && this.unselectable) this.value = '';else this.value = this.values[this.res];
2387
+ if (this.onName !== null) this.onOff();
2387
2388
  if (!this.isLoadButton) this.send();
2388
2389
  }
2389
2390
 
@@ -3786,10 +3787,20 @@
3786
3787
 
3787
3788
 
3788
3789
  remove(n) {
3789
- if (n.clear) n.clear();
3790
+ if (n.dispose) n.dispose();
3790
3791
  } // clear all iner
3791
3792
 
3792
3793
 
3794
+ dispose() {
3795
+ this.clear();
3796
+ if (this.isUI) this.main.calc();
3797
+ super.dispose(); //Proto.prototype.clear.call( this );
3798
+ }
3799
+
3800
+ clear() {
3801
+ this.empty();
3802
+ }
3803
+
3793
3804
  empty() {
3794
3805
  this.close();
3795
3806
  let i = this.uis.length,
@@ -3838,23 +3849,6 @@
3838
3849
  this.parentHeight();
3839
3850
  }
3840
3851
 
3841
- clear() {
3842
- this.empty();
3843
- if (this.isUI) this.main.calc(-(this.h + 1));
3844
- Proto.prototype.clear.call(this);
3845
- }
3846
-
3847
- clearGroup() {
3848
- this.empty();
3849
- /*this.close();
3850
- let i = this.uis.length;
3851
- while(i--){
3852
- this.uis[i].clear();
3853
- }
3854
- this.uis = [];
3855
- this.h = this.baseH;*/
3856
- }
3857
-
3858
3852
  calcUis() {
3859
3853
  if (!this.isOpen) this.h = this.baseH;else this.h = Roots.calcUis(this.uis, this.zone, this.zone.y + this.baseH) + this.baseH;
3860
3854
  this.s[0].height = this.h + 'px'; //console.log('G', this.h)
@@ -6881,7 +6875,7 @@
6881
6875
 
6882
6876
 
6883
6877
  remove(n) {
6884
- if (n.clear) n.clear();
6878
+ if (n.dispose) n.dispose();
6885
6879
  } // call after uis clear
6886
6880
 
6887
6881
 
@@ -6905,7 +6899,7 @@
6905
6899
  while (i--) {
6906
6900
  item = this.uis.pop();
6907
6901
  this.inner.removeChild(item.c[0]);
6908
- item.clear(true); //this.uis[i].clear()
6902
+ item.dispose(); //this.uis[i].clear()
6909
6903
  }
6910
6904
 
6911
6905
  this.uis = [];
@@ -6917,13 +6911,7 @@
6917
6911
  }
6918
6912
 
6919
6913
  clear() {
6920
- this.empty(); //this.callback = null;
6921
-
6922
- /*let i = this.uis.length;
6923
- while( i-- ) this.uis[i].clear();
6924
- this.uis = [];
6925
- Roots.listens = [];
6926
- this.calc( -this.h );*/
6914
+ this.empty();
6927
6915
  }
6928
6916
 
6929
6917
  dispose() {
@@ -7062,7 +7050,7 @@
7062
7050
 
7063
7051
  }
7064
7052
 
7065
- const REVISION = '4.0';
7053
+ const REVISION = '4.0.4';
7066
7054
 
7067
7055
  exports.Gui = Gui;
7068
7056
  exports.Proto = Proto;