gd-bs 6.6.31 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.6.31",
3
+ "version": "6.6.33",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -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,24 +108,24 @@ 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
  }
116
116
 
117
117
  // Renders a row
118
- private renderRow(row: HTMLTableRowElement, data) {
118
+ private renderRow(row: HTMLTableRowElement, data, rowIdx: number) {
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
126
126
  if (this.props.onRenderRow) {
127
127
  // Call the event
128
- this.props.onRenderRow(row, data);
128
+ this.props.onRenderRow(row, data, rowIdx);
129
129
  }
130
130
  }
131
131
 
@@ -144,7 +144,7 @@ class _Table extends Base<ITableProps> implements ITable {
144
144
  tbody.appendChild(row);
145
145
 
146
146
  // Render the row
147
- this.renderRow(row, rows[i]);
147
+ this.renderRow(row, rows[i], i);
148
148
  }
149
149
  }
150
150
  }
@@ -85,12 +85,12 @@ 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
- onRenderRow?: (el?: HTMLTableRowElement, data?: any) => void;
93
+ onRenderRow?: (el?: HTMLTableRowElement, data?: any, rowIdx?: number) => void;
94
94
  rows?: Array<any>;
95
95
  }
96
96
 
@@ -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;