@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,1679 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/forms'), require('@angular/cdk/bidi'), require('@angular/cdk/keycodes'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/cdk/a11y'), require('@angular/cdk/scrolling'), require('@angular/common')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@angular/cdk-experimental/popover-edit', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/forms', '@angular/cdk/bidi', '@angular/cdk/keycodes', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/cdk/a11y', '@angular/cdk/scrolling', '@angular/common'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ng = global.ng || {}, global.ng.cdkExperimental = global.ng.cdkExperimental || {}, global.ng.cdkExperimental.popoverEdit = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.forms, global.ng.cdk.bidi, global.ng.cdk.keycodes, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.cdk.a11y, global.ng.cdk.scrolling, global.ng.common));
|
|
5
|
-
}(this, (function (exports, i0, rxjs, operators, forms, i1, keycodes, overlay, portal, i1$1, scrolling, i2) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopNamespace(e) {
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
9
|
-
var n = Object.create(null);
|
|
10
|
-
if (e) {
|
|
11
|
-
Object.keys(e).forEach(function (k) {
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () {
|
|
17
|
-
return e[k];
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
n['default'] = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
29
|
-
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
30
|
-
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
31
|
-
|
|
32
|
-
/*! *****************************************************************************
|
|
33
|
-
Copyright (c) Microsoft Corporation.
|
|
34
|
-
|
|
35
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
36
|
-
purpose with or without fee is hereby granted.
|
|
37
|
-
|
|
38
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
39
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
40
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
41
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
42
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
43
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
44
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
45
|
-
***************************************************************************** */
|
|
46
|
-
/* global Reflect, Promise */
|
|
47
|
-
var extendStatics = function (d, b) {
|
|
48
|
-
extendStatics = Object.setPrototypeOf ||
|
|
49
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
50
|
-
function (d, b) { for (var p in b)
|
|
51
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
52
|
-
d[p] = b[p]; };
|
|
53
|
-
return extendStatics(d, b);
|
|
54
|
-
};
|
|
55
|
-
function __extends(d, b) {
|
|
56
|
-
if (typeof b !== "function" && b !== null)
|
|
57
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
58
|
-
extendStatics(d, b);
|
|
59
|
-
function __() { this.constructor = d; }
|
|
60
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
61
|
-
}
|
|
62
|
-
var __assign = function () {
|
|
63
|
-
__assign = Object.assign || function __assign(t) {
|
|
64
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
65
|
-
s = arguments[i];
|
|
66
|
-
for (var p in s)
|
|
67
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
68
|
-
t[p] = s[p];
|
|
69
|
-
}
|
|
70
|
-
return t;
|
|
71
|
-
};
|
|
72
|
-
return __assign.apply(this, arguments);
|
|
73
|
-
};
|
|
74
|
-
function __rest(s, e) {
|
|
75
|
-
var t = {};
|
|
76
|
-
for (var p in s)
|
|
77
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
78
|
-
t[p] = s[p];
|
|
79
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
80
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
81
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
82
|
-
t[p[i]] = s[p[i]];
|
|
83
|
-
}
|
|
84
|
-
return t;
|
|
85
|
-
}
|
|
86
|
-
function __decorate(decorators, target, key, desc) {
|
|
87
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
88
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
89
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
90
|
-
else
|
|
91
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
92
|
-
if (d = decorators[i])
|
|
93
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
94
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
95
|
-
}
|
|
96
|
-
function __param(paramIndex, decorator) {
|
|
97
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
98
|
-
}
|
|
99
|
-
function __metadata(metadataKey, metadataValue) {
|
|
100
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
101
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
102
|
-
}
|
|
103
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
104
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
105
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
106
|
-
function fulfilled(value) { try {
|
|
107
|
-
step(generator.next(value));
|
|
108
|
-
}
|
|
109
|
-
catch (e) {
|
|
110
|
-
reject(e);
|
|
111
|
-
} }
|
|
112
|
-
function rejected(value) { try {
|
|
113
|
-
step(generator["throw"](value));
|
|
114
|
-
}
|
|
115
|
-
catch (e) {
|
|
116
|
-
reject(e);
|
|
117
|
-
} }
|
|
118
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
119
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function __generator(thisArg, body) {
|
|
123
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
124
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
125
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
126
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
127
|
-
function step(op) {
|
|
128
|
-
if (f)
|
|
129
|
-
throw new TypeError("Generator is already executing.");
|
|
130
|
-
while (_)
|
|
131
|
-
try {
|
|
132
|
-
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)
|
|
133
|
-
return t;
|
|
134
|
-
if (y = 0, t)
|
|
135
|
-
op = [op[0] & 2, t.value];
|
|
136
|
-
switch (op[0]) {
|
|
137
|
-
case 0:
|
|
138
|
-
case 1:
|
|
139
|
-
t = op;
|
|
140
|
-
break;
|
|
141
|
-
case 4:
|
|
142
|
-
_.label++;
|
|
143
|
-
return { value: op[1], done: false };
|
|
144
|
-
case 5:
|
|
145
|
-
_.label++;
|
|
146
|
-
y = op[1];
|
|
147
|
-
op = [0];
|
|
148
|
-
continue;
|
|
149
|
-
case 7:
|
|
150
|
-
op = _.ops.pop();
|
|
151
|
-
_.trys.pop();
|
|
152
|
-
continue;
|
|
153
|
-
default:
|
|
154
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
155
|
-
_ = 0;
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
159
|
-
_.label = op[1];
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
163
|
-
_.label = t[1];
|
|
164
|
-
t = op;
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
if (t && _.label < t[2]) {
|
|
168
|
-
_.label = t[2];
|
|
169
|
-
_.ops.push(op);
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
if (t[2])
|
|
173
|
-
_.ops.pop();
|
|
174
|
-
_.trys.pop();
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
op = body.call(thisArg, _);
|
|
178
|
-
}
|
|
179
|
-
catch (e) {
|
|
180
|
-
op = [6, e];
|
|
181
|
-
y = 0;
|
|
182
|
-
}
|
|
183
|
-
finally {
|
|
184
|
-
f = t = 0;
|
|
185
|
-
}
|
|
186
|
-
if (op[0] & 5)
|
|
187
|
-
throw op[1];
|
|
188
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
192
|
-
if (k2 === undefined)
|
|
193
|
-
k2 = k;
|
|
194
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
195
|
-
}) : (function (o, m, k, k2) {
|
|
196
|
-
if (k2 === undefined)
|
|
197
|
-
k2 = k;
|
|
198
|
-
o[k2] = m[k];
|
|
199
|
-
});
|
|
200
|
-
function __exportStar(m, o) {
|
|
201
|
-
for (var p in m)
|
|
202
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
203
|
-
__createBinding(o, m, p);
|
|
204
|
-
}
|
|
205
|
-
function __values(o) {
|
|
206
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
207
|
-
if (m)
|
|
208
|
-
return m.call(o);
|
|
209
|
-
if (o && typeof o.length === "number")
|
|
210
|
-
return {
|
|
211
|
-
next: function () {
|
|
212
|
-
if (o && i >= o.length)
|
|
213
|
-
o = void 0;
|
|
214
|
-
return { value: o && o[i++], done: !o };
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
218
|
-
}
|
|
219
|
-
function __read(o, n) {
|
|
220
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
221
|
-
if (!m)
|
|
222
|
-
return o;
|
|
223
|
-
var i = m.call(o), r, ar = [], e;
|
|
224
|
-
try {
|
|
225
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
226
|
-
ar.push(r.value);
|
|
227
|
-
}
|
|
228
|
-
catch (error) {
|
|
229
|
-
e = { error: error };
|
|
230
|
-
}
|
|
231
|
-
finally {
|
|
232
|
-
try {
|
|
233
|
-
if (r && !r.done && (m = i["return"]))
|
|
234
|
-
m.call(i);
|
|
235
|
-
}
|
|
236
|
-
finally {
|
|
237
|
-
if (e)
|
|
238
|
-
throw e.error;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return ar;
|
|
242
|
-
}
|
|
243
|
-
/** @deprecated */
|
|
244
|
-
function __spread() {
|
|
245
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
246
|
-
ar = ar.concat(__read(arguments[i]));
|
|
247
|
-
return ar;
|
|
248
|
-
}
|
|
249
|
-
/** @deprecated */
|
|
250
|
-
function __spreadArrays() {
|
|
251
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
252
|
-
s += arguments[i].length;
|
|
253
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
254
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
255
|
-
r[k] = a[j];
|
|
256
|
-
return r;
|
|
257
|
-
}
|
|
258
|
-
function __spreadArray(to, from, pack) {
|
|
259
|
-
if (pack || arguments.length === 2)
|
|
260
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
261
|
-
if (ar || !(i in from)) {
|
|
262
|
-
if (!ar)
|
|
263
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
264
|
-
ar[i] = from[i];
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
268
|
-
}
|
|
269
|
-
function __await(v) {
|
|
270
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
271
|
-
}
|
|
272
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
273
|
-
if (!Symbol.asyncIterator)
|
|
274
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
275
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
276
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
277
|
-
function verb(n) { if (g[n])
|
|
278
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
279
|
-
function resume(n, v) { try {
|
|
280
|
-
step(g[n](v));
|
|
281
|
-
}
|
|
282
|
-
catch (e) {
|
|
283
|
-
settle(q[0][3], e);
|
|
284
|
-
} }
|
|
285
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
286
|
-
function fulfill(value) { resume("next", value); }
|
|
287
|
-
function reject(value) { resume("throw", value); }
|
|
288
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
289
|
-
resume(q[0][0], q[0][1]); }
|
|
290
|
-
}
|
|
291
|
-
function __asyncDelegator(o) {
|
|
292
|
-
var i, p;
|
|
293
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
294
|
-
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; }
|
|
295
|
-
}
|
|
296
|
-
function __asyncValues(o) {
|
|
297
|
-
if (!Symbol.asyncIterator)
|
|
298
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
299
|
-
var m = o[Symbol.asyncIterator], i;
|
|
300
|
-
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);
|
|
301
|
-
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); }); }; }
|
|
302
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
303
|
-
}
|
|
304
|
-
function __makeTemplateObject(cooked, raw) {
|
|
305
|
-
if (Object.defineProperty) {
|
|
306
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
cooked.raw = raw;
|
|
310
|
-
}
|
|
311
|
-
return cooked;
|
|
312
|
-
}
|
|
313
|
-
;
|
|
314
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
315
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
316
|
-
}) : function (o, v) {
|
|
317
|
-
o["default"] = v;
|
|
318
|
-
};
|
|
319
|
-
function __importStar(mod) {
|
|
320
|
-
if (mod && mod.__esModule)
|
|
321
|
-
return mod;
|
|
322
|
-
var result = {};
|
|
323
|
-
if (mod != null)
|
|
324
|
-
for (var k in mod)
|
|
325
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
326
|
-
__createBinding(result, mod, k);
|
|
327
|
-
__setModuleDefault(result, mod);
|
|
328
|
-
return result;
|
|
329
|
-
}
|
|
330
|
-
function __importDefault(mod) {
|
|
331
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
332
|
-
}
|
|
333
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
334
|
-
if (kind === "a" && !f)
|
|
335
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
336
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
337
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
338
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
339
|
-
}
|
|
340
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
341
|
-
if (kind === "m")
|
|
342
|
-
throw new TypeError("Private method is not writable");
|
|
343
|
-
if (kind === "a" && !f)
|
|
344
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
345
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
346
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
347
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* @license
|
|
352
|
-
* Copyright Google LLC All Rights Reserved.
|
|
353
|
-
*
|
|
354
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
355
|
-
* found in the LICENSE file at https://angular.io/license
|
|
356
|
-
*/
|
|
357
|
-
/** Selector for finding table cells. */
|
|
358
|
-
var CELL_SELECTOR = '.cdk-cell, .mat-cell, td';
|
|
359
|
-
/** Selector for finding editable table cells. */
|
|
360
|
-
var EDITABLE_CELL_SELECTOR = '.cdk-popover-edit-cell, .mat-popover-edit-cell';
|
|
361
|
-
/** Selector for finding table rows. */
|
|
362
|
-
var ROW_SELECTOR = '.cdk-row, .mat-row, tr';
|
|
363
|
-
/** Selector for finding the table element. */
|
|
364
|
-
var TABLE_SELECTOR = 'table, cdk-table, mat-table';
|
|
365
|
-
/** CSS class added to the edit lens pane. */
|
|
366
|
-
var EDIT_PANE_CLASS = 'cdk-edit-pane';
|
|
367
|
-
/** Selector for finding the edit lens pane. */
|
|
368
|
-
var EDIT_PANE_SELECTOR = "." + EDIT_PANE_CLASS + ", .mat-edit-pane";
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* @license
|
|
372
|
-
* Copyright Google LLC All Rights Reserved.
|
|
373
|
-
*
|
|
374
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
375
|
-
* found in the LICENSE file at https://angular.io/license
|
|
376
|
-
*/
|
|
377
|
-
/** IE 11 compatible matches implementation. */
|
|
378
|
-
function matches(element, selector) {
|
|
379
|
-
return element.matches ?
|
|
380
|
-
element.matches(selector) :
|
|
381
|
-
element['msMatchesSelector'](selector);
|
|
382
|
-
}
|
|
383
|
-
/** IE 11 compatible closest implementation that is able to start from non-Element Nodes. */
|
|
384
|
-
function closest(element, selector) {
|
|
385
|
-
if (!(element instanceof Node)) {
|
|
386
|
-
return null;
|
|
387
|
-
}
|
|
388
|
-
var curr = element;
|
|
389
|
-
while (curr != null && !(curr instanceof Element)) {
|
|
390
|
-
curr = curr.parentNode;
|
|
391
|
-
}
|
|
392
|
-
return curr && (hasNativeClosest ?
|
|
393
|
-
curr.closest(selector) : polyfillClosest(curr, selector));
|
|
394
|
-
}
|
|
395
|
-
/** Polyfill for browsers without Element.closest. */
|
|
396
|
-
function polyfillClosest(element, selector) {
|
|
397
|
-
var curr = element;
|
|
398
|
-
while (curr != null && !(curr instanceof Element && matches(curr, selector))) {
|
|
399
|
-
curr = curr.parentNode;
|
|
400
|
-
}
|
|
401
|
-
return (curr || null);
|
|
402
|
-
}
|
|
403
|
-
var hasNativeClosest = !!Element.prototype.closest;
|
|
404
|
-
|
|
405
|
-
/** The delay applied to mouse events before hiding or showing hover content. */
|
|
406
|
-
var MOUSE_EVENT_DELAY_MS = 40;
|
|
407
|
-
/** The delay for reacting to focus/blur changes. */
|
|
408
|
-
var FOCUS_DELAY = 0;
|
|
409
|
-
// Note: this class is generic, rather than referencing EditRef directly, in order to avoid
|
|
410
|
-
// circular imports. If we were to reference it here, importing the registry into the
|
|
411
|
-
// class that is registering itself will introduce a circular import.
|
|
412
|
-
/**
|
|
413
|
-
* Service for sharing delegated events and state for triggering table edits.
|
|
414
|
-
*/
|
|
415
|
-
var EditEventDispatcher = /** @class */ (function () {
|
|
416
|
-
function EditEventDispatcher(_ngZone) {
|
|
417
|
-
var _this = this;
|
|
418
|
-
this._ngZone = _ngZone;
|
|
419
|
-
/** A subject that indicates which table cell is currently editing (unless it is disabled). */
|
|
420
|
-
this.editing = new rxjs.Subject();
|
|
421
|
-
/** A subject that indicates which table row is currently hovered. */
|
|
422
|
-
this.hovering = new rxjs.Subject();
|
|
423
|
-
/** A subject that indicates which table row currently contains focus. */
|
|
424
|
-
this.focused = new rxjs.Subject();
|
|
425
|
-
/** A subject that indicates all elements in the table matching ROW_SELECTOR. */
|
|
426
|
-
this.allRows = new rxjs.Subject();
|
|
427
|
-
/** A subject that emits mouse move events from the table indicating the targeted row. */
|
|
428
|
-
this.mouseMove = new rxjs.Subject();
|
|
429
|
-
// TODO: Use WeakSet once IE11 support is dropped.
|
|
430
|
-
/**
|
|
431
|
-
* Tracks the currently disabled editable cells - edit calls will be ignored
|
|
432
|
-
* for these cells.
|
|
433
|
-
*/
|
|
434
|
-
this.disabledCells = new WeakMap();
|
|
435
|
-
this._editRef = null;
|
|
436
|
-
// Optimization: Precompute common pipeable operators used per row/cell.
|
|
437
|
-
this._distinctUntilChanged = operators.distinctUntilChanged();
|
|
438
|
-
this._startWithNull = operators.startWith(null);
|
|
439
|
-
this._distinctShare = rxjs.pipe(this._distinctUntilChanged, operators.shareReplay(1));
|
|
440
|
-
this._startWithNullDistinct = rxjs.pipe(this._startWithNull, this._distinctUntilChanged);
|
|
441
|
-
this.editingAndEnabled = this.editing.pipe(operators.filter(function (cell) { return cell == null || !_this.disabledCells.has(cell); }), operators.shareReplay(1));
|
|
442
|
-
/** An observable that emits the row containing focus or an active edit. */
|
|
443
|
-
this.editingOrFocused = rxjs.combineLatest([
|
|
444
|
-
this.editingAndEnabled.pipe(operators.map(function (cell) { return closest(cell, ROW_SELECTOR); }), this._startWithNull),
|
|
445
|
-
this.focused.pipe(this._startWithNull),
|
|
446
|
-
]).pipe(operators.map(function (_a) {
|
|
447
|
-
var _b = __read(_a, 2), editingRow = _b[0], focusedRow = _b[1];
|
|
448
|
-
return focusedRow || editingRow;
|
|
449
|
-
}), this._distinctUntilChanged, operators.auditTime(FOCUS_DELAY), // Use audit to skip over blur events to the next focused element.
|
|
450
|
-
this._distinctUntilChanged, operators.shareReplay(1));
|
|
451
|
-
/** Tracks rows that contain hover content with a reference count. */
|
|
452
|
-
this._rowsWithHoverContent = new WeakMap();
|
|
453
|
-
/** The table cell that has an active edit lens (or null). */
|
|
454
|
-
this._currentlyEditing = null;
|
|
455
|
-
/** The combined set of row hover content states organized by row. */
|
|
456
|
-
this._hoveredContentStateDistinct = rxjs.combineLatest([
|
|
457
|
-
this._getFirstRowWithHoverContent(),
|
|
458
|
-
this._getLastRowWithHoverContent(),
|
|
459
|
-
this.editingOrFocused,
|
|
460
|
-
this.hovering.pipe(operators.distinctUntilChanged(), operators.audit(function (row) { return _this.mouseMove.pipe(operators.filter(function (mouseMoveRow) { return row === mouseMoveRow; }), _this._startWithNull, operators.debounceTime(MOUSE_EVENT_DELAY_MS)); }), this._startWithNullDistinct),
|
|
461
|
-
]).pipe(operators.skip(1), // Skip the initial emission of [null, null, null, null].
|
|
462
|
-
operators.map(computeHoverContentState), operators.distinctUntilChanged(areMapEntriesEqual),
|
|
463
|
-
// Optimization: Enter the zone before shareReplay so that we trigger a single
|
|
464
|
-
// ApplicationRef.tick for all row updates.
|
|
465
|
-
this._enterZone(), operators.shareReplay(1));
|
|
466
|
-
this._editingAndEnabledDistinct = this.editingAndEnabled.pipe(operators.distinctUntilChanged(), this._enterZone(), operators.shareReplay(1));
|
|
467
|
-
// Optimization: Share row events observable with subsequent callers.
|
|
468
|
-
// At startup, calls will be sequential by row.
|
|
469
|
-
this._lastSeenRow = null;
|
|
470
|
-
this._lastSeenRowHoverOrFocus = null;
|
|
471
|
-
this._editingAndEnabledDistinct.subscribe(function (cell) {
|
|
472
|
-
_this._currentlyEditing = cell;
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
Object.defineProperty(EditEventDispatcher.prototype, "editRef", {
|
|
476
|
-
/** The EditRef for the currently active edit lens (if any). */
|
|
477
|
-
get: function () {
|
|
478
|
-
return this._editRef;
|
|
479
|
-
},
|
|
480
|
-
enumerable: false,
|
|
481
|
-
configurable: true
|
|
482
|
-
});
|
|
483
|
-
/**
|
|
484
|
-
* Gets an Observable that emits true when the specified element's cell
|
|
485
|
-
* is editing and false when not.
|
|
486
|
-
*/
|
|
487
|
-
EditEventDispatcher.prototype.editingCell = function (element) {
|
|
488
|
-
var cell = null;
|
|
489
|
-
return this._editingAndEnabledDistinct.pipe(operators.map(function (editCell) { return editCell === (cell || (cell = closest(element, CELL_SELECTOR))); }), this._distinctUntilChanged);
|
|
490
|
-
};
|
|
491
|
-
/**
|
|
492
|
-
* Stops editing for the specified cell. If the specified cell is not the current
|
|
493
|
-
* edit cell, does nothing.
|
|
494
|
-
*/
|
|
495
|
-
EditEventDispatcher.prototype.doneEditingCell = function (element) {
|
|
496
|
-
var cell = closest(element, CELL_SELECTOR);
|
|
497
|
-
if (this._currentlyEditing === cell) {
|
|
498
|
-
this.editing.next(null);
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
/** Sets the currently active EditRef. */
|
|
502
|
-
EditEventDispatcher.prototype.setActiveEditRef = function (ref) {
|
|
503
|
-
this._editRef = ref;
|
|
504
|
-
};
|
|
505
|
-
/** Unsets the currently active EditRef, if the specified editRef is active. */
|
|
506
|
-
EditEventDispatcher.prototype.unsetActiveEditRef = function (ref) {
|
|
507
|
-
if (this._editRef !== ref) {
|
|
508
|
-
return;
|
|
509
|
-
}
|
|
510
|
-
this._editRef = null;
|
|
511
|
-
};
|
|
512
|
-
/** Adds the specified table row to be tracked for first/last row comparisons. */
|
|
513
|
-
EditEventDispatcher.prototype.registerRowWithHoverContent = function (row) {
|
|
514
|
-
this._rowsWithHoverContent.set(row, (this._rowsWithHoverContent.get(row) || 0) + 1);
|
|
515
|
-
};
|
|
516
|
-
/**
|
|
517
|
-
* Reference decrements and ultimately removes the specified table row from first/last row
|
|
518
|
-
* comparisons.
|
|
519
|
-
*/
|
|
520
|
-
EditEventDispatcher.prototype.deregisterRowWithHoverContent = function (row) {
|
|
521
|
-
var refCount = this._rowsWithHoverContent.get(row) || 0;
|
|
522
|
-
if (refCount <= 1) {
|
|
523
|
-
this._rowsWithHoverContent.delete(row);
|
|
524
|
-
}
|
|
525
|
-
else {
|
|
526
|
-
this._rowsWithHoverContent.set(row, refCount - 1);
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
|
-
/**
|
|
530
|
-
* Gets an Observable that emits true when the specified element's row
|
|
531
|
-
* contains the focused element or is being hovered over and false when not.
|
|
532
|
-
* Hovering is defined as when the mouse has momentarily stopped moving over the cell.
|
|
533
|
-
*/
|
|
534
|
-
EditEventDispatcher.prototype.hoverOrFocusOnRow = function (row) {
|
|
535
|
-
if (row !== this._lastSeenRow) {
|
|
536
|
-
this._lastSeenRow = row;
|
|
537
|
-
this._lastSeenRowHoverOrFocus = this._hoveredContentStateDistinct.pipe(operators.map(function (state) { return state.get(row) || 0; } /* OFF */), this._distinctShare);
|
|
538
|
-
}
|
|
539
|
-
return this._lastSeenRowHoverOrFocus;
|
|
540
|
-
};
|
|
541
|
-
/**
|
|
542
|
-
* RxJS operator that enters the Angular zone, used to reduce boilerplate in
|
|
543
|
-
* re-entering the zone for stream pipelines.
|
|
544
|
-
*/
|
|
545
|
-
EditEventDispatcher.prototype._enterZone = function () {
|
|
546
|
-
var _this = this;
|
|
547
|
-
return function (source) { return new rxjs.Observable(function (observer) { return source.subscribe({
|
|
548
|
-
next: function (value) { return _this._ngZone.run(function () { return observer.next(value); }); },
|
|
549
|
-
error: function (err) { return observer.error(err); },
|
|
550
|
-
complete: function () { return observer.complete(); }
|
|
551
|
-
}); }); };
|
|
552
|
-
};
|
|
553
|
-
EditEventDispatcher.prototype._getFirstRowWithHoverContent = function () {
|
|
554
|
-
var _this = this;
|
|
555
|
-
return this._mapAllRowsToSingleRow(function (rows) {
|
|
556
|
-
for (var i = 0, row = void 0; row = rows[i]; i++) {
|
|
557
|
-
if (_this._rowsWithHoverContent.has(row)) {
|
|
558
|
-
return row;
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
return null;
|
|
562
|
-
});
|
|
563
|
-
};
|
|
564
|
-
EditEventDispatcher.prototype._getLastRowWithHoverContent = function () {
|
|
565
|
-
var _this = this;
|
|
566
|
-
return this._mapAllRowsToSingleRow(function (rows) {
|
|
567
|
-
for (var i = rows.length - 1, row = void 0; row = rows[i]; i--) {
|
|
568
|
-
if (_this._rowsWithHoverContent.has(row)) {
|
|
569
|
-
return row;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
return null;
|
|
573
|
-
});
|
|
574
|
-
};
|
|
575
|
-
EditEventDispatcher.prototype._mapAllRowsToSingleRow = function (mapper) {
|
|
576
|
-
return this.allRows.pipe(operators.map(mapper), this._startWithNullDistinct);
|
|
577
|
-
};
|
|
578
|
-
return EditEventDispatcher;
|
|
579
|
-
}());
|
|
580
|
-
EditEventDispatcher.decorators = [
|
|
581
|
-
{ type: i0.Injectable }
|
|
582
|
-
];
|
|
583
|
-
EditEventDispatcher.ctorParameters = function () { return [
|
|
584
|
-
{ type: i0.NgZone }
|
|
585
|
-
]; };
|
|
586
|
-
function computeHoverContentState(_a) {
|
|
587
|
-
var e_1, _b, e_2, _c;
|
|
588
|
-
var _d = __read(_a, 4), firstRow = _d[0], lastRow = _d[1], activeRow = _d[2], hoverRow = _d[3];
|
|
589
|
-
var hoverContentState = new Map();
|
|
590
|
-
try {
|
|
591
|
-
// Add focusable rows.
|
|
592
|
-
for (var _e = __values([
|
|
593
|
-
firstRow,
|
|
594
|
-
lastRow,
|
|
595
|
-
activeRow && activeRow.previousElementSibling,
|
|
596
|
-
activeRow && activeRow.nextElementSibling,
|
|
597
|
-
]), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
598
|
-
var focussableRow = _f.value;
|
|
599
|
-
if (focussableRow) {
|
|
600
|
-
hoverContentState.set(focussableRow, 1 /* FOCUSABLE */);
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
605
|
-
finally {
|
|
606
|
-
try {
|
|
607
|
-
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
608
|
-
}
|
|
609
|
-
finally { if (e_1) throw e_1.error; }
|
|
610
|
-
}
|
|
611
|
-
try {
|
|
612
|
-
// Add/overwrite with fully visible rows.
|
|
613
|
-
for (var _g = __values([activeRow, hoverRow]), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
614
|
-
var onRow = _h.value;
|
|
615
|
-
if (onRow) {
|
|
616
|
-
hoverContentState.set(onRow, 2 /* ON */);
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
621
|
-
finally {
|
|
622
|
-
try {
|
|
623
|
-
if (_h && !_h.done && (_c = _g.return)) _c.call(_g);
|
|
624
|
-
}
|
|
625
|
-
finally { if (e_2) throw e_2.error; }
|
|
626
|
-
}
|
|
627
|
-
return hoverContentState;
|
|
628
|
-
}
|
|
629
|
-
function areMapEntriesEqual(a, b) {
|
|
630
|
-
var e_3, _a;
|
|
631
|
-
if (a.size !== b.size) {
|
|
632
|
-
return false;
|
|
633
|
-
}
|
|
634
|
-
try {
|
|
635
|
-
// TODO: use Map.prototype.entries once we're off IE11.
|
|
636
|
-
for (var _b = __values(Array.from(a.keys())), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
637
|
-
var aKey = _c.value;
|
|
638
|
-
if (b.get(aKey) !== a.get(aKey)) {
|
|
639
|
-
return false;
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
644
|
-
finally {
|
|
645
|
-
try {
|
|
646
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
647
|
-
}
|
|
648
|
-
finally { if (e_3) throw e_3.error; }
|
|
649
|
-
}
|
|
650
|
-
return true;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* @license
|
|
655
|
-
* Copyright Google LLC All Rights Reserved.
|
|
656
|
-
*
|
|
657
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
658
|
-
* found in the LICENSE file at https://angular.io/license
|
|
659
|
-
*/
|
|
660
|
-
/**
|
|
661
|
-
* Used for communication between the form within the edit lens and the
|
|
662
|
-
* table that launched it. Provided by CdkEditControl within the lens.
|
|
663
|
-
*/
|
|
664
|
-
var EditRef = /** @class */ (function () {
|
|
665
|
-
function EditRef(_form, _editEventDispatcher, _ngZone) {
|
|
666
|
-
this._form = _form;
|
|
667
|
-
this._editEventDispatcher = _editEventDispatcher;
|
|
668
|
-
this._ngZone = _ngZone;
|
|
669
|
-
/** Emits the final value of this edit instance before closing. */
|
|
670
|
-
this._finalValueSubject = new rxjs.Subject();
|
|
671
|
-
this.finalValue = this._finalValueSubject;
|
|
672
|
-
/** Emits when the user tabs out of this edit lens before closing. */
|
|
673
|
-
this._blurredSubject = new rxjs.Subject();
|
|
674
|
-
this.blurred = this._blurredSubject;
|
|
675
|
-
this._editEventDispatcher.setActiveEditRef(this);
|
|
676
|
-
}
|
|
677
|
-
/**
|
|
678
|
-
* Called by the host directive's OnInit hook. Reads the initial state of the
|
|
679
|
-
* form and overrides it with persisted state from previous openings, if
|
|
680
|
-
* applicable.
|
|
681
|
-
*/
|
|
682
|
-
EditRef.prototype.init = function (previousFormValue) {
|
|
683
|
-
var _this = this;
|
|
684
|
-
// Wait for the zone to stabilize before caching the initial value.
|
|
685
|
-
// This ensures that all form controls have been initialized.
|
|
686
|
-
this._ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
|
|
687
|
-
_this.updateRevertValue();
|
|
688
|
-
if (previousFormValue) {
|
|
689
|
-
_this.reset(previousFormValue);
|
|
690
|
-
}
|
|
691
|
-
});
|
|
692
|
-
};
|
|
693
|
-
EditRef.prototype.ngOnDestroy = function () {
|
|
694
|
-
this._editEventDispatcher.unsetActiveEditRef(this);
|
|
695
|
-
this._finalValueSubject.next(this._form.value);
|
|
696
|
-
this._finalValueSubject.complete();
|
|
697
|
-
};
|
|
698
|
-
/** Whether the attached form is in a valid state. */
|
|
699
|
-
EditRef.prototype.isValid = function () {
|
|
700
|
-
return this._form.valid;
|
|
701
|
-
};
|
|
702
|
-
/** Set the form's current value as what it will be set to on revert/reset. */
|
|
703
|
-
EditRef.prototype.updateRevertValue = function () {
|
|
704
|
-
this._revertFormValue = this._form.value;
|
|
705
|
-
};
|
|
706
|
-
/** Tells the table to close the edit popup. */
|
|
707
|
-
EditRef.prototype.close = function () {
|
|
708
|
-
this._editEventDispatcher.editing.next(null);
|
|
709
|
-
};
|
|
710
|
-
/** Notifies the active edit that the user has moved focus out of the lens. */
|
|
711
|
-
EditRef.prototype.blur = function () {
|
|
712
|
-
this._blurredSubject.next();
|
|
713
|
-
};
|
|
714
|
-
/**
|
|
715
|
-
* Resets the form value to the specified value or the previously set
|
|
716
|
-
* revert value.
|
|
717
|
-
*/
|
|
718
|
-
EditRef.prototype.reset = function (value) {
|
|
719
|
-
this._form.reset(value || this._revertFormValue);
|
|
720
|
-
};
|
|
721
|
-
return EditRef;
|
|
722
|
-
}());
|
|
723
|
-
EditRef.decorators = [
|
|
724
|
-
{ type: i0.Injectable }
|
|
725
|
-
];
|
|
726
|
-
EditRef.ctorParameters = function () { return [
|
|
727
|
-
{ type: forms.ControlContainer, decorators: [{ type: i0.Self }] },
|
|
728
|
-
{ type: EditEventDispatcher },
|
|
729
|
-
{ type: i0.NgZone }
|
|
730
|
-
]; };
|
|
731
|
-
|
|
732
|
-
/**
|
|
733
|
-
* @license
|
|
734
|
-
* Copyright Google LLC All Rights Reserved.
|
|
735
|
-
*
|
|
736
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
737
|
-
* found in the LICENSE file at https://angular.io/license
|
|
738
|
-
*/
|
|
739
|
-
/**
|
|
740
|
-
* Service responsible for moving cell focus around in response to keyboard events.
|
|
741
|
-
* May be overridden to customize the keyboard behavior of popover edit.
|
|
742
|
-
*/
|
|
743
|
-
var FocusDispatcher = /** @class */ (function () {
|
|
744
|
-
function FocusDispatcher(directionality) {
|
|
745
|
-
var _this = this;
|
|
746
|
-
this.directionality = directionality;
|
|
747
|
-
this.keyObserver = { next: function (event) { return _this.handleKeyboardEvent(event); } };
|
|
748
|
-
}
|
|
749
|
-
/**
|
|
750
|
-
* Moves focus to earlier or later cells (in dom order) by offset cells relative to
|
|
751
|
-
* currentCell.
|
|
752
|
-
*/
|
|
753
|
-
FocusDispatcher.prototype.moveFocusHorizontally = function (currentCell, offset) {
|
|
754
|
-
var cells = Array.from(closest(currentCell, TABLE_SELECTOR).querySelectorAll(EDITABLE_CELL_SELECTOR));
|
|
755
|
-
var currentIndex = cells.indexOf(currentCell);
|
|
756
|
-
var newIndex = currentIndex + offset;
|
|
757
|
-
if (cells[newIndex]) {
|
|
758
|
-
cells[newIndex].focus();
|
|
759
|
-
}
|
|
760
|
-
};
|
|
761
|
-
/** Moves focus to up or down by row by offset cells relative to currentCell. */
|
|
762
|
-
FocusDispatcher.prototype.moveFocusVertically = function (currentCell, offset) {
|
|
763
|
-
var currentRow = closest(currentCell, ROW_SELECTOR);
|
|
764
|
-
var rows = Array.from(closest(currentRow, TABLE_SELECTOR).querySelectorAll(ROW_SELECTOR));
|
|
765
|
-
var currentRowIndex = rows.indexOf(currentRow);
|
|
766
|
-
var currentIndexWithinRow = Array.from(currentRow.querySelectorAll(EDITABLE_CELL_SELECTOR)).indexOf(currentCell);
|
|
767
|
-
var newRowIndex = currentRowIndex + offset;
|
|
768
|
-
if (rows[newRowIndex]) {
|
|
769
|
-
var rowToFocus = Array.from(rows[newRowIndex].querySelectorAll(EDITABLE_CELL_SELECTOR));
|
|
770
|
-
if (rowToFocus[currentIndexWithinRow]) {
|
|
771
|
-
rowToFocus[currentIndexWithinRow].focus();
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
/** Translates arrow keydown events into focus move operations. */
|
|
776
|
-
FocusDispatcher.prototype.handleKeyboardEvent = function (event) {
|
|
777
|
-
var cell = closest(event.target, EDITABLE_CELL_SELECTOR);
|
|
778
|
-
if (!cell) {
|
|
779
|
-
return;
|
|
780
|
-
}
|
|
781
|
-
switch (event.keyCode) {
|
|
782
|
-
case keycodes.UP_ARROW:
|
|
783
|
-
this.moveFocusVertically(cell, -1);
|
|
784
|
-
break;
|
|
785
|
-
case keycodes.DOWN_ARROW:
|
|
786
|
-
this.moveFocusVertically(cell, 1);
|
|
787
|
-
break;
|
|
788
|
-
case keycodes.LEFT_ARROW:
|
|
789
|
-
this.moveFocusHorizontally(cell, this.directionality.value === 'ltr' ? -1 : 1);
|
|
790
|
-
break;
|
|
791
|
-
case keycodes.RIGHT_ARROW:
|
|
792
|
-
this.moveFocusHorizontally(cell, this.directionality.value === 'ltr' ? 1 : -1);
|
|
793
|
-
break;
|
|
794
|
-
default:
|
|
795
|
-
// If the keyboard event is not handled, return now so that we don't `preventDefault`.
|
|
796
|
-
return;
|
|
797
|
-
}
|
|
798
|
-
event.preventDefault();
|
|
799
|
-
};
|
|
800
|
-
return FocusDispatcher;
|
|
801
|
-
}());
|
|
802
|
-
FocusDispatcher.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function FocusDispatcher_Factory() { return new FocusDispatcher(i0__namespace.ɵɵinject(i1__namespace.Directionality)); }, token: FocusDispatcher, providedIn: "root" });
|
|
803
|
-
FocusDispatcher.decorators = [
|
|
804
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
805
|
-
];
|
|
806
|
-
FocusDispatcher.ctorParameters = function () { return [
|
|
807
|
-
{ type: i1.Directionality }
|
|
808
|
-
]; };
|
|
809
|
-
|
|
810
|
-
/**
|
|
811
|
-
* @license
|
|
812
|
-
* Copyright Google LLC All Rights Reserved.
|
|
813
|
-
*
|
|
814
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
815
|
-
* found in the LICENSE file at https://angular.io/license
|
|
816
|
-
*/
|
|
817
|
-
/**
|
|
818
|
-
* A convenience class for preserving unsaved form state while an edit lens is closed.
|
|
819
|
-
*
|
|
820
|
-
* Example usage:
|
|
821
|
-
* class MyComponent {
|
|
822
|
-
* readonly nameEditValues = new FormValueContainer<Item, {name: string}>();
|
|
823
|
-
* }
|
|
824
|
-
*
|
|
825
|
-
* <form cdkEditControl [(cdkEditControlPreservedFormValue)]="nameEditValues.for(item).value">
|
|
826
|
-
*/
|
|
827
|
-
var FormValueContainer = /** @class */ (function () {
|
|
828
|
-
function FormValueContainer() {
|
|
829
|
-
this._formValues = new WeakMap();
|
|
830
|
-
}
|
|
831
|
-
FormValueContainer.prototype.for = function (key) {
|
|
832
|
-
var _formValues = this._formValues;
|
|
833
|
-
var entry = _formValues.get(key);
|
|
834
|
-
if (!entry) {
|
|
835
|
-
// Expose entry as an object so that we can [(two-way)] bind to its value member
|
|
836
|
-
entry = {};
|
|
837
|
-
_formValues.set(key, entry);
|
|
838
|
-
}
|
|
839
|
-
return entry;
|
|
840
|
-
};
|
|
841
|
-
return FormValueContainer;
|
|
842
|
-
}());
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
* @license
|
|
846
|
-
* Copyright Google LLC All Rights Reserved.
|
|
847
|
-
*
|
|
848
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
849
|
-
* found in the LICENSE file at https://angular.io/license
|
|
850
|
-
*/
|
|
851
|
-
/**
|
|
852
|
-
* A directive that attaches to a form within the edit lens.
|
|
853
|
-
* It coordinates the form state with the table-wide edit system and handles
|
|
854
|
-
* closing the edit lens when the form is submitted or the user clicks
|
|
855
|
-
* out.
|
|
856
|
-
*/
|
|
857
|
-
var CdkEditControl = /** @class */ (function () {
|
|
858
|
-
function CdkEditControl(elementRef, editRef) {
|
|
859
|
-
this.elementRef = elementRef;
|
|
860
|
-
this.editRef = editRef;
|
|
861
|
-
this.destroyed = new rxjs.Subject();
|
|
862
|
-
/**
|
|
863
|
-
* Specifies what should happen when the user clicks outside of the edit lens.
|
|
864
|
-
* The default behavior is to close the lens without submitting the form.
|
|
865
|
-
*/
|
|
866
|
-
this.clickOutBehavior = 'close';
|
|
867
|
-
this.preservedFormValueChange = new i0.EventEmitter();
|
|
868
|
-
/**
|
|
869
|
-
* Determines whether the lens will close on form submit if the form is not in a valid
|
|
870
|
-
* state. By default the lens will remain open.
|
|
871
|
-
*/
|
|
872
|
-
this.ignoreSubmitUnlessValid = true;
|
|
873
|
-
}
|
|
874
|
-
CdkEditControl.prototype.ngOnInit = function () {
|
|
875
|
-
var _this = this;
|
|
876
|
-
this.editRef.init(this.preservedFormValue);
|
|
877
|
-
this.editRef.finalValue.subscribe(this.preservedFormValueChange);
|
|
878
|
-
this.editRef.blurred.subscribe(function () { return _this._handleBlur(); });
|
|
879
|
-
};
|
|
880
|
-
CdkEditControl.prototype.ngOnDestroy = function () {
|
|
881
|
-
this.destroyed.next();
|
|
882
|
-
this.destroyed.complete();
|
|
883
|
-
};
|
|
884
|
-
/**
|
|
885
|
-
* Called when the form submits. If ignoreSubmitUnlessValid is true, checks
|
|
886
|
-
* the form for validity before proceeding.
|
|
887
|
-
* Updates the revert state with the latest submitted value then closes the edit.
|
|
888
|
-
*/
|
|
889
|
-
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
|
|
890
|
-
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
|
|
891
|
-
// can move this back into `host`.
|
|
892
|
-
// tslint:disable-next-line:no-host-decorator-in-concrete
|
|
893
|
-
CdkEditControl.prototype.handleFormSubmit = function () {
|
|
894
|
-
if (this.ignoreSubmitUnlessValid && !this.editRef.isValid()) {
|
|
895
|
-
return;
|
|
896
|
-
}
|
|
897
|
-
this.editRef.updateRevertValue();
|
|
898
|
-
this.editRef.close();
|
|
899
|
-
};
|
|
900
|
-
/** Called on Escape keyup. Closes the edit. */
|
|
901
|
-
CdkEditControl.prototype.close = function () {
|
|
902
|
-
// todo - allow this behavior to be customized as well, such as calling
|
|
903
|
-
// reset before close
|
|
904
|
-
this.editRef.close();
|
|
905
|
-
};
|
|
906
|
-
/**
|
|
907
|
-
* Called on click anywhere in the document.
|
|
908
|
-
* If the click was outside of the lens, trigger the specified click out behavior.
|
|
909
|
-
*/
|
|
910
|
-
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
|
|
911
|
-
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
|
|
912
|
-
// can move this back into `host`.
|
|
913
|
-
// tslint:disable-next-line:no-host-decorator-in-concrete
|
|
914
|
-
CdkEditControl.prototype.handlePossibleClickOut = function (evt) {
|
|
915
|
-
if (closest(evt.target, EDIT_PANE_SELECTOR)) {
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
switch (this.clickOutBehavior) {
|
|
919
|
-
case 'submit':
|
|
920
|
-
// Manually cause the form to submit before closing.
|
|
921
|
-
this._triggerFormSubmit();
|
|
922
|
-
this.editRef.close();
|
|
923
|
-
break;
|
|
924
|
-
case 'close':
|
|
925
|
-
this.editRef.close();
|
|
926
|
-
break;
|
|
927
|
-
default:
|
|
928
|
-
break;
|
|
929
|
-
}
|
|
930
|
-
};
|
|
931
|
-
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
|
|
932
|
-
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
|
|
933
|
-
// can move this back into `host`.
|
|
934
|
-
// tslint:disable-next-line:no-host-decorator-in-concrete
|
|
935
|
-
CdkEditControl.prototype._handleKeydown = function (event) {
|
|
936
|
-
if (event.key === 'Escape' && !keycodes.hasModifierKey(event)) {
|
|
937
|
-
this.close();
|
|
938
|
-
event.preventDefault();
|
|
939
|
-
}
|
|
940
|
-
};
|
|
941
|
-
/** Triggers submit on tab out if clickOutBehavior is 'submit'. */
|
|
942
|
-
CdkEditControl.prototype._handleBlur = function () {
|
|
943
|
-
if (this.clickOutBehavior === 'submit') {
|
|
944
|
-
// Manually cause the form to submit before closing.
|
|
945
|
-
this._triggerFormSubmit();
|
|
946
|
-
}
|
|
947
|
-
};
|
|
948
|
-
CdkEditControl.prototype._triggerFormSubmit = function () {
|
|
949
|
-
this.elementRef.nativeElement.dispatchEvent(new Event('submit'));
|
|
950
|
-
};
|
|
951
|
-
return CdkEditControl;
|
|
952
|
-
}());
|
|
953
|
-
CdkEditControl.decorators = [
|
|
954
|
-
{ type: i0.Directive, args: [{
|
|
955
|
-
selector: 'form[cdkEditControl]',
|
|
956
|
-
inputs: [
|
|
957
|
-
'clickOutBehavior: cdkEditControlClickOutBehavior',
|
|
958
|
-
'preservedFormValue: cdkEditControlPreservedFormValue',
|
|
959
|
-
'ignoreSubmitUnlessValid: cdkEditControlIgnoreSubmitUnlessValid',
|
|
960
|
-
],
|
|
961
|
-
outputs: ['preservedFormValueChange: cdkEditControlPreservedFormValueChange'],
|
|
962
|
-
providers: [EditRef],
|
|
963
|
-
},] }
|
|
964
|
-
];
|
|
965
|
-
CdkEditControl.ctorParameters = function () { return [
|
|
966
|
-
{ type: i0.ElementRef },
|
|
967
|
-
{ type: EditRef }
|
|
968
|
-
]; };
|
|
969
|
-
CdkEditControl.propDecorators = {
|
|
970
|
-
handleFormSubmit: [{ type: i0.HostListener, args: ['ngSubmit',] }],
|
|
971
|
-
handlePossibleClickOut: [{ type: i0.HostListener, args: ['document:click', ['$event'],] }],
|
|
972
|
-
_handleKeydown: [{ type: i0.HostListener, args: ['keydown', ['$event'],] }]
|
|
973
|
-
};
|
|
974
|
-
/** Reverts the form to its initial or previously submitted state on click. */
|
|
975
|
-
var CdkEditRevert = /** @class */ (function () {
|
|
976
|
-
function CdkEditRevert(editRef) {
|
|
977
|
-
this.editRef = editRef;
|
|
978
|
-
/** Type of the button. Defaults to `button` to avoid accident form submits. */
|
|
979
|
-
this.type = 'button';
|
|
980
|
-
}
|
|
981
|
-
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
|
|
982
|
-
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
|
|
983
|
-
// can move this back into `host`.
|
|
984
|
-
// tslint:disable-next-line:no-host-decorator-in-concrete
|
|
985
|
-
CdkEditRevert.prototype.revertEdit = function () {
|
|
986
|
-
this.editRef.reset();
|
|
987
|
-
};
|
|
988
|
-
return CdkEditRevert;
|
|
989
|
-
}());
|
|
990
|
-
CdkEditRevert.decorators = [
|
|
991
|
-
{ type: i0.Directive, args: [{
|
|
992
|
-
selector: 'button[cdkEditRevert]',
|
|
993
|
-
host: {
|
|
994
|
-
'type': 'button', // Prevents accidental form submits.
|
|
995
|
-
}
|
|
996
|
-
},] }
|
|
997
|
-
];
|
|
998
|
-
CdkEditRevert.ctorParameters = function () { return [
|
|
999
|
-
{ type: EditRef }
|
|
1000
|
-
]; };
|
|
1001
|
-
CdkEditRevert.propDecorators = {
|
|
1002
|
-
type: [{ type: i0.Input }],
|
|
1003
|
-
revertEdit: [{ type: i0.HostListener, args: ['click',] }]
|
|
1004
|
-
};
|
|
1005
|
-
/** Closes the lens on click. */
|
|
1006
|
-
var CdkEditClose = /** @class */ (function () {
|
|
1007
|
-
function CdkEditClose(elementRef, editRef) {
|
|
1008
|
-
this.elementRef = elementRef;
|
|
1009
|
-
this.editRef = editRef;
|
|
1010
|
-
var nativeElement = elementRef.nativeElement;
|
|
1011
|
-
// Prevent accidental form submits.
|
|
1012
|
-
if (nativeElement.nodeName === 'BUTTON' && !nativeElement.getAttribute('type')) {
|
|
1013
|
-
nativeElement.setAttribute('type', 'button');
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
|
|
1017
|
-
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
|
|
1018
|
-
// can move this back into `host`.
|
|
1019
|
-
// tslint:disable-next-line:no-host-decorator-in-concrete
|
|
1020
|
-
CdkEditClose.prototype.closeEdit = function () {
|
|
1021
|
-
// Note that we use `click` here, rather than a keyboard event, because some screen readers
|
|
1022
|
-
// will emit a fake click event instead of an enter keyboard event on buttons. For the keyboard
|
|
1023
|
-
// events we use `keydown`, rather than `keyup`, because we use `keydown` to open the overlay
|
|
1024
|
-
// as well. If we were to use `keyup`, the user could end up opening and closing within
|
|
1025
|
-
// the same event sequence if focus was moved quickly.
|
|
1026
|
-
this.editRef.close();
|
|
1027
|
-
};
|
|
1028
|
-
return CdkEditClose;
|
|
1029
|
-
}());
|
|
1030
|
-
CdkEditClose.decorators = [
|
|
1031
|
-
{ type: i0.Directive, args: [{ selector: '[cdkEditClose]' },] }
|
|
1032
|
-
];
|
|
1033
|
-
CdkEditClose.ctorParameters = function () { return [
|
|
1034
|
-
{ type: i0.ElementRef },
|
|
1035
|
-
{ type: EditRef }
|
|
1036
|
-
]; };
|
|
1037
|
-
CdkEditClose.propDecorators = {
|
|
1038
|
-
closeEdit: [{ type: i0.HostListener, args: ['click',] }, { type: i0.HostListener, args: ['keydown.enter',] }, { type: i0.HostListener, args: ['keydown.space',] }]
|
|
1039
|
-
};
|
|
1040
|
-
|
|
1041
|
-
/**
|
|
1042
|
-
* Overridable factory responsible for configuring how cdkPopoverEdit popovers are positioned
|
|
1043
|
-
* and sized.
|
|
1044
|
-
*/
|
|
1045
|
-
var PopoverEditPositionStrategyFactory = /** @class */ (function () {
|
|
1046
|
-
function PopoverEditPositionStrategyFactory() {
|
|
1047
|
-
}
|
|
1048
|
-
return PopoverEditPositionStrategyFactory;
|
|
1049
|
-
}());
|
|
1050
|
-
PopoverEditPositionStrategyFactory.decorators = [
|
|
1051
|
-
{ type: i0.Injectable }
|
|
1052
|
-
];
|
|
1053
|
-
/**
|
|
1054
|
-
* Default implementation of PopoverEditPositionStrategyFactory.
|
|
1055
|
-
* Uses a FlexibleConnectedPositionStrategy anchored to the start + top of the cell.
|
|
1056
|
-
* Note: This will change to CoverPositionStrategy once it implemented.
|
|
1057
|
-
*/
|
|
1058
|
-
var DefaultPopoverEditPositionStrategyFactory = /** @class */ (function (_super) {
|
|
1059
|
-
__extends(DefaultPopoverEditPositionStrategyFactory, _super);
|
|
1060
|
-
function DefaultPopoverEditPositionStrategyFactory(direction, overlay) {
|
|
1061
|
-
var _this = _super.call(this) || this;
|
|
1062
|
-
_this.direction = direction;
|
|
1063
|
-
_this.overlay = overlay;
|
|
1064
|
-
return _this;
|
|
1065
|
-
}
|
|
1066
|
-
DefaultPopoverEditPositionStrategyFactory.prototype.positionStrategyForCells = function (cells) {
|
|
1067
|
-
return this.overlay.position()
|
|
1068
|
-
.flexibleConnectedTo(cells[0])
|
|
1069
|
-
.withGrowAfterOpen()
|
|
1070
|
-
.withPush()
|
|
1071
|
-
.withViewportMargin(16)
|
|
1072
|
-
.withPositions([{
|
|
1073
|
-
originX: 'start',
|
|
1074
|
-
originY: 'top',
|
|
1075
|
-
overlayX: 'start',
|
|
1076
|
-
overlayY: 'top',
|
|
1077
|
-
}]);
|
|
1078
|
-
};
|
|
1079
|
-
DefaultPopoverEditPositionStrategyFactory.prototype.sizeConfigForCells = function (cells) {
|
|
1080
|
-
if (cells.length === 0) {
|
|
1081
|
-
return {};
|
|
1082
|
-
}
|
|
1083
|
-
if (cells.length === 1) {
|
|
1084
|
-
return { width: cells[0].getBoundingClientRect().width };
|
|
1085
|
-
}
|
|
1086
|
-
var firstCell, lastCell;
|
|
1087
|
-
if (this.direction.value === 'ltr') {
|
|
1088
|
-
firstCell = cells[0];
|
|
1089
|
-
lastCell = cells[cells.length - 1];
|
|
1090
|
-
}
|
|
1091
|
-
else {
|
|
1092
|
-
lastCell = cells[0];
|
|
1093
|
-
firstCell = cells[cells.length - 1];
|
|
1094
|
-
}
|
|
1095
|
-
return { width: lastCell.getBoundingClientRect().right - firstCell.getBoundingClientRect().left };
|
|
1096
|
-
};
|
|
1097
|
-
return DefaultPopoverEditPositionStrategyFactory;
|
|
1098
|
-
}(PopoverEditPositionStrategyFactory));
|
|
1099
|
-
DefaultPopoverEditPositionStrategyFactory.decorators = [
|
|
1100
|
-
{ type: i0.Injectable }
|
|
1101
|
-
];
|
|
1102
|
-
DefaultPopoverEditPositionStrategyFactory.ctorParameters = function () { return [
|
|
1103
|
-
{ type: i1.Directionality },
|
|
1104
|
-
{ type: overlay.Overlay }
|
|
1105
|
-
]; };
|
|
1106
|
-
|
|
1107
|
-
/**
|
|
1108
|
-
* @license
|
|
1109
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1110
|
-
*
|
|
1111
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1112
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1113
|
-
*/
|
|
1114
|
-
/**
|
|
1115
|
-
* Optimization
|
|
1116
|
-
* Collects multiple Injectables into a singleton shared across the table. By reducing the
|
|
1117
|
-
* number of services injected into each CdkPopoverEdit, this saves about 0.023ms of cpu time
|
|
1118
|
-
* and 56 bytes of memory per instance.
|
|
1119
|
-
*/
|
|
1120
|
-
var EditServices = /** @class */ (function () {
|
|
1121
|
-
function EditServices(directionality, editEventDispatcher, focusDispatcher, focusTrapFactory, ngZone, overlay, positionFactory, scrollDispatcher, viewportRuler) {
|
|
1122
|
-
this.directionality = directionality;
|
|
1123
|
-
this.editEventDispatcher = editEventDispatcher;
|
|
1124
|
-
this.focusDispatcher = focusDispatcher;
|
|
1125
|
-
this.focusTrapFactory = focusTrapFactory;
|
|
1126
|
-
this.ngZone = ngZone;
|
|
1127
|
-
this.overlay = overlay;
|
|
1128
|
-
this.positionFactory = positionFactory;
|
|
1129
|
-
this.scrollDispatcher = scrollDispatcher;
|
|
1130
|
-
this.viewportRuler = viewportRuler;
|
|
1131
|
-
}
|
|
1132
|
-
return EditServices;
|
|
1133
|
-
}());
|
|
1134
|
-
EditServices.decorators = [
|
|
1135
|
-
{ type: i0.Injectable }
|
|
1136
|
-
];
|
|
1137
|
-
EditServices.ctorParameters = function () { return [
|
|
1138
|
-
{ type: i1.Directionality },
|
|
1139
|
-
{ type: EditEventDispatcher },
|
|
1140
|
-
{ type: FocusDispatcher },
|
|
1141
|
-
{ type: i1$1.FocusTrapFactory },
|
|
1142
|
-
{ type: i0.NgZone },
|
|
1143
|
-
{ type: overlay.Overlay },
|
|
1144
|
-
{ type: PopoverEditPositionStrategyFactory },
|
|
1145
|
-
{ type: scrolling.ScrollDispatcher },
|
|
1146
|
-
{ type: scrolling.ViewportRuler }
|
|
1147
|
-
]; };
|
|
1148
|
-
|
|
1149
|
-
/**
|
|
1150
|
-
* Like FocusTrap, but rather than trapping focus within a dom region, notifies subscribers when
|
|
1151
|
-
* focus leaves the region.
|
|
1152
|
-
*/
|
|
1153
|
-
var FocusEscapeNotifier = /** @class */ (function (_super) {
|
|
1154
|
-
__extends(FocusEscapeNotifier, _super);
|
|
1155
|
-
function FocusEscapeNotifier(element, checker, ngZone, document) {
|
|
1156
|
-
var _this = _super.call(this, element, checker, ngZone, document, true /* deferAnchors */) || this;
|
|
1157
|
-
_this._escapeSubject = new rxjs.Subject();
|
|
1158
|
-
// The focus trap adds "anchors" at the beginning and end of a trapped region that redirect
|
|
1159
|
-
// focus. We override that redirect behavior here with simply emitting on a stream.
|
|
1160
|
-
_this.startAnchorListener = function () {
|
|
1161
|
-
_this._escapeSubject.next(0 /* START */);
|
|
1162
|
-
return true;
|
|
1163
|
-
};
|
|
1164
|
-
_this.endAnchorListener = function () {
|
|
1165
|
-
_this._escapeSubject.next(1 /* END */);
|
|
1166
|
-
return true;
|
|
1167
|
-
};
|
|
1168
|
-
_this.attachAnchors();
|
|
1169
|
-
return _this;
|
|
1170
|
-
}
|
|
1171
|
-
FocusEscapeNotifier.prototype.escapes = function () {
|
|
1172
|
-
return this._escapeSubject;
|
|
1173
|
-
};
|
|
1174
|
-
return FocusEscapeNotifier;
|
|
1175
|
-
}(i1$1.FocusTrap));
|
|
1176
|
-
/** Factory that allows easy instantiation of focus escape notifiers. */
|
|
1177
|
-
var FocusEscapeNotifierFactory = /** @class */ (function () {
|
|
1178
|
-
function FocusEscapeNotifierFactory(_checker, _ngZone, _document) {
|
|
1179
|
-
this._checker = _checker;
|
|
1180
|
-
this._ngZone = _ngZone;
|
|
1181
|
-
this._document = _document;
|
|
1182
|
-
}
|
|
1183
|
-
/**
|
|
1184
|
-
* Creates a focus escape notifier region around the given element.
|
|
1185
|
-
* @param element The element around which focus will be monitored.
|
|
1186
|
-
* @returns The created focus escape notifier instance.
|
|
1187
|
-
*/
|
|
1188
|
-
FocusEscapeNotifierFactory.prototype.create = function (element) {
|
|
1189
|
-
return new FocusEscapeNotifier(element, this._checker, this._ngZone, this._document);
|
|
1190
|
-
};
|
|
1191
|
-
return FocusEscapeNotifierFactory;
|
|
1192
|
-
}());
|
|
1193
|
-
FocusEscapeNotifierFactory.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function FocusEscapeNotifierFactory_Factory() { return new FocusEscapeNotifierFactory(i0__namespace.ɵɵinject(i1__namespace$1.InteractivityChecker), i0__namespace.ɵɵinject(i0__namespace.NgZone), i0__namespace.ɵɵinject(i2__namespace.DOCUMENT)); }, token: FocusEscapeNotifierFactory, providedIn: "root" });
|
|
1194
|
-
FocusEscapeNotifierFactory.decorators = [
|
|
1195
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
1196
|
-
];
|
|
1197
|
-
FocusEscapeNotifierFactory.ctorParameters = function () { return [
|
|
1198
|
-
{ type: i1$1.InteractivityChecker },
|
|
1199
|
-
{ type: i0.NgZone },
|
|
1200
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [i2.DOCUMENT,] }] }
|
|
1201
|
-
]; };
|
|
1202
|
-
|
|
1203
|
-
/** Used for rate-limiting mousemove events. */
|
|
1204
|
-
var MOUSE_MOVE_THROTTLE_TIME_MS = 10;
|
|
1205
|
-
/**
|
|
1206
|
-
* A directive that must be attached to enable editability on a table.
|
|
1207
|
-
* It is responsible for setting up delegated event handlers and providing the
|
|
1208
|
-
* EditEventDispatcher service for use by the other edit directives.
|
|
1209
|
-
*/
|
|
1210
|
-
var CdkEditable = /** @class */ (function () {
|
|
1211
|
-
function CdkEditable(elementRef, editEventDispatcher, focusDispatcher, ngZone) {
|
|
1212
|
-
this.elementRef = elementRef;
|
|
1213
|
-
this.editEventDispatcher = editEventDispatcher;
|
|
1214
|
-
this.focusDispatcher = focusDispatcher;
|
|
1215
|
-
this.ngZone = ngZone;
|
|
1216
|
-
this.destroyed = new rxjs.Subject();
|
|
1217
|
-
}
|
|
1218
|
-
CdkEditable.prototype.ngAfterViewInit = function () {
|
|
1219
|
-
this._listenForTableEvents();
|
|
1220
|
-
};
|
|
1221
|
-
CdkEditable.prototype.ngOnDestroy = function () {
|
|
1222
|
-
this.destroyed.next();
|
|
1223
|
-
this.destroyed.complete();
|
|
1224
|
-
};
|
|
1225
|
-
CdkEditable.prototype._listenForTableEvents = function () {
|
|
1226
|
-
var _this = this;
|
|
1227
|
-
var element = this.elementRef.nativeElement;
|
|
1228
|
-
var toClosest = function (selector) { return operators.map(function (event) { return closest(event.target, selector); }); };
|
|
1229
|
-
this.ngZone.runOutsideAngular(function () {
|
|
1230
|
-
// Track mouse movement over the table to hide/show hover content.
|
|
1231
|
-
rxjs.fromEvent(element, 'mouseover').pipe(toClosest(ROW_SELECTOR), operators.takeUntil(_this.destroyed)).subscribe(_this.editEventDispatcher.hovering);
|
|
1232
|
-
rxjs.fromEvent(element, 'mouseleave').pipe(operators.mapTo(null), operators.takeUntil(_this.destroyed)).subscribe(_this.editEventDispatcher.hovering);
|
|
1233
|
-
rxjs.fromEvent(element, 'mousemove').pipe(operators.throttleTime(MOUSE_MOVE_THROTTLE_TIME_MS), toClosest(ROW_SELECTOR), operators.takeUntil(_this.destroyed)).subscribe(_this.editEventDispatcher.mouseMove);
|
|
1234
|
-
// Track focus within the table to hide/show/make focusable hover content.
|
|
1235
|
-
rxjs.fromEventPattern(function (handler) { return element.addEventListener('focus', handler, true); }, function (handler) { return element.removeEventListener('focus', handler, true); }).pipe(toClosest(ROW_SELECTOR), operators.share(), operators.takeUntil(_this.destroyed)).subscribe(_this.editEventDispatcher.focused);
|
|
1236
|
-
rxjs.merge(rxjs.fromEventPattern(function (handler) { return element.addEventListener('blur', handler, true); }, function (handler) { return element.removeEventListener('blur', handler, true); }), rxjs.fromEvent(element, 'keydown').pipe(operators.filter(function (event) { return event.key === 'Escape'; }))).pipe(operators.mapTo(null), operators.share(), operators.takeUntil(_this.destroyed)).subscribe(_this.editEventDispatcher.focused);
|
|
1237
|
-
// Keep track of rows within the table. This is used to know which rows with hover content
|
|
1238
|
-
// are first or last in the table. They are kept focusable in case focus enters from above
|
|
1239
|
-
// or below the table.
|
|
1240
|
-
_this.ngZone.onStable.pipe(
|
|
1241
|
-
// Optimization: ignore dom changes while focus is within the table as we already
|
|
1242
|
-
// ensure that rows above and below the focused/active row are tabbable.
|
|
1243
|
-
operators.withLatestFrom(_this.editEventDispatcher.editingOrFocused), operators.filter(function (_a) {
|
|
1244
|
-
var _b = __read(_a, 2), _ = _b[0], activeRow = _b[1];
|
|
1245
|
-
return activeRow == null;
|
|
1246
|
-
}), operators.map(function () { return element.querySelectorAll(ROW_SELECTOR); }), operators.share(), operators.takeUntil(_this.destroyed)).subscribe(_this.editEventDispatcher.allRows);
|
|
1247
|
-
rxjs.fromEvent(element, 'keydown').pipe(operators.filter(function (event) { return event.key === 'Enter'; }), toClosest(CELL_SELECTOR), operators.takeUntil(_this.destroyed)).subscribe(_this.editEventDispatcher.editing);
|
|
1248
|
-
// Keydown must be used here or else key autorepeat does not work properly on some platforms.
|
|
1249
|
-
rxjs.fromEvent(element, 'keydown')
|
|
1250
|
-
.pipe(operators.takeUntil(_this.destroyed))
|
|
1251
|
-
.subscribe(_this.focusDispatcher.keyObserver);
|
|
1252
|
-
});
|
|
1253
|
-
};
|
|
1254
|
-
return CdkEditable;
|
|
1255
|
-
}());
|
|
1256
|
-
CdkEditable.decorators = [
|
|
1257
|
-
{ type: i0.Directive, args: [{
|
|
1258
|
-
selector: 'table[editable], cdk-table[editable], mat-table[editable]',
|
|
1259
|
-
providers: [EditEventDispatcher, EditServices],
|
|
1260
|
-
},] }
|
|
1261
|
-
];
|
|
1262
|
-
CdkEditable.ctorParameters = function () { return [
|
|
1263
|
-
{ type: i0.ElementRef },
|
|
1264
|
-
{ type: EditEventDispatcher },
|
|
1265
|
-
{ type: FocusDispatcher },
|
|
1266
|
-
{ type: i0.NgZone }
|
|
1267
|
-
]; };
|
|
1268
|
-
var POPOVER_EDIT_HOST_BINDINGS = {
|
|
1269
|
-
'[attr.tabindex]': 'disabled ? null : 0',
|
|
1270
|
-
'class': 'cdk-popover-edit-cell',
|
|
1271
|
-
'[attr.aria-haspopup]': '!disabled',
|
|
1272
|
-
};
|
|
1273
|
-
var POPOVER_EDIT_INPUTS = [
|
|
1274
|
-
'template: cdkPopoverEdit',
|
|
1275
|
-
'context: cdkPopoverEditContext',
|
|
1276
|
-
'colspan: cdkPopoverEditColspan',
|
|
1277
|
-
'disabled: cdkPopoverEditDisabled',
|
|
1278
|
-
];
|
|
1279
|
-
/**
|
|
1280
|
-
* Attaches an ng-template to a cell and shows it when instructed to by the
|
|
1281
|
-
* EditEventDispatcher service.
|
|
1282
|
-
* Makes the cell focusable.
|
|
1283
|
-
*/
|
|
1284
|
-
var CdkPopoverEdit = /** @class */ (function () {
|
|
1285
|
-
function CdkPopoverEdit(services, elementRef, viewContainerRef) {
|
|
1286
|
-
this.services = services;
|
|
1287
|
-
this.elementRef = elementRef;
|
|
1288
|
-
this.viewContainerRef = viewContainerRef;
|
|
1289
|
-
/** The edit lens template shown over the cell on edit. */
|
|
1290
|
-
this.template = null;
|
|
1291
|
-
this._colspan = {};
|
|
1292
|
-
this._disabled = false;
|
|
1293
|
-
this.destroyed = new rxjs.Subject();
|
|
1294
|
-
}
|
|
1295
|
-
Object.defineProperty(CdkPopoverEdit.prototype, "colspan", {
|
|
1296
|
-
/**
|
|
1297
|
-
* Specifies that the popup should cover additional table cells before and/or after
|
|
1298
|
-
* this one.
|
|
1299
|
-
*/
|
|
1300
|
-
get: function () {
|
|
1301
|
-
return this._colspan;
|
|
1302
|
-
},
|
|
1303
|
-
set: function (value) {
|
|
1304
|
-
this._colspan = value;
|
|
1305
|
-
// Recompute positioning when the colspan changes.
|
|
1306
|
-
if (this.overlayRef) {
|
|
1307
|
-
this.overlayRef.updatePositionStrategy(this._getPositionStrategy());
|
|
1308
|
-
if (this.overlayRef.hasAttached()) {
|
|
1309
|
-
this._updateOverlaySize();
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
},
|
|
1313
|
-
enumerable: false,
|
|
1314
|
-
configurable: true
|
|
1315
|
-
});
|
|
1316
|
-
Object.defineProperty(CdkPopoverEdit.prototype, "disabled", {
|
|
1317
|
-
/** Whether popover edit is disabled for this cell. */
|
|
1318
|
-
get: function () {
|
|
1319
|
-
return this._disabled;
|
|
1320
|
-
},
|
|
1321
|
-
set: function (value) {
|
|
1322
|
-
this._disabled = value;
|
|
1323
|
-
if (value) {
|
|
1324
|
-
this.services.editEventDispatcher.doneEditingCell(this.elementRef.nativeElement);
|
|
1325
|
-
this.services.editEventDispatcher.disabledCells.set(this.elementRef.nativeElement, true);
|
|
1326
|
-
}
|
|
1327
|
-
else {
|
|
1328
|
-
this.services.editEventDispatcher.disabledCells.delete(this.elementRef.nativeElement);
|
|
1329
|
-
}
|
|
1330
|
-
},
|
|
1331
|
-
enumerable: false,
|
|
1332
|
-
configurable: true
|
|
1333
|
-
});
|
|
1334
|
-
CdkPopoverEdit.prototype.ngAfterViewInit = function () {
|
|
1335
|
-
this._startListeningToEditEvents();
|
|
1336
|
-
};
|
|
1337
|
-
CdkPopoverEdit.prototype.ngOnDestroy = function () {
|
|
1338
|
-
this.destroyed.next();
|
|
1339
|
-
this.destroyed.complete();
|
|
1340
|
-
if (this.focusTrap) {
|
|
1341
|
-
this.focusTrap.destroy();
|
|
1342
|
-
this.focusTrap = undefined;
|
|
1343
|
-
}
|
|
1344
|
-
if (this.overlayRef) {
|
|
1345
|
-
this.overlayRef.dispose();
|
|
1346
|
-
}
|
|
1347
|
-
};
|
|
1348
|
-
CdkPopoverEdit.prototype.initFocusTrap = function () {
|
|
1349
|
-
this.focusTrap = this.services.focusTrapFactory.create(this.overlayRef.overlayElement);
|
|
1350
|
-
};
|
|
1351
|
-
CdkPopoverEdit.prototype.closeEditOverlay = function () {
|
|
1352
|
-
this.services.editEventDispatcher.doneEditingCell(this.elementRef.nativeElement);
|
|
1353
|
-
};
|
|
1354
|
-
CdkPopoverEdit.prototype.panelClass = function () {
|
|
1355
|
-
return EDIT_PANE_CLASS;
|
|
1356
|
-
};
|
|
1357
|
-
CdkPopoverEdit.prototype._startListeningToEditEvents = function () {
|
|
1358
|
-
var _this = this;
|
|
1359
|
-
this.services.editEventDispatcher.editingCell(this.elementRef.nativeElement)
|
|
1360
|
-
.pipe(operators.takeUntil(this.destroyed))
|
|
1361
|
-
.subscribe(function (open) {
|
|
1362
|
-
if (open && _this.template) {
|
|
1363
|
-
if (!_this.overlayRef) {
|
|
1364
|
-
_this._createEditOverlay();
|
|
1365
|
-
}
|
|
1366
|
-
_this._showEditOverlay();
|
|
1367
|
-
}
|
|
1368
|
-
else if (_this.overlayRef) {
|
|
1369
|
-
_this._maybeReturnFocusToCell();
|
|
1370
|
-
_this.overlayRef.detach();
|
|
1371
|
-
}
|
|
1372
|
-
});
|
|
1373
|
-
};
|
|
1374
|
-
CdkPopoverEdit.prototype._createEditOverlay = function () {
|
|
1375
|
-
var _this = this;
|
|
1376
|
-
this.overlayRef = this.services.overlay.create({
|
|
1377
|
-
disposeOnNavigation: true,
|
|
1378
|
-
panelClass: this.panelClass(),
|
|
1379
|
-
positionStrategy: this._getPositionStrategy(),
|
|
1380
|
-
scrollStrategy: this.services.overlay.scrollStrategies.reposition(),
|
|
1381
|
-
direction: this.services.directionality,
|
|
1382
|
-
});
|
|
1383
|
-
this.initFocusTrap();
|
|
1384
|
-
this.overlayRef.overlayElement.setAttribute('aria-role', 'dialog');
|
|
1385
|
-
this.overlayRef.detachments().subscribe(function () { return _this.closeEditOverlay(); });
|
|
1386
|
-
};
|
|
1387
|
-
CdkPopoverEdit.prototype._showEditOverlay = function () {
|
|
1388
|
-
var _this = this;
|
|
1389
|
-
this.overlayRef.attach(new portal.TemplatePortal(this.template, this.viewContainerRef, { $implicit: this.context }));
|
|
1390
|
-
// We have to defer trapping focus, because doing so too early can cause the form inside
|
|
1391
|
-
// the overlay to be submitted immediately if it was opened on an Enter keydown event.
|
|
1392
|
-
this.services.ngZone.runOutsideAngular(function () {
|
|
1393
|
-
setTimeout(function () {
|
|
1394
|
-
_this.focusTrap.focusInitialElement();
|
|
1395
|
-
});
|
|
1396
|
-
});
|
|
1397
|
-
// Update the size of the popup initially and on subsequent changes to
|
|
1398
|
-
// scroll position and viewport size.
|
|
1399
|
-
rxjs.merge(this.services.scrollDispatcher.scrolled(), this.services.viewportRuler.change())
|
|
1400
|
-
.pipe(operators.startWith(null), operators.takeUntil(rxjs.merge(this.overlayRef.detachments(), this.destroyed)))
|
|
1401
|
-
.subscribe(function () {
|
|
1402
|
-
_this._updateOverlaySize();
|
|
1403
|
-
});
|
|
1404
|
-
};
|
|
1405
|
-
CdkPopoverEdit.prototype._getOverlayCells = function () {
|
|
1406
|
-
var cell = closest(this.elementRef.nativeElement, CELL_SELECTOR);
|
|
1407
|
-
if (!this._colspan.before && !this._colspan.after) {
|
|
1408
|
-
return [cell];
|
|
1409
|
-
}
|
|
1410
|
-
var row = closest(this.elementRef.nativeElement, ROW_SELECTOR);
|
|
1411
|
-
var rowCells = Array.from(row.querySelectorAll(CELL_SELECTOR));
|
|
1412
|
-
var ownIndex = rowCells.indexOf(cell);
|
|
1413
|
-
return rowCells.slice(ownIndex - (this._colspan.before || 0), ownIndex + (this._colspan.after || 0) + 1);
|
|
1414
|
-
};
|
|
1415
|
-
CdkPopoverEdit.prototype._getPositionStrategy = function () {
|
|
1416
|
-
return this.services.positionFactory.positionStrategyForCells(this._getOverlayCells());
|
|
1417
|
-
};
|
|
1418
|
-
CdkPopoverEdit.prototype._updateOverlaySize = function () {
|
|
1419
|
-
this.overlayRef.updateSize(this.services.positionFactory.sizeConfigForCells(this._getOverlayCells()));
|
|
1420
|
-
};
|
|
1421
|
-
CdkPopoverEdit.prototype._maybeReturnFocusToCell = function () {
|
|
1422
|
-
if (closest(document.activeElement, EDIT_PANE_SELECTOR) ===
|
|
1423
|
-
this.overlayRef.overlayElement) {
|
|
1424
|
-
this.elementRef.nativeElement.focus();
|
|
1425
|
-
}
|
|
1426
|
-
};
|
|
1427
|
-
return CdkPopoverEdit;
|
|
1428
|
-
}());
|
|
1429
|
-
CdkPopoverEdit.decorators = [
|
|
1430
|
-
{ type: i0.Directive, args: [{
|
|
1431
|
-
selector: '[cdkPopoverEdit]:not([cdkPopoverEditTabOut])',
|
|
1432
|
-
host: POPOVER_EDIT_HOST_BINDINGS,
|
|
1433
|
-
inputs: POPOVER_EDIT_INPUTS,
|
|
1434
|
-
},] }
|
|
1435
|
-
];
|
|
1436
|
-
CdkPopoverEdit.ctorParameters = function () { return [
|
|
1437
|
-
{ type: EditServices },
|
|
1438
|
-
{ type: i0.ElementRef },
|
|
1439
|
-
{ type: i0.ViewContainerRef }
|
|
1440
|
-
]; };
|
|
1441
|
-
/**
|
|
1442
|
-
* Attaches an ng-template to a cell and shows it when instructed to by the
|
|
1443
|
-
* EditEventDispatcher service.
|
|
1444
|
-
* Makes the cell focusable.
|
|
1445
|
-
*/
|
|
1446
|
-
var CdkPopoverEditTabOut = /** @class */ (function (_super) {
|
|
1447
|
-
__extends(CdkPopoverEditTabOut, _super);
|
|
1448
|
-
function CdkPopoverEditTabOut(elementRef, viewContainerRef, services, focusEscapeNotifierFactory) {
|
|
1449
|
-
var _this = _super.call(this, services, elementRef, viewContainerRef) || this;
|
|
1450
|
-
_this.focusEscapeNotifierFactory = focusEscapeNotifierFactory;
|
|
1451
|
-
return _this;
|
|
1452
|
-
}
|
|
1453
|
-
CdkPopoverEditTabOut.prototype.initFocusTrap = function () {
|
|
1454
|
-
var _this = this;
|
|
1455
|
-
this.focusTrap = this.focusEscapeNotifierFactory.create(this.overlayRef.overlayElement);
|
|
1456
|
-
this.focusTrap.escapes().pipe(operators.takeUntil(this.destroyed)).subscribe(function (direction) {
|
|
1457
|
-
if (_this.services.editEventDispatcher.editRef) {
|
|
1458
|
-
_this.services.editEventDispatcher.editRef.blur();
|
|
1459
|
-
}
|
|
1460
|
-
_this.services.focusDispatcher.moveFocusHorizontally(closest(_this.elementRef.nativeElement, CELL_SELECTOR), direction === 0 /* START */ ? -1 : 1);
|
|
1461
|
-
_this.closeEditOverlay();
|
|
1462
|
-
});
|
|
1463
|
-
};
|
|
1464
|
-
return CdkPopoverEditTabOut;
|
|
1465
|
-
}(CdkPopoverEdit));
|
|
1466
|
-
CdkPopoverEditTabOut.decorators = [
|
|
1467
|
-
{ type: i0.Directive, args: [{
|
|
1468
|
-
selector: '[cdkPopoverEdit][cdkPopoverEditTabOut]',
|
|
1469
|
-
host: POPOVER_EDIT_HOST_BINDINGS,
|
|
1470
|
-
inputs: POPOVER_EDIT_INPUTS,
|
|
1471
|
-
},] }
|
|
1472
|
-
];
|
|
1473
|
-
CdkPopoverEditTabOut.ctorParameters = function () { return [
|
|
1474
|
-
{ type: i0.ElementRef },
|
|
1475
|
-
{ type: i0.ViewContainerRef },
|
|
1476
|
-
{ type: EditServices },
|
|
1477
|
-
{ type: FocusEscapeNotifierFactory }
|
|
1478
|
-
]; };
|
|
1479
|
-
/**
|
|
1480
|
-
* A structural directive that shows its contents when the table row containing
|
|
1481
|
-
* it is hovered or when an element in the row has focus.
|
|
1482
|
-
*/
|
|
1483
|
-
var CdkRowHoverContent = /** @class */ (function () {
|
|
1484
|
-
function CdkRowHoverContent(services, elementRef, templateRef, viewContainerRef) {
|
|
1485
|
-
this.services = services;
|
|
1486
|
-
this.elementRef = elementRef;
|
|
1487
|
-
this.templateRef = templateRef;
|
|
1488
|
-
this.viewContainerRef = viewContainerRef;
|
|
1489
|
-
this.destroyed = new rxjs.Subject();
|
|
1490
|
-
this.viewRef = null;
|
|
1491
|
-
}
|
|
1492
|
-
CdkRowHoverContent.prototype.ngAfterViewInit = function () {
|
|
1493
|
-
this._row = closest(this.elementRef.nativeElement, ROW_SELECTOR);
|
|
1494
|
-
this.services.editEventDispatcher.registerRowWithHoverContent(this._row);
|
|
1495
|
-
this._listenForHoverAndFocusEvents();
|
|
1496
|
-
};
|
|
1497
|
-
CdkRowHoverContent.prototype.ngOnDestroy = function () {
|
|
1498
|
-
this.destroyed.next();
|
|
1499
|
-
this.destroyed.complete();
|
|
1500
|
-
if (this.viewRef) {
|
|
1501
|
-
this.viewRef.destroy();
|
|
1502
|
-
}
|
|
1503
|
-
if (this._row) {
|
|
1504
|
-
this.services.editEventDispatcher.deregisterRowWithHoverContent(this._row);
|
|
1505
|
-
}
|
|
1506
|
-
};
|
|
1507
|
-
/**
|
|
1508
|
-
* Called immediately after the hover content is created and added to the dom.
|
|
1509
|
-
* In the CDK version, this is a noop but subclasses such as MatRowHoverContent use this
|
|
1510
|
-
* to prepare/style the inserted element.
|
|
1511
|
-
*/
|
|
1512
|
-
CdkRowHoverContent.prototype.initElement = function (_) {
|
|
1513
|
-
};
|
|
1514
|
-
/**
|
|
1515
|
-
* Called when the hover content needs to be focusable to preserve a reasonable tab ordering
|
|
1516
|
-
* but should not yet be shown.
|
|
1517
|
-
*/
|
|
1518
|
-
CdkRowHoverContent.prototype.makeElementHiddenButFocusable = function (element) {
|
|
1519
|
-
element.style.opacity = '0';
|
|
1520
|
-
};
|
|
1521
|
-
/**
|
|
1522
|
-
* Called when the hover content needs to be focusable to preserve a reasonable tab ordering
|
|
1523
|
-
* but should not yet be shown.
|
|
1524
|
-
*/
|
|
1525
|
-
CdkRowHoverContent.prototype.makeElementVisible = function (element) {
|
|
1526
|
-
element.style.opacity = '';
|
|
1527
|
-
};
|
|
1528
|
-
CdkRowHoverContent.prototype._listenForHoverAndFocusEvents = function () {
|
|
1529
|
-
var _this = this;
|
|
1530
|
-
this.services.editEventDispatcher.hoverOrFocusOnRow(this._row)
|
|
1531
|
-
.pipe(operators.takeUntil(this.destroyed))
|
|
1532
|
-
.subscribe(function (eventState) {
|
|
1533
|
-
// When in FOCUSABLE state, add the hover content to the dom but make it transparent so
|
|
1534
|
-
// that it is in the tab order relative to the currently focused row.
|
|
1535
|
-
if (eventState === 2 /* ON */ || eventState === 1 /* FOCUSABLE */) {
|
|
1536
|
-
if (!_this.viewRef) {
|
|
1537
|
-
_this.viewRef = _this.viewContainerRef.createEmbeddedView(_this.templateRef, {});
|
|
1538
|
-
_this.initElement(_this.viewRef.rootNodes[0]);
|
|
1539
|
-
_this.viewRef.markForCheck();
|
|
1540
|
-
}
|
|
1541
|
-
else if (_this.viewContainerRef.indexOf(_this.viewRef) === -1) {
|
|
1542
|
-
_this.viewContainerRef.insert(_this.viewRef);
|
|
1543
|
-
_this.viewRef.markForCheck();
|
|
1544
|
-
}
|
|
1545
|
-
if (eventState === 2 /* ON */) {
|
|
1546
|
-
_this.makeElementVisible(_this.viewRef.rootNodes[0]);
|
|
1547
|
-
}
|
|
1548
|
-
else {
|
|
1549
|
-
_this.makeElementHiddenButFocusable(_this.viewRef.rootNodes[0]);
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
else if (_this.viewRef) {
|
|
1553
|
-
_this.viewContainerRef.detach(_this.viewContainerRef.indexOf(_this.viewRef));
|
|
1554
|
-
}
|
|
1555
|
-
});
|
|
1556
|
-
};
|
|
1557
|
-
return CdkRowHoverContent;
|
|
1558
|
-
}());
|
|
1559
|
-
CdkRowHoverContent.decorators = [
|
|
1560
|
-
{ type: i0.Directive, args: [{
|
|
1561
|
-
selector: '[cdkRowHoverContent]',
|
|
1562
|
-
},] }
|
|
1563
|
-
];
|
|
1564
|
-
CdkRowHoverContent.ctorParameters = function () { return [
|
|
1565
|
-
{ type: EditServices },
|
|
1566
|
-
{ type: i0.ElementRef },
|
|
1567
|
-
{ type: i0.TemplateRef },
|
|
1568
|
-
{ type: i0.ViewContainerRef }
|
|
1569
|
-
]; };
|
|
1570
|
-
/**
|
|
1571
|
-
* Opens the closest edit popover to this element, whether it's associated with this exact
|
|
1572
|
-
* element or an ancestor element.
|
|
1573
|
-
*/
|
|
1574
|
-
var CdkEditOpen = /** @class */ (function () {
|
|
1575
|
-
function CdkEditOpen(elementRef, editEventDispatcher) {
|
|
1576
|
-
this.elementRef = elementRef;
|
|
1577
|
-
this.editEventDispatcher = editEventDispatcher;
|
|
1578
|
-
var nativeElement = elementRef.nativeElement;
|
|
1579
|
-
// Prevent accidental form submits.
|
|
1580
|
-
if (nativeElement.nodeName === 'BUTTON' && !nativeElement.getAttribute('type')) {
|
|
1581
|
-
nativeElement.setAttribute('type', 'button');
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
|
|
1585
|
-
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
|
|
1586
|
-
// can move this back into `host`.
|
|
1587
|
-
// tslint:disable-next-line:no-host-decorator-in-concrete
|
|
1588
|
-
CdkEditOpen.prototype.openEdit = function (evt) {
|
|
1589
|
-
this.editEventDispatcher.editing.next(closest(this.elementRef.nativeElement, CELL_SELECTOR));
|
|
1590
|
-
evt.stopPropagation();
|
|
1591
|
-
};
|
|
1592
|
-
return CdkEditOpen;
|
|
1593
|
-
}());
|
|
1594
|
-
CdkEditOpen.decorators = [
|
|
1595
|
-
{ type: i0.Directive, args: [{
|
|
1596
|
-
selector: '[cdkEditOpen]',
|
|
1597
|
-
},] }
|
|
1598
|
-
];
|
|
1599
|
-
CdkEditOpen.ctorParameters = function () { return [
|
|
1600
|
-
{ type: i0.ElementRef },
|
|
1601
|
-
{ type: EditEventDispatcher }
|
|
1602
|
-
]; };
|
|
1603
|
-
CdkEditOpen.propDecorators = {
|
|
1604
|
-
openEdit: [{ type: i0.HostListener, args: ['click', ['$event'],] }]
|
|
1605
|
-
};
|
|
1606
|
-
|
|
1607
|
-
/**
|
|
1608
|
-
* @license
|
|
1609
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1610
|
-
*
|
|
1611
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1612
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1613
|
-
*/
|
|
1614
|
-
var EXPORTED_DECLARATIONS = [
|
|
1615
|
-
CdkPopoverEdit,
|
|
1616
|
-
CdkPopoverEditTabOut,
|
|
1617
|
-
CdkRowHoverContent,
|
|
1618
|
-
CdkEditControl,
|
|
1619
|
-
CdkEditRevert,
|
|
1620
|
-
CdkEditClose,
|
|
1621
|
-
CdkEditable,
|
|
1622
|
-
CdkEditOpen,
|
|
1623
|
-
];
|
|
1624
|
-
var CdkPopoverEditModule = /** @class */ (function () {
|
|
1625
|
-
function CdkPopoverEditModule() {
|
|
1626
|
-
}
|
|
1627
|
-
return CdkPopoverEditModule;
|
|
1628
|
-
}());
|
|
1629
|
-
CdkPopoverEditModule.decorators = [
|
|
1630
|
-
{ type: i0.NgModule, args: [{
|
|
1631
|
-
imports: [
|
|
1632
|
-
overlay.OverlayModule,
|
|
1633
|
-
],
|
|
1634
|
-
exports: EXPORTED_DECLARATIONS,
|
|
1635
|
-
declarations: EXPORTED_DECLARATIONS,
|
|
1636
|
-
providers: [{
|
|
1637
|
-
provide: PopoverEditPositionStrategyFactory,
|
|
1638
|
-
useClass: DefaultPopoverEditPositionStrategyFactory
|
|
1639
|
-
}],
|
|
1640
|
-
},] }
|
|
1641
|
-
];
|
|
1642
|
-
|
|
1643
|
-
/**
|
|
1644
|
-
* @license
|
|
1645
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1646
|
-
*
|
|
1647
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1648
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1649
|
-
*/
|
|
1650
|
-
|
|
1651
|
-
/**
|
|
1652
|
-
* Generated bundle index. Do not edit.
|
|
1653
|
-
*/
|
|
1654
|
-
|
|
1655
|
-
exports.CdkEditClose = CdkEditClose;
|
|
1656
|
-
exports.CdkEditControl = CdkEditControl;
|
|
1657
|
-
exports.CdkEditOpen = CdkEditOpen;
|
|
1658
|
-
exports.CdkEditRevert = CdkEditRevert;
|
|
1659
|
-
exports.CdkEditable = CdkEditable;
|
|
1660
|
-
exports.CdkPopoverEdit = CdkPopoverEdit;
|
|
1661
|
-
exports.CdkPopoverEditModule = CdkPopoverEditModule;
|
|
1662
|
-
exports.CdkPopoverEditTabOut = CdkPopoverEditTabOut;
|
|
1663
|
-
exports.CdkRowHoverContent = CdkRowHoverContent;
|
|
1664
|
-
exports.DefaultPopoverEditPositionStrategyFactory = DefaultPopoverEditPositionStrategyFactory;
|
|
1665
|
-
exports.EditEventDispatcher = EditEventDispatcher;
|
|
1666
|
-
exports.EditRef = EditRef;
|
|
1667
|
-
exports.FocusDispatcher = FocusDispatcher;
|
|
1668
|
-
exports.FormValueContainer = FormValueContainer;
|
|
1669
|
-
exports.PopoverEditPositionStrategyFactory = PopoverEditPositionStrategyFactory;
|
|
1670
|
-
exports._CELL_SELECTOR = CELL_SELECTOR;
|
|
1671
|
-
exports._closest = closest;
|
|
1672
|
-
exports._matches = matches;
|
|
1673
|
-
exports.ɵangular_material_src_cdk_experimental_popover_edit_popover_edit_a = EditServices;
|
|
1674
|
-
exports.ɵangular_material_src_cdk_experimental_popover_edit_popover_edit_b = FocusEscapeNotifierFactory;
|
|
1675
|
-
|
|
1676
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1677
|
-
|
|
1678
|
-
})));
|
|
1679
|
-
//# sourceMappingURL=cdk-experimental-popover-edit.umd.js.map
|