@angular/cdk 9.2.0-next.0 → 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/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-table.umd.js +58 -27
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +12 -5
- package/bundles/cdk-table.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/coercion/array.js +1 -2
- 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/version.js +1 -1
- package/esm5/coercion/array.js +1 -2
- 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/version.js +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/coercion.js +0 -1
- package/fesm2015/coercion.js.map +1 -1
- package/fesm2015/table.js +98 -49
- package/fesm2015/table.js.map +1 -1
- package/fesm5/cdk.js +1 -1
- package/fesm5/cdk.js.map +1 -1
- package/fesm5/coercion.js +0 -1
- package/fesm5/coercion.js.map +1 -1
- package/fesm5/table.js +59 -29
- package/fesm5/table.js.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -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
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
* Use of this source code is governed by an MIT-style license that can be
|
|
46
46
|
* found in the LICENSE file at https://angular.io/license
|
|
47
47
|
*/
|
|
48
|
-
/** Wraps the provided value in an array, unless the provided value is an array. */
|
|
49
48
|
function coerceArray(value) {
|
|
50
49
|
return Array.isArray(value) ? value : [value];
|
|
51
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-coercion.umd.js","sources":["../../../../../../src/cdk/coercion/boolean-property.ts","../../../../../../src/cdk/coercion/number-property.ts","../../../../../../src/cdk/coercion/array.ts","../../../../../../src/cdk/coercion/css-pixel-value.ts","../../../../../../src/cdk/coercion/element.ts","../../../../../../src/cdk/coercion/public-api.ts","../../../../../../src/cdk/coercion/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Type describing the allowed values for a boolean input.\n * @docs-private\n */\nexport type BooleanInput = string | boolean | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a boolean. */\nexport function coerceBooleanProperty(value: any): boolean {\n return value != null && `${value}` !== 'false';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Type describing the allowed values for a number input\n * @docs-private\n */\nexport type NumberInput = string | number | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a number. */\nexport function coerceNumberProperty(value: any): number;\nexport function coerceNumberProperty<D>(value: any, fallback: D): number | D;\nexport function coerceNumberProperty(value: any, fallbackValue = 0) {\n return _isNumberValue(value) ? Number(value) : fallbackValue;\n}\n\n/**\n * Whether the provided value is considered a number.\n * @docs-private\n */\nexport function _isNumberValue(value: any): boolean {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value as any)) && !isNaN(Number(value));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Wraps the provided value in an array, unless the provided value is an array. */\nexport function coerceArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Coerces a value to a CSS pixel value. */\nexport function coerceCssPixelValue(value: any): string {\n if (value == null) {\n return '';\n }\n\n return typeof value === 'string' ? value : `${value}px`;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef} from '@angular/core';\n\n/**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\nexport function coerceElement<T>(elementOrRef: ElementRef<T> | T): T {\n return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './boolean-property';\nexport * from './number-property';\nexport * from './array';\nexport * from './css-pixel-value';\nexport * from './element';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":["ElementRef"],"mappings":";;;;;;IAAA;;;;;;;IAcA;AACA,aAAgB,qBAAqB,CAAC,KAAU;QAC9C,OAAO,KAAK,IAAI,IAAI,IAAI,KAAG,KAAO,KAAK,OAAO,CAAC;IACjD,CAAC;;ICjBD;;;;;;;AAiBA,aAAgB,oBAAoB,CAAC,KAAU,EAAE,aAAiB;QAAjB,8BAAA,EAAA,iBAAiB;QAChE,OAAO,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC;IAC/D,CAAC;IAED;;;;AAIA,aAAgB,cAAc,CAAC,KAAU;;;;QAIvC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;;IC9BD;;;;;;;
|
|
1
|
+
{"version":3,"file":"cdk-coercion.umd.js","sources":["../../../../../../src/cdk/coercion/boolean-property.ts","../../../../../../src/cdk/coercion/number-property.ts","../../../../../../src/cdk/coercion/array.ts","../../../../../../src/cdk/coercion/css-pixel-value.ts","../../../../../../src/cdk/coercion/element.ts","../../../../../../src/cdk/coercion/public-api.ts","../../../../../../src/cdk/coercion/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Type describing the allowed values for a boolean input.\n * @docs-private\n */\nexport type BooleanInput = string | boolean | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a boolean. */\nexport function coerceBooleanProperty(value: any): boolean {\n return value != null && `${value}` !== 'false';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Type describing the allowed values for a number input\n * @docs-private\n */\nexport type NumberInput = string | number | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a number. */\nexport function coerceNumberProperty(value: any): number;\nexport function coerceNumberProperty<D>(value: any, fallback: D): number | D;\nexport function coerceNumberProperty(value: any, fallbackValue = 0) {\n return _isNumberValue(value) ? Number(value) : fallbackValue;\n}\n\n/**\n * Whether the provided value is considered a number.\n * @docs-private\n */\nexport function _isNumberValue(value: any): boolean {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value as any)) && !isNaN(Number(value));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Wraps the provided value in an array, unless the provided value is an array. */\nexport function coerceArray<T>(value: T | T[]): T[];\nexport function coerceArray<T>(value: T | readonly T[]): readonly T[];\nexport function coerceArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Coerces a value to a CSS pixel value. */\nexport function coerceCssPixelValue(value: any): string {\n if (value == null) {\n return '';\n }\n\n return typeof value === 'string' ? value : `${value}px`;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef} from '@angular/core';\n\n/**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\nexport function coerceElement<T>(elementOrRef: ElementRef<T> | T): T {\n return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './boolean-property';\nexport * from './number-property';\nexport * from './array';\nexport * from './css-pixel-value';\nexport * from './element';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":["ElementRef"],"mappings":";;;;;;IAAA;;;;;;;IAcA;AACA,aAAgB,qBAAqB,CAAC,KAAU;QAC9C,OAAO,KAAK,IAAI,IAAI,IAAI,KAAG,KAAO,KAAK,OAAO,CAAC;IACjD,CAAC;;ICjBD;;;;;;;AAiBA,aAAgB,oBAAoB,CAAC,KAAU,EAAE,aAAiB;QAAjB,8BAAA,EAAA,iBAAiB;QAChE,OAAO,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC;IAC/D,CAAC;IAED;;;;AAIA,aAAgB,cAAc,CAAC,KAAU;;;;QAIvC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;;IC9BD;;;;;;;AAWA,aAAgB,WAAW,CAAI,KAAc;QAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;;ICbD;;;;;;;IAQA;AACA,aAAgB,mBAAmB,CAAC,KAAU;QAC5C,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,OAAO,EAAE,CAAC;SACX;QAED,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAM,KAAK,OAAI,CAAC;IAC1D,CAAC;;ICfD;;;;;;;AAQA,IAEA;;;;AAIA,aAAgB,aAAa,CAAI,YAA+B;QAC9D,OAAO,YAAY,YAAYA,eAAU,GAAG,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC;IACxF,CAAC;;IChBD;;;;;;OAMG;;ICNH;;;;;;OAMG;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/cdk/cdk-coercion.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","coercion","core","this","_isNumberValue","value","isNaN","parseFloat","Number","coerceArray","Array","isArray","coerceBooleanProperty","coerceCssPixelValue","coerceElement","elementOrRef","ElementRef","nativeElement","coerceNumberProperty","fallbackValue","Object","defineProperty"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,kBACtE,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,wBAAyB,CAAC,UAAW,iBAAkBJ,GACjFA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAIC,SAAW,IAAKV,EAAOQ,GAAGG,MAHjJ,CAIEC,MAAM,SAAWV,EAASS,GAAQ;;;;;;;OA6BhC,SAASE,EAAeC,GAIpB,OAAQC,MAAMC,WAAWF,MAAYC,MAAME,OAAOH;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["src/cdk/cdk-coercion.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","coercion","core","this","_isNumberValue","value","isNaN","parseFloat","Number","coerceArray","Array","isArray","coerceBooleanProperty","coerceCssPixelValue","coerceElement","elementOrRef","ElementRef","nativeElement","coerceNumberProperty","fallbackValue","Object","defineProperty"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,kBACtE,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,wBAAyB,CAAC,UAAW,iBAAkBJ,GACjFA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAIC,SAAW,IAAKV,EAAOQ,GAAGG,MAHjJ,CAIEC,MAAM,SAAWV,EAASS,GAAQ;;;;;;;OA6BhC,SAASE,EAAeC,GAIpB,OAAQC,MAAMC,WAAWF,MAAYC,MAAME,OAAOH;;;;;;;;;;;;;;;;;;;;;;AA4DtDZ,EAAQW,eAAiBA,EACzBX,EAAQgB,YAnDR,SAASA,EAAYJ,GACjB,OAAOK,MAAMC,QAAQN,GAASA,EAAQ,CAACA;;;;;;;QAmD3CZ,EAAQmB,sBArFR,SAASA,EAAsBP,GAC3B,OAAgB,MAATA,GAAiB,GAAKA,GAAU;;;;;;;QAqF3CZ,EAAQoB,oBAzCR,SAASA,EAAoBR,GACzB,OAAa,MAATA,EACO,GAEa,iBAAVA,EAAqBA,EAAQA,EAAQ;;;;;;;QAsCvDZ,EAAQqB,cAxBR,SAASA,EAAcC,GACnB,OAAOA,aAAwBb,EAAKc,WAAaD,EAAaE,cAAgBF,GAwBlFtB,EAAQyB,qBA7ER,SAASA,EAAqBb,EAAOc,GAEjC,YADsB,IAAlBA,IAA4BA,EAAgB,GACzCf,EAAeC,GAASG,OAAOH,GAASc,GA6EnDC,OAAOC,eAAe5B,EAAS,aAAc,CAAEY,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/coercion', ['exports', '@angular/core'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.coercion = {}), global.ng.core));\n}(this, (function (exports, core) { 'use strict';\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /** Coerces a data-bound value (typically a string) to a boolean. */\n function coerceBooleanProperty(value) {\n return value != null && \"\" + value !== 'false';\n }\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n function coerceNumberProperty(value, fallbackValue) {\n if (fallbackValue === void 0) { fallbackValue = 0; }\n return _isNumberValue(value) ? Number(value) : fallbackValue;\n }\n /**\n * Whether the provided value is considered a number.\n * @docs-private\n */\n function _isNumberValue(value) {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value)) && !isNaN(Number(value));\n }\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n function coerceArray(value) {\n return Array.isArray(value) ? value : [value];\n }\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /** Coerces a value to a CSS pixel value. */\n function coerceCssPixelValue(value) {\n if (value == null) {\n return '';\n }\n return typeof value === 'string' ? value : value + \"px\";\n }\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\n function coerceElement(elementOrRef) {\n return elementOrRef instanceof core.ElementRef ? elementOrRef.nativeElement : elementOrRef;\n }\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n exports._isNumberValue = _isNumberValue;\n exports.coerceArray = coerceArray;\n exports.coerceBooleanProperty = coerceBooleanProperty;\n exports.coerceCssPixelValue = coerceCssPixelValue;\n exports.coerceElement = coerceElement;\n exports.coerceNumberProperty = coerceNumberProperty;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-coercion.umd.js.map\n"]}
|
package/bundles/cdk-table.umd.js
CHANGED
|
@@ -253,6 +253,21 @@
|
|
|
253
253
|
}(base));
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
+
/**
|
|
257
|
+
* @license
|
|
258
|
+
* Copyright Google LLC All Rights Reserved.
|
|
259
|
+
*
|
|
260
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
261
|
+
* found in the LICENSE file at https://angular.io/license
|
|
262
|
+
*/
|
|
263
|
+
/**
|
|
264
|
+
* Used to provide a table to some of the sub-components without causing a circular dependency.
|
|
265
|
+
* @docs-private
|
|
266
|
+
*/
|
|
267
|
+
var CDK_TABLE = new core.InjectionToken('CDK_TABLE');
|
|
268
|
+
/** Injection token that can be used to specify the text column options. */
|
|
269
|
+
var TEXT_COLUMN_OPTIONS = new core.InjectionToken('text-column-options');
|
|
270
|
+
|
|
256
271
|
/**
|
|
257
272
|
* @license
|
|
258
273
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -325,8 +340,9 @@
|
|
|
325
340
|
*/
|
|
326
341
|
var CdkColumnDef = /** @class */ (function (_super) {
|
|
327
342
|
__extends(CdkColumnDef, _super);
|
|
328
|
-
function CdkColumnDef() {
|
|
329
|
-
var _this = _super
|
|
343
|
+
function CdkColumnDef(_table) {
|
|
344
|
+
var _this = _super.call(this) || this;
|
|
345
|
+
_this._table = _table;
|
|
330
346
|
_this._stickyEnd = false;
|
|
331
347
|
return _this;
|
|
332
348
|
}
|
|
@@ -338,11 +354,10 @@
|
|
|
338
354
|
set: function (name) {
|
|
339
355
|
// If the directive is set without a name (updated programatically), then this setter will
|
|
340
356
|
// trigger with an empty string and should not overwrite the programatically set value.
|
|
341
|
-
if (
|
|
342
|
-
|
|
357
|
+
if (name) {
|
|
358
|
+
this._name = name;
|
|
359
|
+
this.cssClassFriendlyName = name.replace(/[^a-z0-9_-]/ig, '-');
|
|
343
360
|
}
|
|
344
|
-
this._name = name;
|
|
345
|
-
this.cssClassFriendlyName = name.replace(/[^a-z0-9_-]/ig, '-');
|
|
346
361
|
},
|
|
347
362
|
enumerable: true,
|
|
348
363
|
configurable: true
|
|
@@ -371,6 +386,10 @@
|
|
|
371
386
|
providers: [{ provide: 'MAT_SORT_HEADER_COLUMN_DEF', useExisting: CdkColumnDef }],
|
|
372
387
|
},] }
|
|
373
388
|
];
|
|
389
|
+
/** @nocollapse */
|
|
390
|
+
CdkColumnDef.ctorParameters = function () { return [
|
|
391
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
|
|
392
|
+
]; };
|
|
374
393
|
CdkColumnDef.propDecorators = {
|
|
375
394
|
name: [{ type: core.Input, args: ['cdkColumnDef',] }],
|
|
376
395
|
stickyEnd: [{ type: core.Input, args: ['stickyEnd',] }],
|
|
@@ -523,8 +542,10 @@
|
|
|
523
542
|
*/
|
|
524
543
|
var CdkHeaderRowDef = /** @class */ (function (_super) {
|
|
525
544
|
__extends(CdkHeaderRowDef, _super);
|
|
526
|
-
function CdkHeaderRowDef(template, _differs) {
|
|
527
|
-
|
|
545
|
+
function CdkHeaderRowDef(template, _differs, _table) {
|
|
546
|
+
var _this = _super.call(this, template, _differs) || this;
|
|
547
|
+
_this._table = _table;
|
|
548
|
+
return _this;
|
|
528
549
|
}
|
|
529
550
|
// Prerender fails to recognize that ngOnChanges in a part of this class through inheritance.
|
|
530
551
|
// Explicitly define it so that the method is called as part of the Angular lifecycle.
|
|
@@ -540,7 +561,8 @@
|
|
|
540
561
|
/** @nocollapse */
|
|
541
562
|
CdkHeaderRowDef.ctorParameters = function () { return [
|
|
542
563
|
{ type: core.TemplateRef },
|
|
543
|
-
{ type: core.IterableDiffers }
|
|
564
|
+
{ type: core.IterableDiffers },
|
|
565
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
|
|
544
566
|
]; };
|
|
545
567
|
return CdkHeaderRowDef;
|
|
546
568
|
}(_CdkHeaderRowDefBase));
|
|
@@ -560,8 +582,10 @@
|
|
|
560
582
|
*/
|
|
561
583
|
var CdkFooterRowDef = /** @class */ (function (_super) {
|
|
562
584
|
__extends(CdkFooterRowDef, _super);
|
|
563
|
-
function CdkFooterRowDef(template, _differs) {
|
|
564
|
-
|
|
585
|
+
function CdkFooterRowDef(template, _differs, _table) {
|
|
586
|
+
var _this = _super.call(this, template, _differs) || this;
|
|
587
|
+
_this._table = _table;
|
|
588
|
+
return _this;
|
|
565
589
|
}
|
|
566
590
|
// Prerender fails to recognize that ngOnChanges in a part of this class through inheritance.
|
|
567
591
|
// Explicitly define it so that the method is called as part of the Angular lifecycle.
|
|
@@ -577,7 +601,8 @@
|
|
|
577
601
|
/** @nocollapse */
|
|
578
602
|
CdkFooterRowDef.ctorParameters = function () { return [
|
|
579
603
|
{ type: core.TemplateRef },
|
|
580
|
-
{ type: core.IterableDiffers }
|
|
604
|
+
{ type: core.IterableDiffers },
|
|
605
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
|
|
581
606
|
]; };
|
|
582
607
|
return CdkFooterRowDef;
|
|
583
608
|
}(_CdkFooterRowDefBase));
|
|
@@ -590,8 +615,10 @@
|
|
|
590
615
|
__extends(CdkRowDef, _super);
|
|
591
616
|
// TODO(andrewseguin): Add an input for providing a switch function to determine
|
|
592
617
|
// if this template should be used.
|
|
593
|
-
function CdkRowDef(template, _differs) {
|
|
594
|
-
|
|
618
|
+
function CdkRowDef(template, _differs, _table) {
|
|
619
|
+
var _this = _super.call(this, template, _differs) || this;
|
|
620
|
+
_this._table = _table;
|
|
621
|
+
return _this;
|
|
595
622
|
}
|
|
596
623
|
CdkRowDef.decorators = [
|
|
597
624
|
{ type: core.Directive, args: [{
|
|
@@ -602,7 +629,8 @@
|
|
|
602
629
|
/** @nocollapse */
|
|
603
630
|
CdkRowDef.ctorParameters = function () { return [
|
|
604
631
|
{ type: core.TemplateRef },
|
|
605
|
-
{ type: core.IterableDiffers }
|
|
632
|
+
{ type: core.IterableDiffers },
|
|
633
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [CDK_TABLE,] }, { type: core.Optional }] }
|
|
606
634
|
]; };
|
|
607
635
|
return CdkRowDef;
|
|
608
636
|
}(BaseRowDef));
|
|
@@ -1598,7 +1626,7 @@
|
|
|
1598
1626
|
CdkTable.prototype._cacheColumnDefs = function () {
|
|
1599
1627
|
var _this = this;
|
|
1600
1628
|
this._columnDefsByName.clear();
|
|
1601
|
-
var columnDefs =
|
|
1629
|
+
var columnDefs = mergeArrayAndSet(this._getOwnDefs(this._contentColumnDefs), this._customColumnDefs);
|
|
1602
1630
|
columnDefs.forEach(function (columnDef) {
|
|
1603
1631
|
if (_this._columnDefsByName.has(columnDef.name)) {
|
|
1604
1632
|
throw getTableDuplicateColumnNameError(columnDef.name);
|
|
@@ -1608,11 +1636,9 @@
|
|
|
1608
1636
|
};
|
|
1609
1637
|
/** Update the list of all available row definitions that can be used. */
|
|
1610
1638
|
CdkTable.prototype._cacheRowDefs = function () {
|
|
1611
|
-
this._headerRowDefs =
|
|
1612
|
-
|
|
1613
|
-
this.
|
|
1614
|
-
mergeQueryListAndSet(this._contentFooterRowDefs, this._customFooterRowDefs);
|
|
1615
|
-
this._rowDefs = mergeQueryListAndSet(this._contentRowDefs, this._customRowDefs);
|
|
1639
|
+
this._headerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentHeaderRowDefs), this._customHeaderRowDefs);
|
|
1640
|
+
this._footerRowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentFooterRowDefs), this._customFooterRowDefs);
|
|
1641
|
+
this._rowDefs = mergeArrayAndSet(this._getOwnDefs(this._contentRowDefs), this._customRowDefs);
|
|
1616
1642
|
// After all row definitions are determined, find the row definition to be considered default.
|
|
1617
1643
|
var defaultRowDefs = this._rowDefs.filter(function (def) { return !def.when; });
|
|
1618
1644
|
if (!this.multiTemplateDataRows && defaultRowDefs.length > 1) {
|
|
@@ -1913,6 +1939,11 @@
|
|
|
1913
1939
|
_this.updateStickyColumnStyles();
|
|
1914
1940
|
});
|
|
1915
1941
|
};
|
|
1942
|
+
/** Filters definitions that belong to this table from a QueryList. */
|
|
1943
|
+
CdkTable.prototype._getOwnDefs = function (items) {
|
|
1944
|
+
var _this = this;
|
|
1945
|
+
return items.filter(function (item) { return !item._table || item._table === _this; });
|
|
1946
|
+
};
|
|
1916
1947
|
CdkTable.decorators = [
|
|
1917
1948
|
{ type: core.Component, args: [{
|
|
1918
1949
|
selector: 'cdk-table, table[cdk-table]',
|
|
@@ -1926,7 +1957,8 @@
|
|
|
1926
1957
|
// The view for `MatTable` consists entirely of templates declared in other views. As they are
|
|
1927
1958
|
// declared elsewhere, they are checked when their declaration points are checked.
|
|
1928
1959
|
// tslint:disable-next-line:validate-decorators
|
|
1929
|
-
changeDetection: core.ChangeDetectionStrategy.Default
|
|
1960
|
+
changeDetection: core.ChangeDetectionStrategy.Default,
|
|
1961
|
+
providers: [{ provide: CDK_TABLE, useExisting: CdkTable }]
|
|
1930
1962
|
}] }
|
|
1931
1963
|
];
|
|
1932
1964
|
/** @nocollapse */
|
|
@@ -1957,9 +1989,9 @@
|
|
|
1957
1989
|
};
|
|
1958
1990
|
return CdkTable;
|
|
1959
1991
|
}());
|
|
1960
|
-
/** Utility function that gets a merged list of the entries in
|
|
1961
|
-
function
|
|
1962
|
-
return
|
|
1992
|
+
/** Utility function that gets a merged list of the entries in an array and values of a Set. */
|
|
1993
|
+
function mergeArrayAndSet(array, set) {
|
|
1994
|
+
return array.concat(Array.from(set));
|
|
1963
1995
|
}
|
|
1964
1996
|
|
|
1965
1997
|
/**
|
|
@@ -1969,8 +2001,6 @@
|
|
|
1969
2001
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1970
2002
|
* found in the LICENSE file at https://angular.io/license
|
|
1971
2003
|
*/
|
|
1972
|
-
/** Injection token that can be used to specify the text column options. */
|
|
1973
|
-
var TEXT_COLUMN_OPTIONS = new core.InjectionToken('text-column-options');
|
|
1974
2004
|
/**
|
|
1975
2005
|
* Column that simply shows text content for the header and row cells. Assumes that the table
|
|
1976
2006
|
* is using the native table implementation (`<table>`).
|
|
@@ -2140,6 +2170,7 @@
|
|
|
2140
2170
|
exports.BaseCdkCell = BaseCdkCell;
|
|
2141
2171
|
exports.BaseRowDef = BaseRowDef;
|
|
2142
2172
|
exports.CDK_ROW_TEMPLATE = CDK_ROW_TEMPLATE;
|
|
2173
|
+
exports.CDK_TABLE = CDK_TABLE;
|
|
2143
2174
|
exports.CDK_TABLE_TEMPLATE = CDK_TABLE_TEMPLATE;
|
|
2144
2175
|
exports.CdkCell = CdkCell;
|
|
2145
2176
|
exports.CdkCellDef = CdkCellDef;
|