@hpcc-js/html 3.3.15 → 3.3.16

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/TitleBar.css CHANGED
@@ -1,95 +1,95 @@
1
- #wrap {
2
- width: 100%;
3
- }
4
-
5
- #left,
6
- #right {
7
- padding: 5px;
8
- }
9
-
10
- #left {
11
- background-color: red;
12
- text-align: left;
13
- display: block;
14
- text-overflow: ellipsis;
15
- white-space: nowrap;
16
- overflow: hidden;
17
- }
18
-
19
- #right {
20
- background-color: orange;
21
- float: right;
22
- text-align: right;
23
- white-space: nowrap;
24
- }
25
-
26
- .html_TitleBar>.main {
27
- width: 100%;
28
- display: block;
29
- }
30
-
31
- .html_TitleBar .title {
32
- padding: 4px;
33
- text-align: left;
34
- display: block;
35
- text-overflow: ellipsis;
36
- white-space: nowrap;
37
- overflow: hidden;
38
- font-size: 20px;
39
- font-weight: bold;
40
- }
41
-
42
- .html_TitleBar .icon-bar {
43
- padding: 4px;
44
- float: right;
45
- text-align: right;
46
- white-space: nowrap;
47
- line-height: 28px;
48
- }
49
-
50
- .html_TitleBar .icon-bar-item {
51
- display: inline;
52
- }
53
-
54
- .html_TitleBar .icon-bar-item>div {
55
- display: inline;
56
- }
57
-
58
- .html_TitleBar .icon-bar a {
59
- text-align: center;
60
- /* Center-align text */
61
- padding-top: 4px;
62
- padding-bottom: 4px;
63
- transition: all 0.3s ease;
64
- /* Add transition for hover effects */
65
- color: darkgray;
66
- /* White text color */
67
- }
68
-
69
- .html_TitleBar .icon-bar a:hover {
70
- background-color: whitesmoke;
71
- /* Add a hover color */
72
- }
73
-
74
- .html_TitleBar .icon-bar a.selected {
75
- background-color: #efe5e5;
76
- /* Add a hover color */
77
- }
78
-
79
- .html_TitleBar .icon-bar a.spacer {
80
- text-align: center;
81
- /* Center-align text */
82
- padding-top: 2px;
83
- padding-left: 8px;
84
- padding-bottom: 0px;
85
- color: none;
86
- }
87
-
88
- .html_TitleBar .icon-bar a.spacer:hover {
89
- background-color: transparent;
90
- }
91
-
92
- .html_TitleBar .icon-bar .active {
93
- background-color: #4CAF50;
94
- /* Add an active/current color */
1
+ #wrap {
2
+ width: 100%;
3
+ }
4
+
5
+ #left,
6
+ #right {
7
+ padding: 5px;
8
+ }
9
+
10
+ #left {
11
+ background-color: red;
12
+ text-align: left;
13
+ display: block;
14
+ text-overflow: ellipsis;
15
+ white-space: nowrap;
16
+ overflow: hidden;
17
+ }
18
+
19
+ #right {
20
+ background-color: orange;
21
+ float: right;
22
+ text-align: right;
23
+ white-space: nowrap;
24
+ }
25
+
26
+ .html_TitleBar>.main {
27
+ width: 100%;
28
+ display: block;
29
+ }
30
+
31
+ .html_TitleBar .title {
32
+ padding: 4px;
33
+ text-align: left;
34
+ display: block;
35
+ text-overflow: ellipsis;
36
+ white-space: nowrap;
37
+ overflow: hidden;
38
+ font-size: 20px;
39
+ font-weight: bold;
40
+ }
41
+
42
+ .html_TitleBar .icon-bar {
43
+ padding: 4px;
44
+ float: right;
45
+ text-align: right;
46
+ white-space: nowrap;
47
+ line-height: 28px;
48
+ }
49
+
50
+ .html_TitleBar .icon-bar-item {
51
+ display: inline;
52
+ }
53
+
54
+ .html_TitleBar .icon-bar-item>div {
55
+ display: inline;
56
+ }
57
+
58
+ .html_TitleBar .icon-bar a {
59
+ text-align: center;
60
+ /* Center-align text */
61
+ padding-top: 4px;
62
+ padding-bottom: 4px;
63
+ transition: all 0.3s ease;
64
+ /* Add transition for hover effects */
65
+ color: darkgray;
66
+ /* White text color */
67
+ }
68
+
69
+ .html_TitleBar .icon-bar a:hover {
70
+ background-color: whitesmoke;
71
+ /* Add a hover color */
72
+ }
73
+
74
+ .html_TitleBar .icon-bar a.selected {
75
+ background-color: #efe5e5;
76
+ /* Add a hover color */
77
+ }
78
+
79
+ .html_TitleBar .icon-bar a.spacer {
80
+ text-align: center;
81
+ /* Center-align text */
82
+ padding-top: 2px;
83
+ padding-left: 8px;
84
+ padding-bottom: 0px;
85
+ color: none;
86
+ }
87
+
88
+ .html_TitleBar .icon-bar a.spacer:hover {
89
+ background-color: transparent;
90
+ }
91
+
92
+ .html_TitleBar .icon-bar .active {
93
+ background-color: #4CAF50;
94
+ /* Add an active/current color */
95
95
  }
package/src/TitleBar.ts CHANGED
@@ -1,136 +1,136 @@
1
- import { HTMLWidget } from "@hpcc-js/common";
2
- import { JSXWidget } from "./JSXWidget.ts";
3
-
4
- import "../src/TitleBar.css";
5
-
6
- export interface IClickHandler {
7
- titleBarClick(src: Item, d, idx: number, groups): void;
8
- }
9
-
10
- export class Item extends HTMLWidget {
11
- protected _owner: IClickHandler;
12
-
13
- constructor(owner: IClickHandler) {
14
- super();
15
- this._owner = owner;
16
- this._tag = "a";
17
- }
18
- }
19
- Item.prototype._class += " html_Item";
20
-
21
- export class Button extends Item {
22
- private _icon: string;
23
-
24
- constructor(owner: IClickHandler, icon: string) {
25
- super(owner);
26
- this._icon = icon;
27
- }
28
-
29
- icon() {
30
- return this._icon;
31
- }
32
-
33
- enter(domNode: HTMLElement, element) {
34
- super.enter(domNode, element);
35
- element
36
- .attr("href", "#")
37
- .on("click", (d, idx, groups) => this._owner.titleBarClick(this, d, idx, groups))
38
- .append("i")
39
- .attr("class", `fa ${this._icon} fa-lg fa-fw`)
40
- ;
41
- }
42
- }
43
- Button.prototype._class += " html_Button";
44
-
45
- export class ToggleButton extends Button {
46
-
47
- enter(domNode: HTMLElement, element) {
48
- element.on("click.sel", (d, idx, groups) => {
49
- this.selected(!this.selected());
50
- this.render();
51
- });
52
- super.enter(domNode, element);
53
- }
54
-
55
- update(domNode, element) {
56
- super.update(domNode, element);
57
- this._element.classed("selected", this.selected());
58
- }
59
- }
60
- ToggleButton.prototype._class += " html_ToggleButton";
61
- export interface ToggleButton {
62
- selected(): boolean;
63
- selected(_: boolean): this;
64
- }
65
- ToggleButton.prototype.publish("selected", false, "boolean");
66
-
67
- export class Spacer extends Item {
68
-
69
- enter(domNode, element) {
70
- super.enter(domNode, element);
71
- element
72
- .attr("class", "spacer")
73
- .attr("href", "#")
74
- .append("i")
75
- ;
76
- }
77
- }
78
- Spacer.prototype._class += " html_Spacer";
79
-
80
- export class TitleBar extends JSXWidget {
81
- protected _divMain;
82
- protected _divIconBar;
83
- protected _divTitle;
84
-
85
- constructor() {
86
- super();
87
- }
88
-
89
- enter(domNode, element) {
90
- super.enter(domNode, element);
91
- this._divMain = element.append("div")
92
- .attr("class", "main")
93
- ;
94
- this._divIconBar = this._divMain.append("div")
95
- .attr("class", "icon-bar")
96
- ;
97
- this._divTitle = this._divMain.append("div")
98
- .attr("class", "title")
99
- ;
100
- }
101
-
102
- update(domNode, element) {
103
- super.update(domNode, element);
104
-
105
- this._divTitle.text(this.title());
106
-
107
- const icons = this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());
108
- icons.enter().append("div")
109
- .attr("class", "icon-bar-item")
110
- .each(function (this: HTMLElement, d: Item) {
111
- d.target(this);
112
- })
113
- .merge(icons)
114
- .each(function (d: Item) {
115
- d.render();
116
- })
117
- ;
118
- icons.exit()
119
- .each(function (d: Item) {
120
- d.target(null);
121
- })
122
- .remove()
123
- ;
124
- icons.order();
125
- }
126
- }
127
- TitleBar.prototype._class += " html_TitleBar";
128
-
129
- export interface TitleBar {
130
- title(): string;
131
- title(_: string): this;
132
- buttons(): Item[];
133
- buttons(items: Item[]): this;
134
- }
135
- TitleBar.prototype.publish("title", "", "string");
136
- TitleBar.prototype.publish("buttons", [], "widgetArray");
1
+ import { HTMLWidget } from "@hpcc-js/common";
2
+ import { JSXWidget } from "./JSXWidget.ts";
3
+
4
+ import "../src/TitleBar.css";
5
+
6
+ export interface IClickHandler {
7
+ titleBarClick(src: Item, d, idx: number, groups): void;
8
+ }
9
+
10
+ export class Item extends HTMLWidget {
11
+ protected _owner: IClickHandler;
12
+
13
+ constructor(owner: IClickHandler) {
14
+ super();
15
+ this._owner = owner;
16
+ this._tag = "a";
17
+ }
18
+ }
19
+ Item.prototype._class += " html_Item";
20
+
21
+ export class Button extends Item {
22
+ private _icon: string;
23
+
24
+ constructor(owner: IClickHandler, icon: string) {
25
+ super(owner);
26
+ this._icon = icon;
27
+ }
28
+
29
+ icon() {
30
+ return this._icon;
31
+ }
32
+
33
+ enter(domNode: HTMLElement, element) {
34
+ super.enter(domNode, element);
35
+ element
36
+ .attr("href", "#")
37
+ .on("click", (d, idx, groups) => this._owner.titleBarClick(this, d, idx, groups))
38
+ .append("i")
39
+ .attr("class", `fa ${this._icon} fa-lg fa-fw`)
40
+ ;
41
+ }
42
+ }
43
+ Button.prototype._class += " html_Button";
44
+
45
+ export class ToggleButton extends Button {
46
+
47
+ enter(domNode: HTMLElement, element) {
48
+ element.on("click.sel", (d, idx, groups) => {
49
+ this.selected(!this.selected());
50
+ this.render();
51
+ });
52
+ super.enter(domNode, element);
53
+ }
54
+
55
+ update(domNode, element) {
56
+ super.update(domNode, element);
57
+ this._element.classed("selected", this.selected());
58
+ }
59
+ }
60
+ ToggleButton.prototype._class += " html_ToggleButton";
61
+ export interface ToggleButton {
62
+ selected(): boolean;
63
+ selected(_: boolean): this;
64
+ }
65
+ ToggleButton.prototype.publish("selected", false, "boolean");
66
+
67
+ export class Spacer extends Item {
68
+
69
+ enter(domNode, element) {
70
+ super.enter(domNode, element);
71
+ element
72
+ .attr("class", "spacer")
73
+ .attr("href", "#")
74
+ .append("i")
75
+ ;
76
+ }
77
+ }
78
+ Spacer.prototype._class += " html_Spacer";
79
+
80
+ export class TitleBar extends JSXWidget {
81
+ protected _divMain;
82
+ protected _divIconBar;
83
+ protected _divTitle;
84
+
85
+ constructor() {
86
+ super();
87
+ }
88
+
89
+ enter(domNode, element) {
90
+ super.enter(domNode, element);
91
+ this._divMain = element.append("div")
92
+ .attr("class", "main")
93
+ ;
94
+ this._divIconBar = this._divMain.append("div")
95
+ .attr("class", "icon-bar")
96
+ ;
97
+ this._divTitle = this._divMain.append("div")
98
+ .attr("class", "title")
99
+ ;
100
+ }
101
+
102
+ update(domNode, element) {
103
+ super.update(domNode, element);
104
+
105
+ this._divTitle.text(this.title());
106
+
107
+ const icons = this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());
108
+ icons.enter().append("div")
109
+ .attr("class", "icon-bar-item")
110
+ .each(function (this: HTMLElement, d: Item) {
111
+ d.target(this);
112
+ })
113
+ .merge(icons)
114
+ .each(function (d: Item) {
115
+ d.render();
116
+ })
117
+ ;
118
+ icons.exit()
119
+ .each(function (d: Item) {
120
+ d.target(null);
121
+ })
122
+ .remove()
123
+ ;
124
+ icons.order();
125
+ }
126
+ }
127
+ TitleBar.prototype._class += " html_TitleBar";
128
+
129
+ export interface TitleBar {
130
+ title(): string;
131
+ title(_: string): this;
132
+ buttons(): Item[];
133
+ buttons(items: Item[]): this;
134
+ }
135
+ TitleBar.prototype.publish("title", "", "string");
136
+ TitleBar.prototype.publish("buttons", [], "widgetArray");
@@ -1,39 +1,39 @@
1
- import { JSXWidget } from "./JSXWidget.ts";
2
-
3
- export class VizComponent extends JSXWidget.Component<any, any> {
4
- widget;
5
-
6
- refreshProps() {
7
- for (const key in (this as any).props) {
8
- if (this.widget[key] && typeof this.widget[key] === "function") {
9
- this.widget[key]((this as any).props[key]);
10
- }
11
- }
12
- }
13
-
14
- componentDidMount() {
15
- this.widget = new (this as any).props.type()
16
- .target((this as any).base)
17
- ;
18
- this.refreshProps();
19
- this.widget
20
- .render()
21
- ;
22
- }
23
-
24
- componentWillUnmount() {
25
- this.widget
26
- .target(null)
27
- .render()
28
- ;
29
- }
30
-
31
- render() {
32
- return <div style={(this as any).props.style} />;
33
- }
34
-
35
- componentDidUpdate() {
36
- this.refreshProps();
37
- this.widget.render();
38
- }
39
- }
1
+ import { JSXWidget } from "./JSXWidget.ts";
2
+
3
+ export class VizComponent extends JSXWidget.Component<any, any> {
4
+ widget;
5
+
6
+ refreshProps() {
7
+ for (const key in (this as any).props) {
8
+ if (this.widget[key] && typeof this.widget[key] === "function") {
9
+ this.widget[key]((this as any).props[key]);
10
+ }
11
+ }
12
+ }
13
+
14
+ componentDidMount() {
15
+ this.widget = new (this as any).props.type()
16
+ .target((this as any).base)
17
+ ;
18
+ this.refreshProps();
19
+ this.widget
20
+ .render()
21
+ ;
22
+ }
23
+
24
+ componentWillUnmount() {
25
+ this.widget
26
+ .target(null)
27
+ .render()
28
+ ;
29
+ }
30
+
31
+ render() {
32
+ return <div style={(this as any).props.style} />;
33
+ }
34
+
35
+ componentDidUpdate() {
36
+ this.refreshProps();
37
+ this.widget.render();
38
+ }
39
+ }
@@ -1,39 +1,39 @@
1
- import { JSXWidget } from "./JSXWidget.ts";
2
-
3
- export class VizInstance extends JSXWidget.Component<any, any> {
4
- widget;
5
-
6
- refreshProps() {
7
- for (const key in (this as any).props) {
8
- if (this.widget[key] && typeof this.widget[key] === "function") {
9
- this.widget[key]((this as any).props[key]);
10
- }
11
- }
12
- }
13
-
14
- componentDidMount() {
15
- this.widget = (this as any).props.instance
16
- .target((this as any).base)
17
- ;
18
- this.refreshProps();
19
- this.widget
20
- .render()
21
- ;
22
- }
23
-
24
- componentWillUnmount() {
25
- this.widget
26
- .target(null)
27
- .render()
28
- ;
29
- }
30
-
31
- render() {
32
- return <div style={(this as any).props.style} />;
33
- }
34
-
35
- componentDidUpdate() {
36
- this.refreshProps();
37
- this.widget.render();
38
- }
39
- }
1
+ import { JSXWidget } from "./JSXWidget.ts";
2
+
3
+ export class VizInstance extends JSXWidget.Component<any, any> {
4
+ widget;
5
+
6
+ refreshProps() {
7
+ for (const key in (this as any).props) {
8
+ if (this.widget[key] && typeof this.widget[key] === "function") {
9
+ this.widget[key]((this as any).props[key]);
10
+ }
11
+ }
12
+ }
13
+
14
+ componentDidMount() {
15
+ this.widget = (this as any).props.instance
16
+ .target((this as any).base)
17
+ ;
18
+ this.refreshProps();
19
+ this.widget
20
+ .render()
21
+ ;
22
+ }
23
+
24
+ componentWillUnmount() {
25
+ this.widget
26
+ .target(null)
27
+ .render()
28
+ ;
29
+ }
30
+
31
+ render() {
32
+ return <div style={(this as any).props.style} />;
33
+ }
34
+
35
+ componentDidUpdate() {
36
+ this.refreshProps();
37
+ this.widget.render();
38
+ }
39
+ }
@@ -1,3 +1,3 @@
1
- export const PKG_NAME = "__PACKAGE_NAME__";
2
- export const PKG_VERSION = "__PACKAGE_VERSION__";
3
- export const BUILD_VERSION = "__BUILD_VERSION__";
1
+ export const PKG_NAME = "__PACKAGE_NAME__";
2
+ export const PKG_VERSION = "__PACKAGE_VERSION__";
3
+ export const BUILD_VERSION = "__BUILD_VERSION__";
package/src/index.ts CHANGED
@@ -1,11 +1,11 @@
1
- export * from "./__package__.ts";
2
- export * from "./BreakdownTable.ts";
3
- export * from "./HTMLTooltip.ts";
4
- export * from "./JSXWidget.ts";
5
- export * from "./reactD3.ts";
6
- export * from "./VizComponent.tsx";
7
- export * from "./VizInstance.tsx";
8
- export * from "./SimpleTable.ts";
9
- export * from "./StatsTable.ts";
10
- export * from "./StyledTable.ts";
11
- export * from "./TitleBar.ts";
1
+ export * from "./__package__.ts";
2
+ export * from "./BreakdownTable.ts";
3
+ export * from "./HTMLTooltip.ts";
4
+ export * from "./JSXWidget.ts";
5
+ export * from "./reactD3.ts";
6
+ export * from "./VizComponent.tsx";
7
+ export * from "./VizInstance.tsx";
8
+ export * from "./SimpleTable.ts";
9
+ export * from "./StatsTable.ts";
10
+ export * from "./StyledTable.ts";
11
+ export * from "./TitleBar.ts";