@gisce/ooui 0.9.1 → 0.12.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/Label.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import Field from "./Field";
2
+ declare type LabelType = "secondary" | "success" | "warning" | "danger" | "default";
3
+ declare type LabelSize = "h1" | "h2" | "h3" | "h4" | "h5" | "text";
2
4
  declare class Label extends Field {
3
5
  /**
4
6
  * Label text
@@ -12,6 +14,18 @@ declare class Label extends Field {
12
14
  _align: string;
13
15
  get align(): string;
14
16
  set align(value: string);
17
+ /**
18
+ * Label type
19
+ */
20
+ _labelType: LabelType;
21
+ get labelType(): LabelType;
22
+ set labelType(value: LabelType);
23
+ /**
24
+ * Label size
25
+ */
26
+ _labelSize: LabelSize;
27
+ get labelSize(): LabelSize;
28
+ set labelSize(value: LabelSize);
15
29
  /**
16
30
  * Id of the field that this label goes with. Null if it's an independent label
17
31
  */
package/dist/Label.js CHANGED
@@ -35,6 +35,14 @@ var Label = /** @class */ (function (_super) {
35
35
  * Align text
36
36
  */
37
37
  _this._align = "left";
38
+ /**
39
+ * Label type
40
+ */
41
+ _this._labelType = "default";
42
+ /**
43
+ * Label size
44
+ */
45
+ _this._labelSize = "text";
38
46
  /**
39
47
  * Id of the field that this label goes with. Null if it's an independent label
40
48
  */
@@ -42,6 +50,14 @@ var Label = /** @class */ (function (_super) {
42
50
  if (props === null || props === void 0 ? void 0 : props.fieldForLabel) {
43
51
  _this._fieldForLabel = props.fieldForLabel;
44
52
  }
53
+ if (props.widget_props) {
54
+ if (_this.parsedWidgetProps.label_type) {
55
+ _this.labelType = _this.parsedWidgetProps.label_type;
56
+ }
57
+ if (_this.parsedWidgetProps.label_size) {
58
+ _this.labelSize = _this.parsedWidgetProps.label_size;
59
+ }
60
+ }
45
61
  return _this;
46
62
  }
47
63
  Object.defineProperty(Label.prototype, "text", {
@@ -64,6 +80,26 @@ var Label = /** @class */ (function (_super) {
64
80
  enumerable: false,
65
81
  configurable: true
66
82
  });
83
+ Object.defineProperty(Label.prototype, "labelType", {
84
+ get: function () {
85
+ return this._labelType;
86
+ },
87
+ set: function (value) {
88
+ this._labelType = value;
89
+ },
90
+ enumerable: false,
91
+ configurable: true
92
+ });
93
+ Object.defineProperty(Label.prototype, "labelSize", {
94
+ get: function () {
95
+ return this._labelSize;
96
+ },
97
+ set: function (value) {
98
+ this._labelSize = value;
99
+ },
100
+ enumerable: false,
101
+ configurable: true
102
+ });
67
103
  Object.defineProperty(Label.prototype, "fieldForLabel", {
68
104
  get: function () {
69
105
  return this._fieldForLabel;
package/dist/Label.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"","sources":["../src/Label.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;IAAoB,yBAAK;IAkCvB,eAAY,KAAW;QAAvB,YACE,wCAAW,KAAK,KAAE,OAAO,EAAE,IAAI,IAAG,SAKnC;QAvCD;;WAEG;QACH,WAAK,GAAW,EAAE,CAAC;QAQnB;;WAEG;QACH,YAAM,GAAW,MAAM,CAAC;QAQxB;;WAEG;QACH,oBAAc,GAAkB,IAAI,CAAC;QAWnC,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,EAAE;YACxB,KAAI,CAAC,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC;SAC3C;;IACH,CAAC;IAnCD,sBAAI,uBAAI;aAAR;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;aACD,UAAS,KAAa;YACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;;;OAHA;IASD,sBAAI,wBAAK;aAAT;YACE,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;aACD,UAAU,KAAa;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;;;OAHA;IAS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AAK,CAAC;QACrB,CAAC;;;OAHA;IASD,sBAAI,wBAAK;aAAT;YACE,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;aACD,UAAU,KAAa;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;;;OAHA;IASD,sBAAI,4BAAS;aAAb;YACE,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,CAAC;aACD,UAAc,KAAgB;YAC5B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAHA;IASA,sBAAI,4BAAS;aAAb;YACE,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,CAAC;aACD,UAAc,KAAgB;YAC5B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAHA;IAUF,sBAAI,gCAAa;aAAjB;YACE,OAAO,IAAI,CAAC,cAAc,CAAC;QAC7B,CAAC;aACD,UAAkB,KAAoB;YACpC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC9B,CAAC;;;OAHA;IAoBH,YAAC;AAAD,CAAC,AAxED,CAAoB,KAAK,GAwExB;AAED,eAAe,KAAK,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,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH;IAA4B,iCAAK;IAsD/B,uBAAY,KAAU;QAAtB,YACE,kBAAM,KAAK,CAAC,SAqBb;QA3ED;;WAEG;QACH,WAAK,GAAW,GAAG,CAAC;QAQpB;;WAEG;QACH,eAAS,GAAW,EAAE,CAAC;QAoBvB;;WAEG;QACH,YAAM,GAAW,MAAM,CAAC;QAQxB,cAAQ,GAAW,CAAC,CAAC;QAWnB,IAAI,KAAK,EAAE;YACT,IAAI,KAAK,CAAC,IAAI,EAAE;gBACd,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;aACzB;YAED,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAI,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC;aACjC;YAED,IAAI,KAAK,CAAC,SAAS,EAAE;gBACnB,KAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC;aACnC;YACD,IAAI,KAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;gBAClD,KAAI,CAAC,MAAM,GAAG,KAAI,CAAC,iBAAiB,CAAC,KAAK,CAAA;aAC3C;YACD,IAAI,KAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE;gBAClC,KAAI,CAAC,QAAQ,GAAG,KAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;aAChD;SACF;;IACH,CAAC;IAvED,sBAAI,+BAAI;aAAR;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;aACD,UAAS,KAAa;YACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;;;OAHA;IASD,sBAAI,mCAAQ;aAAZ;YACE,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;aACD,UAAa,KAAa;YACxB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACzB,CAAC;;;OAHA;IASD,sBAAI,oCAAS;aAAb;YACE,OAAO,IAAI,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"}
@@ -0,0 +1,15 @@
1
+ import Selection from "./Selection";
2
+ declare type directionType = "horizontal" | "vertical";
3
+ /**
4
+ * Selection field for key-value lists
5
+ */
6
+ declare class Radio extends Selection {
7
+ /**
8
+ * Define the direction
9
+ */
10
+ _direction: directionType;
11
+ get direction(): directionType;
12
+ set direction(value: directionType);
13
+ constructor(props: any);
14
+ }
15
+ export default Radio;
package/dist/Radio.js ADDED
@@ -0,0 +1,46 @@
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 Selection from "./Selection";
15
+ /**
16
+ * Selection field for key-value lists
17
+ */
18
+ var Radio = /** @class */ (function (_super) {
19
+ __extends(Radio, _super);
20
+ function Radio(props) {
21
+ var _this = _super.call(this, props) || this;
22
+ /**
23
+ * Define the direction
24
+ */
25
+ _this._direction = "horizontal";
26
+ if (props) {
27
+ if (_this.parsedWidgetProps.hasOwnProperty('direction')) {
28
+ _this._direction = _this.parsedWidgetProps.direction;
29
+ }
30
+ }
31
+ return _this;
32
+ }
33
+ Object.defineProperty(Radio.prototype, "direction", {
34
+ get: function () {
35
+ return this._direction;
36
+ },
37
+ set: function (value) {
38
+ this._direction = value;
39
+ },
40
+ enumerable: false,
41
+ configurable: true
42
+ });
43
+ return Radio;
44
+ }(Selection));
45
+ export default Radio;
46
+ //# sourceMappingURL=Radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../src/Radio.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAIpC;;GAEG;AACH;IAAoB,yBAAS;IAa3B,eAAY,KAAU;QAAtB,YACE,kBAAM,KAAK,CAAC,SAOb;QAnBD;;UAEE;QACF,gBAAU,GAAkB,YAAY,CAAC;QAWvC,IAAI,KAAK,EAAE;YACT,IAAI,KAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE;gBACtD,KAAI,CAAC,UAAU,GAAG,KAAI,CAAC,iBAAiB,CAAC,SAAS,CAAA;aACnD;SACF;;IACH,CAAC;IAfD,sBAAI,4BAAS;aAAb;YACE,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,CAAC;aACD,UAAc,KAAoB;YAChC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAHA;IAeH,YAAC;AAAD,CAAC,AAvBD,CAAoB,SAAS,GAuB5B;AAED,eAAe,KAAK,CAAC"}
@@ -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"}
@@ -0,0 +1,7 @@
1
+ import Boolean from "./Boolean";
2
+ /**
3
+ * Switch
4
+ */
5
+ declare class Switch extends Boolean {
6
+ }
7
+ export default Switch;
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 Field from "./Field";
1
+ import MultiCheckbox from "./MultiCheckbox";
2
2
  /**
3
3
  * A Tags widget
4
4
  */
5
- declare class Tags 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
- 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 Field from "./Field";
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(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
- 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
- }(Field));
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,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH;IAAmB,wBAAK;IA8CtB,cAAY,KAAU;QAAtB,YACE,kBAAM,KAAK,CAAC,SAkBb;QAhED;;WAEG;QACH,WAAK,GAAW,GAAG,CAAC;QAQpB;;WAEG;QACH,eAAS,GAAW,EAAE,CAAC;QAoBvB;;WAEG;QACH,YAAM,GAAW,MAAM,CAAC;QAWtB,IAAI,KAAK,EAAE;YACT,IAAI,KAAK,CAAC,IAAI,EAAE;gBACd,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;aACzB;YAED,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAI,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC;aACjC;YAED,IAAI,KAAK,CAAC,SAAS,EAAE;gBACnB,KAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC;aACnC;YACD,IAAI,KAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;gBAClD,KAAI,CAAC,MAAM,GAAG,KAAI,CAAC,iBAAiB,CAAC,KAAK,CAAA;aAC3C;SACF;;IACH,CAAC;IA5DD,sBAAI,sBAAI;aAAR;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;aACD,UAAS,KAAa;YACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;;;OAHA;IASD,sBAAI,0BAAQ;aAAZ;YACE,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;aACD,UAAa,KAAa;YACxB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACzB,CAAC;;;OAHA;IASD,sBAAI,2BAAS;aAAb;YACE,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,CAAC;aACD,UAAc,KAAyB;YACrC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAHA;IAUD,sBAAI,uBAAK;aAAT;YACE,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;aACD,UAAU,KAAa;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;;;OAHA;IAyBH,WAAC;AAAD,CAAC,AAlED,CAAmB,KAAK,GAkEvB;AAED,eAAe,IAAI,CAAC"}
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"}
@@ -37,6 +37,10 @@ import FiberGrid from "./FiberGrid";
37
37
  import Timeline from "./Timeline";
38
38
  import Indicator from "./Indicator";
39
39
  import Tags from "./Tags";
40
+ import Radio from "./Radio";
41
+ import MultiCheckbox from "./MultiCheckbox";
42
+ import Switch from "./Switch";
43
+ import Steps from "./Steps";
40
44
  var WidgetFactory = /** @class */ (function () {
41
45
  function WidgetFactory() {
42
46
  }
@@ -130,6 +134,18 @@ var WidgetFactory = /** @class */ (function () {
130
134
  case "tags":
131
135
  this._widgetClass = Tags;
132
136
  break;
137
+ case "radio":
138
+ this._widgetClass = Radio;
139
+ break;
140
+ case "multicheckbox":
141
+ this._widgetClass = MultiCheckbox;
142
+ break;
143
+ case "switch":
144
+ this._widgetClass = Switch;
145
+ break;
146
+ case "steps":
147
+ this._widgetClass = Steps;
148
+ break;
133
149
  default:
134
150
  break;
135
151
  }
@@ -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;AAC5B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC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T;IACH,CAAC;IAED,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,AAnJD,IAmJC;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,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";
39
+ import Radio from "./Radio";
40
+ import Switch from "./Switch";
41
+ import Steps from "./Steps";
37
42
  import { Graph, GraphAxis, GraphIndicator, GraphIndicatorField, GraphChart, GraphType, parseGraph, Operator, GraphYAxis, GraphXAxis } from "./Graph";
38
43
  import * as graphProcessor from "./Graph/processor/graphProcessor";
39
44
  import * as graphFieldUtils from "./Graph/processor/fieldUtils";
40
- 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, };
45
+ 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, };
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,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";
39
+ import Radio from "./Radio";
40
+ import Switch from "./Switch";
41
+ import Steps from "./Steps";
37
42
  import { Graph, GraphAxis, GraphIndicator, GraphIndicatorField, GraphChart, parseGraph, GraphYAxis, GraphXAxis, } from "./Graph";
38
43
  import * as graphProcessor from "./Graph/processor/graphProcessor";
39
44
  import * as graphFieldUtils from "./Graph/processor/fieldUtils";
40
- 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, };
45
+ 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, };
41
46
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AAC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AAkC,CAAC;AACnE,OAAO,KAAK,eAAe,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,KAAK,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,SAAS,EACT,eAAe,EACf,IAAI,EACJ,WAAW,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,GACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/ooui",
3
- "version": "0.9.1",
3
+ "version": "0.12.0",
4
4
  "dependencies": {
5
5
  "moment": "^2.29.3"
6
6
  },
package/src/Label.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import Field from "./Field";
2
2
 
3
+
4
+ type LabelType = "secondary" | "success" | "warning" | "danger" | "default";
5
+ type LabelSize = "h1" | "h2" | "h3" | "h4" | "h5" | "text";
6
+
3
7
  class Label extends Field {
4
8
  /**
5
9
  * Label text
@@ -23,6 +27,29 @@ class Label extends Field {
23
27
  this._align = value;
24
28
  }
25
29
 
30
+ /**
31
+ * Label type
32
+ */
33
+ _labelType: LabelType = "default";
34
+ get labelType(): LabelType {
35
+ return this._labelType;
36
+ }
37
+ set labelType(value: LabelType) {
38
+ this._labelType = value;
39
+ }
40
+
41
+ /**
42
+ * Label size
43
+ */
44
+ _labelSize: LabelSize = "text";
45
+ get labelSize(): LabelSize {
46
+ return this._labelSize;
47
+ }
48
+ set labelSize(value: LabelSize) {
49
+ this._labelSize = value;
50
+ }
51
+
52
+
26
53
  /**
27
54
  * Id of the field that this label goes with. Null if it's an independent label
28
55
  */
@@ -40,6 +67,14 @@ class Label extends Field {
40
67
  if (props?.fieldForLabel) {
41
68
  this._fieldForLabel = props.fieldForLabel;
42
69
  }
70
+ if (props.widget_props) {
71
+ if (this.parsedWidgetProps.label_type) {
72
+ this.labelType = this.parsedWidgetProps.label_type;
73
+ }
74
+ if (this.parsedWidgetProps.label_size) {
75
+ this.labelSize = this.parsedWidgetProps.label_size;
76
+ }
77
+ }
43
78
  }
44
79
  }
45
80
 
@@ -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/Radio.ts ADDED
@@ -0,0 +1,33 @@
1
+ import Selection from "./Selection";
2
+
3
+ type directionType = "horizontal" | "vertical";
4
+
5
+ /**
6
+ * Selection field for key-value lists
7
+ */
8
+ class Radio extends Selection {
9
+
10
+ /**
11
+ * Define the direction
12
+ */
13
+ _direction: directionType = "horizontal";
14
+ get direction(): directionType {
15
+ return this._direction;
16
+ }
17
+ set direction(value: directionType) {
18
+ this._direction = value;
19
+ }
20
+
21
+ constructor(props: any) {
22
+ super(props);
23
+
24
+ if (props) {
25
+ if (this.parsedWidgetProps.hasOwnProperty('direction')) {
26
+ this._direction = this.parsedWidgetProps.direction
27
+ }
28
+ }
29
+ }
30
+
31
+ }
32
+
33
+ export default Radio;
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
@@ -0,0 +1,8 @@
1
+ import Boolean from "./Boolean";
2
+
3
+ /**
4
+ * Switch
5
+ */
6
+ class Switch extends Boolean {}
7
+
8
+ export default Switch;
package/src/Tags.ts CHANGED
@@ -1,74 +1,8 @@
1
- import Field from "./Field";
1
+ import MultiCheckbox from "./MultiCheckbox";
2
2
 
3
3
  /**
4
4
  * A Tags widget
5
5
  */
6
- class Tags 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
- 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;
@@ -26,6 +26,10 @@ import FiberGrid from "./FiberGrid";
26
26
  import Timeline from "./Timeline";
27
27
  import Indicator from "./Indicator";
28
28
  import Tags from "./Tags";
29
+ import Radio from "./Radio";
30
+ import MultiCheckbox from "./MultiCheckbox";
31
+ import Switch from "./Switch";
32
+ import Steps from "./Steps";
29
33
 
30
34
  class WidgetFactory {
31
35
  /**
@@ -123,6 +127,18 @@ class WidgetFactory {
123
127
  case "tags":
124
128
  this._widgetClass = Tags;
125
129
  break;
130
+ case "radio":
131
+ this._widgetClass = Radio;
132
+ break;
133
+ case "multicheckbox":
134
+ this._widgetClass = MultiCheckbox;
135
+ break;
136
+ case "switch":
137
+ this._widgetClass = Switch;
138
+ break;
139
+ case "steps":
140
+ this._widgetClass = Steps;
141
+ break;
126
142
 
127
143
  default:
128
144
  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,6 +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";
39
+ import Radio from "./Radio";
40
+ import Switch from "./Switch";
41
+ import Steps from "./Steps";
42
+
37
43
  import {
38
44
  Graph,
39
45
  GraphAxis,
@@ -58,6 +64,7 @@ export {
58
64
  Widget,
59
65
  Form,
60
66
  Tree,
67
+ NewLine,
61
68
  Boolean,
62
69
  One2many,
63
70
  Integer,
@@ -99,4 +106,8 @@ export {
99
106
  graphProcessor,
100
107
  graphFieldUtils,
101
108
  Tags,
109
+ MultiCheckbox,
110
+ Radio,
111
+ Switch,
112
+ Steps,
102
113
  };
@@ -43,4 +43,51 @@ describe("A Label", () => {
43
43
  const widget = widgetFactory.createWidget("label", props);
44
44
  expect(widget.fieldForLabel).toBe("field");
45
45
  });
46
+
47
+ describe("Label types", () => {
48
+ it("should have default type by default", () => {
49
+ const widgetFactory = new WidgetFactory();
50
+ const props = {
51
+ name: "field_label",
52
+ string: "Default",
53
+ };
54
+ const widget = widgetFactory.createWidget("label", props);
55
+ expect(widget.labelType).toBe("default");
56
+ });
57
+ it("should parse label_type from widget props", () => {
58
+ const widgetFactory = new WidgetFactory();
59
+ const props = {
60
+ name: "field_label",
61
+ string: "Default",
62
+ widget_props: "{'label_type': 'warning'}"
63
+ };
64
+ const widget = widgetFactory.createWidget("label", props);
65
+ expect(widget.labelType).toBe("warning");
66
+ });
67
+ });
68
+
69
+ describe("Label size", () => {
70
+ it("should have default size to text", () => {
71
+ const widgetFactory = new WidgetFactory();
72
+ const props = {
73
+ name: "field_label",
74
+ string: "Default",
75
+ widget_props: "{}"
76
+ };
77
+ const widget = widgetFactory.createWidget("label", props);
78
+ expect(widget.labelSize).toBe("text");
79
+ });
80
+ it("should have allow size to h1...h5", () => {
81
+ const widgetFactory = new WidgetFactory();
82
+ ['h1', 'h2', 'h3', 'h4', 'h5'].map((level) => {
83
+ const props = {
84
+ name: "field_label",
85
+ string: "Default",
86
+ widget_props: `{'label_size': '${level}'}`
87
+ };
88
+ const widget = widgetFactory.createWidget("label", props);
89
+ expect(widget.labelSize).toBe(level);
90
+ })
91
+ });
92
+ });
46
93
  });
@@ -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,27 @@
1
+ import WidgetFactory from "../WidgetFactory";
2
+
3
+ describe("A Radio widget", () => {
4
+
5
+ it("should have default direction to 'horizontal'", () => {
6
+ const widgetFactory = new WidgetFactory();
7
+ const props = {
8
+ name: "level",
9
+ };
10
+ const widget = widgetFactory.createWidget("radio", props);
11
+
12
+ expect(widget.direction).toBe("horizontal");
13
+ });
14
+
15
+ it("should properly set field", () => {
16
+ const widgetFactory = new WidgetFactory();
17
+ const props = {
18
+ name: "level",
19
+ widget_props: "{'direction': 'vertical'}",
20
+ };
21
+ const widget = widgetFactory.createWidget("radio", props);
22
+
23
+ expect(widget.direction).toBe("vertical");
24
+ });
25
+
26
+
27
+ });
@@ -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,8 +1,5 @@
1
- import Char from "../Char";
2
- import Button from "../Button";
3
- import NewLine from "../NewLine";
4
- import Tags from "../Tags";
5
1
  import WidgetFactory from "../WidgetFactory";
2
+ import { Char, Button, NewLine, Tags, MultiCheckbox, Radio, Switch, Steps } from "..";
6
3
 
7
4
 
8
5
  describe('A WidgetFactory', () => {
@@ -46,4 +43,36 @@ describe('A WidgetFactory', () => {
46
43
  expect(widget).toBeInstanceOf(Tags);
47
44
  expect(widget.type).toBe("tags");
48
45
  });
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
+
55
+ it('should be able to retrieve Radio type', () => {
56
+ const widgetFactory = new WidgetFactory();
57
+ const props = {};
58
+ const widget = widgetFactory.createWidget("radio", props);
59
+ expect(widget).toBeInstanceOf(Radio);
60
+ expect(widget.type).toBe("radio");
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
+ });
49
78
  });