gd-bs 6.6.32 → 6.6.33
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/build/components/table/index.js +6 -6
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +4 -4
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/table/index.ts +6 -6
- package/src/components/table/types.d.ts +4 -4
package/package.json
CHANGED
|
@@ -78,7 +78,7 @@ class _Table extends Base<ITableProps> implements ITable {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// Renders a cell
|
|
81
|
-
private renderCell(row: HTMLTableRowElement, props: ITableColumn, data) {
|
|
81
|
+
private renderCell(row: HTMLTableRowElement, props: ITableColumn, data, rowIdx: number) {
|
|
82
82
|
// Create the cell
|
|
83
83
|
let cell = document.createElement("td");
|
|
84
84
|
cell.className = props.className || "";
|
|
@@ -94,13 +94,13 @@ class _Table extends Base<ITableProps> implements ITable {
|
|
|
94
94
|
// See if there is an event for this column
|
|
95
95
|
if (props.onRenderCell) {
|
|
96
96
|
// Call the event
|
|
97
|
-
props.onRenderCell(cell, props, data);
|
|
97
|
+
props.onRenderCell(cell, props, data, rowIdx);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
// See if there is an event for this component
|
|
101
101
|
if (this.props.onRenderCell) {
|
|
102
102
|
// Call the event
|
|
103
|
-
this.props.onRenderCell(cell, props, data);
|
|
103
|
+
this.props.onRenderCell(cell, props, data, rowIdx);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// See if there is a click event
|
|
@@ -108,8 +108,8 @@ class _Table extends Base<ITableProps> implements ITable {
|
|
|
108
108
|
// Add the click event
|
|
109
109
|
cell.addEventListener("click", ev => {
|
|
110
110
|
// Call the event
|
|
111
|
-
props.onClickCell ? props.onClickCell(cell, props, data) : null;
|
|
112
|
-
this.props.onClickCell ? this.props.onClickCell(cell, props, data) : null;
|
|
111
|
+
props.onClickCell ? props.onClickCell(cell, props, data, rowIdx) : null;
|
|
112
|
+
this.props.onClickCell ? this.props.onClickCell(cell, props, data, rowIdx) : null;
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -119,7 +119,7 @@ class _Table extends Base<ITableProps> implements ITable {
|
|
|
119
119
|
// See if columns
|
|
120
120
|
for (let i = 0; i < this.props.columns.length; i++) {
|
|
121
121
|
// Create the cell
|
|
122
|
-
this.renderCell(row, this.props.columns[i], data);
|
|
122
|
+
this.renderCell(row, this.props.columns[i], data, rowIdx);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
// See if there is an event
|
|
@@ -85,9 +85,9 @@ export interface ITable {
|
|
|
85
85
|
*/
|
|
86
86
|
export interface ITableProps extends IBaseProps<ITable> {
|
|
87
87
|
columns?: Array<ITableColumn>;
|
|
88
|
-
onClickCell?: (el: HTMLTableDataCellElement, column?: ITableColumn, data?: any) => void;
|
|
88
|
+
onClickCell?: (el: HTMLTableDataCellElement, column?: ITableColumn, data?: any, rowIdx?: number) => void;
|
|
89
89
|
onClickHeader?: (el: HTMLTableHeaderCellElement, column?: ITableColumn) => void;
|
|
90
|
-
onRenderCell?: (el?: HTMLTableDataCellElement, column?: ITableColumn, data?: any) => void;
|
|
90
|
+
onRenderCell?: (el?: HTMLTableDataCellElement, column?: ITableColumn, data?: any, rowIdx?: number) => void;
|
|
91
91
|
onRenderHeaderCell?: (el?: HTMLTableDataCellElement, column?: ITableColumn) => void;
|
|
92
92
|
onRenderHeaderRow?: (el?: HTMLTableRowElement) => void;
|
|
93
93
|
onRenderRow?: (el?: HTMLTableRowElement, data?: any, rowIdx?: number) => void;
|
|
@@ -102,9 +102,9 @@ export interface ITableColumn {
|
|
|
102
102
|
data?: any;
|
|
103
103
|
isHidden?: boolean;
|
|
104
104
|
name: string;
|
|
105
|
-
onClickCell?: (el: HTMLTableDataCellElement, column?: ITableColumn, data?: any) => void;
|
|
105
|
+
onClickCell?: (el: HTMLTableDataCellElement, column?: ITableColumn, data?: any, rowIdx?: number) => void;
|
|
106
106
|
onClickHeader?: (el: HTMLTableHeaderCellElement, column?: ITableColumn) => void;
|
|
107
|
-
onRenderCell?: (el: HTMLTableDataCellElement, column?: ITableColumn, data?: any) => void;
|
|
107
|
+
onRenderCell?: (el: HTMLTableDataCellElement, column?: ITableColumn, data?: any, rowIdx?: number) => void;
|
|
108
108
|
onRenderHeader?: (el?: HTMLTableDataCellElement, column?: ITableColumn) => void;
|
|
109
109
|
scope?: string;
|
|
110
110
|
title?: string;
|