@hpcc-js/form 2.12.2 → 2.12.3

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/src/Input.css CHANGED
@@ -1,42 +1,42 @@
1
- .form_Input input,
2
- .form_Input select,
3
- .form_Input button,
4
- .form_Input textarea{
5
- padding:2px;
6
- }
7
-
8
- .form_Input button{
9
- cursor:pointer;
10
- }
11
-
12
- .form_Input input.color-text{
13
- width:120px;
14
- }
15
- .form_Input input.color-text+input{
16
- width:57px;
17
- position:absolute;
18
- }
19
-
20
- .form_Input textarea{
21
- width:100%;
22
- box-sizing: border-box;
23
- display:block;
24
- }
25
-
26
- .form_Input input[type="textbox"]{
27
- width:100%;
28
- box-sizing: border-box;
29
- display:block;
30
- }
31
-
32
- .form_Input ul {
33
- list-style-type: none;
34
- float: left;
35
- padding: 0px;
36
- margin: 0px;
37
- }
38
-
39
- .form_Input li {
40
- float: left;
41
- list-style-position: inside
1
+ .form_Input input,
2
+ .form_Input select,
3
+ .form_Input button,
4
+ .form_Input textarea{
5
+ padding:2px;
6
+ }
7
+
8
+ .form_Input button{
9
+ cursor:pointer;
10
+ }
11
+
12
+ .form_Input input.color-text{
13
+ width:120px;
14
+ }
15
+ .form_Input input.color-text+input{
16
+ width:57px;
17
+ position:absolute;
18
+ }
19
+
20
+ .form_Input textarea{
21
+ width:100%;
22
+ box-sizing: border-box;
23
+ display:block;
24
+ }
25
+
26
+ .form_Input input[type="textbox"]{
27
+ width:100%;
28
+ box-sizing: border-box;
29
+ display:block;
30
+ }
31
+
32
+ .form_Input ul {
33
+ list-style-type: none;
34
+ float: left;
35
+ padding: 0px;
36
+ margin: 0px;
37
+ }
38
+
39
+ .form_Input li {
40
+ float: left;
41
+ list-style-position: inside
42
42
  }
package/src/Input.ts CHANGED
@@ -1,121 +1,121 @@
1
- import { IInput } from "@hpcc-js/api";
2
- import { HTMLWidget } from "@hpcc-js/common";
3
-
4
- import "../src/Input.css";
5
-
6
- export class Input extends HTMLWidget {
7
- _inputElement = [];
8
- _labelElement = [];
9
-
10
- constructor() {
11
- super();
12
- IInput.call(this);
13
-
14
- this._tag = "div";
15
- }
16
-
17
- checked(_) {
18
- if (!arguments.length) return this._inputElement[0] ? this._inputElement[0].property("checked") : false;
19
- if (this._inputElement[0]) {
20
- this._inputElement[0].property("checked", _);
21
- }
22
- return this;
23
- }
24
-
25
- enter(domNode, element) {
26
- super.enter(domNode, element);
27
-
28
- this._labelElement[0] = element.append("label")
29
- .attr("for", this.id() + "_input")
30
- .style("visibility", this.inlineLabel_exists() ? "visible" : "hidden")
31
- ;
32
-
33
- const context = this;
34
- switch (this.type()) {
35
- case "button":
36
- this._inputElement[0] = element.append("button")
37
- .attr("id", this.id() + "_input")
38
- ;
39
- break;
40
- case "textarea":
41
- this._inputElement[0] = element.append("textarea")
42
- .attr("id", this.id() + "_input")
43
- ;
44
- break;
45
- default:
46
- this._inputElement[0] = element.append("input")
47
- .attr("id", this.id() + "_input")
48
- .attr("type", this.type())
49
- ;
50
- break;
51
- }
52
-
53
- this._inputElement.forEach(function (e, idx) {
54
- e.attr("name", context.name());
55
- e.on("click", function (w: Input) {
56
- w.click(w);
57
- });
58
- e.on("blur", function (w: Input) {
59
- w.blur(w);
60
- });
61
- e.on("change", function (w: Input) {
62
- context.value([e.property("value")]);
63
- w.change(w, true);
64
- });
65
- e.on("keyup", function (w: Input) {
66
- context.value([e.property("value")]);
67
- w.change(w, false);
68
- });
69
- });
70
- }
71
-
72
- update(domNode, element) {
73
- super.update(domNode, element);
74
-
75
- this._labelElement[0]
76
- .style("visibility", this.inlineLabel_exists() ? "visible" : "hidden")
77
- .text(this.inlineLabel())
78
- ;
79
- switch (this.type()) {
80
- case "button":
81
- this._inputElement[0].text(this.value());
82
- break;
83
- case "textarea":
84
- this._inputElement[0].property("value", this.value());
85
- break;
86
- default:
87
- this._inputElement[0].attr("type", this.type());
88
- this._inputElement[0].property("value", this.value());
89
- break;
90
- }
91
- }
92
-
93
- type: { (): string; (_: string): Input };
94
- type_exists: () => boolean;
95
- type_default: { (): string; (_: string): Input };
96
- inlineLabel: { (): string; (_: string): Input };
97
- inlineLabel_exists: () => boolean;
98
-
99
- // IInput ---
100
- name: { (): string; (_: string): Input };
101
- name_exists: () => boolean;
102
- label: { (): string; (_: string): Input };
103
- label_exists: () => boolean;
104
- value: { (): any; (_: any): Input };
105
- value_exists: () => boolean;
106
- validate: { (): string; (_: string): Input };
107
- validate_exists: () => boolean;
108
-
109
- // IInput Events ---
110
- blur: (w: Input) => void;
111
- keyup: (w: Input) => void;
112
- focus: (w: Input) => void;
113
- click: (w: Input) => void;
114
- dblclick: (w: Input) => void;
115
- change: (w: Input, complete: boolean) => void;
116
- }
117
- Input.prototype._class += " form_Input";
118
- Input.prototype.implements(IInput.prototype);
119
-
120
- Input.prototype.publish("type", "text", "set", "Input type", ["number", "button", "checkbox", "date", "text", "textarea", "search", "email", "time", "datetime", "hidden"]);
121
- Input.prototype.publish("inlineLabel", null, "string", "Input Label", null, { optional: true });
1
+ import { IInput } from "@hpcc-js/api";
2
+ import { HTMLWidget } from "@hpcc-js/common";
3
+
4
+ import "../src/Input.css";
5
+
6
+ export class Input extends HTMLWidget {
7
+ _inputElement = [];
8
+ _labelElement = [];
9
+
10
+ constructor() {
11
+ super();
12
+ IInput.call(this);
13
+
14
+ this._tag = "div";
15
+ }
16
+
17
+ checked(_) {
18
+ if (!arguments.length) return this._inputElement[0] ? this._inputElement[0].property("checked") : false;
19
+ if (this._inputElement[0]) {
20
+ this._inputElement[0].property("checked", _);
21
+ }
22
+ return this;
23
+ }
24
+
25
+ enter(domNode, element) {
26
+ super.enter(domNode, element);
27
+
28
+ this._labelElement[0] = element.append("label")
29
+ .attr("for", this.id() + "_input")
30
+ .style("visibility", this.inlineLabel_exists() ? "visible" : "hidden")
31
+ ;
32
+
33
+ const context = this;
34
+ switch (this.type()) {
35
+ case "button":
36
+ this._inputElement[0] = element.append("button")
37
+ .attr("id", this.id() + "_input")
38
+ ;
39
+ break;
40
+ case "textarea":
41
+ this._inputElement[0] = element.append("textarea")
42
+ .attr("id", this.id() + "_input")
43
+ ;
44
+ break;
45
+ default:
46
+ this._inputElement[0] = element.append("input")
47
+ .attr("id", this.id() + "_input")
48
+ .attr("type", this.type())
49
+ ;
50
+ break;
51
+ }
52
+
53
+ this._inputElement.forEach(function (e, idx) {
54
+ e.attr("name", context.name());
55
+ e.on("click", function (w: Input) {
56
+ w.click(w);
57
+ });
58
+ e.on("blur", function (w: Input) {
59
+ w.blur(w);
60
+ });
61
+ e.on("change", function (w: Input) {
62
+ context.value([e.property("value")]);
63
+ w.change(w, true);
64
+ });
65
+ e.on("keyup", function (w: Input) {
66
+ context.value([e.property("value")]);
67
+ w.change(w, false);
68
+ });
69
+ });
70
+ }
71
+
72
+ update(domNode, element) {
73
+ super.update(domNode, element);
74
+
75
+ this._labelElement[0]
76
+ .style("visibility", this.inlineLabel_exists() ? "visible" : "hidden")
77
+ .text(this.inlineLabel())
78
+ ;
79
+ switch (this.type()) {
80
+ case "button":
81
+ this._inputElement[0].text(this.value());
82
+ break;
83
+ case "textarea":
84
+ this._inputElement[0].property("value", this.value());
85
+ break;
86
+ default:
87
+ this._inputElement[0].attr("type", this.type());
88
+ this._inputElement[0].property("value", this.value());
89
+ break;
90
+ }
91
+ }
92
+
93
+ type: { (): string; (_: string): Input };
94
+ type_exists: () => boolean;
95
+ type_default: { (): string; (_: string): Input };
96
+ inlineLabel: { (): string; (_: string): Input };
97
+ inlineLabel_exists: () => boolean;
98
+
99
+ // IInput ---
100
+ name: { (): string; (_: string): Input };
101
+ name_exists: () => boolean;
102
+ label: { (): string; (_: string): Input };
103
+ label_exists: () => boolean;
104
+ value: { (): any; (_: any): Input };
105
+ value_exists: () => boolean;
106
+ validate: { (): string; (_: string): Input };
107
+ validate_exists: () => boolean;
108
+
109
+ // IInput Events ---
110
+ blur: (w: Input) => void;
111
+ keyup: (w: Input) => void;
112
+ focus: (w: Input) => void;
113
+ click: (w: Input) => void;
114
+ dblclick: (w: Input) => void;
115
+ change: (w: Input, complete: boolean) => void;
116
+ }
117
+ Input.prototype._class += " form_Input";
118
+ Input.prototype.implements(IInput.prototype);
119
+
120
+ Input.prototype.publish("type", "text", "set", "Input type", ["number", "button", "checkbox", "date", "text", "textarea", "search", "email", "time", "datetime", "hidden"]);
121
+ Input.prototype.publish("inlineLabel", null, "string", "Input Label", null, { optional: true });
package/src/InputRange.ts CHANGED
@@ -1,86 +1,86 @@
1
- import { IInput } from "@hpcc-js/api";
2
- import { HTMLWidget } from "@hpcc-js/common";
3
-
4
- import "../src/Input.css";
5
-
6
- export class InputRange extends HTMLWidget {
7
- _inputElement = [];
8
- _labelElement = [];
9
- _rangeData = [];
10
-
11
- constructor() {
12
- super();
13
- IInput.call(this);
14
-
15
- this._tag = "div";
16
- }
17
-
18
- enter(domNode, element) {
19
- super.enter(domNode, element);
20
-
21
- this._labelElement[0] = element.append("label")
22
- .attr("for", this.id() + "_input")
23
- .style("visibility", this.inlineLabel_exists() ? "visible" : "hidden")
24
- ;
25
-
26
- this._inputElement.push(element.append("input")
27
- .attr("id", this.id() + "_input_min")
28
- .attr("type", this.type()));
29
- this._inputElement.push(element.append("input")
30
- .attr("id", this.id() + "_input_max")
31
- .attr("type", this.type()));
32
-
33
- const context = this;
34
- this._inputElement.forEach(function (e, idx) {
35
- e.attr("name", context.name());
36
- e.on("click", function (w) {
37
- w.click(w);
38
- });
39
- e.on("blur", function (w) {
40
- w.blur(w);
41
- });
42
- e.on("change", function (w) {
43
- context._rangeData[idx] = e.property("value");
44
- context.value(context._rangeData);
45
- w.change(w, true);
46
- });
47
- });
48
- }
49
-
50
- update(domNode, element) {
51
- super.update(domNode, element);
52
-
53
- this._labelElement[0]
54
- .style("visibility", this.inlineLabel_exists() ? "visible" : "hidden")
55
- .text(this.inlineLabel())
56
- ;
57
-
58
- this._rangeData = this.value();
59
- this._inputElement.forEach(function (e, idx) {
60
- e
61
- .attr("type", this.type())
62
- .property("value", this._rangeData.length > idx ? this._rangeData[idx] : "");
63
- }, this);
64
- }
65
-
66
- type: { (): string; (_: string): InputRange };
67
- type_exists: () => boolean;
68
- inlineLabel: { (): string; (_: string): InputRange };
69
- inlineLabel_exists: () => boolean;
70
- value: { (): any[]; (_: any[]): InputRange };
71
- value_exists: () => boolean;
72
-
73
- // IInput ---
74
- name: { (): string; (_: string): InputRange };
75
- name_exists: () => boolean;
76
- label: { (): string; (_: string): InputRange };
77
- label_exists: () => boolean;
78
- validate: { (): string; (_: string): InputRange };
79
- validate_exists: () => boolean;
80
- }
81
- InputRange.prototype._class += " form_InputRange";
82
- InputRange.prototype.implements(IInput.prototype);
83
-
84
- InputRange.prototype.publish("type", "text", "set", "InputRange type", ["number", "date", "text", "time", "datetime", "hidden"]);
85
- InputRange.prototype.publish("inlineLabel", null, "string", "InputRange Label", null, { optional: true });
86
- InputRange.prototype.publish("value", ["", ""], "array", "Input Current Value", null, { override: true });
1
+ import { IInput } from "@hpcc-js/api";
2
+ import { HTMLWidget } from "@hpcc-js/common";
3
+
4
+ import "../src/Input.css";
5
+
6
+ export class InputRange extends HTMLWidget {
7
+ _inputElement = [];
8
+ _labelElement = [];
9
+ _rangeData = [];
10
+
11
+ constructor() {
12
+ super();
13
+ IInput.call(this);
14
+
15
+ this._tag = "div";
16
+ }
17
+
18
+ enter(domNode, element) {
19
+ super.enter(domNode, element);
20
+
21
+ this._labelElement[0] = element.append("label")
22
+ .attr("for", this.id() + "_input")
23
+ .style("visibility", this.inlineLabel_exists() ? "visible" : "hidden")
24
+ ;
25
+
26
+ this._inputElement.push(element.append("input")
27
+ .attr("id", this.id() + "_input_min")
28
+ .attr("type", this.type()));
29
+ this._inputElement.push(element.append("input")
30
+ .attr("id", this.id() + "_input_max")
31
+ .attr("type", this.type()));
32
+
33
+ const context = this;
34
+ this._inputElement.forEach(function (e, idx) {
35
+ e.attr("name", context.name());
36
+ e.on("click", function (w) {
37
+ w.click(w);
38
+ });
39
+ e.on("blur", function (w) {
40
+ w.blur(w);
41
+ });
42
+ e.on("change", function (w) {
43
+ context._rangeData[idx] = e.property("value");
44
+ context.value(context._rangeData);
45
+ w.change(w, true);
46
+ });
47
+ });
48
+ }
49
+
50
+ update(domNode, element) {
51
+ super.update(domNode, element);
52
+
53
+ this._labelElement[0]
54
+ .style("visibility", this.inlineLabel_exists() ? "visible" : "hidden")
55
+ .text(this.inlineLabel())
56
+ ;
57
+
58
+ this._rangeData = this.value();
59
+ this._inputElement.forEach(function (e, idx) {
60
+ e
61
+ .attr("type", this.type())
62
+ .property("value", this._rangeData.length > idx ? this._rangeData[idx] : "");
63
+ }, this);
64
+ }
65
+
66
+ type: { (): string; (_: string): InputRange };
67
+ type_exists: () => boolean;
68
+ inlineLabel: { (): string; (_: string): InputRange };
69
+ inlineLabel_exists: () => boolean;
70
+ value: { (): any[]; (_: any[]): InputRange };
71
+ value_exists: () => boolean;
72
+
73
+ // IInput ---
74
+ name: { (): string; (_: string): InputRange };
75
+ name_exists: () => boolean;
76
+ label: { (): string; (_: string): InputRange };
77
+ label_exists: () => boolean;
78
+ validate: { (): string; (_: string): InputRange };
79
+ validate_exists: () => boolean;
80
+ }
81
+ InputRange.prototype._class += " form_InputRange";
82
+ InputRange.prototype.implements(IInput.prototype);
83
+
84
+ InputRange.prototype.publish("type", "text", "set", "InputRange type", ["number", "date", "text", "time", "datetime", "hidden"]);
85
+ InputRange.prototype.publish("inlineLabel", null, "string", "InputRange Label", null, { optional: true });
86
+ InputRange.prototype.publish("value", ["", ""], "array", "Input Current Value", null, { override: true });
package/src/OnOff.css CHANGED
@@ -1,55 +1,55 @@
1
- .onoffswitch-checkbox {
2
- display: none;
3
- }
4
- .onoffswitch {
5
- position: relative; height: 20px; width: 100px;
6
- -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
7
- }
8
- .onoffswitch-label {
9
- display: block; overflow: hidden; cursor: pointer;
10
- border: 1px solid #999999;
11
- height: 20px;
12
- }
13
- .onoffswitch-inner {
14
- position: relative;
15
- display: block;
16
- transition: margin 0.3s ease-in 0s;
17
- }
18
- .onoffswitch-inner > .onoffswitch-offText,
19
- .onoffswitch-inner > .onoffswitch-onText{
20
- height: 100%;
21
- }
22
- .onoffswitch-inner > .onoffswitch-offText{
23
- font-weight: bold;
24
- position: absolute;
25
- right: 0;
26
- transition: all 0.3s ease-in 0s;
27
- width: 100%;
28
- text-align: right;
29
- }
30
- .onoffswitch-inner > .onoffswitch-onText{
31
- font-weight: bold;
32
- position: absolute;
33
- left: -100%;
34
- transition: all 0.3s ease-in 0s;
35
- width: 100%;
36
- text-align: left;
37
- }
38
- .onoffswitch-switch {
39
- display: block; width: 20px; margin: -1px;
40
- background: #FFFFFF;
41
- position: absolute; top: 0; bottom: 0;
42
- right: 78px;
43
- border: 1px solid #999999;
44
- transition: all 0.3s ease-in 0s;
45
- left: 4px;
46
- }
47
- .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner > .onoffswitch-offText{
48
- right: -100%;
49
- }
50
- .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner > .onoffswitch-onText{
51
- left: 0;
52
- }
53
- .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
54
- left: calc(100% - 20px);
1
+ .onoffswitch-checkbox {
2
+ display: none;
3
+ }
4
+ .onoffswitch {
5
+ position: relative; height: 20px; width: 100px;
6
+ -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
7
+ }
8
+ .onoffswitch-label {
9
+ display: block; overflow: hidden; cursor: pointer;
10
+ border: 1px solid #999999;
11
+ height: 20px;
12
+ }
13
+ .onoffswitch-inner {
14
+ position: relative;
15
+ display: block;
16
+ transition: margin 0.3s ease-in 0s;
17
+ }
18
+ .onoffswitch-inner > .onoffswitch-offText,
19
+ .onoffswitch-inner > .onoffswitch-onText{
20
+ height: 100%;
21
+ }
22
+ .onoffswitch-inner > .onoffswitch-offText{
23
+ font-weight: bold;
24
+ position: absolute;
25
+ right: 0;
26
+ transition: all 0.3s ease-in 0s;
27
+ width: 100%;
28
+ text-align: right;
29
+ }
30
+ .onoffswitch-inner > .onoffswitch-onText{
31
+ font-weight: bold;
32
+ position: absolute;
33
+ left: -100%;
34
+ transition: all 0.3s ease-in 0s;
35
+ width: 100%;
36
+ text-align: left;
37
+ }
38
+ .onoffswitch-switch {
39
+ display: block; width: 20px; margin: -1px;
40
+ background: #FFFFFF;
41
+ position: absolute; top: 0; bottom: 0;
42
+ right: 78px;
43
+ border: 1px solid #999999;
44
+ transition: all 0.3s ease-in 0s;
45
+ left: 4px;
46
+ }
47
+ .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner > .onoffswitch-offText{
48
+ right: -100%;
49
+ }
50
+ .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner > .onoffswitch-onText{
51
+ left: 0;
52
+ }
53
+ .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
54
+ left: calc(100% - 20px);
55
55
  }