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 +22 -22
- package/README.md +30 -33
- package/lib/typed-controls.js +24 -8
- package/package.json +93 -100
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
|
-

|
|
5
|
-
[](https://npmjs.org/package/typed-controls)
|
|
6
|
-
[](https://npmjs.org/package/typed-controls)
|
|
7
|
-
[](https://travis-ci.org/codenautas/typed-controls)
|
|
8
|
-
[
|
|
5
|
+
[](https://npmjs.org/package/typed-controls)
|
|
6
|
+
[](https://npmjs.org/package/typed-controls)
|
|
7
|
+
[](https://travis-ci.org/codenautas/typed-controls)
|
|
8
|
+
[](https://david-dm.org/codenautas/typed-controls)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
language: 
|
|
13
|
+
also available in:
|
|
14
|
+
[](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
|
+
|
package/lib/typed-controls.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
30
|
-
"js-to-html": "^1.
|
|
31
|
-
"like-ar": "~0.
|
|
32
|
-
"type-store": "~0.2.
|
|
33
|
-
"dialog-promise": "~0.9.4"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"big.js": "^6.
|
|
37
|
-
"body-parser": "^1.19.0",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"express": "^
|
|
44
|
-
"express-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"karma": "^
|
|
49
|
-
"karma-
|
|
50
|
-
"karma-coverage": "^
|
|
51
|
-
"karma-
|
|
52
|
-
"karma-
|
|
53
|
-
"karma-
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
},
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
}
|
|
93
|
-
|
|
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
|
+
}
|