\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{WebPlanet (Pawel)} \pdfinfo{ /Title (polymer-1-1.pdf) /Creator (Cheatography) /Author (WebPlanet (Pawel)) /Subject (Polymer 1.1 Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{314CA3} \definecolor{LightBackground}{HTML}{F2F3F9} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Polymer 1.1 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{WebPlanet (Pawel)} via \textcolor{DarkBackground}{\uline{cheatography.com/25918/cs/7033/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}WebPlanet (Pawel) \\ \uline{cheatography.com/pawel} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 6th February, 2016.\\ Updated 7th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Register and Create}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{// Register element 'my-element' and return constructor}} \newline var elementConstr = Polymer(\{is: 'my-element'\}) \newline \newline {\bf{// Register element 'my-element' with factory implementation}} \newline {\bf{var}} elementConstr = {\bf{Polymer}}( \newline \{ {\bf{is}}: 'my-element', \newline {\bf{factoryImpl}}: function (v1, v2) \{ \newline this.v1 = v1; \newline this.v2 = v2 \newline \}\}); \newline \newline {\bf{// Create element}} \newline {\bf{var}} myElement = new elementConstr(); \newline {\bf{OR}} \newline {\bf{var}} myElement = \seqsplit{document.createElement('my-element');} \newline \newline {\bf{Create element with factory implementation}} \newline {\bf{var}} myElement = new elementConstr(1, 2);} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Extend existing element}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{// Extend existing input element}} \newline {\bf{var}} myElement = {\bf{Polymer}}(\{ \newline {\bf{is}}: 'my-input', \newline {\bf{extends}}: 'input' \newline \});} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Data binding}} \tn % Row 0 \SetRowColor{LightBackground} \{\{prop\}\} & bind property 'prop', get child custom element notifications \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} {[}{[}prop{]}{]} & bind property 'prop', DO NOT get child custom element notifications \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} \{\{prop::eventname\}\} & bind property 'prop' when event 'eventname' occurs \tn % Row Count 10 (+ 3) % Row 3 \SetRowColor{white} \{\{obj.prop\}\} & bind property 'prop' of 'obj' object property \tn % Row Count 13 (+ 3) % Row 4 \SetRowColor{LightBackground} \{\{!bool\}\} & negate and bind boolean property 'bool' \tn % Row Count 15 (+ 2) % Row 5 \SetRowColor{white} \{\{compute(a, b)\}\} & execute 'compute(a, b)' and bind \tn % Row Count 17 (+ 2) % Row 6 \SetRowColor{LightBackground} \textless{}my-element selected\$="\{\{value\}\}"\textgreater{}\textless{}/my-element\textgreater{} & bind 'value' to attribute 'selected' \tn % Row Count 20 (+ 3) % Row 7 \SetRowColor{white} \textless{}my-element selected="\{\{value\}\}"\textgreater{}\textless{}/my-element\textgreater{} & bind 'value' to property 'selected' \tn % Row Count 23 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Behaviors}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{my-behavior.html}} \newline \textless{}script\textgreater{} \newline myBehavior = \{ \newline {\bf{listeners}}: \{'click' : 'changeColor'\}, \newline {\bf{changeColor}}: function () \{ \newline this.color = 'blue'; \newline \} \newline \} \newline \textless{}/script\textgreater{} \newline {\bf{my-element.html}} \newline \textless{}link rel="import" href="my-behavior.html"\textgreater{} \newline {\bf{Polymer}}(\{ \newline {\bf{is}}: 'my-element', \newline {\bf{behaviors}}: {[}myBehavior{]} \newline \});} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Register observers}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Polymer}}(\{ \newline {\bf{is}}: 'my-element', \newline {\bf{properties}}: \{ \newline {\emph{color}}: String, \newline {\emph{arr}}: \{ \newline {\bf{type}}: Array, \newline {\bf{value}}: function () \{return {[}{]};\} \newline \}, \newline {\emph{obj}}: \{ \newline {\bf{type}}: Object \newline \} \newline \}, \newline {\bf{observers}}: {[} \newline 'obs1(obj.prop2)', 'obj2(color)', \newline 'obs3(obj.prop2, color)', {\bf{//Observe mupliple}} \newline 'obs4(obj.*) {\bf{//Observe deep}}, \newline 'obs5(arr.splices) {\bf{//Observe array splices}} \newline {]}\});} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Debouncing}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Polymer}}(\{ \newline {\bf{is}}: 'my-element', \newline {\bf{properties}}: \{ \newline prop1: String, \newline prop2: String \newline \}, \newline {\bf{observers}}: {[}'doSomething(prop1, prop2)'{]}, \newline {\bf{doSomething}}: function () \{ \newline {\bf{this.debounce}}('doSomething', function () \{ \newline console.log('called once...'); \newline \}, 300); \newline \} \newline \});} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{When 'prop1' and 'prop2' are changed within 300ms time frame, 'doSomething' callback is executed once.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.44333 cm} x{3.53367 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Lifecycle Callbacks}} \tn % Row 0 \SetRowColor{LightBackground} created & when element is registered \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} ready & when element is registered and local DOM is ready \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} attached & when element is attached to DOM \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} detached & when element is removed from DOM \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} \seqsplit{attributeChanged} & when element attribute is changed \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.14011 cm} x{2.83689 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Styling}} \tn % Row 0 \SetRowColor{LightBackground} :host & style host element \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} :host ::content & style distributed content \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} -{}-custom-property: value & create css property 'custom-property' and give it a 'value' \tn % Row Count 6 (+ 3) % Row 3 \SetRowColor{white} -{}-mixin-name: \{mixin contents\} & create mixin 'mixin-name' with contents 'mixin contents' \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} color: var(-{}-my-color, red) & apply custom property 'my color', set default to red \tn % Row Count 12 (+ 3) % Row 5 \SetRowColor{white} color: @apply(-{}-mixin-name) & apply mixin 'mixin-name' to a property 'color' \tn % Row Count 15 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Import styles}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{style.html}} \newline \textless{}{\bf{dom-module}} id="my-style"\textgreater{} \newline \textless{}template\textgreater{} \newline \textless{}style\textgreater{} \newline :host \{ \newline -{}-text-style: blue; \newline \} \newline \textless{}/style\textgreater{} \newline \textless{}/template\textgreater{} \newline \textless{}{\bf{/dom-module}}\textgreater{} \newline \newline {\bf{my-element.html}} \newline \textless{}{\bf{link rel="import" href="style.html"}}\textgreater{} \newline \textless{}{\bf{dom-module}} id="my-element"\textgreater{} \newline \textless{}style {\bf{include="my-style"}}\textgreater{}\textless{}/style\textgreater{} \newline \textless{}{\bf{/dom-module}}\textgreater{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Style from light DOM}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\textless{}{\bf{style}} is="custom-style"\textgreater{} \newline \newline my-element \{ \newline -{}-text-style: red; \newline \} \newline \newline \textless{}{\bf{/style}}\textgreater{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Dom repeat}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{\textless{}template is="dom-repeat" items=\{\{table\}\} as="myTable"\textgreater{}}} \newline \textless{}div\textgreater{}\{\{myTable.item\}\}\textless{}/div\textgreater{} \newline {\bf{\textless{}/template\textgreater{}}} \newline ... \newline {\bf{Polymer}} (\{ ... \newline ready: function () \{this.table = {[}\{item: 'item1'\}, \{item: 'item2'\}{]};\} \newline ...\});} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Sort and Filter}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\textless{}template is="dom-repeat" items=\{\{table\}\} {\bf{filler="myFilter" sort="mySort"}}\textgreater{} \newline \textless{}div\textgreater{}\{\{table.item\}\}\textless{}/div\textgreater{} \newline \textless{}/template\textgreater{} \newline ... \newline {\bf{Polymer}} (\{ ... \newline {\bf{ready}}: function () \{this.table = {[}\{item: 'item1'\}, \{item: 'item2'\}{]};\}, \newline {\bf{myFilter}}: function (item) \{...\}, \newline {\bf{mySort}}: function (item) \{...\} \newline ...\});} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Extending Behaviors}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\textless{}link rel="import" href="oldbehavior.html"\textgreater{} \newline \textless{}script\textgreater{} \newline NewBehaviorImpl = \{ \newline \} \newline {\bf{NewBehavior = {[} OldBehavior, NewBehaviorImpl {]}}} \newline \textless{}/script\textgreater{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Add event listeners}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{// Add event listeners as a element prototype property}} \newline \textless{}dom-module id="my-element"\textgreater{} \newline \textless{}template\textgreater{} \newline \textless{}{\bf{div}} id="elementID1"\textgreater{}Element 1\textless{}{\bf{/div}}\textgreater{} \newline \textless{}{\bf{div}} id="elementID2"\textgreater{}Element 1\textless{}{\bf{/div}}\textgreater{} \newline \textless{}/template\textgreater{} \newline \textless{}/dom-module\textgreater{} \newline \{ \newline {\bf{Polymer}}(\{ \newline {\bf{is}}: 'my-element', \newline {\bf{listeners}}: \{ \newline 'click.elementID1' : 'handleClick1', \newline 'click.elementID2' : 'handleClick2' \newline 'click' : 'handleClick' {\bf{// Every click}} \newline \}); \newline \newline {\bf{// Adding event listeners on elements}} \newline \textless{}element on-\{event name\} = "\{handler\}"\textgreater{}\textless{}/element\textgreater{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Observe mutations}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{this.\_observer = {\bf{Polymer.dom}}(this). \newline {\bf{observeNodes}}(function (info) \{ \newline console.log ('Added nodes: ' + info.{\bf{addedNodes}}); \newline console.log ('Removed nodes: '+ info.{\bf{removedNodes}}); \newline \}); \newline \newline {\bf{Polymer.dom}}(this).{\bf{unobserveNodes}}(this.\_observer)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.54287 cm} x{3.43413 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Property Definition}} \tn % Row 0 \SetRowColor{LightBackground} type & type of a property (String, Array, Boolean, Number, Object) \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} value & default value \tn % Row Count 4 (+ 1) % Row 2 \SetRowColor{LightBackground} readOnly & set read only property \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} notify & fire 'property-changed' event, when property is changed. Handy for nested data binding \tn % Row Count 9 (+ 4) % Row 4 \SetRowColor{LightBackground} \seqsplit{reflectToAttribute} & update attribute when property is changed \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} observer & execute provided Callback when property is changed \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} computed & compute value based on other property values \tn % Row Count 15 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Example for {\emph{color}} and {\emph{underline}} properties:}} \newline {\bf{properties}}: \{ \newline {\emph{color}}: String, \newline {\emph{underline}}: \{ \newline {\bf{type}}: Boolean, \newline {\bf{value}}: false, \newline {\bf{observer}}: 'applyDecoration', \newline {\bf{reflectToAttribute}}: true, \newline {\bf{notify}}: true \newline \}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.43873 cm} x{2.53827 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Property modifications}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{this.set('property'}, value) & set this.property to 'value' \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} this.set('arr.1', value) & set this.arr{[}1{]} to 'value' \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{this.set('obj.prop1'}, value) & set this.obj.prop1 to 'value' \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{this.get('property')} & get value of this.property \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} \seqsplit{this.get('obj.prop1')} & get value of this.obj.prop1 \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} this.get('arr.1') & get value of this.arr{[}1{]} \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{This API is required to observe properties of Array and Object types.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.43873 cm} x{2.53827 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Polymer API}} \tn % Row 0 \SetRowColor{LightBackground} Dom manipulation & \seqsplit{Polymer.dom(element)}.{\emph{method}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Shadow root & this.root \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} Host element & this \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} this.\$.myid & local DOM element with id = 'myid' \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} this.\$\$(selector) & "querySelector" in local DOM \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} \seqsplit{contentElement.getDistributedNodes()} & return distributed nodes to contentElement \tn % Row Count 11 (+ 3) % Row 6 \SetRowColor{LightBackground} \seqsplit{element.getDestinationInsertionPoints()} & return \textless{}content\textgreater{} elements for light DOM 'element', where 'element' is distributed to local DOM \tn % Row Count 16 (+ 5) % Row 7 \SetRowColor{white} \seqsplit{contentElement.getContentChildren()} & return distributed elements to local DOM that are children of 'contentElement' \tn % Row Count 20 (+ 4) % Row 8 \SetRowColor{LightBackground} .\{query | get\}EffectiveChildren() & return effective children Handy for nesting when host element contains \textless{}content\textgreater{} tag \tn % Row Count 25 (+ 5) % Row 9 \SetRowColor{white} \seqsplit{.getEffectiveChildNodes()} & same as above for nodes \tn % Row Count 27 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Conditional Template}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{\textless{}template is="dom-if" if="\{\{user.isAdmin\}\}"\textgreater{}}} \newline Only admins can see this. \newline {\bf{\textless{}/template\textgreater{}}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.59264 cm} x{3.38436 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Utility Functions}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{toggleClass()} & toggle class \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{toggleAttribute()} & toggle attribute \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{attributeFollows()} & move attribute from one element to another \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{classFollows()} & move class from one element to another \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} async() & call asynchronously \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} fire() & dispatch event \tn % Row Count 10 (+ 1) % Row 6 \SetRowColor{LightBackground} \seqsplit{cancelDebouncer()} & cancel given debouncer \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} \seqsplit{flushDebouncer()} & call debouncer task and cancel debouncer \tn % Row Count 14 (+ 2) % Row 8 \SetRowColor{LightBackground} \seqsplit{isDebouncerActive()} & return true if active, false otherwise \tn % Row Count 16 (+ 2) % Row 9 \SetRowColor{white} transform() & tranform element (css transform function) \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}