typed-controls 0.8.24 → 0.9.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/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 Codenautas
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Codenautas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md CHANGED
@@ -1,33 +1,30 @@
1
- # typed-controls
2
- typed controls, widgets and others
3
-
4
- ![extending](https://img.shields.io/badge/stability-extending-orange.svg)
5
- [![npm-version](https://img.shields.io/npm/v/typed-controls.svg)](https://npmjs.org/package/typed-controls)
6
- [![downloads](https://img.shields.io/npm/dm/typed-controls.svg)](https://npmjs.org/package/typed-controls)
7
- [![build](https://img.shields.io/travis/codenautas/typed-controls/master.svg)](https://travis-ci.org/codenautas/typed-controls)
8
- [![coverage](https://img.shields.io/coveralls/codenautas/typed-controls/master.svg)](https://coveralls.io/r/codenautas/typed-controls)
9
- [![climate](https://img.shields.io/codeclimate/github/codenautas/typed-controls.svg)](https://codeclimate.com/github/codenautas/typed-controls)
10
- [![dependencies](https://img.shields.io/david/codenautas/typed-controls.svg)](https://david-dm.org/codenautas/typed-controls)
11
- [![qa-control](http://codenautas.com/github/codenautas/typed-controls.svg)](http://codenautas.com/github/codenautas/typed-controls)
12
-
13
-
14
-
15
- language: ![English](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-en.png)
16
- also available in:
17
- [![Spanish](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-es.png)](LEEME.md)
18
-
19
-
20
- ## Install
21
-
22
-
23
- ```sh
24
- $ npm install typed-controls
25
- ```
26
-
27
- ## License
28
-
29
- [MIT](LICENSE)
30
-
31
- ----------------
32
-
33
-
1
+ # typed-controls
2
+ typed controls, widgets and others
3
+
4
+ ![extending](https://img.shields.io/badge/stability-extending-orange.svg)
5
+ [![npm-version](https://img.shields.io/npm/v/typed-controls.svg)](https://npmjs.org/package/typed-controls)
6
+ [![downloads](https://img.shields.io/npm/dm/typed-controls.svg)](https://npmjs.org/package/typed-controls)
7
+ [![build](https://img.shields.io/travis/codenautas/typed-controls/master.svg)](https://travis-ci.org/codenautas/typed-controls)
8
+ [![dependencies](https://img.shields.io/david/codenautas/typed-controls.svg)](https://david-dm.org/codenautas/typed-controls)
9
+
10
+
11
+
12
+ language: ![English](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-en.png)
13
+ also available in:
14
+ [![Spanish](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-es.png)](LEEME.md)
15
+
16
+
17
+ ## Install
18
+
19
+
20
+ ```sh
21
+ $ npm install typed-controls
22
+ ```
23
+
24
+ ## License
25
+
26
+ [MIT](LICENSE)
27
+
28
+ ----------------
29
+
30
+
@@ -32,6 +32,7 @@ TypedControls.SIGNAL_UNKNOWN_DATA='//';
32
32
  var likeAr = require('like-ar');
33
33
  var DialogPromise = require('dialog-promise');
34
34
 
35
+ TypedControls.disablePasteFuncOverriding=false;
35
36
  TypedControls.doubleClickExpands=false;
36
37
  TypedControls.showLupa=0.5;
37
38
  TypedControls.showOn={
@@ -190,6 +191,17 @@ BestControls.div = {
190
191
  element.validateWhileInput();
191
192
  },300);
192
193
  },
194
+ 'paste': function(event){
195
+ if (!TypedControls.disablePasteFuncOverriding){
196
+ let paste = (event.clipboardData || window.clipboardData).getData('text');
197
+ paste = paste.replace(/\u00A0/g,' ');
198
+ const selection = window.getSelection();
199
+ if (!selection.rangeCount) return false;
200
+ selection.deleteFromDocument();
201
+ selection.getRangeAt(0).insertNode(document.createTextNode(paste));
202
+ event.preventDefault();
203
+ }
204
+ },
193
205
  'keypress': function onKeyPressListenerForDiv(event){
194
206
  var element = this;
195
207
  if(event.which>=32){
@@ -422,7 +434,7 @@ BestControls.boolean = {
422
434
  }else{
423
435
  var value = this.getPlainValue();
424
436
  var falseInitials={'n':true,'N':true,'0':true,'2':true,'F':true,'f':true,'\u043d':true,'\u041d':true};
425
- if(value==null){
437
+ if(value==null || value.trim()==''){
426
438
  return null;
427
439
  }else{
428
440
  return !falseInitials[value.trim()[0]];
@@ -822,7 +834,7 @@ TypedControls.adaptElement = function adaptElement(domElement, typerOrTypeInfo){
822
834
  domElement.lupa=null;
823
835
  domElement.expander = expander;
824
836
  var reubicate = function reubicate(){
825
- if((document.activeElement === domElement || domElement.disabled) && editable(typer, expander, domElement)){
837
+ if(domElement.lupaFija || (document.activeElement === domElement || domElement.disabled) && editable(typer, expander, domElement)){
826
838
  domElement.lupa.style.display='';
827
839
  domElement.lupa.style.opacity=1;
828
840
  var rect = getRect(domElement);
@@ -842,8 +854,16 @@ TypedControls.adaptElement = function adaptElement(domElement, typerOrTypeInfo){
842
854
  domElement.lupa=null;
843
855
  }
844
856
  };
857
+ domElement.ponerLupa = function ponerLupa(fija){
858
+ domElement.lupa = html.img({src:TypedControls.path.img+(domElement.expander.img||'lookdown.png'), class:'img-lupa', style:'position:absolute; display:none'}).create();
859
+ document.body.appendChild(domElement.lupa);
860
+ domElement.lupa.addEventListener('load', reubicate);
861
+ domElement.lupa.addEventListener('click',displayExpander);
862
+ domElement.lupa.timerReubicate = setInterval(reubicate,500);
863
+ domElement.lupaFija = fija;
864
+ }
845
865
  var quitarLupa = function quitarLupa(domElement){
846
- if(domElement.lupa){
866
+ if(domElement.lupa && !domElement.lupaFija){
847
867
  clearInterval(domElement.lupa.timerReubicate);
848
868
  domElement.lupa.timerReubicate=null;
849
869
  // domElement.lupa.timerReubicate = setInterval(reubicate,500);
@@ -880,11 +900,7 @@ TypedControls.adaptElement = function adaptElement(domElement, typerOrTypeInfo){
880
900
  if(TypedControls.showLupa && TypedControls.showOn[eventName]){
881
901
  domElement.addEventListener(eventName, function(){
882
902
  if(!domElement.lupa){
883
- domElement.lupa = html.img({src:TypedControls.path.img+(domElement.expander.img||'lookdown.png'), class:'img-lupa', style:'position:absolute; display:none'}).create();
884
- document.body.appendChild(domElement.lupa);
885
- domElement.lupa.addEventListener('load', reubicate);
886
- domElement.lupa.addEventListener('click',displayExpander);
887
- domElement.lupa.timerReubicate = setInterval(reubicate,500);
903
+ domElement.ponerLupa();
888
904
  }else if(domElement.lupa.timerClose){
889
905
  clearTimeout(domElement.lupa.timerClose);
890
906
  }
package/package.json CHANGED
@@ -1,100 +1,93 @@
1
- {
2
- "name": "typed-controls",
3
- "description": "typed controls, widgets and others",
4
- "version": "0.8.24",
5
- "author": "Codenautas <codenautas@googlegroups.com>",
6
- "license": "MIT",
7
- "repository": "codenautas/typed-controls",
8
- "contributors": [
9
- {
10
- "name": "Emilio Platzer",
11
- "email": "emilioplatzer@gmail.com"
12
- },
13
- {
14
- "name": "Estefanía Capece",
15
- "email": "eycapece@gmail.com"
16
- },
17
- {
18
- "name": "Diego Florio",
19
- "email": "diegoefe@gmail.com"
20
- },
21
- {
22
- "name": "Manuel De la Penna",
23
- "email": "manueldelapenna@gmail.com"
24
- }
25
- ],
26
- "main": "lib/typed-controls.js",
27
- "dependencies": {
28
- "pikaday": "^1.8.2",
29
- "best-globals": "~0.10.30",
30
- "js-to-html": "^1.0.11",
31
- "like-ar": "~0.2.19",
32
- "type-store": "~0.2.38",
33
- "dialog-promise": "~0.9.4"
34
- },
35
- "devDependencies": {
36
- "big.js": "^6.0.2",
37
- "body-parser": "^1.19.0",
38
- "casperjs": "^1.1.4",
39
- "cookie-parser": "^1.4.5",
40
- "es6-promise": "^4.2.8",
41
- "esprima": "^4.0.1",
42
- "expect.js": "~0.3.1",
43
- "express": "^4.17.1",
44
- "express-session": "^1.17.1",
45
- "express-useragent": "^1.0.15",
46
- "fs-extra": "^9.0.1",
47
- "istanbul": "~0.4.5",
48
- "karma": "^5.2.3",
49
- "karma-chrome-launcher": "^3.1.0",
50
- "karma-coverage": "^2.0.3",
51
- "karma-coverage-html-index-reporter": "^1.0.2",
52
- "karma-expect": "^1.1.3",
53
- "karma-firefox-launcher": "^2.1.0",
54
- "karma-ie-launcher": "^1.0.0",
55
- "karma-mocha": "^2.0.1",
56
- "karma-phantomjs-launcher": "^1.0.4",
57
- "karma-safari-launcher": "^1.0.0",
58
- "karma-slimerjs-launcher": "^1.1.0",
59
- "istanbul-middleware": "~0.2.2",
60
- "mocha": "^8.2.1",
61
- "moment": "^2.29.1",
62
- "phantomjs-prebuilt": "^2.1.16",
63
- "pug": "^3.0.0",
64
- "read-yaml-promise": "^1.0.2",
65
- "slimerjs": "^1.0.0",
66
- "ajax-best-promise": "~0.3.7",
67
- "discrepances": "~0.2.4",
68
- "json4all": "~0.3.10",
69
- "require-bro": "~0.2.2",
70
- "self-explain": "~0.10.22",
71
- "serve-content": "~0.3.13"
72
- },
73
- "optionalDependencies": {
74
- "dialog-promise": "~0.9.10",
75
- "castellano": "~0.1.3"
76
- },
77
- "engines": {
78
- "node": ">= 0.12.0"
79
- },
80
- "files": [
81
- "lib"
82
- ],
83
- "scripts": {
84
- "infinito": "node server/karma-server.js --karma karma.conf.js",
85
- "test": "node server/karma-server.js --karma karma.conf.js --single-run",
86
- "test-cov": "node server/karma-server.js --karma karma.conf.js --single-run",
87
- "ctest": "node server/pdemo-server.js --use-casper --coverage",
88
- "ctest-h": "node server/pdemo-server.js --use-casper --coverage --hold",
89
- "start": "node server/pdemo-server.js",
90
- "all": "npm test && npm run ctest && qa-control . -v",
91
- "report": "istanbul report"
92
- },
93
- "qa-control": {
94
- "package-version": "0.3.0",
95
- "coverage": 100,
96
- "run-in": "both",
97
- "stability": "extending",
98
- "type": "lib"
99
- }
100
- }
1
+ {
2
+ "name": "typed-controls",
3
+ "description": "typed controls, widgets and others",
4
+ "version": "0.9.2",
5
+ "author": "Codenautas <codenautas@googlegroups.com>",
6
+ "license": "MIT",
7
+ "repository": "codenautas/typed-controls",
8
+ "contributors": [
9
+ {
10
+ "name": "Emilio Platzer",
11
+ "email": "emilioplatzer@gmail.com"
12
+ },
13
+ {
14
+ "name": "Estefanía Capece",
15
+ "email": "eycapece@gmail.com"
16
+ },
17
+ {
18
+ "name": "Diego Florio",
19
+ "email": "diegoefe@gmail.com"
20
+ },
21
+ {
22
+ "name": "Manuel De la Penna",
23
+ "email": "manueldelapenna@gmail.com"
24
+ }
25
+ ],
26
+ "main": "lib/typed-controls.js",
27
+ "dependencies": {
28
+ "pikaday": "^1.8.2",
29
+ "best-globals": "~1.0.0",
30
+ "js-to-html": "^1.2.1",
31
+ "like-ar": "~0.3.6",
32
+ "type-store": "~0.2.41",
33
+ "dialog-promise": "~0.9.4"
34
+ },
35
+ "devDependencies": {
36
+ "big.js": "^6.1.1",
37
+ "body-parser": "^1.19.0",
38
+ "cookie-parser": "^1.4.6",
39
+ "es6-promise": "^4.2.8",
40
+ "esprima": "^4.0.1",
41
+ "expect.js": "~0.3.1",
42
+ "express": "^4.17.1",
43
+ "express-session": "^1.17.2",
44
+ "express-useragent": "^1.0.15",
45
+ "fs-extra": "^10.0.0",
46
+ "istanbul": "~0.4.5",
47
+ "karma": "^6.3.9",
48
+ "karma-chrome-launcher": "^3.1.0",
49
+ "karma-coverage": "^2.0.3",
50
+ "karma-coverage-html-index-reporter": "^1.0.2",
51
+ "karma-expect": "^1.1.3",
52
+ "karma-firefox-launcher": "^2.1.2",
53
+ "karma-mocha": "^2.0.1",
54
+ "mocha": "^9.1.3",
55
+ "moment": "^2.29.1",
56
+ "pug": "^3.0.2",
57
+ "read-yaml-promise": "^1.0.2",
58
+ "slimerjs": "^1.0.0",
59
+ "ajax-best-promise": "~0.3.7",
60
+ "discrepances": "~0.2.6",
61
+ "json4all": "~1.1.0",
62
+ "require-bro": "~0.2.2",
63
+ "self-explain": "~0.10.22",
64
+ "serve-content": "~0.3.16"
65
+ },
66
+ "optionalDependencies": {
67
+ "dialog-promise": "~0.9.14",
68
+ "castellano": "~0.1.3"
69
+ },
70
+ "engines": {
71
+ "node": ">= 14"
72
+ },
73
+ "files": [
74
+ "lib"
75
+ ],
76
+ "scripts": {
77
+ "infinito": "node server/karma-server.js --karma karma.conf.js",
78
+ "test": "node server/karma-server.js --karma karma.conf.js --single-run",
79
+ "test-cov": "node server/karma-server.js --karma karma.conf.js --single-run",
80
+ "ctest": "node server/pdemo-server.js --use-casper --coverage",
81
+ "ctest-h": "node server/pdemo-server.js --use-casper --coverage --hold",
82
+ "start": "node server/pdemo-server.js",
83
+ "all": "npm test && npm run ctest && qa-control . -v",
84
+ "report": "istanbul report"
85
+ },
86
+ "qa-control": {
87
+ "package-version": "0.3.0",
88
+ "coverage": 100,
89
+ "run-in": "both",
90
+ "stability": "extending",
91
+ "type": "lib"
92
+ }
93
+ }