@hpcc-js/layout 3.5.10 → 3.5.11

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/Popup.ts CHANGED
@@ -1,120 +1,120 @@
1
- import { HTMLWidget, Widget } from "@hpcc-js/common";
2
-
3
- export class Popup extends HTMLWidget {
4
- _surfaceButtons;
5
- _originalPosition;
6
-
7
- constructor() {
8
- super();
9
- this._tag = "div";
10
- this._surfaceButtons = [];
11
- }
12
-
13
- updateState(visible) {
14
- visible = visible || !this.popupState();
15
- this.popupState(visible).render();
16
- }
17
-
18
- enter(domNode, element) {
19
- super.enter(domNode, element);
20
- this.widget()
21
- .target(domNode)
22
- ;
23
- this._originalPosition = this.position();
24
- }
25
-
26
- update(domNode, element) {
27
- super.update(domNode, element);
28
- element
29
- .style("visibility", this.popupState() ? null : "hidden")
30
- .style("opacity", this.popupState() ? null : 0)
31
- .style("width", this.shrinkWrap() ? this.widget().width() + "px" : this._size.width + "px")
32
- .style("height", this.shrinkWrap() ? this.widget().height() + "px" : this._size.height + "px")
33
- ;
34
- if (this.widget().size().height === 0) {
35
- this.widget().resize(this.size());
36
- }
37
- }
38
-
39
- postUpdate(domNode, element) {
40
- let left;
41
- let top;
42
- switch (this.centerPopup()) {
43
- case "container":
44
- if (this._placeholderElement) {
45
- left = parseInt(this._placeholderElement.style("width")) / 2 - this.widget().width() / 2;
46
- top = parseInt(this._placeholderElement.style("height")) / 2 - this.widget().height() / 2;
47
- }
48
- this.position("absolute");
49
- break;
50
-
51
- case "window":
52
- left = window.innerWidth / 2 - this.widget().width() / 2;
53
- top = window.innerHeight / 2 - this.widget().height() / 2;
54
- this.position("fixed");
55
- break;
56
-
57
- default:
58
- left = 0;
59
- top = 0;
60
- this.position(this._originalPosition);
61
- break;
62
- }
63
-
64
- this.pos({ x: left, y: top });
65
-
66
- super.postUpdate(domNode, element);
67
-
68
- element
69
- .style("position", this.position())
70
- .style("left", this.left() + "px")
71
- .style("right", this.right() + "px")
72
- .style("top", this.top() + "px")
73
- .style("bottom", this.bottom() + "px")
74
- ;
75
- }
76
-
77
- exit(domNode, element) {
78
- if (this.widget()) {
79
- this.widget().target(null);
80
- }
81
- super.exit(domNode, element);
82
- }
83
-
84
- click(obj) {
85
- }
86
- }
87
- Popup.prototype._class += " layout_Popup";
88
-
89
- export interface Popup {
90
- popupState(): boolean;
91
- popupState(_: boolean): this;
92
- shrinkWrap(): boolean;
93
- shrinkWrap(_: boolean): this;
94
- centerPopup(): "none" | "container" | "window";
95
- centerPopup(_: "none" | "container" | "window"): this;
96
- top(): number;
97
- top(_: number): this;
98
- bottom(): number;
99
- bottom(_: number): this;
100
- left(): number;
101
- left(_: number): this;
102
- right(): number;
103
- right(_: number): this;
104
- position(): string;
105
- position(_: string): this;
106
-
107
- widget(): Widget;
108
- widget(_: Widget): this;
109
- }
110
-
111
- Popup.prototype.publish("popupState", false, "boolean", "State of the popup, visible (true) or hidden (false)", null, {});
112
- Popup.prototype.publish("shrinkWrap", false, "boolean", "The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)", null, {});
113
- Popup.prototype.publish("centerPopup", "none", "set", "Center the widget in its container element (target) or in the window", ["none", "container", "window"], {});
114
- Popup.prototype.publish("top", null, "number", "Top position property of popup", null, {});
115
- Popup.prototype.publish("bottom", null, "number", "Bottom position property of popup", null, {});
116
- Popup.prototype.publish("left", null, "number", "Left position property of popup", null, {});
117
- Popup.prototype.publish("right", null, "number", "Right position property of popup", null, {});
118
- Popup.prototype.publish("position", "relative", "set", "Value of the 'position' property", ["absolute", "relative", "fixed", "static", "initial", "inherit"], { tags: ["Private"] });
119
-
120
- Popup.prototype.publish("widget", null, "widget", "Widget", null, { tags: ["Private"] });
1
+ import { HTMLWidget, Widget } from "@hpcc-js/common";
2
+
3
+ export class Popup extends HTMLWidget {
4
+ _surfaceButtons;
5
+ _originalPosition;
6
+
7
+ constructor() {
8
+ super();
9
+ this._tag = "div";
10
+ this._surfaceButtons = [];
11
+ }
12
+
13
+ updateState(visible) {
14
+ visible = visible || !this.popupState();
15
+ this.popupState(visible).render();
16
+ }
17
+
18
+ enter(domNode, element) {
19
+ super.enter(domNode, element);
20
+ this.widget()
21
+ .target(domNode)
22
+ ;
23
+ this._originalPosition = this.position();
24
+ }
25
+
26
+ update(domNode, element) {
27
+ super.update(domNode, element);
28
+ element
29
+ .style("visibility", this.popupState() ? null : "hidden")
30
+ .style("opacity", this.popupState() ? null : 0)
31
+ .style("width", this.shrinkWrap() ? this.widget().width() + "px" : this._size.width + "px")
32
+ .style("height", this.shrinkWrap() ? this.widget().height() + "px" : this._size.height + "px")
33
+ ;
34
+ if (this.widget().size().height === 0) {
35
+ this.widget().resize(this.size());
36
+ }
37
+ }
38
+
39
+ postUpdate(domNode, element) {
40
+ let left;
41
+ let top;
42
+ switch (this.centerPopup()) {
43
+ case "container":
44
+ if (this._placeholderElement) {
45
+ left = parseInt(this._placeholderElement.style("width")) / 2 - this.widget().width() / 2;
46
+ top = parseInt(this._placeholderElement.style("height")) / 2 - this.widget().height() / 2;
47
+ }
48
+ this.position("absolute");
49
+ break;
50
+
51
+ case "window":
52
+ left = window.innerWidth / 2 - this.widget().width() / 2;
53
+ top = window.innerHeight / 2 - this.widget().height() / 2;
54
+ this.position("fixed");
55
+ break;
56
+
57
+ default:
58
+ left = 0;
59
+ top = 0;
60
+ this.position(this._originalPosition);
61
+ break;
62
+ }
63
+
64
+ this.pos({ x: left, y: top });
65
+
66
+ super.postUpdate(domNode, element);
67
+
68
+ element
69
+ .style("position", this.position())
70
+ .style("left", this.left() + "px")
71
+ .style("right", this.right() + "px")
72
+ .style("top", this.top() + "px")
73
+ .style("bottom", this.bottom() + "px")
74
+ ;
75
+ }
76
+
77
+ exit(domNode, element) {
78
+ if (this.widget()) {
79
+ this.widget().target(null);
80
+ }
81
+ super.exit(domNode, element);
82
+ }
83
+
84
+ click(obj) {
85
+ }
86
+ }
87
+ Popup.prototype._class += " layout_Popup";
88
+
89
+ export interface Popup {
90
+ popupState(): boolean;
91
+ popupState(_: boolean): this;
92
+ shrinkWrap(): boolean;
93
+ shrinkWrap(_: boolean): this;
94
+ centerPopup(): "none" | "container" | "window";
95
+ centerPopup(_: "none" | "container" | "window"): this;
96
+ top(): number;
97
+ top(_: number): this;
98
+ bottom(): number;
99
+ bottom(_: number): this;
100
+ left(): number;
101
+ left(_: number): this;
102
+ right(): number;
103
+ right(_: number): this;
104
+ position(): string;
105
+ position(_: string): this;
106
+
107
+ widget(): Widget;
108
+ widget(_: Widget): this;
109
+ }
110
+
111
+ Popup.prototype.publish("popupState", false, "boolean", "State of the popup, visible (true) or hidden (false)", null, {});
112
+ Popup.prototype.publish("shrinkWrap", false, "boolean", "The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)", null, {});
113
+ Popup.prototype.publish("centerPopup", "none", "set", "Center the widget in its container element (target) or in the window", ["none", "container", "window"], {});
114
+ Popup.prototype.publish("top", null, "number", "Top position property of popup", null, {});
115
+ Popup.prototype.publish("bottom", null, "number", "Bottom position property of popup", null, {});
116
+ Popup.prototype.publish("left", null, "number", "Left position property of popup", null, {});
117
+ Popup.prototype.publish("right", null, "number", "Right position property of popup", null, {});
118
+ Popup.prototype.publish("position", "relative", "set", "Value of the 'position' property", ["absolute", "relative", "fixed", "static", "initial", "inherit"], { tags: ["Private"] });
119
+
120
+ Popup.prototype.publish("widget", null, "widget", "Widget", null, { tags: ["Private"] });
package/src/Surface.css CHANGED
@@ -1,105 +1,105 @@
1
- .layout_Surface {
2
- box-sizing: border-box;
3
- margin: 0px;
4
- border: 1px solid #e5e5e5;
5
- overflow: hidden;
6
- height: 100%;
7
- width: 100%;
8
- }
9
-
10
- .layout_Surface.shadow2 {
11
- box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12)
12
- }
13
-
14
- .layout_Surface>h3 {
15
- margin: 0px;
16
- padding: 2px;
17
- background-color: #e5e5e5;
18
- }
19
-
20
- .layout_Surface .html-button-container {
21
- position: absolute;
22
- right: 0px;
23
- top: 3px;
24
- }
25
-
26
- .layout_Surface>div {
27
- padding: 8px;
28
- }
29
-
30
- .layout_Surface .html-button-container .surface-button {
31
- margin-right: 5px;
32
- }
33
-
34
- .layout_Surface .html-button-container .surface-button i {
35
- opacity: 0.8;
36
- }
37
-
38
- .layout_Surface .html-button-container .surface-button:hover {
39
- opacity: 1;
40
- }
41
-
42
- .layout_Surface .html-button-container .surface-button:active {
43
- opacity: 0.5;
44
- }
45
-
46
- div[draggable=true].hideDragCellContent.content-icon:before {
47
- content: "\f080";
48
- font-family: FontAwesome;
49
- position: absolute;
50
- top: calc(50% - 74px);
51
- left: calc(50% - 56px);
52
- font-size: 100px;
53
- }
54
-
55
- div[draggable=true].hideDragCellContent.content-icon-Line:before {
56
- content: "\f201";
57
- }
58
-
59
- div[draggable=true].hideDragCellContent.content-icon-Pie:before {
60
- top: calc(50% - 72px);
61
- left: calc(50% - 45px);
62
- content: "\f200";
63
- }
64
-
65
- div[draggable=true].hideDragCellContent.content-icon-Area:before {
66
- content: "\f1fe";
67
- }
68
-
69
- div[draggable=true].hideDragCellContent.content-icon-Gauge:before {
70
- content: "\f0e4";
71
- }
72
-
73
- div[draggable=true].hideDragCellContent.content-icon-Table:before {
74
- content: "\f0ce";
75
- }
76
-
77
- div[draggable=true].hideDragCellContent.content-icon-Form:before {
78
- content: "\f11c";
79
- }
80
-
81
- div[draggable=true].hideDragCellContent.content-icon-Grid:before,
82
- div[draggable=true].hideDragCellContent.content-icon-Graph:before,
83
- div[draggable=true].hideDragCellContent.content-icon-Border:before,
84
- div[draggable=true].hideDragCellContent.content-icon-Tabbed:before,
85
- div[draggable=true].hideDragCellContent.content-icon-Accordion:before,
86
- div[draggable=true].hideDragCellContent.content-icon-MultiChart:before,
87
- div[draggable=true].hideDragCellContent.content-icon-MultiChartSurface:before {
88
- content: "\f247";
89
- }
90
-
91
- div[draggable=true].hideDragCellContent.content-icon-ChoroplethStates:before,
92
- div[draggable=true].hideDragCellContent.content-icon-ChoroplethStatesHeat:before,
93
- div[draggable=true].hideDragCellContent.content-icon-ChoroplethCounties:before,
94
- div[draggable=true].hideDragCellContent.content-icon-ChoroplethCountries:before,
95
- div[draggable=true].hideDragCellContent.content-icon-GMap:before,
96
- div[draggable=true].hideDragCellContent.content-icon-GMapHeat:before,
97
- div[draggable=true].hideDragCellContent.content-icon-GMapGraph:before {
98
- content: "\f278";
99
- }
100
-
101
- div[draggable=true].hideDragCellContent.content-icon-Text:before,
102
- div[draggable=true].hideDragCellContent.content-icon-TextBox:before,
103
- div[draggable=true].hideDragCellContent.content-icon-FAChar:before {
104
- content: "\f278";
1
+ .layout_Surface {
2
+ box-sizing: border-box;
3
+ margin: 0px;
4
+ border: 1px solid #e5e5e5;
5
+ overflow: hidden;
6
+ height: 100%;
7
+ width: 100%;
8
+ }
9
+
10
+ .layout_Surface.shadow2 {
11
+ box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12)
12
+ }
13
+
14
+ .layout_Surface>h3 {
15
+ margin: 0px;
16
+ padding: 2px;
17
+ background-color: #e5e5e5;
18
+ }
19
+
20
+ .layout_Surface .html-button-container {
21
+ position: absolute;
22
+ right: 0px;
23
+ top: 3px;
24
+ }
25
+
26
+ .layout_Surface>div {
27
+ padding: 8px;
28
+ }
29
+
30
+ .layout_Surface .html-button-container .surface-button {
31
+ margin-right: 5px;
32
+ }
33
+
34
+ .layout_Surface .html-button-container .surface-button i {
35
+ opacity: 0.8;
36
+ }
37
+
38
+ .layout_Surface .html-button-container .surface-button:hover {
39
+ opacity: 1;
40
+ }
41
+
42
+ .layout_Surface .html-button-container .surface-button:active {
43
+ opacity: 0.5;
44
+ }
45
+
46
+ div[draggable=true].hideDragCellContent.content-icon:before {
47
+ content: "\f080";
48
+ font-family: FontAwesome;
49
+ position: absolute;
50
+ top: calc(50% - 74px);
51
+ left: calc(50% - 56px);
52
+ font-size: 100px;
53
+ }
54
+
55
+ div[draggable=true].hideDragCellContent.content-icon-Line:before {
56
+ content: "\f201";
57
+ }
58
+
59
+ div[draggable=true].hideDragCellContent.content-icon-Pie:before {
60
+ top: calc(50% - 72px);
61
+ left: calc(50% - 45px);
62
+ content: "\f200";
63
+ }
64
+
65
+ div[draggable=true].hideDragCellContent.content-icon-Area:before {
66
+ content: "\f1fe";
67
+ }
68
+
69
+ div[draggable=true].hideDragCellContent.content-icon-Gauge:before {
70
+ content: "\f0e4";
71
+ }
72
+
73
+ div[draggable=true].hideDragCellContent.content-icon-Table:before {
74
+ content: "\f0ce";
75
+ }
76
+
77
+ div[draggable=true].hideDragCellContent.content-icon-Form:before {
78
+ content: "\f11c";
79
+ }
80
+
81
+ div[draggable=true].hideDragCellContent.content-icon-Grid:before,
82
+ div[draggable=true].hideDragCellContent.content-icon-Graph:before,
83
+ div[draggable=true].hideDragCellContent.content-icon-Border:before,
84
+ div[draggable=true].hideDragCellContent.content-icon-Tabbed:before,
85
+ div[draggable=true].hideDragCellContent.content-icon-Accordion:before,
86
+ div[draggable=true].hideDragCellContent.content-icon-MultiChart:before,
87
+ div[draggable=true].hideDragCellContent.content-icon-MultiChartSurface:before {
88
+ content: "\f247";
89
+ }
90
+
91
+ div[draggable=true].hideDragCellContent.content-icon-ChoroplethStates:before,
92
+ div[draggable=true].hideDragCellContent.content-icon-ChoroplethStatesHeat:before,
93
+ div[draggable=true].hideDragCellContent.content-icon-ChoroplethCounties:before,
94
+ div[draggable=true].hideDragCellContent.content-icon-ChoroplethCountries:before,
95
+ div[draggable=true].hideDragCellContent.content-icon-GMap:before,
96
+ div[draggable=true].hideDragCellContent.content-icon-GMapHeat:before,
97
+ div[draggable=true].hideDragCellContent.content-icon-GMapGraph:before {
98
+ content: "\f278";
99
+ }
100
+
101
+ div[draggable=true].hideDragCellContent.content-icon-Text:before,
102
+ div[draggable=true].hideDragCellContent.content-icon-TextBox:before,
103
+ div[draggable=true].hideDragCellContent.content-icon-FAChar:before {
104
+ content: "\f278";
105
105
  }