@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,414 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
InjectionToken,
|
|
4
|
+
Directive,
|
|
5
|
+
Input,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
Optional,
|
|
8
|
+
Inject,
|
|
9
|
+
SkipSelf,
|
|
10
|
+
Output,
|
|
11
|
+
NgModule,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
import { coerceBooleanProperty } from '@kato-lee/cdk/coercion';
|
|
14
|
+
import { Subject, Subscription } from 'rxjs';
|
|
15
|
+
import * as i1 from '@kato-lee/cdk/collections';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright Google LLC All Rights Reserved.
|
|
20
|
+
*
|
|
21
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
22
|
+
* found in the LICENSE file at https://angular.io/license
|
|
23
|
+
*/
|
|
24
|
+
/** Used to generate unique ID for each accordion. */
|
|
25
|
+
let nextId$1 = 0;
|
|
26
|
+
/**
|
|
27
|
+
* Injection token that can be used to reference instances of `CdkAccordion`. It serves
|
|
28
|
+
* as alternative token to the actual `CdkAccordion` class which could cause unnecessary
|
|
29
|
+
* retention of the class and its directive metadata.
|
|
30
|
+
*/
|
|
31
|
+
const CDK_ACCORDION = new InjectionToken('CdkAccordion');
|
|
32
|
+
/**
|
|
33
|
+
* Directive whose purpose is to manage the expanded state of CdkAccordionItem children.
|
|
34
|
+
*/
|
|
35
|
+
class CdkAccordion {
|
|
36
|
+
constructor() {
|
|
37
|
+
/** Emits when the state of the accordion changes */
|
|
38
|
+
this._stateChanges = new Subject();
|
|
39
|
+
/** Stream that emits true/false when openAll/closeAll is triggered. */
|
|
40
|
+
this._openCloseAllActions = new Subject();
|
|
41
|
+
/** A readonly id value to use for unique selection coordination. */
|
|
42
|
+
this.id = `cdk-accordion-${nextId$1++}`;
|
|
43
|
+
this._multi = false;
|
|
44
|
+
}
|
|
45
|
+
/** Whether the accordion should allow multiple expanded accordion items simultaneously. */
|
|
46
|
+
get multi() {
|
|
47
|
+
return this._multi;
|
|
48
|
+
}
|
|
49
|
+
set multi(multi) {
|
|
50
|
+
this._multi = coerceBooleanProperty(multi);
|
|
51
|
+
}
|
|
52
|
+
/** Opens all enabled accordion items in an accordion where multi is enabled. */
|
|
53
|
+
openAll() {
|
|
54
|
+
if (this._multi) {
|
|
55
|
+
this._openCloseAllActions.next(true);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Closes all enabled accordion items in an accordion where multi is enabled. */
|
|
59
|
+
closeAll() {
|
|
60
|
+
this._openCloseAllActions.next(false);
|
|
61
|
+
}
|
|
62
|
+
ngOnChanges(changes) {
|
|
63
|
+
this._stateChanges.next(changes);
|
|
64
|
+
}
|
|
65
|
+
ngOnDestroy() {
|
|
66
|
+
this._stateChanges.complete();
|
|
67
|
+
this._openCloseAllActions.complete();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
CdkAccordion.ɵfac = i0.ɵɵngDeclareFactory({
|
|
71
|
+
minVersion: '12.0.0',
|
|
72
|
+
version: '14.2.0',
|
|
73
|
+
ngImport: i0,
|
|
74
|
+
type: CdkAccordion,
|
|
75
|
+
deps: [],
|
|
76
|
+
target: i0.ɵɵFactoryTarget.Directive,
|
|
77
|
+
});
|
|
78
|
+
CdkAccordion.ɵdir = i0.ɵɵngDeclareDirective({
|
|
79
|
+
minVersion: '14.0.0',
|
|
80
|
+
version: '14.2.0',
|
|
81
|
+
type: CdkAccordion,
|
|
82
|
+
selector: 'cdk-accordion, [cdkAccordion]',
|
|
83
|
+
inputs: { multi: 'multi' },
|
|
84
|
+
providers: [{ provide: CDK_ACCORDION, useExisting: CdkAccordion }],
|
|
85
|
+
exportAs: ['cdkAccordion'],
|
|
86
|
+
usesOnChanges: true,
|
|
87
|
+
ngImport: i0,
|
|
88
|
+
});
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
90
|
+
minVersion: '12.0.0',
|
|
91
|
+
version: '14.2.0',
|
|
92
|
+
ngImport: i0,
|
|
93
|
+
type: CdkAccordion,
|
|
94
|
+
decorators: [
|
|
95
|
+
{
|
|
96
|
+
type: Directive,
|
|
97
|
+
args: [
|
|
98
|
+
{
|
|
99
|
+
selector: 'cdk-accordion, [cdkAccordion]',
|
|
100
|
+
exportAs: 'cdkAccordion',
|
|
101
|
+
providers: [{ provide: CDK_ACCORDION, useExisting: CdkAccordion }],
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
propDecorators: {
|
|
107
|
+
multi: [
|
|
108
|
+
{
|
|
109
|
+
type: Input,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @license
|
|
117
|
+
* Copyright Google LLC All Rights Reserved.
|
|
118
|
+
*
|
|
119
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
120
|
+
* found in the LICENSE file at https://angular.io/license
|
|
121
|
+
*/
|
|
122
|
+
/** Used to generate unique ID for each accordion item. */
|
|
123
|
+
let nextId = 0;
|
|
124
|
+
/**
|
|
125
|
+
* An basic directive expected to be extended and decorated as a component. Sets up all
|
|
126
|
+
* events and attributes needed to be managed by a CdkAccordion parent.
|
|
127
|
+
*/
|
|
128
|
+
class CdkAccordionItem {
|
|
129
|
+
constructor(accordion, _changeDetectorRef, _expansionDispatcher) {
|
|
130
|
+
this.accordion = accordion;
|
|
131
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
132
|
+
this._expansionDispatcher = _expansionDispatcher;
|
|
133
|
+
/** Subscription to openAll/closeAll events. */
|
|
134
|
+
this._openCloseAllSubscription = Subscription.EMPTY;
|
|
135
|
+
/** Event emitted every time the AccordionItem is closed. */
|
|
136
|
+
this.closed = new EventEmitter();
|
|
137
|
+
/** Event emitted every time the AccordionItem is opened. */
|
|
138
|
+
this.opened = new EventEmitter();
|
|
139
|
+
/** Event emitted when the AccordionItem is destroyed. */
|
|
140
|
+
this.destroyed = new EventEmitter();
|
|
141
|
+
/**
|
|
142
|
+
* Emits whenever the expanded state of the accordion changes.
|
|
143
|
+
* Primarily used to facilitate two-way binding.
|
|
144
|
+
* @docs-private
|
|
145
|
+
*/
|
|
146
|
+
this.expandedChange = new EventEmitter();
|
|
147
|
+
/** The unique AccordionItem id. */
|
|
148
|
+
this.id = `cdk-accordion-child-${nextId++}`;
|
|
149
|
+
this._expanded = false;
|
|
150
|
+
this._disabled = false;
|
|
151
|
+
/** Unregister function for _expansionDispatcher. */
|
|
152
|
+
this._removeUniqueSelectionListener = () => {};
|
|
153
|
+
this._removeUniqueSelectionListener = _expansionDispatcher.listen((id, accordionId) => {
|
|
154
|
+
if (
|
|
155
|
+
this.accordion &&
|
|
156
|
+
!this.accordion.multi &&
|
|
157
|
+
this.accordion.id === accordionId &&
|
|
158
|
+
this.id !== id
|
|
159
|
+
) {
|
|
160
|
+
this.expanded = false;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
// When an accordion item is hosted in an accordion, subscribe to open/close events.
|
|
164
|
+
if (this.accordion) {
|
|
165
|
+
this._openCloseAllSubscription = this._subscribeToOpenCloseAllActions();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/** Whether the AccordionItem is expanded. */
|
|
169
|
+
get expanded() {
|
|
170
|
+
return this._expanded;
|
|
171
|
+
}
|
|
172
|
+
set expanded(expanded) {
|
|
173
|
+
expanded = coerceBooleanProperty(expanded);
|
|
174
|
+
// Only emit events and update the internal value if the value changes.
|
|
175
|
+
if (this._expanded !== expanded) {
|
|
176
|
+
this._expanded = expanded;
|
|
177
|
+
this.expandedChange.emit(expanded);
|
|
178
|
+
if (expanded) {
|
|
179
|
+
this.opened.emit();
|
|
180
|
+
/**
|
|
181
|
+
* In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem,
|
|
182
|
+
* the name value is the id of the accordion.
|
|
183
|
+
*/
|
|
184
|
+
const accordionId = this.accordion ? this.accordion.id : this.id;
|
|
185
|
+
this._expansionDispatcher.notify(this.id, accordionId);
|
|
186
|
+
} else {
|
|
187
|
+
this.closed.emit();
|
|
188
|
+
}
|
|
189
|
+
// Ensures that the animation will run when the value is set outside of an `@Input`.
|
|
190
|
+
// This includes cases like the open, close and toggle methods.
|
|
191
|
+
this._changeDetectorRef.markForCheck();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/** Whether the AccordionItem is disabled. */
|
|
195
|
+
get disabled() {
|
|
196
|
+
return this._disabled;
|
|
197
|
+
}
|
|
198
|
+
set disabled(disabled) {
|
|
199
|
+
this._disabled = coerceBooleanProperty(disabled);
|
|
200
|
+
}
|
|
201
|
+
/** Emits an event for the accordion item being destroyed. */
|
|
202
|
+
ngOnDestroy() {
|
|
203
|
+
this.opened.complete();
|
|
204
|
+
this.closed.complete();
|
|
205
|
+
this.destroyed.emit();
|
|
206
|
+
this.destroyed.complete();
|
|
207
|
+
this._removeUniqueSelectionListener();
|
|
208
|
+
this._openCloseAllSubscription.unsubscribe();
|
|
209
|
+
}
|
|
210
|
+
/** Toggles the expanded state of the accordion item. */
|
|
211
|
+
toggle() {
|
|
212
|
+
if (!this.disabled) {
|
|
213
|
+
this.expanded = !this.expanded;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/** Sets the expanded state of the accordion item to false. */
|
|
217
|
+
close() {
|
|
218
|
+
if (!this.disabled) {
|
|
219
|
+
this.expanded = false;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/** Sets the expanded state of the accordion item to true. */
|
|
223
|
+
open() {
|
|
224
|
+
if (!this.disabled) {
|
|
225
|
+
this.expanded = true;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
_subscribeToOpenCloseAllActions() {
|
|
229
|
+
return this.accordion._openCloseAllActions.subscribe(expanded => {
|
|
230
|
+
// Only change expanded state if item is enabled
|
|
231
|
+
if (!this.disabled) {
|
|
232
|
+
this.expanded = expanded;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
CdkAccordionItem.ɵfac = i0.ɵɵngDeclareFactory({
|
|
238
|
+
minVersion: '12.0.0',
|
|
239
|
+
version: '14.2.0',
|
|
240
|
+
ngImport: i0,
|
|
241
|
+
type: CdkAccordionItem,
|
|
242
|
+
deps: [
|
|
243
|
+
{ token: CDK_ACCORDION, optional: true, skipSelf: true },
|
|
244
|
+
{ token: i0.ChangeDetectorRef },
|
|
245
|
+
{ token: i1.UniqueSelectionDispatcher },
|
|
246
|
+
],
|
|
247
|
+
target: i0.ɵɵFactoryTarget.Directive,
|
|
248
|
+
});
|
|
249
|
+
CdkAccordionItem.ɵdir = i0.ɵɵngDeclareDirective({
|
|
250
|
+
minVersion: '14.0.0',
|
|
251
|
+
version: '14.2.0',
|
|
252
|
+
type: CdkAccordionItem,
|
|
253
|
+
selector: 'cdk-accordion-item, [cdkAccordionItem]',
|
|
254
|
+
inputs: { expanded: 'expanded', disabled: 'disabled' },
|
|
255
|
+
outputs: {
|
|
256
|
+
closed: 'closed',
|
|
257
|
+
opened: 'opened',
|
|
258
|
+
destroyed: 'destroyed',
|
|
259
|
+
expandedChange: 'expandedChange',
|
|
260
|
+
},
|
|
261
|
+
providers: [
|
|
262
|
+
// Provide `CDK_ACCORDION` as undefined to prevent nested accordion items from
|
|
263
|
+
// registering to the same accordion.
|
|
264
|
+
{ provide: CDK_ACCORDION, useValue: undefined },
|
|
265
|
+
],
|
|
266
|
+
exportAs: ['cdkAccordionItem'],
|
|
267
|
+
ngImport: i0,
|
|
268
|
+
});
|
|
269
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
270
|
+
minVersion: '12.0.0',
|
|
271
|
+
version: '14.2.0',
|
|
272
|
+
ngImport: i0,
|
|
273
|
+
type: CdkAccordionItem,
|
|
274
|
+
decorators: [
|
|
275
|
+
{
|
|
276
|
+
type: Directive,
|
|
277
|
+
args: [
|
|
278
|
+
{
|
|
279
|
+
selector: 'cdk-accordion-item, [cdkAccordionItem]',
|
|
280
|
+
exportAs: 'cdkAccordionItem',
|
|
281
|
+
providers: [
|
|
282
|
+
// Provide `CDK_ACCORDION` as undefined to prevent nested accordion items from
|
|
283
|
+
// registering to the same accordion.
|
|
284
|
+
{ provide: CDK_ACCORDION, useValue: undefined },
|
|
285
|
+
],
|
|
286
|
+
},
|
|
287
|
+
],
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
ctorParameters: function () {
|
|
291
|
+
return [
|
|
292
|
+
{
|
|
293
|
+
type: CdkAccordion,
|
|
294
|
+
decorators: [
|
|
295
|
+
{
|
|
296
|
+
type: Optional,
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
type: Inject,
|
|
300
|
+
args: [CDK_ACCORDION],
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
type: SkipSelf,
|
|
304
|
+
},
|
|
305
|
+
],
|
|
306
|
+
},
|
|
307
|
+
{ type: i0.ChangeDetectorRef },
|
|
308
|
+
{ type: i1.UniqueSelectionDispatcher },
|
|
309
|
+
];
|
|
310
|
+
},
|
|
311
|
+
propDecorators: {
|
|
312
|
+
closed: [
|
|
313
|
+
{
|
|
314
|
+
type: Output,
|
|
315
|
+
},
|
|
316
|
+
],
|
|
317
|
+
opened: [
|
|
318
|
+
{
|
|
319
|
+
type: Output,
|
|
320
|
+
},
|
|
321
|
+
],
|
|
322
|
+
destroyed: [
|
|
323
|
+
{
|
|
324
|
+
type: Output,
|
|
325
|
+
},
|
|
326
|
+
],
|
|
327
|
+
expandedChange: [
|
|
328
|
+
{
|
|
329
|
+
type: Output,
|
|
330
|
+
},
|
|
331
|
+
],
|
|
332
|
+
expanded: [
|
|
333
|
+
{
|
|
334
|
+
type: Input,
|
|
335
|
+
},
|
|
336
|
+
],
|
|
337
|
+
disabled: [
|
|
338
|
+
{
|
|
339
|
+
type: Input,
|
|
340
|
+
},
|
|
341
|
+
],
|
|
342
|
+
},
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* @license
|
|
347
|
+
* Copyright Google LLC All Rights Reserved.
|
|
348
|
+
*
|
|
349
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
350
|
+
* found in the LICENSE file at https://angular.io/license
|
|
351
|
+
*/
|
|
352
|
+
class CdkAccordionModule {}
|
|
353
|
+
CdkAccordionModule.ɵfac = i0.ɵɵngDeclareFactory({
|
|
354
|
+
minVersion: '12.0.0',
|
|
355
|
+
version: '14.2.0',
|
|
356
|
+
ngImport: i0,
|
|
357
|
+
type: CdkAccordionModule,
|
|
358
|
+
deps: [],
|
|
359
|
+
target: i0.ɵɵFactoryTarget.NgModule,
|
|
360
|
+
});
|
|
361
|
+
CdkAccordionModule.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
362
|
+
minVersion: '14.0.0',
|
|
363
|
+
version: '14.2.0',
|
|
364
|
+
ngImport: i0,
|
|
365
|
+
type: CdkAccordionModule,
|
|
366
|
+
declarations: [CdkAccordion, CdkAccordionItem],
|
|
367
|
+
exports: [CdkAccordion, CdkAccordionItem],
|
|
368
|
+
});
|
|
369
|
+
CdkAccordionModule.ɵinj = i0.ɵɵngDeclareInjector({
|
|
370
|
+
minVersion: '12.0.0',
|
|
371
|
+
version: '14.2.0',
|
|
372
|
+
ngImport: i0,
|
|
373
|
+
type: CdkAccordionModule,
|
|
374
|
+
});
|
|
375
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
376
|
+
minVersion: '12.0.0',
|
|
377
|
+
version: '14.2.0',
|
|
378
|
+
ngImport: i0,
|
|
379
|
+
type: CdkAccordionModule,
|
|
380
|
+
decorators: [
|
|
381
|
+
{
|
|
382
|
+
type: NgModule,
|
|
383
|
+
args: [
|
|
384
|
+
{
|
|
385
|
+
exports: [CdkAccordion, CdkAccordionItem],
|
|
386
|
+
declarations: [CdkAccordion, CdkAccordionItem],
|
|
387
|
+
},
|
|
388
|
+
],
|
|
389
|
+
},
|
|
390
|
+
],
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* @license
|
|
395
|
+
* Copyright Google LLC All Rights Reserved.
|
|
396
|
+
*
|
|
397
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
398
|
+
* found in the LICENSE file at https://angular.io/license
|
|
399
|
+
*/
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* @license
|
|
403
|
+
* Copyright Google LLC All Rights Reserved.
|
|
404
|
+
*
|
|
405
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
406
|
+
* found in the LICENSE file at https://angular.io/license
|
|
407
|
+
*/
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Generated bundle index. Do not edit.
|
|
411
|
+
*/
|
|
412
|
+
|
|
413
|
+
export { CdkAccordion, CdkAccordionItem, CdkAccordionModule };
|
|
414
|
+
//# sourceMappingURL=accordion.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.mjs","sources":["../../../../../../src/cdk/accordion/accordion.ts","../../../../../../src/cdk/accordion/accordion-item.ts","../../../../../../src/cdk/accordion/accordion-module.ts","../../../../../../src/cdk/accordion/public-api.ts","../../../../../../src/cdk/accordion/index.ts","../../../../../../src/cdk/accordion/accordion_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@kato-lee/cdk/coercion';\nimport {Directive, InjectionToken, Input, OnChanges, OnDestroy, SimpleChanges} from '@angular/core';\nimport {Subject} from 'rxjs';\n\n/** Used to generate unique ID for each accordion. */\nlet nextId = 0;\n\n/**\n * Injection token that can be used to reference instances of `CdkAccordion`. It serves\n * as alternative token to the actual `CdkAccordion` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_ACCORDION = new InjectionToken<CdkAccordion>('CdkAccordion');\n\n/**\n * Directive whose purpose is to manage the expanded state of CdkAccordionItem children.\n */\n@Directive({\n selector: 'cdk-accordion, [cdkAccordion]',\n exportAs: 'cdkAccordion',\n providers: [{provide: CDK_ACCORDION, useExisting: CdkAccordion}],\n})\nexport class CdkAccordion implements OnDestroy, OnChanges {\n /** Emits when the state of the accordion changes */\n readonly _stateChanges = new Subject<SimpleChanges>();\n\n /** Stream that emits true/false when openAll/closeAll is triggered. */\n readonly _openCloseAllActions: Subject<boolean> = new Subject<boolean>();\n\n /** A readonly id value to use for unique selection coordination. */\n readonly id: string = `cdk-accordion-${nextId++}`;\n\n /** Whether the accordion should allow multiple expanded accordion items simultaneously. */\n @Input()\n get multi(): boolean {\n return this._multi;\n }\n set multi(multi: BooleanInput) {\n this._multi = coerceBooleanProperty(multi);\n }\n private _multi: boolean = false;\n\n /** Opens all enabled accordion items in an accordion where multi is enabled. */\n openAll(): void {\n if (this._multi) {\n this._openCloseAllActions.next(true);\n }\n }\n\n /** Closes all enabled accordion items in an accordion where multi is enabled. */\n closeAll(): void {\n this._openCloseAllActions.next(false);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n this._stateChanges.next(changes);\n }\n\n ngOnDestroy() {\n this._stateChanges.complete();\n this._openCloseAllActions.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Output,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Optional,\n ChangeDetectorRef,\n SkipSelf,\n Inject,\n} from '@angular/core';\nimport {UniqueSelectionDispatcher} from '@kato-lee/cdk/collections';\nimport {CDK_ACCORDION, CdkAccordion} from './accordion';\nimport {BooleanInput, coerceBooleanProperty} from '@kato-lee/cdk/coercion';\nimport {Subscription} from 'rxjs';\n\n/** Used to generate unique ID for each accordion item. */\nlet nextId = 0;\n\n/**\n * An basic directive expected to be extended and decorated as a component. Sets up all\n * events and attributes needed to be managed by a CdkAccordion parent.\n */\n@Directive({\n selector: 'cdk-accordion-item, [cdkAccordionItem]',\n exportAs: 'cdkAccordionItem',\n providers: [\n // Provide `CDK_ACCORDION` as undefined to prevent nested accordion items from\n // registering to the same accordion.\n {provide: CDK_ACCORDION, useValue: undefined},\n ],\n})\nexport class CdkAccordionItem implements OnDestroy {\n /** Subscription to openAll/closeAll events. */\n private _openCloseAllSubscription = Subscription.EMPTY;\n /** Event emitted every time the AccordionItem is closed. */\n @Output() readonly closed: EventEmitter<void> = new EventEmitter<void>();\n /** Event emitted every time the AccordionItem is opened. */\n @Output() readonly opened: EventEmitter<void> = new EventEmitter<void>();\n /** Event emitted when the AccordionItem is destroyed. */\n @Output() readonly destroyed: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Emits whenever the expanded state of the accordion changes.\n * Primarily used to facilitate two-way binding.\n * @docs-private\n */\n @Output() readonly expandedChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n /** The unique AccordionItem id. */\n readonly id: string = `cdk-accordion-child-${nextId++}`;\n\n /** Whether the AccordionItem is expanded. */\n @Input()\n get expanded(): boolean {\n return this._expanded;\n }\n set expanded(expanded: BooleanInput) {\n expanded = coerceBooleanProperty(expanded);\n\n // Only emit events and update the internal value if the value changes.\n if (this._expanded !== expanded) {\n this._expanded = expanded;\n this.expandedChange.emit(expanded);\n\n if (expanded) {\n this.opened.emit();\n /**\n * In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem,\n * the name value is the id of the accordion.\n */\n const accordionId = this.accordion ? this.accordion.id : this.id;\n this._expansionDispatcher.notify(this.id, accordionId);\n } else {\n this.closed.emit();\n }\n\n // Ensures that the animation will run when the value is set outside of an `@Input`.\n // This includes cases like the open, close and toggle methods.\n this._changeDetectorRef.markForCheck();\n }\n }\n private _expanded = false;\n\n /** Whether the AccordionItem is disabled. */\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(disabled: BooleanInput) {\n this._disabled = coerceBooleanProperty(disabled);\n }\n private _disabled = false;\n\n /** Unregister function for _expansionDispatcher. */\n private _removeUniqueSelectionListener: () => void = () => {};\n\n constructor(\n @Optional() @Inject(CDK_ACCORDION) @SkipSelf() public accordion: CdkAccordion,\n private _changeDetectorRef: ChangeDetectorRef,\n protected _expansionDispatcher: UniqueSelectionDispatcher,\n ) {\n this._removeUniqueSelectionListener = _expansionDispatcher.listen(\n (id: string, accordionId: string) => {\n if (\n this.accordion &&\n !this.accordion.multi &&\n this.accordion.id === accordionId &&\n this.id !== id\n ) {\n this.expanded = false;\n }\n },\n );\n\n // When an accordion item is hosted in an accordion, subscribe to open/close events.\n if (this.accordion) {\n this._openCloseAllSubscription = this._subscribeToOpenCloseAllActions();\n }\n }\n\n /** Emits an event for the accordion item being destroyed. */\n ngOnDestroy() {\n this.opened.complete();\n this.closed.complete();\n this.destroyed.emit();\n this.destroyed.complete();\n this._removeUniqueSelectionListener();\n this._openCloseAllSubscription.unsubscribe();\n }\n\n /** Toggles the expanded state of the accordion item. */\n toggle(): void {\n if (!this.disabled) {\n this.expanded = !this.expanded;\n }\n }\n\n /** Sets the expanded state of the accordion item to false. */\n close(): void {\n if (!this.disabled) {\n this.expanded = false;\n }\n }\n\n /** Sets the expanded state of the accordion item to true. */\n open(): void {\n if (!this.disabled) {\n this.expanded = true;\n }\n }\n\n private _subscribeToOpenCloseAllActions(): Subscription {\n return this.accordion._openCloseAllActions.subscribe(expanded => {\n // Only change expanded state if item is enabled\n if (!this.disabled) {\n this.expanded = expanded;\n }\n });\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkAccordion} from './accordion';\nimport {CdkAccordionItem} from './accordion-item';\n\n@NgModule({\n exports: [CdkAccordion, CdkAccordionItem],\n declarations: [CdkAccordion, CdkAccordionItem],\n})\nexport class CdkAccordionModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {CdkAccordionItem} from './accordion-item';\nexport {CdkAccordion} from './accordion';\nexport * from './accordion-module';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["nextId"],"mappings":";;;;;;AAAA;;;;;;AAMG;AAMH;AACA,IAAIA,QAAM,GAAG,CAAC,CAAC;AAEf;;;;AAIG;AACI,MAAM,aAAa,GAAG,IAAI,cAAc,CAAe,cAAc,CAAC,CAAC;AAE9E;;AAEG;MAMU,YAAY,CAAA;AALzB,IAAA,WAAA,GAAA;;AAOW,QAAA,IAAA,CAAA,aAAa,GAAG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AAM;+BAAC,aAAa,CAAA;;8BAAG,QAAQ;;yBA9D3B,MAAM,EAAA,CAAA;sBAAxB,MAAM;gBAEY,MAAM,EAAA,CAAA;sBAAxB,MAAM;gBAEY,SAAS,EAAA,CAAA;sBAA3B,MAAM;gBAOY,cAAc,EAAA,CAAA;sBAAhC,MAAM;gBAOH,QAAQ,EAAA,CAAA;sBADX,KAAK;gBAiCF,QAAQ,EAAA,CAAA;sBADX,KAAK;;;AC7FR;;;;;;AAMG;MAUU,kBAAkB,CAAA;;+GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAlB,kBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,iBAFd,YAAY,EAAE,gBAAgB,CADnC,EAAA,OAAA,EAAA,CAAA,YAAY,EAAE,gBAAgB,CAAA,EAAA,CAAA,CAAA;gHAG7B,kBAAkB,EAAA,CAAA,CAAA;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;AACzC,oBAAA,YAAY,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;iBAC/C,CAAA;;;ACfD;;;;;;AAMG;;ACNH;;;;;;AAMG;;ACNH;;AAEG;;;;"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, EventEmitter, Injectable, Optional, Inject, Directive, Output, Input, NgModule } from '@angular/core';
|
|
3
|
+
import { DOCUMENT } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright Google LLC All Rights Reserved.
|
|
8
|
+
*
|
|
9
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
10
|
+
* found in the LICENSE file at https://angular.io/license
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Injection token used to inject the document into Directionality.
|
|
14
|
+
* This is used so that the value can be faked in tests.
|
|
15
|
+
*
|
|
16
|
+
* We can't use the real document in tests because changing the real `dir` causes geometry-based
|
|
17
|
+
* tests in Safari to fail.
|
|
18
|
+
*
|
|
19
|
+
* We also can't re-provide the DOCUMENT token from platform-browser because the unit tests
|
|
20
|
+
* themselves use things like `querySelector` in test code.
|
|
21
|
+
*
|
|
22
|
+
* This token is defined in a separate file from Directionality as a workaround for
|
|
23
|
+
* https://github.com/angular/angular/issues/22559
|
|
24
|
+
*
|
|
25
|
+
* @docs-private
|
|
26
|
+
*/
|
|
27
|
+
const DIR_DOCUMENT = new InjectionToken('cdk-dir-doc', {
|
|
28
|
+
providedIn: 'root',
|
|
29
|
+
factory: DIR_DOCUMENT_FACTORY,
|
|
30
|
+
});
|
|
31
|
+
/** @docs-private */
|
|
32
|
+
function DIR_DOCUMENT_FACTORY() {
|
|
33
|
+
return inject(DOCUMENT);
|
|
34
|
+
}
|
|
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
|
+
/** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */
|
|
44
|
+
const RTL_LOCALE_PATTERN = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;
|
|
45
|
+
/** Resolves a string value to a specific direction. */
|
|
46
|
+
function _resolveDirectionality(rawValue) {
|
|
47
|
+
const value = (rawValue === null || rawValue === void 0 ? void 0 : rawValue.toLowerCase()) || '';
|
|
48
|
+
if (value === 'auto' && typeof navigator !== 'undefined' && (navigator === null || navigator === void 0 ? void 0 : navigator.language)) {
|
|
49
|
+
return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr';
|
|
50
|
+
}
|
|
51
|
+
return value === 'rtl' ? 'rtl' : 'ltr';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The directionality (LTR / RTL) context for the application (or a subtree of it).
|
|
55
|
+
* Exposes the current direction and a stream of direction changes.
|
|
56
|
+
*/
|
|
57
|
+
class Directionality {
|
|
58
|
+
constructor(_document) {
|
|
59
|
+
/** The current 'ltr' or 'rtl' value. */
|
|
60
|
+
this.value = 'ltr';
|
|
61
|
+
/** Stream that emits whenever the 'ltr' / 'rtl' state changes. */
|
|
62
|
+
this.change = new EventEmitter();
|
|
63
|
+
if (_document) {
|
|
64
|
+
const bodyDir = _document.body ? _document.body.dir : null;
|
|
65
|
+
const htmlDir = _document.documentElement ? _document.documentElement.dir : null;
|
|
66
|
+
this.value = _resolveDirectionality(bodyDir || htmlDir || 'ltr');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
ngOnDestroy() {
|
|
70
|
+
this.change.complete();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
Directionality.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: Directionality, deps: [{ token: DIR_DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
74
|
+
Directionality.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: Directionality, providedIn: 'root' });
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: Directionality, decorators: [{
|
|
76
|
+
type: Injectable,
|
|
77
|
+
args: [{ providedIn: 'root' }]
|
|
78
|
+
}], ctorParameters: function () {
|
|
79
|
+
return [{ type: undefined, decorators: [{
|
|
80
|
+
type: Optional
|
|
81
|
+
}, {
|
|
82
|
+
type: Inject,
|
|
83
|
+
args: [DIR_DOCUMENT]
|
|
84
|
+
}] }];
|
|
85
|
+
} });
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @license
|
|
89
|
+
* Copyright Google LLC All Rights Reserved.
|
|
90
|
+
*
|
|
91
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
92
|
+
* found in the LICENSE file at https://angular.io/license
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* Directive to listen for changes of direction of part of the DOM.
|
|
96
|
+
*
|
|
97
|
+
* Provides itself as Directionality such that descendant directives only need to ever inject
|
|
98
|
+
* Directionality to get the closest direction.
|
|
99
|
+
*/
|
|
100
|
+
class Dir {
|
|
101
|
+
constructor() {
|
|
102
|
+
/** Normalized direction that accounts for invalid/unsupported values. */
|
|
103
|
+
this._dir = 'ltr';
|
|
104
|
+
/** Whether the `value` has been set to its initial value. */
|
|
105
|
+
this._isInitialized = false;
|
|
106
|
+
/** Event emitted when the direction changes. */
|
|
107
|
+
this.change = new EventEmitter();
|
|
108
|
+
}
|
|
109
|
+
/** @docs-private */
|
|
110
|
+
get dir() {
|
|
111
|
+
return this._dir;
|
|
112
|
+
}
|
|
113
|
+
set dir(value) {
|
|
114
|
+
const previousValue = this._dir;
|
|
115
|
+
// Note: `_resolveDirectionality` resolves the language based on the browser's language,
|
|
116
|
+
// whereas the browser does it based on the content of the element. Since doing so based
|
|
117
|
+
// on the content can be expensive, for now we're doing the simpler matching.
|
|
118
|
+
this._dir = _resolveDirectionality(value);
|
|
119
|
+
this._rawDir = value;
|
|
120
|
+
if (previousValue !== this._dir && this._isInitialized) {
|
|
121
|
+
this.change.emit(this._dir);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/** Current layout direction of the element. */
|
|
125
|
+
get value() {
|
|
126
|
+
return this.dir;
|
|
127
|
+
}
|
|
128
|
+
/** Initialize once default value has been set. */
|
|
129
|
+
ngAfterContentInit() {
|
|
130
|
+
this._isInitialized = true;
|
|
131
|
+
}
|
|
132
|
+
ngOnDestroy() {
|
|
133
|
+
this.change.complete();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
Dir.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: Dir, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
137
|
+
Dir.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: Dir, selector: "[dir]", inputs: { dir: "dir" }, outputs: { change: "dirChange" }, host: { properties: { "attr.dir": "_rawDir" } }, providers: [{ provide: Directionality, useExisting: Dir }], exportAs: ["dir"], ngImport: i0 });
|
|
138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: Dir, decorators: [{
|
|
139
|
+
type: Directive,
|
|
140
|
+
args: [{
|
|
141
|
+
selector: '[dir]',
|
|
142
|
+
providers: [{ provide: Directionality, useExisting: Dir }],
|
|
143
|
+
host: { '[attr.dir]': '_rawDir' },
|
|
144
|
+
exportAs: 'dir',
|
|
145
|
+
}]
|
|
146
|
+
}], propDecorators: { change: [{
|
|
147
|
+
type: Output,
|
|
148
|
+
args: ['dirChange']
|
|
149
|
+
}], dir: [{
|
|
150
|
+
type: Input
|
|
151
|
+
}] } });
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @license
|
|
155
|
+
* Copyright Google LLC All Rights Reserved.
|
|
156
|
+
*
|
|
157
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
158
|
+
* found in the LICENSE file at https://angular.io/license
|
|
159
|
+
*/
|
|
160
|
+
class BidiModule {
|
|
161
|
+
}
|
|
162
|
+
BidiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: BidiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
163
|
+
BidiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: BidiModule, declarations: [Dir], exports: [Dir] });
|
|
164
|
+
BidiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: BidiModule });
|
|
165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: BidiModule, decorators: [{
|
|
166
|
+
type: NgModule,
|
|
167
|
+
args: [{
|
|
168
|
+
exports: [Dir],
|
|
169
|
+
declarations: [Dir],
|
|
170
|
+
}]
|
|
171
|
+
}] });
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @license
|
|
175
|
+
* Copyright Google LLC All Rights Reserved.
|
|
176
|
+
*
|
|
177
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
178
|
+
* found in the LICENSE file at https://angular.io/license
|
|
179
|
+
*/
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @license
|
|
183
|
+
* Copyright Google LLC All Rights Reserved.
|
|
184
|
+
*
|
|
185
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
186
|
+
* found in the LICENSE file at https://angular.io/license
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Generated bundle index. Do not edit.
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
export { BidiModule, DIR_DOCUMENT, Dir, Directionality };
|
|
194
|
+
//# sourceMappingURL=bidi.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bidi.mjs","sources":["../../../../../../src/cdk/bidi/dir-document-token.ts","../../../../../../src/cdk/bidi/directionality.ts","../../../../../../src/cdk/bidi/dir.ts","../../../../../../src/cdk/bidi/bidi-module.ts","../../../../../../src/cdk/bidi/public-api.ts","../../../../../../src/cdk/bidi/index.ts","../../../../../../src/cdk/bidi/bidi_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\n\n/**\n * Injection token used to inject the document into Directionality.\n * This is used so that the value can be faked in tests.\n *\n * We can't use the real document in tests because changing the real `dir` causes geometry-based\n * tests in Safari to fail.\n *\n * We also can't re-provide the DOCUMENT token from platform-browser because the unit tests\n * themselves use things like `querySelector` in test code.\n *\n * This token is defined in a separate file from Directionality as a workaround for\n * https://github.com/angular/angular/issues/22559\n *\n * @docs-private\n */\nexport const DIR_DOCUMENT = new InjectionToken<Document>('cdk-dir-doc', {\n providedIn: 'root',\n factory: DIR_DOCUMENT_FACTORY,\n});\n\n/** @docs-private */\nexport function DIR_DOCUMENT_FACTORY(): Document {\n return inject(DOCUMENT);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EventEmitter, Inject, Injectable, Optional, OnDestroy} from '@angular/core';\nimport {DIR_DOCUMENT} from './dir-document-token';\n\nexport type Direction = 'ltr' | 'rtl';\n\n/** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */\nconst RTL_LOCALE_PATTERN =\n /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;\n\n/** Resolves a string value to a specific direction. */\nexport function _resolveDirectionality(rawValue: string): Direction {\n const value = rawValue?.toLowerCase() || '';\n\n if (value === 'auto' && typeof navigator !== 'undefined' && navigator?.language) {\n return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr';\n }\n\n return value === 'rtl' ? 'rtl' : 'ltr';\n}\n\n/**\n * The directionality (LTR / RTL) context for the application (or a subtree of it).\n * Exposes the current direction and a stream of direction changes.\n */\n@Injectable({providedIn: 'root'})\nexport class Directionality implements OnDestroy {\n /** The current 'ltr' or 'rtl' value. */\n readonly value: Direction = 'ltr';\n\n /** Stream that emits whenever the 'ltr' / 'rtl' state changes. */\n readonly change = new EventEmitter<Direction>();\n\n constructor(@Optional() @Inject(DIR_DOCUMENT) _document?: any) {\n if (_document) {\n const bodyDir = _document.body ? _document.body.dir : null;\n const htmlDir = _document.documentElement ? _document.documentElement.dir : null;\n this.value = _resolveDirectionality(bodyDir || htmlDir || 'ltr');\n }\n }\n\n ngOnDestroy() {\n this.change.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, Output, Input, EventEmitter, AfterContentInit, OnDestroy} from '@angular/core';\n\nimport {Direction, Directionality, _resolveDirectionality} from './directionality';\n\n/**\n * Directive to listen for changes of direction of part of the DOM.\n *\n * Provides itself as Directionality such that descendant directives only need to ever inject\n * Directionality to get the closest direction.\n */\n@Directive({\n selector: '[dir]',\n providers: [{provide: Directionality, useExisting: Dir}],\n host: {'[attr.dir]': '_rawDir'},\n exportAs: 'dir',\n})\nexport class Dir implements Directionality, AfterContentInit, OnDestroy {\n /** Normalized direction that accounts for invalid/unsupported values. */\n private _dir: Direction = 'ltr';\n\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Direction as passed in by the consumer. */\n _rawDir: string;\n\n /** Event emitted when the direction changes. */\n @Output('dirChange') readonly change = new EventEmitter<Direction>();\n\n /** @docs-private */\n @Input()\n get dir(): Direction {\n return this._dir;\n }\n set dir(value: Direction | 'auto') {\n const previousValue = this._dir;\n\n // Note: `_resolveDirectionality` resolves the language based on the browser's language,\n // whereas the browser does it based on the content of the element. Since doing so based\n // on the content can be expensive, for now we're doing the simpler matching.\n this._dir = _resolveDirectionality(value);\n this._rawDir = value;\n\n if (previousValue !== this._dir && this._isInitialized) {\n this.change.emit(this._dir);\n }\n }\n\n /** Current layout direction of the element. */\n get value(): Direction {\n return this.dir;\n }\n\n /** Initialize once default value has been set. */\n ngAfterContentInit() {\n this._isInitialized = true;\n }\n\n ngOnDestroy() {\n this.change.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {Dir} from './dir';\n\n@NgModule({\n exports: [Dir],\n declarations: [Dir],\n})\nexport class BidiModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {Directionality, Direction} from './directionality';\nexport {DIR_DOCUMENT} from './dir-document-token';\nexport {Dir} from './dir';\nexport * from './bidi-module';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;;;;AAMG;AAKH;;;;;;;;;;;;;;AAcG;MACU,YAAY,GAAG,IAAI,cAAc,CAAW,aAAa,EAAE;AACtE,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,oBAAoB;AAC9B,CAAA,EAAE;AAEH;SACgB,oBAAoB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B;;AClCA;;;;;;AAMG;AAOH;AACA,MAAM,kBAAkB,GACtB,oHAAoH,CAAC;AAEvH;AACM,SAAU,sBAAsB,CAAC,QAAgB,EAAA;AACrD,IAAA,MAAM,KAAK,GAAG,CAAA,QAAQ,KAAR,IAA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