@angular/cdk-experimental 13.0.0-next.7 → 13.0.0-rc.2
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/column-resize/column-resize-directives/column-resize-flex.d.ts +3 -0
- package/column-resize/column-resize-directives/column-resize.d.ts +3 -0
- package/column-resize/column-resize-directives/default-enabled-column-resize-flex.d.ts +3 -0
- package/column-resize/column-resize-directives/default-enabled-column-resize.d.ts +3 -0
- package/column-resize/column-resize-module.d.ts +11 -7
- package/column-resize/column-resize-notifier.d.ts +5 -7
- package/column-resize/column-resize.d.ts +3 -0
- package/column-resize/column-resize_public_index.d.ts +4 -0
- package/column-resize/column-size-store.d.ts +3 -7
- package/column-resize/event-dispatcher.d.ts +3 -0
- package/column-resize/index.d.ts +5 -2
- package/column-resize/overlay-handle.d.ts +3 -0
- package/column-resize/package.json +6 -6
- package/column-resize/resizable.d.ts +3 -0
- package/column-resize/resize-strategy.d.ts +7 -0
- package/combobox/combobox-module.d.ts +8 -7
- package/combobox/combobox-panel.d.ts +5 -2
- package/combobox/combobox-popup.d.ts +3 -0
- package/combobox/combobox.d.ts +8 -5
- package/combobox/combobox_public_index.d.ts +4 -0
- package/combobox/index.d.ts +5 -1
- package/combobox/package.json +6 -6
- package/dialog/dialog-container.d.ts +4 -1
- package/dialog/dialog-module.d.ts +8 -7
- package/dialog/dialog.d.ts +3 -0
- package/dialog/dialog_public_index.d.ts +4 -0
- package/dialog/index.d.ts +5 -1
- package/dialog/package.json +6 -6
- package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +42 -0
- package/esm2020/column-resize/column-resize-directives/column-resize.mjs +42 -0
- package/{esm2015/column-resize/column-resize-directives/constants.js → esm2020/column-resize/column-resize-directives/constants.mjs} +0 -0
- package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize-flex.mjs +48 -0
- package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize.mjs +48 -0
- package/esm2020/column-resize/column-resize-module.mjs +46 -0
- package/esm2020/column-resize/column-resize-notifier.mjs +52 -0
- package/esm2020/column-resize/column-resize.mjs +82 -0
- package/esm2020/column-resize/column-resize_public_index.mjs +5 -0
- package/esm2020/column-resize/column-size-store.mjs +20 -0
- package/esm2020/column-resize/event-dispatcher.mjs +70 -0
- package/esm2020/column-resize/index.mjs +9 -0
- package/esm2020/column-resize/overlay-handle.mjs +146 -0
- package/{esm2015/column-resize/public-api.js → esm2020/column-resize/public-api.mjs} +0 -0
- package/esm2020/column-resize/resizable.mjs +195 -0
- package/{esm2015/column-resize/resize-ref.js → esm2020/column-resize/resize-ref.mjs} +1 -1
- package/esm2020/column-resize/resize-strategy.mjs +230 -0
- package/{esm2015/column-resize/selectors.js → esm2020/column-resize/selectors.mjs} +0 -0
- package/esm2020/combobox/combobox-module.mjs +28 -0
- package/esm2020/combobox/combobox-panel.mjs +48 -0
- package/esm2020/combobox/combobox-popup.mjs +83 -0
- package/esm2020/combobox/combobox.mjs +261 -0
- package/esm2020/combobox/combobox_public_index.mjs +5 -0
- package/esm2020/combobox/index.mjs +9 -0
- package/{esm2015/combobox/public-api.js → esm2020/combobox/public-api.mjs} +0 -0
- package/{esm2015/dialog/dialog-config.js → esm2020/dialog/dialog-config.mjs} +0 -0
- package/esm2020/dialog/dialog-container.mjs +310 -0
- package/esm2020/dialog/dialog-injectors.mjs +30 -0
- package/esm2020/dialog/dialog-module.mjs +57 -0
- package/esm2020/dialog/dialog-ref.mjs +116 -0
- package/esm2020/dialog/dialog.mjs +252 -0
- package/esm2020/dialog/dialog_public_index.mjs +5 -0
- package/esm2020/dialog/index.mjs +9 -0
- package/{esm2015/dialog/public-api.js → esm2020/dialog/public-api.mjs} +0 -0
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/esm2020/listbox/index.mjs +9 -0
- package/esm2020/listbox/listbox-module.mjs +24 -0
- package/esm2020/listbox/listbox.mjs +499 -0
- package/esm2020/listbox/listbox_public_index.mjs +5 -0
- package/{esm2015/listbox/public-api.js → esm2020/listbox/public-api.mjs} +0 -0
- package/esm2020/menu/context-menu.mjs +287 -0
- package/esm2020/menu/index.mjs +9 -0
- package/esm2020/menu/menu-aim.mjs +199 -0
- package/esm2020/menu/menu-bar.mjs +272 -0
- package/{esm2015/menu/menu-errors.js → esm2020/menu/menu-errors.mjs} +1 -1
- package/esm2020/menu/menu-group.mjs +68 -0
- package/{esm2015/menu/menu-interface.js → esm2020/menu/menu-interface.mjs} +0 -0
- package/esm2020/menu/menu-item-checkbox.mjs +48 -0
- package/esm2020/menu/menu-item-radio.mjs +90 -0
- package/esm2020/menu/menu-item-selectable.mjs +57 -0
- package/esm2020/menu/menu-item-trigger.mjs +361 -0
- package/esm2020/menu/menu-item.mjs +291 -0
- package/esm2020/menu/menu-module.mjs +64 -0
- package/esm2020/menu/menu-panel.mjs +37 -0
- package/{esm2015/menu/menu-stack.js → esm2020/menu/menu-stack.mjs} +0 -0
- package/esm2020/menu/menu.mjs +316 -0
- package/esm2020/menu/menu_public_index.mjs +5 -0
- package/{esm2015/menu/pointer-focus-tracker.js → esm2020/menu/pointer-focus-tracker.mjs} +1 -1
- package/{esm2015/menu/public-api.js → esm2020/menu/public-api.mjs} +0 -0
- package/{esm2015/popover-edit/constants.js → esm2020/popover-edit/constants.mjs} +0 -0
- package/esm2020/popover-edit/edit-event-dispatcher.mjs +215 -0
- package/esm2020/popover-edit/edit-ref.mjs +84 -0
- package/esm2020/popover-edit/edit-services.mjs +48 -0
- package/esm2020/popover-edit/focus-dispatcher.mjs +82 -0
- package/esm2020/popover-edit/focus-escape-notifier.mjs +63 -0
- package/{esm2015/popover-edit/form-value-container.js → esm2020/popover-edit/form-value-container.mjs} +0 -0
- package/esm2020/popover-edit/index.mjs +9 -0
- package/esm2020/popover-edit/lens-directives.mjs +210 -0
- package/esm2020/popover-edit/polyfill.mjs +37 -0
- package/esm2020/popover-edit/popover-edit-module.mjs +62 -0
- package/esm2020/popover-edit/popover-edit-position-strategy-factory.mjs +76 -0
- package/esm2020/popover-edit/popover-edit_public_index.mjs +5 -0
- package/{esm2015/popover-edit/public-api.js → esm2020/popover-edit/public-api.mjs} +0 -0
- package/esm2020/popover-edit/table-directives.mjs +400 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/esm2020/scrolling/auto-size-virtual-scroll.mjs +421 -0
- package/esm2020/scrolling/index.mjs +9 -0
- package/{esm2015/scrolling/public-api.js → esm2020/scrolling/public-api.mjs} +0 -0
- package/esm2020/scrolling/scrolling-module.mjs +23 -0
- package/esm2020/scrolling/scrolling_public_index.mjs +5 -0
- package/esm2020/selection/index.mjs +9 -0
- package/{esm2015/selection/public-api.js → esm2020/selection/public-api.mjs} +0 -0
- package/esm2020/selection/row-selection.mjs +49 -0
- package/esm2020/selection/select-all.mjs +109 -0
- package/esm2020/selection/selection-column.mjs +134 -0
- package/esm2020/selection/selection-module.mjs +40 -0
- package/{esm2015/selection/selection-set.js → esm2020/selection/selection-set.mjs} +1 -1
- package/esm2020/selection/selection-toggle.mjs +101 -0
- package/esm2020/selection/selection.mjs +186 -0
- package/esm2020/selection/selection_public_index.mjs +5 -0
- package/esm2020/table-scroll-container/index.mjs +9 -0
- package/{esm2015/table-scroll-container/public-api.js → esm2020/table-scroll-container/public-api.mjs} +0 -0
- package/esm2020/table-scroll-container/table-scroll-container-module.mjs +23 -0
- package/esm2020/table-scroll-container/table-scroll-container.mjs +131 -0
- package/esm2020/table-scroll-container/table-scroll-container_public_index.mjs +5 -0
- package/{esm2015/version.js → esm2020/version.mjs} +1 -1
- package/fesm2015/{cdk-experimental.js → cdk-experimental.mjs} +2 -2
- package/fesm2015/cdk-experimental.mjs.map +1 -0
- package/fesm2015/{column-resize.js → column-resize.mjs} +213 -175
- package/fesm2015/column-resize.mjs.map +1 -0
- package/fesm2015/{combobox.js → combobox.mjs} +134 -102
- package/fesm2015/combobox.mjs.map +1 -0
- package/fesm2015/dialog.mjs +813 -0
- package/fesm2015/dialog.mjs.map +1 -0
- package/fesm2015/{listbox.js → listbox.mjs} +128 -91
- package/fesm2015/listbox.mjs.map +1 -0
- package/fesm2015/{menu.js → menu.mjs} +576 -397
- package/fesm2015/menu.mjs.map +1 -0
- package/fesm2015/{popover-edit.js → popover-edit.mjs} +257 -230
- package/fesm2015/popover-edit.mjs.map +1 -0
- package/fesm2015/{scrolling.js → scrolling.mjs} +66 -36
- package/fesm2015/scrolling.mjs.map +1 -0
- package/fesm2015/selection.mjs +693 -0
- package/fesm2015/selection.mjs.map +1 -0
- package/fesm2015/{table-scroll-container.js → table-scroll-container.mjs} +43 -30
- package/fesm2015/table-scroll-container.mjs.map +1 -0
- package/fesm2020/cdk-experimental.mjs +30 -0
- package/fesm2020/cdk-experimental.mjs.map +1 -0
- package/fesm2020/column-resize.mjs +1016 -0
- package/fesm2020/column-resize.mjs.map +1 -0
- package/fesm2020/combobox.mjs +430 -0
- package/fesm2020/combobox.mjs.map +1 -0
- package/{fesm2015/dialog.js → fesm2020/dialog.mjs} +156 -104
- package/fesm2020/dialog.mjs.map +1 -0
- package/fesm2020/listbox.mjs +541 -0
- package/fesm2020/listbox.mjs.map +1 -0
- package/fesm2020/menu.mjs +2202 -0
- package/fesm2020/menu.mjs.map +1 -0
- package/fesm2020/popover-edit.mjs +1289 -0
- package/fesm2020/popover-edit.mjs.map +1 -0
- package/fesm2020/scrolling.mjs +464 -0
- package/fesm2020/scrolling.mjs.map +1 -0
- package/{fesm2015/selection.js → fesm2020/selection.mjs} +195 -107
- package/fesm2020/selection.mjs.map +1 -0
- package/fesm2020/table-scroll-container.mjs +173 -0
- package/fesm2020/table-scroll-container.mjs.map +1 -0
- package/listbox/index.d.ts +5 -1
- package/listbox/listbox-module.d.ts +5 -7
- package/listbox/listbox.d.ts +5 -0
- package/listbox/listbox_public_index.d.ts +4 -0
- package/listbox/package.json +6 -6
- package/menu/context-menu.d.ts +5 -0
- package/menu/index.d.ts +5 -3
- package/menu/menu-aim.d.ts +5 -0
- package/menu/menu-bar.d.ts +3 -0
- package/menu/menu-group.d.ts +3 -0
- package/menu/menu-item-checkbox.d.ts +3 -7
- package/menu/menu-item-radio.d.ts +3 -0
- package/menu/menu-item-selectable.d.ts +3 -0
- package/menu/menu-item-trigger.d.ts +3 -0
- package/menu/menu-item.d.ts +3 -0
- package/menu/menu-module.d.ts +15 -7
- package/menu/menu-panel.d.ts +3 -0
- package/menu/menu.d.ts +3 -0
- package/menu/menu_public_index.d.ts +4 -0
- package/menu/package.json +6 -6
- package/package.json +94 -8
- package/popover-edit/edit-event-dispatcher.d.ts +3 -0
- package/popover-edit/edit-ref.d.ts +3 -0
- package/popover-edit/edit-services.d.ts +3 -0
- package/popover-edit/focus-dispatcher.d.ts +3 -0
- package/popover-edit/focus-escape-notifier.d.ts +3 -0
- package/popover-edit/index.d.ts +5 -3
- package/popover-edit/lens-directives.d.ts +7 -0
- package/popover-edit/package.json +6 -6
- package/popover-edit/popover-edit-module.d.ts +7 -7
- package/popover-edit/popover-edit-position-strategy-factory.d.ts +5 -0
- package/popover-edit/popover-edit_public_index.d.ts +4 -0
- package/popover-edit/table-directives.d.ts +11 -0
- package/scrolling/auto-size-virtual-scroll.d.ts +3 -0
- package/scrolling/index.d.ts +5 -1
- package/scrolling/package.json +6 -6
- package/scrolling/scrolling-module.d.ts +5 -7
- package/scrolling/scrolling_public_index.d.ts +4 -0
- package/selection/index.d.ts +5 -1
- package/selection/package.json +6 -6
- package/selection/row-selection.d.ts +3 -0
- package/selection/select-all.d.ts +3 -0
- package/selection/selection-column.d.ts +3 -0
- package/selection/selection-module.d.ts +11 -7
- package/selection/selection-toggle.d.ts +3 -0
- package/selection/selection.d.ts +3 -0
- package/selection/selection_public_index.d.ts +4 -0
- package/table-scroll-container/index.d.ts +5 -1
- package/table-scroll-container/package.json +6 -6
- package/table-scroll-container/table-scroll-container-module.d.ts +5 -7
- package/table-scroll-container/table-scroll-container.d.ts +3 -0
- package/table-scroll-container/table-scroll-container_public_index.d.ts +4 -0
- package/bundles/cdk-experimental-column-resize.umd.js +0 -1324
- package/bundles/cdk-experimental-column-resize.umd.js.map +0 -1
- package/bundles/cdk-experimental-combobox.umd.js +0 -443
- package/bundles/cdk-experimental-combobox.umd.js.map +0 -1
- package/bundles/cdk-experimental-dialog.umd.js +0 -1113
- package/bundles/cdk-experimental-dialog.umd.js.map +0 -1
- package/bundles/cdk-experimental-listbox.umd.js +0 -935
- package/bundles/cdk-experimental-listbox.umd.js.map +0 -1
- package/bundles/cdk-experimental-menu.umd.js +0 -2461
- package/bundles/cdk-experimental-menu.umd.js.map +0 -1
- package/bundles/cdk-experimental-popover-edit.umd.js +0 -1679
- package/bundles/cdk-experimental-popover-edit.umd.js.map +0 -1
- package/bundles/cdk-experimental-scrolling.umd.js +0 -459
- package/bundles/cdk-experimental-scrolling.umd.js.map +0 -1
- package/bundles/cdk-experimental-selection.umd.js +0 -961
- package/bundles/cdk-experimental-selection.umd.js.map +0 -1
- package/bundles/cdk-experimental-table-scroll-container.umd.js +0 -499
- package/bundles/cdk-experimental-table-scroll-container.umd.js.map +0 -1
- package/bundles/cdk-experimental.umd.js +0 -38
- package/bundles/cdk-experimental.umd.js.map +0 -1
- package/column-resize/index.metadata.json +0 -1
- package/combobox/index.metadata.json +0 -1
- package/dialog/index.metadata.json +0 -1
- package/esm2015/cdk-experimental.externs.js +0 -0
- package/esm2015/column-resize/column-resize-directives/column-resize-flex.js +0 -46
- package/esm2015/column-resize/column-resize-directives/column-resize.js +0 -46
- package/esm2015/column-resize/column-resize-directives/default-enabled-column-resize-flex.js +0 -46
- package/esm2015/column-resize/column-resize-directives/default-enabled-column-resize.js +0 -46
- package/esm2015/column-resize/column-resize-module.js +0 -37
- package/esm2015/column-resize/column-resize-notifier.js +0 -45
- package/esm2015/column-resize/column-resize.externs.js +0 -6
- package/esm2015/column-resize/column-resize.js +0 -71
- package/esm2015/column-resize/column-size-store.js +0 -17
- package/esm2015/column-resize/event-dispatcher.js +0 -70
- package/esm2015/column-resize/index.js +0 -6
- package/esm2015/column-resize/overlay-handle.js +0 -139
- package/esm2015/column-resize/resizable.js +0 -185
- package/esm2015/column-resize/resize-strategy.js +0 -227
- package/esm2015/combobox/combobox-module.js +0 -23
- package/esm2015/combobox/combobox-panel.js +0 -55
- package/esm2015/combobox/combobox-popup.js +0 -74
- package/esm2015/combobox/combobox.externs.js +0 -6
- package/esm2015/combobox/combobox.js +0 -248
- package/esm2015/combobox/index.js +0 -5
- package/esm2015/dialog/dialog-container.js +0 -289
- package/esm2015/dialog/dialog-injectors.js +0 -30
- package/esm2015/dialog/dialog-module.js +0 -47
- package/esm2015/dialog/dialog-ref.js +0 -115
- package/esm2015/dialog/dialog.externs.js +0 -6
- package/esm2015/dialog/dialog.js +0 -238
- package/esm2015/dialog/index.js +0 -5
- package/esm2015/listbox/index.js +0 -5
- package/esm2015/listbox/listbox-module.js +0 -19
- package/esm2015/listbox/listbox.externs.js +0 -6
- package/esm2015/listbox/listbox.js +0 -481
- package/esm2015/menu/context-menu.js +0 -280
- package/esm2015/menu/index.js +0 -6
- package/esm2015/menu/menu-aim.js +0 -195
- package/esm2015/menu/menu-bar.js +0 -252
- package/esm2015/menu/menu-group.js +0 -63
- package/esm2015/menu/menu-item-checkbox.js +0 -41
- package/esm2015/menu/menu-item-radio.js +0 -73
- package/esm2015/menu/menu-item-selectable.js +0 -51
- package/esm2015/menu/menu-item-trigger.js +0 -354
- package/esm2015/menu/menu-item.js +0 -253
- package/esm2015/menu/menu-module.js +0 -41
- package/esm2015/menu/menu-panel.js +0 -37
- package/esm2015/menu/menu.externs.js +0 -6
- package/esm2015/menu/menu.js +0 -293
- package/esm2015/popover-edit/edit-event-dispatcher.js +0 -215
- package/esm2015/popover-edit/edit-ref.js +0 -82
- package/esm2015/popover-edit/edit-services.js +0 -49
- package/esm2015/popover-edit/focus-dispatcher.js +0 -83
- package/esm2015/popover-edit/focus-escape-notifier.js +0 -64
- package/esm2015/popover-edit/index.js +0 -7
- package/esm2015/popover-edit/lens-directives.js +0 -199
- package/esm2015/popover-edit/polyfill.js +0 -35
- package/esm2015/popover-edit/popover-edit-module.js +0 -38
- package/esm2015/popover-edit/popover-edit-position-strategy-factory.js +0 -70
- package/esm2015/popover-edit/popover-edit.externs.js +0 -6
- package/esm2015/popover-edit/table-directives.js +0 -390
- package/esm2015/scrolling/auto-size-virtual-scroll.js +0 -403
- package/esm2015/scrolling/index.js +0 -5
- package/esm2015/scrolling/scrolling-module.js +0 -18
- package/esm2015/scrolling/scrolling.externs.js +0 -6
- package/esm2015/selection/index.js +0 -5
- package/esm2015/selection/row-selection.js +0 -41
- package/esm2015/selection/select-all.js +0 -96
- package/esm2015/selection/selection-column.js +0 -93
- package/esm2015/selection/selection-module.js +0 -40
- package/esm2015/selection/selection-toggle.js +0 -82
- package/esm2015/selection/selection.externs.js +0 -6
- package/esm2015/selection/selection.js +0 -176
- package/esm2015/table-scroll-container/index.js +0 -5
- package/esm2015/table-scroll-container/table-scroll-container-module.js +0 -18
- package/esm2015/table-scroll-container/table-scroll-container.externs.js +0 -6
- package/esm2015/table-scroll-container/table-scroll-container.js +0 -133
- package/fesm2015/cdk-experimental.js.map +0 -1
- package/fesm2015/column-resize.js.map +0 -1
- package/fesm2015/combobox.js.map +0 -1
- package/fesm2015/dialog.js.map +0 -1
- package/fesm2015/listbox.js.map +0 -1
- package/fesm2015/menu.js.map +0 -1
- package/fesm2015/popover-edit.js.map +0 -1
- package/fesm2015/scrolling.js.map +0 -1
- package/fesm2015/selection.js.map +0 -1
- package/fesm2015/table-scroll-container.js.map +0 -1
- package/listbox/index.metadata.json +0 -1
- package/menu/index.metadata.json +0 -1
- package/popover-edit/index.metadata.json +0 -1
- package/scrolling/index.metadata.json +0 -1
- package/selection/index.metadata.json +0 -1
- package/table-scroll-container/index.metadata.json +0 -1
|
@@ -1,1113 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/animations'), require('@angular/cdk/a11y'), require('@angular/cdk/platform'), require('@angular/cdk/portal'), require('@angular/common'), require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/keycodes'), require('@angular/cdk/bidi'), require('@angular/cdk/overlay')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@angular/cdk-experimental/dialog', ['exports', '@angular/animations', '@angular/cdk/a11y', '@angular/cdk/platform', '@angular/cdk/portal', '@angular/common', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/cdk/keycodes', '@angular/cdk/bidi', '@angular/cdk/overlay'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ng = global.ng || {}, global.ng.cdkExperimental = global.ng.cdkExperimental || {}, global.ng.cdkExperimental.dialog = {}), global.ng.animations, global.ng.cdk.a11y, global.ng.cdk.platform, global.ng.cdk.portal, global.ng.common, global.ng.core, global.rxjs, global.rxjs.operators, global.ng.cdk.keycodes, global.ng.cdk.bidi, global.ng.cdk.overlay));
|
|
5
|
-
}(this, (function (exports, animations, a11y, platform, portal, common, core, rxjs, operators, keycodes, bidi, overlay) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation.
|
|
9
|
-
|
|
10
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
-
purpose with or without fee is hereby granted.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
-
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
22
|
-
var extendStatics = function (d, b) {
|
|
23
|
-
extendStatics = Object.setPrototypeOf ||
|
|
24
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
25
|
-
function (d, b) { for (var p in b)
|
|
26
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
27
|
-
d[p] = b[p]; };
|
|
28
|
-
return extendStatics(d, b);
|
|
29
|
-
};
|
|
30
|
-
function __extends(d, b) {
|
|
31
|
-
if (typeof b !== "function" && b !== null)
|
|
32
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
33
|
-
extendStatics(d, b);
|
|
34
|
-
function __() { this.constructor = d; }
|
|
35
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
|
-
}
|
|
37
|
-
var __assign = function () {
|
|
38
|
-
__assign = Object.assign || function __assign(t) {
|
|
39
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
40
|
-
s = arguments[i];
|
|
41
|
-
for (var p in s)
|
|
42
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
43
|
-
t[p] = s[p];
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
};
|
|
47
|
-
return __assign.apply(this, arguments);
|
|
48
|
-
};
|
|
49
|
-
function __rest(s, e) {
|
|
50
|
-
var t = {};
|
|
51
|
-
for (var p in s)
|
|
52
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
53
|
-
t[p] = s[p];
|
|
54
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
55
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
56
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
57
|
-
t[p[i]] = s[p[i]];
|
|
58
|
-
}
|
|
59
|
-
return t;
|
|
60
|
-
}
|
|
61
|
-
function __decorate(decorators, target, key, desc) {
|
|
62
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
63
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
64
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
65
|
-
else
|
|
66
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
67
|
-
if (d = decorators[i])
|
|
68
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
69
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
70
|
-
}
|
|
71
|
-
function __param(paramIndex, decorator) {
|
|
72
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
73
|
-
}
|
|
74
|
-
function __metadata(metadataKey, metadataValue) {
|
|
75
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
76
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
77
|
-
}
|
|
78
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
79
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
80
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
81
|
-
function fulfilled(value) { try {
|
|
82
|
-
step(generator.next(value));
|
|
83
|
-
}
|
|
84
|
-
catch (e) {
|
|
85
|
-
reject(e);
|
|
86
|
-
} }
|
|
87
|
-
function rejected(value) { try {
|
|
88
|
-
step(generator["throw"](value));
|
|
89
|
-
}
|
|
90
|
-
catch (e) {
|
|
91
|
-
reject(e);
|
|
92
|
-
} }
|
|
93
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
94
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function __generator(thisArg, body) {
|
|
98
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
99
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
100
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
101
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
102
|
-
function step(op) {
|
|
103
|
-
if (f)
|
|
104
|
-
throw new TypeError("Generator is already executing.");
|
|
105
|
-
while (_)
|
|
106
|
-
try {
|
|
107
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
108
|
-
return t;
|
|
109
|
-
if (y = 0, t)
|
|
110
|
-
op = [op[0] & 2, t.value];
|
|
111
|
-
switch (op[0]) {
|
|
112
|
-
case 0:
|
|
113
|
-
case 1:
|
|
114
|
-
t = op;
|
|
115
|
-
break;
|
|
116
|
-
case 4:
|
|
117
|
-
_.label++;
|
|
118
|
-
return { value: op[1], done: false };
|
|
119
|
-
case 5:
|
|
120
|
-
_.label++;
|
|
121
|
-
y = op[1];
|
|
122
|
-
op = [0];
|
|
123
|
-
continue;
|
|
124
|
-
case 7:
|
|
125
|
-
op = _.ops.pop();
|
|
126
|
-
_.trys.pop();
|
|
127
|
-
continue;
|
|
128
|
-
default:
|
|
129
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
130
|
-
_ = 0;
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
134
|
-
_.label = op[1];
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
138
|
-
_.label = t[1];
|
|
139
|
-
t = op;
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
if (t && _.label < t[2]) {
|
|
143
|
-
_.label = t[2];
|
|
144
|
-
_.ops.push(op);
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
if (t[2])
|
|
148
|
-
_.ops.pop();
|
|
149
|
-
_.trys.pop();
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
op = body.call(thisArg, _);
|
|
153
|
-
}
|
|
154
|
-
catch (e) {
|
|
155
|
-
op = [6, e];
|
|
156
|
-
y = 0;
|
|
157
|
-
}
|
|
158
|
-
finally {
|
|
159
|
-
f = t = 0;
|
|
160
|
-
}
|
|
161
|
-
if (op[0] & 5)
|
|
162
|
-
throw op[1];
|
|
163
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
167
|
-
if (k2 === undefined)
|
|
168
|
-
k2 = k;
|
|
169
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
170
|
-
}) : (function (o, m, k, k2) {
|
|
171
|
-
if (k2 === undefined)
|
|
172
|
-
k2 = k;
|
|
173
|
-
o[k2] = m[k];
|
|
174
|
-
});
|
|
175
|
-
function __exportStar(m, o) {
|
|
176
|
-
for (var p in m)
|
|
177
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
178
|
-
__createBinding(o, m, p);
|
|
179
|
-
}
|
|
180
|
-
function __values(o) {
|
|
181
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
182
|
-
if (m)
|
|
183
|
-
return m.call(o);
|
|
184
|
-
if (o && typeof o.length === "number")
|
|
185
|
-
return {
|
|
186
|
-
next: function () {
|
|
187
|
-
if (o && i >= o.length)
|
|
188
|
-
o = void 0;
|
|
189
|
-
return { value: o && o[i++], done: !o };
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
193
|
-
}
|
|
194
|
-
function __read(o, n) {
|
|
195
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
196
|
-
if (!m)
|
|
197
|
-
return o;
|
|
198
|
-
var i = m.call(o), r, ar = [], e;
|
|
199
|
-
try {
|
|
200
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
201
|
-
ar.push(r.value);
|
|
202
|
-
}
|
|
203
|
-
catch (error) {
|
|
204
|
-
e = { error: error };
|
|
205
|
-
}
|
|
206
|
-
finally {
|
|
207
|
-
try {
|
|
208
|
-
if (r && !r.done && (m = i["return"]))
|
|
209
|
-
m.call(i);
|
|
210
|
-
}
|
|
211
|
-
finally {
|
|
212
|
-
if (e)
|
|
213
|
-
throw e.error;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return ar;
|
|
217
|
-
}
|
|
218
|
-
/** @deprecated */
|
|
219
|
-
function __spread() {
|
|
220
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
221
|
-
ar = ar.concat(__read(arguments[i]));
|
|
222
|
-
return ar;
|
|
223
|
-
}
|
|
224
|
-
/** @deprecated */
|
|
225
|
-
function __spreadArrays() {
|
|
226
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
227
|
-
s += arguments[i].length;
|
|
228
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
229
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
230
|
-
r[k] = a[j];
|
|
231
|
-
return r;
|
|
232
|
-
}
|
|
233
|
-
function __spreadArray(to, from, pack) {
|
|
234
|
-
if (pack || arguments.length === 2)
|
|
235
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
236
|
-
if (ar || !(i in from)) {
|
|
237
|
-
if (!ar)
|
|
238
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
239
|
-
ar[i] = from[i];
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
243
|
-
}
|
|
244
|
-
function __await(v) {
|
|
245
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
246
|
-
}
|
|
247
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
248
|
-
if (!Symbol.asyncIterator)
|
|
249
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
250
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
251
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
252
|
-
function verb(n) { if (g[n])
|
|
253
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
254
|
-
function resume(n, v) { try {
|
|
255
|
-
step(g[n](v));
|
|
256
|
-
}
|
|
257
|
-
catch (e) {
|
|
258
|
-
settle(q[0][3], e);
|
|
259
|
-
} }
|
|
260
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
261
|
-
function fulfill(value) { resume("next", value); }
|
|
262
|
-
function reject(value) { resume("throw", value); }
|
|
263
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
264
|
-
resume(q[0][0], q[0][1]); }
|
|
265
|
-
}
|
|
266
|
-
function __asyncDelegator(o) {
|
|
267
|
-
var i, p;
|
|
268
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
269
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
270
|
-
}
|
|
271
|
-
function __asyncValues(o) {
|
|
272
|
-
if (!Symbol.asyncIterator)
|
|
273
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
274
|
-
var m = o[Symbol.asyncIterator], i;
|
|
275
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
276
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
277
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
278
|
-
}
|
|
279
|
-
function __makeTemplateObject(cooked, raw) {
|
|
280
|
-
if (Object.defineProperty) {
|
|
281
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
cooked.raw = raw;
|
|
285
|
-
}
|
|
286
|
-
return cooked;
|
|
287
|
-
}
|
|
288
|
-
;
|
|
289
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
290
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
291
|
-
}) : function (o, v) {
|
|
292
|
-
o["default"] = v;
|
|
293
|
-
};
|
|
294
|
-
function __importStar(mod) {
|
|
295
|
-
if (mod && mod.__esModule)
|
|
296
|
-
return mod;
|
|
297
|
-
var result = {};
|
|
298
|
-
if (mod != null)
|
|
299
|
-
for (var k in mod)
|
|
300
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
301
|
-
__createBinding(result, mod, k);
|
|
302
|
-
__setModuleDefault(result, mod);
|
|
303
|
-
return result;
|
|
304
|
-
}
|
|
305
|
-
function __importDefault(mod) {
|
|
306
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
307
|
-
}
|
|
308
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
309
|
-
if (kind === "a" && !f)
|
|
310
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
311
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
312
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
313
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
314
|
-
}
|
|
315
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
316
|
-
if (kind === "m")
|
|
317
|
-
throw new TypeError("Private method is not writable");
|
|
318
|
-
if (kind === "a" && !f)
|
|
319
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
320
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
321
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
322
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
var DialogConfig = /** @class */ (function () {
|
|
326
|
-
function DialogConfig() {
|
|
327
|
-
/** The ARIA role of the dialog. */
|
|
328
|
-
this.role = 'dialog';
|
|
329
|
-
/** Custom class(es) for the overlay panel. */
|
|
330
|
-
this.panelClass = '';
|
|
331
|
-
/** Whether the dialog has a background. */
|
|
332
|
-
this.hasBackdrop = true;
|
|
333
|
-
/** Custom class(es) for the backdrop. */
|
|
334
|
-
this.backdropClass = '';
|
|
335
|
-
/** Whether the dialog can be closed by user interaction. */
|
|
336
|
-
this.disableClose = false;
|
|
337
|
-
/** The width of the dialog. */
|
|
338
|
-
this.width = '';
|
|
339
|
-
/** The height of the dialog. */
|
|
340
|
-
this.height = '';
|
|
341
|
-
/** The minimum width of the dialog. */
|
|
342
|
-
this.minWidth = '';
|
|
343
|
-
/** The minimum height of the dialog. */
|
|
344
|
-
this.minHeight = '';
|
|
345
|
-
/** The maximum width of the dialog. */
|
|
346
|
-
this.maxWidth = '80vw';
|
|
347
|
-
/** The maximum height of the dialog. */
|
|
348
|
-
this.maxHeight = '';
|
|
349
|
-
/** Data to be injected into the dialog content. */
|
|
350
|
-
this.data = null;
|
|
351
|
-
/** ID of the element that describes the dialog. */
|
|
352
|
-
this.ariaDescribedBy = null;
|
|
353
|
-
/** Aria label to assign to the dialog element */
|
|
354
|
-
this.ariaLabel = null;
|
|
355
|
-
/**
|
|
356
|
-
* Where the dialog should focus on open.
|
|
357
|
-
* @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or
|
|
358
|
-
* AutoFocusTarget instead.
|
|
359
|
-
*/
|
|
360
|
-
this.autoFocus = 'first-tabbable';
|
|
361
|
-
/** Duration of the enter animation. Has to be a valid CSS value (e.g. 100ms). */
|
|
362
|
-
this.enterAnimationDuration = '225ms';
|
|
363
|
-
/** Duration of the exit animation. Has to be a valid CSS value (e.g. 50ms). */
|
|
364
|
-
this.exitAnimationDuration = '225ms';
|
|
365
|
-
}
|
|
366
|
-
return DialogConfig;
|
|
367
|
-
}());
|
|
368
|
-
|
|
369
|
-
function throwDialogContentAlreadyAttachedError() {
|
|
370
|
-
throw Error('Attempting to attach dialog content after content is already attached');
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Internal component that wraps user-provided dialog content.
|
|
374
|
-
* @docs-private
|
|
375
|
-
*/
|
|
376
|
-
var CdkDialogContainer = /** @class */ (function (_super) {
|
|
377
|
-
__extends(CdkDialogContainer, _super);
|
|
378
|
-
function CdkDialogContainer(_elementRef, _focusTrapFactory, _changeDetectorRef, _interactivityChecker, _ngZone, _document,
|
|
379
|
-
/** The dialog configuration. */
|
|
380
|
-
_config) {
|
|
381
|
-
var _this = _super.call(this) || this;
|
|
382
|
-
_this._elementRef = _elementRef;
|
|
383
|
-
_this._focusTrapFactory = _focusTrapFactory;
|
|
384
|
-
_this._changeDetectorRef = _changeDetectorRef;
|
|
385
|
-
_this._interactivityChecker = _interactivityChecker;
|
|
386
|
-
_this._ngZone = _ngZone;
|
|
387
|
-
_this._config = _config;
|
|
388
|
-
/** State of the dialog animation. */
|
|
389
|
-
_this._state = 'enter';
|
|
390
|
-
/** Element that was focused before the dialog was opened. Save this to restore upon close. */
|
|
391
|
-
_this._elementFocusedBeforeDialogWasOpened = null;
|
|
392
|
-
/** The class that traps and manages focus within the dialog. */
|
|
393
|
-
_this._focusTrap = _this._focusTrapFactory.create(_this._elementRef.nativeElement);
|
|
394
|
-
_this._ariaModal = true;
|
|
395
|
-
/** A subject emitting before the dialog enters the view. */
|
|
396
|
-
_this._beforeEnter = new rxjs.Subject();
|
|
397
|
-
/** A subject emitting after the dialog enters the view. */
|
|
398
|
-
_this._afterEnter = new rxjs.Subject();
|
|
399
|
-
/** A subject emitting before the dialog exits the view. */
|
|
400
|
-
_this._beforeExit = new rxjs.Subject();
|
|
401
|
-
/** A subject emitting after the dialog exits the view. */
|
|
402
|
-
_this._afterExit = new rxjs.Subject();
|
|
403
|
-
/** Stream of animation `done` events. */
|
|
404
|
-
_this._animationDone = new rxjs.Subject();
|
|
405
|
-
/**
|
|
406
|
-
* Attaches a DOM portal to the dialog container.
|
|
407
|
-
* @param portal Portal to be attached.
|
|
408
|
-
* @deprecated To be turned into a method.
|
|
409
|
-
* @breaking-change 10.0.0
|
|
410
|
-
*/
|
|
411
|
-
_this.attachDomPortal = function (portal) {
|
|
412
|
-
if (_this._portalHost.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
413
|
-
throwDialogContentAlreadyAttachedError();
|
|
414
|
-
}
|
|
415
|
-
return _this._portalHost.attachDomPortal(portal);
|
|
416
|
-
};
|
|
417
|
-
_this._document = _document;
|
|
418
|
-
// We use a Subject with a distinctUntilChanged, rather than a callback attached to .done,
|
|
419
|
-
// because some browsers fire the done event twice and we don't want to emit duplicate events.
|
|
420
|
-
// See: https://github.com/angular/angular/issues/24084
|
|
421
|
-
_this._animationDone.pipe(operators.distinctUntilChanged(function (x, y) {
|
|
422
|
-
return x.fromState === y.fromState && x.toState === y.toState;
|
|
423
|
-
})).subscribe(function (event) {
|
|
424
|
-
// Emit lifecycle events based on animation `done` callback.
|
|
425
|
-
if (event.toState === 'enter') {
|
|
426
|
-
_this._autoFocus();
|
|
427
|
-
_this._afterEnter.next();
|
|
428
|
-
_this._afterEnter.complete();
|
|
429
|
-
}
|
|
430
|
-
if (event.fromState === 'enter' && (event.toState === 'void' || event.toState === 'exit')) {
|
|
431
|
-
_this._returnFocusAfterDialog();
|
|
432
|
-
_this._afterExit.next();
|
|
433
|
-
_this._afterExit.complete();
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
return _this;
|
|
437
|
-
}
|
|
438
|
-
Object.defineProperty(CdkDialogContainer.prototype, "_ariaLabel", {
|
|
439
|
-
// @HostBinding is used in the class as it is expected to be extended. Since @Component decorator
|
|
440
|
-
// metadata is not inherited by child classes, instead the host binding data is defined in a way
|
|
441
|
-
// that can be inherited.
|
|
442
|
-
// tslint:disable:no-host-decorator-in-concrete no-private-getters
|
|
443
|
-
get: function () { return this._config.ariaLabel || null; },
|
|
444
|
-
enumerable: false,
|
|
445
|
-
configurable: true
|
|
446
|
-
});
|
|
447
|
-
Object.defineProperty(CdkDialogContainer.prototype, "_ariaDescribedBy", {
|
|
448
|
-
get: function () { return this._config.ariaDescribedBy; },
|
|
449
|
-
enumerable: false,
|
|
450
|
-
configurable: true
|
|
451
|
-
});
|
|
452
|
-
Object.defineProperty(CdkDialogContainer.prototype, "_role", {
|
|
453
|
-
get: function () { return this._config.role; },
|
|
454
|
-
enumerable: false,
|
|
455
|
-
configurable: true
|
|
456
|
-
});
|
|
457
|
-
Object.defineProperty(CdkDialogContainer.prototype, "_tabindex", {
|
|
458
|
-
get: function () { return -1; },
|
|
459
|
-
enumerable: false,
|
|
460
|
-
configurable: true
|
|
461
|
-
});
|
|
462
|
-
/** Initializes the dialog container with the attached content. */
|
|
463
|
-
CdkDialogContainer.prototype._initializeWithAttachedContent = function () {
|
|
464
|
-
// Save the previously focused element. This element will be re-focused
|
|
465
|
-
// when the dialog closes.
|
|
466
|
-
this._savePreviouslyFocusedElement();
|
|
467
|
-
// Move focus onto the dialog immediately in order to prevent the user
|
|
468
|
-
// from accidentally opening multiple dialogs at the same time.
|
|
469
|
-
this._focusDialogContainer();
|
|
470
|
-
};
|
|
471
|
-
/** Destroy focus trap to place focus back to the element focused before the dialog opened. */
|
|
472
|
-
CdkDialogContainer.prototype.ngOnDestroy = function () {
|
|
473
|
-
this._focusTrap.destroy();
|
|
474
|
-
this._animationDone.complete();
|
|
475
|
-
};
|
|
476
|
-
/**
|
|
477
|
-
* Attach a ComponentPortal as content to this dialog container.
|
|
478
|
-
* @param portal Portal to be attached as the dialog content.
|
|
479
|
-
*/
|
|
480
|
-
CdkDialogContainer.prototype.attachComponentPortal = function (portal) {
|
|
481
|
-
if (this._portalHost.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
482
|
-
throwDialogContentAlreadyAttachedError();
|
|
483
|
-
}
|
|
484
|
-
return this._portalHost.attachComponentPortal(portal);
|
|
485
|
-
};
|
|
486
|
-
/**
|
|
487
|
-
* Attach a TemplatePortal as content to this dialog container.
|
|
488
|
-
* @param portal Portal to be attached as the dialog content.
|
|
489
|
-
*/
|
|
490
|
-
CdkDialogContainer.prototype.attachTemplatePortal = function (portal) {
|
|
491
|
-
if (this._portalHost.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
492
|
-
throwDialogContentAlreadyAttachedError();
|
|
493
|
-
}
|
|
494
|
-
return this._portalHost.attachTemplatePortal(portal);
|
|
495
|
-
};
|
|
496
|
-
/** Emit lifecycle events based on animation `start` callback. */
|
|
497
|
-
CdkDialogContainer.prototype._onAnimationStart = function (event) {
|
|
498
|
-
if (event.toState === 'enter') {
|
|
499
|
-
this._beforeEnter.next();
|
|
500
|
-
this._beforeEnter.complete();
|
|
501
|
-
}
|
|
502
|
-
if (event.fromState === 'enter' && (event.toState === 'void' || event.toState === 'exit')) {
|
|
503
|
-
this._beforeExit.next();
|
|
504
|
-
this._beforeExit.complete();
|
|
505
|
-
}
|
|
506
|
-
};
|
|
507
|
-
/** Starts the dialog exit animation. */
|
|
508
|
-
CdkDialogContainer.prototype._startExiting = function () {
|
|
509
|
-
this._state = 'exit';
|
|
510
|
-
// Mark the container for check so it can react if the
|
|
511
|
-
// view container is using OnPush change detection.
|
|
512
|
-
this._changeDetectorRef.markForCheck();
|
|
513
|
-
};
|
|
514
|
-
/** Saves a reference to the element that was focused before the dialog was opened. */
|
|
515
|
-
CdkDialogContainer.prototype._savePreviouslyFocusedElement = function () {
|
|
516
|
-
if (this._document) {
|
|
517
|
-
this._elementFocusedBeforeDialogWasOpened = platform._getFocusedElementPierceShadowDom();
|
|
518
|
-
}
|
|
519
|
-
};
|
|
520
|
-
/** Focuses the dialog container. */
|
|
521
|
-
CdkDialogContainer.prototype._focusDialogContainer = function () {
|
|
522
|
-
// Note that there is no focus method when rendering on the server.
|
|
523
|
-
if (this._elementRef.nativeElement.focus) {
|
|
524
|
-
this._elementRef.nativeElement.focus();
|
|
525
|
-
}
|
|
526
|
-
};
|
|
527
|
-
/**
|
|
528
|
-
* Focuses the provided element. If the element is not focusable, it will add a tabIndex
|
|
529
|
-
* attribute to forcefully focus it. The attribute is removed after focus is moved.
|
|
530
|
-
* @param element The element to focus.
|
|
531
|
-
*/
|
|
532
|
-
CdkDialogContainer.prototype._forceFocus = function (element, options) {
|
|
533
|
-
if (!this._interactivityChecker.isFocusable(element)) {
|
|
534
|
-
element.tabIndex = -1;
|
|
535
|
-
// The tabindex attribute should be removed to avoid navigating to that element again
|
|
536
|
-
this._ngZone.runOutsideAngular(function () {
|
|
537
|
-
element.addEventListener('blur', function () { return element.removeAttribute('tabindex'); });
|
|
538
|
-
element.addEventListener('mousedown', function () { return element.removeAttribute('tabindex'); });
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
element.focus(options);
|
|
542
|
-
};
|
|
543
|
-
/**
|
|
544
|
-
* Focuses the first element that matches the given selector within the focus trap.
|
|
545
|
-
* @param selector The CSS selector for the element to set focus to.
|
|
546
|
-
*/
|
|
547
|
-
CdkDialogContainer.prototype._focusByCssSelector = function (selector, options) {
|
|
548
|
-
var elementToFocus = this._elementRef.nativeElement.querySelector(selector);
|
|
549
|
-
if (elementToFocus) {
|
|
550
|
-
this._forceFocus(elementToFocus, options);
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
/**
|
|
554
|
-
* Autofocus the element specified by the autoFocus field. When autoFocus is not 'dialog', if
|
|
555
|
-
* for some reason the element cannot be focused, the dialog container will be focused.
|
|
556
|
-
*/
|
|
557
|
-
CdkDialogContainer.prototype._autoFocus = function () {
|
|
558
|
-
var element = this._elementRef.nativeElement;
|
|
559
|
-
// If were to attempt to focus immediately, then the content of the dialog would not yet be
|
|
560
|
-
// ready in instances where change detection has to run first. To deal with this, we simply
|
|
561
|
-
// wait for the microtask queue to be empty when setting focus when autoFocus isn't set to
|
|
562
|
-
// dialog. If the element inside the dialog can't be focused, then the container is focused
|
|
563
|
-
// so the user can't tab into other elements behind it.
|
|
564
|
-
switch (this._config.autoFocus) {
|
|
565
|
-
case false:
|
|
566
|
-
case 'dialog':
|
|
567
|
-
var activeElement = platform._getFocusedElementPierceShadowDom();
|
|
568
|
-
// Ensure that focus is on the dialog container. It's possible that a different
|
|
569
|
-
// component tried to move focus while the open animation was running. See:
|
|
570
|
-
// https://github.com/angular/components/issues/16215. Note that we only want to do this
|
|
571
|
-
// if the focus isn't inside the dialog already, because it's possible that the consumer
|
|
572
|
-
// turned off `autoFocus` in order to move focus themselves.
|
|
573
|
-
if (activeElement !== element && !element.contains(activeElement)) {
|
|
574
|
-
element.focus();
|
|
575
|
-
}
|
|
576
|
-
break;
|
|
577
|
-
case true:
|
|
578
|
-
case 'first-tabbable':
|
|
579
|
-
this._focusTrap.focusInitialElementWhenReady()
|
|
580
|
-
.then(function (hasMovedFocus) {
|
|
581
|
-
if (!hasMovedFocus) {
|
|
582
|
-
element.focus();
|
|
583
|
-
}
|
|
584
|
-
});
|
|
585
|
-
break;
|
|
586
|
-
case 'first-heading':
|
|
587
|
-
this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');
|
|
588
|
-
break;
|
|
589
|
-
default:
|
|
590
|
-
this._focusByCssSelector(this._config.autoFocus);
|
|
591
|
-
break;
|
|
592
|
-
}
|
|
593
|
-
};
|
|
594
|
-
/** Returns the focus to the element focused before the dialog was open. */
|
|
595
|
-
CdkDialogContainer.prototype._returnFocusAfterDialog = function () {
|
|
596
|
-
var toFocus = this._elementFocusedBeforeDialogWasOpened;
|
|
597
|
-
// We need the extra check, because IE can set the `activeElement` to null in some cases.
|
|
598
|
-
if (toFocus && typeof toFocus.focus === 'function') {
|
|
599
|
-
var activeElement = platform._getFocusedElementPierceShadowDom();
|
|
600
|
-
var element = this._elementRef.nativeElement;
|
|
601
|
-
// Make sure that focus is still inside the dialog or is on the body (usually because a
|
|
602
|
-
// non-focusable element like the backdrop was clicked) before moving it. It's possible that
|
|
603
|
-
// the consumer moved it themselves before the animation was done, in which case we shouldn't
|
|
604
|
-
// do anything.
|
|
605
|
-
if (!activeElement || activeElement === this._document.body || activeElement === element ||
|
|
606
|
-
element.contains(activeElement)) {
|
|
607
|
-
toFocus.focus();
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
return CdkDialogContainer;
|
|
612
|
-
}(portal.BasePortalOutlet));
|
|
613
|
-
CdkDialogContainer.decorators = [
|
|
614
|
-
{ type: core.Component, args: [{
|
|
615
|
-
selector: 'cdk-dialog-container',
|
|
616
|
-
template: "<ng-template cdkPortalOutlet></ng-template>\n",
|
|
617
|
-
encapsulation: core.ViewEncapsulation.None,
|
|
618
|
-
// Using OnPush for dialogs caused some G3 sync issues. Disabled until we can track them down.
|
|
619
|
-
// tslint:disable-next-line:validate-decorators
|
|
620
|
-
changeDetection: core.ChangeDetectionStrategy.Default,
|
|
621
|
-
animations: [
|
|
622
|
-
animations.trigger('dialog', [
|
|
623
|
-
animations.state('enter', animations.style({ opacity: 1 })),
|
|
624
|
-
animations.state('exit, void', animations.style({ opacity: 0 })),
|
|
625
|
-
animations.transition('* => enter', animations.animate('{{enterAnimationDuration}}')),
|
|
626
|
-
animations.transition('* => exit, * => void', animations.animate('{{exitAnimationDuration}}')),
|
|
627
|
-
])
|
|
628
|
-
],
|
|
629
|
-
host: {
|
|
630
|
-
'[@dialog]': "{\n value: _state,\n params: {\n enterAnimationDuration: _config.enterAnimationDuration,\n exitAnimationDuration: _config.exitAnimationDuration\n }\n }",
|
|
631
|
-
'(@dialog.start)': '_onAnimationStart($event)',
|
|
632
|
-
'(@dialog.done)': '_animationDone.next($event)',
|
|
633
|
-
},
|
|
634
|
-
styles: ["cdk-dialog-container{background:#fff;border-radius:5px;display:block;padding:10px}\n"]
|
|
635
|
-
},] }
|
|
636
|
-
];
|
|
637
|
-
CdkDialogContainer.ctorParameters = function () { return [
|
|
638
|
-
{ type: core.ElementRef },
|
|
639
|
-
{ type: a11y.FocusTrapFactory },
|
|
640
|
-
{ type: core.ChangeDetectorRef },
|
|
641
|
-
{ type: a11y.InteractivityChecker },
|
|
642
|
-
{ type: core.NgZone },
|
|
643
|
-
{ type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [common.DOCUMENT,] }] },
|
|
644
|
-
{ type: DialogConfig }
|
|
645
|
-
]; };
|
|
646
|
-
CdkDialogContainer.propDecorators = {
|
|
647
|
-
_ariaLabel: [{ type: core.HostBinding, args: ['attr.aria-label',] }],
|
|
648
|
-
_ariaDescribedBy: [{ type: core.HostBinding, args: ['attr.aria-describedby',] }],
|
|
649
|
-
_role: [{ type: core.HostBinding, args: ['attr.role',] }],
|
|
650
|
-
_ariaModal: [{ type: core.HostBinding, args: ['attr.aria-modal',] }],
|
|
651
|
-
_tabindex: [{ type: core.HostBinding, args: ['attr.tabindex',] }],
|
|
652
|
-
_portalHost: [{ type: core.ViewChild, args: [portal.CdkPortalOutlet, { static: true },] }]
|
|
653
|
-
};
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* @license
|
|
657
|
-
* Copyright Google LLC All Rights Reserved.
|
|
658
|
-
*
|
|
659
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
660
|
-
* found in the LICENSE file at https://angular.io/license
|
|
661
|
-
*/
|
|
662
|
-
/** Unique id for the created dialog. */
|
|
663
|
-
var uniqueId = 0;
|
|
664
|
-
/**
|
|
665
|
-
* Reference to a dialog opened via the Dialog service.
|
|
666
|
-
*/
|
|
667
|
-
var DialogRef = /** @class */ (function () {
|
|
668
|
-
function DialogRef(_overlayRef, _containerInstance, id) {
|
|
669
|
-
var _this = this;
|
|
670
|
-
if (id === void 0) { id = "dialog-" + uniqueId++; }
|
|
671
|
-
this._overlayRef = _overlayRef;
|
|
672
|
-
this._containerInstance = _containerInstance;
|
|
673
|
-
this.id = id;
|
|
674
|
-
// If the dialog has a backdrop, handle clicks from the backdrop.
|
|
675
|
-
if (_containerInstance._config.hasBackdrop) {
|
|
676
|
-
_overlayRef.backdropClick().subscribe(function () {
|
|
677
|
-
if (!_this.disableClose) {
|
|
678
|
-
_this.close();
|
|
679
|
-
}
|
|
680
|
-
});
|
|
681
|
-
}
|
|
682
|
-
this.beforeClosed().subscribe(function () {
|
|
683
|
-
_this._overlayRef.detachBackdrop();
|
|
684
|
-
});
|
|
685
|
-
this.afterClosed().subscribe(function () {
|
|
686
|
-
_this._overlayRef.detach();
|
|
687
|
-
_this._overlayRef.dispose();
|
|
688
|
-
_this.componentInstance = null;
|
|
689
|
-
});
|
|
690
|
-
// Close when escape keydown event occurs
|
|
691
|
-
_overlayRef.keydownEvents()
|
|
692
|
-
.pipe(operators.filter(function (event) {
|
|
693
|
-
return event.keyCode === keycodes.ESCAPE && !_this.disableClose && !keycodes.hasModifierKey(event);
|
|
694
|
-
}))
|
|
695
|
-
.subscribe(function (event) {
|
|
696
|
-
event.preventDefault();
|
|
697
|
-
_this.close();
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
/** Gets an observable that emits when the overlay's backdrop has been clicked. */
|
|
701
|
-
DialogRef.prototype.backdropClick = function () {
|
|
702
|
-
return this._overlayRef.backdropClick();
|
|
703
|
-
};
|
|
704
|
-
/**
|
|
705
|
-
* Close the dialog.
|
|
706
|
-
* @param dialogResult Optional result to return to the dialog opener.
|
|
707
|
-
*/
|
|
708
|
-
DialogRef.prototype.close = function (dialogResult) {
|
|
709
|
-
this._result = dialogResult;
|
|
710
|
-
this._containerInstance._startExiting();
|
|
711
|
-
};
|
|
712
|
-
/**
|
|
713
|
-
* Updates the dialog's position.
|
|
714
|
-
* @param position New dialog position.
|
|
715
|
-
*/
|
|
716
|
-
DialogRef.prototype.updatePosition = function (position) {
|
|
717
|
-
var strategy = this._getPositionStrategy();
|
|
718
|
-
if (position && (position.left || position.right)) {
|
|
719
|
-
position.left ? strategy.left(position.left) : strategy.right(position.right);
|
|
720
|
-
}
|
|
721
|
-
else {
|
|
722
|
-
strategy.centerHorizontally();
|
|
723
|
-
}
|
|
724
|
-
if (position && (position.top || position.bottom)) {
|
|
725
|
-
position.top ? strategy.top(position.top) : strategy.bottom(position.bottom);
|
|
726
|
-
}
|
|
727
|
-
else {
|
|
728
|
-
strategy.centerVertically();
|
|
729
|
-
}
|
|
730
|
-
this._overlayRef.updatePosition();
|
|
731
|
-
return this;
|
|
732
|
-
};
|
|
733
|
-
/**
|
|
734
|
-
* Gets an observable that emits when keydown events are targeted on the overlay.
|
|
735
|
-
*/
|
|
736
|
-
DialogRef.prototype.keydownEvents = function () {
|
|
737
|
-
return this._overlayRef.keydownEvents();
|
|
738
|
-
};
|
|
739
|
-
/**
|
|
740
|
-
* Updates the dialog's width and height, defined, min and max.
|
|
741
|
-
* @param size New size for the overlay.
|
|
742
|
-
*/
|
|
743
|
-
DialogRef.prototype.updateSize = function (size) {
|
|
744
|
-
this._overlayRef.updateSize(size);
|
|
745
|
-
this._overlayRef.updatePosition();
|
|
746
|
-
return this;
|
|
747
|
-
};
|
|
748
|
-
/** Fetches the position strategy object from the overlay ref. */
|
|
749
|
-
DialogRef.prototype._getPositionStrategy = function () {
|
|
750
|
-
return this._overlayRef.getConfig().positionStrategy;
|
|
751
|
-
};
|
|
752
|
-
/** Gets an observable that emits when dialog begins opening. */
|
|
753
|
-
DialogRef.prototype.beforeOpened = function () {
|
|
754
|
-
return this._containerInstance._beforeEnter;
|
|
755
|
-
};
|
|
756
|
-
/** Gets an observable that emits when dialog is finished opening. */
|
|
757
|
-
DialogRef.prototype.afterOpened = function () {
|
|
758
|
-
return this._containerInstance._afterEnter;
|
|
759
|
-
};
|
|
760
|
-
/** Gets an observable that emits when dialog begins closing. */
|
|
761
|
-
DialogRef.prototype.beforeClosed = function () {
|
|
762
|
-
var _this = this;
|
|
763
|
-
return this._containerInstance._beforeExit.pipe(operators.map(function () { return _this._result; }));
|
|
764
|
-
};
|
|
765
|
-
/** Gets an observable that emits when dialog is finished closing. */
|
|
766
|
-
DialogRef.prototype.afterClosed = function () {
|
|
767
|
-
var _this = this;
|
|
768
|
-
return this._containerInstance._afterExit.pipe(operators.map(function () { return _this._result; }));
|
|
769
|
-
};
|
|
770
|
-
return DialogRef;
|
|
771
|
-
}());
|
|
772
|
-
|
|
773
|
-
/**
|
|
774
|
-
* @license
|
|
775
|
-
* Copyright Google LLC All Rights Reserved.
|
|
776
|
-
*
|
|
777
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
778
|
-
* found in the LICENSE file at https://angular.io/license
|
|
779
|
-
*/
|
|
780
|
-
/** Injection token for the Dialog's ScrollStrategy. */
|
|
781
|
-
var DIALOG_SCROLL_STRATEGY = new core.InjectionToken('DialogScrollStrategy');
|
|
782
|
-
/** Injection token for the Dialog's Data. */
|
|
783
|
-
var DIALOG_DATA = new core.InjectionToken('DialogData');
|
|
784
|
-
/** Injection token for the DialogRef constructor. */
|
|
785
|
-
var DIALOG_REF = new core.InjectionToken('DialogRef');
|
|
786
|
-
/** Injection token for the DialogConfig. */
|
|
787
|
-
var DIALOG_CONFIG = new core.InjectionToken('DialogConfig');
|
|
788
|
-
/** Injection token for the Dialog's DialogContainer component. */
|
|
789
|
-
var DIALOG_CONTAINER = new core.InjectionToken('DialogContainer');
|
|
790
|
-
/** @docs-private */
|
|
791
|
-
function MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
|
|
792
|
-
return function () { return overlay.scrollStrategies.block(); };
|
|
793
|
-
}
|
|
794
|
-
/** @docs-private */
|
|
795
|
-
var MAT_DIALOG_SCROLL_STRATEGY_PROVIDER = {
|
|
796
|
-
provide: DIALOG_SCROLL_STRATEGY,
|
|
797
|
-
deps: [overlay.Overlay],
|
|
798
|
-
useFactory: MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,
|
|
799
|
-
};
|
|
800
|
-
|
|
801
|
-
/**
|
|
802
|
-
* @license
|
|
803
|
-
* Copyright Google LLC All Rights Reserved.
|
|
804
|
-
*
|
|
805
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
806
|
-
* found in the LICENSE file at https://angular.io/license
|
|
807
|
-
*/
|
|
808
|
-
/**
|
|
809
|
-
* Service to open modal dialogs.
|
|
810
|
-
*/
|
|
811
|
-
var Dialog = /** @class */ (function () {
|
|
812
|
-
function Dialog(_overlay, _injector, _dialogRefConstructor,
|
|
813
|
-
// TODO(crisbeto): the `any` here can be replaced
|
|
814
|
-
// with the proper type once we start using Ivy.
|
|
815
|
-
scrollStrategy, _parentDialog, location) {
|
|
816
|
-
var _this = this;
|
|
817
|
-
this._overlay = _overlay;
|
|
818
|
-
this._injector = _injector;
|
|
819
|
-
this._dialogRefConstructor = _dialogRefConstructor;
|
|
820
|
-
this._parentDialog = _parentDialog;
|
|
821
|
-
this._afterAllClosedBase = new rxjs.Subject();
|
|
822
|
-
// TODO(jelbourn): tighten the type on the right-hand side of this expression.
|
|
823
|
-
this.afterAllClosed = rxjs.defer(function () { return _this.openDialogs.length ?
|
|
824
|
-
_this._getAfterAllClosed() : _this._getAfterAllClosed().pipe(operators.startWith(undefined)); });
|
|
825
|
-
this._afterOpened = new rxjs.Subject();
|
|
826
|
-
this._openDialogs = [];
|
|
827
|
-
// Close all of the dialogs when the user goes forwards/backwards in history or when the
|
|
828
|
-
// location hash changes. Note that this usually doesn't include clicking on links (unless
|
|
829
|
-
// the user is using the `HashLocationStrategy`).
|
|
830
|
-
if (!_parentDialog && location) {
|
|
831
|
-
location.subscribe(function () { return _this.closeAll(); });
|
|
832
|
-
}
|
|
833
|
-
this._scrollStrategy = scrollStrategy;
|
|
834
|
-
}
|
|
835
|
-
/** Stream that emits when all dialogs are closed. */
|
|
836
|
-
Dialog.prototype._getAfterAllClosed = function () {
|
|
837
|
-
return this._parentDialog ? this._parentDialog.afterAllClosed : this._afterAllClosedBase;
|
|
838
|
-
};
|
|
839
|
-
Object.defineProperty(Dialog.prototype, "afterOpened", {
|
|
840
|
-
/** Stream that emits when a dialog is opened. */
|
|
841
|
-
get: function () {
|
|
842
|
-
return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpened;
|
|
843
|
-
},
|
|
844
|
-
enumerable: false,
|
|
845
|
-
configurable: true
|
|
846
|
-
});
|
|
847
|
-
Object.defineProperty(Dialog.prototype, "openDialogs", {
|
|
848
|
-
/** Stream that emits when a dialog is opened. */
|
|
849
|
-
get: function () {
|
|
850
|
-
return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogs;
|
|
851
|
-
},
|
|
852
|
-
enumerable: false,
|
|
853
|
-
configurable: true
|
|
854
|
-
});
|
|
855
|
-
/** Gets an open dialog by id. */
|
|
856
|
-
Dialog.prototype.getById = function (id) {
|
|
857
|
-
return this._openDialogs.find(function (ref) { return ref.id === id; });
|
|
858
|
-
};
|
|
859
|
-
/** Closes all open dialogs. */
|
|
860
|
-
Dialog.prototype.closeAll = function () {
|
|
861
|
-
this.openDialogs.forEach(function (ref) { return ref.close(); });
|
|
862
|
-
};
|
|
863
|
-
/** Opens a dialog from a component. */
|
|
864
|
-
Dialog.prototype.openFromComponent = function (component, config) {
|
|
865
|
-
config = this._applyConfigDefaults(config);
|
|
866
|
-
if (config.id && this.getById(config.id) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
867
|
-
throw Error("Dialog with id \"" + config.id + "\" exists already. The dialog id must be unique.");
|
|
868
|
-
}
|
|
869
|
-
var overlayRef = this._createOverlay(config);
|
|
870
|
-
var dialogContainer = this._attachDialogContainer(overlayRef, config);
|
|
871
|
-
var dialogRef = this._attachDialogContentForComponent(component, dialogContainer, overlayRef, config);
|
|
872
|
-
this._registerDialogRef(dialogRef);
|
|
873
|
-
dialogContainer._initializeWithAttachedContent();
|
|
874
|
-
return dialogRef;
|
|
875
|
-
};
|
|
876
|
-
/** Opens a dialog from a template. */
|
|
877
|
-
Dialog.prototype.openFromTemplate = function (template, config) {
|
|
878
|
-
config = this._applyConfigDefaults(config);
|
|
879
|
-
if (config.id && this.getById(config.id) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
880
|
-
throw Error("Dialog with id \"" + config.id + "\" exists already. The dialog id must be unique.");
|
|
881
|
-
}
|
|
882
|
-
var overlayRef = this._createOverlay(config);
|
|
883
|
-
var dialogContainer = this._attachDialogContainer(overlayRef, config);
|
|
884
|
-
var dialogRef = this._attachDialogContentForTemplate(template, dialogContainer, overlayRef, config);
|
|
885
|
-
this._registerDialogRef(dialogRef);
|
|
886
|
-
dialogContainer._initializeWithAttachedContent();
|
|
887
|
-
return dialogRef;
|
|
888
|
-
};
|
|
889
|
-
Dialog.prototype.ngOnDestroy = function () {
|
|
890
|
-
// Only close all the dialogs at this level.
|
|
891
|
-
this._openDialogs.forEach(function (ref) { return ref.close(); });
|
|
892
|
-
};
|
|
893
|
-
/**
|
|
894
|
-
* Forwards emitting events for when dialogs are opened and all dialogs are closed.
|
|
895
|
-
*/
|
|
896
|
-
Dialog.prototype._registerDialogRef = function (dialogRef) {
|
|
897
|
-
var _this = this;
|
|
898
|
-
this.openDialogs.push(dialogRef);
|
|
899
|
-
var dialogOpenSub = dialogRef.afterOpened().subscribe(function () {
|
|
900
|
-
_this.afterOpened.next(dialogRef);
|
|
901
|
-
dialogOpenSub.unsubscribe();
|
|
902
|
-
});
|
|
903
|
-
var dialogCloseSub = dialogRef.afterClosed().subscribe(function () {
|
|
904
|
-
var dialogIndex = _this._openDialogs.indexOf(dialogRef);
|
|
905
|
-
if (dialogIndex > -1) {
|
|
906
|
-
_this._openDialogs.splice(dialogIndex, 1);
|
|
907
|
-
}
|
|
908
|
-
if (!_this._openDialogs.length) {
|
|
909
|
-
_this._afterAllClosedBase.next();
|
|
910
|
-
dialogCloseSub.unsubscribe();
|
|
911
|
-
}
|
|
912
|
-
});
|
|
913
|
-
};
|
|
914
|
-
/**
|
|
915
|
-
* Creates an overlay config from a dialog config.
|
|
916
|
-
* @param config The dialog configuration.
|
|
917
|
-
* @returns The overlay configuration.
|
|
918
|
-
*/
|
|
919
|
-
Dialog.prototype._createOverlay = function (config) {
|
|
920
|
-
var overlayConfig = new overlay.OverlayConfig({
|
|
921
|
-
positionStrategy: this._overlay.position().global(),
|
|
922
|
-
scrollStrategy: this._scrollStrategy(),
|
|
923
|
-
panelClass: config.panelClass,
|
|
924
|
-
hasBackdrop: config.hasBackdrop,
|
|
925
|
-
direction: config.direction,
|
|
926
|
-
minWidth: config.minWidth,
|
|
927
|
-
minHeight: config.minHeight,
|
|
928
|
-
maxWidth: config.maxWidth,
|
|
929
|
-
maxHeight: config.maxHeight
|
|
930
|
-
});
|
|
931
|
-
if (config.backdropClass) {
|
|
932
|
-
overlayConfig.backdropClass = config.backdropClass;
|
|
933
|
-
}
|
|
934
|
-
return this._overlay.create(overlayConfig);
|
|
935
|
-
};
|
|
936
|
-
/**
|
|
937
|
-
* Attaches an MatDialogContainer to a dialog's already-created overlay.
|
|
938
|
-
* @param overlay Reference to the dialog's underlying overlay.
|
|
939
|
-
* @param config The dialog configuration.
|
|
940
|
-
* @returns A promise resolving to a ComponentRef for the attached container.
|
|
941
|
-
*/
|
|
942
|
-
Dialog.prototype._attachDialogContainer = function (overlay, config) {
|
|
943
|
-
var container = config.containerComponent || this._injector.get(DIALOG_CONTAINER);
|
|
944
|
-
var userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
|
|
945
|
-
var injector = core.Injector.create({
|
|
946
|
-
parent: userInjector || this._injector,
|
|
947
|
-
providers: [{ provide: DialogConfig, useValue: config }]
|
|
948
|
-
});
|
|
949
|
-
var containerPortal = new portal.ComponentPortal(container, config.viewContainerRef, injector);
|
|
950
|
-
var containerRef = overlay.attach(containerPortal);
|
|
951
|
-
containerRef.instance._config = config;
|
|
952
|
-
return containerRef.instance;
|
|
953
|
-
};
|
|
954
|
-
/**
|
|
955
|
-
* Attaches the user-provided component to the already-created MatDialogContainer.
|
|
956
|
-
* @param componentOrTemplateRef The type of component being loaded into the dialog,
|
|
957
|
-
* or a TemplateRef to instantiate as the content.
|
|
958
|
-
* @param dialogContainer Reference to the wrapping MatDialogContainer.
|
|
959
|
-
* @param overlayRef Reference to the overlay in which the dialog resides.
|
|
960
|
-
* @param config The dialog configuration.
|
|
961
|
-
* @returns A promise resolving to the MatDialogRef that should be returned to the user.
|
|
962
|
-
*/
|
|
963
|
-
Dialog.prototype._attachDialogContentForComponent = function (componentOrTemplateRef, dialogContainer, overlayRef, config) {
|
|
964
|
-
// Create a reference to the dialog we're creating in order to give the user a handle
|
|
965
|
-
// to modify and close it.
|
|
966
|
-
var dialogRef = this._createDialogRef(overlayRef, dialogContainer, config);
|
|
967
|
-
var injector = this._createInjector(config, dialogRef, dialogContainer);
|
|
968
|
-
var contentRef = dialogContainer.attachComponentPortal(new portal.ComponentPortal(componentOrTemplateRef, undefined, injector));
|
|
969
|
-
dialogRef.componentInstance = contentRef.instance;
|
|
970
|
-
return dialogRef;
|
|
971
|
-
};
|
|
972
|
-
/**
|
|
973
|
-
* Attaches the user-provided component to the already-created MatDialogContainer.
|
|
974
|
-
* @param componentOrTemplateRef The type of component being loaded into the dialog,
|
|
975
|
-
* or a TemplateRef to instantiate as the content.
|
|
976
|
-
* @param dialogContainer Reference to the wrapping MatDialogContainer.
|
|
977
|
-
* @param overlayRef Reference to the overlay in which the dialog resides.
|
|
978
|
-
* @param config The dialog configuration.
|
|
979
|
-
* @returns A promise resolving to the MatDialogRef that should be returned to the user.
|
|
980
|
-
*/
|
|
981
|
-
Dialog.prototype._attachDialogContentForTemplate = function (componentOrTemplateRef, dialogContainer, overlayRef, config) {
|
|
982
|
-
// Create a reference to the dialog we're creating in order to give the user a handle
|
|
983
|
-
// to modify and close it.
|
|
984
|
-
var dialogRef = this._createDialogRef(overlayRef, dialogContainer, config);
|
|
985
|
-
dialogContainer.attachTemplatePortal(new portal.TemplatePortal(componentOrTemplateRef, null, { $implicit: config.data, dialogRef: dialogRef }));
|
|
986
|
-
return dialogRef;
|
|
987
|
-
};
|
|
988
|
-
/**
|
|
989
|
-
* Creates a custom injector to be used inside the dialog. This allows a component loaded inside
|
|
990
|
-
* of a dialog to close itself and, optionally, to return a value.
|
|
991
|
-
* @param config Config object that is used to construct the dialog.
|
|
992
|
-
* @param dialogRef Reference to the dialog.
|
|
993
|
-
* @param container Dialog container element that wraps all of the contents.
|
|
994
|
-
* @returns The custom injector that can be used inside the dialog.
|
|
995
|
-
*/
|
|
996
|
-
Dialog.prototype._createInjector = function (config, dialogRef, dialogContainer) {
|
|
997
|
-
var userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
|
|
998
|
-
var providers = [
|
|
999
|
-
{ provide: this._injector.get(DIALOG_REF), useValue: dialogRef },
|
|
1000
|
-
{ provide: this._injector.get(DIALOG_CONTAINER), useValue: dialogContainer },
|
|
1001
|
-
{ provide: DIALOG_DATA, useValue: config.data }
|
|
1002
|
-
];
|
|
1003
|
-
if (config.direction && (!userInjector ||
|
|
1004
|
-
!userInjector.get(bidi.Directionality, null, core.InjectFlags.Optional))) {
|
|
1005
|
-
providers.push({
|
|
1006
|
-
provide: bidi.Directionality,
|
|
1007
|
-
useValue: { value: config.direction, change: rxjs.of() }
|
|
1008
|
-
});
|
|
1009
|
-
}
|
|
1010
|
-
return core.Injector.create({ parent: userInjector || this._injector, providers: providers });
|
|
1011
|
-
};
|
|
1012
|
-
/** Creates a new dialog ref. */
|
|
1013
|
-
Dialog.prototype._createDialogRef = function (overlayRef, dialogContainer, config) {
|
|
1014
|
-
var dialogRef = new this._dialogRefConstructor(overlayRef, dialogContainer, config.id);
|
|
1015
|
-
dialogRef.disableClose = config.disableClose;
|
|
1016
|
-
dialogRef.updateSize(config).updatePosition(config.position);
|
|
1017
|
-
return dialogRef;
|
|
1018
|
-
};
|
|
1019
|
-
/**
|
|
1020
|
-
* Expands the provided configuration object to include the default values for properties which
|
|
1021
|
-
* are undefined.
|
|
1022
|
-
*/
|
|
1023
|
-
Dialog.prototype._applyConfigDefaults = function (config) {
|
|
1024
|
-
var dialogConfig = this._injector.get(DIALOG_CONFIG);
|
|
1025
|
-
return Object.assign(Object.assign({}, new dialogConfig()), config);
|
|
1026
|
-
};
|
|
1027
|
-
return Dialog;
|
|
1028
|
-
}());
|
|
1029
|
-
Dialog.decorators = [
|
|
1030
|
-
{ type: core.Injectable }
|
|
1031
|
-
];
|
|
1032
|
-
Dialog.ctorParameters = function () { return [
|
|
1033
|
-
{ type: overlay.Overlay },
|
|
1034
|
-
{ type: core.Injector },
|
|
1035
|
-
{ type: core.Type, decorators: [{ type: core.Inject, args: [DIALOG_REF,] }] },
|
|
1036
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: [DIALOG_SCROLL_STRATEGY,] }] },
|
|
1037
|
-
{ type: Dialog, decorators: [{ type: core.Optional }, { type: core.SkipSelf }] },
|
|
1038
|
-
{ type: common.Location, decorators: [{ type: core.Optional }] }
|
|
1039
|
-
]; };
|
|
1040
|
-
|
|
1041
|
-
/**
|
|
1042
|
-
* @license
|
|
1043
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1044
|
-
*
|
|
1045
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1046
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1047
|
-
*/
|
|
1048
|
-
var ɵ0 = DialogRef, ɵ1 = CdkDialogContainer, ɵ2 = DialogConfig;
|
|
1049
|
-
var DialogModule = /** @class */ (function () {
|
|
1050
|
-
function DialogModule() {
|
|
1051
|
-
}
|
|
1052
|
-
return DialogModule;
|
|
1053
|
-
}());
|
|
1054
|
-
DialogModule.decorators = [
|
|
1055
|
-
{ type: core.NgModule, args: [{
|
|
1056
|
-
imports: [
|
|
1057
|
-
overlay.OverlayModule,
|
|
1058
|
-
portal.PortalModule,
|
|
1059
|
-
a11y.A11yModule,
|
|
1060
|
-
],
|
|
1061
|
-
exports: [
|
|
1062
|
-
// Re-export the PortalModule so that people extending the `CdkDialogContainer`
|
|
1063
|
-
// don't have to remember to import it or be faced with an unhelpful error.
|
|
1064
|
-
portal.PortalModule,
|
|
1065
|
-
CdkDialogContainer,
|
|
1066
|
-
],
|
|
1067
|
-
declarations: [
|
|
1068
|
-
CdkDialogContainer,
|
|
1069
|
-
],
|
|
1070
|
-
providers: [
|
|
1071
|
-
Dialog,
|
|
1072
|
-
MAT_DIALOG_SCROLL_STRATEGY_PROVIDER,
|
|
1073
|
-
{ provide: DIALOG_REF, useValue: ɵ0 },
|
|
1074
|
-
{ provide: DIALOG_CONTAINER, useValue: ɵ1 },
|
|
1075
|
-
{ provide: DIALOG_CONFIG, useValue: ɵ2 },
|
|
1076
|
-
],
|
|
1077
|
-
entryComponents: [CdkDialogContainer],
|
|
1078
|
-
},] }
|
|
1079
|
-
];
|
|
1080
|
-
|
|
1081
|
-
/**
|
|
1082
|
-
* @license
|
|
1083
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1084
|
-
*
|
|
1085
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1086
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1087
|
-
*/
|
|
1088
|
-
|
|
1089
|
-
/**
|
|
1090
|
-
* Generated bundle index. Do not edit.
|
|
1091
|
-
*/
|
|
1092
|
-
|
|
1093
|
-
exports.CdkDialogContainer = CdkDialogContainer;
|
|
1094
|
-
exports.DIALOG_CONFIG = DIALOG_CONFIG;
|
|
1095
|
-
exports.DIALOG_CONTAINER = DIALOG_CONTAINER;
|
|
1096
|
-
exports.DIALOG_DATA = DIALOG_DATA;
|
|
1097
|
-
exports.DIALOG_REF = DIALOG_REF;
|
|
1098
|
-
exports.DIALOG_SCROLL_STRATEGY = DIALOG_SCROLL_STRATEGY;
|
|
1099
|
-
exports.Dialog = Dialog;
|
|
1100
|
-
exports.DialogConfig = DialogConfig;
|
|
1101
|
-
exports.DialogModule = DialogModule;
|
|
1102
|
-
exports.DialogRef = DialogRef;
|
|
1103
|
-
exports.MAT_DIALOG_SCROLL_STRATEGY_PROVIDER = MAT_DIALOG_SCROLL_STRATEGY_PROVIDER;
|
|
1104
|
-
exports.MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY = MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY;
|
|
1105
|
-
exports.throwDialogContentAlreadyAttachedError = throwDialogContentAlreadyAttachedError;
|
|
1106
|
-
exports.ɵ0 = ɵ0;
|
|
1107
|
-
exports.ɵ1 = ɵ1;
|
|
1108
|
-
exports.ɵ2 = ɵ2;
|
|
1109
|
-
|
|
1110
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1111
|
-
|
|
1112
|
-
})));
|
|
1113
|
-
//# sourceMappingURL=cdk-experimental-dialog.umd.js.map
|