@angular/cdk 13.0.3 → 13.1.0-next.3
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/bidi/dir.d.ts +1 -1
- package/bidi/directionality.d.ts +2 -0
- package/drag-drop/drag-styling.d.ts +1 -0
- package/esm2020/bidi/dir.mjs +8 -6
- package/esm2020/bidi/directionality.mjs +12 -7
- package/esm2020/drag-drop/drag-ref.mjs +3 -2
- package/esm2020/drag-drop/drag-styling.mjs +1 -1
- package/esm2020/table/row.mjs +2 -1
- package/esm2020/table/table.mjs +21 -7
- package/esm2020/version.mjs +1 -1
- package/fesm2015/bidi.mjs +17 -10
- package/fesm2015/bidi.mjs.map +1 -1
- package/fesm2015/cdk.mjs +1 -1
- package/fesm2015/cdk.mjs.map +1 -1
- package/fesm2015/drag-drop.mjs +2 -1
- package/fesm2015/drag-drop.mjs.map +1 -1
- package/fesm2015/table.mjs +21 -6
- package/fesm2015/table.mjs.map +1 -1
- package/fesm2020/bidi.mjs +17 -10
- package/fesm2020/bidi.mjs.map +1 -1
- package/fesm2020/cdk.mjs +1 -1
- package/fesm2020/cdk.mjs.map +1 -1
- package/fesm2020/drag-drop.mjs +2 -1
- package/fesm2020/drag-drop.mjs.map +1 -1
- package/fesm2020/table.mjs +21 -6
- package/fesm2020/table.mjs.map +1 -1
- package/package.json +1 -1
- package/table/row.d.ts +1 -0
package/fesm2020/table.mjs
CHANGED
|
@@ -612,6 +612,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
612
612
|
class CdkNoDataRow {
|
|
613
613
|
constructor(templateRef) {
|
|
614
614
|
this.templateRef = templateRef;
|
|
615
|
+
this._contentClassName = 'cdk-no-data-row';
|
|
615
616
|
}
|
|
616
617
|
}
|
|
617
618
|
CdkNoDataRow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: CdkNoDataRow, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -1949,14 +1950,28 @@ class CdkTable {
|
|
|
1949
1950
|
/** Creates or removes the no data row, depending on whether any data is being shown. */
|
|
1950
1951
|
_updateNoDataRow() {
|
|
1951
1952
|
const noDataRow = this._customNoDataRow || this._noDataRow;
|
|
1952
|
-
if (noDataRow) {
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1953
|
+
if (!noDataRow) {
|
|
1954
|
+
return;
|
|
1955
|
+
}
|
|
1956
|
+
const shouldShow = this._rowOutlet.viewContainer.length === 0;
|
|
1957
|
+
if (shouldShow === this._isShowingNoDataRow) {
|
|
1958
|
+
return;
|
|
1959
|
+
}
|
|
1960
|
+
const container = this._noDataRowOutlet.viewContainer;
|
|
1961
|
+
if (shouldShow) {
|
|
1962
|
+
const view = container.createEmbeddedView(noDataRow.templateRef);
|
|
1963
|
+
const rootNode = view.rootNodes[0];
|
|
1964
|
+
// Only add the attributes if we have a single root node since it's hard
|
|
1965
|
+
// to figure out which one to add it to when there are multiple.
|
|
1966
|
+
if (view.rootNodes.length === 1 && rootNode?.nodeType === this._document.ELEMENT_NODE) {
|
|
1967
|
+
rootNode.setAttribute('role', 'row');
|
|
1968
|
+
rootNode.classList.add(noDataRow._contentClassName);
|
|
1958
1969
|
}
|
|
1959
1970
|
}
|
|
1971
|
+
else {
|
|
1972
|
+
container.clear();
|
|
1973
|
+
}
|
|
1974
|
+
this._isShowingNoDataRow = shouldShow;
|
|
1960
1975
|
}
|
|
1961
1976
|
}
|
|
1962
1977
|
CdkTable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: CdkTable, deps: [{ token: i0.IterableDiffers }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: 'role', attribute: true }, { token: i1.Directionality, optional: true }, { token: DOCUMENT }, { token: i2.Platform }, { token: _VIEW_REPEATER_STRATEGY }, { token: _COALESCED_STYLE_SCHEDULER }, { token: i3.ViewportRuler }, { token: STICKY_POSITIONING_LISTENER, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component });
|