@kato-lee/cdk 14.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +8 -0
- package/_index.scss +8 -0
- package/a11y/_index.import.scss +2 -0
- package/a11y/_index.scss +102 -0
- package/a11y/index.d.ts +1212 -0
- package/a11y-prebuilt.css +1 -0
- package/accordion/index.d.ts +140 -0
- package/bidi/index.d.ts +80 -0
- package/clipboard/index.d.ts +115 -0
- package/coercion/index.d.ts +67 -0
- package/collections/index.d.ts +374 -0
- package/dialog/index.d.ts +469 -0
- package/drag-drop/index.d.ts +1614 -0
- package/esm2020/a11y/a11y-module.mjs +32 -0
- package/esm2020/a11y/a11y_public_index.mjs +5 -0
- package/esm2020/a11y/aria-describer/aria-describer.mjs +232 -0
- package/esm2020/a11y/aria-describer/aria-reference.mjs +44 -0
- package/esm2020/a11y/fake-event-detection.mjs +31 -0
- package/esm2020/a11y/focus-monitor/focus-monitor.mjs +451 -0
- package/esm2020/a11y/focus-trap/configurable-focus-trap-config.mjs +9 -0
- package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +53 -0
- package/esm2020/a11y/focus-trap/configurable-focus-trap.mjs +51 -0
- package/esm2020/a11y/focus-trap/event-listener-inert-strategy.mjs +61 -0
- package/esm2020/a11y/focus-trap/focus-trap-inert-strategy.mjs +11 -0
- package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +53 -0
- package/esm2020/a11y/focus-trap/focus-trap.mjs +402 -0
- package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +109 -0
- package/esm2020/a11y/index.mjs +9 -0
- package/esm2020/a11y/input-modality/input-modality-detector.mjs +176 -0
- package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +238 -0
- package/esm2020/a11y/key-manager/activedescendant-key-manager.mjs +20 -0
- package/esm2020/a11y/key-manager/focus-key-manager.mjs +29 -0
- package/esm2020/a11y/key-manager/list-key-manager.mjs +321 -0
- package/esm2020/a11y/live-announcer/live-announcer-tokens.mjs +19 -0
- package/esm2020/a11y/live-announcer/live-announcer.mjs +178 -0
- package/esm2020/a11y/public-api.mjs +26 -0
- package/esm2020/accordion/accordion-item.mjs +167 -0
- package/esm2020/accordion/accordion-module.mjs +24 -0
- package/esm2020/accordion/accordion.mjs +70 -0
- package/esm2020/accordion/accordion_public_index.mjs +5 -0
- package/esm2020/accordion/index.mjs +9 -0
- package/esm2020/accordion/public-api.mjs +11 -0
- package/esm2020/bidi/bidi-module.mjs +23 -0
- package/esm2020/bidi/bidi_public_index.mjs +5 -0
- package/esm2020/bidi/dir-document-token.mjs +33 -0
- package/esm2020/bidi/dir.mjs +69 -0
- package/esm2020/bidi/directionality.mjs +52 -0
- package/esm2020/bidi/index.mjs +9 -0
- package/esm2020/bidi/public-api.mjs +12 -0
- package/esm2020/clipboard/clipboard-module.mjs +23 -0
- package/esm2020/clipboard/clipboard.mjs +53 -0
- package/esm2020/clipboard/clipboard_public_index.mjs +5 -0
- package/esm2020/clipboard/copy-to-clipboard.mjs +99 -0
- package/esm2020/clipboard/index.mjs +9 -0
- package/esm2020/clipboard/pending-copy.mjs +69 -0
- package/esm2020/clipboard/public-api.mjs +12 -0
- package/esm2020/coercion/array.mjs +11 -0
- package/esm2020/coercion/boolean-property.mjs +12 -0
- package/esm2020/coercion/css-pixel-value.mjs +15 -0
- package/esm2020/coercion/element.mjs +16 -0
- package/esm2020/coercion/index.mjs +9 -0
- package/esm2020/coercion/number-property.mjs +21 -0
- package/esm2020/coercion/public-api.mjs +14 -0
- package/esm2020/coercion/string-array.mjs +38 -0
- package/esm2020/collections/array-data-source.mjs +21 -0
- package/esm2020/collections/collection-viewer.mjs +9 -0
- package/esm2020/collections/collections_public_index.mjs +5 -0
- package/esm2020/collections/data-source.mjs +19 -0
- package/esm2020/collections/dispose-view-repeater-strategy.mjs +47 -0
- package/esm2020/collections/index.mjs +9 -0
- package/esm2020/collections/public-api.mjs +17 -0
- package/esm2020/collections/recycle-view-repeater-strategy.mjs +128 -0
- package/esm2020/collections/selection-model.mjs +216 -0
- package/esm2020/collections/tree-adapter.mjs +9 -0
- package/esm2020/collections/unique-selection-dispatcher.mjs +55 -0
- package/esm2020/collections/view-repeater.mjs +14 -0
- package/esm2020/dialog/dialog-config.mjs +63 -0
- package/esm2020/dialog/dialog-container.mjs +278 -0
- package/esm2020/dialog/dialog-injectors.mjs +26 -0
- package/esm2020/dialog/dialog-module.mjs +42 -0
- package/esm2020/dialog/dialog-ref.mjs +76 -0
- package/esm2020/dialog/dialog.mjs +301 -0
- package/esm2020/dialog/dialog_public_index.mjs +5 -0
- package/esm2020/dialog/index.mjs +9 -0
- package/esm2020/dialog/public-api.mjs +14 -0
- package/esm2020/drag-drop/directives/assertions.mjs +18 -0
- package/esm2020/drag-drop/directives/config.mjs +14 -0
- package/esm2020/drag-drop/directives/drag-handle.mjs +66 -0
- package/esm2020/drag-drop/directives/drag-placeholder.mjs +36 -0
- package/esm2020/drag-drop/directives/drag-preview.mjs +47 -0
- package/esm2020/drag-drop/directives/drag.mjs +487 -0
- package/esm2020/drag-drop/directives/drop-list-group.mjs +53 -0
- package/esm2020/drag-drop/directives/drop-list.mjs +345 -0
- package/esm2020/drag-drop/dom/client-rect.mjs +64 -0
- package/esm2020/drag-drop/dom/clone-node.mjs +65 -0
- package/esm2020/drag-drop/dom/parent-position-tracker.mjs +76 -0
- package/esm2020/drag-drop/dom/styling.mjs +69 -0
- package/esm2020/drag-drop/dom/transition-duration.mjs +36 -0
- package/esm2020/drag-drop/drag-drop-module.mjs +57 -0
- package/esm2020/drag-drop/drag-drop-registry.mjs +231 -0
- package/esm2020/drag-drop/drag-drop.mjs +57 -0
- package/esm2020/drag-drop/drag-drop_public_index.mjs +5 -0
- package/esm2020/drag-drop/drag-events.mjs +9 -0
- package/esm2020/drag-drop/drag-parent.mjs +16 -0
- package/esm2020/drag-drop/drag-ref.mjs +1146 -0
- package/esm2020/drag-drop/drag-utils.mjs +60 -0
- package/esm2020/drag-drop/drop-list-ref.mjs +577 -0
- package/esm2020/drag-drop/index.mjs +9 -0
- package/esm2020/drag-drop/public-api.mjs +23 -0
- package/esm2020/drag-drop/sorting/drop-list-sort-strategy.mjs +9 -0
- package/esm2020/drag-drop/sorting/single-axis-sort-strategy.mjs +341 -0
- package/esm2020/index.mjs +9 -0
- package/esm2020/keycodes/index.mjs +9 -0
- package/esm2020/keycodes/keycodes.mjs +127 -0
- package/esm2020/keycodes/keycodes_public_index.mjs +5 -0
- package/esm2020/keycodes/modifiers.mjs +18 -0
- package/esm2020/keycodes/public-api.mjs +10 -0
- package/esm2020/layout/breakpoints-observer.mjs +105 -0
- package/esm2020/layout/breakpoints.mjs +29 -0
- package/esm2020/layout/index.mjs +9 -0
- package/esm2020/layout/layout-module.mjs +19 -0
- package/esm2020/layout/layout_public_index.mjs +5 -0
- package/esm2020/layout/media-matcher.mjs +85 -0
- package/esm2020/layout/public-api.mjs +12 -0
- package/esm2020/listbox/index.mjs +9 -0
- package/esm2020/listbox/listbox-module.mjs +24 -0
- package/esm2020/listbox/listbox.mjs +872 -0
- package/esm2020/listbox/listbox_public_index.mjs +5 -0
- package/esm2020/listbox/public-api.mjs +10 -0
- package/esm2020/menu/context-menu-trigger.mjs +212 -0
- package/esm2020/menu/index.mjs +9 -0
- package/esm2020/menu/menu-aim.mjs +203 -0
- package/esm2020/menu/menu-bar.mjs +133 -0
- package/esm2020/menu/menu-base.mjs +187 -0
- package/esm2020/menu/menu-errors.mjs +22 -0
- package/esm2020/menu/menu-group.mjs +30 -0
- package/esm2020/menu/menu-interface.mjs +11 -0
- package/esm2020/menu/menu-item-checkbox.mjs +49 -0
- package/esm2020/menu/menu-item-radio.mjs +71 -0
- package/esm2020/menu/menu-item-selectable.mjs +42 -0
- package/esm2020/menu/menu-item.mjs +267 -0
- package/esm2020/menu/menu-module.mjs +62 -0
- package/esm2020/menu/menu-stack.mjs +156 -0
- package/esm2020/menu/menu-trigger-base.mjs +107 -0
- package/esm2020/menu/menu-trigger.mjs +291 -0
- package/esm2020/menu/menu.mjs +134 -0
- package/esm2020/menu/menu_public_index.mjs +5 -0
- package/esm2020/menu/pointer-focus-tracker.mjs +51 -0
- package/esm2020/menu/public-api.mjs +24 -0
- package/esm2020/observers/index.mjs +9 -0
- package/esm2020/observers/observe-content.mjs +187 -0
- package/esm2020/observers/observers_public_index.mjs +5 -0
- package/esm2020/observers/public-api.mjs +9 -0
- package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +52 -0
- package/esm2020/overlay/dispatchers/index.mjs +10 -0
- package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +81 -0
- package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +138 -0
- package/esm2020/overlay/fullscreen-overlay-container.mjs +94 -0
- package/esm2020/overlay/index.mjs +9 -0
- package/esm2020/overlay/overlay-config.mjs +45 -0
- package/esm2020/overlay/overlay-container.mjs +81 -0
- package/esm2020/overlay/overlay-directives.mjs +427 -0
- package/esm2020/overlay/overlay-module.mjs +29 -0
- package/esm2020/overlay/overlay-ref.mjs +427 -0
- package/esm2020/overlay/overlay-reference.mjs +9 -0
- package/esm2020/overlay/overlay.mjs +125 -0
- package/esm2020/overlay/overlay_public_index.mjs +5 -0
- package/esm2020/overlay/position/connected-position.mjs +88 -0
- package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +985 -0
- package/esm2020/overlay/position/global-position-strategy.mjs +237 -0
- package/esm2020/overlay/position/overlay-position-builder.mjs +50 -0
- package/esm2020/overlay/position/position-strategy.mjs +9 -0
- package/esm2020/overlay/position/scroll-clip.mjs +40 -0
- package/esm2020/overlay/public-api.mjs +22 -0
- package/esm2020/overlay/scroll/block-scroll-strategy.mjs +80 -0
- package/esm2020/overlay/scroll/close-scroll-strategy.mjs +61 -0
- package/esm2020/overlay/scroll/index.mjs +14 -0
- package/esm2020/overlay/scroll/noop-scroll-strategy.mjs +17 -0
- package/esm2020/overlay/scroll/reposition-scroll-strategy.mjs +61 -0
- package/esm2020/overlay/scroll/scroll-strategy-options.mjs +55 -0
- package/esm2020/overlay/scroll/scroll-strategy.mjs +14 -0
- package/esm2020/platform/features/input-types.mjs +59 -0
- package/esm2020/platform/features/passive-listeners.mjs +36 -0
- package/esm2020/platform/features/scrolling.mjs +85 -0
- package/esm2020/platform/features/shadow-dom.mjs +54 -0
- package/esm2020/platform/features/test-environment.mjs +24 -0
- package/esm2020/platform/index.mjs +9 -0
- package/esm2020/platform/platform-module.mjs +19 -0
- package/esm2020/platform/platform.mjs +85 -0
- package/esm2020/platform/platform_public_index.mjs +5 -0
- package/esm2020/platform/public-api.mjs +15 -0
- package/esm2020/portal/dom-portal-outlet.mjs +158 -0
- package/esm2020/portal/index.mjs +9 -0
- package/esm2020/portal/portal-directives.mjs +246 -0
- package/esm2020/portal/portal-errors.mjs +51 -0
- package/esm2020/portal/portal-injector.mjs +28 -0
- package/esm2020/portal/portal.mjs +188 -0
- package/esm2020/portal/portal_public_index.mjs +5 -0
- package/esm2020/portal/public-api.mjs +12 -0
- package/esm2020/public-api.mjs +9 -0
- package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +217 -0
- package/esm2020/scrolling/index.mjs +9 -0
- package/esm2020/scrolling/public-api.mjs +20 -0
- package/esm2020/scrolling/scroll-dispatcher.mjs +163 -0
- package/esm2020/scrolling/scrollable.mjs +176 -0
- package/esm2020/scrolling/scrolling-module.mjs +67 -0
- package/esm2020/scrolling/scrolling_public_index.mjs +5 -0
- package/esm2020/scrolling/viewport-ruler.mjs +146 -0
- package/esm2020/scrolling/virtual-for-of.mjs +298 -0
- package/esm2020/scrolling/virtual-scroll-repeater.mjs +9 -0
- package/esm2020/scrolling/virtual-scroll-strategy.mjs +11 -0
- package/esm2020/scrolling/virtual-scroll-viewport.mjs +437 -0
- package/esm2020/scrolling/virtual-scrollable-element.mjs +41 -0
- package/esm2020/scrolling/virtual-scrollable-window.mjs +40 -0
- package/esm2020/scrolling/virtual-scrollable.mjs +40 -0
- package/esm2020/stepper/index.mjs +9 -0
- package/esm2020/stepper/public-api.mjs +13 -0
- package/esm2020/stepper/step-header.mjs +30 -0
- package/esm2020/stepper/step-label.mjs +23 -0
- package/esm2020/stepper/stepper-button.mjs +56 -0
- package/esm2020/stepper/stepper-module.mjs +40 -0
- package/esm2020/stepper/stepper.mjs +458 -0
- package/esm2020/stepper/stepper_public_index.mjs +5 -0
- package/esm2020/table/can-stick.mjs +44 -0
- package/esm2020/table/cell.mjs +217 -0
- package/esm2020/table/coalesced-style-scheduler.mjs +91 -0
- package/esm2020/table/index.mjs +9 -0
- package/esm2020/table/public-api.mjs +20 -0
- package/esm2020/table/row.mjs +262 -0
- package/esm2020/table/sticky-position-listener.mjs +11 -0
- package/esm2020/table/sticky-styler.mjs +345 -0
- package/esm2020/table/table-errors.mjs +67 -0
- package/esm2020/table/table-module.mjs +94 -0
- package/esm2020/table/table.mjs +1065 -0
- package/esm2020/table/table_public_index.mjs +5 -0
- package/esm2020/table/text-column.mjs +153 -0
- package/esm2020/table/tokens.mjs +16 -0
- package/esm2020/text-field/autofill.mjs +113 -0
- package/esm2020/text-field/autosize.mjs +309 -0
- package/esm2020/text-field/index.mjs +9 -0
- package/esm2020/text-field/public-api.mjs +11 -0
- package/esm2020/text-field/text-field-module.mjs +24 -0
- package/esm2020/text-field/text-field_public_index.mjs +5 -0
- package/esm2020/tree/control/base-tree-control.mjs +57 -0
- package/esm2020/tree/control/flat-tree-control.mjs +51 -0
- package/esm2020/tree/control/nested-tree-control.mjs +58 -0
- package/esm2020/tree/control/tree-control.mjs +2 -0
- package/esm2020/tree/index.mjs +9 -0
- package/esm2020/tree/nested-node.mjs +112 -0
- package/esm2020/tree/node.mjs +35 -0
- package/esm2020/tree/outlet.mjs +39 -0
- package/esm2020/tree/padding.mjs +131 -0
- package/esm2020/tree/public-api.mjs +20 -0
- package/esm2020/tree/toggle.mjs +50 -0
- package/esm2020/tree/tree-errors.mjs +43 -0
- package/esm2020/tree/tree-module.mjs +49 -0
- package/esm2020/tree/tree.mjs +347 -0
- package/esm2020/tree/tree_public_index.mjs +5 -0
- package/esm2020/version.mjs +11 -0
- package/fesm2015/a11y.mjs +2473 -0
- package/fesm2015/a11y.mjs.map +1 -0
- package/fesm2015/accordion.mjs +414 -0
- package/fesm2015/accordion.mjs.map +1 -0
- package/fesm2015/bidi.mjs +194 -0
- package/fesm2015/bidi.mjs.map +1 -0
- package/fesm2015/cdk.mjs +30 -0
- package/fesm2015/cdk.mjs.map +1 -0
- package/fesm2015/clipboard.mjs +263 -0
- package/fesm2015/clipboard.mjs.map +1 -0
- package/fesm2015/coercion.mjs +132 -0
- package/fesm2015/coercion.mjs.map +1 -0
- package/fesm2015/collections.mjs +519 -0
- package/fesm2015/collections.mjs.map +1 -0
- package/fesm2015/dialog.mjs +1050 -0
- package/fesm2015/dialog.mjs.map +1 -0
- package/fesm2015/drag-drop.mjs +3812 -0
- package/fesm2015/drag-drop.mjs.map +1 -0
- package/fesm2015/keycodes.mjs +167 -0
- package/fesm2015/keycodes.mjs.map +1 -0
- package/fesm2015/layout.mjs +337 -0
- package/fesm2015/layout.mjs.map +1 -0
- package/fesm2015/listbox.mjs +1200 -0
- package/fesm2015/listbox.mjs.map +1 -0
- package/fesm2015/menu.mjs +2719 -0
- package/fesm2015/menu.mjs.map +1 -0
- package/fesm2015/observers.mjs +326 -0
- package/fesm2015/observers.mjs.map +1 -0
- package/fesm2015/overlay.mjs +3137 -0
- package/fesm2015/overlay.mjs.map +1 -0
- package/fesm2015/platform.mjs +385 -0
- package/fesm2015/platform.mjs.map +1 -0
- package/fesm2015/portal.mjs +691 -0
- package/fesm2015/portal.mjs.map +1 -0
- package/fesm2015/scrolling.mjs +1558 -0
- package/fesm2015/scrolling.mjs.map +1 -0
- package/fesm2015/stepper.mjs +989 -0
- package/fesm2015/stepper.mjs.map +1 -0
- package/fesm2015/table.mjs +2356 -0
- package/fesm2015/table.mjs.map +1 -0
- package/fesm2015/testing.mjs +833 -0
- package/fesm2015/testing.mjs.map +1 -0
- package/fesm2015/text-field.mjs +461 -0
- package/fesm2015/text-field.mjs.map +1 -0
- package/fesm2015/tree.mjs +1303 -0
- package/fesm2015/tree.mjs.map +1 -0
- package/fesm2020/a11y.mjs +2476 -0
- package/fesm2020/a11y.mjs.map +1 -0
- package/fesm2020/accordion.mjs +414 -0
- package/fesm2020/accordion.mjs.map +1 -0
- package/fesm2020/bidi.mjs +192 -0
- package/fesm2020/bidi.mjs.map +1 -0
- package/fesm2020/cdk.mjs +30 -0
- package/fesm2020/cdk.mjs.map +1 -0
- package/fesm2020/clipboard.mjs +259 -0
- package/fesm2020/clipboard.mjs.map +1 -0
- package/fesm2020/coercion.mjs +132 -0
- package/fesm2020/coercion.mjs.map +1 -0
- package/fesm2020/collections.mjs +535 -0
- package/fesm2020/collections.mjs.map +1 -0
- package/fesm2020/dialog.mjs +787 -0
- package/fesm2020/dialog.mjs.map +1 -0
- package/fesm2020/drag-drop.mjs +3808 -0
- package/fesm2020/drag-drop.mjs.map +1 -0
- package/fesm2020/keycodes.mjs +167 -0
- package/fesm2020/keycodes.mjs.map +1 -0
- package/fesm2020/layout.mjs +337 -0
- package/fesm2020/layout.mjs.map +1 -0
- package/fesm2020/listbox.mjs +1164 -0
- package/fesm2020/listbox.mjs.map +1 -0
- package/fesm2020/menu.mjs +2615 -0
- package/fesm2020/menu.mjs.map +1 -0
- package/fesm2020/observers.mjs +325 -0
- package/fesm2020/observers.mjs.map +1 -0
- package/fesm2020/overlay.mjs +3145 -0
- package/fesm2020/overlay.mjs.map +1 -0
- package/fesm2020/platform.mjs +383 -0
- package/fesm2020/platform.mjs.map +1 -0
- package/fesm2020/portal.mjs +689 -0
- package/fesm2020/portal.mjs.map +1 -0
- package/fesm2020/scrolling.mjs +1591 -0
- package/fesm2020/scrolling.mjs.map +1 -0
- package/fesm2020/stepper.mjs +985 -0
- package/fesm2020/stepper.mjs.map +1 -0
- package/fesm2020/table.mjs +2348 -0
- package/fesm2020/table.mjs.map +1 -0
- package/fesm2020/testing.mjs +797 -0
- package/fesm2020/testing.mjs.map +1 -0
- package/fesm2020/text-field.mjs +459 -0
- package/fesm2020/text-field.mjs.map +1 -0
- package/fesm2020/tree.mjs +1305 -0
- package/fesm2020/tree.mjs.map +1 -0
- package/index.d.ts +6 -0
- package/keycodes/index.d.ts +249 -0
- package/layout/index.d.ts +90 -0
- package/listbox/index.d.ts +419 -0
- package/menu/index.d.ts +1013 -0
- package/observers/index.d.ts +109 -0
- package/overlay/_index-deprecated.scss +13 -0
- package/overlay/_index.import.scss +13 -0
- package/overlay/_index.scss +152 -0
- package/overlay/index.d.ts +1343 -0
- package/overlay-prebuilt.css +1 -0
- package/package.json +232 -0
- package/platform/index.d.ts +106 -0
- package/portal/index.d.ts +328 -0
- package/scrolling/index.d.ts +849 -0
- package/stepper/index.d.ts +419 -0
- package/table/index.d.ts +1483 -0
- package/text-field/_index.import.scss +2 -0
- package/text-field/_index.scss +89 -0
- package/text-field/index.d.ts +203 -0
- package/text-field-prebuilt.css +1 -0
- package/tree/index.d.ts +593 -0
|
@@ -0,0 +1,1050 @@
|
|
|
1
|
+
import { _getFocusedElementPierceShadowDom } from '@kato-lee/cdk/platform';
|
|
2
|
+
import * as i3 from '@kato-lee/cdk/portal';
|
|
3
|
+
import {
|
|
4
|
+
BasePortalOutlet,
|
|
5
|
+
CdkPortalOutlet,
|
|
6
|
+
ComponentPortal,
|
|
7
|
+
TemplatePortal,
|
|
8
|
+
PortalModule,
|
|
9
|
+
} from '@kato-lee/cdk/portal';
|
|
10
|
+
import { DOCUMENT } from '@angular/common';
|
|
11
|
+
import * as i0 from '@angular/core';
|
|
12
|
+
import {
|
|
13
|
+
Component,
|
|
14
|
+
ViewEncapsulation,
|
|
15
|
+
ChangeDetectionStrategy,
|
|
16
|
+
Optional,
|
|
17
|
+
Inject,
|
|
18
|
+
ViewChild,
|
|
19
|
+
InjectionToken,
|
|
20
|
+
Injector,
|
|
21
|
+
TemplateRef,
|
|
22
|
+
InjectFlags,
|
|
23
|
+
Injectable,
|
|
24
|
+
SkipSelf,
|
|
25
|
+
NgModule,
|
|
26
|
+
} from '@angular/core';
|
|
27
|
+
import * as i1 from '@kato-lee/cdk/a11y';
|
|
28
|
+
import { A11yModule } from '@kato-lee/cdk/a11y';
|
|
29
|
+
import * as i1$1 from '@kato-lee/cdk/overlay';
|
|
30
|
+
import { Overlay, OverlayConfig, OverlayRef, OverlayModule } from '@kato-lee/cdk/overlay';
|
|
31
|
+
import { ESCAPE, hasModifierKey } from '@kato-lee/cdk/keycodes';
|
|
32
|
+
import { Subject, defer, of } from 'rxjs';
|
|
33
|
+
import { Directionality } from '@kato-lee/cdk/bidi';
|
|
34
|
+
import { startWith } from 'rxjs/operators';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @license
|
|
38
|
+
* Copyright Google LLC All Rights Reserved.
|
|
39
|
+
*
|
|
40
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
41
|
+
* found in the LICENSE file at https://angular.io/license
|
|
42
|
+
*/
|
|
43
|
+
/** Configuration for opening a modal dialog. */
|
|
44
|
+
class DialogConfig {
|
|
45
|
+
constructor() {
|
|
46
|
+
/** The ARIA role of the dialog element. */
|
|
47
|
+
this.role = 'dialog';
|
|
48
|
+
/** Optional CSS class or classes applied to the overlay panel. */
|
|
49
|
+
this.panelClass = '';
|
|
50
|
+
/** Whether the dialog has a backdrop. */
|
|
51
|
+
this.hasBackdrop = true;
|
|
52
|
+
/** Optional CSS class or classes applied to the overlay backdrop. */
|
|
53
|
+
this.backdropClass = '';
|
|
54
|
+
/** Whether the dialog closes with the escape key or pointer events outside the panel element. */
|
|
55
|
+
this.disableClose = false;
|
|
56
|
+
/** Width of the dialog. */
|
|
57
|
+
this.width = '';
|
|
58
|
+
/** Height of the dialog. */
|
|
59
|
+
this.height = '';
|
|
60
|
+
/** Data being injected into the child component. */
|
|
61
|
+
this.data = null;
|
|
62
|
+
/** ID of the element that describes the dialog. */
|
|
63
|
+
this.ariaDescribedBy = null;
|
|
64
|
+
/** ID of the element that labels the dialog. */
|
|
65
|
+
this.ariaLabelledBy = null;
|
|
66
|
+
/** Dialog label applied via `aria-label` */
|
|
67
|
+
this.ariaLabel = null;
|
|
68
|
+
/** Whether this is a modal dialog. Used to set the `aria-modal` attribute. */
|
|
69
|
+
this.ariaModal = true;
|
|
70
|
+
/**
|
|
71
|
+
* Where the dialog should focus on open.
|
|
72
|
+
* @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or
|
|
73
|
+
* AutoFocusTarget instead.
|
|
74
|
+
*/
|
|
75
|
+
this.autoFocus = 'first-tabbable';
|
|
76
|
+
/**
|
|
77
|
+
* Whether the dialog should restore focus to the previously-focused element upon closing.
|
|
78
|
+
* Has the following behavior based on the type that is passed in:
|
|
79
|
+
* - `boolean` - when true, will return focus to the element that was focused before the dialog
|
|
80
|
+
* was opened, otherwise won't restore focus at all.
|
|
81
|
+
* - `string` - focus will be restored to the first element that matches the CSS selector.
|
|
82
|
+
* - `HTMLElement` - focus will be restored to the specific element.
|
|
83
|
+
*/
|
|
84
|
+
this.restoreFocus = true;
|
|
85
|
+
/**
|
|
86
|
+
* Whether the dialog should close when the user navigates backwards or forwards through browser
|
|
87
|
+
* history. This does not apply to navigation via anchor element unless using URL-hash based
|
|
88
|
+
* routing (`HashLocationStrategy` in the Angular router).
|
|
89
|
+
*/
|
|
90
|
+
this.closeOnNavigation = true;
|
|
91
|
+
/**
|
|
92
|
+
* Whether the dialog should close when the dialog service is destroyed. This is useful if
|
|
93
|
+
* another service is wrapping the dialog and is managing the destruction instead.
|
|
94
|
+
*/
|
|
95
|
+
this.closeOnDestroy = true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function throwDialogContentAlreadyAttachedError() {
|
|
100
|
+
throw Error('Attempting to attach dialog content after content is already attached');
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Internal component that wraps user-provided dialog content.
|
|
104
|
+
* @docs-private
|
|
105
|
+
*/
|
|
106
|
+
class CdkDialogContainer extends BasePortalOutlet {
|
|
107
|
+
constructor(
|
|
108
|
+
_elementRef,
|
|
109
|
+
_focusTrapFactory,
|
|
110
|
+
_document,
|
|
111
|
+
_config,
|
|
112
|
+
_interactivityChecker,
|
|
113
|
+
_ngZone,
|
|
114
|
+
_overlayRef,
|
|
115
|
+
_focusMonitor
|
|
116
|
+
) {
|
|
117
|
+
super();
|
|
118
|
+
this._elementRef = _elementRef;
|
|
119
|
+
this._focusTrapFactory = _focusTrapFactory;
|
|
120
|
+
this._config = _config;
|
|
121
|
+
this._interactivityChecker = _interactivityChecker;
|
|
122
|
+
this._ngZone = _ngZone;
|
|
123
|
+
this._overlayRef = _overlayRef;
|
|
124
|
+
this._focusMonitor = _focusMonitor;
|
|
125
|
+
/** Element that was focused before the dialog was opened. Save this to restore upon close. */
|
|
126
|
+
this._elementFocusedBeforeDialogWasOpened = null;
|
|
127
|
+
/**
|
|
128
|
+
* Type of interaction that led to the dialog being closed. This is used to determine
|
|
129
|
+
* whether the focus style will be applied when returning focus to its original location
|
|
130
|
+
* after the dialog is closed.
|
|
131
|
+
*/
|
|
132
|
+
this._closeInteractionType = null;
|
|
133
|
+
/**
|
|
134
|
+
* Attaches a DOM portal to the dialog container.
|
|
135
|
+
* @param portal Portal to be attached.
|
|
136
|
+
* @deprecated To be turned into a method.
|
|
137
|
+
* @breaking-change 10.0.0
|
|
138
|
+
*/
|
|
139
|
+
this.attachDomPortal = portal => {
|
|
140
|
+
if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
141
|
+
throwDialogContentAlreadyAttachedError();
|
|
142
|
+
}
|
|
143
|
+
const result = this._portalOutlet.attachDomPortal(portal);
|
|
144
|
+
this._contentAttached();
|
|
145
|
+
return result;
|
|
146
|
+
};
|
|
147
|
+
this._ariaLabelledBy = this._config.ariaLabelledBy || null;
|
|
148
|
+
this._document = _document;
|
|
149
|
+
}
|
|
150
|
+
_contentAttached() {
|
|
151
|
+
this._initializeFocusTrap();
|
|
152
|
+
this._handleBackdropClicks();
|
|
153
|
+
this._captureInitialFocus();
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Can be used by child classes to customize the initial focus
|
|
157
|
+
* capturing behavior (e.g. if it's tied to an animation).
|
|
158
|
+
*/
|
|
159
|
+
_captureInitialFocus() {
|
|
160
|
+
this._trapFocus();
|
|
161
|
+
}
|
|
162
|
+
ngOnDestroy() {
|
|
163
|
+
this._restoreFocus();
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Attach a ComponentPortal as content to this dialog container.
|
|
167
|
+
* @param portal Portal to be attached as the dialog content.
|
|
168
|
+
*/
|
|
169
|
+
attachComponentPortal(portal) {
|
|
170
|
+
if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
171
|
+
throwDialogContentAlreadyAttachedError();
|
|
172
|
+
}
|
|
173
|
+
const result = this._portalOutlet.attachComponentPortal(portal);
|
|
174
|
+
this._contentAttached();
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Attach a TemplatePortal as content to this dialog container.
|
|
179
|
+
* @param portal Portal to be attached as the dialog content.
|
|
180
|
+
*/
|
|
181
|
+
attachTemplatePortal(portal) {
|
|
182
|
+
if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
183
|
+
throwDialogContentAlreadyAttachedError();
|
|
184
|
+
}
|
|
185
|
+
const result = this._portalOutlet.attachTemplatePortal(portal);
|
|
186
|
+
this._contentAttached();
|
|
187
|
+
return result;
|
|
188
|
+
}
|
|
189
|
+
// TODO(crisbeto): this shouldn't be exposed, but there are internal references to it.
|
|
190
|
+
/** Captures focus if it isn't already inside the dialog. */
|
|
191
|
+
_recaptureFocus() {
|
|
192
|
+
if (!this._containsFocus()) {
|
|
193
|
+
this._trapFocus();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Focuses the provided element. If the element is not focusable, it will add a tabIndex
|
|
198
|
+
* attribute to forcefully focus it. The attribute is removed after focus is moved.
|
|
199
|
+
* @param element The element to focus.
|
|
200
|
+
*/
|
|
201
|
+
_forceFocus(element, options) {
|
|
202
|
+
if (!this._interactivityChecker.isFocusable(element)) {
|
|
203
|
+
element.tabIndex = -1;
|
|
204
|
+
// The tabindex attribute should be removed to avoid navigating to that element again
|
|
205
|
+
this._ngZone.runOutsideAngular(() => {
|
|
206
|
+
const callback = () => {
|
|
207
|
+
element.removeEventListener('blur', callback);
|
|
208
|
+
element.removeEventListener('mousedown', callback);
|
|
209
|
+
element.removeAttribute('tabindex');
|
|
210
|
+
};
|
|
211
|
+
element.addEventListener('blur', callback);
|
|
212
|
+
element.addEventListener('mousedown', callback);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
element.focus(options);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Focuses the first element that matches the given selector within the focus trap.
|
|
219
|
+
* @param selector The CSS selector for the element to set focus to.
|
|
220
|
+
*/
|
|
221
|
+
_focusByCssSelector(selector, options) {
|
|
222
|
+
let elementToFocus = this._elementRef.nativeElement.querySelector(selector);
|
|
223
|
+
if (elementToFocus) {
|
|
224
|
+
this._forceFocus(elementToFocus, options);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Moves the focus inside the focus trap. When autoFocus is not set to 'dialog', if focus
|
|
229
|
+
* cannot be moved then focus will go to the dialog container.
|
|
230
|
+
*/
|
|
231
|
+
_trapFocus() {
|
|
232
|
+
const element = this._elementRef.nativeElement;
|
|
233
|
+
// If were to attempt to focus immediately, then the content of the dialog would not yet be
|
|
234
|
+
// ready in instances where change detection has to run first. To deal with this, we simply
|
|
235
|
+
// wait for the microtask queue to be empty when setting focus when autoFocus isn't set to
|
|
236
|
+
// dialog. If the element inside the dialog can't be focused, then the container is focused
|
|
237
|
+
// so the user can't tab into other elements behind it.
|
|
238
|
+
switch (this._config.autoFocus) {
|
|
239
|
+
case false:
|
|
240
|
+
case 'dialog':
|
|
241
|
+
// Ensure that focus is on the dialog container. It's possible that a different
|
|
242
|
+
// component tried to move focus while the open animation was running. See:
|
|
243
|
+
// https://github.com/angular/components/issues/16215. Note that we only want to do this
|
|
244
|
+
// if the focus isn't inside the dialog already, because it's possible that the consumer
|
|
245
|
+
// turned off `autoFocus` in order to move focus themselves.
|
|
246
|
+
if (!this._containsFocus()) {
|
|
247
|
+
element.focus();
|
|
248
|
+
}
|
|
249
|
+
break;
|
|
250
|
+
case true:
|
|
251
|
+
case 'first-tabbable':
|
|
252
|
+
this._focusTrap.focusInitialElementWhenReady().then(focusedSuccessfully => {
|
|
253
|
+
// If we weren't able to find a focusable element in the dialog, then focus the dialog
|
|
254
|
+
// container instead.
|
|
255
|
+
if (!focusedSuccessfully) {
|
|
256
|
+
this._focusDialogContainer();
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
break;
|
|
260
|
+
case 'first-heading':
|
|
261
|
+
this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');
|
|
262
|
+
break;
|
|
263
|
+
default:
|
|
264
|
+
this._focusByCssSelector(this._config.autoFocus);
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
/** Restores focus to the element that was focused before the dialog opened. */
|
|
269
|
+
_restoreFocus() {
|
|
270
|
+
const focusConfig = this._config.restoreFocus;
|
|
271
|
+
let focusTargetElement = null;
|
|
272
|
+
if (typeof focusConfig === 'string') {
|
|
273
|
+
focusTargetElement = this._document.querySelector(focusConfig);
|
|
274
|
+
} else if (typeof focusConfig === 'boolean') {
|
|
275
|
+
focusTargetElement = focusConfig ? this._elementFocusedBeforeDialogWasOpened : null;
|
|
276
|
+
} else if (focusConfig) {
|
|
277
|
+
focusTargetElement = focusConfig;
|
|
278
|
+
}
|
|
279
|
+
// We need the extra check, because IE can set the `activeElement` to null in some cases.
|
|
280
|
+
if (
|
|
281
|
+
this._config.restoreFocus &&
|
|
282
|
+
focusTargetElement &&
|
|
283
|
+
typeof focusTargetElement.focus === 'function'
|
|
284
|
+
) {
|
|
285
|
+
const activeElement = _getFocusedElementPierceShadowDom();
|
|
286
|
+
const element = this._elementRef.nativeElement;
|
|
287
|
+
// Make sure that focus is still inside the dialog or is on the body (usually because a
|
|
288
|
+
// non-focusable element like the backdrop was clicked) before moving it. It's possible that
|
|
289
|
+
// the consumer moved it themselves before the animation was done, in which case we shouldn't
|
|
290
|
+
// do anything.
|
|
291
|
+
if (
|
|
292
|
+
!activeElement ||
|
|
293
|
+
activeElement === this._document.body ||
|
|
294
|
+
activeElement === element ||
|
|
295
|
+
element.contains(activeElement)
|
|
296
|
+
) {
|
|
297
|
+
if (this._focusMonitor) {
|
|
298
|
+
this._focusMonitor.focusVia(focusTargetElement, this._closeInteractionType);
|
|
299
|
+
this._closeInteractionType = null;
|
|
300
|
+
} else {
|
|
301
|
+
focusTargetElement.focus();
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (this._focusTrap) {
|
|
306
|
+
this._focusTrap.destroy();
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
/** Focuses the dialog container. */
|
|
310
|
+
_focusDialogContainer() {
|
|
311
|
+
// Note that there is no focus method when rendering on the server.
|
|
312
|
+
if (this._elementRef.nativeElement.focus) {
|
|
313
|
+
this._elementRef.nativeElement.focus();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/** Returns whether focus is inside the dialog. */
|
|
317
|
+
_containsFocus() {
|
|
318
|
+
const element = this._elementRef.nativeElement;
|
|
319
|
+
const activeElement = _getFocusedElementPierceShadowDom();
|
|
320
|
+
return element === activeElement || element.contains(activeElement);
|
|
321
|
+
}
|
|
322
|
+
/** Sets up the focus trap. */
|
|
323
|
+
_initializeFocusTrap() {
|
|
324
|
+
this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
|
|
325
|
+
// Save the previously focused element. This element will be re-focused
|
|
326
|
+
// when the dialog closes.
|
|
327
|
+
if (this._document) {
|
|
328
|
+
this._elementFocusedBeforeDialogWasOpened = _getFocusedElementPierceShadowDom();
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
/** Sets up the listener that handles clicks on the dialog backdrop. */
|
|
332
|
+
_handleBackdropClicks() {
|
|
333
|
+
// Clicking on the backdrop will move focus out of dialog.
|
|
334
|
+
// Recapture it if closing via the backdrop is disabled.
|
|
335
|
+
this._overlayRef.backdropClick().subscribe(() => {
|
|
336
|
+
if (this._config.disableClose) {
|
|
337
|
+
this._recaptureFocus();
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
CdkDialogContainer.ɵfac = i0.ɵɵngDeclareFactory({
|
|
343
|
+
minVersion: '12.0.0',
|
|
344
|
+
version: '14.2.0',
|
|
345
|
+
ngImport: i0,
|
|
346
|
+
type: CdkDialogContainer,
|
|
347
|
+
deps: [
|
|
348
|
+
{ token: i0.ElementRef },
|
|
349
|
+
{ token: i1.FocusTrapFactory },
|
|
350
|
+
{ token: DOCUMENT, optional: true },
|
|
351
|
+
{ token: DialogConfig },
|
|
352
|
+
{ token: i1.InteractivityChecker },
|
|
353
|
+
{ token: i0.NgZone },
|
|
354
|
+
{ token: i1$1.OverlayRef },
|
|
355
|
+
{ token: i1.FocusMonitor },
|
|
356
|
+
],
|
|
357
|
+
target: i0.ɵɵFactoryTarget.Component,
|
|
358
|
+
});
|
|
359
|
+
CdkDialogContainer.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
360
|
+
minVersion: '14.0.0',
|
|
361
|
+
version: '14.2.0',
|
|
362
|
+
type: CdkDialogContainer,
|
|
363
|
+
selector: 'cdk-dialog-container',
|
|
364
|
+
host: {
|
|
365
|
+
attributes: { tabindex: '-1' },
|
|
366
|
+
properties: {
|
|
367
|
+
'attr.id': '_config.id || null',
|
|
368
|
+
'attr.role': '_config.role',
|
|
369
|
+
'attr.aria-modal': '_config.ariaModal',
|
|
370
|
+
'attr.aria-labelledby': '_config.ariaLabel ? null : _ariaLabelledBy',
|
|
371
|
+
'attr.aria-label': '_config.ariaLabel',
|
|
372
|
+
'attr.aria-describedby': '_config.ariaDescribedBy || null',
|
|
373
|
+
},
|
|
374
|
+
classAttribute: 'cdk-dialog-container',
|
|
375
|
+
},
|
|
376
|
+
viewQueries: [
|
|
377
|
+
{
|
|
378
|
+
propertyName: '_portalOutlet',
|
|
379
|
+
first: true,
|
|
380
|
+
predicate: CdkPortalOutlet,
|
|
381
|
+
descendants: true,
|
|
382
|
+
static: true,
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
usesInheritance: true,
|
|
386
|
+
ngImport: i0,
|
|
387
|
+
template: '<ng-template cdkPortalOutlet></ng-template>\n',
|
|
388
|
+
styles: [
|
|
389
|
+
'.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}',
|
|
390
|
+
],
|
|
391
|
+
dependencies: [
|
|
392
|
+
{
|
|
393
|
+
kind: 'directive',
|
|
394
|
+
type: i3.CdkPortalOutlet,
|
|
395
|
+
selector: '[cdkPortalOutlet]',
|
|
396
|
+
inputs: ['cdkPortalOutlet'],
|
|
397
|
+
outputs: ['attached'],
|
|
398
|
+
exportAs: ['cdkPortalOutlet'],
|
|
399
|
+
},
|
|
400
|
+
],
|
|
401
|
+
changeDetection: i0.ChangeDetectionStrategy.Default,
|
|
402
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
403
|
+
});
|
|
404
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
405
|
+
minVersion: '12.0.0',
|
|
406
|
+
version: '14.2.0',
|
|
407
|
+
ngImport: i0,
|
|
408
|
+
type: CdkDialogContainer,
|
|
409
|
+
decorators: [
|
|
410
|
+
{
|
|
411
|
+
type: Component,
|
|
412
|
+
args: [
|
|
413
|
+
{
|
|
414
|
+
selector: 'cdk-dialog-container',
|
|
415
|
+
encapsulation: ViewEncapsulation.None,
|
|
416
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
417
|
+
host: {
|
|
418
|
+
class: 'cdk-dialog-container',
|
|
419
|
+
tabindex: '-1',
|
|
420
|
+
'[attr.id]': '_config.id || null',
|
|
421
|
+
'[attr.role]': '_config.role',
|
|
422
|
+
'[attr.aria-modal]': '_config.ariaModal',
|
|
423
|
+
'[attr.aria-labelledby]': '_config.ariaLabel ? null : _ariaLabelledBy',
|
|
424
|
+
'[attr.aria-label]': '_config.ariaLabel',
|
|
425
|
+
'[attr.aria-describedby]': '_config.ariaDescribedBy || null',
|
|
426
|
+
},
|
|
427
|
+
template: '<ng-template cdkPortalOutlet></ng-template>\n',
|
|
428
|
+
styles: [
|
|
429
|
+
'.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}',
|
|
430
|
+
],
|
|
431
|
+
},
|
|
432
|
+
],
|
|
433
|
+
},
|
|
434
|
+
],
|
|
435
|
+
ctorParameters: function () {
|
|
436
|
+
return [
|
|
437
|
+
{ type: i0.ElementRef },
|
|
438
|
+
{ type: i1.FocusTrapFactory },
|
|
439
|
+
{
|
|
440
|
+
type: undefined,
|
|
441
|
+
decorators: [
|
|
442
|
+
{
|
|
443
|
+
type: Optional,
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
type: Inject,
|
|
447
|
+
args: [DOCUMENT],
|
|
448
|
+
},
|
|
449
|
+
],
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
type: undefined,
|
|
453
|
+
decorators: [
|
|
454
|
+
{
|
|
455
|
+
type: Inject,
|
|
456
|
+
args: [DialogConfig],
|
|
457
|
+
},
|
|
458
|
+
],
|
|
459
|
+
},
|
|
460
|
+
{ type: i1.InteractivityChecker },
|
|
461
|
+
{ type: i0.NgZone },
|
|
462
|
+
{ type: i1$1.OverlayRef },
|
|
463
|
+
{ type: i1.FocusMonitor },
|
|
464
|
+
];
|
|
465
|
+
},
|
|
466
|
+
propDecorators: {
|
|
467
|
+
_portalOutlet: [
|
|
468
|
+
{
|
|
469
|
+
type: ViewChild,
|
|
470
|
+
args: [CdkPortalOutlet, { static: true }],
|
|
471
|
+
},
|
|
472
|
+
],
|
|
473
|
+
},
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* @license
|
|
478
|
+
* Copyright Google LLC All Rights Reserved.
|
|
479
|
+
*
|
|
480
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
481
|
+
* found in the LICENSE file at https://angular.io/license
|
|
482
|
+
*/
|
|
483
|
+
/**
|
|
484
|
+
* Reference to a dialog opened via the Dialog service.
|
|
485
|
+
*/
|
|
486
|
+
class DialogRef {
|
|
487
|
+
constructor(overlayRef, config) {
|
|
488
|
+
this.overlayRef = overlayRef;
|
|
489
|
+
this.config = config;
|
|
490
|
+
/** Emits when the dialog has been closed. */
|
|
491
|
+
this.closed = new Subject();
|
|
492
|
+
this.disableClose = config.disableClose;
|
|
493
|
+
this.backdropClick = overlayRef.backdropClick();
|
|
494
|
+
this.keydownEvents = overlayRef.keydownEvents();
|
|
495
|
+
this.outsidePointerEvents = overlayRef.outsidePointerEvents();
|
|
496
|
+
this.id = config.id; // By the time the dialog is created we are guaranteed to have an ID.
|
|
497
|
+
this.keydownEvents.subscribe(event => {
|
|
498
|
+
if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) {
|
|
499
|
+
event.preventDefault();
|
|
500
|
+
this.close(undefined, { focusOrigin: 'keyboard' });
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
this.backdropClick.subscribe(() => {
|
|
504
|
+
if (!this.disableClose) {
|
|
505
|
+
this.close(undefined, { focusOrigin: 'mouse' });
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Close the dialog.
|
|
511
|
+
* @param result Optional result to return to the dialog opener.
|
|
512
|
+
* @param options Additional options to customize the closing behavior.
|
|
513
|
+
*/
|
|
514
|
+
close(result, options) {
|
|
515
|
+
if (this.containerInstance) {
|
|
516
|
+
const closedSubject = this.closed;
|
|
517
|
+
this.containerInstance._closeInteractionType =
|
|
518
|
+
(options === null || options === void 0 ? void 0 : options.focusOrigin) || 'program';
|
|
519
|
+
this.overlayRef.dispose();
|
|
520
|
+
closedSubject.next(result);
|
|
521
|
+
closedSubject.complete();
|
|
522
|
+
this.componentInstance = this.containerInstance = null;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
/** Updates the position of the dialog based on the current position strategy. */
|
|
526
|
+
updatePosition() {
|
|
527
|
+
this.overlayRef.updatePosition();
|
|
528
|
+
return this;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Updates the dialog's width and height.
|
|
532
|
+
* @param width New width of the dialog.
|
|
533
|
+
* @param height New height of the dialog.
|
|
534
|
+
*/
|
|
535
|
+
updateSize(width = '', height = '') {
|
|
536
|
+
this.overlayRef.updateSize({ width, height });
|
|
537
|
+
return this;
|
|
538
|
+
}
|
|
539
|
+
/** Add a CSS class or an array of classes to the overlay pane. */
|
|
540
|
+
addPanelClass(classes) {
|
|
541
|
+
this.overlayRef.addPanelClass(classes);
|
|
542
|
+
return this;
|
|
543
|
+
}
|
|
544
|
+
/** Remove a CSS class or an array of classes from the overlay pane. */
|
|
545
|
+
removePanelClass(classes) {
|
|
546
|
+
this.overlayRef.removePanelClass(classes);
|
|
547
|
+
return this;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* @license
|
|
553
|
+
* Copyright Google LLC All Rights Reserved.
|
|
554
|
+
*
|
|
555
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
556
|
+
* found in the LICENSE file at https://angular.io/license
|
|
557
|
+
*/
|
|
558
|
+
/** Injection token for the Dialog's ScrollStrategy. */
|
|
559
|
+
const DIALOG_SCROLL_STRATEGY = new InjectionToken('DialogScrollStrategy');
|
|
560
|
+
/** Injection token for the Dialog's Data. */
|
|
561
|
+
const DIALOG_DATA = new InjectionToken('DialogData');
|
|
562
|
+
/** Injection token that can be used to provide default options for the dialog module. */
|
|
563
|
+
const DEFAULT_DIALOG_CONFIG = new InjectionToken('DefaultDialogConfig');
|
|
564
|
+
/** @docs-private */
|
|
565
|
+
function DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
|
|
566
|
+
return () => overlay.scrollStrategies.block();
|
|
567
|
+
}
|
|
568
|
+
/** @docs-private */
|
|
569
|
+
const DIALOG_SCROLL_STRATEGY_PROVIDER = {
|
|
570
|
+
provide: DIALOG_SCROLL_STRATEGY,
|
|
571
|
+
deps: [Overlay],
|
|
572
|
+
useFactory: DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* @license
|
|
577
|
+
* Copyright Google LLC All Rights Reserved.
|
|
578
|
+
*
|
|
579
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
580
|
+
* found in the LICENSE file at https://angular.io/license
|
|
581
|
+
*/
|
|
582
|
+
/** Unique id for the created dialog. */
|
|
583
|
+
let uniqueId = 0;
|
|
584
|
+
class Dialog {
|
|
585
|
+
constructor(
|
|
586
|
+
_overlay,
|
|
587
|
+
_injector,
|
|
588
|
+
_defaultOptions,
|
|
589
|
+
_parentDialog,
|
|
590
|
+
_overlayContainer,
|
|
591
|
+
scrollStrategy
|
|
592
|
+
) {
|
|
593
|
+
this._overlay = _overlay;
|
|
594
|
+
this._injector = _injector;
|
|
595
|
+
this._defaultOptions = _defaultOptions;
|
|
596
|
+
this._parentDialog = _parentDialog;
|
|
597
|
+
this._overlayContainer = _overlayContainer;
|
|
598
|
+
this._openDialogsAtThisLevel = [];
|
|
599
|
+
this._afterAllClosedAtThisLevel = new Subject();
|
|
600
|
+
this._afterOpenedAtThisLevel = new Subject();
|
|
601
|
+
this._ariaHiddenElements = new Map();
|
|
602
|
+
/**
|
|
603
|
+
* Stream that emits when all open dialog have finished closing.
|
|
604
|
+
* Will emit on subscribe if there are no open dialogs to begin with.
|
|
605
|
+
*/
|
|
606
|
+
this.afterAllClosed = defer(() =>
|
|
607
|
+
this.openDialogs.length
|
|
608
|
+
? this._getAfterAllClosed()
|
|
609
|
+
: this._getAfterAllClosed().pipe(startWith(undefined))
|
|
610
|
+
);
|
|
611
|
+
this._scrollStrategy = scrollStrategy;
|
|
612
|
+
}
|
|
613
|
+
/** Keeps track of the currently-open dialogs. */
|
|
614
|
+
get openDialogs() {
|
|
615
|
+
return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel;
|
|
616
|
+
}
|
|
617
|
+
/** Stream that emits when a dialog has been opened. */
|
|
618
|
+
get afterOpened() {
|
|
619
|
+
return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;
|
|
620
|
+
}
|
|
621
|
+
open(componentOrTemplateRef, config) {
|
|
622
|
+
const defaults = this._defaultOptions || new DialogConfig();
|
|
623
|
+
config = Object.assign(Object.assign({}, defaults), config);
|
|
624
|
+
config.id = config.id || `cdk-dialog-${uniqueId++}`;
|
|
625
|
+
if (
|
|
626
|
+
config.id &&
|
|
627
|
+
this.getDialogById(config.id) &&
|
|
628
|
+
(typeof ngDevMode === 'undefined' || ngDevMode)
|
|
629
|
+
) {
|
|
630
|
+
throw Error(`Dialog with id "${config.id}" exists already. The dialog id must be unique.`);
|
|
631
|
+
}
|
|
632
|
+
const overlayConfig = this._getOverlayConfig(config);
|
|
633
|
+
const overlayRef = this._overlay.create(overlayConfig);
|
|
634
|
+
const dialogRef = new DialogRef(overlayRef, config);
|
|
635
|
+
const dialogContainer = this._attachContainer(overlayRef, dialogRef, config);
|
|
636
|
+
dialogRef.containerInstance = dialogContainer;
|
|
637
|
+
this._attachDialogContent(componentOrTemplateRef, dialogRef, dialogContainer, config);
|
|
638
|
+
// If this is the first dialog that we're opening, hide all the non-overlay content.
|
|
639
|
+
if (!this.openDialogs.length) {
|
|
640
|
+
this._hideNonDialogContentFromAssistiveTechnology();
|
|
641
|
+
}
|
|
642
|
+
this.openDialogs.push(dialogRef);
|
|
643
|
+
dialogRef.closed.subscribe(() => this._removeOpenDialog(dialogRef, true));
|
|
644
|
+
this.afterOpened.next(dialogRef);
|
|
645
|
+
return dialogRef;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Closes all of the currently-open dialogs.
|
|
649
|
+
*/
|
|
650
|
+
closeAll() {
|
|
651
|
+
reverseForEach(this.openDialogs, dialog => dialog.close());
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Finds an open dialog by its id.
|
|
655
|
+
* @param id ID to use when looking up the dialog.
|
|
656
|
+
*/
|
|
657
|
+
getDialogById(id) {
|
|
658
|
+
return this.openDialogs.find(dialog => dialog.id === id);
|
|
659
|
+
}
|
|
660
|
+
ngOnDestroy() {
|
|
661
|
+
// Make one pass over all the dialogs that need to be untracked, but should not be closed. We
|
|
662
|
+
// want to stop tracking the open dialog even if it hasn't been closed, because the tracking
|
|
663
|
+
// determines when `aria-hidden` is removed from elements outside the dialog.
|
|
664
|
+
reverseForEach(this._openDialogsAtThisLevel, dialog => {
|
|
665
|
+
// Check for `false` specifically since we want `undefined` to be interpreted as `true`.
|
|
666
|
+
if (dialog.config.closeOnDestroy === false) {
|
|
667
|
+
this._removeOpenDialog(dialog, false);
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
// Make a second pass and close the remaining dialogs. We do this second pass in order to
|
|
671
|
+
// correctly dispatch the `afterAllClosed` event in case we have a mixed array of dialogs
|
|
672
|
+
// that should be closed and dialogs that should not.
|
|
673
|
+
reverseForEach(this._openDialogsAtThisLevel, dialog => dialog.close());
|
|
674
|
+
this._afterAllClosedAtThisLevel.complete();
|
|
675
|
+
this._afterOpenedAtThisLevel.complete();
|
|
676
|
+
this._openDialogsAtThisLevel = [];
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Creates an overlay config from a dialog config.
|
|
680
|
+
* @param config The dialog configuration.
|
|
681
|
+
* @returns The overlay configuration.
|
|
682
|
+
*/
|
|
683
|
+
_getOverlayConfig(config) {
|
|
684
|
+
const state = new OverlayConfig({
|
|
685
|
+
positionStrategy:
|
|
686
|
+
config.positionStrategy ||
|
|
687
|
+
this._overlay.position().global().centerHorizontally().centerVertically(),
|
|
688
|
+
scrollStrategy: config.scrollStrategy || this._scrollStrategy(),
|
|
689
|
+
panelClass: config.panelClass,
|
|
690
|
+
hasBackdrop: config.hasBackdrop,
|
|
691
|
+
direction: config.direction,
|
|
692
|
+
minWidth: config.minWidth,
|
|
693
|
+
minHeight: config.minHeight,
|
|
694
|
+
maxWidth: config.maxWidth,
|
|
695
|
+
maxHeight: config.maxHeight,
|
|
696
|
+
width: config.width,
|
|
697
|
+
height: config.height,
|
|
698
|
+
disposeOnNavigation: config.closeOnNavigation,
|
|
699
|
+
});
|
|
700
|
+
if (config.backdropClass) {
|
|
701
|
+
state.backdropClass = config.backdropClass;
|
|
702
|
+
}
|
|
703
|
+
return state;
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Attaches a dialog container to a dialog's already-created overlay.
|
|
707
|
+
* @param overlay Reference to the dialog's underlying overlay.
|
|
708
|
+
* @param config The dialog configuration.
|
|
709
|
+
* @returns A promise resolving to a ComponentRef for the attached container.
|
|
710
|
+
*/
|
|
711
|
+
_attachContainer(overlay, dialogRef, config) {
|
|
712
|
+
var _a;
|
|
713
|
+
const userInjector =
|
|
714
|
+
config.injector ||
|
|
715
|
+
((_a = config.viewContainerRef) === null || _a === void 0 ? void 0 : _a.injector);
|
|
716
|
+
const providers = [
|
|
717
|
+
{ provide: DialogConfig, useValue: config },
|
|
718
|
+
{ provide: DialogRef, useValue: dialogRef },
|
|
719
|
+
{ provide: OverlayRef, useValue: overlay },
|
|
720
|
+
];
|
|
721
|
+
let containerType;
|
|
722
|
+
if (config.container) {
|
|
723
|
+
if (typeof config.container === 'function') {
|
|
724
|
+
containerType = config.container;
|
|
725
|
+
} else {
|
|
726
|
+
containerType = config.container.type;
|
|
727
|
+
providers.push(...config.container.providers(config));
|
|
728
|
+
}
|
|
729
|
+
} else {
|
|
730
|
+
containerType = CdkDialogContainer;
|
|
731
|
+
}
|
|
732
|
+
const containerPortal = new ComponentPortal(
|
|
733
|
+
containerType,
|
|
734
|
+
config.viewContainerRef,
|
|
735
|
+
Injector.create({ parent: userInjector || this._injector, providers }),
|
|
736
|
+
config.componentFactoryResolver
|
|
737
|
+
);
|
|
738
|
+
const containerRef = overlay.attach(containerPortal);
|
|
739
|
+
return containerRef.instance;
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Attaches the user-provided component to the already-created dialog container.
|
|
743
|
+
* @param componentOrTemplateRef The type of component being loaded into the dialog,
|
|
744
|
+
* or a TemplateRef to instantiate as the content.
|
|
745
|
+
* @param dialogRef Reference to the dialog being opened.
|
|
746
|
+
* @param dialogContainer Component that is going to wrap the dialog content.
|
|
747
|
+
* @param config Configuration used to open the dialog.
|
|
748
|
+
*/
|
|
749
|
+
_attachDialogContent(componentOrTemplateRef, dialogRef, dialogContainer, config) {
|
|
750
|
+
if (componentOrTemplateRef instanceof TemplateRef) {
|
|
751
|
+
const injector = this._createInjector(config, dialogRef, dialogContainer, undefined);
|
|
752
|
+
let context = { $implicit: config.data, dialogRef };
|
|
753
|
+
if (config.templateContext) {
|
|
754
|
+
context = Object.assign(
|
|
755
|
+
Object.assign({}, context),
|
|
756
|
+
typeof config.templateContext === 'function'
|
|
757
|
+
? config.templateContext()
|
|
758
|
+
: config.templateContext
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
dialogContainer.attachTemplatePortal(
|
|
762
|
+
new TemplatePortal(componentOrTemplateRef, null, context, injector)
|
|
763
|
+
);
|
|
764
|
+
} else {
|
|
765
|
+
const injector = this._createInjector(config, dialogRef, dialogContainer, this._injector);
|
|
766
|
+
const contentRef = dialogContainer.attachComponentPortal(
|
|
767
|
+
new ComponentPortal(
|
|
768
|
+
componentOrTemplateRef,
|
|
769
|
+
config.viewContainerRef,
|
|
770
|
+
injector,
|
|
771
|
+
config.componentFactoryResolver
|
|
772
|
+
)
|
|
773
|
+
);
|
|
774
|
+
dialogRef.componentInstance = contentRef.instance;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Creates a custom injector to be used inside the dialog. This allows a component loaded inside
|
|
779
|
+
* of a dialog to close itself and, optionally, to return a value.
|
|
780
|
+
* @param config Config object that is used to construct the dialog.
|
|
781
|
+
* @param dialogRef Reference to the dialog being opened.
|
|
782
|
+
* @param dialogContainer Component that is going to wrap the dialog content.
|
|
783
|
+
* @param fallbackInjector Injector to use as a fallback when a lookup fails in the custom
|
|
784
|
+
* dialog injector, if the user didn't provide a custom one.
|
|
785
|
+
* @returns The custom injector that can be used inside the dialog.
|
|
786
|
+
*/
|
|
787
|
+
_createInjector(config, dialogRef, dialogContainer, fallbackInjector) {
|
|
788
|
+
var _a;
|
|
789
|
+
const userInjector =
|
|
790
|
+
config.injector ||
|
|
791
|
+
((_a = config.viewContainerRef) === null || _a === void 0 ? void 0 : _a.injector);
|
|
792
|
+
const providers = [
|
|
793
|
+
{ provide: DIALOG_DATA, useValue: config.data },
|
|
794
|
+
{ provide: DialogRef, useValue: dialogRef },
|
|
795
|
+
];
|
|
796
|
+
if (config.providers) {
|
|
797
|
+
if (typeof config.providers === 'function') {
|
|
798
|
+
providers.push(...config.providers(dialogRef, config, dialogContainer));
|
|
799
|
+
} else {
|
|
800
|
+
providers.push(...config.providers);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
if (
|
|
804
|
+
config.direction &&
|
|
805
|
+
(!userInjector || !userInjector.get(Directionality, null, InjectFlags.Optional))
|
|
806
|
+
) {
|
|
807
|
+
providers.push({
|
|
808
|
+
provide: Directionality,
|
|
809
|
+
useValue: { value: config.direction, change: of() },
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
return Injector.create({ parent: userInjector || fallbackInjector, providers });
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Removes a dialog from the array of open dialogs.
|
|
816
|
+
* @param dialogRef Dialog to be removed.
|
|
817
|
+
* @param emitEvent Whether to emit an event if this is the last dialog.
|
|
818
|
+
*/
|
|
819
|
+
_removeOpenDialog(dialogRef, emitEvent) {
|
|
820
|
+
const index = this.openDialogs.indexOf(dialogRef);
|
|
821
|
+
if (index > -1) {
|
|
822
|
+
this.openDialogs.splice(index, 1);
|
|
823
|
+
// If all the dialogs were closed, remove/restore the `aria-hidden`
|
|
824
|
+
// to a the siblings and emit to the `afterAllClosed` stream.
|
|
825
|
+
if (!this.openDialogs.length) {
|
|
826
|
+
this._ariaHiddenElements.forEach((previousValue, element) => {
|
|
827
|
+
if (previousValue) {
|
|
828
|
+
element.setAttribute('aria-hidden', previousValue);
|
|
829
|
+
} else {
|
|
830
|
+
element.removeAttribute('aria-hidden');
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
this._ariaHiddenElements.clear();
|
|
834
|
+
if (emitEvent) {
|
|
835
|
+
this._getAfterAllClosed().next();
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
/** Hides all of the content that isn't an overlay from assistive technology. */
|
|
841
|
+
_hideNonDialogContentFromAssistiveTechnology() {
|
|
842
|
+
const overlayContainer = this._overlayContainer.getContainerElement();
|
|
843
|
+
// Ensure that the overlay container is attached to the DOM.
|
|
844
|
+
if (overlayContainer.parentElement) {
|
|
845
|
+
const siblings = overlayContainer.parentElement.children;
|
|
846
|
+
for (let i = siblings.length - 1; i > -1; i--) {
|
|
847
|
+
const sibling = siblings[i];
|
|
848
|
+
if (
|
|
849
|
+
sibling !== overlayContainer &&
|
|
850
|
+
sibling.nodeName !== 'SCRIPT' &&
|
|
851
|
+
sibling.nodeName !== 'STYLE' &&
|
|
852
|
+
!sibling.hasAttribute('aria-live')
|
|
853
|
+
) {
|
|
854
|
+
this._ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));
|
|
855
|
+
sibling.setAttribute('aria-hidden', 'true');
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
_getAfterAllClosed() {
|
|
861
|
+
const parent = this._parentDialog;
|
|
862
|
+
return parent ? parent._getAfterAllClosed() : this._afterAllClosedAtThisLevel;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
Dialog.ɵfac = i0.ɵɵngDeclareFactory({
|
|
866
|
+
minVersion: '12.0.0',
|
|
867
|
+
version: '14.2.0',
|
|
868
|
+
ngImport: i0,
|
|
869
|
+
type: Dialog,
|
|
870
|
+
deps: [
|
|
871
|
+
{ token: i1$1.Overlay },
|
|
872
|
+
{ token: i0.Injector },
|
|
873
|
+
{ token: DEFAULT_DIALOG_CONFIG, optional: true },
|
|
874
|
+
{ token: Dialog, optional: true, skipSelf: true },
|
|
875
|
+
{ token: i1$1.OverlayContainer },
|
|
876
|
+
{ token: DIALOG_SCROLL_STRATEGY },
|
|
877
|
+
],
|
|
878
|
+
target: i0.ɵɵFactoryTarget.Injectable,
|
|
879
|
+
});
|
|
880
|
+
Dialog.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
881
|
+
minVersion: '12.0.0',
|
|
882
|
+
version: '14.2.0',
|
|
883
|
+
ngImport: i0,
|
|
884
|
+
type: Dialog,
|
|
885
|
+
});
|
|
886
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
887
|
+
minVersion: '12.0.0',
|
|
888
|
+
version: '14.2.0',
|
|
889
|
+
ngImport: i0,
|
|
890
|
+
type: Dialog,
|
|
891
|
+
decorators: [
|
|
892
|
+
{
|
|
893
|
+
type: Injectable,
|
|
894
|
+
},
|
|
895
|
+
],
|
|
896
|
+
ctorParameters: function () {
|
|
897
|
+
return [
|
|
898
|
+
{ type: i1$1.Overlay },
|
|
899
|
+
{ type: i0.Injector },
|
|
900
|
+
{
|
|
901
|
+
type: DialogConfig,
|
|
902
|
+
decorators: [
|
|
903
|
+
{
|
|
904
|
+
type: Optional,
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
type: Inject,
|
|
908
|
+
args: [DEFAULT_DIALOG_CONFIG],
|
|
909
|
+
},
|
|
910
|
+
],
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
type: Dialog,
|
|
914
|
+
decorators: [
|
|
915
|
+
{
|
|
916
|
+
type: Optional,
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
type: SkipSelf,
|
|
920
|
+
},
|
|
921
|
+
],
|
|
922
|
+
},
|
|
923
|
+
{ type: i1$1.OverlayContainer },
|
|
924
|
+
{
|
|
925
|
+
type: undefined,
|
|
926
|
+
decorators: [
|
|
927
|
+
{
|
|
928
|
+
type: Inject,
|
|
929
|
+
args: [DIALOG_SCROLL_STRATEGY],
|
|
930
|
+
},
|
|
931
|
+
],
|
|
932
|
+
},
|
|
933
|
+
];
|
|
934
|
+
},
|
|
935
|
+
});
|
|
936
|
+
/**
|
|
937
|
+
* Executes a callback against all elements in an array while iterating in reverse.
|
|
938
|
+
* Useful if the array is being modified as it is being iterated.
|
|
939
|
+
*/
|
|
940
|
+
function reverseForEach(items, callback) {
|
|
941
|
+
let i = items.length;
|
|
942
|
+
while (i--) {
|
|
943
|
+
callback(items[i]);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* @license
|
|
949
|
+
* Copyright Google LLC All Rights Reserved.
|
|
950
|
+
*
|
|
951
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
952
|
+
* found in the LICENSE file at https://angular.io/license
|
|
953
|
+
*/
|
|
954
|
+
class DialogModule {}
|
|
955
|
+
DialogModule.ɵfac = i0.ɵɵngDeclareFactory({
|
|
956
|
+
minVersion: '12.0.0',
|
|
957
|
+
version: '14.2.0',
|
|
958
|
+
ngImport: i0,
|
|
959
|
+
type: DialogModule,
|
|
960
|
+
deps: [],
|
|
961
|
+
target: i0.ɵɵFactoryTarget.NgModule,
|
|
962
|
+
});
|
|
963
|
+
DialogModule.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
964
|
+
minVersion: '14.0.0',
|
|
965
|
+
version: '14.2.0',
|
|
966
|
+
ngImport: i0,
|
|
967
|
+
type: DialogModule,
|
|
968
|
+
declarations: [CdkDialogContainer],
|
|
969
|
+
imports: [OverlayModule, PortalModule, A11yModule],
|
|
970
|
+
exports: [
|
|
971
|
+
// Re-export the PortalModule so that people extending the `CdkDialogContainer`
|
|
972
|
+
// don't have to remember to import it or be faced with an unhelpful error.
|
|
973
|
+
PortalModule,
|
|
974
|
+
CdkDialogContainer,
|
|
975
|
+
],
|
|
976
|
+
});
|
|
977
|
+
DialogModule.ɵinj = i0.ɵɵngDeclareInjector({
|
|
978
|
+
minVersion: '12.0.0',
|
|
979
|
+
version: '14.2.0',
|
|
980
|
+
ngImport: i0,
|
|
981
|
+
type: DialogModule,
|
|
982
|
+
providers: [Dialog, DIALOG_SCROLL_STRATEGY_PROVIDER],
|
|
983
|
+
imports: [
|
|
984
|
+
OverlayModule,
|
|
985
|
+
PortalModule,
|
|
986
|
+
A11yModule,
|
|
987
|
+
// Re-export the PortalModule so that people extending the `CdkDialogContainer`
|
|
988
|
+
// don't have to remember to import it or be faced with an unhelpful error.
|
|
989
|
+
PortalModule,
|
|
990
|
+
],
|
|
991
|
+
});
|
|
992
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
993
|
+
minVersion: '12.0.0',
|
|
994
|
+
version: '14.2.0',
|
|
995
|
+
ngImport: i0,
|
|
996
|
+
type: DialogModule,
|
|
997
|
+
decorators: [
|
|
998
|
+
{
|
|
999
|
+
type: NgModule,
|
|
1000
|
+
args: [
|
|
1001
|
+
{
|
|
1002
|
+
imports: [OverlayModule, PortalModule, A11yModule],
|
|
1003
|
+
exports: [
|
|
1004
|
+
// Re-export the PortalModule so that people extending the `CdkDialogContainer`
|
|
1005
|
+
// don't have to remember to import it or be faced with an unhelpful error.
|
|
1006
|
+
PortalModule,
|
|
1007
|
+
CdkDialogContainer,
|
|
1008
|
+
],
|
|
1009
|
+
declarations: [CdkDialogContainer],
|
|
1010
|
+
providers: [Dialog, DIALOG_SCROLL_STRATEGY_PROVIDER],
|
|
1011
|
+
},
|
|
1012
|
+
],
|
|
1013
|
+
},
|
|
1014
|
+
],
|
|
1015
|
+
});
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* @license
|
|
1019
|
+
* Copyright Google LLC All Rights Reserved.
|
|
1020
|
+
*
|
|
1021
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
1022
|
+
* found in the LICENSE file at https://angular.io/license
|
|
1023
|
+
*/
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* @license
|
|
1027
|
+
* Copyright Google LLC All Rights Reserved.
|
|
1028
|
+
*
|
|
1029
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
1030
|
+
* found in the LICENSE file at https://angular.io/license
|
|
1031
|
+
*/
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Generated bundle index. Do not edit.
|
|
1035
|
+
*/
|
|
1036
|
+
|
|
1037
|
+
export {
|
|
1038
|
+
CdkDialogContainer,
|
|
1039
|
+
DEFAULT_DIALOG_CONFIG,
|
|
1040
|
+
DIALOG_DATA,
|
|
1041
|
+
DIALOG_SCROLL_STRATEGY,
|
|
1042
|
+
DIALOG_SCROLL_STRATEGY_PROVIDER,
|
|
1043
|
+
DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,
|
|
1044
|
+
Dialog,
|
|
1045
|
+
DialogConfig,
|
|
1046
|
+
DialogModule,
|
|
1047
|
+
DialogRef,
|
|
1048
|
+
throwDialogContentAlreadyAttachedError,
|
|
1049
|
+
};
|
|
1050
|
+
//# sourceMappingURL=dialog.mjs.map
|