@angular/cdk 7.0.4 → 7.2.1
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/LICENSE +1 -1
- package/_a11y.scss +1 -1
- package/a11y/typings/focus-monitor/focus-monitor.d.ts +20 -5
- package/a11y/typings/focus-trap/focus-trap.d.ts +2 -0
- package/a11y/typings/index.metadata.json +1 -1
- package/a11y/typings/live-announcer/live-announcer.d.ts +34 -3
- package/bundles/cdk-a11y.umd.js +477 -216
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -1
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +16 -9
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-bidi.umd.js +11 -6
- package/bundles/cdk-bidi.umd.js.map +1 -1
- package/bundles/cdk-bidi.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +25 -9
- package/bundles/cdk-coercion.umd.js.map +1 -1
- package/bundles/cdk-coercion.umd.min.js +1 -1
- package/bundles/cdk-coercion.umd.min.js.map +1 -1
- package/bundles/cdk-collections.umd.js +28 -5
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +2177 -915
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +2 -1
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-keycodes.umd.js +33 -1
- package/bundles/cdk-keycodes.umd.js.map +1 -1
- package/bundles/cdk-keycodes.umd.min.js +1 -1
- package/bundles/cdk-keycodes.umd.min.js.map +1 -1
- package/bundles/cdk-layout.umd.js +29 -22
- package/bundles/cdk-layout.umd.js.map +1 -1
- package/bundles/cdk-layout.umd.min.js +1 -1
- package/bundles/cdk-layout.umd.min.js.map +1 -1
- package/bundles/cdk-observers.umd.js +26 -7
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js +1 -1
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +605 -258
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +2 -2
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +50 -28
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +14 -7
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +139 -44
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +1 -1
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +103 -19
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js +1 -1
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +182 -48
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +76 -38
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +1 -1
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +71 -34
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +1 -1
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +5 -4
- 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/typings/element.d.ts +13 -0
- package/coercion/typings/index.metadata.json +1 -1
- package/coercion/typings/public-api.d.ts +1 -0
- package/drag-drop/typings/{drag-handle.d.ts → directives/drag-handle.d.ts} +3 -0
- package/drag-drop/typings/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
- package/drag-drop/typings/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
- package/drag-drop/typings/directives/drag.d.ts +109 -0
- package/{typings/drag-drop → drag-drop/typings/directives}/drop-list-group.d.ts +3 -0
- package/drag-drop/typings/directives/drop-list.d.ts +135 -0
- package/drag-drop/typings/drag-drop-registry.d.ts +8 -3
- package/drag-drop/typings/drag-events.d.ts +14 -7
- package/{typings/esm5/drag-drop/drag.d.ts → drag-drop/typings/drag-ref.d.ts} +152 -82
- package/drag-drop/typings/drop-list-container.d.ts +21 -3
- package/drag-drop/typings/{drop-list.d.ts → drop-list-ref.d.ts} +132 -81
- package/drag-drop/typings/index.d.ts +1 -0
- package/drag-drop/typings/index.metadata.json +1 -1
- package/drag-drop/typings/public-api.d.ts +13 -6
- package/esm2015/a11y.js +337 -190
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/accordion.js +16 -11
- package/esm2015/accordion.js.map +1 -1
- package/esm2015/bidi.js +13 -8
- package/esm2015/bidi.js.map +1 -1
- package/esm2015/cdk.js +7 -6
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/coercion.js +25 -8
- package/esm2015/coercion.js.map +1 -1
- package/esm2015/collections.js +22 -7
- package/esm2015/collections.js.map +1 -1
- package/esm2015/drag-drop.js +1587 -691
- package/esm2015/drag-drop.js.map +1 -1
- package/esm2015/keycodes.js +31 -4
- package/esm2015/keycodes.js.map +1 -1
- package/esm2015/layout.js +29 -19
- package/esm2015/layout.js.map +1 -1
- package/esm2015/observers.js +15 -10
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js +393 -232
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/platform.js +53 -31
- package/esm2015/platform.js.map +1 -1
- package/esm2015/portal.js +13 -9
- package/esm2015/portal.js.map +1 -1
- package/esm2015/scrolling.js +102 -45
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +93 -24
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +89 -45
- package/esm2015/table.js.map +1 -1
- package/esm2015/text-field.js +54 -37
- package/esm2015/text-field.js.map +1 -1
- package/esm2015/tree.js +55 -36
- package/esm2015/tree.js.map +1 -1
- package/esm5/a11y.es5.js +481 -220
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/accordion.es5.js +18 -11
- package/esm5/accordion.es5.js.map +1 -1
- package/esm5/bidi.es5.js +13 -8
- package/esm5/bidi.es5.js.map +1 -1
- package/esm5/cdk.es5.js +7 -6
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/coercion.es5.js +25 -8
- package/esm5/coercion.es5.js.map +1 -1
- package/esm5/collections.es5.js +35 -7
- package/esm5/collections.es5.js.map +1 -1
- package/esm5/drag-drop.es5.js +2233 -972
- package/esm5/drag-drop.es5.js.map +1 -1
- package/esm5/keycodes.es5.js +35 -4
- package/esm5/keycodes.es5.js.map +1 -1
- package/esm5/layout.es5.js +31 -24
- package/esm5/layout.es5.js.map +1 -1
- package/esm5/observers.es5.js +29 -10
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js +609 -262
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/platform.es5.js +52 -30
- package/esm5/platform.es5.js.map +1 -1
- package/esm5/portal.es5.js +16 -9
- package/esm5/portal.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +141 -46
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +106 -24
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +184 -50
- package/esm5/table.es5.js.map +1 -1
- package/esm5/text-field.es5.js +75 -37
- package/esm5/text-field.es5.js.map +1 -1
- package/esm5/tree.es5.js +74 -37
- package/esm5/tree.es5.js.map +1 -1
- package/keycodes/typings/index.metadata.json +1 -1
- package/keycodes/typings/modifiers.d.ts +14 -0
- package/keycodes/typings/public-api.d.ts +1 -0
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/overlay-directives.d.ts +0 -2
- package/package.json +4 -4
- package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
- package/schematics/ng-update/upgrade-data.js +2 -1
- package/schematics/ng-update/upgrade-data.js.map +1 -1
- package/schematics/ng-update/upgrade-rules/index.js +3 -2
- package/schematics/ng-update/upgrade-rules/index.js.map +1 -1
- package/schematics/utils/ast/ng-module-imports.d.ts +1 -1
- package/schematics/utils/ast/ng-module-imports.js +25 -13
- package/schematics/utils/ast/ng-module-imports.js.map +1 -1
- package/schematics/utils/get-project.js +2 -1
- package/schematics/utils/get-project.js.map +1 -1
- package/schematics/utils/parse5-element.js +3 -2
- package/schematics/utils/parse5-element.js.map +1 -1
- package/schematics/utils/project-targets.js +2 -1
- package/schematics/utils/project-targets.js.map +1 -1
- package/schematics/utils/version-agnostic-typescript.js +3 -2
- package/schematics/utils/version-agnostic-typescript.js.map +1 -1
- package/scrolling/typings/index.metadata.json +1 -1
- package/stepper/typings/index.metadata.json +1 -1
- package/stepper/typings/public-api.d.ts +1 -0
- package/stepper/typings/step-header.d.ts +15 -0
- package/stepper/typings/stepper.d.ts +11 -1
- package/text-field/typings/autosize.d.ts +6 -0
- package/text-field/typings/index.metadata.json +1 -1
- package/tree/typings/control/base-tree-control.d.ts +1 -1
- package/tree/typings/control/nested-tree-control.d.ts +2 -2
- package/tree/typings/control/tree-control.d.ts +1 -1
- package/tree/typings/nested-node.d.ts +5 -5
- package/typings/a11y/focus-monitor/focus-monitor.d.ts +20 -5
- package/typings/a11y/focus-trap/focus-trap.d.ts +2 -0
- package/typings/a11y/index.metadata.json +1 -1
- package/typings/a11y/live-announcer/live-announcer.d.ts +34 -3
- package/typings/coercion/element.d.ts +13 -0
- package/typings/coercion/index.metadata.json +1 -1
- package/typings/coercion/public-api.d.ts +1 -0
- package/typings/{esm5/drag-drop → drag-drop/directives}/drag-handle.d.ts +3 -0
- package/typings/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
- package/typings/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
- package/typings/drag-drop/directives/drag.d.ts +109 -0
- package/typings/{esm5/drag-drop → drag-drop/directives}/drop-list-group.d.ts +3 -0
- package/typings/drag-drop/directives/drop-list.d.ts +135 -0
- package/typings/drag-drop/drag-drop-registry.d.ts +8 -3
- package/typings/drag-drop/drag-events.d.ts +14 -7
- package/typings/drag-drop/{drag.d.ts → drag-ref.d.ts} +152 -82
- package/typings/drag-drop/drop-list-container.d.ts +21 -3
- package/typings/{esm5/drag-drop/drop-list.d.ts → drag-drop/drop-list-ref.d.ts} +132 -81
- package/typings/drag-drop/index.d.ts +1 -0
- package/typings/drag-drop/index.metadata.json +1 -1
- package/typings/drag-drop/public-api.d.ts +13 -6
- package/typings/esm5/a11y/focus-monitor/focus-monitor.d.ts +20 -5
- package/typings/esm5/a11y/focus-trap/focus-trap.d.ts +2 -0
- package/typings/esm5/a11y/index.metadata.json +1 -1
- package/typings/esm5/a11y/live-announcer/live-announcer.d.ts +34 -3
- package/typings/esm5/coercion/element.d.ts +13 -0
- package/typings/esm5/coercion/index.metadata.json +1 -1
- package/typings/esm5/coercion/public-api.d.ts +1 -0
- package/typings/{drag-drop → esm5/drag-drop/directives}/drag-handle.d.ts +3 -0
- package/typings/esm5/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
- package/typings/esm5/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
- package/typings/esm5/drag-drop/directives/drag.d.ts +109 -0
- package/{drag-drop/typings → typings/esm5/drag-drop/directives}/drop-list-group.d.ts +3 -0
- package/typings/esm5/drag-drop/directives/drop-list.d.ts +135 -0
- package/typings/esm5/drag-drop/drag-drop-registry.d.ts +8 -3
- package/typings/esm5/drag-drop/drag-events.d.ts +14 -7
- package/{drag-drop/typings/drag.d.ts → typings/esm5/drag-drop/drag-ref.d.ts} +152 -82
- package/typings/esm5/drag-drop/drop-list-container.d.ts +21 -3
- package/typings/{drag-drop/drop-list.d.ts → esm5/drag-drop/drop-list-ref.d.ts} +132 -81
- package/typings/esm5/drag-drop/index.d.ts +1 -0
- package/typings/esm5/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/drag-drop/public-api.d.ts +13 -6
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/keycodes/index.metadata.json +1 -1
- package/typings/esm5/keycodes/modifiers.d.ts +14 -0
- package/typings/esm5/keycodes/public-api.d.ts +1 -0
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/overlay/overlay-directives.d.ts +0 -2
- package/typings/esm5/scrolling/index.metadata.json +1 -1
- package/typings/esm5/stepper/index.metadata.json +1 -1
- package/typings/esm5/stepper/public-api.d.ts +1 -0
- package/typings/esm5/stepper/step-header.d.ts +15 -0
- package/typings/esm5/stepper/stepper.d.ts +11 -1
- package/typings/esm5/text-field/autosize.d.ts +6 -0
- package/typings/esm5/text-field/index.metadata.json +1 -1
- package/typings/esm5/tree/control/base-tree-control.d.ts +1 -1
- package/typings/esm5/tree/control/nested-tree-control.d.ts +2 -2
- package/typings/esm5/tree/control/tree-control.d.ts +1 -1
- package/typings/esm5/tree/nested-node.d.ts +5 -5
- package/typings/index.metadata.json +1 -1
- package/typings/keycodes/index.metadata.json +1 -1
- package/typings/keycodes/modifiers.d.ts +14 -0
- package/typings/keycodes/public-api.d.ts +1 -0
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/overlay-directives.d.ts +0 -2
- package/typings/schematics/utils/ast/ng-module-imports.d.ts +1 -1
- package/typings/scrolling/index.metadata.json +1 -1
- package/typings/stepper/index.metadata.json +1 -1
- package/typings/stepper/public-api.d.ts +1 -0
- package/typings/stepper/step-header.d.ts +15 -0
- package/typings/stepper/stepper.d.ts +11 -1
- package/typings/text-field/autosize.d.ts +6 -0
- package/typings/text-field/index.metadata.json +1 -1
- package/typings/tree/control/base-tree-control.d.ts +1 -1
- package/typings/tree/control/nested-tree-control.d.ts +2 -2
- package/typings/tree/control/tree-control.d.ts +1 -1
- package/typings/tree/nested-node.d.ts +5 -5
package/esm5/keycodes.es5.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* @fileoverview added by tsickle
|
|
10
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
10
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/** @type {?} */
|
|
@@ -80,8 +80,10 @@ var EIGHT = 56;
|
|
|
80
80
|
var NINE = 57;
|
|
81
81
|
/** @type {?} */
|
|
82
82
|
var FF_SEMICOLON = 59;
|
|
83
|
+
// Firefox (Gecko) fires this for semicolon instead of 186
|
|
83
84
|
/** @type {?} */
|
|
84
85
|
var FF_EQUALS = 61;
|
|
86
|
+
// Firefox (Gecko) fires this for equals instead of 187
|
|
85
87
|
/** @type {?} */
|
|
86
88
|
var QUESTION_MARK = 63;
|
|
87
89
|
/** @type {?} */
|
|
@@ -140,6 +142,7 @@ var Y = 89;
|
|
|
140
142
|
var Z = 90;
|
|
141
143
|
/** @type {?} */
|
|
142
144
|
var META = 91;
|
|
145
|
+
// WIN_KEY_LEFT
|
|
143
146
|
/** @type {?} */
|
|
144
147
|
var MAC_WK_CMD_LEFT = 91;
|
|
145
148
|
/** @type {?} */
|
|
@@ -210,10 +213,13 @@ var FIRST_MEDIA = 166;
|
|
|
210
213
|
var FF_MINUS = 173;
|
|
211
214
|
/** @type {?} */
|
|
212
215
|
var MUTE = 173;
|
|
216
|
+
// Firefox (Gecko) fires 181 for MUTE
|
|
213
217
|
/** @type {?} */
|
|
214
218
|
var VOLUME_DOWN = 174;
|
|
219
|
+
// Firefox (Gecko) fires 182 for VOLUME_DOWN
|
|
215
220
|
/** @type {?} */
|
|
216
221
|
var VOLUME_UP = 175;
|
|
222
|
+
// Firefox (Gecko) fires 183 for VOLUME_UP
|
|
217
223
|
/** @type {?} */
|
|
218
224
|
var FF_MUTE = 181;
|
|
219
225
|
/** @type {?} */
|
|
@@ -224,12 +230,15 @@ var LAST_MEDIA = 183;
|
|
|
224
230
|
var FF_VOLUME_UP = 183;
|
|
225
231
|
/** @type {?} */
|
|
226
232
|
var SEMICOLON = 186;
|
|
233
|
+
// Firefox (Gecko) fires 59 for SEMICOLON
|
|
227
234
|
/** @type {?} */
|
|
228
235
|
var EQUALS = 187;
|
|
236
|
+
// Firefox (Gecko) fires 61 for EQUALS
|
|
229
237
|
/** @type {?} */
|
|
230
238
|
var COMMA = 188;
|
|
231
239
|
/** @type {?} */
|
|
232
240
|
var DASH = 189;
|
|
241
|
+
// Firefox (Gecko) fires 173 for DASH/MINUS
|
|
233
242
|
/** @type {?} */
|
|
234
243
|
var SLASH = 191;
|
|
235
244
|
/** @type {?} */
|
|
@@ -249,13 +258,35 @@ var MAC_META = 224;
|
|
|
249
258
|
|
|
250
259
|
/**
|
|
251
260
|
* @fileoverview added by tsickle
|
|
252
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
261
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
262
|
+
*/
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Checks whether a modifier key is pressed.
|
|
266
|
+
* @param {?} event Event to be checked.
|
|
267
|
+
* @param {...?} modifiers
|
|
268
|
+
* @return {?}
|
|
269
|
+
*/
|
|
270
|
+
function hasModifierKey(event) {
|
|
271
|
+
var modifiers = [];
|
|
272
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
273
|
+
modifiers[_i - 1] = arguments[_i];
|
|
274
|
+
}
|
|
275
|
+
if (modifiers.length) {
|
|
276
|
+
return modifiers.some(function (modifier) { return event[modifier]; });
|
|
277
|
+
}
|
|
278
|
+
return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* @fileoverview added by tsickle
|
|
283
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
253
284
|
*/
|
|
254
285
|
|
|
255
286
|
/**
|
|
256
287
|
* @fileoverview added by tsickle
|
|
257
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
288
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
258
289
|
*/
|
|
259
290
|
|
|
260
|
-
export { MAC_ENTER, BACKSPACE, TAB, NUM_CENTER, ENTER, SHIFT, CONTROL, ALT, PAUSE, CAPS_LOCK, ESCAPE, SPACE, PAGE_UP, PAGE_DOWN, END, HOME, LEFT_ARROW, UP_ARROW, RIGHT_ARROW, DOWN_ARROW, PLUS_SIGN, PRINT_SCREEN, INSERT, DELETE, ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, FF_SEMICOLON, FF_EQUALS, QUESTION_MARK, AT_SIGN, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, CONTEXT_MENU, NUMPAD_ZERO, NUMPAD_ONE, NUMPAD_TWO, NUMPAD_THREE, NUMPAD_FOUR, NUMPAD_FIVE, NUMPAD_SIX, NUMPAD_SEVEN, NUMPAD_EIGHT, NUMPAD_NINE, NUMPAD_MULTIPLY, NUMPAD_PLUS, NUMPAD_MINUS, NUMPAD_PERIOD, NUMPAD_DIVIDE, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, NUM_LOCK, SCROLL_LOCK, FIRST_MEDIA, FF_MINUS, MUTE, VOLUME_DOWN, VOLUME_UP, FF_MUTE, FF_VOLUME_DOWN, LAST_MEDIA, FF_VOLUME_UP, SEMICOLON, EQUALS, COMMA, DASH, SLASH, APOSTROPHE, TILDE, OPEN_SQUARE_BRACKET, BACKSLASH, CLOSE_SQUARE_BRACKET, SINGLE_QUOTE, MAC_META };
|
|
291
|
+
export { MAC_ENTER, BACKSPACE, TAB, NUM_CENTER, ENTER, SHIFT, CONTROL, ALT, PAUSE, CAPS_LOCK, ESCAPE, SPACE, PAGE_UP, PAGE_DOWN, END, HOME, LEFT_ARROW, UP_ARROW, RIGHT_ARROW, DOWN_ARROW, PLUS_SIGN, PRINT_SCREEN, INSERT, DELETE, ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, FF_SEMICOLON, FF_EQUALS, QUESTION_MARK, AT_SIGN, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, CONTEXT_MENU, NUMPAD_ZERO, NUMPAD_ONE, NUMPAD_TWO, NUMPAD_THREE, NUMPAD_FOUR, NUMPAD_FIVE, NUMPAD_SIX, NUMPAD_SEVEN, NUMPAD_EIGHT, NUMPAD_NINE, NUMPAD_MULTIPLY, NUMPAD_PLUS, NUMPAD_MINUS, NUMPAD_PERIOD, NUMPAD_DIVIDE, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, NUM_LOCK, SCROLL_LOCK, FIRST_MEDIA, FF_MINUS, MUTE, VOLUME_DOWN, VOLUME_UP, FF_MUTE, FF_VOLUME_DOWN, LAST_MEDIA, FF_VOLUME_UP, SEMICOLON, EQUALS, COMMA, DASH, SLASH, APOSTROPHE, TILDE, OPEN_SQUARE_BRACKET, BACKSLASH, CLOSE_SQUARE_BRACKET, SINGLE_QUOTE, MAC_META, hasModifierKey };
|
|
261
292
|
//# sourceMappingURL=keycodes.es5.js.map
|
package/esm5/keycodes.es5.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keycodes.es5.js","sources":["../../../src/cdk/keycodes/keycodes.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\nexport const MAC_ENTER = 3;\nexport const BACKSPACE = 8;\nexport const TAB = 9;\nexport const NUM_CENTER = 12;\nexport const ENTER = 13;\nexport const SHIFT = 16;\nexport const CONTROL = 17;\nexport const ALT = 18;\nexport const PAUSE = 19;\nexport const CAPS_LOCK = 20;\nexport const ESCAPE = 27;\nexport const SPACE = 32;\nexport const PAGE_UP = 33;\nexport const PAGE_DOWN = 34;\nexport const END = 35;\nexport const HOME = 36;\nexport const LEFT_ARROW = 37;\nexport const UP_ARROW = 38;\nexport const RIGHT_ARROW = 39;\nexport const DOWN_ARROW = 40;\nexport const PLUS_SIGN = 43;\nexport const PRINT_SCREEN = 44;\nexport const INSERT = 45;\nexport const DELETE = 46;\nexport const ZERO = 48;\nexport const ONE = 49;\nexport const TWO = 50;\nexport const THREE = 51;\nexport const FOUR = 52;\nexport const FIVE = 53;\nexport const SIX = 54;\nexport const SEVEN = 55;\nexport const EIGHT = 56;\nexport const NINE = 57;\nexport const FF_SEMICOLON = 59; // Firefox (Gecko) fires this for semicolon instead of 186\nexport const FF_EQUALS = 61; // Firefox (Gecko) fires this for equals instead of 187\nexport const QUESTION_MARK = 63;\nexport const AT_SIGN = 64;\nexport const A = 65;\nexport const B = 66;\nexport const C = 67;\nexport const D = 68;\nexport const E = 69;\nexport const F = 70;\nexport const G = 71;\nexport const H = 72;\nexport const I = 73;\nexport const J = 74;\nexport const K = 75;\nexport const L = 76;\nexport const M = 77;\nexport const N = 78;\nexport const O = 79;\nexport const P = 80;\nexport const Q = 81;\nexport const R = 82;\nexport const S = 83;\nexport const T = 84;\nexport const U = 85;\nexport const V = 86;\nexport const W = 87;\nexport const X = 88;\nexport const Y = 89;\nexport const Z = 90;\nexport const META = 91; // WIN_KEY_LEFT\nexport const MAC_WK_CMD_LEFT = 91;\nexport const MAC_WK_CMD_RIGHT = 93;\nexport const CONTEXT_MENU = 93;\nexport const NUMPAD_ZERO = 96;\nexport const NUMPAD_ONE = 97;\nexport const NUMPAD_TWO = 98;\nexport const NUMPAD_THREE = 99;\nexport const NUMPAD_FOUR = 100;\nexport const NUMPAD_FIVE = 101;\nexport const NUMPAD_SIX = 102;\nexport const NUMPAD_SEVEN = 103;\nexport const NUMPAD_EIGHT = 104;\nexport const NUMPAD_NINE = 105;\nexport const NUMPAD_MULTIPLY = 106;\nexport const NUMPAD_PLUS = 107;\nexport const NUMPAD_MINUS = 109;\nexport const NUMPAD_PERIOD = 110;\nexport const NUMPAD_DIVIDE = 111;\nexport const F1 = 112;\nexport const F2 = 113;\nexport const F3 = 114;\nexport const F4 = 115;\nexport const F5 = 116;\nexport const F6 = 117;\nexport const F7 = 118;\nexport const F8 = 119;\nexport const F9 = 120;\nexport const F10 = 121;\nexport const F11 = 122;\nexport const F12 = 123;\nexport const NUM_LOCK = 144;\nexport const SCROLL_LOCK = 145;\nexport const FIRST_MEDIA = 166;\nexport const FF_MINUS = 173;\nexport const MUTE = 173; // Firefox (Gecko) fires 181 for MUTE\nexport const VOLUME_DOWN = 174; // Firefox (Gecko) fires 182 for VOLUME_DOWN\nexport const VOLUME_UP = 175; // Firefox (Gecko) fires 183 for VOLUME_UP\nexport const FF_MUTE = 181;\nexport const FF_VOLUME_DOWN = 182;\nexport const LAST_MEDIA = 183;\nexport const FF_VOLUME_UP = 183;\nexport const SEMICOLON = 186; // Firefox (Gecko) fires 59 for SEMICOLON\nexport const EQUALS = 187; // Firefox (Gecko) fires 61 for EQUALS\nexport const COMMA = 188;\nexport const DASH = 189; // Firefox (Gecko) fires 173 for DASH/MINUS\nexport const SLASH = 191;\nexport const APOSTROPHE = 192;\nexport const TILDE = 192;\nexport const OPEN_SQUARE_BRACKET = 219;\nexport const BACKSLASH = 220;\nexport const CLOSE_SQUARE_BRACKET = 221;\nexport const SINGLE_QUOTE = 222;\nexport const MAC_META = 224;\n"],"names":[],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"keycodes.es5.js","sources":["../../../src/cdk/keycodes/modifiers.ts","../../../src/cdk/keycodes/keycodes.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\ntype ModifierKey = 'altKey' | 'shiftKey' | 'ctrlKey' | 'metaKey';\n\n/**\n * Checks whether a modifier key is pressed.\n * @param event Event to be checked.\n */\nexport function hasModifierKey(event: KeyboardEvent, ...modifiers: ModifierKey[]): boolean {\n if (modifiers.length) {\n return modifiers.some(modifier => event[modifier]);\n }\n\n return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey;\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 const MAC_ENTER = 3;\nexport const BACKSPACE = 8;\nexport const TAB = 9;\nexport const NUM_CENTER = 12;\nexport const ENTER = 13;\nexport const SHIFT = 16;\nexport const CONTROL = 17;\nexport const ALT = 18;\nexport const PAUSE = 19;\nexport const CAPS_LOCK = 20;\nexport const ESCAPE = 27;\nexport const SPACE = 32;\nexport const PAGE_UP = 33;\nexport const PAGE_DOWN = 34;\nexport const END = 35;\nexport const HOME = 36;\nexport const LEFT_ARROW = 37;\nexport const UP_ARROW = 38;\nexport const RIGHT_ARROW = 39;\nexport const DOWN_ARROW = 40;\nexport const PLUS_SIGN = 43;\nexport const PRINT_SCREEN = 44;\nexport const INSERT = 45;\nexport const DELETE = 46;\nexport const ZERO = 48;\nexport const ONE = 49;\nexport const TWO = 50;\nexport const THREE = 51;\nexport const FOUR = 52;\nexport const FIVE = 53;\nexport const SIX = 54;\nexport const SEVEN = 55;\nexport const EIGHT = 56;\nexport const NINE = 57;\nexport const FF_SEMICOLON = 59; // Firefox (Gecko) fires this for semicolon instead of 186\nexport const FF_EQUALS = 61; // Firefox (Gecko) fires this for equals instead of 187\nexport const QUESTION_MARK = 63;\nexport const AT_SIGN = 64;\nexport const A = 65;\nexport const B = 66;\nexport const C = 67;\nexport const D = 68;\nexport const E = 69;\nexport const F = 70;\nexport const G = 71;\nexport const H = 72;\nexport const I = 73;\nexport const J = 74;\nexport const K = 75;\nexport const L = 76;\nexport const M = 77;\nexport const N = 78;\nexport const O = 79;\nexport const P = 80;\nexport const Q = 81;\nexport const R = 82;\nexport const S = 83;\nexport const T = 84;\nexport const U = 85;\nexport const V = 86;\nexport const W = 87;\nexport const X = 88;\nexport const Y = 89;\nexport const Z = 90;\nexport const META = 91; // WIN_KEY_LEFT\nexport const MAC_WK_CMD_LEFT = 91;\nexport const MAC_WK_CMD_RIGHT = 93;\nexport const CONTEXT_MENU = 93;\nexport const NUMPAD_ZERO = 96;\nexport const NUMPAD_ONE = 97;\nexport const NUMPAD_TWO = 98;\nexport const NUMPAD_THREE = 99;\nexport const NUMPAD_FOUR = 100;\nexport const NUMPAD_FIVE = 101;\nexport const NUMPAD_SIX = 102;\nexport const NUMPAD_SEVEN = 103;\nexport const NUMPAD_EIGHT = 104;\nexport const NUMPAD_NINE = 105;\nexport const NUMPAD_MULTIPLY = 106;\nexport const NUMPAD_PLUS = 107;\nexport const NUMPAD_MINUS = 109;\nexport const NUMPAD_PERIOD = 110;\nexport const NUMPAD_DIVIDE = 111;\nexport const F1 = 112;\nexport const F2 = 113;\nexport const F3 = 114;\nexport const F4 = 115;\nexport const F5 = 116;\nexport const F6 = 117;\nexport const F7 = 118;\nexport const F8 = 119;\nexport const F9 = 120;\nexport const F10 = 121;\nexport const F11 = 122;\nexport const F12 = 123;\nexport const NUM_LOCK = 144;\nexport const SCROLL_LOCK = 145;\nexport const FIRST_MEDIA = 166;\nexport const FF_MINUS = 173;\nexport const MUTE = 173; // Firefox (Gecko) fires 181 for MUTE\nexport const VOLUME_DOWN = 174; // Firefox (Gecko) fires 182 for VOLUME_DOWN\nexport const VOLUME_UP = 175; // Firefox (Gecko) fires 183 for VOLUME_UP\nexport const FF_MUTE = 181;\nexport const FF_VOLUME_DOWN = 182;\nexport const LAST_MEDIA = 183;\nexport const FF_VOLUME_UP = 183;\nexport const SEMICOLON = 186; // Firefox (Gecko) fires 59 for SEMICOLON\nexport const EQUALS = 187; // Firefox (Gecko) fires 61 for EQUALS\nexport const COMMA = 188;\nexport const DASH = 189; // Firefox (Gecko) fires 173 for DASH/MINUS\nexport const SLASH = 191;\nexport const APOSTROPHE = 192;\nexport const TILDE = 192;\nexport const OPEN_SQUARE_BRACKET = 219;\nexport const BACKSLASH = 220;\nexport const CLOSE_SQUARE_BRACKET = 221;\nexport const SINGLE_QUOTE = 222;\nexport const MAC_META = 224;\n"],"names":[],"mappings":";;;;;;;;;;;;;ACQA,AAAA,IAAa,SAAS,GAAG,CAAC,CAA1B;;AACA,AAAA,IAAa,SAAS,GAAG,CAAC,CAA1B;;AACA,AAAA,IAAa,GAAG,GAAG,CAAC,CAApB;;AACA,AAAA,IAAa,UAAU,GAAG,EAAE,CAA5B;;AACA,AAAA,IAAa,KAAK,GAAG,EAAE,CAAvB;;AACA,AAAA,IAAa,KAAK,GAAG,EAAE,CAAvB;;AACA,AAAA,IAAa,OAAO,GAAG,EAAE,CAAzB;;AACA,AAAA,IAAa,GAAG,GAAG,EAAE,CAArB;;AACA,AAAA,IAAa,KAAK,GAAG,EAAE,CAAvB;;AACA,AAAA,IAAa,SAAS,GAAG,EAAE,CAA3B;;AACA,AAAA,IAAa,MAAM,GAAG,EAAE,CAAxB;;AACA,AAAA,IAAa,KAAK,GAAG,EAAE,CAAvB;;AACA,AAAA,IAAa,OAAO,GAAG,EAAE,CAAzB;;AACA,AAAA,IAAa,SAAS,GAAG,EAAE,CAA3B;;AACA,AAAA,IAAa,GAAG,GAAG,EAAE,CAArB;;AACA,AAAA,IAAa,IAAI,GAAG,EAAE,CAAtB;;AACA,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AK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC;CACzE;;;;;;;;;;;;;;"}
|
package/esm5/layout.es5.js
CHANGED
|
@@ -13,7 +13,7 @@ import { coerceArray } from '@angular/cdk/coercion';
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @fileoverview added by tsickle
|
|
16
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
16
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
17
17
|
*/
|
|
18
18
|
var LayoutModule = /** @class */ (function () {
|
|
19
19
|
function LayoutModule() {
|
|
@@ -26,15 +26,17 @@ var LayoutModule = /** @class */ (function () {
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* @fileoverview added by tsickle
|
|
29
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
29
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
30
30
|
*/
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
32
|
* Global registry for all dynamically-created, injected media queries.
|
|
33
|
-
|
|
33
|
+
* @type {?}
|
|
34
|
+
*/
|
|
34
35
|
var mediaQueriesForWebkitCompatibility = new Set();
|
|
35
|
-
/**
|
|
36
|
+
/**
|
|
36
37
|
* Style tag that holds all of the dynamically-created media queries.
|
|
37
|
-
|
|
38
|
+
* @type {?}
|
|
39
|
+
*/
|
|
38
40
|
var mediaQueryStyleNode;
|
|
39
41
|
/**
|
|
40
42
|
* A utility for calling matchMedia queries.
|
|
@@ -99,11 +101,11 @@ function createEmptyStyleRule(query) {
|
|
|
99
101
|
try {
|
|
100
102
|
if (!mediaQueryStyleNode) {
|
|
101
103
|
mediaQueryStyleNode = document.createElement('style');
|
|
102
|
-
mediaQueryStyleNode.setAttribute('type', 'text/css');
|
|
103
|
-
((document.head)).appendChild(mediaQueryStyleNode);
|
|
104
|
+
mediaQueryStyleNode.setAttribute('type', 'text/css');
|
|
105
|
+
(/** @type {?} */ (document.head)).appendChild(mediaQueryStyleNode);
|
|
104
106
|
}
|
|
105
107
|
if (mediaQueryStyleNode.sheet) {
|
|
106
|
-
(/** @type {?} */ (mediaQueryStyleNode.sheet))
|
|
108
|
+
((/** @type {?} */ (mediaQueryStyleNode.sheet)))
|
|
107
109
|
.insertRule("@media " + query + " {.fx-query-test{ }}", 0);
|
|
108
110
|
mediaQueriesForWebkitCompatibility.add(query);
|
|
109
111
|
}
|
|
@@ -120,17 +122,17 @@ function createEmptyStyleRule(query) {
|
|
|
120
122
|
function noopMatchMedia(query) {
|
|
121
123
|
// Use `as any` here to avoid adding additional necessary properties for
|
|
122
124
|
// the noop matcher.
|
|
123
|
-
return /** @type {?} */ ({
|
|
125
|
+
return (/** @type {?} */ ({
|
|
124
126
|
matches: query === 'all' || query === '',
|
|
125
127
|
media: query,
|
|
126
128
|
addListener: function () { },
|
|
127
129
|
removeListener: function () { }
|
|
128
|
-
});
|
|
130
|
+
}));
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
/**
|
|
132
134
|
* @fileoverview added by tsickle
|
|
133
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
135
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
134
136
|
*/
|
|
135
137
|
/**
|
|
136
138
|
* Utility for checking the matching state of \@media queries.
|
|
@@ -219,13 +221,16 @@ var BreakpointObserver = /** @class */ (function () {
|
|
|
219
221
|
return response;
|
|
220
222
|
}));
|
|
221
223
|
};
|
|
224
|
+
/** Registers a specific query to be listened for. */
|
|
222
225
|
/**
|
|
223
226
|
* Registers a specific query to be listened for.
|
|
227
|
+
* @private
|
|
224
228
|
* @param {?} query
|
|
225
229
|
* @return {?}
|
|
226
230
|
*/
|
|
227
231
|
BreakpointObserver.prototype._registerQuery = /**
|
|
228
232
|
* Registers a specific query to be listened for.
|
|
233
|
+
* @private
|
|
229
234
|
* @param {?} query
|
|
230
235
|
* @return {?}
|
|
231
236
|
*/
|
|
@@ -233,12 +238,15 @@ var BreakpointObserver = /** @class */ (function () {
|
|
|
233
238
|
var _this = this;
|
|
234
239
|
// Only set up a new MediaQueryList if it is not already being listened for.
|
|
235
240
|
if (this._queries.has(query)) {
|
|
236
|
-
return /** @type {?} */ (
|
|
241
|
+
return (/** @type {?} */ (this._queries.get(query)));
|
|
237
242
|
}
|
|
238
243
|
/** @type {?} */
|
|
239
244
|
var mql = this.mediaMatcher.matchMedia(query);
|
|
245
|
+
// TODO(jelbourn): change this `any` to `MediaQueryListEvent` once Google has upgraded to
|
|
246
|
+
// TypeScript 3.1 (the type is unavailable before then).
|
|
240
247
|
/** @type {?} */
|
|
241
248
|
var queryListener;
|
|
249
|
+
// Create callback for match changes and add it is as a listener.
|
|
242
250
|
/** @type {?} */
|
|
243
251
|
var queryObservable = fromEventPattern(
|
|
244
252
|
// Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed
|
|
@@ -246,16 +254,12 @@ var BreakpointObserver = /** @class */ (function () {
|
|
|
246
254
|
// webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not
|
|
247
255
|
// have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js
|
|
248
256
|
// patches it.
|
|
249
|
-
// Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed
|
|
250
|
-
// back into the zone because matchMedia is only included in Zone.js by loading the
|
|
251
|
-
// webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not
|
|
252
|
-
// have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js
|
|
253
|
-
// patches it.
|
|
254
257
|
function (listener) {
|
|
255
258
|
queryListener = function (e) { return _this.zone.run(function () { return listener(e); }); };
|
|
256
259
|
mql.addListener(queryListener);
|
|
257
260
|
}, function () { return mql.removeListener(queryListener); })
|
|
258
|
-
.pipe(
|
|
261
|
+
.pipe(startWith(mql), map(function (nextMql) { return ({ query: query, matches: nextMql.matches }); }), takeUntil(this._destroySubject));
|
|
262
|
+
// Add the MediaQueryList to the set of queries.
|
|
259
263
|
/** @type {?} */
|
|
260
264
|
var output = { observable: queryObservable, mql: mql };
|
|
261
265
|
this._queries.set(query, output);
|
|
@@ -286,15 +290,18 @@ function splitQueries(queries) {
|
|
|
286
290
|
|
|
287
291
|
/**
|
|
288
292
|
* @fileoverview added by tsickle
|
|
289
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
293
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
290
294
|
*/
|
|
291
|
-
|
|
295
|
+
// PascalCase is being used as Breakpoints is used like an enum.
|
|
296
|
+
// tslint:disable-next-line:variable-name
|
|
297
|
+
/**
|
|
292
298
|
* @license
|
|
293
299
|
* Copyright Google LLC All Rights Reserved.
|
|
294
300
|
*
|
|
295
301
|
* Use of this source code is governed by an MIT-style license that can be
|
|
296
302
|
* found in the LICENSE file at https://angular.io/license
|
|
297
|
-
|
|
303
|
+
* @type {?}
|
|
304
|
+
*/
|
|
298
305
|
var Breakpoints = {
|
|
299
306
|
XSmall: '(max-width: 599.99px)',
|
|
300
307
|
Small: '(min-width: 600px) and (max-width: 959.99px)',
|
|
@@ -317,12 +324,12 @@ var Breakpoints = {
|
|
|
317
324
|
|
|
318
325
|
/**
|
|
319
326
|
* @fileoverview added by tsickle
|
|
320
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
327
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
321
328
|
*/
|
|
322
329
|
|
|
323
330
|
/**
|
|
324
331
|
* @fileoverview added by tsickle
|
|
325
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
332
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
326
333
|
*/
|
|
327
334
|
|
|
328
335
|
export { LayoutModule, BreakpointObserver, Breakpoints, MediaMatcher };
|
package/esm5/layout.es5.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es5.js","sources":["../../../src/cdk/layout/breakpoints.ts","../../../src/cdk/layout/breakpoints-observer.ts","../../../src/cdk/layout/media-matcher.ts","../../../src/cdk/layout/layout-module.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// PascalCase is being used as Breakpoints is used like an enum.\n// tslint:disable-next-line:variable-name\nexport const Breakpoints = {\n XSmall: '(max-width: 599.99px)',\n Small: '(min-width: 600px) and (max-width: 959.99px)',\n Medium: '(min-width: 960px) and (max-width: 1279.99px)',\n Large: '(min-width: 1280px) and (max-width: 1919.99px)',\n XLarge: '(min-width: 1920px)',\n\n Handset: '(max-width: 599.99px) and (orientation: portrait), ' +\n '(max-width: 959.99px) and (orientation: landscape)',\n Tablet: '(min-width: 600px) and (max-width: 839.99px) and (orientation: portrait), ' +\n '(min-width: 960px) and (max-width: 1279.99px) and (orientation: landscape)',\n Web: '(min-width: 840px) and (orientation: portrait), ' +\n '(min-width: 1280px) and (orientation: landscape)',\n\n HandsetPortrait: '(max-width: 599.99px) and (orientation: portrait)',\n TabletPortrait: '(min-width: 600px) and (max-width: 839.99px) and (orientation: portrait)',\n WebPortrait: '(min-width: 840px) and (orientation: portrait)',\n\n HandsetLandscape: '(max-width: 959.99px) and (orientation: landscape)',\n TabletLandscape: '(min-width: 960px) and (max-width: 1279.99px) and (orientation: landscape)',\n WebLandscape: '(min-width: 1280px) and (orientation: landscape)',\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 {Injectable, NgZone, OnDestroy} from '@angular/core';\nimport {MediaMatcher} from './media-matcher';\nimport {asapScheduler, combineLatest, fromEventPattern, Observable, Subject} from 'rxjs';\nimport {debounceTime, map, startWith, takeUntil} from 'rxjs/operators';\nimport {coerceArray} from '@angular/cdk/coercion';\n\n\n/** The current state of a layout breakpoint. */\nexport interface BreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /**\n * A key boolean pair for each query provided to the observe method,\n * with its current matched state.\n */\n breakpoints: {\n [key: string]: boolean;\n };\n}\n\n/** The current state of a layout breakpoint. */\ninterface InternalBreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /** The media query being to be matched */\n query: string;\n}\n\ninterface Query {\n observable: Observable<InternalBreakpointState>;\n mql: MediaQueryList;\n}\n\n/** Utility for checking the matching state of @media queries. */\n@Injectable({providedIn: 'root'})\nexport class BreakpointObserver implements OnDestroy {\n /** A map of all media queries currently being listened for. */\n private _queries = new Map<string, Query>();\n /** A subject for all other observables to takeUntil based on. */\n private _destroySubject = new Subject<void>();\n\n constructor(private mediaMatcher: MediaMatcher, private zone: NgZone) {}\n\n /** Completes the active subject, signalling to all other observables to complete. */\n ngOnDestroy() {\n this._destroySubject.next();\n this._destroySubject.complete();\n }\n\n /**\n * Whether one or more media queries match the current viewport size.\n * @param value One or more media queries to check.\n * @returns Whether any of the media queries match.\n */\n isMatched(value: string | string[]): boolean {\n const queries = splitQueries(coerceArray(value));\n return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);\n }\n\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param value One or more media queries to check.\n * @returns A stream of matches for the given queries.\n */\n observe(value: string | string[]): Observable<BreakpointState> {\n const queries = splitQueries(coerceArray(value));\n const observables = queries.map(query => this._registerQuery(query).observable);\n\n return combineLatest(observables).pipe(\n debounceTime(0, asapScheduler),\n map((breakpointStates: InternalBreakpointState[]) => {\n const response: BreakpointState = {\n matches: false,\n breakpoints: {},\n };\n breakpointStates.forEach((state: InternalBreakpointState) => {\n response.matches = response.matches || state.matches;\n response.breakpoints[state.query] = state.matches;\n });\n return response;\n }));\n }\n\n /** Registers a specific query to be listened for. */\n private _registerQuery(query: string): Query {\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return this._queries.get(query)!;\n }\n\n const mql: MediaQueryList = this.mediaMatcher.matchMedia(query);\n\n // TODO(jelbourn): change this `any` to `MediaQueryListEvent` once Google has upgraded to\n // TypeScript 3.1 (the type is unavailable before then).\n let queryListener: any;\n\n // Create callback for match changes and add it is as a listener.\n const queryObservable = fromEventPattern<MediaQueryList>(\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n (listener: Function) => {\n queryListener = (e: any) => this.zone.run(() => listener(e));\n mql.addListener(queryListener);\n },\n () => mql.removeListener(queryListener))\n .pipe(\n takeUntil(this._destroySubject),\n startWith(mql),\n map((nextMql: MediaQueryList) => ({query, matches: nextMql.matches}))\n );\n\n // Add the MediaQueryList to the set of queries.\n const output = {observable: queryObservable, mql};\n this._queries.set(query, output);\n return output;\n }\n}\n\n/**\n * Split each query string into separate query strings if two queries are provided as comma\n * separated.\n */\nfunction splitQueries(queries: string[]): string[] {\n return queries.map((query: string) => query.split(','))\n .reduce((a1: string[], a2: string[]) => a1.concat(a2))\n .map(query => query.trim());\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 */\nimport {Injectable} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\n@Injectable({providedIn: 'root'})\nexport class MediaMatcher {\n /** The internal matchMedia method to return back a MediaQueryList like object. */\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor(private platform: Platform) {\n this._matchMedia = this.platform.isBrowser && window.matchMedia ?\n // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window) :\n noopMatchMedia;\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this.platform.WEBKIT) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * For Webkit engines that only trigger the MediaQueryListListener when\n * there is at least one CSS selector for the respective media query.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head!.appendChild(mediaQueryStyleNode);\n }\n\n if (mediaQueryStyleNode.sheet) {\n (mediaQueryStyleNode.sheet as CSSStyleSheet)\n .insertRule(`@media ${query} {.fx-query-test{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n console.error(e);\n }\n}\n\n/** No-op matchMedia replacement for non-browser platforms. */\nfunction noopMatchMedia(query: string): MediaQueryList {\n // Use `as any` here to avoid adding additional necessary properties for\n // the noop matcher.\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: () => {},\n removeListener: () => {}\n } as any;\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 */\nimport {NgModule} from '@angular/core';\n\n\n@NgModule({})\nexport class LayoutModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AGOA;;;;QAGA,EAAA,IAAA,EAAC,QAAQ,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CAAC;SACxC,MAAM,CAAC,UAAC,EAAY,EAAE,EAAY,EAAnD,EAAwD,OAAA,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAArE,EAAqE,CAAC;SACrD,GAAG,CAAC,UAAA,KAAK,EAA1B,EAA8B,OAAA,KAAK,CAAC,IAAI,EAAE,CAA1C,EAA0C,CAAC,CAAC;CAC3C;;;;;;;;;;;;;ADjID,AAAA,IAAa,WAAW,GAAG;IACzB,MAAM,EAAE,uBAAuB;IAC/B,KAAK,EAAE,8CAA8C;IACrD,MAAM,EAAE,+CAA+C;IACvD,KAAK,EAAE,gDAAgD;IACvD,MAAM,EAAE,qBAAqB;IAE7B,OAAO,EAAE,qDAAqD;QACrD,oDAAoD;IAC7D,MAAM,EAAE,4EAA4E;QAC5E,4EAA4E;IACpF,GAAG,EAAE,kDAAkD;QAClD,kDAAkD;IAEvD,eAAe,EAAE,mDAAmD;IACpE,cAAc,EAAE,0EAA0E;IAC1F,WAAW,EAAE,gDAAgD;IAE7D,gBAAgB,EAAE,oDAAoD;IACtE,eAAe,EAAE,4EAA4E;IAC7F,YAAY,EAAE,kDAAkD;CACjE;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"layout.es5.js","sources":["../../../src/cdk/layout/breakpoints.ts","../../../src/cdk/layout/breakpoints-observer.ts","../../../src/cdk/layout/media-matcher.ts","../../../src/cdk/layout/layout-module.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// PascalCase is being used as Breakpoints is used like an enum.\n// tslint:disable-next-line:variable-name\nexport const Breakpoints = {\n XSmall: '(max-width: 599.99px)',\n Small: '(min-width: 600px) and (max-width: 959.99px)',\n Medium: '(min-width: 960px) and (max-width: 1279.99px)',\n Large: '(min-width: 1280px) and (max-width: 1919.99px)',\n XLarge: '(min-width: 1920px)',\n\n Handset: '(max-width: 599.99px) and (orientation: portrait), ' +\n '(max-width: 959.99px) and (orientation: landscape)',\n Tablet: '(min-width: 600px) and (max-width: 839.99px) and (orientation: portrait), ' +\n '(min-width: 960px) and (max-width: 1279.99px) and (orientation: landscape)',\n Web: '(min-width: 840px) and (orientation: portrait), ' +\n '(min-width: 1280px) and (orientation: landscape)',\n\n HandsetPortrait: '(max-width: 599.99px) and (orientation: portrait)',\n TabletPortrait: '(min-width: 600px) and (max-width: 839.99px) and (orientation: portrait)',\n WebPortrait: '(min-width: 840px) and (orientation: portrait)',\n\n HandsetLandscape: '(max-width: 959.99px) and (orientation: landscape)',\n TabletLandscape: '(min-width: 960px) and (max-width: 1279.99px) and (orientation: landscape)',\n WebLandscape: '(min-width: 1280px) and (orientation: landscape)',\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 {Injectable, NgZone, OnDestroy} from '@angular/core';\nimport {MediaMatcher} from './media-matcher';\nimport {asapScheduler, combineLatest, fromEventPattern, Observable, Subject} from 'rxjs';\nimport {debounceTime, map, startWith, takeUntil} from 'rxjs/operators';\nimport {coerceArray} from '@angular/cdk/coercion';\n\n\n/** The current state of a layout breakpoint. */\nexport interface BreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /**\n * A key boolean pair for each query provided to the observe method,\n * with its current matched state.\n */\n breakpoints: {\n [key: string]: boolean;\n };\n}\n\n/** The current state of a layout breakpoint. */\ninterface InternalBreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /** The media query being to be matched */\n query: string;\n}\n\ninterface Query {\n observable: Observable<InternalBreakpointState>;\n mql: MediaQueryList;\n}\n\n/** Utility for checking the matching state of @media queries. */\n@Injectable({providedIn: 'root'})\nexport class BreakpointObserver implements OnDestroy {\n /** A map of all media queries currently being listened for. */\n private _queries = new Map<string, Query>();\n /** A subject for all other observables to takeUntil based on. */\n private _destroySubject = new Subject<void>();\n\n constructor(private mediaMatcher: MediaMatcher, private zone: NgZone) {}\n\n /** Completes the active subject, signalling to all other observables to complete. */\n ngOnDestroy() {\n this._destroySubject.next();\n this._destroySubject.complete();\n }\n\n /**\n * Whether one or more media queries match the current viewport size.\n * @param value One or more media queries to check.\n * @returns Whether any of the media queries match.\n */\n isMatched(value: string | string[]): boolean {\n const queries = splitQueries(coerceArray(value));\n return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);\n }\n\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param value One or more media queries to check.\n * @returns A stream of matches for the given queries.\n */\n observe(value: string | string[]): Observable<BreakpointState> {\n const queries = splitQueries(coerceArray(value));\n const observables = queries.map(query => this._registerQuery(query).observable);\n\n return combineLatest(observables).pipe(\n debounceTime(0, asapScheduler),\n map((breakpointStates: InternalBreakpointState[]) => {\n const response: BreakpointState = {\n matches: false,\n breakpoints: {},\n };\n breakpointStates.forEach((state: InternalBreakpointState) => {\n response.matches = response.matches || state.matches;\n response.breakpoints[state.query] = state.matches;\n });\n return response;\n }));\n }\n\n /** Registers a specific query to be listened for. */\n private _registerQuery(query: string): Query {\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return this._queries.get(query)!;\n }\n\n const mql: MediaQueryList = this.mediaMatcher.matchMedia(query);\n\n // TODO(jelbourn): change this `any` to `MediaQueryListEvent` once Google has upgraded to\n // TypeScript 3.1 (the type is unavailable before then).\n let queryListener: any;\n\n // Create callback for match changes and add it is as a listener.\n const queryObservable = fromEventPattern<MediaQueryList>(\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n (listener: Function) => {\n queryListener = (e: any) => this.zone.run(() => listener(e));\n mql.addListener(queryListener);\n },\n () => mql.removeListener(queryListener))\n .pipe(\n startWith(mql),\n map((nextMql: MediaQueryList) => ({query, matches: nextMql.matches})),\n takeUntil(this._destroySubject)\n );\n\n // Add the MediaQueryList to the set of queries.\n const output = {observable: queryObservable, mql};\n this._queries.set(query, output);\n return output;\n }\n}\n\n/**\n * Split each query string into separate query strings if two queries are provided as comma\n * separated.\n */\nfunction splitQueries(queries: string[]): string[] {\n return queries.map((query: string) => query.split(','))\n .reduce((a1: string[], a2: string[]) => a1.concat(a2))\n .map(query => query.trim());\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 */\nimport {Injectable} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\n@Injectable({providedIn: 'root'})\nexport class MediaMatcher {\n /** The internal matchMedia method to return back a MediaQueryList like object. */\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor(private platform: Platform) {\n this._matchMedia = this.platform.isBrowser && window.matchMedia ?\n // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window) :\n noopMatchMedia;\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this.platform.WEBKIT) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * For Webkit engines that only trigger the MediaQueryListListener when\n * there is at least one CSS selector for the respective media query.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head!.appendChild(mediaQueryStyleNode);\n }\n\n if (mediaQueryStyleNode.sheet) {\n (mediaQueryStyleNode.sheet as CSSStyleSheet)\n .insertRule(`@media ${query} {.fx-query-test{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n console.error(e);\n }\n}\n\n/** No-op matchMedia replacement for non-browser platforms. */\nfunction noopMatchMedia(query: string): MediaQueryList {\n // Use `as any` here to avoid adding additional necessary properties for\n // the noop matcher.\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: () => {},\n removeListener: () => {}\n } as any;\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 */\nimport {NgModule} from '@angular/core';\n\n\n@NgModule({})\nexport class LayoutModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AGUA,IAAA,YAAA,kBAAA,YAAA;IAAA,SAAA,YAAA,GAAA;KAC4B;;QAD5B,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU,EAAE,EAAZ,EAAA;;IAC2B,OAA3B,YAA4B,CAA5B;CAA4B,EAA5B,CAAA;;;;;;;;;;ADAA,IAAM,kCAAkC,GAAgB,IAAI,GAAG,EAAU,CAAzE;;;;;AAGA,IAAI,mBAAiD,CAArD;;;;AAGA,AAAA,IAAA,YAAA,kBAAA,YAAA;IAKE,SAAF,YAAA,CAAsB,QAAkB,EAAxC;QAAsB,IAAtB,CAAA,QAA8B,GAAR,QAAQ,CAAU;QACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,IAAI,MAAM,CAAC,UAAU;;;YAG7D,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9B,cAAc,CAAC;KAClB;;;;;;;;;;;;;;;IAQD,YAAF,CAAA,SAAA,CAAA,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,EAAE,+CAA+C;IACvD,KAAK,EAAE,gDAAgD;IACvD,MAAM,EAAE,qBAAqB;IAE7B,OAAO,EAAE,qDAAqD;QACrD,oDAAoD;IAC7D,MAAM,EAAE,4EAA4E;QAC5E,4EAA4E;IACpF,GAAG,EAAE,kDAAkD;QAClD,kDAAkD;IAEvD,eAAe,EAAE,mDAAmD;IACpE,cAAc,EAAE,0EAA0E;IAC1F,WAAW,EAAE,gDAAgD;IAE7D,gBAAgB,EAAE,oDAAoD;IACtE,eAAe,EAAE,4EAA4E;IAC7F,YAAY,EAAE,kDAAkD;CACjE;;;;;;;;;;;;;;"}
|
package/esm5/observers.es5.js
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
8
|
+
import { coerceBooleanProperty, coerceNumberProperty, coerceElement } from '@angular/cdk/coercion';
|
|
9
9
|
import { Directive, ElementRef, EventEmitter, Injectable, Input, NgModule, NgZone, Output, defineInjectable, inject } from '@angular/core';
|
|
10
10
|
import { Observable, Subject } from 'rxjs';
|
|
11
11
|
import { debounceTime } from 'rxjs/operators';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @fileoverview added by tsickle
|
|
15
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
15
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
18
|
* Factory that creates a new MutationObserver and allows us to stub it out in unit tests.
|
|
@@ -70,7 +70,7 @@ var ContentObserver = /** @class */ (function () {
|
|
|
70
70
|
function (elementOrRef) {
|
|
71
71
|
var _this = this;
|
|
72
72
|
/** @type {?} */
|
|
73
|
-
var element = elementOrRef
|
|
73
|
+
var element = coerceElement(elementOrRef);
|
|
74
74
|
return Observable.create(function (observer) {
|
|
75
75
|
/** @type {?} */
|
|
76
76
|
var stream = _this._observeElement(element);
|
|
@@ -85,12 +85,18 @@ var ContentObserver = /** @class */ (function () {
|
|
|
85
85
|
/**
|
|
86
86
|
* Observes the given element by using the existing MutationObserver if available, or creating a
|
|
87
87
|
* new one if not.
|
|
88
|
+
*/
|
|
89
|
+
/**
|
|
90
|
+
* Observes the given element by using the existing MutationObserver if available, or creating a
|
|
91
|
+
* new one if not.
|
|
92
|
+
* @private
|
|
88
93
|
* @param {?} element
|
|
89
94
|
* @return {?}
|
|
90
95
|
*/
|
|
91
96
|
ContentObserver.prototype._observeElement = /**
|
|
92
97
|
* Observes the given element by using the existing MutationObserver if available, or creating a
|
|
93
98
|
* new one if not.
|
|
99
|
+
* @private
|
|
94
100
|
* @param {?} element
|
|
95
101
|
* @return {?}
|
|
96
102
|
*/
|
|
@@ -110,43 +116,52 @@ var ContentObserver = /** @class */ (function () {
|
|
|
110
116
|
this._observedElements.set(element, { observer: observer, stream: stream_1, count: 1 });
|
|
111
117
|
}
|
|
112
118
|
else {
|
|
113
|
-
/** @type {?} */ (
|
|
119
|
+
(/** @type {?} */ (this._observedElements.get(element))).count++;
|
|
114
120
|
}
|
|
115
|
-
return /** @type {?} */ (
|
|
121
|
+
return (/** @type {?} */ (this._observedElements.get(element))).stream;
|
|
116
122
|
};
|
|
117
123
|
/**
|
|
118
124
|
* Un-observes the given element and cleans up the underlying MutationObserver if nobody else is
|
|
119
125
|
* observing this element.
|
|
126
|
+
*/
|
|
127
|
+
/**
|
|
128
|
+
* Un-observes the given element and cleans up the underlying MutationObserver if nobody else is
|
|
129
|
+
* observing this element.
|
|
130
|
+
* @private
|
|
120
131
|
* @param {?} element
|
|
121
132
|
* @return {?}
|
|
122
133
|
*/
|
|
123
134
|
ContentObserver.prototype._unobserveElement = /**
|
|
124
135
|
* Un-observes the given element and cleans up the underlying MutationObserver if nobody else is
|
|
125
136
|
* observing this element.
|
|
137
|
+
* @private
|
|
126
138
|
* @param {?} element
|
|
127
139
|
* @return {?}
|
|
128
140
|
*/
|
|
129
141
|
function (element) {
|
|
130
142
|
if (this._observedElements.has(element)) {
|
|
131
|
-
/** @type {?} */ (
|
|
132
|
-
if (
|
|
143
|
+
(/** @type {?} */ (this._observedElements.get(element))).count--;
|
|
144
|
+
if (!(/** @type {?} */ (this._observedElements.get(element))).count) {
|
|
133
145
|
this._cleanupObserver(element);
|
|
134
146
|
}
|
|
135
147
|
}
|
|
136
148
|
};
|
|
149
|
+
/** Clean up the underlying MutationObserver for the specified element. */
|
|
137
150
|
/**
|
|
138
151
|
* Clean up the underlying MutationObserver for the specified element.
|
|
152
|
+
* @private
|
|
139
153
|
* @param {?} element
|
|
140
154
|
* @return {?}
|
|
141
155
|
*/
|
|
142
156
|
ContentObserver.prototype._cleanupObserver = /**
|
|
143
157
|
* Clean up the underlying MutationObserver for the specified element.
|
|
158
|
+
* @private
|
|
144
159
|
* @param {?} element
|
|
145
160
|
* @return {?}
|
|
146
161
|
*/
|
|
147
162
|
function (element) {
|
|
148
163
|
if (this._observedElements.has(element)) {
|
|
149
|
-
var _a = /** @type {?} */ (
|
|
164
|
+
var _a = (/** @type {?} */ (this._observedElements.get(element))), observer = _a.observer, stream = _a.stream;
|
|
150
165
|
if (observer) {
|
|
151
166
|
observer.disconnect();
|
|
152
167
|
}
|
|
@@ -241,9 +256,11 @@ var CdkObserveContent = /** @class */ (function () {
|
|
|
241
256
|
this._unsubscribe();
|
|
242
257
|
};
|
|
243
258
|
/**
|
|
259
|
+
* @private
|
|
244
260
|
* @return {?}
|
|
245
261
|
*/
|
|
246
262
|
CdkObserveContent.prototype._subscribe = /**
|
|
263
|
+
* @private
|
|
247
264
|
* @return {?}
|
|
248
265
|
*/
|
|
249
266
|
function () {
|
|
@@ -261,9 +278,11 @@ var CdkObserveContent = /** @class */ (function () {
|
|
|
261
278
|
});
|
|
262
279
|
};
|
|
263
280
|
/**
|
|
281
|
+
* @private
|
|
264
282
|
* @return {?}
|
|
265
283
|
*/
|
|
266
284
|
CdkObserveContent.prototype._unsubscribe = /**
|
|
285
|
+
* @private
|
|
267
286
|
* @return {?}
|
|
268
287
|
*/
|
|
269
288
|
function () {
|
|
@@ -305,12 +324,12 @@ var ObserversModule = /** @class */ (function () {
|
|
|
305
324
|
|
|
306
325
|
/**
|
|
307
326
|
* @fileoverview added by tsickle
|
|
308
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
327
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
309
328
|
*/
|
|
310
329
|
|
|
311
330
|
/**
|
|
312
331
|
* @fileoverview added by tsickle
|
|
313
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
332
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
314
333
|
*/
|
|
315
334
|
|
|
316
335
|
export { MutationObserverFactory, ContentObserver, CdkObserveContent, ObserversModule };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observers.es5.js","sources":["../../../src/cdk/observers/observe-content.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\nimport {coerceBooleanProperty, coerceNumberProperty} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {Observable, Subject, Subscription, Observer} from 'rxjs';\nimport {debounceTime} from 'rxjs/operators';\n\n/**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class MutationObserverFactory {\n create(callback: MutationCallback): MutationObserver | null {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n }\n}\n\n\n/** An injectable service that allows watching elements for changes to their content. */\n@Injectable({providedIn: 'root'})\nexport class ContentObserver implements OnDestroy {\n /** Keeps track of the existing MutationObservers so they can be reused. */\n private _observedElements = new Map<Element, {\n observer: MutationObserver | null,\n stream: Subject<MutationRecord[]>,\n count: number\n }>();\n\n constructor(private _mutationObserverFactory: MutationObserverFactory) {}\n\n ngOnDestroy() {\n this._observedElements.forEach((_, element) => this._cleanupObserver(element));\n }\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: Element): Observable<MutationRecord[]>;\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: ElementRef<Element>): Observable<MutationRecord[]>;\n\n observe(elementOrRef: Element | ElementRef<Element>): Observable<MutationRecord[]> {\n const element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n\n return Observable.create((observer: Observer<MutationRecord[]>) => {\n const stream = this._observeElement(element);\n const subscription = stream.subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n this._unobserveElement(element);\n };\n });\n }\n\n /**\n * Observes the given element by using the existing MutationObserver if available, or creating a\n * new one if not.\n */\n private _observeElement(element: Element): Subject<MutationRecord[]> {\n if (!this._observedElements.has(element)) {\n const stream = new Subject<MutationRecord[]>();\n const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));\n if (observer) {\n observer.observe(element, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n this._observedElements.set(element, {observer, stream, count: 1});\n } else {\n this._observedElements.get(element)!.count++;\n }\n return this._observedElements.get(element)!.stream;\n }\n\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n private _unobserveElement(element: Element) {\n if (this._observedElements.has(element)) {\n this._observedElements.get(element)!.count--;\n if (!this._observedElements.get(element)!.count) {\n this._cleanupObserver(element);\n }\n }\n }\n\n /** Clean up the underlying MutationObserver for the specified element. */\n private _cleanupObserver(element: Element) {\n if (this._observedElements.has(element)) {\n const {observer, stream} = this._observedElements.get(element)!;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n }\n}\n\n\n/**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n@Directive({\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') event = new EventEmitter<MutationRecord[]>();\n\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n @Input('cdkObserveContentDisabled')\n get disabled() { return this._disabled; }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value);\n this._disabled ? this._unsubscribe() : this._subscribe();\n }\n private _disabled = false;\n\n /** Debounce interval for emitting the changes. */\n @Input()\n get debounce(): number { return this._debounce; }\n set debounce(value: number) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(private _contentObserver: ContentObserver,\n private _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone) {}\n\n ngAfterContentInit() {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n }\n\n ngOnDestroy() {\n this._unsubscribe();\n }\n\n private _subscribe() {\n this._unsubscribe();\n const stream = this._contentObserver.observe(this._elementRef);\n\n // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.\n // Consider brining it back inside the zone next time we're making breaking changes.\n // Bringing it back inside can cause things like infinite change detection loops and changed\n // after checked errors if people's code isn't handling it properly.\n this._ngZone.runOutsideAngular(() => {\n this._currentSubscription =\n (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n if (this._currentSubscription) {\n this._currentSubscription.unsubscribe();\n }\n }\n}\n\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n})\nexport class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MAAM,EAAE,SAAS,CAAC,KAAI,CAAC,KAAK,CAAC,CAAC;SAC/F,CAAC,CAAC;;;;;IAGG,iBAAV,CAAA,SAAA,CAAA,YAAsB;;;;QAClB,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC7B,IAAI,CAAC,oBAAoB,CAAC,WAAW,EAAE,CAAC;SACzC;;;QA9DL,EAAA,IAAA,EAAC,SAAS,EAAV,IAAA,EAAA,CAAW;oBACT,QAAQ,EAAE,qBAAqB;oBAC/B,QAAQ,EAAE,mBAAmB;iBAC9B,EAAD,EAAA;;;;QA4BA,EAAA,IAAA,EAAwC,eAAe,EAAvD;QAtJA,EAAA,IAAA,EAAE,UAAU,EAAZ;QAKA,EAAA,IAAA,EAAE,MAAM,EAAR;;;QAwHA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAG,MAAM,EAAT,IAAA,EAAA,CAAU,mBAAmB,EAA7B,EAAA,CAAA;QAMA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,2BAA2B,EAApC,EAAA,CAAA;QASA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,CAAA;;IAxJA,OAAA,iBAAA,CAAA;;AAuIA;;;;QA+DA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,SAAS,EAAE,CAAC,uBAAuB,CAAC;iBACrC,EAAD,EAAA;;IA1MA,OAAA,eAAA,CAAA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"observers.es5.js","sources":["../../../src/cdk/observers/observe-content.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\nimport {coerceBooleanProperty, coerceNumberProperty, coerceElement} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {Observable, Subject, Subscription, Observer} from 'rxjs';\nimport {debounceTime} from 'rxjs/operators';\n\n/**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class MutationObserverFactory {\n create(callback: MutationCallback): MutationObserver | null {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n }\n}\n\n\n/** An injectable service that allows watching elements for changes to their content. */\n@Injectable({providedIn: 'root'})\nexport class ContentObserver implements OnDestroy {\n /** Keeps track of the existing MutationObservers so they can be reused. */\n private _observedElements = new Map<Element, {\n observer: MutationObserver | null,\n stream: Subject<MutationRecord[]>,\n count: number\n }>();\n\n constructor(private _mutationObserverFactory: MutationObserverFactory) {}\n\n ngOnDestroy() {\n this._observedElements.forEach((_, element) => this._cleanupObserver(element));\n }\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: Element): Observable<MutationRecord[]>;\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: ElementRef<Element>): Observable<MutationRecord[]>;\n\n observe(elementOrRef: Element | ElementRef<Element>): Observable<MutationRecord[]> {\n const element = coerceElement(elementOrRef);\n\n return Observable.create((observer: Observer<MutationRecord[]>) => {\n const stream = this._observeElement(element);\n const subscription = stream.subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n this._unobserveElement(element);\n };\n });\n }\n\n /**\n * Observes the given element by using the existing MutationObserver if available, or creating a\n * new one if not.\n */\n private _observeElement(element: Element): Subject<MutationRecord[]> {\n if (!this._observedElements.has(element)) {\n const stream = new Subject<MutationRecord[]>();\n const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));\n if (observer) {\n observer.observe(element, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n this._observedElements.set(element, {observer, stream, count: 1});\n } else {\n this._observedElements.get(element)!.count++;\n }\n return this._observedElements.get(element)!.stream;\n }\n\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n private _unobserveElement(element: Element) {\n if (this._observedElements.has(element)) {\n this._observedElements.get(element)!.count--;\n if (!this._observedElements.get(element)!.count) {\n this._cleanupObserver(element);\n }\n }\n }\n\n /** Clean up the underlying MutationObserver for the specified element. */\n private _cleanupObserver(element: Element) {\n if (this._observedElements.has(element)) {\n const {observer, stream} = this._observedElements.get(element)!;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n }\n}\n\n\n/**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n@Directive({\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') event = new EventEmitter<MutationRecord[]>();\n\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n @Input('cdkObserveContentDisabled')\n get disabled() { return this._disabled; }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value);\n this._disabled ? this._unsubscribe() : this._subscribe();\n }\n private _disabled = false;\n\n /** Debounce interval for emitting the changes. */\n @Input()\n get debounce(): number { return this._debounce; }\n set debounce(value: number) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(private _contentObserver: ContentObserver,\n private _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone) {}\n\n ngAfterContentInit() {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n }\n\n ngOnDestroy() {\n this._unsubscribe();\n }\n\n private _subscribe() {\n this._unsubscribe();\n const stream = this._contentObserver.observe(this._elementRef);\n\n // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.\n // Consider brining it back inside the zone next time we're making breaking changes.\n // Bringing it back inside can cause things like infinite change detection loops and changed\n // after checked errors if people's code isn't handling it properly.\n this._ngZone.runOutsideAngular(() => {\n this._currentSubscription =\n (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n if (this._currentSubscription) {\n this._currentSubscription.unsubscribe();\n }\n }\n}\n\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n})\nexport class ObserversModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA4BA,AAAA,IAAA,uBAAA,kBAAA,YAAA;IAAA,SAAA,uBAAA,GAAA;KAKC;;;;;IAHC,uBAAF,CAAA,SAAA,CAAA,MAAQ;;;;IAAN,UAAO,QAA0B,EAAnC;QACI,OAAO,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;KACxF,CAAH;;QAJA,EAAA,IAAA,EAAC,UAAU,EAAX,IAAA,EAAA,CAAY,EAAC,UAAU,EAAE,MAAM,EAAC,EAAhC,EAAA;;;IA5BA,OAAA,uBAAA,CAAA;CAiCC,EAAD,CAAA,CAAC;AAJD;;;AAQA,AAAA,IAAA,eAAA,kBAAA,YAAA;IASE,SAAF,eAAA,CAAsB,wBAAiD,EAAvE;QAAsB,IAAtB,CAAA,wBAA8C,GAAxB,wBAAwB,CAAyB;;;;QAN7D,IAAV,CAAA,iBAA2B,GAAG,IAAI,GAAG,EAI/B,CAAC;KAEoE;;;;IAEzE,eAAF,CAAA,SAAA,CAAA,WAAa;;;IAAX,YAAF;QAAE,IAAF,KAAA,GAAA,IAAA,CAEG;QADC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,UAAC,CAAC,EAAE,OAAO,EAA9C,EAAmD,OAAA,KAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAjF,EAAiF,CAAC,CAAC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