UNPKG

carbon-components-angular

Version:
439 lines (371 loc) 17.9 kB
<!doctype html> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>carbon-components-angular documentation</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="../images/favicon.ico"> <link rel="stylesheet" href="../styles/style.css"> <link rel="stylesheet" href="../styles/dark.css"> <style> footer.carbon { position: absolute; bottom: 0; width: 100%; z-index: 9999; } #root > div { /* * Subtracting the height of the footer to prevent * overlaying the footer ontop of content */ height: calc(100vh - 48px); } </style> </head> <body> <script> // Blocking script to avoid flickering dark mode // Dark mode toggle button var useDark = window.matchMedia('(prefers-color-scheme: dark)'); var darkModeState = useDark.matches; var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input'); var $darkModeToggles = document.querySelectorAll('.dark-mode-switch'); var darkModeStateLocal = localStorage.getItem('compodoc_darkmode-state'); function checkToggle(check) { for (var i = 0; i < $darkModeToggleSwitchers.length; i++) { $darkModeToggleSwitchers[i].checked = check; } } function toggleDarkMode(state) { if (window.localStorage) { localStorage.setItem('compodoc_darkmode-state', state); } checkToggle(state); const hasClass = document.body.classList.contains('dark'); if (state) { for (var i = 0; i < $darkModeToggles.length; i++) { $darkModeToggles[i].classList.add('dark'); } if (!hasClass) { document.body.classList.add('dark'); } } else { for (var i = 0; i < $darkModeToggles.length; i++) { $darkModeToggles[i].classList.remove('dark'); } if (hasClass) { document.body.classList.remove('dark'); } } } useDark.addEventListener('change', function (evt) { toggleDarkMode(evt.matches); }); if (darkModeStateLocal) { darkModeState = darkModeStateLocal === 'true'; } toggleDarkMode(darkModeState); </script> <div class="navbar navbar-default navbar-fixed-top d-md-none p-0"> <div class="d-flex"> <a href="../" class="navbar-brand">carbon-components-angular documentation</a> <button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button> </div> </div> <div class="xs-menu menu" id="mobile-menu"> <div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu> </div> <div class="container-fluid main"> <div class="row main"> <div class="d-none d-md-block menu"> <compodoc-menu mode="normal"></compodoc-menu> </div> <!-- START CONTENT --> <div class="content module"> <div class="content-data"> <ol class="breadcrumb"> <li class="breadcrumb-item">Modules</li> <li class="breadcrumb-item" >UtilsModule</li> </ol> <div class="text-center module-graph-container"> <div id="module-graph-svg"> <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <!-- Generated by graphviz version 2.47.0 (20210316.0004) --> <!-- Title: dependencies Pages: 1 --> <svg width="1056pt" height="211pt" viewBox="0.00 0.00 1056.00 211.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 207)"> <title>dependencies</title> <polygon fill="white" stroke="transparent" points="-4,4 -4,-207 1052,-207 1052,4 -4,4"/> <text text-anchor="start" x="503.01" y="-42.4" font-family="Times-12" font-weight="bold" font-size="14.00">Legend</text> <polygon fill="#ffffb3" stroke="transparent" points="290,-10 290,-30 310,-30 310,-10 290,-10"/> <text text-anchor="start" x="313.63" y="-15.4" font-family="Times-12" font-size="14.00"> &#160;Declarations</text> <polygon fill="#8dd3c7" stroke="transparent" points="403,-10 403,-30 423,-30 423,-10 403,-10"/> <text text-anchor="start" x="426.73" y="-15.4" font-family="Times-12" font-size="14.00"> &#160;Module</text> <polygon fill="#80b1d3" stroke="transparent" points="489,-10 489,-30 509,-30 509,-10 489,-10"/> <text text-anchor="start" x="512.78" y="-15.4" font-family="Times-12" font-size="14.00"> &#160;Bootstrap</text> <polygon fill="#fdb462" stroke="transparent" points="586,-10 586,-30 606,-30 606,-10 586,-10"/> <text text-anchor="start" x="609.67" y="-15.4" font-family="Times-12" font-size="14.00"> &#160;Providers</text> <polygon fill="#fb8072" stroke="transparent" points="682,-10 682,-30 702,-30 702,-10 682,-10"/> <text text-anchor="start" x="705.73" y="-15.4" font-family="Times-12" font-size="14.00"> &#160;Exports</text> <g id="clust1" class="cluster"> <title>cluster_UtilsModule</title> <polygon fill="none" stroke="black" stroke-dasharray="1,5" points="8,-70 8,-195 1040,-195 1040,-70 8,-70"/> </g> <g id="clust6" class="cluster"> <title>cluster_UtilsModule_providers</title> <polygon fill="none" stroke="black" points="16,-78 16,-130 1032,-130 1032,-78 16,-78"/> </g> <!-- AnimationFrameService --> <g id="node1" class="node"> <title>AnimationFrameService</title> <ellipse fill="#fdb462" stroke="black" cx="918" cy="-104" rx="105.93" ry="18"/> <text text-anchor="middle" x="918" y="-99.8" font-family="Times,serif" font-size="14.00">AnimationFrameService</text> </g> <!-- UtilsModule --> <g id="node6" class="node"> <title>UtilsModule</title> <polygon fill="#8dd3c7" stroke="black" points="453.27,-187 450.27,-191 429.27,-191 426.27,-187 366.73,-187 366.73,-151 453.27,-151 453.27,-187"/> <text text-anchor="middle" x="410" y="-164.8" font-family="Times,serif" font-size="14.00">UtilsModule</text> </g> <!-- AnimationFrameService&#45;&gt;UtilsModule --> <g id="edge1" class="edge"> <title>AnimationFrameService&#45;&gt;UtilsModule</title> <path fill="none" stroke="black" d="M918,-122.28C918,-143.32 918,-175 918,-175 918,-175 463.31,-175 463.31,-175"/> <polygon fill="black" stroke="black" points="463.31,-171.5 453.31,-175 463.31,-178.5 463.31,-171.5"/> </g> <!-- AnimationFrameServiceSingleton --> <g id="node2" class="node"> <title>AnimationFrameServiceSingleton</title> <ellipse fill="#fdb462" stroke="black" cx="651" cy="-104" rx="142.97" ry="18"/> <text text-anchor="middle" x="651" y="-99.8" font-family="Times,serif" font-size="14.00">AnimationFrameServiceSingleton</text> </g> <!-- AnimationFrameServiceSingleton&#45;&gt;UtilsModule --> <g id="edge2" class="edge"> <title>AnimationFrameServiceSingleton&#45;&gt;UtilsModule</title> <path fill="none" stroke="black" d="M651,-122.02C651,-139.37 651,-163 651,-163 651,-163 463.36,-163 463.36,-163"/> <polygon fill="black" stroke="black" points="463.36,-159.5 453.36,-163 463.36,-166.5 463.36,-159.5"/> </g> <!-- DocumentService --> <g id="node3" class="node"> <title>DocumentService</title> <ellipse fill="#fdb462" stroke="black" cx="410" cy="-104" rx="80.44" ry="18"/> <text text-anchor="middle" x="410" y="-99.8" font-family="Times,serif" font-size="14.00">DocumentService</text> </g> <!-- DocumentService&#45;&gt;UtilsModule --> <g id="edge3" class="edge"> <title>DocumentService&#45;&gt;UtilsModule</title> <path fill="none" stroke="black" d="M410,-122.11C410,-122.11 410,-140.99 410,-140.99"/> <polygon fill="black" stroke="black" points="406.5,-140.99 410,-150.99 413.5,-140.99 406.5,-140.99"/> </g> <!-- ElementService --> <g id="node4" class="node"> <title>ElementService</title> <ellipse fill="#fdb462" stroke="black" cx="240" cy="-104" rx="72.35" ry="18"/> <text text-anchor="middle" x="240" y="-99.8" font-family="Times,serif" font-size="14.00">ElementService</text> </g> <!-- ElementService&#45;&gt;UtilsModule --> <g id="edge4" class="edge"> <title>ElementService&#45;&gt;UtilsModule</title> <path fill="none" stroke="black" d="M240,-122.02C240,-139.37 240,-163 240,-163 240,-163 356.66,-163 356.66,-163"/> <polygon fill="black" stroke="black" points="356.66,-166.5 366.66,-163 356.66,-159.5 356.66,-166.5"/> </g> <!-- EventService --> <g id="node5" class="node"> <title>EventService</title> <ellipse fill="#fdb462" stroke="black" cx="87" cy="-104" rx="62.54" ry="18"/> <text text-anchor="middle" x="87" y="-99.8" font-family="Times,serif" font-size="14.00">EventService</text> </g> <!-- EventService&#45;&gt;UtilsModule --> <g id="edge5" class="edge"> <title>EventService&#45;&gt;UtilsModule</title> <path fill="none" stroke="black" d="M87,-122.28C87,-143.32 87,-175 87,-175 87,-175 356.44,-175 356.44,-175"/> <polygon fill="black" stroke="black" points="356.44,-178.5 366.44,-175 356.44,-171.5 356.44,-178.5"/> </g> </g> </svg> </div> <i id="fullscreen" class="icon ion-ios-resize module-graph-fullscreen-btn" aria-hidden="true"></i> <div class="btn-group size-buttons"> <button id="zoom-in" class="btn btn-default btn-sm">Zoom in</button> <button id="reset" class="btn btn-default btn-sm">Reset</button> <button id="zoom-out" class="btn btn-default btn-sm">Zoom out</button> </div> </div> <script src="../js/libs/svg-pan-zoom.min.js"></script> <script src="../js/svg-pan-zoom.controls.js"></script> <ul class="nav nav-tabs" role="tablist"> <li class="nav-item"> <a href="#info" class="nav-link" class="nav-link active" role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a> </li> <li class="nav-item"> <a href="#source" class="nav-link" role="tab" id="source-tab" data-bs-toggle="tab" data-link="source">Source</a> </li> </ul> <div class="tab-content"> <div class="tab-pane fade active in" id="info"> <p class="comment"> <h3>File</h3> </p> <p class="comment"> <code>src/utils/utils.module.ts</code> </p> <div class="container-fluid module"> <div class="row"> <div class="col-sm-3"> <h3>Providers<a href="https://angular.io/api/core/NgModule#providers" target="_blank" rel="noopener noreferrer" title="Official documentation about module providers"><span class="icon ion-ios-information-circle-outline"></a></h3> <ul class="list-group"> <li class="list-group-item"> <a href="../injectables/AnimationFrameService.html">AnimationFrameService</a> </li> <li class="list-group-item"> <a href="../injectables/AnimationFrameServiceSingleton.html">AnimationFrameServiceSingleton</a> </li> <li class="list-group-item"> <a href="../injectables/DocumentService.html">DocumentService</a> </li> <li class="list-group-item"> <a href="../injectables/ElementService.html">ElementService</a> </li> <li class="list-group-item"> <a href="../injectables/EventService.html">EventService</a> </li> </ul> </div> </div> </div> </div> <div class="tab-pane fade tab-source-code" id="source"> <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { NgModule, Optional, SkipSelf, NgZone } from &quot;@angular/core&quot;; import { AnimationFrameService, AnimationFrameServiceSingleton } from &quot;./animation-frame.service&quot;; import { ElementService } from &quot;./element.service&quot;; import { EventService } from &quot;./event.service&quot;; import { DocumentService } from &quot;./document.service&quot;; // either provides a new instance of DocumentService, or returns the parent export function DOCUMENT_SERVICE_PROVIDER_FACTORY(parentService: DocumentService) { return parentService || new DocumentService(); } // DocumentService *must* be a singleton to ensure that we handle events and other document level settings once (and only once) export const DOCUMENT_SERVICE_PROVIDER &#x3D; { provide: DocumentService, deps: [[new Optional(), new SkipSelf(), DocumentService]], useFactory: DOCUMENT_SERVICE_PROVIDER_FACTORY }; // either provides a new instance of AnimationFrameServiceSingleton, or returns the parent export function ANIMATION_FRAME_SERVICE_SINGLETON_PROVIDER_FACTORY(parentService: AnimationFrameServiceSingleton, ngZone: NgZone) { return parentService || new AnimationFrameServiceSingleton(ngZone); } // AnimationFrameServiceSingleton is a singleton so we don&#x27;t have a ton of duplicate RAFs firing (better for scheduling) export const ANIMATION_FRAME_SERVICE_SINGLETON_PROVIDER &#x3D; { provide: AnimationFrameServiceSingleton, deps: [[new Optional(), new SkipSelf(), AnimationFrameServiceSingleton], NgZone], useFactory: ANIMATION_FRAME_SERVICE_SINGLETON_PROVIDER_FACTORY }; @NgModule({ providers: [ DOCUMENT_SERVICE_PROVIDER, ANIMATION_FRAME_SERVICE_SINGLETON_PROVIDER, AnimationFrameServiceSingleton, DocumentService, AnimationFrameService, ElementService, EventService ] }) export class UtilsModule { } </code></pre> </div> </div> </div><div class="search-results"> <div class="has-results"> <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1> <ul class="search-results-list"></ul> </div> <div class="no-results"> <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1> </div> </div> </div> <!-- END CONTENT --> </div> </div> <label class="dark-mode-switch"> <input type="checkbox"> <span class="slider"> <svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg"> <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path> </svg> </span> </label> <script> var COMPODOC_CURRENT_PAGE_DEPTH = 1; var COMPODOC_CURRENT_PAGE_CONTEXT = 'module'; var COMPODOC_CURRENT_PAGE_URL = 'UtilsModule.html'; var MAX_SEARCH_RESULTS = 15; </script> <script> $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input'); checkToggle(darkModeState); if ($darkModeToggleSwitchers.length > 0) { for (var i = 0; i < $darkModeToggleSwitchers.length; i++) { $darkModeToggleSwitchers[i].addEventListener('change', function (event) { darkModeState = !darkModeState; toggleDarkMode(darkModeState); }); } } </script> <script src="../js/libs/custom-elements.min.js"></script> <script src="../js/libs/lit-html.js"></script> <script src="../js/menu-wc.js" defer></script> <script nomodule src="../js/menu-wc_es5.js" defer></script> <script src="../js/libs/bootstrap-native.js"></script> <script src="../js/libs/es6-shim.min.js"></script> <script src="../js/libs/EventDispatcher.js"></script> <script src="../js/libs/promise.min.js"></script> <script src="../js/libs/zepto.min.js"></script> <script src="../js/compodoc.js"></script> <script src="../js/tabs.js"></script> <script src="../js/menu.js"></script> <script src="../js/libs/clipboard.min.js"></script> <script src="../js/libs/prism.js"></script> <script src="../js/sourceCode.js"></script> <script src="../js/search/search.js"></script> <script src="../js/search/lunr.min.js"></script> <script src="../js/search/search-lunr.js"></script> <script src="../js/search/search_index.js"></script> <script src="../js/lazy-load-graphs.js"></script> <footer class="carbon"> <dds-footer-container key="footer" disable-locale-button="true" size="micro" /> </footer> <script key="8" type="module" src="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/footer.min.js"> </script> <!-- Storybook override --> <script> document.title = "Carbon Components Angular"; </script> <script src="//1.www.s81c.com/common/stats/ibm-common.js" type="text/javascript" async="async"> </script> </body> </html>