Update the list of all available row definitions that can be used.
()
| 1130 | |
| 1131 | /** Update the list of all available row definitions that can be used. */ |
| 1132 | private _cacheRowDefs() { |
| 1133 | this._headerRowDefs = mergeArrayAndSet( |
| 1134 | this._getOwnDefs(this._contentHeaderRowDefs), |
| 1135 | this._customHeaderRowDefs, |
| 1136 | ); |
| 1137 | this._footerRowDefs = mergeArrayAndSet( |
| 1138 | this._getOwnDefs(this._contentFooterRowDefs), |
| 1139 | this._customFooterRowDefs, |
| 1140 | ); |
| 1141 | this._rowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentRowDefs), this._customRowDefs); |
| 1142 | |
| 1143 | // After all row definitions are determined, find the row definition to be considered default. |
| 1144 | const defaultRowDefs = this._rowDefs.filter(def => !def.when); |
| 1145 | |
| 1146 | if (typeof ngDevMode === 'undefined' || ngDevMode) { |
| 1147 | // At the moment of writing, it's tricky to support `when` with virtual scrolling |
| 1148 | // because we reuse templates and they can change arbitrarily based on the `when` |
| 1149 | // condition. We may be able to support it in the future (see #32670). |
| 1150 | if (this._virtualScrollEnabled() && this._rowDefs.some(def => def.when)) { |
| 1151 | throw new Error( |
| 1152 | 'Conditional row definitions via the `when` input are not ' + |
| 1153 | 'supported when virtual scrolling is enabled, at the moment.', |
| 1154 | ); |
| 1155 | } |
| 1156 | |
| 1157 | if (!this.multiTemplateDataRows && defaultRowDefs.length > 1) { |
| 1158 | throw getTableMultipleDefaultRowDefsError(); |
| 1159 | } |
| 1160 | } |
| 1161 | this._defaultRowDef = defaultRowDefs[0]; |
| 1162 | } |
| 1163 | |
| 1164 | /** |
| 1165 | * Check if the header, data, or footer rows have changed what columns they want to display or |
no test coverage detected