@angular/cdk 9.1.1 → 9.2.0
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/a11y/focus-monitor/focus-monitor.d.ts +36 -2
- package/a11y/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +241 -19
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +25 -10
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-clipboard.umd.js +1 -1
- package/bundles/cdk-clipboard.umd.js.map +1 -1
- package/bundles/cdk-clipboard.umd.min.js +1 -1
- package/bundles/cdk-clipboard.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +0 -1
- package/bundles/cdk-coercion.umd.js.map +1 -1
- package/bundles/cdk-coercion.umd.min.js.map +1 -1
- package/bundles/cdk-collections.umd.js +203 -6
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js +17 -10
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +217 -23
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +25 -10
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +210 -12
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +27 -12
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +11 -0
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +6 -6
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +211 -14
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js +19 -4
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +242 -14
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +14 -6
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +278 -50
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +29 -7
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.js +254 -49
- package/bundles/cdk-testing-protractor.umd.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js +16 -9
- package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.js +257 -54
- package/bundles/cdk-testing-testbed.umd.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.min.js +23 -8
- package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
- package/bundles/cdk-testing.umd.js +243 -46
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.min.js +20 -5
- package/bundles/cdk-testing.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +21 -6
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +3 -3
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +212 -15
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +17 -3
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/coercion/array.d.ts +1 -0
- package/esm2015/a11y/focus-monitor/focus-monitor.js +93 -12
- package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
- package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
- package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
- package/esm2015/a11y/public-api.js +2 -2
- package/esm2015/bidi/directionality.js +1 -1
- package/esm2015/clipboard/pending-copy.js +3 -3
- package/esm2015/coercion/array.js +1 -2
- package/esm2015/drag-drop/drag-drop.js +1 -1
- package/esm2015/drag-drop/drag-ref.js +7 -5
- package/esm2015/drag-drop/drop-list-ref.js +11 -19
- package/esm2015/layout/breakpoints-observer.js +1 -1
- package/esm2015/overlay/position/flexible-connected-position-strategy.js +3 -2
- package/esm2015/overlay/position/overlay-position-builder.js +1 -1
- package/esm2015/platform/features/shadow-dom.js +16 -1
- package/esm2015/platform/public-api.js +2 -2
- package/esm2015/scrolling/scroll-dispatcher.js +38 -5
- package/esm2015/scrolling/viewport-ruler.js +44 -5
- package/esm2015/table/cell.js +18 -8
- package/esm2015/table/public-api.js +3 -2
- package/esm2015/table/row.js +24 -8
- package/esm2015/table/table.js +26 -12
- package/esm2015/table/text-column.js +3 -26
- package/esm2015/table/tokens.js +44 -0
- package/esm2015/testing/protractor/protractor-element.js +4 -2
- package/esm2015/testing/protractor/protractor-harness-environment.js +13 -8
- package/esm2015/testing/testbed/testbed-harness-environment.js +16 -10
- package/esm2015/text-field/autosize.js +38 -4
- package/esm2015/version.js +1 -1
- package/esm5/a11y/focus-monitor/focus-monitor.js +39 -13
- package/esm5/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
- package/esm5/a11y/focus-trap/focus-trap.js +1 -1
- package/esm5/a11y/live-announcer/live-announcer.js +1 -1
- package/esm5/bidi/directionality.js +1 -1
- package/esm5/clipboard/pending-copy.js +2 -2
- package/esm5/coercion/array.js +1 -2
- package/esm5/drag-drop/drag-drop.js +1 -1
- package/esm5/drag-drop/drag-ref.js +7 -5
- package/esm5/drag-drop/drop-list-ref.js +9 -14
- package/esm5/layout/breakpoints-observer.js +1 -1
- package/esm5/overlay/position/flexible-connected-position-strategy.js +3 -2
- package/esm5/overlay/position/overlay-position-builder.js +1 -1
- package/esm5/platform/features/shadow-dom.js +11 -1
- package/esm5/scrolling/scroll-dispatcher.js +21 -5
- package/esm5/scrolling/viewport-ruler.js +24 -5
- package/esm5/table/cell.js +13 -8
- package/esm5/table/public-api.js +2 -1
- package/esm5/table/row.js +21 -11
- package/esm5/table/table.js +16 -11
- package/esm5/table/text-column.js +3 -4
- package/esm5/table/tokens.js +16 -0
- package/esm5/testing/protractor/protractor-element.js +4 -2
- package/esm5/testing/protractor/protractor-harness-environment.js +17 -11
- package/esm5/testing/testbed/testbed-harness-environment.js +17 -11
- package/esm5/text-field/autosize.js +20 -4
- package/esm5/version.js +1 -1
- package/fesm2015/a11y.js +89 -11
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/clipboard.js +2 -2
- package/fesm2015/clipboard.js.map +1 -1
- package/fesm2015/coercion.js +0 -1
- package/fesm2015/coercion.js.map +1 -1
- package/fesm2015/drag-drop.js +16 -22
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/overlay.js +2 -1
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/platform.js +16 -1
- package/fesm2015/platform.js.map +1 -1
- package/fesm2015/scrolling.js +76 -7
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/table.js +98 -49
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/testing/protractor.js +16 -9
- package/fesm2015/testing/protractor.js.map +1 -1
- package/fesm2015/testing/testbed.js +15 -9
- package/fesm2015/testing/testbed.js.map +1 -1
- package/fesm2015/text-field.js +37 -3
- package/fesm2015/text-field.js.map +1 -1
- package/fesm5/a11y.js +36 -12
- package/fesm5/a11y.js.map +1 -1
- package/fesm5/cdk.js +1 -1
- package/fesm5/cdk.js.map +1 -1
- package/fesm5/clipboard.js +1 -1
- package/fesm5/clipboard.js.map +1 -1
- package/fesm5/coercion.js +0 -1
- package/fesm5/coercion.js.map +1 -1
- package/fesm5/drag-drop.js +14 -17
- package/fesm5/drag-drop.js.map +1 -1
- package/fesm5/overlay.js +2 -1
- package/fesm5/overlay.js.map +1 -1
- package/fesm5/platform.js +11 -1
- package/fesm5/platform.js.map +1 -1
- package/fesm5/scrolling.js +39 -7
- package/fesm5/scrolling.js.map +1 -1
- package/fesm5/table.js +59 -29
- package/fesm5/table.js.map +1 -1
- package/fesm5/testing/protractor.js +20 -12
- package/fesm5/testing/protractor.js.map +1 -1
- package/fesm5/testing/testbed.js +16 -10
- package/fesm5/testing/testbed.js.map +1 -1
- package/fesm5/text-field.js +19 -3
- package/fesm5/text-field.js.map +1 -1
- package/package.json +1 -1
- package/platform/features/shadow-dom.d.ts +2 -0
- package/platform/index.metadata.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/upgrade-rules/class-names-rule.js +3 -1
- package/schematics/utils/ast/ng-module-imports.js +3 -2
- package/scrolling/index.metadata.json +1 -1
- package/scrolling/scroll-dispatcher.d.ts +9 -1
- package/scrolling/viewport-ruler.d.ts +9 -1
- package/table/cell.d.ts +2 -0
- package/table/index.metadata.json +1 -1
- package/table/public-api.d.ts +1 -0
- package/table/row.d.ts +6 -3
- package/table/table.d.ts +2 -0
- package/table/text-column.d.ts +2 -13
- package/table/tokens.d.ts +25 -0
- package/testing/protractor/protractor-harness-environment.d.ts +10 -3
- package/testing/testbed/testbed-harness-environment.d.ts +12 -4
- package/text-field/autosize.d.ts +9 -1
- package/text-field/index.metadata.json +1 -1
|
@@ -1,18 +1,33 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/bidi"),require("@angular/cdk/coercion"),require("@angular/cdk/collections"),require("@angular/cdk/platform"),require("@angular/common"),require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/cdk/table",["exports","@angular/cdk/bidi","@angular/cdk/coercion","@angular/cdk/collections","@angular/cdk/platform","@angular/common","@angular/core","rxjs","rxjs/operators"],t):t(((e=e||self).ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.table={}),e.ng.cdk.bidi,e.ng.cdk.coercion,e.ng.cdk.collections,e.ng.cdk.platform,e.ng.common,e.ng.core,e.rxjs,e.rxjs.operators)}(this,(function(e,t,o,r,n,i,s,a,c){"use strict";
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
6
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
|
|
8
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
9
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
10
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
11
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
12
|
+
|
|
13
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
|
+
and limitations under the License.
|
|
15
|
+
***************************************************************************** */var l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};function u(e,t){function o(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}function f(e){var t="function"==typeof Symbol&&e[Symbol.iterator],o=0;return t?t.call(e):{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}}}function h(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return s}function d(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}
|
|
2
16
|
/**
|
|
3
17
|
* @license
|
|
4
18
|
* Copyright Google LLC All Rights Reserved.
|
|
5
19
|
*
|
|
6
20
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
21
|
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
22
|
+
*/
|
|
23
|
+
function p(e){return function(e){function t(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var r=e.apply(this,d(t))||this;return r._sticky=!1,r._hasStickyChanged=!1,r}return u(t,e),Object.defineProperty(t.prototype,"sticky",{get:function(){return this._sticky},set:function(e){var t=this._sticky;this._sticky=o.coerceBooleanProperty(e),this._hasStickyChanged=t!==this._sticky},enumerable:!0,configurable:!0}),t.prototype.hasStickyChanged=function(){var e=this._hasStickyChanged;return this._hasStickyChanged=!1,e},t.prototype.resetStickyChanged=function(){this._hasStickyChanged=!1},t}(e)}
|
|
9
24
|
/**
|
|
10
25
|
* @license
|
|
11
26
|
* Copyright Google LLC All Rights Reserved.
|
|
12
27
|
*
|
|
13
28
|
* Use of this source code is governed by an MIT-style license that can be
|
|
14
29
|
* found in the LICENSE file at https://angular.io/license
|
|
15
|
-
*/var
|
|
30
|
+
*/var y,_=new s.InjectionToken("CDK_TABLE"),m=new s.InjectionToken("text-column-options"),w=function(){function e(e){this.template=e}return e.decorators=[{type:s.Directive,args:[{selector:"[cdkCellDef]"}]}],e.ctorParameters=function(){return[{type:s.TemplateRef}]},e}(),g=function(){function e(e){this.template=e}return e.decorators=[{type:s.Directive,args:[{selector:"[cdkHeaderCellDef]"}]}],e.ctorParameters=function(){return[{type:s.TemplateRef}]},e}(),D=function(){function e(e){this.template=e}return e.decorators=[{type:s.Directive,args:[{selector:"[cdkFooterCellDef]"}]}],e.ctorParameters=function(){return[{type:s.TemplateRef}]},e}(),R=function(e){function t(t){var o=e.call(this)||this;return o._table=t,o._stickyEnd=!1,o}return u(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stickyEnd",{get:function(){return this._stickyEnd},set:function(e){var t=this._stickyEnd;this._stickyEnd=o.coerceBooleanProperty(e),this._hasStickyChanged=t!==this._stickyEnd},enumerable:!0,configurable:!0}),t.decorators=[{type:s.Directive,args:[{selector:"[cdkColumnDef]",inputs:["sticky"],providers:[{provide:"MAT_SORT_HEADER_COLUMN_DEF",useExisting:t}]}]}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:s.Inject,args:[_]},{type:s.Optional}]}]},t.propDecorators={name:[{type:s.Input,args:["cdkColumnDef"]}],stickyEnd:[{type:s.Input,args:["stickyEnd"]}],cell:[{type:s.ContentChild,args:[w]}],headerCell:[{type:s.ContentChild,args:[g]}],footerCell:[{type:s.ContentChild,args:[D]}]},t}(p((function C(){}))),k=function(e){function t(t,o){return e.call(this,t,o)||this}return u(t,e),t.decorators=[{type:s.Directive,args:[{selector:"cdk-header-cell, th[cdk-header-cell]",host:{class:"cdk-header-cell",role:"columnheader"}}]}],t.ctorParameters=function(){return[{type:R},{type:s.ElementRef}]},t}(y=function y(e,t){t.nativeElement.classList.add("cdk-column-"+e.cssClassFriendlyName)}),v=function(e){function t(t,o){return e.call(this,t,o)||this}return u(t,e),t.decorators=[{type:s.Directive,args:[{selector:"cdk-footer-cell, td[cdk-footer-cell]",host:{class:"cdk-footer-cell",role:"gridcell"}}]}],t.ctorParameters=function(){return[{type:R},{type:s.ElementRef}]},t}(y),S=function(e){function t(t,o){return e.call(this,t,o)||this}return u(t,e),t.decorators=[{type:s.Directive,args:[{selector:"cdk-cell, td[cdk-cell]",host:{class:"cdk-cell",role:"gridcell"}}]}],t.ctorParameters=function(){return[{type:R},{type:s.ElementRef}]},t}(y),b="<ng-container cdkCellOutlet></ng-container>",O=function(){function e(e,t){this.template=e,this._differs=t}return e.prototype.ngOnChanges=function(e){if(!this._columnsDiffer){var t=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t)}},e.prototype.getColumnsDiff=function(){return this._columnsDiffer.diff(this.columns)},e.prototype.extractCellTemplate=function(e){return this instanceof E?e.headerCell.template:this instanceof x?e.footerCell.template:e.cell.template},e}(),E=function(e){function t(t,o,r){var n=e.call(this,t,o)||this;return n._table=r,n}return u(t,e),t.prototype.ngOnChanges=function(t){e.prototype.ngOnChanges.call(this,t)},t.decorators=[{type:s.Directive,args:[{selector:"[cdkHeaderRowDef]",inputs:["columns: cdkHeaderRowDef","sticky: cdkHeaderRowDefSticky"]}]}],t.ctorParameters=function(){return[{type:s.TemplateRef},{type:s.IterableDiffers},{type:void 0,decorators:[{type:s.Inject,args:[_]},{type:s.Optional}]}]},t}(p(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(O))),x=function(e){function t(t,o,r){var n=e.call(this,t,o)||this;return n._table=r,n}return u(t,e),t.prototype.ngOnChanges=function(t){e.prototype.ngOnChanges.call(this,t)},t.decorators=[{type:s.Directive,args:[{selector:"[cdkFooterRowDef]",inputs:["columns: cdkFooterRowDef","sticky: cdkFooterRowDefSticky"]}]}],t.ctorParameters=function(){return[{type:s.TemplateRef},{type:s.IterableDiffers},{type:void 0,decorators:[{type:s.Inject,args:[_]},{type:s.Optional}]}]},t}(p(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(O))),T=function(e){function t(t,o,r){var n=e.call(this,t,o)||this;return n._table=r,n}return u(t,e),t.decorators=[{type:s.Directive,args:[{selector:"[cdkRowDef]",inputs:["columns: cdkRowDefColumns","when: cdkRowDefWhen"]}]}],t.ctorParameters=function(){return[{type:s.TemplateRef},{type:s.IterableDiffers},{type:void 0,decorators:[{type:s.Inject,args:[_]},{type:s.Optional}]}]},t}(O),I=function(){function e(t){this._viewContainer=t,e.mostRecentCellOutlet=this}return e.prototype.ngOnDestroy=function(){e.mostRecentCellOutlet===this&&(e.mostRecentCellOutlet=null)},e.mostRecentCellOutlet=null,e.decorators=[{type:s.Directive,args:[{selector:"[cdkCellOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef}]},e}(),P=function(){function e(){}return e.decorators=[{type:s.Component,args:[{selector:"cdk-header-row, tr[cdk-header-row]",template:b,host:{class:"cdk-header-row",role:"row"},changeDetection:s.ChangeDetectionStrategy.Default,encapsulation:s.ViewEncapsulation.None}]}],e}(),N=function(){function e(){}return e.decorators=[{type:s.Component,args:[{selector:"cdk-footer-row, tr[cdk-footer-row]",template:b,host:{class:"cdk-footer-row",role:"row"},changeDetection:s.ChangeDetectionStrategy.Default,encapsulation:s.ViewEncapsulation.None}]}],e}(),H=function(){function e(){}return e.decorators=[{type:s.Component,args:[{selector:"cdk-row, tr[cdk-row]",template:b,host:{class:"cdk-row",role:"row"},changeDetection:s.ChangeDetectionStrategy.Default,encapsulation:s.ViewEncapsulation.None}]}],e}(),F=["top","bottom","left","right"],j=function(){function e(e,t,o,r){void 0===r&&(r=!0),this._isNativeHtmlTable=e,this._stickCellCss=t,this.direction=o,this._isBrowser=r}return e.prototype.clearStickyPositioning=function(e,t){var o,r;try{for(var n=f(e),i=n.next();!i.done;i=n.next()){var s=i.value;if(s.nodeType===s.ELEMENT_NODE){this._removeStickyStyle(s,t);for(var a=0;a<s.children.length;a++)this._removeStickyStyle(s.children[a],t)}}}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}},e.prototype.updateStickyColumns=function(e,t,o){var r,n,i=t.some((function(e){return e}))||o.some((function(e){return e}));if(e.length&&i&&this._isBrowser){var s=e[0],a=s.children.length,c=this._getCellWidths(s),l=this._getStickyStartColumnPositions(c,t),u=this._getStickyEndColumnPositions(c,o),h="rtl"===this.direction;try{for(var d=f(e),p=d.next();!p.done;p=d.next())for(var y=p.value,_=0;_<a;_++){var m=y.children[_];t[_]&&this._addStickyStyle(m,h?"right":"left",l[_]),o[_]&&this._addStickyStyle(m,h?"left":"right",u[_])}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}}},e.prototype.stickRows=function(e,t,o){if(this._isBrowser)for(var r="bottom"===o?e.reverse():e,n=0,i=0;i<r.length;i++)if(t[i]){var s=r[i];if(this._isNativeHtmlTable)for(var a=0;a<s.children.length;a++)this._addStickyStyle(s.children[a],o,n);else this._addStickyStyle(s,o,n);if(i===r.length-1)return;n+=s.getBoundingClientRect().height}},e.prototype.updateStickyFooterContainer=function(e,t){if(this._isNativeHtmlTable){var o=e.querySelector("tfoot");t.some((function(e){return!e}))?this._removeStickyStyle(o,["bottom"]):this._addStickyStyle(o,"bottom",0)}},e.prototype._removeStickyStyle=function(e,t){var o,r;try{for(var n=f(t),i=n.next();!i.done;i=n.next())e.style[i.value]=""}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}e.style.zIndex=this._getCalculatedZIndex(e),F.some((function(t){return!!e.style[t]}))||(e.style.position="",e.classList.remove(this._stickCellCss))},e.prototype._addStickyStyle=function(e,t,o){e.classList.add(this._stickCellCss),e.style[t]=o+"px",e.style.cssText+="position: -webkit-sticky; position: sticky; ",e.style.zIndex=this._getCalculatedZIndex(e)},e.prototype._getCalculatedZIndex=function(e){var t,o,r={top:100,bottom:10,left:1,right:1},n=0;try{for(var i=f(F),s=i.next();!s.done;s=i.next()){var a=s.value;e.style[a]&&(n+=r[a])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(t)throw t.error}}return n?""+n:""},e.prototype._getCellWidths=function(e){for(var t=[],o=e.children,r=0;r<o.length;r++)t.push(o[r].getBoundingClientRect().width);return t},e.prototype._getStickyStartColumnPositions=function(e,t){for(var o=[],r=0,n=0;n<e.length;n++)t[n]&&(o[n]=r,r+=e[n]);return o},e.prototype._getStickyEndColumnPositions=function(e,t){for(var o=[],r=0,n=e.length;n>0;n--)t[n]&&(o[n]=r,r+=e[n]);return o},e}();
|
|
16
31
|
/**
|
|
17
32
|
* @license
|
|
18
33
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -20,7 +35,7 @@
|
|
|
20
35
|
* Use of this source code is governed by an MIT-style license that can be
|
|
21
36
|
* found in the LICENSE file at https://angular.io/license
|
|
22
37
|
*/
|
|
23
|
-
function
|
|
38
|
+
function B(e){return Error('Could not find column with id "'+e+'".')}
|
|
24
39
|
/**
|
|
25
40
|
* @license
|
|
26
41
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -28,14 +43,21 @@ function I(e){return Error('Could not find column with id "'+e+'".')}
|
|
|
28
43
|
* Use of this source code is governed by an MIT-style license that can be
|
|
29
44
|
* found in the LICENSE file at https://angular.io/license
|
|
30
45
|
*/
|
|
31
|
-
var P,N=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:a.Directive,args:[{selector:"[rowOutlet]"}]}],e.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:a.ElementRef}]},e}(),H=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:a.Directive,args:[{selector:"[headerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:a.ElementRef}]},e}(),F=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:a.Directive,args:[{selector:"[footerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:a.ElementRef}]},e}(),B='\n <ng-content select="caption"></ng-content>\n <ng-container headerRowOutlet></ng-container>\n <ng-container rowOutlet></ng-container>\n <ng-container footerRowOutlet></ng-container>\n',A=(t.__extends((function j(){return null!==P&&P.apply(this,arguments)||this}),P=a.EmbeddedViewRef),function(){function e(e,t,o,r,n,i,s){this._differs=e,this._changeDetectorRef=t,this._elementRef=o,this._dir=n,this._platform=s,this._onDestroy=new c.Subject,this._columnDefsByName=new Map,this._customColumnDefs=new Set,this._customRowDefs=new Set,this._customHeaderRowDefs=new Set,this._customFooterRowDefs=new Set,this._headerRowDefChanged=!0,this._footerRowDefChanged=!0,this._cachedRenderRowsMap=new Map,this.stickyCssClass="cdk-table-sticky",this._multiTemplateDataRows=!1,this.viewChange=new c.BehaviorSubject({start:0,end:Number.MAX_VALUE}),r||this._elementRef.nativeElement.setAttribute("role","grid"),this._document=i,this._isNativeHtmlTable="TABLE"===this._elementRef.nativeElement.nodeName}return Object.defineProperty(e.prototype,"trackBy",{get:function(){return this._trackByFn},set:function(e){a.isDevMode()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(e)+"."),this._trackByFn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource!==e&&this._switchDataSource(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"multiTemplateDataRows",{get:function(){return this._multiTemplateDataRows},set:function(e){this._multiTemplateDataRows=r.coerceBooleanProperty(e),this._rowOutlet&&this._rowOutlet.viewContainer.length&&this._forceRenderDataRows()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this._setupStickyStyler(),this._isNativeHtmlTable&&this._applyNativeTableSections(),this._dataDiffer=this._differs.find([]).create((function(t,o){return e.trackBy?e.trackBy(o.dataIndex,o.data):o}))},e.prototype.ngAfterContentChecked=function(){if(this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&!this._rowDefs.length)throw function e(){return Error("Missing definitions for header, footer, and row; cannot determine which columns should be rendered.")}();this._renderUpdatedColumns(),this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=!1),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=!1),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription&&this._observeRenderChanges(),this._checkStickyStates()},e.prototype.ngOnDestroy=function(){this._rowOutlet.viewContainer.clear(),this._headerRowOutlet.viewContainer.clear(),this._footerRowOutlet.viewContainer.clear(),this._cachedRenderRowsMap.clear(),this._onDestroy.next(),this._onDestroy.complete(),n.isDataSource(this.dataSource)&&this.dataSource.disconnect(this)},e.prototype.renderRows=function(){var e=this;this._renderRows=this._getAllRenderRows();var t=this._dataDiffer.diff(this._renderRows);if(t){var o=this._rowOutlet.viewContainer;t.forEachOperation((function(t,r,n){if(null==t.previousIndex)e._insertRow(t.item,n);else if(null==n)o.remove(r);else{var i=o.get(r);o.move(i,n)}})),this._updateRowIndexContext(),t.forEachIdentityChange((function(e){o.get(e.currentIndex).context.$implicit=e.item.data})),this.updateStickyColumnStyles()}},e.prototype.setHeaderRowDef=function(e){this._customHeaderRowDefs=new Set([e]),this._headerRowDefChanged=!0},e.prototype.setFooterRowDef=function(e){this._customFooterRowDefs=new Set([e]),this._footerRowDefChanged=!0},e.prototype.addColumnDef=function(e){this._customColumnDefs.add(e)},e.prototype.removeColumnDef=function(e){this._customColumnDefs.delete(e)},e.prototype.addRowDef=function(e){this._customRowDefs.add(e)},e.prototype.removeRowDef=function(e){this._customRowDefs.delete(e)},e.prototype.addHeaderRowDef=function(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=!0},e.prototype.removeHeaderRowDef=function(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=!0},e.prototype.addFooterRowDef=function(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=!0},e.prototype.removeFooterRowDef=function(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=!0},e.prototype.updateStickyHeaderRowStyles=function(){var e=this._getRenderedRows(this._headerRowOutlet),t=this._elementRef.nativeElement.querySelector("thead");t&&(t.style.display=e.length?"":"none");var o=this._headerRowDefs.map((function(e){return e.sticky}));this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,o,"top"),this._headerRowDefs.forEach((function(e){return e.resetStickyChanged()}))},e.prototype.updateStickyFooterRowStyles=function(){var e=this._getRenderedRows(this._footerRowOutlet),t=this._elementRef.nativeElement.querySelector("tfoot");t&&(t.style.display=e.length?"":"none");var o=this._footerRowDefs.map((function(e){return e.sticky}));this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,o,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,o),this._footerRowDefs.forEach((function(e){return e.resetStickyChanged()}))},e.prototype.updateStickyColumnStyles=function(){var e=this,o=this._getRenderedRows(this._headerRowOutlet),r=this._getRenderedRows(this._rowOutlet),n=this._getRenderedRows(this._footerRowOutlet);this._stickyStyler.clearStickyPositioning(t.__spread(o,r,n),["left","right"]),o.forEach((function(t,o){e._addStickyColumnStyles([t],e._headerRowDefs[o])})),this._rowDefs.forEach((function(t){for(var o=[],n=0;n<r.length;n++)e._renderRows[n].rowDef===t&&o.push(r[n]);e._addStickyColumnStyles(o,t)})),n.forEach((function(t,o){e._addStickyColumnStyles([t],e._footerRowDefs[o])})),Array.from(this._columnDefsByName.values()).forEach((function(e){return e.resetStickyChanged()}))},e.prototype._getAllRenderRows=function(){var e=[],t=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(var o=0;o<this._data.length;o++){var r=this._data[o],n=this._getRenderRowsForData(r,o,t.get(r));this._cachedRenderRowsMap.has(r)||this._cachedRenderRowsMap.set(r,new WeakMap);for(var i=0;i<n.length;i++){var s=n[i],a=this._cachedRenderRowsMap.get(s.data);a.has(s.rowDef)?a.get(s.rowDef).push(s):a.set(s.rowDef,[s]),e.push(s)}}return e},e.prototype._getRenderRowsForData=function(e,t,o){return this._getRowDefs(e,t).map((function(r){var n=o&&o.has(r)?o.get(r):[];if(n.length){var i=n.shift();return i.dataIndex=t,i}return{data:e,rowDef:r,dataIndex:t}}))},e.prototype._cacheColumnDefs=function(){var e=this;this._columnDefsByName.clear(),M(this._contentColumnDefs,this._customColumnDefs).forEach((function(t){if(e._columnDefsByName.has(t.name))throw function o(e){return Error('Duplicate column definition name provided: "'+e+'".')}(t.name);e._columnDefsByName.set(t.name,t)}))},e.prototype._cacheRowDefs=function(){this._headerRowDefs=M(this._contentHeaderRowDefs,this._customHeaderRowDefs),this._footerRowDefs=M(this._contentFooterRowDefs,this._customFooterRowDefs),this._rowDefs=M(this._contentRowDefs,this._customRowDefs);var e=this._rowDefs.filter((function(e){return!e.when}));if(!this.multiTemplateDataRows&&e.length>1)throw function t(){return Error("There can only be one default row without a when predicate function.")}();this._defaultRowDef=e[0]},e.prototype._renderUpdatedColumns=function(){var e=function(e,t){return e||!!t.getColumnsDiff()};this._rowDefs.reduce(e,!1)&&this._forceRenderDataRows(),this._headerRowDefs.reduce(e,!1)&&this._forceRenderHeaderRows(),this._footerRowDefs.reduce(e,!1)&&this._forceRenderFooterRows()},e.prototype._switchDataSource=function(e){this._data=[],n.isDataSource(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear()),this._dataSource=e},e.prototype._observeRenderChanges=function(){var e=this;if(this.dataSource){var t;if(n.isDataSource(this.dataSource)?t=this.dataSource.connect(this):c.isObservable(this.dataSource)?t=this.dataSource:Array.isArray(this.dataSource)&&(t=c.of(this.dataSource)),void 0===t)throw function o(){return Error("Provided data source did not match an array, Observable, or DataSource")}();this._renderChangeSubscription=t.pipe(l.takeUntil(this._onDestroy)).subscribe((function(t){e._data=t||[],e.renderRows()}))}},e.prototype._forceRenderHeaderRows=function(){var e=this;this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((function(t,o){return e._renderRow(e._headerRowOutlet,t,o)})),this.updateStickyHeaderRowStyles(),this.updateStickyColumnStyles()},e.prototype._forceRenderFooterRows=function(){var e=this;this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((function(t,o){return e._renderRow(e._footerRowOutlet,t,o)})),this.updateStickyFooterRowStyles(),this.updateStickyColumnStyles()},e.prototype._addStickyColumnStyles=function(e,t){var o=this,r=Array.from(t.columns||[]).map((function(e){var t=o._columnDefsByName.get(e);if(!t)throw I(e);return t})),n=r.map((function(e){return e.sticky})),i=r.map((function(e){return e.stickyEnd}));this._stickyStyler.updateStickyColumns(e,n,i)},e.prototype._getRenderedRows=function(e){for(var t=[],o=0;o<e.viewContainer.length;o++){var r=e.viewContainer.get(o);t.push(r.rootNodes[0])}return t},e.prototype._getRowDefs=function(e,t){if(1==this._rowDefs.length)return[this._rowDefs[0]];var o=[];if(this.multiTemplateDataRows)o=this._rowDefs.filter((function(o){return!o.when||o.when(t,e)}));else{var r=this._rowDefs.find((function(o){return o.when&&o.when(t,e)}))||this._defaultRowDef;r&&o.push(r)}if(!o.length)throw function n(e){return Error("Could not find a matching row definition for theprovided row data: "+JSON.stringify(e))}(e);return o},e.prototype._insertRow=function(e,t){this._renderRow(this._rowOutlet,e.rowDef,t,{$implicit:e.data})},e.prototype._renderRow=function(e,o,r,n){var i,s;void 0===n&&(n={}),e.viewContainer.createEmbeddedView(o.template,n,r);try{for(var a=t.__values(this._getCellTemplates(o)),c=a.next();!c.done;c=a.next())S.mostRecentCellOutlet&&S.mostRecentCellOutlet._viewContainer.createEmbeddedView(c.value,n)}catch(e){i={error:e}}finally{try{c&&!c.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}this._changeDetectorRef.markForCheck()},e.prototype._updateRowIndexContext=function(){for(var e=this._rowOutlet.viewContainer,t=0,o=e.length;t<o;t++){var r=e.get(t).context;r.count=o,r.first=0===t,r.last=t===o-1,r.even=t%2==0,r.odd=!r.even,this.multiTemplateDataRows?(r.dataIndex=this._renderRows[t].dataIndex,r.renderIndex=t):r.index=this._renderRows[t].dataIndex}},e.prototype._getCellTemplates=function(e){var t=this;return e&&e.columns?Array.from(e.columns,(function(o){var r=t._columnDefsByName.get(o);if(!r)throw I(o);return e.extractCellTemplate(r)})):[]},e.prototype._applyNativeTableSections=function(){var e,o,r=this._document.createDocumentFragment(),n=[{tag:"thead",outlet:this._headerRowOutlet},{tag:"tbody",outlet:this._rowOutlet},{tag:"tfoot",outlet:this._footerRowOutlet}];try{for(var i=t.__values(n),s=i.next();!s.done;s=i.next()){var a=s.value,c=this._document.createElement(a.tag);c.setAttribute("role","rowgroup"),c.appendChild(a.outlet.elementRef.nativeElement),r.appendChild(c)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(e)throw e.error}}this._elementRef.nativeElement.appendChild(r)},e.prototype._forceRenderDataRows=function(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows(),this.updateStickyColumnStyles()},e.prototype._checkStickyStates=function(){var e=function(e,t){return e||t.hasStickyChanged()};this._headerRowDefs.reduce(e,!1)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,!1)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,!1)&&this.updateStickyColumnStyles()},e.prototype._setupStickyStyler=function(){var e=this;this._stickyStyler=new T(this._isNativeHtmlTable,this.stickyCssClass,this._dir?this._dir.value:"ltr",this._platform.isBrowser),(this._dir?this._dir.change:c.of()).pipe(l.takeUntil(this._onDestroy)).subscribe((function(t){e._stickyStyler.direction=t,e.updateStickyColumnStyles()}))},e.decorators=[{type:a.Component,args:[{selector:"cdk-table, table[cdk-table]",exportAs:"cdkTable",template:B,host:{class:"cdk-table"},encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.Default}]}],e.ctorParameters=function(){return[{type:a.IterableDiffers},{type:a.ChangeDetectorRef},{type:a.ElementRef},{type:String,decorators:[{type:a.Attribute,args:["role"]}]},{type:o.Directionality,decorators:[{type:a.Optional}]},{type:void 0,decorators:[{type:a.Inject,args:[s.DOCUMENT]}]},{type:i.Platform}]},e.propDecorators={trackBy:[{type:a.Input}],dataSource:[{type:a.Input}],multiTemplateDataRows:[{type:a.Input}],_rowOutlet:[{type:a.ViewChild,args:[N,{static:!0}]}],_headerRowOutlet:[{type:a.ViewChild,args:[H,{static:!0}]}],_footerRowOutlet:[{type:a.ViewChild,args:[F,{static:!0}]}],_contentColumnDefs:[{type:a.ContentChildren,args:[y,{descendants:!0}]}],_contentRowDefs:[{type:a.ContentChildren,args:[v,{descendants:!0}]}],_contentHeaderRowDefs:[{type:a.ContentChildren,args:[C,{descendants:!0}]}],_contentFooterRowDefs:[{type:a.ContentChildren,args:[k,{descendants:!0}]}]},e}());function M(e,t){return e.toArray().concat(Array.from(t))}
|
|
46
|
+
var A,M=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:s.Directive,args:[{selector:"[rowOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef},{type:s.ElementRef}]},e}(),V=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:s.Directive,args:[{selector:"[headerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef},{type:s.ElementRef}]},e}(),L=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return e.decorators=[{type:s.Directive,args:[{selector:"[footerRowOutlet]"}]}],e.ctorParameters=function(){return[{type:s.ViewContainerRef},{type:s.ElementRef}]},e}(),q='\n <ng-content select="caption"></ng-content>\n <ng-container headerRowOutlet></ng-container>\n <ng-container rowOutlet></ng-container>\n <ng-container footerRowOutlet></ng-container>\n',U=(u((function K(){return null!==A&&A.apply(this,arguments)||this}),A=s.EmbeddedViewRef),function(){function e(e,t,o,r,n,i,s){this._differs=e,this._changeDetectorRef=t,this._elementRef=o,this._dir=n,this._platform=s,this._onDestroy=new a.Subject,this._columnDefsByName=new Map,this._customColumnDefs=new Set,this._customRowDefs=new Set,this._customHeaderRowDefs=new Set,this._customFooterRowDefs=new Set,this._headerRowDefChanged=!0,this._footerRowDefChanged=!0,this._cachedRenderRowsMap=new Map,this.stickyCssClass="cdk-table-sticky",this._multiTemplateDataRows=!1,this.viewChange=new a.BehaviorSubject({start:0,end:Number.MAX_VALUE}),r||this._elementRef.nativeElement.setAttribute("role","grid"),this._document=i,this._isNativeHtmlTable="TABLE"===this._elementRef.nativeElement.nodeName}return Object.defineProperty(e.prototype,"trackBy",{get:function(){return this._trackByFn},set:function(e){s.isDevMode()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(e)+"."),this._trackByFn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource!==e&&this._switchDataSource(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"multiTemplateDataRows",{get:function(){return this._multiTemplateDataRows},set:function(e){this._multiTemplateDataRows=o.coerceBooleanProperty(e),this._rowOutlet&&this._rowOutlet.viewContainer.length&&this._forceRenderDataRows()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this._setupStickyStyler(),this._isNativeHtmlTable&&this._applyNativeTableSections(),this._dataDiffer=this._differs.find([]).create((function(t,o){return e.trackBy?e.trackBy(o.dataIndex,o.data):o}))},e.prototype.ngAfterContentChecked=function(){if(this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&!this._rowDefs.length)throw function e(){return Error("Missing definitions for header, footer, and row; cannot determine which columns should be rendered.")}();this._renderUpdatedColumns(),this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=!1),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=!1),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription&&this._observeRenderChanges(),this._checkStickyStates()},e.prototype.ngOnDestroy=function(){this._rowOutlet.viewContainer.clear(),this._headerRowOutlet.viewContainer.clear(),this._footerRowOutlet.viewContainer.clear(),this._cachedRenderRowsMap.clear(),this._onDestroy.next(),this._onDestroy.complete(),r.isDataSource(this.dataSource)&&this.dataSource.disconnect(this)},e.prototype.renderRows=function(){var e=this;this._renderRows=this._getAllRenderRows();var t=this._dataDiffer.diff(this._renderRows);if(t){var o=this._rowOutlet.viewContainer;t.forEachOperation((function(t,r,n){if(null==t.previousIndex)e._insertRow(t.item,n);else if(null==n)o.remove(r);else{var i=o.get(r);o.move(i,n)}})),this._updateRowIndexContext(),t.forEachIdentityChange((function(e){o.get(e.currentIndex).context.$implicit=e.item.data})),this.updateStickyColumnStyles()}},e.prototype.setHeaderRowDef=function(e){this._customHeaderRowDefs=new Set([e]),this._headerRowDefChanged=!0},e.prototype.setFooterRowDef=function(e){this._customFooterRowDefs=new Set([e]),this._footerRowDefChanged=!0},e.prototype.addColumnDef=function(e){this._customColumnDefs.add(e)},e.prototype.removeColumnDef=function(e){this._customColumnDefs.delete(e)},e.prototype.addRowDef=function(e){this._customRowDefs.add(e)},e.prototype.removeRowDef=function(e){this._customRowDefs.delete(e)},e.prototype.addHeaderRowDef=function(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=!0},e.prototype.removeHeaderRowDef=function(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=!0},e.prototype.addFooterRowDef=function(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=!0},e.prototype.removeFooterRowDef=function(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=!0},e.prototype.updateStickyHeaderRowStyles=function(){var e=this._getRenderedRows(this._headerRowOutlet),t=this._elementRef.nativeElement.querySelector("thead");t&&(t.style.display=e.length?"":"none");var o=this._headerRowDefs.map((function(e){return e.sticky}));this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,o,"top"),this._headerRowDefs.forEach((function(e){return e.resetStickyChanged()}))},e.prototype.updateStickyFooterRowStyles=function(){var e=this._getRenderedRows(this._footerRowOutlet),t=this._elementRef.nativeElement.querySelector("tfoot");t&&(t.style.display=e.length?"":"none");var o=this._footerRowDefs.map((function(e){return e.sticky}));this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,o,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,o),this._footerRowDefs.forEach((function(e){return e.resetStickyChanged()}))},e.prototype.updateStickyColumnStyles=function(){var e=this,t=this._getRenderedRows(this._headerRowOutlet),o=this._getRenderedRows(this._rowOutlet),r=this._getRenderedRows(this._footerRowOutlet);this._stickyStyler.clearStickyPositioning(d(t,o,r),["left","right"]),t.forEach((function(t,o){e._addStickyColumnStyles([t],e._headerRowDefs[o])})),this._rowDefs.forEach((function(t){for(var r=[],n=0;n<o.length;n++)e._renderRows[n].rowDef===t&&r.push(o[n]);e._addStickyColumnStyles(r,t)})),r.forEach((function(t,o){e._addStickyColumnStyles([t],e._footerRowDefs[o])})),Array.from(this._columnDefsByName.values()).forEach((function(e){return e.resetStickyChanged()}))},e.prototype._getAllRenderRows=function(){var e=[],t=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(var o=0;o<this._data.length;o++){var r=this._data[o],n=this._getRenderRowsForData(r,o,t.get(r));this._cachedRenderRowsMap.has(r)||this._cachedRenderRowsMap.set(r,new WeakMap);for(var i=0;i<n.length;i++){var s=n[i],a=this._cachedRenderRowsMap.get(s.data);a.has(s.rowDef)?a.get(s.rowDef).push(s):a.set(s.rowDef,[s]),e.push(s)}}return e},e.prototype._getRenderRowsForData=function(e,t,o){return this._getRowDefs(e,t).map((function(r){var n=o&&o.has(r)?o.get(r):[];if(n.length){var i=n.shift();return i.dataIndex=t,i}return{data:e,rowDef:r,dataIndex:t}}))},e.prototype._cacheColumnDefs=function(){var e=this;this._columnDefsByName.clear(),W(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach((function(t){if(e._columnDefsByName.has(t.name))throw function o(e){return Error('Duplicate column definition name provided: "'+e+'".')}(t.name);e._columnDefsByName.set(t.name,t)}))},e.prototype._cacheRowDefs=function(){this._headerRowDefs=W(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=W(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=W(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);var e=this._rowDefs.filter((function(e){return!e.when}));if(!this.multiTemplateDataRows&&e.length>1)throw function t(){return Error("There can only be one default row without a when predicate function.")}();this._defaultRowDef=e[0]},e.prototype._renderUpdatedColumns=function(){var e=function(e,t){return e||!!t.getColumnsDiff()};this._rowDefs.reduce(e,!1)&&this._forceRenderDataRows(),this._headerRowDefs.reduce(e,!1)&&this._forceRenderHeaderRows(),this._footerRowDefs.reduce(e,!1)&&this._forceRenderFooterRows()},e.prototype._switchDataSource=function(e){this._data=[],r.isDataSource(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear()),this._dataSource=e},e.prototype._observeRenderChanges=function(){var e=this;if(this.dataSource){var t;if(r.isDataSource(this.dataSource)?t=this.dataSource.connect(this):a.isObservable(this.dataSource)?t=this.dataSource:Array.isArray(this.dataSource)&&(t=a.of(this.dataSource)),void 0===t)throw function o(){return Error("Provided data source did not match an array, Observable, or DataSource")}();this._renderChangeSubscription=t.pipe(c.takeUntil(this._onDestroy)).subscribe((function(t){e._data=t||[],e.renderRows()}))}},e.prototype._forceRenderHeaderRows=function(){var e=this;this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((function(t,o){return e._renderRow(e._headerRowOutlet,t,o)})),this.updateStickyHeaderRowStyles(),this.updateStickyColumnStyles()},e.prototype._forceRenderFooterRows=function(){var e=this;this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((function(t,o){return e._renderRow(e._footerRowOutlet,t,o)})),this.updateStickyFooterRowStyles(),this.updateStickyColumnStyles()},e.prototype._addStickyColumnStyles=function(e,t){var o=this,r=Array.from(t.columns||[]).map((function(e){var t=o._columnDefsByName.get(e);if(!t)throw B(e);return t})),n=r.map((function(e){return e.sticky})),i=r.map((function(e){return e.stickyEnd}));this._stickyStyler.updateStickyColumns(e,n,i)},e.prototype._getRenderedRows=function(e){for(var t=[],o=0;o<e.viewContainer.length;o++){var r=e.viewContainer.get(o);t.push(r.rootNodes[0])}return t},e.prototype._getRowDefs=function(e,t){if(1==this._rowDefs.length)return[this._rowDefs[0]];var o=[];if(this.multiTemplateDataRows)o=this._rowDefs.filter((function(o){return!o.when||o.when(t,e)}));else{var r=this._rowDefs.find((function(o){return o.when&&o.when(t,e)}))||this._defaultRowDef;r&&o.push(r)}if(!o.length)throw function n(e){return Error("Could not find a matching row definition for theprovided row data: "+JSON.stringify(e))}(e);return o},e.prototype._insertRow=function(e,t){this._renderRow(this._rowOutlet,e.rowDef,t,{$implicit:e.data})},e.prototype._renderRow=function(e,t,o,r){var n,i;void 0===r&&(r={}),e.viewContainer.createEmbeddedView(t.template,r,o);try{for(var s=f(this._getCellTemplates(t)),a=s.next();!a.done;a=s.next())I.mostRecentCellOutlet&&I.mostRecentCellOutlet._viewContainer.createEmbeddedView(a.value,r)}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}this._changeDetectorRef.markForCheck()},e.prototype._updateRowIndexContext=function(){for(var e=this._rowOutlet.viewContainer,t=0,o=e.length;t<o;t++){var r=e.get(t).context;r.count=o,r.first=0===t,r.last=t===o-1,r.even=t%2==0,r.odd=!r.even,this.multiTemplateDataRows?(r.dataIndex=this._renderRows[t].dataIndex,r.renderIndex=t):r.index=this._renderRows[t].dataIndex}},e.prototype._getCellTemplates=function(e){var t=this;return e&&e.columns?Array.from(e.columns,(function(o){var r=t._columnDefsByName.get(o);if(!r)throw B(o);return e.extractCellTemplate(r)})):[]},e.prototype._applyNativeTableSections=function(){var e,t,o=this._document.createDocumentFragment(),r=[{tag:"thead",outlet:this._headerRowOutlet},{tag:"tbody",outlet:this._rowOutlet},{tag:"tfoot",outlet:this._footerRowOutlet}];try{for(var n=f(r),i=n.next();!i.done;i=n.next()){var s=i.value,a=this._document.createElement(s.tag);a.setAttribute("role","rowgroup"),a.appendChild(s.outlet.elementRef.nativeElement),o.appendChild(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._elementRef.nativeElement.appendChild(o)},e.prototype._forceRenderDataRows=function(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows(),this.updateStickyColumnStyles()},e.prototype._checkStickyStates=function(){var e=function(e,t){return e||t.hasStickyChanged()};this._headerRowDefs.reduce(e,!1)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,!1)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,!1)&&this.updateStickyColumnStyles()},e.prototype._setupStickyStyler=function(){var e=this;this._stickyStyler=new j(this._isNativeHtmlTable,this.stickyCssClass,this._dir?this._dir.value:"ltr",this._platform.isBrowser),(this._dir?this._dir.change:a.of()).pipe(c.takeUntil(this._onDestroy)).subscribe((function(t){e._stickyStyler.direction=t,e.updateStickyColumnStyles()}))},e.prototype._getOwnDefs=function(e){var t=this;return e.filter((function(e){return!e._table||e._table===t}))},e.decorators=[{type:s.Component,args:[{selector:"cdk-table, table[cdk-table]",exportAs:"cdkTable",template:q,host:{class:"cdk-table"},encapsulation:s.ViewEncapsulation.None,changeDetection:s.ChangeDetectionStrategy.Default,providers:[{provide:_,useExisting:e}]}]}],e.ctorParameters=function(){return[{type:s.IterableDiffers},{type:s.ChangeDetectorRef},{type:s.ElementRef},{type:String,decorators:[{type:s.Attribute,args:["role"]}]},{type:t.Directionality,decorators:[{type:s.Optional}]},{type:void 0,decorators:[{type:s.Inject,args:[i.DOCUMENT]}]},{type:n.Platform}]},e.propDecorators={trackBy:[{type:s.Input}],dataSource:[{type:s.Input}],multiTemplateDataRows:[{type:s.Input}],_rowOutlet:[{type:s.ViewChild,args:[M,{static:!0}]}],_headerRowOutlet:[{type:s.ViewChild,args:[V,{static:!0}]}],_footerRowOutlet:[{type:s.ViewChild,args:[L,{static:!0}]}],_contentColumnDefs:[{type:s.ContentChildren,args:[R,{descendants:!0}]}],_contentRowDefs:[{type:s.ContentChildren,args:[T,{descendants:!0}]}],_contentHeaderRowDefs:[{type:s.ContentChildren,args:[E,{descendants:!0}]}],_contentFooterRowDefs:[{type:s.ContentChildren,args:[x,{descendants:!0}]}]},e}());function W(e,t){return e.concat(Array.from(t))}
|
|
47
|
+
/**
|
|
48
|
+
* @license
|
|
49
|
+
* Copyright Google LLC All Rights Reserved.
|
|
50
|
+
*
|
|
51
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
52
|
+
* found in the LICENSE file at https://angular.io/license
|
|
53
|
+
*/var z=function(){function e(e,t){this._table=e,this._options=t,this.justify="start",this._options=t||{}}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e,this._syncColumnDefName()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){if(this._syncColumnDefName(),void 0===this.headerText&&(this.headerText=this._createDefaultHeaderText()),this.dataAccessor||(this.dataAccessor=this._options.defaultDataAccessor||function(e,t){return e[t]}),!this._table)throw function e(){return Error("Text column could not find a parent table for registration.")}();this.columnDef.cell=this.cell,this.columnDef.headerCell=this.headerCell,this._table.addColumnDef(this.columnDef)},e.prototype.ngOnDestroy=function(){this._table&&this._table.removeColumnDef(this.columnDef)},e.prototype._createDefaultHeaderText=function(){var e=this.name;if(s.isDevMode()&&!e)throw function t(){return Error("Table text column must have a name.")}();return this._options&&this._options.defaultHeaderTextTransform?this._options.defaultHeaderTextTransform(e):e[0].toUpperCase()+e.slice(1)},e.prototype._syncColumnDefName=function(){this.columnDef&&(this.columnDef.name=this.name)},e.decorators=[{type:s.Component,args:[{selector:"cdk-text-column",template:'\n <ng-container cdkColumnDef>\n <th cdk-header-cell *cdkHeaderCellDef [style.text-align]="justify">\n {{headerText}}\n </th>\n <td cdk-cell *cdkCellDef="let data" [style.text-align]="justify">\n {{dataAccessor(data, name)}}\n </td>\n </ng-container>\n ',encapsulation:s.ViewEncapsulation.None,changeDetection:s.ChangeDetectionStrategy.Default}]}],e.ctorParameters=function(){return[{type:U,decorators:[{type:s.Optional}]},{type:void 0,decorators:[{type:s.Optional},{type:s.Inject,args:[m]}]}]},e.propDecorators={name:[{type:s.Input}],headerText:[{type:s.Input}],dataAccessor:[{type:s.Input}],justify:[{type:s.Input}],columnDef:[{type:s.ViewChild,args:[R,{static:!0}]}],cell:[{type:s.ViewChild,args:[w,{static:!0}]}],headerCell:[{type:s.ViewChild,args:[g,{static:!0}]}]},e}(),Z=[U,T,w,I,g,D,R,S,H,k,v,P,E,N,x,M,V,L,z],J=function(){function e(){}return e.decorators=[{type:s.NgModule,args:[{exports:Z,declarations:Z}]}],e}();
|
|
32
54
|
/**
|
|
33
55
|
* @license
|
|
34
56
|
* Copyright Google LLC All Rights Reserved.
|
|
35
57
|
*
|
|
36
58
|
* Use of this source code is governed by an MIT-style license that can be
|
|
37
59
|
* found in the LICENSE file at https://angular.io/license
|
|
38
|
-
*/
|
|
60
|
+
*/
|
|
39
61
|
/**
|
|
40
62
|
* @license
|
|
41
63
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -43,4 +65,4 @@ var P,N=function(){function e(e,t){this.viewContainer=e,this.elementRef=t}return
|
|
|
43
65
|
* Use of this source code is governed by an MIT-style license that can be
|
|
44
66
|
* found in the LICENSE file at https://angular.io/license
|
|
45
67
|
*/
|
|
46
|
-
Object.defineProperty(e,"DataSource",{enumerable:!0,get:function(){return
|
|
68
|
+
Object.defineProperty(e,"DataSource",{enumerable:!0,get:function(){return r.DataSource}}),e.BaseCdkCell=y,e.BaseRowDef=O,e.CDK_ROW_TEMPLATE=b,e.CDK_TABLE=_,e.CDK_TABLE_TEMPLATE=q,e.CdkCell=S,e.CdkCellDef=w,e.CdkCellOutlet=I,e.CdkColumnDef=R,e.CdkFooterCell=v,e.CdkFooterCellDef=D,e.CdkFooterRow=N,e.CdkFooterRowDef=x,e.CdkHeaderCell=k,e.CdkHeaderCellDef=g,e.CdkHeaderRow=P,e.CdkHeaderRowDef=E,e.CdkRow=H,e.CdkRowDef=T,e.CdkTable=U,e.CdkTableModule=J,e.CdkTextColumn=z,e.DataRowOutlet=M,e.FooterRowOutlet=L,e.HeaderRowOutlet=V,e.STICKY_DIRECTIONS=F,e.StickyStyler=j,e.TEXT_COLUMN_OPTIONS=m,e.mixinHasStickyInput=p,Object.defineProperty(e,"__esModule",{value:!0})}));
|