@gisce/ooui 0.10.0 → 0.13.0
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/dist/CodeEditor.d.ts +11 -0
- package/dist/CodeEditor.js +43 -0
- package/dist/CodeEditor.js.map +1 -0
- package/dist/MultiCheckbox.d.ts +35 -0
- package/dist/MultiCheckbox.js +107 -0
- package/dist/MultiCheckbox.js.map +1 -0
- package/dist/Steps.d.ts +17 -0
- package/dist/Steps.js +60 -0
- package/dist/Steps.js.map +1 -0
- package/dist/Switch.d.ts +7 -0
- package/dist/Switch.js +26 -0
- package/dist/Switch.js.map +1 -0
- package/dist/Tags.d.ts +2 -27
- package/dist/Tags.js +4 -71
- package/dist/Tags.js.map +1 -1
- package/dist/WidgetFactory.js +16 -0
- package/dist/WidgetFactory.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/CodeEditor.ts +28 -0
- package/src/MultiCheckbox.ts +85 -0
- package/src/Steps.ts +43 -0
- package/src/Switch.ts +8 -0
- package/src/Tags.ts +2 -68
- package/src/WidgetFactory.ts +16 -0
- package/src/index.ts +10 -0
- package/src/spec/CodeEditor.spec.ts +37 -0
- package/src/spec/MultiCheckbox.spec.ts +58 -0
- package/src/spec/Steps.spec.ts +35 -0
- package/src/spec/WidgetFactory.spec.ts +33 -5
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
import Text from "./Text";
|
|
15
|
+
/**
|
|
16
|
+
* A CodeEditor widget
|
|
17
|
+
*/
|
|
18
|
+
var CodeEditor = /** @class */ (function (_super) {
|
|
19
|
+
__extends(CodeEditor, _super);
|
|
20
|
+
function CodeEditor(props) {
|
|
21
|
+
var _this = _super.call(this, props) || this;
|
|
22
|
+
_this._lang = null;
|
|
23
|
+
if (props) {
|
|
24
|
+
if (_this.parsedWidgetProps.lang) {
|
|
25
|
+
_this._lang = _this.parsedWidgetProps.lang;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
Object.defineProperty(CodeEditor.prototype, "lang", {
|
|
31
|
+
get: function () {
|
|
32
|
+
return this._lang;
|
|
33
|
+
},
|
|
34
|
+
set: function (value) {
|
|
35
|
+
this._lang = value;
|
|
36
|
+
},
|
|
37
|
+
enumerable: false,
|
|
38
|
+
configurable: true
|
|
39
|
+
});
|
|
40
|
+
return CodeEditor;
|
|
41
|
+
}(Text));
|
|
42
|
+
export default CodeEditor;
|
|
43
|
+
//# sourceMappingURL=CodeEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../src/CodeEditor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B;;GAEG;AACH;IAAyB,8BAAI;IAU3B,oBAAY,KAAU;QAAtB,YACE,kBAAM,KAAK,CAAC,SAQb;QAjBD,WAAK,GAAkB,IAAI,CAAC;QAW1B,IAAI,KAAK,EAAE;YAET,IAAI,KAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE;gBAC/B,KAAI,CAAC,KAAK,GAAG,KAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;aAC1C;SACF;;IACH,CAAC;IAhBD,sBAAI,4BAAI;aAAR;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;aACD,UAAS,KAAoB;YAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;;;OAHA;IAeH,iBAAC;AAAD,CAAC,AApBD,CAAyB,IAAI,GAoB5B;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Field from "./Field";
|
|
2
|
+
/**
|
|
3
|
+
* A Tags widget
|
|
4
|
+
*/
|
|
5
|
+
declare class MultiCheckbox extends Field {
|
|
6
|
+
/**
|
|
7
|
+
* Field size
|
|
8
|
+
*/
|
|
9
|
+
_size: number;
|
|
10
|
+
get size(): number;
|
|
11
|
+
set size(value: number);
|
|
12
|
+
/**
|
|
13
|
+
* Relation
|
|
14
|
+
*/
|
|
15
|
+
_relation: string;
|
|
16
|
+
get relation(): string;
|
|
17
|
+
set relation(value: string);
|
|
18
|
+
/**
|
|
19
|
+
* Inv_field
|
|
20
|
+
*/
|
|
21
|
+
_inv_field: string | undefined;
|
|
22
|
+
get inv_field(): string | undefined;
|
|
23
|
+
set inv_field(value: string | undefined);
|
|
24
|
+
/**
|
|
25
|
+
* field to define the value to show
|
|
26
|
+
*/
|
|
27
|
+
_field: string;
|
|
28
|
+
get field(): string;
|
|
29
|
+
set field(value: string);
|
|
30
|
+
_columns: number;
|
|
31
|
+
get columns(): number;
|
|
32
|
+
set columns(value: number);
|
|
33
|
+
constructor(props: any);
|
|
34
|
+
}
|
|
35
|
+
export default MultiCheckbox;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
import Field from "./Field";
|
|
15
|
+
/**
|
|
16
|
+
* A Tags widget
|
|
17
|
+
*/
|
|
18
|
+
var MultiCheckbox = /** @class */ (function (_super) {
|
|
19
|
+
__extends(MultiCheckbox, _super);
|
|
20
|
+
function MultiCheckbox(props) {
|
|
21
|
+
var _this = _super.call(this, props) || this;
|
|
22
|
+
/**
|
|
23
|
+
* Field size
|
|
24
|
+
*/
|
|
25
|
+
_this._size = 150;
|
|
26
|
+
/**
|
|
27
|
+
* Relation
|
|
28
|
+
*/
|
|
29
|
+
_this._relation = "";
|
|
30
|
+
/**
|
|
31
|
+
* field to define the value to show
|
|
32
|
+
*/
|
|
33
|
+
_this._field = "name";
|
|
34
|
+
_this._columns = 4;
|
|
35
|
+
if (props) {
|
|
36
|
+
if (props.size) {
|
|
37
|
+
_this._size = props.size;
|
|
38
|
+
}
|
|
39
|
+
if (props.relation) {
|
|
40
|
+
_this._relation = props.relation;
|
|
41
|
+
}
|
|
42
|
+
if (props.inv_field) {
|
|
43
|
+
_this._inv_field = props.inv_field;
|
|
44
|
+
}
|
|
45
|
+
if (_this.parsedWidgetProps.hasOwnProperty('field')) {
|
|
46
|
+
_this._field = _this.parsedWidgetProps.field;
|
|
47
|
+
}
|
|
48
|
+
if (_this.parsedWidgetProps.columns) {
|
|
49
|
+
_this._columns = _this.parsedWidgetProps.columns;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return _this;
|
|
53
|
+
}
|
|
54
|
+
Object.defineProperty(MultiCheckbox.prototype, "size", {
|
|
55
|
+
get: function () {
|
|
56
|
+
return this._size;
|
|
57
|
+
},
|
|
58
|
+
set: function (value) {
|
|
59
|
+
this._size = value;
|
|
60
|
+
},
|
|
61
|
+
enumerable: false,
|
|
62
|
+
configurable: true
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(MultiCheckbox.prototype, "relation", {
|
|
65
|
+
get: function () {
|
|
66
|
+
return this._relation;
|
|
67
|
+
},
|
|
68
|
+
set: function (value) {
|
|
69
|
+
this._relation = value;
|
|
70
|
+
},
|
|
71
|
+
enumerable: false,
|
|
72
|
+
configurable: true
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(MultiCheckbox.prototype, "inv_field", {
|
|
75
|
+
get: function () {
|
|
76
|
+
return this._inv_field;
|
|
77
|
+
},
|
|
78
|
+
set: function (value) {
|
|
79
|
+
this._inv_field = value;
|
|
80
|
+
},
|
|
81
|
+
enumerable: false,
|
|
82
|
+
configurable: true
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(MultiCheckbox.prototype, "field", {
|
|
85
|
+
get: function () {
|
|
86
|
+
return this._field;
|
|
87
|
+
},
|
|
88
|
+
set: function (value) {
|
|
89
|
+
this._field = value;
|
|
90
|
+
},
|
|
91
|
+
enumerable: false,
|
|
92
|
+
configurable: true
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(MultiCheckbox.prototype, "columns", {
|
|
95
|
+
get: function () {
|
|
96
|
+
return this._columns;
|
|
97
|
+
},
|
|
98
|
+
set: function (value) {
|
|
99
|
+
this._columns = value;
|
|
100
|
+
},
|
|
101
|
+
enumerable: false,
|
|
102
|
+
configurable: true
|
|
103
|
+
});
|
|
104
|
+
return MultiCheckbox;
|
|
105
|
+
}(Field));
|
|
106
|
+
export default MultiCheckbox;
|
|
107
|
+
//# sourceMappingURL=MultiCheckbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiCheckbox.js","sourceRoot":"","sources":["../src/MultiCheckbox.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO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I,CAAC,UAAU,CAAC;QACzB,CAAC;aACD,UAAc,KAAyB;YACrC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAHA;IAUD,sBAAI,gCAAK;aAAT;YACE,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;aACD,UAAU,KAAa;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;;;OAHA;IAMD,sBAAI,kCAAO;aAAX;YACE,OAAO,IAAI,CAAC,QAAQ,CAAC;QACvB,CAAC;aACD,UAAY,KAAa;YACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACxB,CAAC;;;OAHA;IA4BH,oBAAC;AAAD,CAAC,AA7ED,CAA4B,KAAK,GA6EhC;AAED,eAAe,aAAa,CAAC"}
|
package/dist/Steps.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Field from "./Field";
|
|
2
|
+
/**
|
|
3
|
+
* A many2one relationship field
|
|
4
|
+
*/
|
|
5
|
+
declare class Steps extends Field {
|
|
6
|
+
/**
|
|
7
|
+
* Relation
|
|
8
|
+
*/
|
|
9
|
+
_relation: string;
|
|
10
|
+
get relation(): string;
|
|
11
|
+
set relation(value: string);
|
|
12
|
+
_errorField: string | null;
|
|
13
|
+
get errorField(): string | null;
|
|
14
|
+
set errorField(value: string | null);
|
|
15
|
+
constructor(props: any);
|
|
16
|
+
}
|
|
17
|
+
export default Steps;
|
package/dist/Steps.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
import Field from "./Field";
|
|
15
|
+
/**
|
|
16
|
+
* A many2one relationship field
|
|
17
|
+
*/
|
|
18
|
+
var Steps = /** @class */ (function (_super) {
|
|
19
|
+
__extends(Steps, _super);
|
|
20
|
+
function Steps(props) {
|
|
21
|
+
var _this = _super.call(this, props) || this;
|
|
22
|
+
/**
|
|
23
|
+
* Relation
|
|
24
|
+
*/
|
|
25
|
+
_this._relation = "";
|
|
26
|
+
_this._errorField = null;
|
|
27
|
+
if (props) {
|
|
28
|
+
if (props.relation) {
|
|
29
|
+
_this._relation = props.relation;
|
|
30
|
+
}
|
|
31
|
+
if (_this.parsedWidgetProps.hasOwnProperty('error_field')) {
|
|
32
|
+
_this._errorField = _this.parsedWidgetProps.error_field;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return _this;
|
|
36
|
+
}
|
|
37
|
+
Object.defineProperty(Steps.prototype, "relation", {
|
|
38
|
+
get: function () {
|
|
39
|
+
return this._relation;
|
|
40
|
+
},
|
|
41
|
+
set: function (value) {
|
|
42
|
+
this._relation = value;
|
|
43
|
+
},
|
|
44
|
+
enumerable: false,
|
|
45
|
+
configurable: true
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(Steps.prototype, "errorField", {
|
|
48
|
+
get: function () {
|
|
49
|
+
return this._errorField;
|
|
50
|
+
},
|
|
51
|
+
set: function (value) {
|
|
52
|
+
this._errorField = value;
|
|
53
|
+
},
|
|
54
|
+
enumerable: false,
|
|
55
|
+
configurable: true
|
|
56
|
+
});
|
|
57
|
+
return Steps;
|
|
58
|
+
}(Field));
|
|
59
|
+
export default Steps;
|
|
60
|
+
//# sourceMappingURL=Steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Steps.js","sourceRoot":"","sources":["../src/Steps.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH;IAAoB,yBAAK;IAqBvB,eAAY,KAAU;QAAtB,YACE,kBAAM,KAAK,CAAC,SAYb;QAhCD;;WAEG;QACH,eAAS,GAAW,EAAE,CAAC;QAQvB,iBAAW,GAAkB,IAAI,CAAC;QAWhC,IAAI,KAAK,EAAE;YAET,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAI,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC;aACjC;YAED,IAAI,KAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE;gBACxD,KAAI,CAAC,WAAW,GAAG,KAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC;aACvD;SACF;;IACH,CAAC;IA5BD,sBAAI,2BAAQ;aAAZ;YACE,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;aACD,UAAa,KAAa;YACxB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACzB,CAAC;;;OAHA;IAMD,sBAAI,6BAAU;aAAd;YACE,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;aACD,UAAe,KAAoB;YACjC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3B,CAAC;;;OAHA;IAmBH,YAAC;AAAD,CAAC,AAnCD,CAAoB,KAAK,GAmCxB;AAED,eAAe,KAAK,CAAC"}
|
package/dist/Switch.d.ts
ADDED
package/dist/Switch.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
import Boolean from "./Boolean";
|
|
15
|
+
/**
|
|
16
|
+
* Switch
|
|
17
|
+
*/
|
|
18
|
+
var Switch = /** @class */ (function (_super) {
|
|
19
|
+
__extends(Switch, _super);
|
|
20
|
+
function Switch() {
|
|
21
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
+
}
|
|
23
|
+
return Switch;
|
|
24
|
+
}(Boolean));
|
|
25
|
+
export default Switch;
|
|
26
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../src/Switch.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC;;GAEG;AACH;IAAqB,0BAAO;IAA5B;;IAA8B,CAAC;IAAD,aAAC;AAAD,CAAC,AAA/B,CAAqB,OAAO,GAAG;AAE/B,eAAe,MAAM,CAAC"}
|
package/dist/Tags.d.ts
CHANGED
|
@@ -1,32 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MultiCheckbox from "./MultiCheckbox";
|
|
2
2
|
/**
|
|
3
3
|
* A Tags widget
|
|
4
4
|
*/
|
|
5
|
-
declare class Tags extends
|
|
6
|
-
/**
|
|
7
|
-
* Field size
|
|
8
|
-
*/
|
|
9
|
-
_size: number;
|
|
10
|
-
get size(): number;
|
|
11
|
-
set size(value: number);
|
|
12
|
-
/**
|
|
13
|
-
* Relation
|
|
14
|
-
*/
|
|
15
|
-
_relation: string;
|
|
16
|
-
get relation(): string;
|
|
17
|
-
set relation(value: string);
|
|
18
|
-
/**
|
|
19
|
-
* Inv_field
|
|
20
|
-
*/
|
|
21
|
-
_inv_field: string | undefined;
|
|
22
|
-
get inv_field(): string | undefined;
|
|
23
|
-
set inv_field(value: string | undefined);
|
|
24
|
-
/**
|
|
25
|
-
* field to define the value to show
|
|
26
|
-
*/
|
|
27
|
-
_field: string;
|
|
28
|
-
get field(): string;
|
|
29
|
-
set field(value: string);
|
|
30
|
-
constructor(props: any);
|
|
5
|
+
declare class Tags extends MultiCheckbox {
|
|
31
6
|
}
|
|
32
7
|
export default Tags;
|
package/dist/Tags.js
CHANGED
|
@@ -11,83 +11,16 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
11
11
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
12
|
};
|
|
13
13
|
})();
|
|
14
|
-
import
|
|
14
|
+
import MultiCheckbox from "./MultiCheckbox";
|
|
15
15
|
/**
|
|
16
16
|
* A Tags widget
|
|
17
17
|
*/
|
|
18
18
|
var Tags = /** @class */ (function (_super) {
|
|
19
19
|
__extends(Tags, _super);
|
|
20
|
-
function Tags(
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Field size
|
|
24
|
-
*/
|
|
25
|
-
_this._size = 150;
|
|
26
|
-
/**
|
|
27
|
-
* Relation
|
|
28
|
-
*/
|
|
29
|
-
_this._relation = "";
|
|
30
|
-
/**
|
|
31
|
-
* field to define the value to show
|
|
32
|
-
*/
|
|
33
|
-
_this._field = "name";
|
|
34
|
-
if (props) {
|
|
35
|
-
if (props.size) {
|
|
36
|
-
_this._size = props.size;
|
|
37
|
-
}
|
|
38
|
-
if (props.relation) {
|
|
39
|
-
_this._relation = props.relation;
|
|
40
|
-
}
|
|
41
|
-
if (props.inv_field) {
|
|
42
|
-
_this._inv_field = props.inv_field;
|
|
43
|
-
}
|
|
44
|
-
if (_this.parsedWidgetProps.hasOwnProperty('field')) {
|
|
45
|
-
_this._field = _this.parsedWidgetProps.field;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return _this;
|
|
20
|
+
function Tags() {
|
|
21
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
49
22
|
}
|
|
50
|
-
Object.defineProperty(Tags.prototype, "size", {
|
|
51
|
-
get: function () {
|
|
52
|
-
return this._size;
|
|
53
|
-
},
|
|
54
|
-
set: function (value) {
|
|
55
|
-
this._size = value;
|
|
56
|
-
},
|
|
57
|
-
enumerable: false,
|
|
58
|
-
configurable: true
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(Tags.prototype, "relation", {
|
|
61
|
-
get: function () {
|
|
62
|
-
return this._relation;
|
|
63
|
-
},
|
|
64
|
-
set: function (value) {
|
|
65
|
-
this._relation = value;
|
|
66
|
-
},
|
|
67
|
-
enumerable: false,
|
|
68
|
-
configurable: true
|
|
69
|
-
});
|
|
70
|
-
Object.defineProperty(Tags.prototype, "inv_field", {
|
|
71
|
-
get: function () {
|
|
72
|
-
return this._inv_field;
|
|
73
|
-
},
|
|
74
|
-
set: function (value) {
|
|
75
|
-
this._inv_field = value;
|
|
76
|
-
},
|
|
77
|
-
enumerable: false,
|
|
78
|
-
configurable: true
|
|
79
|
-
});
|
|
80
|
-
Object.defineProperty(Tags.prototype, "field", {
|
|
81
|
-
get: function () {
|
|
82
|
-
return this._field;
|
|
83
|
-
},
|
|
84
|
-
set: function (value) {
|
|
85
|
-
this._field = value;
|
|
86
|
-
},
|
|
87
|
-
enumerable: false,
|
|
88
|
-
configurable: true
|
|
89
|
-
});
|
|
90
23
|
return Tags;
|
|
91
|
-
}(
|
|
24
|
+
}(MultiCheckbox));
|
|
92
25
|
export default Tags;
|
|
93
26
|
//# sourceMappingURL=Tags.js.map
|
package/dist/Tags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tags.js","sourceRoot":"","sources":["../src/Tags.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Tags.js","sourceRoot":"","sources":["../src/Tags.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH;IAAmB,wBAAa;IAAhC;;IAAkC,CAAC;IAAD,WAAC;AAAD,CAAC,AAAnC,CAAmB,aAAa,GAAG;AAEnC,eAAe,IAAI,CAAC"}
|
package/dist/WidgetFactory.js
CHANGED
|
@@ -38,6 +38,10 @@ import Timeline from "./Timeline";
|
|
|
38
38
|
import Indicator from "./Indicator";
|
|
39
39
|
import Tags from "./Tags";
|
|
40
40
|
import Radio from "./Radio";
|
|
41
|
+
import MultiCheckbox from "./MultiCheckbox";
|
|
42
|
+
import Switch from "./Switch";
|
|
43
|
+
import Steps from "./Steps";
|
|
44
|
+
import CodeEditor from "./CodeEditor";
|
|
41
45
|
var WidgetFactory = /** @class */ (function () {
|
|
42
46
|
function WidgetFactory() {
|
|
43
47
|
}
|
|
@@ -134,6 +138,18 @@ var WidgetFactory = /** @class */ (function () {
|
|
|
134
138
|
case "radio":
|
|
135
139
|
this._widgetClass = Radio;
|
|
136
140
|
break;
|
|
141
|
+
case "multicheckbox":
|
|
142
|
+
this._widgetClass = MultiCheckbox;
|
|
143
|
+
break;
|
|
144
|
+
case "switch":
|
|
145
|
+
this._widgetClass = Switch;
|
|
146
|
+
break;
|
|
147
|
+
case "steps":
|
|
148
|
+
this._widgetClass = Steps;
|
|
149
|
+
break;
|
|
150
|
+
case "codeeditor":
|
|
151
|
+
this._widgetClass = CodeEditor;
|
|
152
|
+
break;
|
|
137
153
|
default:
|
|
138
154
|
break;
|
|
139
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetFactory.js","sourceRoot":"","sources":["../src/WidgetFactory.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS,CAAC;A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,oCAAY,GAAZ,UAAa,IAAY,EAAE,KAAU;QACnC,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE1B,gFAAgF;QAChF,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;YACnC,SAAS,GAAG,KAAK,CAAC,gBAAgB,CAAC;YACnC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;SAC7C;QAED,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;YACnC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;SAC5B;QAED,mFAAmF;QACnF,QAAQ,IAAI,EAAE;YACZ,sDAAsD;YACtD,KAAK,UAAU,CAAC;YAChB,KAAK,MAAM,CAAC;YACZ,KAAK,OAAO;gBACV,OAAO,IAAI,IAAI,CAAC,YAAY,uBAAM,KAAK,KAAE,IAAI,EAAE,SAAS,IAAG,CAAC;YAC9D,KAAK,QAAQ;gBACX,OAAO,IAAI,IAAI,CAAC,YAAY,uBACvB,KAAK,KACR,IAAI,MAAA,EACJ,UAAU,EAAE,KAAK,CAAC,IAAI,IACtB,CAAC;YACL,eAAe;YACf;gBACE,OAAO,IAAI,IAAI,CAAC,YAAY,uBAAM,KAAK,KAAE,IAAI,EAAE,SAAS,IAAG,CAAC;SAC/D;IACH,CAAC;IACH,oBAAC;AAAD,CAAC,AAtJD,IAsJC;AAED,eAAe,aAAa,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import Tree from "./Tree";
|
|
|
3
3
|
import Char from "./Char";
|
|
4
4
|
import Container from "./Container";
|
|
5
5
|
import ContainerWidget from "./ContainerWidget";
|
|
6
|
+
import NewLine from "./NewLine";
|
|
6
7
|
import Selection from "./Selection";
|
|
7
8
|
import Many2one from "./Many2one";
|
|
8
9
|
import Field from "./Field";
|
|
@@ -34,8 +35,12 @@ import Indicator from "./Indicator";
|
|
|
34
35
|
import Dashboard from "./Dashboard";
|
|
35
36
|
import DashboardItem from "./DashboardItem";
|
|
36
37
|
import Tags from "./Tags";
|
|
38
|
+
import MultiCheckbox from "./MultiCheckbox";
|
|
37
39
|
import Radio from "./Radio";
|
|
40
|
+
import Switch from "./Switch";
|
|
41
|
+
import Steps from "./Steps";
|
|
42
|
+
import CodeEditor from "./CodeEditor";
|
|
38
43
|
import { Graph, GraphAxis, GraphIndicator, GraphIndicatorField, GraphChart, GraphType, parseGraph, Operator, GraphYAxis, GraphXAxis } from "./Graph";
|
|
39
44
|
import * as graphProcessor from "./Graph/processor/graphProcessor";
|
|
40
45
|
import * as graphFieldUtils from "./Graph/processor/fieldUtils";
|
|
41
|
-
export { Char, Selection, Many2one, Field, Widget, Form, Tree, Boolean, One2many, Integer, Float, FloatTime, Date, DateTime, Many2many, SearchFilter, Container, ContainerWidget, Text, ProgressBar, Notebook, Group, Page, Label, Separator, Button, Reference, Binary, Image, parseContext, transformDomainForChildWidget, Timeline, Indicator, Dashboard, DashboardItem, Graph, GraphAxis, GraphYAxis, GraphXAxis, GraphIndicator, GraphChart, GraphType, parseGraph, Operator, GraphIndicatorField, graphProcessor, graphFieldUtils, Tags, Radio, };
|
|
46
|
+
export { Char, Selection, Many2one, Field, Widget, Form, Tree, NewLine, Boolean, One2many, Integer, Float, FloatTime, Date, DateTime, Many2many, SearchFilter, Container, ContainerWidget, Text, ProgressBar, Notebook, Group, Page, Label, Separator, Button, Reference, Binary, Image, parseContext, transformDomainForChildWidget, Timeline, Indicator, Dashboard, DashboardItem, Graph, GraphAxis, GraphYAxis, GraphXAxis, GraphIndicator, GraphChart, GraphType, parseGraph, Operator, GraphIndicatorField, graphProcessor, graphFieldUtils, Tags, MultiCheckbox, Radio, Switch, Steps, CodeEditor, };
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import Tree from "./Tree";
|
|
|
3
3
|
import Char from "./Char";
|
|
4
4
|
import Container from "./Container";
|
|
5
5
|
import ContainerWidget from "./ContainerWidget";
|
|
6
|
+
import NewLine from "./NewLine";
|
|
6
7
|
import Selection from "./Selection";
|
|
7
8
|
import Many2one from "./Many2one";
|
|
8
9
|
import Field from "./Field";
|
|
@@ -34,9 +35,13 @@ import Indicator from "./Indicator";
|
|
|
34
35
|
import Dashboard from "./Dashboard";
|
|
35
36
|
import DashboardItem from "./DashboardItem";
|
|
36
37
|
import Tags from "./Tags";
|
|
38
|
+
import MultiCheckbox from "./MultiCheckbox";
|
|
37
39
|
import Radio from "./Radio";
|
|
40
|
+
import Switch from "./Switch";
|
|
41
|
+
import Steps from "./Steps";
|
|
42
|
+
import CodeEditor from "./CodeEditor";
|
|
38
43
|
import { Graph, GraphAxis, GraphIndicator, GraphIndicatorField, GraphChart, parseGraph, GraphYAxis, GraphXAxis, } from "./Graph";
|
|
39
44
|
import * as graphProcessor from "./Graph/processor/graphProcessor";
|
|
40
45
|
import * as graphFieldUtils from "./Graph/processor/fieldUtils";
|
|
41
|
-
export { Char, Selection, Many2one, Field, Widget, Form, Tree, Boolean, One2many, Integer, Float, FloatTime, Date, DateTime, Many2many, SearchFilter, Container, ContainerWidget, Text, ProgressBar, Notebook, Group, Page, Label, Separator, Button, Reference, Binary, Image, parseContext, transformDomainForChildWidget, Timeline, Indicator, Dashboard, DashboardItem, Graph, GraphAxis, GraphYAxis, GraphXAxis, GraphIndicator, GraphChart, parseGraph, GraphIndicatorField, graphProcessor, graphFieldUtils, Tags, Radio, };
|
|
46
|
+
export { Char, Selection, Many2one, Field, Widget, Form, Tree, NewLine, Boolean, One2many, Integer, Float, FloatTime, Date, DateTime, Many2many, SearchFilter, Container, ContainerWidget, Text, ProgressBar, Notebook, Group, Page, Label, Separator, Button, Reference, Binary, Image, parseContext, transformDomainForChildWidget, Timeline, Indicator, Dashboard, DashboardItem, Graph, GraphAxis, GraphYAxis, GraphXAxis, GraphIndicator, GraphChart, parseGraph, GraphIndicatorField, graphProcessor, graphFieldUtils, Tags, MultiCheckbox, Radio, Switch, Steps, Code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EACX,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,KAAK,EACL,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,EACN,KAAK,EACL,YAAY,EACZ,6BAA6B,EAC7B,QAAQ,EACR,SAAS,EACT,SAAS,EACT,aAAa,EACb,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EAEV,UAAU,EAEV,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,IAAI,EACJ,aAAa,EACb,KAAK,EACL,MAAM,EACN,KAAK,EACL,UAAU,GACX,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Text from "./Text";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A CodeEditor widget
|
|
5
|
+
*/
|
|
6
|
+
class CodeEditor extends Text {
|
|
7
|
+
|
|
8
|
+
_lang: string | null = null;
|
|
9
|
+
get lang(): string | null {
|
|
10
|
+
return this._lang;
|
|
11
|
+
}
|
|
12
|
+
set lang(value: string | null) {
|
|
13
|
+
this._lang = value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
constructor(props: any) {
|
|
17
|
+
super(props);
|
|
18
|
+
|
|
19
|
+
if (props) {
|
|
20
|
+
|
|
21
|
+
if (this.parsedWidgetProps.lang) {
|
|
22
|
+
this._lang = this.parsedWidgetProps.lang;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default CodeEditor;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import Field from "./Field";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Tags widget
|
|
5
|
+
*/
|
|
6
|
+
class MultiCheckbox extends Field {
|
|
7
|
+
/**
|
|
8
|
+
* Field size
|
|
9
|
+
*/
|
|
10
|
+
_size: number = 150;
|
|
11
|
+
get size(): number {
|
|
12
|
+
return this._size;
|
|
13
|
+
}
|
|
14
|
+
set size(value: number) {
|
|
15
|
+
this._size = value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Relation
|
|
20
|
+
*/
|
|
21
|
+
_relation: string = "";
|
|
22
|
+
get relation(): string {
|
|
23
|
+
return this._relation;
|
|
24
|
+
}
|
|
25
|
+
set relation(value: string) {
|
|
26
|
+
this._relation = value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Inv_field
|
|
31
|
+
*/
|
|
32
|
+
_inv_field: string | undefined;
|
|
33
|
+
get inv_field(): string | undefined {
|
|
34
|
+
return this._inv_field;
|
|
35
|
+
}
|
|
36
|
+
set inv_field(value: string | undefined) {
|
|
37
|
+
this._inv_field = value;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* field to define the value to show
|
|
43
|
+
*/
|
|
44
|
+
_field: string = "name";
|
|
45
|
+
get field(): string {
|
|
46
|
+
return this._field;
|
|
47
|
+
}
|
|
48
|
+
set field(value: string) {
|
|
49
|
+
this._field = value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
_columns: number = 4;
|
|
53
|
+
get columns(): number {
|
|
54
|
+
return this._columns;
|
|
55
|
+
}
|
|
56
|
+
set columns(value: number) {
|
|
57
|
+
this._columns = value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
constructor(props: any) {
|
|
61
|
+
super(props);
|
|
62
|
+
|
|
63
|
+
if (props) {
|
|
64
|
+
if (props.size) {
|
|
65
|
+
this._size = props.size;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (props.relation) {
|
|
69
|
+
this._relation = props.relation;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (props.inv_field) {
|
|
73
|
+
this._inv_field = props.inv_field;
|
|
74
|
+
}
|
|
75
|
+
if (this.parsedWidgetProps.hasOwnProperty('field')) {
|
|
76
|
+
this._field = this.parsedWidgetProps.field
|
|
77
|
+
}
|
|
78
|
+
if (this.parsedWidgetProps.columns) {
|
|
79
|
+
this._columns = this.parsedWidgetProps.columns;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default MultiCheckbox;
|
package/src/Steps.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import Field from "./Field";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A many2one relationship field
|
|
5
|
+
*/
|
|
6
|
+
class Steps extends Field {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Relation
|
|
10
|
+
*/
|
|
11
|
+
_relation: string = "";
|
|
12
|
+
get relation(): string {
|
|
13
|
+
return this._relation;
|
|
14
|
+
}
|
|
15
|
+
set relation(value: string) {
|
|
16
|
+
this._relation = value;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
_errorField: string | null = null;
|
|
20
|
+
get errorField(): string | null {
|
|
21
|
+
return this._errorField;
|
|
22
|
+
}
|
|
23
|
+
set errorField(value: string | null) {
|
|
24
|
+
this._errorField = value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
constructor(props: any) {
|
|
28
|
+
super(props);
|
|
29
|
+
|
|
30
|
+
if (props) {
|
|
31
|
+
|
|
32
|
+
if (props.relation) {
|
|
33
|
+
this._relation = props.relation;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (this.parsedWidgetProps.hasOwnProperty('error_field')) {
|
|
37
|
+
this._errorField = this.parsedWidgetProps.error_field;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default Steps;
|
package/src/Switch.ts
ADDED
package/src/Tags.ts
CHANGED
|
@@ -1,74 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MultiCheckbox from "./MultiCheckbox";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A Tags widget
|
|
5
5
|
*/
|
|
6
|
-
class Tags extends
|
|
7
|
-
/**
|
|
8
|
-
* Field size
|
|
9
|
-
*/
|
|
10
|
-
_size: number = 150;
|
|
11
|
-
get size(): number {
|
|
12
|
-
return this._size;
|
|
13
|
-
}
|
|
14
|
-
set size(value: number) {
|
|
15
|
-
this._size = value;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Relation
|
|
20
|
-
*/
|
|
21
|
-
_relation: string = "";
|
|
22
|
-
get relation(): string {
|
|
23
|
-
return this._relation;
|
|
24
|
-
}
|
|
25
|
-
set relation(value: string) {
|
|
26
|
-
this._relation = value;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Inv_field
|
|
31
|
-
*/
|
|
32
|
-
_inv_field: string | undefined;
|
|
33
|
-
get inv_field(): string | undefined {
|
|
34
|
-
return this._inv_field;
|
|
35
|
-
}
|
|
36
|
-
set inv_field(value: string | undefined) {
|
|
37
|
-
this._inv_field = value;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* field to define the value to show
|
|
43
|
-
*/
|
|
44
|
-
_field: string = "name";
|
|
45
|
-
get field(): string {
|
|
46
|
-
return this._field;
|
|
47
|
-
}
|
|
48
|
-
set field(value: string) {
|
|
49
|
-
this._field = value;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
constructor(props: any) {
|
|
53
|
-
super(props);
|
|
54
|
-
|
|
55
|
-
if (props) {
|
|
56
|
-
if (props.size) {
|
|
57
|
-
this._size = props.size;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (props.relation) {
|
|
61
|
-
this._relation = props.relation;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (props.inv_field) {
|
|
65
|
-
this._inv_field = props.inv_field;
|
|
66
|
-
}
|
|
67
|
-
if (this.parsedWidgetProps.hasOwnProperty('field')) {
|
|
68
|
-
this._field = this.parsedWidgetProps.field
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
6
|
+
class Tags extends MultiCheckbox {}
|
|
73
7
|
|
|
74
8
|
export default Tags;
|
package/src/WidgetFactory.ts
CHANGED
|
@@ -27,6 +27,10 @@ import Timeline from "./Timeline";
|
|
|
27
27
|
import Indicator from "./Indicator";
|
|
28
28
|
import Tags from "./Tags";
|
|
29
29
|
import Radio from "./Radio";
|
|
30
|
+
import MultiCheckbox from "./MultiCheckbox";
|
|
31
|
+
import Switch from "./Switch";
|
|
32
|
+
import Steps from "./Steps";
|
|
33
|
+
import CodeEditor from "./CodeEditor";
|
|
30
34
|
|
|
31
35
|
class WidgetFactory {
|
|
32
36
|
/**
|
|
@@ -127,6 +131,18 @@ class WidgetFactory {
|
|
|
127
131
|
case "radio":
|
|
128
132
|
this._widgetClass = Radio;
|
|
129
133
|
break;
|
|
134
|
+
case "multicheckbox":
|
|
135
|
+
this._widgetClass = MultiCheckbox;
|
|
136
|
+
break;
|
|
137
|
+
case "switch":
|
|
138
|
+
this._widgetClass = Switch;
|
|
139
|
+
break;
|
|
140
|
+
case "steps":
|
|
141
|
+
this._widgetClass = Steps;
|
|
142
|
+
break;
|
|
143
|
+
case "codeeditor":
|
|
144
|
+
this._widgetClass = CodeEditor;
|
|
145
|
+
break;
|
|
130
146
|
|
|
131
147
|
default:
|
|
132
148
|
break;
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import Tree from "./Tree";
|
|
|
3
3
|
import Char from "./Char";
|
|
4
4
|
import Container from "./Container";
|
|
5
5
|
import ContainerWidget from "./ContainerWidget";
|
|
6
|
+
import NewLine from "./NewLine";
|
|
6
7
|
import Selection from "./Selection";
|
|
7
8
|
import Many2one from "./Many2one";
|
|
8
9
|
import Field from "./Field";
|
|
@@ -34,7 +35,11 @@ import Indicator from "./Indicator";
|
|
|
34
35
|
import Dashboard from "./Dashboard";
|
|
35
36
|
import DashboardItem from "./DashboardItem";
|
|
36
37
|
import Tags from "./Tags";
|
|
38
|
+
import MultiCheckbox from "./MultiCheckbox";
|
|
37
39
|
import Radio from "./Radio";
|
|
40
|
+
import Switch from "./Switch";
|
|
41
|
+
import Steps from "./Steps";
|
|
42
|
+
import CodeEditor from "./CodeEditor";
|
|
38
43
|
|
|
39
44
|
import {
|
|
40
45
|
Graph,
|
|
@@ -60,6 +65,7 @@ export {
|
|
|
60
65
|
Widget,
|
|
61
66
|
Form,
|
|
62
67
|
Tree,
|
|
68
|
+
NewLine,
|
|
63
69
|
Boolean,
|
|
64
70
|
One2many,
|
|
65
71
|
Integer,
|
|
@@ -101,5 +107,9 @@ export {
|
|
|
101
107
|
graphProcessor,
|
|
102
108
|
graphFieldUtils,
|
|
103
109
|
Tags,
|
|
110
|
+
MultiCheckbox,
|
|
104
111
|
Radio,
|
|
112
|
+
Switch,
|
|
113
|
+
Steps,
|
|
114
|
+
CodeEditor,
|
|
105
115
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import WidgetFactory from "../WidgetFactory";
|
|
2
|
+
|
|
3
|
+
describe("A CodeEditor widget", () => {
|
|
4
|
+
it("should have an id corresponding to field name", () => {
|
|
5
|
+
const widgetFactory = new WidgetFactory();
|
|
6
|
+
const props = {
|
|
7
|
+
name: "code",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const widget = widgetFactory.createWidget("codeeditor", props);
|
|
11
|
+
|
|
12
|
+
expect(widget.id).toBe("code");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("should have default lang to null", () => {
|
|
16
|
+
const widgetFactory = new WidgetFactory();
|
|
17
|
+
const props = {
|
|
18
|
+
name: "code",
|
|
19
|
+
};
|
|
20
|
+
const widget = widgetFactory.createWidget("codeeditor", props);
|
|
21
|
+
|
|
22
|
+
expect(widget.lang).toBe(null);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("should properly set lang", () => {
|
|
26
|
+
const widgetFactory = new WidgetFactory();
|
|
27
|
+
const props = {
|
|
28
|
+
name: "code",
|
|
29
|
+
widget_props: "{'lang': 'xml'}",
|
|
30
|
+
};
|
|
31
|
+
const widget = widgetFactory.createWidget("codeeditor", props);
|
|
32
|
+
|
|
33
|
+
expect(widget.lang).toBe("xml");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import WidgetFactory from "../WidgetFactory";
|
|
2
|
+
|
|
3
|
+
describe("A MultiCheckbox widget", () => {
|
|
4
|
+
it("should have an id corresponding to field name", () => {
|
|
5
|
+
const widgetFactory = new WidgetFactory();
|
|
6
|
+
const props = {
|
|
7
|
+
name: "one2many1",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const widget = widgetFactory.createWidget("multicheckbox", props);
|
|
11
|
+
|
|
12
|
+
expect(widget.id).toBe("one2many1");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe("Parsing widget props", () => {
|
|
16
|
+
it("should properly set field", () => {
|
|
17
|
+
const widgetFactory = new WidgetFactory();
|
|
18
|
+
const props = {
|
|
19
|
+
name: "one2many1",
|
|
20
|
+
widget_props: "{'field': 'foo'}",
|
|
21
|
+
};
|
|
22
|
+
const widget = widgetFactory.createWidget("multicheckbox", props);
|
|
23
|
+
|
|
24
|
+
expect(widget.field).toBe("foo");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("should have default field to 'name'", () => {
|
|
28
|
+
const widgetFactory = new WidgetFactory();
|
|
29
|
+
const props = {
|
|
30
|
+
name: "one2many1",
|
|
31
|
+
};
|
|
32
|
+
const widget = widgetFactory.createWidget("multicheckbox", props);
|
|
33
|
+
|
|
34
|
+
expect(widget.field).toBe("name");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("should have the number of columns default 4", () => {
|
|
38
|
+
const widgetFactory = new WidgetFactory();
|
|
39
|
+
const props = {
|
|
40
|
+
name: "one2many1",
|
|
41
|
+
};
|
|
42
|
+
const widget = widgetFactory.createWidget("multicheckbox", props);
|
|
43
|
+
|
|
44
|
+
expect(widget.columns).toBe(4);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("should parse the number of columns", () => {
|
|
48
|
+
const widgetFactory = new WidgetFactory();
|
|
49
|
+
const props = {
|
|
50
|
+
name: "one2many1",
|
|
51
|
+
widget_props: "{'columns': 6}"
|
|
52
|
+
};
|
|
53
|
+
const widget = widgetFactory.createWidget("multicheckbox", props);
|
|
54
|
+
|
|
55
|
+
expect(widget.columns).toBe(6);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import WidgetFactory from "../WidgetFactory";
|
|
2
|
+
|
|
3
|
+
describe("A Steps widget", () => {
|
|
4
|
+
it("should have an id corresponding to field name", () => {
|
|
5
|
+
const widgetFactory = new WidgetFactory();
|
|
6
|
+
const props = {
|
|
7
|
+
name: "state",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const widget = widgetFactory.createWidget("steps", props);
|
|
11
|
+
expect(widget.id).toBe("state");
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("should have default errorField to undefined", () => {
|
|
15
|
+
const widgetFactory = new WidgetFactory();
|
|
16
|
+
const props = {
|
|
17
|
+
name: "state",
|
|
18
|
+
};
|
|
19
|
+
const widget = widgetFactory.createWidget("steps", props);
|
|
20
|
+
|
|
21
|
+
expect(widget.errorField).toBe(null);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("should properly set field", () => {
|
|
25
|
+
const widgetFactory = new WidgetFactory();
|
|
26
|
+
const props = {
|
|
27
|
+
name: "state",
|
|
28
|
+
widget_props: "{'error_field': 'error'}",
|
|
29
|
+
};
|
|
30
|
+
const widget = widgetFactory.createWidget("steps", props);
|
|
31
|
+
|
|
32
|
+
expect(widget.errorField).toBe("error");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
});
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import Char from "../Char";
|
|
2
|
-
import Button from "../Button";
|
|
3
|
-
import NewLine from "../NewLine";
|
|
4
|
-
import Tags from "../Tags";
|
|
5
|
-
import Radio from "../Radio";
|
|
6
1
|
import WidgetFactory from "../WidgetFactory";
|
|
2
|
+
import { Char, Button, NewLine, Tags, MultiCheckbox, Radio, Switch, Steps, CodeEditor } from "..";
|
|
7
3
|
|
|
8
4
|
|
|
9
5
|
describe('A WidgetFactory', () => {
|
|
@@ -48,6 +44,14 @@ describe('A WidgetFactory', () => {
|
|
|
48
44
|
expect(widget.type).toBe("tags");
|
|
49
45
|
});
|
|
50
46
|
|
|
47
|
+
it('should be able to retrieve MultiCheckbox type', () => {
|
|
48
|
+
const widgetFactory = new WidgetFactory();
|
|
49
|
+
const props = {};
|
|
50
|
+
const widget = widgetFactory.createWidget("multicheckbox", props);
|
|
51
|
+
expect(widget).toBeInstanceOf(MultiCheckbox);
|
|
52
|
+
expect(widget.type).toBe("multicheckbox");
|
|
53
|
+
});
|
|
54
|
+
|
|
51
55
|
it('should be able to retrieve Radio type', () => {
|
|
52
56
|
const widgetFactory = new WidgetFactory();
|
|
53
57
|
const props = {};
|
|
@@ -55,4 +59,28 @@ describe('A WidgetFactory', () => {
|
|
|
55
59
|
expect(widget).toBeInstanceOf(Radio);
|
|
56
60
|
expect(widget.type).toBe("radio");
|
|
57
61
|
});
|
|
62
|
+
|
|
63
|
+
it('should be able to retrieve Switch type', () => {
|
|
64
|
+
const widgetFactory = new WidgetFactory();
|
|
65
|
+
const props = {};
|
|
66
|
+
const widget = widgetFactory.createWidget("switch", props);
|
|
67
|
+
expect(widget).toBeInstanceOf(Switch);
|
|
68
|
+
expect(widget.type).toBe("switch");
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('should be able to retrieve Steps type', () => {
|
|
72
|
+
const widgetFactory = new WidgetFactory();
|
|
73
|
+
const props = {};
|
|
74
|
+
const widget = widgetFactory.createWidget("steps", props);
|
|
75
|
+
expect(widget).toBeInstanceOf(Steps);
|
|
76
|
+
expect(widget.type).toBe("steps");
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('should be able to retrieve CodeEditor type', () => {
|
|
80
|
+
const widgetFactory = new WidgetFactory();
|
|
81
|
+
const props = {};
|
|
82
|
+
const widget = widgetFactory.createWidget("codeeditor", props);
|
|
83
|
+
expect(widget).toBeInstanceOf(CodeEditor);
|
|
84
|
+
expect(widget.type).toBe("codeeditor");
|
|
85
|
+
});
|
|
58
86
|
});
|