@hpcc-js/layout 3.5.8 → 3.5.10

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/Accordion.ts CHANGED
@@ -1,146 +1,146 @@
1
- import { FAChar, HTMLWidget } from "@hpcc-js/common";
2
-
3
- import "../src/Accordion.css";
4
-
5
- export class Accordion extends HTMLWidget {
6
- protected _isClosed: boolean;
7
- titleSpan;
8
- iconDiv;
9
- ul;
10
- icon;
11
-
12
- constructor() {
13
- super();
14
-
15
- this._tag = "div";
16
- this._isClosed = false;
17
- }
18
-
19
- pushListItem(widget, prepend: boolean = false, protect: boolean = false) {
20
- const contentArr = this.content();
21
-
22
- widget._protected = protect;
23
-
24
- if (prepend) {
25
- contentArr.unshift(widget);
26
- } else {
27
- contentArr.push(widget);
28
- }
29
- this.content(contentArr);
30
- return this;
31
- }
32
-
33
- clearListItems() {
34
- const arr = [];
35
- for (const i in this.content()) {
36
- if (this.content()[i]._protected) {
37
- arr.push(this.content()[i]);
38
- }
39
- }
40
- this.content(arr);
41
- return this;
42
- }
43
-
44
- collapseClick(element) {
45
- if (element.classed("closed")) {
46
- this._isClosed = false;
47
- element.classed("open", true);
48
- element.classed("closed", false);
49
- } else {
50
- this._isClosed = true;
51
- element.classed("open", false);
52
- element.classed("closed", true);
53
- }
54
- }
55
-
56
- enter(domNode, element) {
57
- super.enter(domNode, element);
58
- const context = this;
59
- this._isClosed = this.defaultCollapsed();
60
- element.classed(this._isClosed ? "closed" : "open", true);
61
-
62
- this.titleSpan = element.append("span").classed("collapsible-title", true);
63
- this.iconDiv = element.append("div").classed("collapsible-icon", true);
64
- this.ul = element.append("ul");
65
-
66
- this.icon = new FAChar()
67
- .size({ height: 24, width: 24 })
68
- .target(this.iconDiv.node());
69
-
70
- this.iconDiv.on("click", function () {
71
- context.collapseClick(element);
72
- context.render();
73
- });
74
- this.titleSpan.on("click", function () {
75
- context.collapseClick(element);
76
- context.render();
77
- });
78
- }
79
-
80
- update(domNode, element) {
81
- super.update(domNode, element);
82
- const context = this;
83
- const this_id = "";
84
- this.titleSpan.text(context.title().length > 0 ? context.title() + this_id : "Accordion [" + context._id + "]" + this_id);
85
- const rows = this.ul.selectAll("#" + context._id + " > ul > li").data(this.content(), function (d) {
86
- return d._id;
87
- });
88
- rows.enter()
89
- .append(function (widget) {
90
- const li = document.createElement("li");
91
- if (widget._target === null) {
92
- const wSize = widget.size();
93
- if (wSize.width === 0 || wSize.height === 0) {
94
- const cSize = context.size();
95
- widget.size({
96
- width: cSize.width,
97
- height: cSize.width
98
- });
99
- }
100
- widget.target(li);
101
- } else {
102
- return widget._target;
103
- }
104
- return li;
105
- })
106
- ;
107
- rows.exit().remove();
108
-
109
- this.icon
110
- .text_colorFill(this.titleFontColor())
111
- .char(this._isClosed ? this.closedIcon() : this.openIcon()).render()
112
- ;
113
- }
114
-
115
- exit(domNode, element) {
116
- super.exit(domNode, element);
117
- }
118
- }
119
- Accordion.prototype._class += " layout_Accordion";
120
-
121
- export interface Accordion {
122
- content(): any[];
123
- content(_: any[]): this;
124
- title(): string;
125
- title(_: string): this;
126
- openIcon(): string;
127
- openIcon(_: string): this;
128
- closedIcon(): string;
129
- closedIcon(_: string): this;
130
- titleFontColor(): string;
131
- titleFontColor(_: string): this;
132
- titleBackgroundColor(): string;
133
- titleBackgroundColor(_: string): this;
134
-
135
- defaultCollapsed(): boolean;
136
- defaultCollapsed(_: boolean): this;
137
- }
138
-
139
- Accordion.prototype.publish("content", [], "widgetArray", "Array of widgets", null, { tags: ["Basic"] });
140
- Accordion.prototype.publish("title", "", "string", "Title of collapsible section", null, { tags: ["Private"] });
141
- Accordion.prototype.publish("openIcon", "\uf147", "string", "Icon to display when list is open", null, { tags: ["Private"] });
142
- Accordion.prototype.publish("closedIcon", "\uf196", "string", "Icon to display when list is closed", null, { tags: ["Private"] });
143
- Accordion.prototype.publish("titleFontColor", "#FFFFFF", "html-color", "Title font color", null, { tags: ["Private"] });
144
- Accordion.prototype.publish("titleBackgroundColor", "#333333", "html-color", "Title background color", null, { tags: ["Private"] });
145
-
146
- Accordion.prototype.publish("defaultCollapsed", false, "boolean", "Collapsed by default if true", null, { tags: ["Private"] });
1
+ import { FAChar, HTMLWidget } from "@hpcc-js/common";
2
+
3
+ import "../src/Accordion.css";
4
+
5
+ export class Accordion extends HTMLWidget {
6
+ protected _isClosed: boolean;
7
+ titleSpan;
8
+ iconDiv;
9
+ ul;
10
+ icon;
11
+
12
+ constructor() {
13
+ super();
14
+
15
+ this._tag = "div";
16
+ this._isClosed = false;
17
+ }
18
+
19
+ pushListItem(widget, prepend: boolean = false, protect: boolean = false) {
20
+ const contentArr = this.content();
21
+
22
+ widget._protected = protect;
23
+
24
+ if (prepend) {
25
+ contentArr.unshift(widget);
26
+ } else {
27
+ contentArr.push(widget);
28
+ }
29
+ this.content(contentArr);
30
+ return this;
31
+ }
32
+
33
+ clearListItems() {
34
+ const arr = [];
35
+ for (const i in this.content()) {
36
+ if (this.content()[i]._protected) {
37
+ arr.push(this.content()[i]);
38
+ }
39
+ }
40
+ this.content(arr);
41
+ return this;
42
+ }
43
+
44
+ collapseClick(element) {
45
+ if (element.classed("closed")) {
46
+ this._isClosed = false;
47
+ element.classed("open", true);
48
+ element.classed("closed", false);
49
+ } else {
50
+ this._isClosed = true;
51
+ element.classed("open", false);
52
+ element.classed("closed", true);
53
+ }
54
+ }
55
+
56
+ enter(domNode, element) {
57
+ super.enter(domNode, element);
58
+ const context = this;
59
+ this._isClosed = this.defaultCollapsed();
60
+ element.classed(this._isClosed ? "closed" : "open", true);
61
+
62
+ this.titleSpan = element.append("span").classed("collapsible-title", true);
63
+ this.iconDiv = element.append("div").classed("collapsible-icon", true);
64
+ this.ul = element.append("ul");
65
+
66
+ this.icon = new FAChar()
67
+ .size({ height: 24, width: 24 })
68
+ .target(this.iconDiv.node());
69
+
70
+ this.iconDiv.on("click", function () {
71
+ context.collapseClick(element);
72
+ context.render();
73
+ });
74
+ this.titleSpan.on("click", function () {
75
+ context.collapseClick(element);
76
+ context.render();
77
+ });
78
+ }
79
+
80
+ update(domNode, element) {
81
+ super.update(domNode, element);
82
+ const context = this;
83
+ const this_id = "";
84
+ this.titleSpan.text(context.title().length > 0 ? context.title() + this_id : "Accordion [" + context._id + "]" + this_id);
85
+ const rows = this.ul.selectAll("#" + context._id + " > ul > li").data(this.content(), function (d) {
86
+ return d._id;
87
+ });
88
+ rows.enter()
89
+ .append(function (widget) {
90
+ const li = document.createElement("li");
91
+ if (widget._target === null) {
92
+ const wSize = widget.size();
93
+ if (wSize.width === 0 || wSize.height === 0) {
94
+ const cSize = context.size();
95
+ widget.size({
96
+ width: cSize.width,
97
+ height: cSize.width
98
+ });
99
+ }
100
+ widget.target(li);
101
+ } else {
102
+ return widget._target;
103
+ }
104
+ return li;
105
+ })
106
+ ;
107
+ rows.exit().remove();
108
+
109
+ this.icon
110
+ .text_colorFill(this.titleFontColor())
111
+ .char(this._isClosed ? this.closedIcon() : this.openIcon()).render()
112
+ ;
113
+ }
114
+
115
+ exit(domNode, element) {
116
+ super.exit(domNode, element);
117
+ }
118
+ }
119
+ Accordion.prototype._class += " layout_Accordion";
120
+
121
+ export interface Accordion {
122
+ content(): any[];
123
+ content(_: any[]): this;
124
+ title(): string;
125
+ title(_: string): this;
126
+ openIcon(): string;
127
+ openIcon(_: string): this;
128
+ closedIcon(): string;
129
+ closedIcon(_: string): this;
130
+ titleFontColor(): string;
131
+ titleFontColor(_: string): this;
132
+ titleBackgroundColor(): string;
133
+ titleBackgroundColor(_: string): this;
134
+
135
+ defaultCollapsed(): boolean;
136
+ defaultCollapsed(_: boolean): this;
137
+ }
138
+
139
+ Accordion.prototype.publish("content", [], "widgetArray", "Array of widgets", null, { tags: ["Basic"] });
140
+ Accordion.prototype.publish("title", "", "string", "Title of collapsible section", null, { tags: ["Private"] });
141
+ Accordion.prototype.publish("openIcon", "\uf147", "string", "Icon to display when list is open", null, { tags: ["Private"] });
142
+ Accordion.prototype.publish("closedIcon", "\uf196", "string", "Icon to display when list is closed", null, { tags: ["Private"] });
143
+ Accordion.prototype.publish("titleFontColor", "#FFFFFF", "html-color", "Title font color", null, { tags: ["Private"] });
144
+ Accordion.prototype.publish("titleBackgroundColor", "#333333", "html-color", "Title background color", null, { tags: ["Private"] });
145
+
146
+ Accordion.prototype.publish("defaultCollapsed", false, "boolean", "Collapsed by default if true", null, { tags: ["Private"] });
package/src/Border.css CHANGED
@@ -1,149 +1,149 @@
1
- .layout_Border {
2
- width: 100%;
3
- height: 100%;
4
- }
5
-
6
- .layout_Border>.border-content {
7
- width: 100%;
8
- height: 100%;
9
- position: relative;
10
- }
11
-
12
- .layout_Border>.borderHandle {
13
- width: 6px;
14
- height: 6px;
15
- background-color: #444;
16
- opacity: 0.3;
17
- position: absolute;
18
- visibility: hidden;
19
- }
20
-
21
- .layout_Border.design-mode>.borderHandle {
22
- visibility: visible;
23
- }
24
-
25
- .layout_Border>.borderHandle:hover {
26
- background-color: #666;
27
- }
28
-
29
- .layout_Border>.borderHandle.borderHandleDisabled {
30
- display: none;
31
- }
32
-
33
- .layout_Border>.borderHandle_top,
34
- .layout_Border>.borderHandle_bottom {
35
- cursor: ns-resize;
36
- }
37
-
38
- .layout_Border>.borderHandle_left,
39
- .layout_Border>.borderHandle_right {
40
- cursor: ew-resize;
41
- }
42
-
43
- .layout_Border .cell {
44
- border-radius: 5px;
45
- border: 1px solid #e5e5e5;
46
- display: inline-block;
47
- overflow: hidden;
48
- }
49
-
50
- .layout_Border .cell h2 {
51
- margin: 0px;
52
- padding-top: 4px;
53
- -webkit-margin: 0px;
54
- text-align: center;
55
- }
56
-
57
- .layout_Border .layout_BorderCell.over {
58
- border: 2px dashed #000;
59
- }
60
-
61
- .layout_Border .dragItem {
62
- z-index: -1;
63
- opacity: 0.33;
64
- }
65
-
66
- .layout_Border .notDragItem {
67
- z-index: -1;
68
- opacity: 1;
69
- }
70
-
71
- .layout_Border div[draggable=true] {
72
- opacity: 0.75;
73
- cursor: default;
74
- }
75
-
76
- .layout_Border div[draggable=true] .dragHandle {
77
- opacity: 1.0;
78
- }
79
-
80
- .layout_Border div[draggable=true] .dragHandle_n,
81
- .layout_Border div[draggable=true] .dragHandle_e,
82
- .layout_Border div[draggable=true] .dragHandle_s,
83
- .layout_Border div[draggable=true] .dragHandle_w {
84
- background-color: #AAA;
85
- }
86
-
87
- .layout_Border div[draggable=true] .dragHandle_nw,
88
- .layout_Border div[draggable=true] .dragHandle_ne,
89
- .layout_Border div[draggable=true] .dragHandle_se,
90
- .layout_Border div[draggable=true] .dragHandle_sw {
91
- background-color: #333;
92
- }
93
-
94
- .layout_Border div[draggable=true] .dragHandle_nw {
95
- cursor: nw-resize;
96
- }
97
-
98
- .layout_Border div[draggable=true] .dragHandle_n {
99
- cursor: n-resize;
100
- }
101
-
102
- .layout_Border div[draggable=true] .dragHandle_ne {
103
- cursor: ne-resize;
104
- }
105
-
106
- .layout_Border div[draggable=true] .dragHandle_e {
107
- cursor: e-resize;
108
- }
109
-
110
- .layout_Border div[draggable=true] .dragHandle_se {
111
- cursor: se-resize;
112
- }
113
-
114
- .layout_Border div[draggable=true] .dragHandle_s {
115
- cursor: s-resize;
116
- }
117
-
118
- .layout_Border div[draggable=true] .dragHandle_sw {
119
- cursor: sw-resize;
120
- }
121
-
122
- .layout_Border div[draggable=true] .dragHandle_w {
123
- cursor: w-resize;
124
- }
125
-
126
- .layout_Border div[draggable=false]>div>.dragHandle {
127
- display: none;
128
- }
129
-
130
- .layout_Border .grid-drop-target {
131
- position: fixed;
132
- box-sizing: border-box;
133
- border: 2px dashed #7f8c8d;
134
- border-radius: 0px;
135
- background: repeating-linear-gradient(-45deg,
136
- rgba(0, 0, 0, 0),
137
- rgba(0, 0, 0, 0) 4px,
138
- rgba(100, 100, 100, 0.1) 4px,
139
- rgba(100, 100, 100, 0.1) 8px);
140
- }
141
-
142
- .layout_Border .grid-drop-target.drop-target-over {
143
- border: 2px dashed #179BD7;
144
- background: repeating-linear-gradient(-45deg,
145
- rgba(0, 0, 0, 0),
146
- rgba(0, 0, 0, 0) 6px,
147
- rgba(17, 155, 215, 0.1) 6px,
148
- rgba(17, 155, 215, 0.1) 12px);
1
+ .layout_Border {
2
+ width: 100%;
3
+ height: 100%;
4
+ }
5
+
6
+ .layout_Border>.border-content {
7
+ width: 100%;
8
+ height: 100%;
9
+ position: relative;
10
+ }
11
+
12
+ .layout_Border>.borderHandle {
13
+ width: 6px;
14
+ height: 6px;
15
+ background-color: #444;
16
+ opacity: 0.3;
17
+ position: absolute;
18
+ visibility: hidden;
19
+ }
20
+
21
+ .layout_Border.design-mode>.borderHandle {
22
+ visibility: visible;
23
+ }
24
+
25
+ .layout_Border>.borderHandle:hover {
26
+ background-color: #666;
27
+ }
28
+
29
+ .layout_Border>.borderHandle.borderHandleDisabled {
30
+ display: none;
31
+ }
32
+
33
+ .layout_Border>.borderHandle_top,
34
+ .layout_Border>.borderHandle_bottom {
35
+ cursor: ns-resize;
36
+ }
37
+
38
+ .layout_Border>.borderHandle_left,
39
+ .layout_Border>.borderHandle_right {
40
+ cursor: ew-resize;
41
+ }
42
+
43
+ .layout_Border .cell {
44
+ border-radius: 5px;
45
+ border: 1px solid #e5e5e5;
46
+ display: inline-block;
47
+ overflow: hidden;
48
+ }
49
+
50
+ .layout_Border .cell h2 {
51
+ margin: 0px;
52
+ padding-top: 4px;
53
+ -webkit-margin: 0px;
54
+ text-align: center;
55
+ }
56
+
57
+ .layout_Border .layout_BorderCell.over {
58
+ border: 2px dashed #000;
59
+ }
60
+
61
+ .layout_Border .dragItem {
62
+ z-index: -1;
63
+ opacity: 0.33;
64
+ }
65
+
66
+ .layout_Border .notDragItem {
67
+ z-index: -1;
68
+ opacity: 1;
69
+ }
70
+
71
+ .layout_Border div[draggable=true] {
72
+ opacity: 0.75;
73
+ cursor: default;
74
+ }
75
+
76
+ .layout_Border div[draggable=true] .dragHandle {
77
+ opacity: 1.0;
78
+ }
79
+
80
+ .layout_Border div[draggable=true] .dragHandle_n,
81
+ .layout_Border div[draggable=true] .dragHandle_e,
82
+ .layout_Border div[draggable=true] .dragHandle_s,
83
+ .layout_Border div[draggable=true] .dragHandle_w {
84
+ background-color: #AAA;
85
+ }
86
+
87
+ .layout_Border div[draggable=true] .dragHandle_nw,
88
+ .layout_Border div[draggable=true] .dragHandle_ne,
89
+ .layout_Border div[draggable=true] .dragHandle_se,
90
+ .layout_Border div[draggable=true] .dragHandle_sw {
91
+ background-color: #333;
92
+ }
93
+
94
+ .layout_Border div[draggable=true] .dragHandle_nw {
95
+ cursor: nw-resize;
96
+ }
97
+
98
+ .layout_Border div[draggable=true] .dragHandle_n {
99
+ cursor: n-resize;
100
+ }
101
+
102
+ .layout_Border div[draggable=true] .dragHandle_ne {
103
+ cursor: ne-resize;
104
+ }
105
+
106
+ .layout_Border div[draggable=true] .dragHandle_e {
107
+ cursor: e-resize;
108
+ }
109
+
110
+ .layout_Border div[draggable=true] .dragHandle_se {
111
+ cursor: se-resize;
112
+ }
113
+
114
+ .layout_Border div[draggable=true] .dragHandle_s {
115
+ cursor: s-resize;
116
+ }
117
+
118
+ .layout_Border div[draggable=true] .dragHandle_sw {
119
+ cursor: sw-resize;
120
+ }
121
+
122
+ .layout_Border div[draggable=true] .dragHandle_w {
123
+ cursor: w-resize;
124
+ }
125
+
126
+ .layout_Border div[draggable=false]>div>.dragHandle {
127
+ display: none;
128
+ }
129
+
130
+ .layout_Border .grid-drop-target {
131
+ position: fixed;
132
+ box-sizing: border-box;
133
+ border: 2px dashed #7f8c8d;
134
+ border-radius: 0px;
135
+ background: repeating-linear-gradient(-45deg,
136
+ rgba(0, 0, 0, 0),
137
+ rgba(0, 0, 0, 0) 4px,
138
+ rgba(100, 100, 100, 0.1) 4px,
139
+ rgba(100, 100, 100, 0.1) 8px);
140
+ }
141
+
142
+ .layout_Border .grid-drop-target.drop-target-over {
143
+ border: 2px dashed #179BD7;
144
+ background: repeating-linear-gradient(-45deg,
145
+ rgba(0, 0, 0, 0),
146
+ rgba(0, 0, 0, 0) 6px,
147
+ rgba(17, 155, 215, 0.1) 6px,
148
+ rgba(17, 155, 215, 0.1) 12px);
149
149
  }