gd-bs 6.9.13 → 6.9.15
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 +36 -1
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +4 -0
- 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 +41 -1
- package/src/components/table/types.d.ts +4 -0
|
@@ -168,7 +168,7 @@ var _Table = /** @class */ (function (_super) {
|
|
|
168
168
|
};
|
|
169
169
|
// Renders a row
|
|
170
170
|
_Table.prototype.renderRow = function (row, data, rowIdx) {
|
|
171
|
-
//
|
|
171
|
+
// Parse the columns
|
|
172
172
|
for (var i = 0; i < this.props.columns.length; i++) {
|
|
173
173
|
// Create the cell
|
|
174
174
|
this.renderCell(row, this.props.columns[i], data, rowIdx);
|
|
@@ -197,6 +197,41 @@ var _Table = /** @class */ (function (_super) {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
|
+
// Method to update a column element
|
|
201
|
+
_Table.prototype.updateColumn = function (elCol, colIdx, row) {
|
|
202
|
+
// Get the column
|
|
203
|
+
var colProps = this.props.columns[colIdx];
|
|
204
|
+
if (colProps) {
|
|
205
|
+
// Set the value
|
|
206
|
+
elCol.innerHTML = row[colProps.name] == null ? "" : row[colProps.name];
|
|
207
|
+
// See if there is an event for this column
|
|
208
|
+
if (colProps.onRenderCell) {
|
|
209
|
+
// Call the event
|
|
210
|
+
colProps.onRenderCell(elCol, colProps, row);
|
|
211
|
+
}
|
|
212
|
+
// See if there is an event for this component
|
|
213
|
+
if (this.props.onRenderCell) {
|
|
214
|
+
// Call the event
|
|
215
|
+
this.props.onRenderCell(elCol, colProps, row);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
// Method to update a row element
|
|
220
|
+
_Table.prototype.updateRow = function (elRow, row) {
|
|
221
|
+
// Parse the columns
|
|
222
|
+
for (var i = 0; i < this.props.columns.length; i++) {
|
|
223
|
+
var elCol = elRow.children[i];
|
|
224
|
+
if (elCol) {
|
|
225
|
+
// Update the column
|
|
226
|
+
this.updateColumn(elCol, i, row);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// See if there is an event
|
|
230
|
+
if (this.props.onRenderRow) {
|
|
231
|
+
// Call the event
|
|
232
|
+
this.props.onRenderRow(elRow, row);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
200
235
|
return _Table;
|
|
201
236
|
}(base_1.Base));
|
|
202
237
|
var Table = function (props, template) { return new _Table(props, template); };
|