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
@@ -31,7 +31,7 @@ const R = {
31
31
  pointerEvent: ['pointerdown', 'pointermove', 'pointerup'],
32
32
  eventOut: ['pointercancel', 'pointerout', 'pointerleave'],
33
33
 
34
- xmlserializer: new XMLSerializer(),
34
+ xmlserializer: null,
35
35
  tmpTime: null,
36
36
  tmpImage: null,
37
37
 
@@ -519,6 +519,8 @@ const R = {
519
519
 
520
520
  toCanvas: function ( o, w, h, force ) {
521
521
 
522
+ if( !R.xmlserializer ) R.xmlserializer = new XMLSerializer();
523
+
522
524
  // prevent exesive redraw
523
525
 
524
526
  if( force && R.tmpTime !== null ) { clearTimeout(R.tmpTime); R.tmpTime = null; }
@@ -2263,31 +2265,27 @@ class Proto {
2263
2265
  // ----------------------
2264
2266
  // clear node
2265
2267
  // ----------------------
2266
-
2267
- clear( nofull ) {
2268
+
2269
+ dispose(){
2268
2270
 
2269
2271
  if( this.isListen ) Roots.removeListen( this );
2270
2272
 
2271
2273
  Tools.clear( this.c[0] );
2272
2274
 
2273
- if( !nofull ){
2274
-
2275
- if( this.target !== null ){
2276
-
2277
- if( this.group !== null ) this.group.clearOne( this );
2278
- else this.target.removeChild( this.c[0] );
2279
-
2280
- } else {
2275
+ if( this.target !== null ){
2281
2276
 
2282
- if( this.isUI ) this.main.clearOne( this );
2283
- else document.body.removeChild( this.c[0] );
2277
+ if( this.group !== null ) this.group.clearOne( this );
2278
+ else this.target.removeChild( this.c[0] );
2284
2279
 
2285
- }
2280
+ } else {
2286
2281
 
2287
- if( !this.isUI ) Roots.remove( this );
2282
+ if( this.isUI ) this.main.clearOne( this );
2283
+ else document.body.removeChild( this.c[0] );
2288
2284
 
2289
2285
  }
2290
2286
 
2287
+ if( !this.isUI ) Roots.remove( this );
2288
+
2291
2289
  this.c = null;
2292
2290
  this.s = null;
2293
2291
  this.callback = null;
@@ -2295,6 +2293,10 @@ class Proto {
2295
2293
  this.isListen = false;
2296
2294
 
2297
2295
  }
2296
+
2297
+ clear() {
2298
+
2299
+ }
2298
2300
 
2299
2301
  // ----------------------
2300
2302
  // change size
@@ -2426,7 +2428,8 @@ class Proto {
2426
2428
  display( v ) {
2427
2429
 
2428
2430
  v = v || false;
2429
- this.s[0].display = v ? (this.useFlex? 'flex':'block') : 'none';
2431
+ this.s[0].visibility = v ? 'visible' : 'hidden';
2432
+ //this.s[0].display = v ? (this.useFlex? 'flex':'block') : 'none'
2430
2433
 
2431
2434
  }
2432
2435
 
@@ -2657,7 +2660,7 @@ class Button extends Proto {
2657
2660
 
2658
2661
 
2659
2662
 
2660
- this.onName = o.onName || '';
2663
+ this.onName = o.onName || null;
2661
2664
 
2662
2665
  this.on = false;
2663
2666
 
@@ -2707,16 +2710,16 @@ class Button extends Proto {
2707
2710
  this.initDrager();
2708
2711
  }
2709
2712
 
2710
- if( this.onName !== '' ) this.values[0] = this.on;
2713
+ //if( this.onName !== '' ) this.values[0] = this.on;
2711
2714
 
2712
2715
  this.init();
2713
2716
 
2714
2717
  }
2715
2718
 
2716
- onOff ( ){
2719
+ onOff() {
2717
2720
 
2718
2721
  this.on = !this.on;
2719
- this.c[2].innerHTML = this.on ? this.onName : this.txt;
2722
+ this.label( this.on ? this.onName : this.txt );
2720
2723
 
2721
2724
  }
2722
2725
 
@@ -2748,6 +2751,7 @@ class Button extends Proto {
2748
2751
  if( this.res !== -1 ){
2749
2752
  if( this.value === this.values[this.res] && this.unselectable ) this.value = '';
2750
2753
  else this.value = this.values[this.res];
2754
+ if( this.onName !== null ) this.onOff();
2751
2755
  if( !this.isLoadButton ) this.send();
2752
2756
  }
2753
2757
 
@@ -4488,7 +4492,7 @@ class Group extends Proto {
4488
4492
 
4489
4493
  }
4490
4494
 
4491
- add () {
4495
+ add() {
4492
4496
 
4493
4497
  let a = arguments;
4494
4498
 
@@ -4526,12 +4530,28 @@ class Group extends Proto {
4526
4530
 
4527
4531
  remove ( n ) {
4528
4532
 
4529
- if( n.clear ) n.clear();
4533
+ if( n.dispose ) n.dispose();
4530
4534
 
4531
4535
  }
4532
4536
 
4533
4537
  // clear all iner
4534
4538
 
4539
+ dispose() {
4540
+
4541
+ this.clear();
4542
+ if( this.isUI ) this.main.calc();
4543
+
4544
+ super.dispose();
4545
+ //Proto.prototype.clear.call( this );
4546
+
4547
+ }
4548
+
4549
+ clear() {
4550
+
4551
+ this.empty();
4552
+
4553
+ }
4554
+
4535
4555
  empty () {
4536
4556
 
4537
4557
  this.close();
@@ -4599,29 +4619,6 @@ class Group extends Proto {
4599
4619
 
4600
4620
  }
4601
4621
 
4602
- clear () {
4603
-
4604
- this.empty();
4605
- if( this.isUI ) this.main.calc( -( this.h + 1 ));
4606
- Proto.prototype.clear.call( this );
4607
-
4608
- }
4609
-
4610
- clearGroup () {
4611
-
4612
- this.empty();
4613
-
4614
- /*this.close();
4615
-
4616
- let i = this.uis.length;
4617
- while(i--){
4618
- this.uis[i].clear();
4619
- }
4620
- this.uis = [];
4621
- this.h = this.baseH;*/
4622
-
4623
- }
4624
-
4625
4622
  calcUis () {
4626
4623
 
4627
4624
  if( !this.isOpen ) this.h = this.baseH;
@@ -8388,7 +8385,7 @@ class Gui {
8388
8385
 
8389
8386
  remove ( n ) {
8390
8387
 
8391
- if( n.clear ) n.clear();
8388
+ if( n.dispose ) n.dispose();
8392
8389
 
8393
8390
  }
8394
8391
 
@@ -8417,7 +8414,7 @@ class Gui {
8417
8414
  while( i-- ){
8418
8415
  item = this.uis.pop();
8419
8416
  this.inner.removeChild( item.c[0] );
8420
- item.clear( true );
8417
+ item.dispose();
8421
8418
 
8422
8419
  //this.uis[i].clear()
8423
8420
  }
@@ -8437,16 +8434,6 @@ class Gui {
8437
8434
 
8438
8435
  this.empty();
8439
8436
 
8440
- //this.callback = null;
8441
-
8442
- /*let i = this.uis.length;
8443
- while( i-- ) this.uis[i].clear();
8444
-
8445
- this.uis = [];
8446
- Roots.listens = [];
8447
-
8448
- this.calc( -this.h );*/
8449
-
8450
8437
  }
8451
8438
 
8452
8439
  dispose() {
@@ -8641,6 +8628,6 @@ class Gui {
8641
8628
 
8642
8629
  }
8643
8630
 
8644
- const REVISION = '4.0';
8631
+ const REVISION = '4.0.4';
8645
8632
 
8646
8633
  export { Gui, Proto, REVISION, Tools, add };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uil",
3
- "version": "4.0.0",
3
+ "version": "4.0.4",
4
4
  "description": "JavaScript gui library",
5
5
  "main": "build/uil.js",
6
6
  "repository": "lo-th/uil",
@@ -12,23 +12,19 @@
12
12
  "README.md",
13
13
  "build/uil.js",
14
14
  "build/uil.min.js",
15
- "build/uil.module.js",
16
- "src",
17
- "examples/js",
18
- "examples/fonts"
15
+ "build/uil.module.js"
19
16
  ],
20
17
  "directories": {
21
18
  "doc": "docs",
22
- "example": "examples",
23
- "test": "test"
19
+ "example": "examples"
24
20
  },
25
21
  "eslintConfig": {
26
22
  "extends": "mdcs"
27
23
  },
28
24
  "scripts": {
29
- "build": "rollup -c utils/build/rollup.config.js",
30
- "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8111 --index\"",
31
- "start": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"http-server -c-1 -p 8111 -o index.html\""
25
+ "build": "rollup -c utils/rollup.config.js",
26
+ "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/rollup.config.js -w -m inline\" \"servez -p 8111 --index\"",
27
+ "start": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/rollup.config.js -w -m inline\" \"http-server -c-1 -p 8111 -o index.html\""
32
28
  },
33
29
  "keywords": [
34
30
  "uil",