typed-controls 0.12.2 → 0.12.5
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 +0 -1
- package/README.md +29 -30
- package/lib/typed-controls.js +17 -17
- package/package.json +31 -24
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
# typed-controls
|
|
2
|
-
typed controls, widgets and others
|
|
3
|
-
|
|
4
|
-
](https://npmjs.org/package/typed-controls)
|
|
5
|
+
[](https://npmjs.org/package/typed-controls)
|
|
6
|
+
[](https://github.com/codenautas/typed-controls/actions/workflows/build-and-test.yml)
|
|
7
|
+
[](https://coveralls.io/r/codenautas/typed-controls)
|
|
8
|
+
[](https://socket.dev/npm/package/typed-controls)
|
|
9
|
+
[](https://github.com/codenautas/typed-controls/actions/workflows/qa-control.yml)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
language: 
|
|
14
|
+
also available in:
|
|
15
|
+
[](LEEME.md)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
$ npm install typed-controls
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## License
|
|
26
|
+
|
|
27
|
+
[MIT](LICENSE)
|
|
28
|
+
|
|
29
|
+
----------------
|
package/lib/typed-controls.js
CHANGED
|
@@ -91,7 +91,7 @@ TypedControls.Form.prototype.render = function render(container){
|
|
|
91
91
|
var formHtml=html.div({id: JSON.stringify(this.medium.superId)},
|
|
92
92
|
this.info.fields.map(function(field){
|
|
93
93
|
return html.div({id:'div_'+field.name},[
|
|
94
|
-
html.label({"for":field.name},field.name),
|
|
94
|
+
html.label({"for":field.name},field.name),
|
|
95
95
|
html.input({id:field.name})
|
|
96
96
|
]);
|
|
97
97
|
})
|
|
@@ -147,9 +147,9 @@ TypedControls.optionsCtrl = function optionsCtrl(typeInfo){
|
|
|
147
147
|
return html.div({"typed-controls-option-group": 'simple-option'},
|
|
148
148
|
options.map(function(option){
|
|
149
149
|
return html.div([
|
|
150
|
-
(typeInfo.showOption?html.label({"for-value": option.option},option.option):null),
|
|
151
|
-
html.input({type:'radio', value:option.option}),
|
|
152
|
-
html.label({"for-value": option.option},option.label),
|
|
150
|
+
(typeInfo.showOption?html.label({"for-value": option.option},option.option):null),
|
|
151
|
+
html.input({type:'radio', value:option.option}),
|
|
152
|
+
html.label({"for-value": option.option},option.label),
|
|
153
153
|
(option.more?html.span({"for-value": option.option, "class":"option-more-info"}):null)
|
|
154
154
|
]);
|
|
155
155
|
})
|
|
@@ -507,7 +507,7 @@ BestControls.boolean = {
|
|
|
507
507
|
{tagName:'input' , attributes:{type:'checkbox'}, mainUpdateEventName:'change'},
|
|
508
508
|
],
|
|
509
509
|
defaultOptions:[
|
|
510
|
-
{option: true , labelId: 'Yes'},
|
|
510
|
+
{option: true , labelId: 'Yes'},
|
|
511
511
|
{option: false, labelId: 'No'},
|
|
512
512
|
]
|
|
513
513
|
};
|
|
@@ -549,7 +549,7 @@ BestControls.date = {
|
|
|
549
549
|
}else if(this.type==='date'){
|
|
550
550
|
this.value = typedValue.toISOString().substr(0,10);
|
|
551
551
|
}else{
|
|
552
|
-
var month = typedValue.getUTCMonth()+1;
|
|
552
|
+
var month = typedValue.getUTCMonth()+1;
|
|
553
553
|
var day = typedValue.getUTCDate();
|
|
554
554
|
var year = typedValue.getUTCFullYear();
|
|
555
555
|
this.setPlainValue(day+'/'+month+'/'+year);
|
|
@@ -564,7 +564,7 @@ BestControls.date = {
|
|
|
564
564
|
this.innerHTML = rta;
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
|
|
567
|
+
|
|
568
568
|
},
|
|
569
569
|
},
|
|
570
570
|
listeners:{
|
|
@@ -574,7 +574,7 @@ BestControls.date = {
|
|
|
574
574
|
var now=new Date();
|
|
575
575
|
this.controledType.setTypedValue(new Date(now.getFullYear(),now.getMonth(),now.getDate()));
|
|
576
576
|
event.preventDefault();
|
|
577
|
-
}
|
|
577
|
+
}
|
|
578
578
|
},
|
|
579
579
|
},
|
|
580
580
|
domFixtures:[
|
|
@@ -714,7 +714,7 @@ TypedControls.adaptElement = function adaptElement(domElement, typerOrTypeInfo){
|
|
|
714
714
|
domElement.setAttribute("typed-controls-option-group",idElement);
|
|
715
715
|
domElement.typedControlsValidOptions={};
|
|
716
716
|
domElement.moreInfo={};
|
|
717
|
-
// var childs=domElement.childNodes;
|
|
717
|
+
// var childs=domElement.childNodes;
|
|
718
718
|
domElement.optionControl={};
|
|
719
719
|
var inputElement=domElement.getElementsByClassName('typed-control-input-for-options');
|
|
720
720
|
inputElement = inputElement?inputElement[0]:null;
|
|
@@ -998,7 +998,7 @@ TypedControls.adaptElement = function adaptElement(domElement, typerOrTypeInfo){
|
|
|
998
998
|
if(plainValue==null){
|
|
999
999
|
this.setAttribute('typed-controls-status','null');
|
|
1000
1000
|
}else{
|
|
1001
|
-
var typer = this.controledType;
|
|
1001
|
+
var typer = this.controledType; // eslint-disable-line no-redeclare
|
|
1002
1002
|
var reason = !typer.isValidLocalString(plainValue);
|
|
1003
1003
|
if(reason){
|
|
1004
1004
|
this.setAttribute('typed-controls-status','error');
|
|
@@ -1038,7 +1038,7 @@ TypedControls.adaptElement = function adaptElement(domElement, typerOrTypeInfo){
|
|
|
1038
1038
|
var setSignal = function(){
|
|
1039
1039
|
if(TypedControls.ENABLE_SIGNALS && typer.typeInfo.typeName!='text' || TypedControls.ENABLE_SIGNALS4ALL){
|
|
1040
1040
|
var plainValue = typedValue && typer.typeInfo.typeName=='date'?typedValue.toLocaleDateString():typedValue;
|
|
1041
|
-
if(plainValue==TypedControls.SIGNAL_UNKNOWN_DATA || plainValue==TypedControls.VALUE_UNKNOWN_DATA ||
|
|
1041
|
+
if(plainValue==TypedControls.SIGNAL_UNKNOWN_DATA || plainValue==TypedControls.VALUE_UNKNOWN_DATA ||
|
|
1042
1042
|
(self.controledType.typeInfo.valueUnknownData && self.controledType.typeInfo.valueUnknownData == plainValue)){
|
|
1043
1043
|
self.setAttribute('typed-controls-signal-unknown-data','1');
|
|
1044
1044
|
}else{
|
|
@@ -1090,7 +1090,7 @@ TypedControls.adaptElement = function adaptElement(domElement, typerOrTypeInfo){
|
|
|
1090
1090
|
setup.catchFun(err);
|
|
1091
1091
|
});
|
|
1092
1092
|
})
|
|
1093
|
-
break;
|
|
1093
|
+
break;
|
|
1094
1094
|
default:
|
|
1095
1095
|
setup.preDialogFun(self, typedValue).then(function(){
|
|
1096
1096
|
confirmPromise(setup.message,setup.opts).then(function(){
|
|
@@ -1153,7 +1153,7 @@ TypedControls.pickDate = function pickDate(actualValue, label, opts){
|
|
|
1153
1153
|
if(window.miniMenuPromise){
|
|
1154
1154
|
window.addEventListener('load', function(){
|
|
1155
1155
|
TypedControls.Expanders.push({
|
|
1156
|
-
whenType: function(typedControl){
|
|
1156
|
+
whenType: function(typedControl){
|
|
1157
1157
|
var typeInfo = typedControl.controledType.typeInfo;
|
|
1158
1158
|
return typeInfo.typeName === 'boolean';
|
|
1159
1159
|
},
|
|
@@ -1176,7 +1176,7 @@ if(window.miniMenuPromise){
|
|
|
1176
1176
|
}
|
|
1177
1177
|
});
|
|
1178
1178
|
TypedControls.Expanders.push({
|
|
1179
|
-
whenType: function(typedControl){
|
|
1179
|
+
whenType: function(typedControl){
|
|
1180
1180
|
var typeInfo = typedControl.controledType.typeInfo;
|
|
1181
1181
|
return typeInfo.options;
|
|
1182
1182
|
},
|
|
@@ -1201,7 +1201,7 @@ if(window.miniMenuPromise){
|
|
|
1201
1201
|
}
|
|
1202
1202
|
});
|
|
1203
1203
|
TypedControls.Expanders.push({
|
|
1204
|
-
whenType: function(typedControl){
|
|
1204
|
+
whenType: function(typedControl){
|
|
1205
1205
|
var typer = typedControl.controledType;
|
|
1206
1206
|
return typer.typeInfo.typeName == 'date';
|
|
1207
1207
|
},
|
|
@@ -1223,7 +1223,7 @@ if(window.miniMenuPromise){
|
|
|
1223
1223
|
}
|
|
1224
1224
|
});
|
|
1225
1225
|
TypedControls.Expanders.push({
|
|
1226
|
-
whenType: function(typedControl){
|
|
1226
|
+
whenType: function(typedControl){
|
|
1227
1227
|
var typer = typedControl.controledType;
|
|
1228
1228
|
return !typer.typeInfo.clientSide;
|
|
1229
1229
|
},
|
|
@@ -1260,4 +1260,4 @@ if(window.miniMenuPromise){
|
|
|
1260
1260
|
|
|
1261
1261
|
return TypedControls;
|
|
1262
1262
|
|
|
1263
|
-
});
|
|
1263
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typed-controls",
|
|
3
3
|
"description": "typed controls, widgets and others",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.5",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/typed-controls",
|
|
@@ -24,26 +24,33 @@
|
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
26
|
"main": "lib/typed-controls.js",
|
|
27
|
+
"overrides": {
|
|
28
|
+
"diff": ">=8.0.2",
|
|
29
|
+
"serialize-javascript": ">=7.0.0",
|
|
30
|
+
"uuid": ">=14.0.0"
|
|
31
|
+
},
|
|
27
32
|
"dependencies": {
|
|
33
|
+
"best-globals": "^2.2.2",
|
|
34
|
+
"js-to-html": "^1.3.6",
|
|
35
|
+
"like-ar": "^0.5.3",
|
|
28
36
|
"pikaday": "^1.8.2",
|
|
29
|
-
"
|
|
30
|
-
"js-to-html": "^1.3.2",
|
|
31
|
-
"like-ar": "^0.5.1",
|
|
32
|
-
"type-store": "^0.4.4",
|
|
33
|
-
"dialog-promise": "^0.10.0"
|
|
37
|
+
"type-store": "^0.4.12"
|
|
34
38
|
},
|
|
35
39
|
"devDependencies": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
40
|
+
"ajax-best-promise": "~0.4.3",
|
|
41
|
+
"big.js": "^7.0.1",
|
|
42
|
+
"body-parser": "^2.3.0",
|
|
38
43
|
"cookie-parser": "^1.4.7",
|
|
44
|
+
"discrepances": "^0.2.14",
|
|
39
45
|
"es6-promise": "^4.2.8",
|
|
40
46
|
"esprima": "^4.0.1",
|
|
41
47
|
"expect.js": "~0.3.1",
|
|
42
|
-
"express": "^
|
|
43
|
-
"express-session": "^1.
|
|
44
|
-
"express-useragent": "^
|
|
45
|
-
"fs-extra": "^11.
|
|
48
|
+
"express": "^5.2.1",
|
|
49
|
+
"express-session": "^1.19.0",
|
|
50
|
+
"express-useragent": "^2.2.0",
|
|
51
|
+
"fs-extra": "^11.3.5",
|
|
46
52
|
"istanbul": "^0.4.5",
|
|
53
|
+
"json4all": "^1.4.4",
|
|
47
54
|
"karma": "^6.4.4",
|
|
48
55
|
"karma-chrome-launcher": "^3.2.0",
|
|
49
56
|
"karma-coverage": "^2.2.1",
|
|
@@ -51,22 +58,20 @@
|
|
|
51
58
|
"karma-expect": "^1.1.3",
|
|
52
59
|
"karma-firefox-launcher": "^2.1.3",
|
|
53
60
|
"karma-mocha": "^2.0.1",
|
|
54
|
-
"mocha": "^
|
|
61
|
+
"mocha": "^11.7.6",
|
|
55
62
|
"moment": "^2.30.1",
|
|
56
|
-
"pug": "^3.0.
|
|
63
|
+
"pug": "^3.0.4",
|
|
57
64
|
"read-yaml-promise": "^1.0.2",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"discrepances": "^0.2.8",
|
|
61
|
-
"json4all": "^1.4.0",
|
|
62
|
-
"require-bro": "^0.3.1",
|
|
65
|
+
"require-bro": "^0.3.6",
|
|
66
|
+
"qa-control": "^0.7.0",
|
|
63
67
|
"self-explain": "^0.11.0",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
68
|
+
"serve-content": "^1.0.4",
|
|
69
|
+
"server4test": "^1.0.0",
|
|
70
|
+
"slimerjs": "^1.0.0"
|
|
66
71
|
},
|
|
67
72
|
"optionalDependencies": {
|
|
68
|
-
"
|
|
69
|
-
"
|
|
73
|
+
"castellano": "~0.1.5",
|
|
74
|
+
"dialog-promise": "~0.10.5"
|
|
70
75
|
},
|
|
71
76
|
"engines": {
|
|
72
77
|
"node": ">= 14"
|
|
@@ -77,6 +82,7 @@
|
|
|
77
82
|
"scripts": {
|
|
78
83
|
"infinito": "node server/karma-server.js --karma karma.conf.js",
|
|
79
84
|
"test": "node server/karma-server.js --karma karma.conf.js --single-run",
|
|
85
|
+
"test-ci": "npm test",
|
|
80
86
|
"test-cov": "node server/karma-server.js --karma karma.conf.js --single-run",
|
|
81
87
|
"ctest": "node server/pdemo-server.js --use-casper --coverage",
|
|
82
88
|
"ctest-h": "node server/pdemo-server.js --use-casper --coverage --hold",
|
|
@@ -90,6 +96,7 @@
|
|
|
90
96
|
"coverage": 100,
|
|
91
97
|
"run-in": "both",
|
|
92
98
|
"stability": "extending",
|
|
93
|
-
"type": "lib"
|
|
99
|
+
"type": "lib",
|
|
100
|
+
"gha": "all"
|
|
94
101
|
}
|
|
95
102
|
}
|