@hpcc-js/dgrid2 2.5.3 → 2.5.5
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/LICENSE +43 -43
- package/README.md +5 -5
- package/dist/index.es6.js +2 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +4 -4
- package/src/__package__.ts +3 -3
- package/src/hooks.ts +12 -12
- package/src/index.ts +2 -2
- package/src/reactTable.tsx +159 -159
- package/src/table.css +9 -9
- package/src/table.md +57 -57
- package/src/table.ts +92 -92
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
package/src/table.ts
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { HTMLWidget, publish } from "@hpcc-js/common";
|
|
3
|
-
import { render, unmountComponentAtNode } from "react-dom";
|
|
4
|
-
import { ReactTable } from "./reactTable";
|
|
5
|
-
|
|
6
|
-
import "../src/table.css";
|
|
7
|
-
|
|
8
|
-
export type ColumnType = "boolean" | "number" | "string" | "time";
|
|
9
|
-
|
|
10
|
-
export class Table extends HTMLWidget {
|
|
11
|
-
|
|
12
|
-
protected _div;
|
|
13
|
-
|
|
14
|
-
constructor() {
|
|
15
|
-
super();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@publish("...empty...", "string", "No Data Message")
|
|
19
|
-
noDataMessage: publish<this, string>;
|
|
20
|
-
@publish(false, "boolean", "Dark Mode")
|
|
21
|
-
darkMode: publish<this, boolean>;
|
|
22
|
-
@publish(false, "boolean", "Multiple Selection")
|
|
23
|
-
multiSelect: publish<this, boolean>;
|
|
24
|
-
@publish({}, "object", "Column Types (\"boolean\" | \"number\" | \"string\" | \"time\"")
|
|
25
|
-
columnTypes: publish<this, { [column: string]: ColumnType }>;
|
|
26
|
-
@publish({}, "object", "Column Patterns")
|
|
27
|
-
columnPatterns: publish<this, { [column: string]: string }>;
|
|
28
|
-
@publish({}, "object", "Column Formats")
|
|
29
|
-
columnFormats: publish<this, { [column: string]: string }>;
|
|
30
|
-
|
|
31
|
-
columnType(column: string): ColumnType;
|
|
32
|
-
columnType(column: string, type: ColumnType): this;
|
|
33
|
-
columnType(column: string, type?: ColumnType): ColumnType | this {
|
|
34
|
-
if (arguments.length === 1) return this.columnTypes()[column];
|
|
35
|
-
this.columnTypes({ ...this.columnTypes(), [column]: type });
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
columnPattern(column: string): string;
|
|
40
|
-
columnPattern(column: string, pattern: string): this;
|
|
41
|
-
columnPattern(column: string, pattern?: string): string | this {
|
|
42
|
-
if (arguments.length === 1) return this.columnPatterns()[column];
|
|
43
|
-
this.columnPatterns({ ...this.columnPatterns(), [column]: pattern });
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
columnFormat(column: string): string;
|
|
48
|
-
columnFormat(column: string, format: string): this;
|
|
49
|
-
columnFormat(column: string, format?: string): string | this {
|
|
50
|
-
if (arguments.length === 1) return this.columnFormats()[column];
|
|
51
|
-
this.columnFormats({ ...this.columnFormats(), [column]: format });
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
private _prevRow;
|
|
56
|
-
private _prevColumn;
|
|
57
|
-
onRowClickCallback(row, column) {
|
|
58
|
-
if (this._prevRow && JSON.stringify(this._prevRow) !== JSON.stringify(row)) {
|
|
59
|
-
this.click(this._prevRow, this._prevColumn ?? "", false);
|
|
60
|
-
}
|
|
61
|
-
if (row) {
|
|
62
|
-
this.click(row, column, true);
|
|
63
|
-
}
|
|
64
|
-
this._prevRow = row;
|
|
65
|
-
this._prevColumn = column;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
enter(domNode, element) {
|
|
69
|
-
super.enter(domNode, element);
|
|
70
|
-
this._div = element
|
|
71
|
-
.append("div")
|
|
72
|
-
;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
update(domNode, element) {
|
|
76
|
-
super.update(domNode, element);
|
|
77
|
-
this._div.style("width", this.width() + "px");
|
|
78
|
-
this._div.style("height", this.height() + "px");
|
|
79
|
-
render(React.createElement(ReactTable, { table: this }), this._div.node());
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
exit(domNode, element) {
|
|
83
|
-
unmountComponentAtNode(this._div.node());
|
|
84
|
-
this._div.remove();
|
|
85
|
-
super.exit(domNode, element);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Events ---
|
|
89
|
-
click(row, col, sel) {
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
Table.prototype._class += " dgrid2_Table";
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { HTMLWidget, publish } from "@hpcc-js/common";
|
|
3
|
+
import { render, unmountComponentAtNode } from "react-dom";
|
|
4
|
+
import { ReactTable } from "./reactTable";
|
|
5
|
+
|
|
6
|
+
import "../src/table.css";
|
|
7
|
+
|
|
8
|
+
export type ColumnType = "boolean" | "number" | "string" | "time";
|
|
9
|
+
|
|
10
|
+
export class Table extends HTMLWidget {
|
|
11
|
+
|
|
12
|
+
protected _div;
|
|
13
|
+
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@publish("...empty...", "string", "No Data Message")
|
|
19
|
+
noDataMessage: publish<this, string>;
|
|
20
|
+
@publish(false, "boolean", "Dark Mode")
|
|
21
|
+
darkMode: publish<this, boolean>;
|
|
22
|
+
@publish(false, "boolean", "Multiple Selection")
|
|
23
|
+
multiSelect: publish<this, boolean>;
|
|
24
|
+
@publish({}, "object", "Column Types (\"boolean\" | \"number\" | \"string\" | \"time\"")
|
|
25
|
+
columnTypes: publish<this, { [column: string]: ColumnType }>;
|
|
26
|
+
@publish({}, "object", "Column Patterns")
|
|
27
|
+
columnPatterns: publish<this, { [column: string]: string }>;
|
|
28
|
+
@publish({}, "object", "Column Formats")
|
|
29
|
+
columnFormats: publish<this, { [column: string]: string }>;
|
|
30
|
+
|
|
31
|
+
columnType(column: string): ColumnType;
|
|
32
|
+
columnType(column: string, type: ColumnType): this;
|
|
33
|
+
columnType(column: string, type?: ColumnType): ColumnType | this {
|
|
34
|
+
if (arguments.length === 1) return this.columnTypes()[column];
|
|
35
|
+
this.columnTypes({ ...this.columnTypes(), [column]: type });
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
columnPattern(column: string): string;
|
|
40
|
+
columnPattern(column: string, pattern: string): this;
|
|
41
|
+
columnPattern(column: string, pattern?: string): string | this {
|
|
42
|
+
if (arguments.length === 1) return this.columnPatterns()[column];
|
|
43
|
+
this.columnPatterns({ ...this.columnPatterns(), [column]: pattern });
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
columnFormat(column: string): string;
|
|
48
|
+
columnFormat(column: string, format: string): this;
|
|
49
|
+
columnFormat(column: string, format?: string): string | this {
|
|
50
|
+
if (arguments.length === 1) return this.columnFormats()[column];
|
|
51
|
+
this.columnFormats({ ...this.columnFormats(), [column]: format });
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private _prevRow;
|
|
56
|
+
private _prevColumn;
|
|
57
|
+
onRowClickCallback(row, column) {
|
|
58
|
+
if (this._prevRow && JSON.stringify(this._prevRow) !== JSON.stringify(row)) {
|
|
59
|
+
this.click(this._prevRow, this._prevColumn ?? "", false);
|
|
60
|
+
}
|
|
61
|
+
if (row) {
|
|
62
|
+
this.click(row, column, true);
|
|
63
|
+
}
|
|
64
|
+
this._prevRow = row;
|
|
65
|
+
this._prevColumn = column;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
enter(domNode, element) {
|
|
69
|
+
super.enter(domNode, element);
|
|
70
|
+
this._div = element
|
|
71
|
+
.append("div")
|
|
72
|
+
;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
update(domNode, element) {
|
|
76
|
+
super.update(domNode, element);
|
|
77
|
+
this._div.style("width", this.width() + "px");
|
|
78
|
+
this._div.style("height", this.height() + "px");
|
|
79
|
+
render(React.createElement(ReactTable, { table: this }), this._div.node());
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
exit(domNode, element) {
|
|
83
|
+
unmountComponentAtNode(this._div.node());
|
|
84
|
+
this._div.remove();
|
|
85
|
+
super.exit(domNode, element);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Events ---
|
|
89
|
+
click(row, col, sel) {
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
Table.prototype._class += " dgrid2_Table";
|
package/types/__package__.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const PKG_NAME = "@hpcc-js/dgrid2";
|
|
2
|
-
export declare const PKG_VERSION = "2.5.
|
|
3
|
-
export declare const BUILD_VERSION = "2.108.
|
|
2
|
+
export declare const PKG_VERSION = "2.5.5";
|
|
3
|
+
export declare const BUILD_VERSION = "2.108.10";
|
|
4
4
|
//# sourceMappingURL=__package__.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__package__.d.ts","sourceRoot":"","sources":["../src/__package__.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,oBAAoB,CAAC;AAC1C,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"__package__.d.ts","sourceRoot":"","sources":["../src/__package__.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,oBAAoB,CAAC;AAC1C,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,aAAa,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const PKG_NAME = "@hpcc-js/dgrid2";
|
|
2
|
-
export declare const PKG_VERSION = "2.5.
|
|
3
|
-
export declare const BUILD_VERSION = "2.108.
|
|
2
|
+
export declare const PKG_VERSION = "2.5.5";
|
|
3
|
+
export declare const BUILD_VERSION = "2.108.10";
|
|
4
4
|
//# sourceMappingURL=__package__.d.ts.map
|