diff --git a/elements/pfe-accordion/dist/pfe-accordion-header.css.map b/elements/pfe-accordion/dist/pfe-accordion-header.css.map new file mode 100644 index 0000000000..92b0f275b4 --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion-header.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-accordion-header.scss","../../pfe-sass/functions/_custom-properties.scss","pfe-accordion-header.css","../../pfe-sass/mixins/_mixins.scss","../../pfe-sass/mixins/_custom-properties.scss","../../pfe-sass/mixins/_components.scss","../../pfe-sass/maps/_general.scss","../../../node_modules/@patternfly/patternfly/sass-utilities/colors.scss"],"names":[],"mappings":"AAKA;EAGE,mFC6BkC;ED7BlC,2EC6BkC;ED7BlC,mEC6BkC;ED7BlC,oIC6BkC;ED7BlC,uHC6BkC;ED7BlC,+GC6BkC;ED7BlC,uGC6BkC;ED7BlC,4MC6BkC;ED5BlC,cAAc;AENhB;;AC+EU;EACN,aAAa;AD5EjB;;AFFA;EAQI,SAAS;AEFb;;AFNA;EI+FM,qCAA8C;EAA9C,0BAA8C;EAJ5C,6RAA8C;ECRpD,SAAS;EACT,WJVkC;EIUlC,wCJVkC;EIWlC,2BAAgE;EAAhE,2EAAgE;EAChE,YAAY;EACZ,kBAAkB;EAGlB,6BJhBkC;EIgBlC,oEJhBkC;EIiBlC,cJjBkC;EIiBlC,yEJjBkC;EIoBlC,eAAe;EACf,mBJ/DkC;EI+DlC,4DJ/DkC;EIgElC,qBJtBkC;EIsBlC,kGJtBkC;EIuBlC,qBJvBkC;EIuBlC,oGJvBkC;EIwBlC,qBJxBkC;EIwBlC,6DJxBkC;EIyBlC,wBJzBkC;EIyBlC,0GJzBkC;EI0BlC,sBJ1BkC;EI0BlC,6GJ1BkC;EIoClC,8BJpCkC;EIoClC,yEJpCkC;EIsClC,mDJtCkC;UIsClC,2CJtCkC;EIuClC,qCJvCkC;EIqElC,eAAe;EAEf,oBAAoB;EACpB,2BJxEkC;EIwElC,gGJxEkC;EIyElC,gBJnHkC;EImHlC,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;;AF5EE;EIqCI,0DAA8C;EAA9C,6DAA8C;EAA9C,0FAA8C;EAA9C,gCAA8C;AF8CpD;;AF9EE;EIgCI,oDAA8C;EAA9C,6DAA8C;EAA9C,4FAA8C;EAA9C,gCAA8C;AFqDpD;;AF3EA;EAEI,4BAA4D;EAA5D,qGAA4D;AE6EhE;;AC1JM;EH2EN;IG3E4F,UAAA;IH+EtF,4BAA4B;IAC5B,2BO/EkC;IPgFlC,0BOhFkC;IPiFlC,sBMjE8B;EJkJlC;AACF;;AFzFA;EKuIE,WAAW;EACX,kBAAkB;EAClB,wBAAoD;EAApD,4DAAoD;EAEpD,cAAc;EACd,mBJrLkC;EIqLlC,4DJrLkC;EIsLlC,aAR4D;EAS5D,YAT4D;EAU5D,2CAA2B;EAA3B,mCAA2B;EAA3B,2BAA2B;EAA3B,oDAA2B;EAgBzB,2BAA2B;EAC3B,gCAAwB;UAAxB,wBAAwB;EAEtB,yBAAiD;EAAjD,6DAAiD;EACjD,iCAAyB;UAAzB,yBAAyB;AH3D/B;;AFxGA;EAeM,gCAAwB;UAAxB,wBAAwB;AE6F9B;;AF5GA;EAoBM,wCAA2I;EAA3I,0MAA2I;AE4FjJ;;AFhHA;EAsBQ,mCAAsG;EAAtG,4HAAsG;AE8F9G","file":"pfe-accordion-header.css","sourcesContent":["@import \"shared-assets\";\n\n/// ===========================================================================\n/// ACCORDION HEADER\n/// ===========================================================================\n:host {\n @include pfe-hidden;\n \n transition: transform 0.3s pfe-var(animation-timing);\n display: block;\n\n // Shadow template styles\n > * {\n margin: 0;\n }\n\n button {\n @include pfe-trigger;\n\n // @TODO workaround, can we get the variables working?\n @include browser-query(edge) {\n text-align: left;\n }\n\n @include browser-query(ie11) {\n padding: 16px 24px;\n &:hover {\n border-left-color: pfe-fetch(ui-accent);\n }\n }\n\n &[aria-expanded=\"true\"] {\n $accordion: pfe-accordion-variables($state: expanded);\n @include pfe-print-local($accordion);\n @include browser-query(ie11) {\n border-bottom-width: 0;\n border-left-color: pfe-fetch(ui-accent);\n border-right-color: pfe-fetch(surface--border);\n }\n }\n }\n}\n\n:host(:not([disclosure=\"true\"])) {\n button::after {\n @include pfe-chevron($state: closed);\n }\n button[aria-expanded=\"true\"]::after {\n transform: rotate(-135deg);\n }\n}\n\n// Add border bottom to the last button in an accordion set.\n:host(:last-of-type) button:not([aria-expanded=\"true\"]) {\n @include pfe-trigger-last;\n}\n\n:host(:last-of-type.animating) button {\n --pfe-accordion--BorderBottomWidth: 0;\n}\n\n// Styles based on background color\nbutton[aria-expanded=\"true\"] {\n :host([on=\"dark\"]) & {\n $accordion: pfe-accordion-variables($state: expanded, $context: dark);\n @include pfe-print-local($accordion);\n }\n\n :host([on=\"saturated\"]) & {\n $accordion: pfe-accordion-variables($state: expanded, $context: saturated);\n @include pfe-print-local($accordion);\n }\n}\n\n/// ===========================================================================\n/// DISCLOSURE STYLES\n/// ===========================================================================\n\n:host([disclosure=\"true\"]) {\n button {\n padding-left: calc(#{pfe-local(Padding, $region: base)} * 3);\n @include browser-query(ie11) {\n padding: 16px 24px 16px 47px;\n border-right-color: pfe-fetch(surface--border);\n border-left-color: pfe-fetch(surface--border);\n border-left-width: pfe-fetch(surface--border-width);\n }\n\n &::before {\n @include pfe-chevron($state: closed, $position: before, $offset: .55em);\n }\n \n &[aria-expanded=\"true\"]::before {\n transform: rotate(45deg);\n }\n \n &[aria-expanded=\"true\"],\n &:not([aria-expanded=\"true\"]):hover {\n padding-left: calc(#{pfe-local(Padding, $region: base)} * 3 - #{pfe-var(surface--border-width--heavy)} + #{pfe-var(surface--border-width)});\n &::before {\n margin-left: calc((#{pfe-var(surface--border-width--heavy)} - #{pfe-var(surface--border-width)}) * -1);\n }\n }\n }\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}",":host {\n transition: transform 0.3s var(--pfe-theme--animation-timing, cubic-bezier(0.465, 0.183, 0.153, 0.946));\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host > * {\n margin: 0;\n}\n\n:host button {\n --pfe-accordion--BorderBottomWidth: 0;\n --pfe-accordion--ZIndex: 3;\n --pfe-accordion__trigger--Padding: var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) 50px var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 1.5);\n margin: 0;\n width: var(--pfe-accordion--Width, 100%);\n max-width: calc(100% - var(--pfe-theme--surface--border-width--heavy, 4px));\n height: auto;\n position: relative;\n background-color: var(--pfe-accordion--BackgroundColor, transparent);\n color: var(--pfe-accordion--Color, var(--pfe-broadcasted--text, #3c3f42));\n border-width: 0;\n border-style: var(--pfe-theme--surface--border-style, solid);\n border-color: var(--pfe-accordion--BorderColor, var(--pfe-theme--color--surface--border, #d2d2d2));\n border-top-width: var(--pfe-accordion--BorderTopWidth, var(--pfe-theme--surface--border-width, 1px));\n border-right-width: var(--pfe-accordion--BorderRightWidth, 0);\n border-bottom-width: var(--pfe-accordion--BorderBottomWidth, var(--pfe-theme--surface--border-width, 1px));\n border-left-width: var(--pfe-accordion--BorderLeftWidth, var(--pfe-theme--surface--border-width--heavy, 4px));\n border-left-color: var(--pfe-accordion--BorderColor--accent, transparent);\n box-shadow: var(--pfe-accordion--BoxShadow);\n z-index: var(--pfe-accordion--ZIndex);\n cursor: pointer;\n font-family: inherit;\n font-size: var(--pfe-accordion--FontSize--header, calc(var(--pfe-theme--font-size, 1rem) * 1.1));\n font-weight: var(--pfe-theme--font-weight--bold, 700);\n text-align: var(--pfe-accordion--TextAlign, left);\n line-height: var(--pfe-theme--line-height, 1.5);\n padding: var(--pfe-accordion__trigger--Padding);\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host button {\n /* IE10+ */\n border-top-width: 1px;\n border-right-width: 0;\n border-bottom-width: 1px;\n border-left-width: 4px;\n }\n}\n\n:host button:hover, :host button:focus {\n --pfe-accordion--BorderColor--accent: var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host button:hover, :host button:focus {\n /* IE10+ */\n border-left-color: #06c;\n }\n}\n\n:host button:hover {\n outline: none;\n border-left-width: var(--pfe-theme--surface--border-width--heavy, 4px);\n}\n\n:host button:focus {\n outline: none;\n text-decoration: underline;\n}\n\n:host button::-moz-focus-inner {\n border: 0;\n}\n\n@supports (-ms-ime-align: auto) {\n :host button {\n /* Microsoft Edge Browser 16+ (All) */\n text-align: left;\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host button {\n /* IE10+ */\n padding: 16px 24px;\n }\n :host button:hover {\n border-left-color: #06c;\n }\n}\n\n:host button[aria-expanded=\"true\"] {\n --pfe-accordion--BorderColor: var(--pfe-theme--color--surface--border, #d2d2d2);\n --pfe-accordion--BorderRightWidth: var(--pfe-theme--surface--border-width, 1px);\n --pfe-accordion--BorderLeftWidth: var(--pfe-theme--surface--border-width--heavy, 4px);\n --pfe-accordion--BackgroundColor: white;\n --pfe-accordion--Color: var(--pfe-theme--color--text, #151515);\n --pfe-accordion--BorderColor--accent: var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));\n --pfe-accordion--BoxShadow: 0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);\n --pfe-accordion--ZIndex: 3;\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host button[aria-expanded=\"true\"] {\n /* IE10+ */\n border-bottom-width: 0;\n border-left-color: #06c;\n border-right-color: #d2d2d2;\n }\n}\n\n:host(:not([disclosure=\"true\"])) button::after {\n content: \"\";\n position: absolute;\n top: calc(var(--pfe-theme--container-spacer, 1rem) + 0.4em);\n display: block;\n border-style: var(--pfe-theme--surface--border-style, solid);\n height: 0.4em;\n width: 0.4em;\n transition: transform 0.15s;\n border-width: 0 .1em .1em 0;\n transform: rotate(45deg);\n right: calc(var(--pfe-theme--container-spacer, 1rem) * 1.3125);\n}\n\n:host(:not([disclosure=\"true\"])) button[aria-expanded=\"true\"]::after {\n transform: rotate(-135deg);\n}\n\n:host(:last-of-type) button:not([aria-expanded=\"true\"]) {\n --pfe-accordion--BorderBottomWidth: var(--pfe-theme--surface--border-width, 1px);\n}\n\n:host(:last-of-type.animating) button {\n --pfe-accordion--BorderBottomWidth: 0;\n}\n\n:host([on=\"dark\"]) button[aria-expanded=\"true\"] {\n --pfe-accordion--BackgroundColor: rgba(247, 247, 249, 0.1);\n --pfe-accordion--Color: var(--pfe-broadcasted--text, #3c3f42);\n --pfe-accordion--BorderColor--accent: var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);\n --pfe-accordion--BoxShadow: none;\n}\n\n:host([on=\"saturated\"]) button[aria-expanded=\"true\"] {\n --pfe-accordion--BackgroundColor: rgba(0, 0, 0, 0.2);\n --pfe-accordion--Color: var(--pfe-broadcasted--text, #3c3f42);\n --pfe-accordion--BorderColor--accent: var(--pfe-theme--color--ui-accent--on-saturated, #fff);\n --pfe-accordion--BoxShadow: none;\n}\n\n:host([disclosure=\"true\"]) button {\n padding-left: calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 3);\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host([disclosure=\"true\"]) button {\n /* IE10+ */\n padding: 16px 24px 16px 47px;\n border-right-color: #d2d2d2;\n border-left-color: #d2d2d2;\n border-left-width: 1px;\n }\n}\n\n:host([disclosure=\"true\"]) button::before {\n content: \"\";\n position: absolute;\n top: calc(var(--pfe-theme--container-spacer, 1rem) + 0.55em);\n display: block;\n border-style: var(--pfe-theme--surface--border-style, solid);\n height: 0.4em;\n width: 0.4em;\n transition: transform 0.15s;\n border-width: 0 .1em .1em 0;\n transform: rotate(45deg);\n left: calc(var(--pfe-theme--container-spacer, 1rem) * 1.3125);\n transform: rotate(-45deg);\n}\n\n:host([disclosure=\"true\"]) button[aria-expanded=\"true\"]::before {\n transform: rotate(45deg);\n}\n\n:host([disclosure=\"true\"]) button[aria-expanded=\"true\"], :host([disclosure=\"true\"]) button:not([aria-expanded=\"true\"]):hover {\n padding-left: calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 3 - var(--pfe-theme--surface--border-width--heavy, 4px) + var(--pfe-theme--surface--border-width, 1px));\n}\n\n:host([disclosure=\"true\"]) button[aria-expanded=\"true\"]::before, :host([disclosure=\"true\"]) button:not([aria-expanded=\"true\"]):hover::before {\n margin-left: calc((var(--pfe-theme--surface--border-width--heavy, 4px) - var(--pfe-theme--surface--border-width, 1px)) * -1);\n}\n","@mixin browser-query($browser-list) {\n @each $browser in $browser-list {\n @if $browser == ie11 {\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n @content;\n }\n }\n @if $browser == edge12 {\n @supports (-ms-accelerator: true) { /* Microsoft Edge Browser 12+ */\n @content;\n }\n }\n @if $browser == edge {\n @supports (-ms-ime-align: auto) { /* Microsoft Edge Browser 16+ (All) */\n @content;\n }\n }\n @if $browser == firefox {\n @media all and (min--moz-device-pixel-ratio:0) { /* Mozilla Firefox (All) */\n @content;\n }\n }\n }\n}\n\n@mixin pfe-transition($properties...) {\n $return: null;\n @each $property in $properties {\n @if length($property) == 1 {\n $return: append($return, #{$property} 250ms $pfe-global--animation-timing, comma);\n }\n @else if length($property) == 2 {\n $return: append($return, nth($property, 1) nth($property, 2), comma);\n }\n }\n transition: $return;\n}\n\n// Make a CSS arrow\n@mixin pfe-arrow($type, $color, $width: 8px, $height: 5px, $pseudo: false) {\n $direction: (\n up: 180deg,\n down: 0deg,\n right: -90deg,\n left: 90deg,\n );\n border-style: pfe-var(surface--border-style);\n border-width: $width $height 0;\n border-color: transparent;\n border-top-color: $color;\n transform: rotate(map-get($direction, $type));\n @if $pseudo {\n display: inline-block;\n content: \"\";\n @content;\n }\n}\n\n@mixin pfe-arrow-color($color) {\n border-top-color: $color;\n}\n\n@mixin pfe-print-media {\n @media print {\n @content;\n }\n}\n\n@mixin pfe-print-background {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n@mixin pfe-no-print-background {\n @include pfe-print-media {\n background-color: white !important;\n background-image: none !important;\n box-shadow: none !important;\n }\n}\n\n@mixin pfe-hidden {\n @at-root #{&}([hidden]) {\n display: none;\n }\n}\n\n@mixin pfe-pipe( $position: right, $padding: 0, $margin: 0, $color: $border-color) {\n border: pfe-var(surface--border-width) pfe-var(surface--border-style) transparent;\n border-#{$position}-color: $color;\n @if $position == right {\n padding-left: $padding;\n margin-right: $margin;\n }\n @else if $position == left {\n padding-right: $padding;\n margin-left: $margin;\n }\n}\n\n@mixin pfe-retina {\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n @content;\n }\n}\n\n@mixin pfe-icon($path, $display: flex, $size: 1em) {\n display: #{$display};\n @if $path {\n background: #{$path} no-repeat;\n background-size: contain;\n background-position: center;\n }\n width: #{$size};\n height: #{$size};\n @content;\n}\n\n@mixin pfe-local-debug($map: $LOCAL-VARIABLES) {\n :root {\n @include pfe-print-local($map);\n }\n} ","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// This will print all the broadcast variables, and set the value to the context of your choosing, like on-dark or on-saturated.\n/// @param {String} $context - Look up values from contexts, i.e. \"light\" or \"saturated\"\n/// @param {List | String} $broadcast [$BROADCAST-VARS] - Optionally specify only one broadcast variable instead of the whole set, i.e. \"text\"\n/// @see $custom-prop-prefix\n/// @see $BROADCAST-VARS\n/// @example - scss - Usage in a container component, i.e. pfe-card\n/// :host {\n/// @include pfe-set-broadcast-context(dark);\n/// }\n/// @example - css - Rendered output\n/// :host {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n///\n@mixin pfe-set-broadcast-context($context, $broadcast: $BROADCAST-VARS) {\n @each $type in $broadcast {\n $list: ();\n $string: \"\";\n $context_string: \"\";\n $state: \"\";\n\n @if str-starts-with($type, \"link\") {\n $list: append($list, \"#{$type}\");\n\n @each $s in (hover, focus, visited) {\n $state: \"--#{$s}\";\n $string: \"#{$type}#{$state}\";\n\n @if not index($list, $string) {\n $list: append($list, \"#{$type}#{$state}\");\n }\n }\n } @else {\n @if not index($list, $string) {\n $list: append($list, \"#{$type}\");\n }\n }\n\n @if index($CONTEXTS, $context) != null {\n @if $context != \"light\" {\n $context_string: \"--on-#{$context}\";\n }\n }\n\n @each $item in $list {\n @if not index($BROADCAST-VARS, $type) {\n @warn \"--#{$custom-prop-prefix}-broadcasted--#{$item} variable is not in the $BROADCAST-VARS list.\";\n } @else if not pfe-broadcasted(#{$item}#{$context_string}) {\n @warn \"#{$item}#{$context_string} value does not currently exist.\";\n } @else {\n @if index($CONTEXTS, $context) != null {\n --#{$custom-prop-prefix}-broadcasted--#{$item}: #{pfe-var(#{$item}#{$context_string})};\n } @else {\n @error \"The #{$context} context does not appear to be part of a supported context.\";\n }\n }\n }\n }\n}\n\n/// Returns CSS Variable for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $value - The value of the css variable being defined\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example - scss\n/// :host {\n/// padding-top: pfe-local(paddingTop);\n/// padding-bottom: pfe-local(paddingBottom);\n/// }\n@mixin pfe-print-local($map: $LOCAL-VARIABLES) {\n @each $property, $value in $map {\n $name: \"--#{$property}\";\n $styles: $value;\n\n @if type-of($value) == \"map\" {\n @each $prop, $v in $value {\n $name: \"__#{$property}--#{$prop}\";\n $styles: $v;\n\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n } @else {\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n }\n}\n\n/// Surface properties\n/// This mixin creates an attribute for all the surface colors, then prints the local background color variable for the component, with the correct context colors.\n/// @param {List | String} $surfaces [$SURFACES] - defaults to the global $SURFACES list of all supported colors\n/// @param {String} $attr-name [pfe-var] - defaults to pfe-var, optionally pass in a custom name for the data attribute\n/// @example - scss - In your component stylesheet\n/// $LOCAL: band;\n/// @include pfe-surfaces;\n/// @example - css - Rendered result\n/// :host([color=\"darker\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darker, #464646);\n/// --context: dark;\n/// }\n/// :host([color=\"darkest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darkest, #131313);\n/// --context: dark;\n/// }\n/// :host([color=\"base\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--base, #dfdfdf);\n/// --context: light;\n/// }\n/// :host([color=\"lighter\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lighter, #ececec);\n/// --context: light;\n/// }\n/// :host([color=\"lightest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n/// --context: light;\n/// }\n/// :host([color=\"accent\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--accent, #ee0000);\n/// --context: saturated;\n/// }\n/// :host([color=\"complement\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--complement, #0477a4);\n/// --context: saturated;\n/// }\n@mixin pfe-surfaces($surfaces: $SURFACE, $attr-name: color) {\n @each $color in $surfaces {\n $context: #{pfe-get-context(surface--#{$color}--context)};\n :host([#{$attr-name}=\"#{$color}\"]) {\n @include pfe-print-local(\n (\n BackgroundColor: pfe-var(surface--#{$color}),\n context: pfe-var(surface--#{$color}--context, #{$context})\n )\n );\n @extend %fallback-surface;\n }\n }\n}\n\n/// Prints the `on` attribute with IE11 fallbacks\n/// @param {List} contexts [$CONTEXTS] - defaults to the global $CONTEXTS list of all supported contexts\n/// @param {Boolean} ie-fallback [true] - defaults to true, prints IE11 fallbacks\n/// @example - scss - In your component styles\n/// @include pfe-contexts; // imports on=\"light\" etc support\n/// @example - css - Rendered outputs\n/// :host([on=\"dark\"]) {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n/// @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n/// :host([on=\"dark\"]) {\n/// color: #fff;\n/// color: var(--pfe-theme--color--text--on-dark, #fff);\n/// }\n/// }\n/// // ...as well as all the values for :host([on=\"saturated\"]) and :host([on=\"light\"])\n@mixin pfe-contexts($contexts: $CONTEXTS, $ie-fallback: true) {\n // Helper attributes to aid in theming\n @each $context in $contexts {\n :host([on=\"#{$context}\"]) {\n @include pfe-set-broadcast-context($context);\n }\n }\n @if $ie-fallback {\n :host {\n @extend %fallback-text;\n }\n }\n}\n","////\n/// Accordion-specific SASS Vars\n/// @group accordion\n////\n\n@function pfe-accordion-variables($state: default, $context: default, $variant: default) {\n // Shared variables for all contexts\n $accordion-styles: ();\n\n @if $state != expanded { // Default state\n // Shared variables for all contexts\n $accordion-styles: (\n BorderColor--accent: transparent,\n BorderColor: pfe-var(surface--border),\n BorderTopWidth: pfe-var(surface--border-width),\n BorderRightWidth: 0,\n BorderBottomWidth: pfe-var(surface--border-width),\n BorderLeftWidth: pfe-var(surface--border-width--heavy),\n Color: pfe-broadcasted(text),\n TextAlign: left,\n accent: pfe-var(ui-accent),\n base: (\n Padding: pfe-var(container-spacer)\n )\n );\n\n @if $context == dark { // Dark context\n $accordion-styles: (\n accent: pfe-var(ui-accent--on-dark)\n );\n }\n @else if $context == saturated { // Saturated context\n $accordion-styles: (\n accent: pfe-var(ui-accent--on-saturated)\n );\n }\n\n @if $variant == disclosure {\n $accordion-styles: (\n BorderRightWidth: pfe-var(surface--border-width),\n BorderLeftWidth: pfe-var(surface--border-width),\n BorderColor--accent: pfe-var(surface--border)\n );\n }\n }\n @else { // Expanded state\n // Shared variables for all contexts\n $accordion-styles: (\n BorderColor: pfe-var(surface--border),\n BorderRightWidth: pfe-var(surface--border-width),\n BorderLeftWidth: pfe-var(surface--border-width--heavy),\n // Defaults for light context\n BackgroundColor: rgba(255, 255, 255, 1),\n Color: pfe-var(text),\n BorderColor--accent: pfe-local(accent),\n BoxShadow: 0 5px pfe-var(surface--border-width--heavy) rgba(140, 140, 140, 0.35),\n ZIndex: 3\n );\n\n @if $context == dark { // Dark context\n $accordion-styles: (\n BackgroundColor: rgba(247, 247, 249, .1),\n Color: pfe-broadcasted(text),\n BorderColor--accent: pfe-var(ui-accent--on-dark),\n BoxShadow: none\n );\n }\n @else if $context == saturated { // Saturated context\n $accordion-styles: (\n BackgroundColor: rgba(0, 0, 0, 0.2),\n Color: pfe-broadcasted(text),\n BorderColor--accent: pfe-var(ui-accent--on-saturated),\n BoxShadow: none\n );\n }\n \n @if $variant == disclosure {\n $accordion-styles: (\n BorderLeftWidth: pfe-var(surface--border-width--heavy),\n BorderColor--accent: pfe-var(ui-accent)\n );\n }\n }\n\n @return $accordion-styles;\n}\n\n@mixin pfe-accordion-props($variant: default) {\n margin: 0;\n width: pfe-local(Width, 100%);\n max-width: calc(100% - #{pfe-var(surface--border-width--heavy)});\n height: auto;\n position: relative;\n\n // Since the default bg color is transparent, look to broadcast values\n background-color: pfe-local(BackgroundColor, transparent);\n color: pfe-local(Color);\n\n // Border settings\n border-width: 0;\n border-style: pfe-var(surface--border-style);\n border-color: pfe-local(BorderColor);\n border-top-width: pfe-local(BorderTopWidth, $fallback: pfe-var(surface--border-width));\n border-right-width: pfe-local(BorderRightWidth, $fallback: 0);\n border-bottom-width: pfe-local(BorderBottomWidth, $fallback: pfe-var(surface--border-width));\n border-left-width: pfe-local(BorderLeftWidth, $fallback: pfe-var(surface--border-width--heavy));\n\n @include browser-query(ie11) {\n border-top-width: pfe-fetch(surface--border-width);\n border-right-width: 0;\n border-bottom-width: pfe-fetch(surface--border-width);\n border-left-width: pfe-fetch(surface--border-width--heavy);\n }\n\n // Custom border color for the accent mark on the left\n border-left-color: pfe-local(BorderColor--accent);\n\n box-shadow: pfe-local(BoxShadow);\n z-index: pfe-local(ZIndex);\n\n &:hover,\n &:focus {\n @include pfe-print-local((\n BorderColor--accent: pfe-local(accent)\n ));\n\n @include browser-query(ie11) {\n border-left-color: pfe-fetch(ui-accent);\n }\n }\n}\n\n//-- Trigger-specific properties\n@mixin pfe-trigger {\n $chevron--spacing: 50px;\n\n $LOCAL-VARIABLES: (\n BorderBottomWidth: 0,\n ZIndex: 3,\n trigger: (\n Padding: pfe-local(Padding, $region: base) $chevron--spacing pfe-local(Padding, $region: base) calc(#{pfe-local(Padding, $region: base)} * 1.5)\n )\n );\n\n @include pfe-print-local($LOCAL-VARIABLES);\n @include pfe-accordion-props;\n\n // -webkit-appearance: button;\n cursor: pointer;\n\n font-family: inherit;\n font-size: pfe-local(FontSize--header, calc(#{pfe-var(font-size)} * 1.1));\n font-weight: pfe-var(font-weight--bold);\n text-align: pfe-local(TextAlign, left);\n line-height: pfe-var(line-height);\n padding: pfe-local(Padding, $region: trigger);\n\n &:hover {\n outline: none;\n border-left-width: pfe-var(surface--border-width--heavy);\n }\n\n &:focus {\n outline: none;\n text-decoration: underline;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n}\n\n@mixin pfe-trigger-last($context: light) {\n @include pfe-print-local((\n BorderBottomWidth: pfe-var(surface--border-width)\n ));\n}\n\n//-- Panel-specific properties\n@mixin pfe-panel-variables($context: light) {\n $LOCAL-VARIABLES: (\n accent: pfe-var(ui-accent),\n BorderTopWidth: 0\n );\n\n @if $context == \"light\" { // Light context\n $LOCAL-VARIABLES: map-deep-merge($LOCAL-VARIABLES, (\n BoxShadow: 0 5px pfe-var(surface--border-width--heavy) rgba(140, 140, 140, 0.35)\n ));\n }\n @else {\n $LOCAL-VARIABLES: map-deep-merge($LOCAL-VARIABLES, (\n BoxShadow: none\n ));\n }\n\n @include pfe-print-local($LOCAL-VARIABLES);\n}\n\n@mixin pfe-panel-container() {\n // Ensure the box shadow does not propagate to nest accordions\n @include pfe-print-local( ( BoxShadow: none ) );\n\n @extend %container;\n padding: pfe-local(Padding, $region: panel-container);\n}\n\n/// ===========================================================================\n/// Accordion chevrons\n/// ===========================================================================\n\n@mixin pfe-chevron($state: open, $position: after, $size: .4em, $offset: $size) {\n\n content: \"\";\n position: absolute;\n top: calc(#{pfe-var(container-spacer)} + #{$offset});\n\n display: block;\n border-style: pfe-var(surface--border-style);\n height: $size;\n width: $size;\n transition: transform 0.15s;\n @if $state == open {\n border-width: .1em .1em 0 0;\n border-bottom: 0;\n transform: rotate(-45deg);\n top: calc(#{pfe-var(container-spacer)} + #{$offset});\n @if $position == before {\n left: calc(#{pfe-var(container-spacer)} * 1.3125); // 21px\n top: calc(#{pfe-var(container-spacer)} + .25em);\n transform: rotate(135deg);\n }\n @else {\n right: calc(#{pfe-var(container-spacer)} * 1.3125);\n }\n }\n @else {\n border-width: 0 .1em .1em 0;\n transform: rotate(45deg);\n @if $position == before {\n left: calc(#{pfe-var(container-spacer)} * 1.3125);\n transform: rotate(-45deg);\n }\n @else {\n right: calc(#{pfe-var(container-spacer)} * 1.3125);\n }\n }\n}","@import \"@patternfly/patternfly/sass-utilities/scss-variables\";\n\n////\n/// @group maps\n/// @type Map\n////\n\n/// Variables for typography, spacing, sizing\n$pfe-vars: (\n\n container-spacer: pf-font-prem($pf-spacer), // 16px\n container-padding: pf-font-prem($pf-spacer), // 16px\n content-spacer: pf-font-prem($pf-spacer-sm), // 24px\n\n content-spacer--heading--lg: pf-font-prem($pf-spacer-md), // 32px \n content-spacer--heading--md: pf-font-prem($pf-spacer-sm), // 24px \n content-spacer--heading--sm: pf-font-prem($pf-spacer), // 16px\n content-spacer--body--md: pf-font-prem($pf-spacer), // 16px\n content-spacer--body--sm: pf-font-prem($pf-spacer-xs), // 8px\n\n surface--border-width: 1px, //\n surface--border-width--heavy: 4px, //\n surface--border-style: solid, //\n surface--border-radius: 3px, //\n surface--border-width--active: 3px, //\n\n icon-size: 1em, //\n\n ui--element--size: 20px, //\n ui--indent: 20px, //\n ui--border-width--sm: 1px, //\n ui--border-width--md: 2px, //\n ui--border-width--lg: 3px, //\n\n ui--border-width: 1px, //\n ui--border-width--active: 3px, //\n \n ui--border-style: solid, //\n ui--border-radius: 2px, //\n\n ui--focus-outline-width: 1px, //\n ui--focus-outline-style: solid, //\n\n grid-breakpoint--xs: 0, //\n grid-breakpoint--sm: 576px, //\n grid-breakpoint--md: 768px, //\n grid-breakpoint--lg: 992px, //\n grid-breakpoint--xl: 1200px, //\n\n box-shadow--sm: #{0 #{pfe-size-prem(1)} #{pfe-size-prem(2)} 0 rgba($pf-color-black-1000, .2)}, //\n box-shadow--md: #{0 #{pfe-size-prem(2)} #{pfe-size-prem(1)} #{pfe-size-prem(1)} rgba($pf-color-black-1000, .12), 0 #{pfe-size-prem(4)} #{pfe-size-prem(11)} #{pfe-size-prem(6)} rgba($pf-color-black-1000, .05)}, //\n box-shadow--lg: #{0 #{pfe-size-prem(3)} #{pfe-size-prem(7)} #{pfe-size-prem(3)} rgba($pf-color-black-1000, .13), 0 #{pfe-size-prem(11)} #{pfe-size-prem(24)} #{pfe-size-prem(16)} rgba($pf-color-black-1000, .12)}, //\n box-shadow--inset: #{inset 0 0 #{pfe-size-prem(10)} 0 $pf-color-black-100}, //\n\n animation-speed: .3s, //\n animation-timing: cubic-bezier(0.465, 0.183, 0.153, 0.946), //\n opacity: .09 //\n);","// Colors\n$pf-color-black-100: #fafafa !default;\n$pf-color-black-150: #f5f5f5 !default;\n$pf-color-black-200: #f0f0f0 !default;\n$pf-color-black-300: #d2d2d2 !default;\n$pf-color-black-400: #b8bbbe !default;\n$pf-color-black-500: #8a8d90 !default;\n$pf-color-black-600: #6a6e73 !default;\n$pf-color-black-700: #4f5255 !default;\n$pf-color-black-800: #3c3f42 !default;\n$pf-color-black-850: #212427 !default;\n$pf-color-black-900: #151515 !default;\n$pf-color-black-1000: #030303 !default;\n$pf-color-blue-50: #e7f1fa !default;\n$pf-color-blue-100: #bee1f4 !default;\n$pf-color-blue-200: #73bcf7 !default;\n$pf-color-blue-300: #2b9af3 !default;\n$pf-color-blue-400: #06c !default;\n$pf-color-blue-500: #004080 !default;\n$pf-color-blue-600: #002952 !default;\n$pf-color-blue-700: #001223 !default;\n$pf-color-cyan-50: #f2f9f9 !default;\n$pf-color-cyan-100: #a2d9d9 !default;\n$pf-color-cyan-200: #73c5c5 !default;\n$pf-color-cyan-300: #009596 !default;\n$pf-color-cyan-400: #005f60 !default;\n$pf-color-cyan-500: #003737 !default;\n$pf-color-cyan-600: #002323 !default;\n$pf-color-cyan-700: #000f0f !default;\n$pf-color-gold-50: #fdf7e7 !default;\n$pf-color-gold-100: #f9e0a2 !default;\n$pf-color-gold-200: #f6d173 !default;\n$pf-color-gold-300: #f4c145 !default;\n$pf-color-gold-400: #f0ab00 !default;\n$pf-color-gold-500: #c58c00 !default;\n$pf-color-gold-600: #795600 !default;\n$pf-color-gold-700: #3d2c00 !default;\n$pf-color-green-50: #f3faf2 !default;\n$pf-color-green-100: #bde5b8 !default;\n$pf-color-green-200: #95d58e !default;\n$pf-color-green-300: #6ec664 !default;\n$pf-color-green-400: #5ba352 !default;\n$pf-color-green-500: #3e8635 !default;\n$pf-color-green-600: #1e4f18 !default;\n$pf-color-green-700: #0f280d !default;\n$pf-color-light-blue-100: #beedf9 !default;\n$pf-color-light-blue-200: #7cdbf3 !default;\n$pf-color-light-blue-300: #35caed !default;\n$pf-color-light-blue-400: #00b9e4 !default;\n$pf-color-light-blue-500: #008bad !default;\n$pf-color-light-blue-600: #005c73 !default;\n$pf-color-light-blue-700: #002d39 !default;\n$pf-color-light-green-100: #e4f5bc !default;\n$pf-color-light-green-200: #c8eb79 !default;\n$pf-color-light-green-300: #ace12e !default;\n$pf-color-light-green-400: #92d400 !default;\n$pf-color-light-green-500: #6ca100 !default;\n$pf-color-light-green-600: #486b00 !default;\n$pf-color-light-green-700: #253600 !default;\n$pf-color-orange-100: #f4b678 !default;\n$pf-color-orange-200: #ef9234 !default;\n$pf-color-orange-300: #ec7a08 !default;\n$pf-color-orange-400: #c46100 !default;\n$pf-color-orange-500: #8f4700 !default;\n$pf-color-orange-600: #773d00 !default;\n$pf-color-orange-700: #3b1f00 !default;\n$pf-color-purple-50: #f2f0fc !default;\n$pf-color-purple-100: #cbc1ff !default;\n$pf-color-purple-200: #b2a3ff !default;\n$pf-color-purple-300: #a18fff !default;\n$pf-color-purple-400: #8476d1 !default;\n$pf-color-purple-500: #6753ac !default;\n$pf-color-purple-600: #40199a !default;\n$pf-color-purple-700: #1f0066 !default;\n$pf-color-red-50: #faeae8 !default;\n$pf-color-red-100: #c9190b !default;\n$pf-color-red-200: #a30000 !default;\n$pf-color-red-300: #7d1007 !default;\n$pf-color-red-400: #470000 !default;\n$pf-color-red-500: #2c0000 !default;\n$pf-color-white: #fff !default;\n"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-accordion/dist/pfe-accordion-header.min.css.map b/elements/pfe-accordion/dist/pfe-accordion-header.min.css.map new file mode 100644 index 0000000000..a6d08729e4 --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion-header.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/pfe-accordion-header.scss","../../../pfe-sass/mixins/_mixins.scss","../../../pfe-sass/mixins/_custom-properties.scss","../../../pfe-sass/mixins/_components.scss"],"names":[],"mappings":"AAKA,MAGE,mBAAA,kBAAA,IAAA,kCAAA,WAAA,kBAAA,IAAA,kCAAA,WAAA,UAAA,IAAA,kCAAA,WAAA,UAAA,IAAA,iCAAA,CAAA,kBAAA,IAAA,kCAAA,mBAAA,kBAAA,IAAA,qEAAA,WAAA,kBAAA,IAAA,qEAAA,WAAA,UAAA,IAAA,qEAAA,WAAA,UAAA,IAAA,oEAAA,CAAA,kBAAA,IAAA,qEACA,QAAA,MCyEQ,gBACN,QAAA,KD9EJ,QAQI,OAAA,EARJ,aE+FM,mCAAA,EAAA,wBAAA,EAJE,kCAAA,8EAAA,KAAA,8EAAA,0FCRN,OAAA,EACA,MAAA,KAAA,MAAA,iCACA,UAAA,iBAAA,UAAA,gEACA,OAAA,KACA,SAAA,SAGA,iBAAA,YAAA,iBAAA,kDACA,MAAA,QAAA,MAAA,iEAGA,aAAA,EACA,aAAA,MAAA,aAAA,8CACA,aAAA,QAAA,aAAA,mFACA,iBAAA,IAAA,iBAAA,iFACA,mBAAA,EAAA,mBAAA,yCACA,oBAAA,IAAA,oBAAA,oFACA,kBAAA,IAAA,kBAAA,yFAUA,kBAAA,YAAA,kBAAA,sDAEA,mBAAA,gCAAA,WAAA,gCACA,QAAA,6BA8BA,OAAA,QAEA,YAAA,QACA,UAAA,iBAAA,UAAA,oFACA,YAAA,IAAA,YAAA,wCACA,WAAA,KAAA,WAAA,qCACA,YAAA,IAAA,YAAA,kCACA,QAAA,uCFxJI,6CAAA,oCDEN,aGuGI,iBAAA,IACA,mBAAA,EACA,oBAAA,IACA,kBAAA,KH1GJ,mBAAA,mBE+FM,qCAAA,uEDjGA,6CAAA,oCDEN,mBAAA,mBG0HM,kBAAA,MH1HN,mBGyJI,QAAA,EACA,kBAAA,IAAA,kBAAA,mD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AA,UAAA,cAEE,KAAA,oBAAA,KAAA,uDACA,kBAAA,eAAA,UAAA,eHnKN,4DAeM,kBAAA,cAAA,UAAA,cAfN,gEAAA,oDAoBM,aAAA,2BAAA,aAAA,yLApBN,wEAAA,4DAsBQ,YAAA,uBAAA,YAAA","file":"pfe-accordion-header.min.css","sourceRoot":"../src","sourcesContent":[]} \ No newline at end of file diff --git a/elements/pfe-accordion/dist/pfe-accordion-panel.css.map b/elements/pfe-accordion/dist/pfe-accordion-panel.css.map new file mode 100644 index 0000000000..ef24dd7763 --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion-panel.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-accordion-panel.scss","../../pfe-sass/extends/_extends.scss","../../pfe-sass/functions/_custom-properties.scss","pfe-accordion-panel.css","../../pfe-sass/mixins/_containers.scss","../../pfe-sass/mixins/_components.scss","../../pfe-sass/mixins/_mixins.scss","../../pfe-sass/maps/_general.scss","../../pfe-sass/mixins/_custom-properties.scss","../../../node_modules/@patternfly/patternfly/sass-utilities/colors.scss"],"names":[],"mappings":"AAkBA;ECQE,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,aCQkC;EDRlC,iDCQkC;AChCpC;;AHCA;EI2BI,aAAa;EACb,gBAAgB;EAChB,mBAAmB;EACnB,yBAAyB;EACzB,UAAU;ECmDZ,SAAS;EACT,WHVkC;EGUlC,wCHVkC;EGWlC,2BAAgE;EAAhE,2EAAgE;EAChE,YAAY;EACZ,kBAAkB;EAGlB,6BHhBkC;EGgBlC,oEHhBkC;EGiBlC,cHjBkC;EGiBlC,yEHjBkC;EGoBlC,eAAe;EACf,mBH/DkC;EG+DlC,4DH/DkC;EGgElC,qBHtBkC;EGsBlC,kGHtBkC;EGuBlC,qBHvBkC;EGuBlC,oGHvBkC;EGwBlC,qBHxBkC;EGwBlC,6DHxBkC;EGyBlC,wBHzBkC;EGyBlC,0GHzBkC;EG0BlC,sBH1BkC;EG0BlC,6GH1BkC;EGoClC,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["@import \"shared-assets\";\n\n/// ===========================================================================\n/// DEFAULT ACCORDION PANEL\n/// ===========================================================================\n\n:host {\n @include pfe-collapsible($state: closed);\n @include pfe-accordion-props;\n @include pfe-box-sizing;\n box-sizing: border-box;\n}\n\n:host(.animating) {\n display: block;\n transition: height 0.3s ease-in-out;\n}\n\n.container {\n @include pfe-clearfix;\n @include pfe-panel-container;\n --pfe-accordion__panel-container--Padding: 0 calc(#{pfe-local(Padding, $region: base)} * 3) #{pfe-local(Padding, $region: base)} calc(#{pfe-local(Padding, $region: base)} * 1.5);\n\n :host([disclosure=\"true\"]) & {\n --pfe-accordion__panel-container--Padding: 0 calc(#{pfe-local(Padding, $region: base)} * 1.5);\n }\n}\n\n:host(:last-of-type[expanded]) {\n margin-bottom: 0;\n}\n\n/// ===========================================================================\n/// EXPANDED STYLES\n/// ===========================================================================\n\n:host([expanded]),\n:host(.animating) {\n @include pfe-print-local(pfe-accordion-variables($state: expanded));\n @include pfe-panel-variables;\n @include pfe-collapsible($state: open);\n @include browser-query(ie11) {\n border-top-width: 0;\n border-left-color: pfe-var(ui-accent);\n border-right-color: pfe-var(surface--border);\n }\n}\n\n:host([on=\"dark\"][expanded]),\n:host([on=\"dark\"].animating){\n @include pfe-print-local(pfe-accordion-variables($state: expanded, $context: dark));\n @include pfe-panel-variables($context: dark);\n}\n\n:host([on=\"saturated\"][expanded]),\n:host([on=\"saturated\"].animating){\n @include pfe-print-local(pfe-accordion-variables($state: expanded, $context: saturated));\n @include pfe-panel-variables($context: saturated);\n}\n","// @todo Change to mixins; no efficiency gain with placeholders in web components\n\n/// Clear box element styles\n%reset-box {\n margin: 0;\n padding: 0;\n}\n\n/// Clear list styles\n%reset-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/// Clear button styles\n%reset-button {\n background-color: transparent;\n border: none;\n margin: 0;\n padding: 0;\n text-align: left;\n}\n\n/// Set up a container element\n%container {\n position: relative;\n display: block;\n width: 100%;\n padding: pfe-var(container-spacer);\n}\n\n/// Screen-reader only content\n%sr-only {\n position: absolute;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n}\n\n/// Fallback surface styles for IE11 only\n%fallback-surface {\n @include browser-query(ie11) {\n background-color: pfe-fetch(surface--lightest) !important;\n color: pfe-fetch(text) !important;\n }\n}\n\n/// Fallback text styles for IE11 only\n%fallback-text {\n @include browser-query(ie11) {\n color: pfe-fetch(text) !important;\n }\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}",".container {\n position: relative;\n display: block;\n width: 100%;\n padding: var(--pfe-theme--container-spacer, 1rem);\n}\n\n:host {\n display: none;\n overflow: hidden;\n will-change: height;\n border-color: transparent;\n opacity: 0;\n margin: 0;\n width: var(--pfe-accordion--Width, 100%);\n max-width: calc(100% - var(--pfe-theme--surface--border-width--heavy, 4px));\n height: auto;\n position: relative;\n background-color: var(--pfe-accordion--BackgroundColor, transparent);\n color: var(--pfe-accordion--Color, var(--pfe-broadcasted--text, #3c3f42));\n border-width: 0;\n border-style: var(--pfe-theme--surface--border-style, solid);\n border-color: var(--pfe-accordion--BorderColor, var(--pfe-theme--color--surface--border, #d2d2d2));\n border-top-width: var(--pfe-accordion--BorderTopWidth, var(--pfe-theme--surface--border-width, 1px));\n border-right-width: var(--pfe-accordion--BorderRightWidth, 0);\n border-bottom-width: var(--pfe-accordion--BorderBottomWidth, var(--pfe-theme--surface--border-width, 1px));\n border-left-width: var(--pfe-accordion--BorderLeftWidth, var(--pfe-theme--surface--border-width--heavy, 4px));\n border-left-color: var(--pfe-accordion--BorderColor--accent, transparent);\n box-shadow: var(--pfe-accordion--BoxShadow);\n z-index: var(--pfe-accordion--ZIndex);\n box-sizing: border-box;\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n border-top-width: 1px;\n border-right-width: 0;\n border-bottom-width: 1px;\n border-left-width: 4px;\n }\n}\n\n:host:hover, :host:focus {\n --pfe-accordion--BorderColor--accent: var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host:hover, :host:focus {\n /* IE10+ */\n border-left-color: #06c;\n }\n}\n\n:host *,\n:host *::before,\n:host *::after {\n box-sizing: border-box;\n}\n\n:host(.animating) {\n display: block;\n transition: height 0.3s ease-in-out;\n}\n\n.container {\n --pfe-accordion--BoxShadow: none;\n padding: var(--pfe-accordion__panel-container--Padding);\n --pfe-accordion__panel-container--Padding: 0 calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 3) var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 1.5);\n}\n\n.container::after {\n clear: both;\n content: \"\";\n display: table;\n}\n\n:host([disclosure=\"true\"]) .container {\n --pfe-accordion__panel-container--Padding: 0 calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 1.5);\n}\n\n:host(:last-of-type[expanded]) {\n margin-bottom: 0;\n}\n\n:host([expanded]),\n:host(.animating) {\n --pfe-accordion--BorderColor: var(--pfe-theme--color--surface--border, #d2d2d2);\n --pfe-accordion--BorderRightWidth: var(--pfe-theme--surface--border-width, 1px);\n --pfe-accordion--BorderLeftWidth: var(--pfe-theme--surface--border-width--heavy, 4px);\n --pfe-accordion--BackgroundColor: white;\n --pfe-accordion--Color: var(--pfe-theme--color--text, #151515);\n --pfe-accordion--BorderColor--accent: var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));\n --pfe-accordion--BoxShadow: 0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);\n --pfe-accordion--ZIndex: 3;\n --pfe-accordion--accent: var(--pfe-theme--color--ui-accent, #06c);\n --pfe-accordion--BorderTopWidth: 0;\n --pfe-accordion--BoxShadow: 0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);\n display: block;\n position: relative;\n opacity: 1;\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host([expanded]),\n :host(.animating) {\n /* IE10+ */\n border-top-width: 0;\n border-left-color: var(--pfe-theme--color--ui-accent, #06c);\n border-right-color: var(--pfe-theme--color--surface--border, #d2d2d2);\n }\n}\n\n:host([on=\"dark\"][expanded]),\n:host([on=\"dark\"].animating) {\n --pfe-accordion--BackgroundColor: rgba(247, 247, 249, 0.1);\n --pfe-accordion--Color: var(--pfe-broadcasted--text, #3c3f42);\n --pfe-accordion--BorderColor--accent: var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);\n --pfe-accordion--BoxShadow: none;\n --pfe-accordion--accent: var(--pfe-theme--color--ui-accent, #06c);\n --pfe-accordion--BorderTopWidth: 0;\n --pfe-accordion--BoxShadow: none;\n}\n\n:host([on=\"saturated\"][expanded]),\n:host([on=\"saturated\"].animating) {\n --pfe-accordion--BackgroundColor: rgba(0, 0, 0, 0.2);\n --pfe-accordion--Color: var(--pfe-broadcasted--text, #3c3f42);\n --pfe-accordion--BorderColor--accent: var(--pfe-theme--color--ui-accent--on-saturated, #fff);\n --pfe-accordion--BoxShadow: none;\n --pfe-accordion--accent: var(--pfe-theme--color--ui-accent, #06c);\n --pfe-accordion--BorderTopWidth: 0;\n --pfe-accordion--BoxShadow: none;\n}\n","// $boxSize = any box-sizing property, default is border-box\n@mixin pfe-box-sizing($boxSize: border-box) {\n *,\n *::before,\n *::after {\n box-sizing: $boxSize;\n }\n}\n\n@mixin pfe-clearfix {\n &::after {\n clear: both;\n content: \"\";\n display: table;\n }\n}\n\n@mixin pfe-container {\n @extend %container;\n\n padding: calc(#{pfe-local(Padding--vertical)} / 2) #{pfe-local(Padding--horizontal)};\n\n @media (min-width: pfe-breakpoint(sm)) {\n padding: pfe-local(Padding);\n }\n}\n\n@mixin pfe-collapsible($state: closed) {\n @if $state != closed {\n display: block;\n position: relative;\n opacity: 1;\n } @else {\n display: none;\n overflow: hidden;\n will-change: height;\n border-color: transparent;\n opacity: 0;\n }\n}\n","////\n/// Accordion-specific SASS Vars\n/// @group accordion\n////\n\n@function pfe-accordion-variables($state: default, $context: default, $variant: default) {\n // Shared variables for all contexts\n $accordion-styles: ();\n\n @if $state != expanded { // Default state\n // Shared variables for all contexts\n $accordion-styles: (\n BorderColor--accent: transparent,\n BorderColor: pfe-var(surface--border),\n BorderTopWidth: pfe-var(surface--border-width),\n BorderRightWidth: 0,\n BorderBottomWidth: pfe-var(surface--border-width),\n BorderLeftWidth: pfe-var(surface--border-width--heavy),\n Color: pfe-broadcasted(text),\n TextAlign: left,\n accent: pfe-var(ui-accent),\n base: (\n Padding: pfe-var(container-spacer)\n )\n );\n\n @if $context == dark { // Dark context\n $accordion-styles: (\n accent: pfe-var(ui-accent--on-dark)\n );\n }\n @else if $context == saturated { // Saturated context\n $accordion-styles: (\n accent: pfe-var(ui-accent--on-saturated)\n );\n }\n\n @if $variant == disclosure {\n $accordion-styles: (\n BorderRightWidth: pfe-var(surface--border-width),\n BorderLeftWidth: pfe-var(surface--border-width),\n BorderColor--accent: pfe-var(surface--border)\n );\n }\n }\n @else { // Expanded state\n // Shared variables for all contexts\n $accordion-styles: (\n BorderColor: pfe-var(surface--border),\n BorderRightWidth: pfe-var(surface--border-width),\n BorderLeftWidth: pfe-var(surface--border-width--heavy),\n // Defaults for light context\n BackgroundColor: rgba(255, 255, 255, 1),\n Color: pfe-var(text),\n BorderColor--accent: pfe-local(accent),\n BoxShadow: 0 5px pfe-var(surface--border-width--heavy) rgba(140, 140, 140, 0.35),\n ZIndex: 3\n );\n\n @if $context == dark { // Dark context\n $accordion-styles: (\n BackgroundColor: rgba(247, 247, 249, .1),\n Color: pfe-broadcasted(text),\n BorderColor--accent: pfe-var(ui-accent--on-dark),\n BoxShadow: none\n );\n }\n @else if $context == saturated { // Saturated context\n $accordion-styles: (\n BackgroundColor: rgba(0, 0, 0, 0.2),\n Color: pfe-broadcasted(text),\n BorderColor--accent: pfe-var(ui-accent--on-saturated),\n BoxShadow: none\n );\n }\n \n @if $variant == disclosure {\n $accordion-styles: (\n BorderLeftWidth: pfe-var(surface--border-width--heavy),\n BorderColor--accent: pfe-var(ui-accent)\n );\n }\n }\n\n @return $accordion-styles;\n}\n\n@mixin pfe-accordion-props($variant: default) {\n margin: 0;\n width: pfe-local(Width, 100%);\n max-width: calc(100% - #{pfe-var(surface--border-width--heavy)});\n height: auto;\n position: relative;\n\n // Since the default bg color is transparent, look to broadcast values\n background-color: pfe-local(BackgroundColor, transparent);\n color: pfe-local(Color);\n\n // Border settings\n border-width: 0;\n border-style: pfe-var(surface--border-style);\n border-color: pfe-local(BorderColor);\n border-top-width: pfe-local(BorderTopWidth, $fallback: pfe-var(surface--border-width));\n border-right-width: pfe-local(BorderRightWidth, $fallback: 0);\n border-bottom-width: pfe-local(BorderBottomWidth, $fallback: pfe-var(surface--border-width));\n border-left-width: pfe-local(BorderLeftWidth, $fallback: pfe-var(surface--border-width--heavy));\n\n @include browser-query(ie11) {\n border-top-width: pfe-fetch(surface--border-width);\n border-right-width: 0;\n border-bottom-width: pfe-fetch(surface--border-width);\n border-left-width: pfe-fetch(surface--border-width--heavy);\n }\n\n // Custom border color for the accent mark on the left\n border-left-color: pfe-local(BorderColor--accent);\n\n box-shadow: pfe-local(BoxShadow);\n z-index: pfe-local(ZIndex);\n\n &:hover,\n &:focus {\n @include pfe-print-local((\n BorderColor--accent: pfe-local(accent)\n ));\n\n @include browser-query(ie11) {\n border-left-color: pfe-fetch(ui-accent);\n }\n }\n}\n\n//-- Trigger-specific properties\n@mixin pfe-trigger {\n $chevron--spacing: 50px;\n\n $LOCAL-VARIABLES: (\n BorderBottomWidth: 0,\n ZIndex: 3,\n trigger: (\n Padding: pfe-local(Padding, $region: base) $chevron--spacing pfe-local(Padding, $region: base) calc(#{pfe-local(Padding, $region: base)} * 1.5)\n )\n );\n\n @include pfe-print-local($LOCAL-VARIABLES);\n @include pfe-accordion-props;\n\n // -webkit-appearance: button;\n cursor: pointer;\n\n font-family: inherit;\n font-size: pfe-local(FontSize--header, calc(#{pfe-var(font-size)} * 1.1));\n font-weight: pfe-var(font-weight--bold);\n text-align: pfe-local(TextAlign, left);\n line-height: pfe-var(line-height);\n padding: pfe-local(Padding, $region: trigger);\n\n &:hover {\n outline: none;\n border-left-width: pfe-var(surface--border-width--heavy);\n }\n\n &:focus {\n outline: none;\n text-decoration: underline;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n}\n\n@mixin pfe-trigger-last($context: light) {\n @include pfe-print-local((\n BorderBottomWidth: pfe-var(surface--border-width)\n ));\n}\n\n//-- Panel-specific properties\n@mixin pfe-panel-variables($context: light) {\n $LOCAL-VARIABLES: (\n accent: pfe-var(ui-accent),\n BorderTopWidth: 0\n );\n\n @if $context == \"light\" { // Light context\n $LOCAL-VARIABLES: map-deep-merge($LOCAL-VARIABLES, (\n BoxShadow: 0 5px pfe-var(surface--border-width--heavy) rgba(140, 140, 140, 0.35)\n ));\n }\n @else {\n $LOCAL-VARIABLES: map-deep-merge($LOCAL-VARIABLES, (\n BoxShadow: none\n ));\n }\n\n @include pfe-print-local($LOCAL-VARIABLES);\n}\n\n@mixin pfe-panel-container() {\n // Ensure the box shadow does not propagate to nest accordions\n @include pfe-print-local( ( BoxShadow: none ) );\n\n @extend %container;\n padding: pfe-local(Padding, $region: panel-container);\n}\n\n/// ===========================================================================\n/// Accordion chevrons\n/// ===========================================================================\n\n@mixin pfe-chevron($state: open, $position: after, $size: .4em, $offset: $size) {\n\n content: \"\";\n position: absolute;\n top: calc(#{pfe-var(container-spacer)} + #{$offset});\n\n display: block;\n border-style: pfe-var(surface--border-style);\n height: $size;\n width: $size;\n transition: transform 0.15s;\n @if $state == open {\n border-width: .1em .1em 0 0;\n border-bottom: 0;\n transform: rotate(-45deg);\n top: calc(#{pfe-var(container-spacer)} + #{$offset});\n @if $position == before {\n left: calc(#{pfe-var(container-spacer)} * 1.3125); // 21px\n top: calc(#{pfe-var(container-spacer)} + .25em);\n transform: rotate(135deg);\n }\n @else {\n right: calc(#{pfe-var(container-spacer)} * 1.3125);\n }\n }\n @else {\n border-width: 0 .1em .1em 0;\n transform: rotate(45deg);\n @if $position == before {\n left: calc(#{pfe-var(container-spacer)} * 1.3125);\n transform: rotate(-45deg);\n }\n @else {\n right: calc(#{pfe-var(container-spacer)} * 1.3125);\n }\n }\n}","@mixin browser-query($browser-list) {\n @each $browser in $browser-list {\n @if $browser == ie11 {\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n @content;\n }\n }\n @if $browser == edge12 {\n @supports (-ms-accelerator: true) { /* Microsoft Edge Browser 12+ */\n @content;\n }\n }\n @if $browser == edge {\n @supports (-ms-ime-align: auto) { /* Microsoft Edge Browser 16+ (All) */\n @content;\n }\n }\n @if $browser == firefox {\n @media all and (min--moz-device-pixel-ratio:0) { /* Mozilla Firefox (All) */\n @content;\n }\n }\n }\n}\n\n@mixin pfe-transition($properties...) {\n $return: null;\n @each $property in $properties {\n @if length($property) == 1 {\n $return: append($return, #{$property} 250ms $pfe-global--animation-timing, comma);\n }\n @else if length($property) == 2 {\n $return: append($return, nth($property, 1) nth($property, 2), comma);\n }\n }\n transition: $return;\n}\n\n// Make a CSS arrow\n@mixin pfe-arrow($type, $color, $width: 8px, $height: 5px, $pseudo: false) {\n $direction: (\n up: 180deg,\n down: 0deg,\n right: -90deg,\n left: 90deg,\n );\n border-style: pfe-var(surface--border-style);\n border-width: $width $height 0;\n border-color: transparent;\n border-top-color: $color;\n transform: rotate(map-get($direction, $type));\n @if $pseudo {\n display: inline-block;\n content: \"\";\n @content;\n }\n}\n\n@mixin pfe-arrow-color($color) {\n border-top-color: $color;\n}\n\n@mixin pfe-print-media {\n @media print {\n @content;\n }\n}\n\n@mixin pfe-print-background {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n@mixin pfe-no-print-background {\n @include pfe-print-media {\n background-color: white !important;\n background-image: none !important;\n box-shadow: none !important;\n }\n}\n\n@mixin pfe-hidden {\n @at-root #{&}([hidden]) {\n display: none;\n }\n}\n\n@mixin pfe-pipe( $position: right, $padding: 0, $margin: 0, $color: $border-color) {\n border: pfe-var(surface--border-width) pfe-var(surface--border-style) transparent;\n border-#{$position}-color: $color;\n @if $position == right {\n padding-left: $padding;\n margin-right: $margin;\n }\n @else if $position == left {\n padding-right: $padding;\n margin-left: $margin;\n }\n}\n\n@mixin pfe-retina {\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n @content;\n }\n}\n\n@mixin pfe-icon($path, $display: flex, $size: 1em) {\n display: #{$display};\n @if $path {\n background: #{$path} no-repeat;\n background-size: contain;\n background-position: center;\n }\n width: #{$size};\n height: #{$size};\n @content;\n}\n\n@mixin pfe-local-debug($map: $LOCAL-VARIABLES) {\n :root {\n @include pfe-print-local($map);\n }\n} ","@import \"@patternfly/patternfly/sass-utilities/scss-variables\";\n\n////\n/// @group maps\n/// @type Map\n////\n\n/// Variables for typography, spacing, sizing\n$pfe-vars: (\n\n container-spacer: pf-font-prem($pf-spacer), // 16px\n container-padding: pf-font-prem($pf-spacer), // 16px\n content-spacer: pf-font-prem($pf-spacer-sm), // 24px\n\n content-spacer--heading--lg: pf-font-prem($pf-spacer-md), // 32px \n content-spacer--heading--md: pf-font-prem($pf-spacer-sm), // 24px \n content-spacer--heading--sm: pf-font-prem($pf-spacer), // 16px\n content-spacer--body--md: pf-font-prem($pf-spacer), // 16px\n content-spacer--body--sm: pf-font-prem($pf-spacer-xs), // 8px\n\n surface--border-width: 1px, //\n surface--border-width--heavy: 4px, //\n surface--border-style: solid, //\n surface--border-radius: 3px, //\n surface--border-width--active: 3px, //\n\n icon-size: 1em, //\n\n ui--element--size: 20px, //\n ui--indent: 20px, //\n ui--border-width--sm: 1px, //\n ui--border-width--md: 2px, //\n ui--border-width--lg: 3px, //\n\n ui--border-width: 1px, //\n ui--border-width--active: 3px, //\n \n ui--border-style: solid, //\n ui--border-radius: 2px, //\n\n ui--focus-outline-width: 1px, //\n ui--focus-outline-style: solid, //\n\n grid-breakpoint--xs: 0, //\n grid-breakpoint--sm: 576px, //\n grid-breakpoint--md: 768px, //\n grid-breakpoint--lg: 992px, //\n grid-breakpoint--xl: 1200px, //\n\n box-shadow--sm: #{0 #{pfe-size-prem(1)} #{pfe-size-prem(2)} 0 rgba($pf-color-black-1000, .2)}, //\n box-shadow--md: #{0 #{pfe-size-prem(2)} #{pfe-size-prem(1)} #{pfe-size-prem(1)} rgba($pf-color-black-1000, .12), 0 #{pfe-size-prem(4)} #{pfe-size-prem(11)} #{pfe-size-prem(6)} rgba($pf-color-black-1000, .05)}, //\n box-shadow--lg: #{0 #{pfe-size-prem(3)} #{pfe-size-prem(7)} #{pfe-size-prem(3)} rgba($pf-color-black-1000, .13), 0 #{pfe-size-prem(11)} #{pfe-size-prem(24)} #{pfe-size-prem(16)} rgba($pf-color-black-1000, .12)}, //\n box-shadow--inset: #{inset 0 0 #{pfe-size-prem(10)} 0 $pf-color-black-100}, //\n\n animation-speed: .3s, //\n animation-timing: cubic-bezier(0.465, 0.183, 0.153, 0.946), //\n opacity: .09 //\n);","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// This will print all the broadcast variables, and set the value to the context of your choosing, like on-dark or on-saturated.\n/// @param {String} $context - Look up values from contexts, i.e. \"light\" or \"saturated\"\n/// @param {List | String} $broadcast [$BROADCAST-VARS] - Optionally specify only one broadcast variable instead of the whole set, i.e. \"text\"\n/// @see $custom-prop-prefix\n/// @see $BROADCAST-VARS\n/// @example - scss - Usage in a container component, i.e. pfe-card\n/// :host {\n/// @include pfe-set-broadcast-context(dark);\n/// }\n/// @example - css - Rendered output\n/// :host {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n///\n@mixin pfe-set-broadcast-context($context, $broadcast: $BROADCAST-VARS) {\n @each $type in $broadcast {\n $list: ();\n $string: \"\";\n $context_string: \"\";\n $state: \"\";\n\n @if str-starts-with($type, \"link\") {\n $list: append($list, \"#{$type}\");\n\n @each $s in (hover, focus, visited) {\n $state: \"--#{$s}\";\n $string: \"#{$type}#{$state}\";\n\n @if not index($list, $string) {\n $list: append($list, \"#{$type}#{$state}\");\n }\n }\n } @else {\n @if not index($list, $string) {\n $list: append($list, \"#{$type}\");\n }\n }\n\n @if index($CONTEXTS, $context) != null {\n @if $context != \"light\" {\n $context_string: \"--on-#{$context}\";\n }\n }\n\n @each $item in $list {\n @if not index($BROADCAST-VARS, $type) {\n @warn \"--#{$custom-prop-prefix}-broadcasted--#{$item} variable is not in the $BROADCAST-VARS list.\";\n } @else if not pfe-broadcasted(#{$item}#{$context_string}) {\n @warn \"#{$item}#{$context_string} value does not currently exist.\";\n } @else {\n @if index($CONTEXTS, $context) != null {\n --#{$custom-prop-prefix}-broadcasted--#{$item}: #{pfe-var(#{$item}#{$context_string})};\n } @else {\n @error \"The #{$context} context does not appear to be part of a supported context.\";\n }\n }\n }\n }\n}\n\n/// Returns CSS Variable for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $value - The value of the css variable being defined\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example - scss\n/// :host {\n/// padding-top: pfe-local(paddingTop);\n/// padding-bottom: pfe-local(paddingBottom);\n/// }\n@mixin pfe-print-local($map: $LOCAL-VARIABLES) {\n @each $property, $value in $map {\n $name: \"--#{$property}\";\n $styles: $value;\n\n @if type-of($value) == \"map\" {\n @each $prop, $v in $value {\n $name: \"__#{$property}--#{$prop}\";\n $styles: $v;\n\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n } @else {\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n }\n}\n\n/// Surface properties\n/// This mixin creates an attribute for all the surface colors, then prints the local background color variable for the component, with the correct context colors.\n/// @param {List | String} $surfaces [$SURFACES] - defaults to the global $SURFACES list of all supported colors\n/// @param {String} $attr-name [pfe-var] - defaults to pfe-var, optionally pass in a custom name for the data attribute\n/// @example - scss - In your component stylesheet\n/// $LOCAL: band;\n/// @include pfe-surfaces;\n/// @example - css - Rendered result\n/// :host([color=\"darker\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darker, #464646);\n/// --context: dark;\n/// }\n/// :host([color=\"darkest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darkest, #131313);\n/// --context: dark;\n/// }\n/// :host([color=\"base\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--base, #dfdfdf);\n/// --context: light;\n/// }\n/// :host([color=\"lighter\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lighter, #ececec);\n/// --context: light;\n/// }\n/// :host([color=\"lightest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n/// --context: light;\n/// }\n/// :host([color=\"accent\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--accent, #ee0000);\n/// --context: saturated;\n/// }\n/// :host([color=\"complement\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--complement, #0477a4);\n/// --context: saturated;\n/// }\n@mixin pfe-surfaces($surfaces: $SURFACE, $attr-name: color) {\n @each $color in $surfaces {\n $context: #{pfe-get-context(surface--#{$color}--context)};\n :host([#{$attr-name}=\"#{$color}\"]) {\n @include pfe-print-local(\n (\n BackgroundColor: pfe-var(surface--#{$color}),\n context: pfe-var(surface--#{$color}--context, #{$context})\n )\n );\n @extend %fallback-surface;\n }\n }\n}\n\n/// Prints the `on` attribute with IE11 fallbacks\n/// @param {List} contexts [$CONTEXTS] - defaults to the global $CONTEXTS list of all supported contexts\n/// @param {Boolean} ie-fallback [true] - defaults to true, prints IE11 fallbacks\n/// @example - scss - In your component styles\n/// @include pfe-contexts; // imports on=\"light\" etc support\n/// @example - css - Rendered outputs\n/// :host([on=\"dark\"]) {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n/// @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n/// :host([on=\"dark\"]) {\n/// color: #fff;\n/// color: var(--pfe-theme--color--text--on-dark, #fff);\n/// }\n/// }\n/// // ...as well as all the values for :host([on=\"saturated\"]) and :host([on=\"light\"])\n@mixin pfe-contexts($contexts: $CONTEXTS, $ie-fallback: true) {\n // Helper attributes to aid in theming\n @each $context in $contexts {\n :host([on=\"#{$context}\"]) {\n @include pfe-set-broadcast-context($context);\n }\n }\n @if $ie-fallback {\n :host {\n @extend %fallback-text;\n }\n }\n}\n","// Colors\n$pf-color-black-100: #fafafa !default;\n$pf-color-black-150: #f5f5f5 !default;\n$pf-color-black-200: #f0f0f0 !default;\n$pf-color-black-300: #d2d2d2 !default;\n$pf-color-black-400: #b8bbbe !default;\n$pf-color-black-500: #8a8d90 !default;\n$pf-color-black-600: #6a6e73 !default;\n$pf-color-black-700: #4f5255 !default;\n$pf-color-black-800: #3c3f42 !default;\n$pf-color-black-850: #212427 !default;\n$pf-color-black-900: #151515 !default;\n$pf-color-black-1000: #030303 !default;\n$pf-color-blue-50: #e7f1fa !default;\n$pf-color-blue-100: #bee1f4 !default;\n$pf-color-blue-200: #73bcf7 !default;\n$pf-color-blue-300: #2b9af3 !default;\n$pf-color-blue-400: #06c !default;\n$pf-color-blue-500: #004080 !default;\n$pf-color-blue-600: #002952 !default;\n$pf-color-blue-700: #001223 !default;\n$pf-color-cyan-50: #f2f9f9 !default;\n$pf-color-cyan-100: #a2d9d9 !default;\n$pf-color-cyan-200: #73c5c5 !default;\n$pf-color-cyan-300: #009596 !default;\n$pf-color-cyan-400: #005f60 !default;\n$pf-color-cyan-500: #003737 !default;\n$pf-color-cyan-600: #002323 !default;\n$pf-color-cyan-700: #000f0f !default;\n$pf-color-gold-50: #fdf7e7 !default;\n$pf-color-gold-100: #f9e0a2 !default;\n$pf-color-gold-200: #f6d173 !default;\n$pf-color-gold-300: #f4c145 !default;\n$pf-color-gold-400: #f0ab00 !default;\n$pf-color-gold-500: #c58c00 !default;\n$pf-color-gold-600: #795600 !default;\n$pf-color-gold-700: #3d2c00 !default;\n$pf-color-green-50: #f3faf2 !default;\n$pf-color-green-100: #bde5b8 !default;\n$pf-color-green-200: #95d58e !default;\n$pf-color-green-300: #6ec664 !default;\n$pf-color-green-400: #5ba352 !default;\n$pf-color-green-500: #3e8635 !default;\n$pf-color-green-600: #1e4f18 !default;\n$pf-color-green-700: #0f280d !default;\n$pf-color-light-blue-100: #beedf9 !default;\n$pf-color-light-blue-200: #7cdbf3 !default;\n$pf-color-light-blue-300: #35caed !default;\n$pf-color-light-blue-400: #00b9e4 !default;\n$pf-color-light-blue-500: #008bad !default;\n$pf-color-light-blue-600: #005c73 !default;\n$pf-color-light-blue-700: #002d39 !default;\n$pf-color-light-green-100: #e4f5bc !default;\n$pf-color-light-green-200: #c8eb79 !default;\n$pf-color-light-green-300: #ace12e !default;\n$pf-color-light-green-400: #92d400 !default;\n$pf-color-light-green-500: #6ca100 !default;\n$pf-color-light-green-600: #486b00 !default;\n$pf-color-light-green-700: #253600 !default;\n$pf-color-orange-100: #f4b678 !default;\n$pf-color-orange-200: #ef9234 !default;\n$pf-color-orange-300: #ec7a08 !default;\n$pf-color-orange-400: #c46100 !default;\n$pf-color-orange-500: #8f4700 !default;\n$pf-color-orange-600: #773d00 !default;\n$pf-color-orange-700: #3b1f00 !default;\n$pf-color-purple-50: #f2f0fc !default;\n$pf-color-purple-100: #cbc1ff !default;\n$pf-color-purple-200: #b2a3ff !default;\n$pf-color-purple-300: #a18fff !default;\n$pf-color-purple-400: #8476d1 !default;\n$pf-color-purple-500: #6753ac !default;\n$pf-color-purple-600: #40199a !default;\n$pf-color-purple-700: #1f0066 !default;\n$pf-color-red-50: #faeae8 !default;\n$pf-color-red-100: #c9190b !default;\n$pf-color-red-200: #a30000 !default;\n$pf-color-red-300: #7d1007 !default;\n$pf-color-red-400: #470000 !default;\n$pf-color-red-500: #2c0000 !default;\n$pf-color-white: #fff !default;\n"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-accordion/dist/pfe-accordion-panel.min.css.map b/elements/pfe-accordion/dist/pfe-accordion-panel.min.css.map new file mode 100644 index 0000000000..3ab794288e --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion-panel.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/pfe-accordion-panel.scss","../../../pfe-sass/extends/_extends.scss","../../../pfe-sass/mixins/_containers.scss","../../../pfe-sass/mixins/_components.scss","../../../pfe-sass/mixins/_mixins.scss","../../../pfe-sass/mixins/_custom-properties.scss","pfe-accordion-panel.css"],"names":[],"mappings":"AAkBA,WCQE,SAAA,SACA,QAAA,MACA,MAAA,KACA,QAAA,KAAA,QAAA,wCDvBF,ME2BI,QAAA,KACA,SAAA,OACA,YAAA,OACA,aAAA,YACA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,2BAAA,KAAA,wBAAA,yCAAA,gCAAA,EAAA,2BAAA,KC2CN,gCNzFA,gCK8CM,iCAAA,mBAAA,uBAAA,sCAAA,qCAAA,uDAAA,2BAAA,KAAA,wBAAA,yCAAA,gCAAA,EAAA,2BAAA","file":"pfe-accordion-panel.min.css","sourceRoot":"../src","sourcesContent":[null,null,null,null,null,null,".container {\n position: relative;\n display: block;\n width: 100%;\n padding: 1rem;\n padding: var(--pfe-theme--container-spacer, 1rem);\n}\n\n:host {\n display: none;\n overflow: hidden;\n will-change: height;\n border-color: transparent;\n opacity: 0;\n margin: 0;\n width: 100%;\n width: var(--pfe-accordion--Width, 100%);\n max-width: calc(100% - 4px);\n max-width: calc(100% - var(--pfe-theme--surface--border-width--heavy, 4px));\n height: auto;\n position: relative;\n background-color: transparent;\n background-color: var(--pfe-accordion--BackgroundColor, transparent);\n color: #3c3f42;\n color: var(--pfe-accordion--Color, var(--pfe-broadcasted--text, #3c3f42));\n border-width: 0;\n border-style: solid;\n border-style: var(--pfe-theme--surface--border-style, solid);\n border-color: #d2d2d2;\n border-color: var(--pfe-accordion--BorderColor, var(--pfe-theme--color--surface--border, #d2d2d2));\n border-top-width: 1px;\n border-top-width: var(--pfe-accordion--BorderTopWidth, var(--pfe-theme--surface--border-width, 1px));\n border-right-width: 0;\n border-right-width: var(--pfe-accordion--BorderRightWidth, 0);\n border-bottom-width: 1px;\n border-bottom-width: var(--pfe-accordion--BorderBottomWidth, var(--pfe-theme--surface--border-width, 1px));\n border-left-width: 4px;\n border-left-width: var(--pfe-accordion--BorderLeftWidth, var(--pfe-theme--surface--border-width--heavy, 4px));\n border-left-color: transparent;\n border-left-color: var(--pfe-accordion--BorderColor--accent, transparent);\n -webkit-box-shadow: var(--pfe-accordion--BoxShadow);\n box-shadow: var(--pfe-accordion--BoxShadow);\n z-index: var(--pfe-accordion--ZIndex);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n border-top-width: 1px;\n border-right-width: 0;\n border-bottom-width: 1px;\n border-left-width: 4px;\n }\n}\n\n:host:hover, :host:focus {\n --pfe-accordion--BorderColor--accent: var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host:hover, :host:focus {\n /* IE10+ */\n border-left-color: #06c;\n }\n}\n\n:host *,\n:host *::before,\n:host *::after {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n:host(.animating) {\n display: block;\n -webkit-transition: height 0.3s ease-in-out;\n transition: height 0.3s ease-in-out;\n}\n\n.container {\n --pfe-accordion--BoxShadow: none;\n padding: var(--pfe-accordion__panel-container--Padding);\n --pfe-accordion__panel-container--Padding: 0 calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 3) var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 1.5);\n}\n\n.container::after {\n clear: both;\n content: \"\";\n display: table;\n}\n\n:host([disclosure=\"true\"]) .container {\n --pfe-accordion__panel-container--Padding: 0 calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 1.5);\n}\n\n:host(:last-of-type[expanded]) {\n margin-bottom: 0;\n}\n\n:host([expanded]),\n:host(.animating) {\n --pfe-accordion--BorderColor: var(--pfe-theme--color--surface--border, #d2d2d2);\n --pfe-accordion--BorderRightWidth: var(--pfe-theme--surface--border-width, 1px);\n --pfe-accordion--BorderLeftWidth: var(--pfe-theme--surface--border-width--heavy, 4px);\n --pfe-accordion--BackgroundColor: white;\n --pfe-accordion--Color: var(--pfe-theme--color--text, #151515);\n --pfe-accordion--BorderColor--accent: var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));\n --pfe-accordion--BoxShadow: 0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);\n --pfe-accordion--ZIndex: 3;\n --pfe-accordion--accent: var(--pfe-theme--color--ui-accent, #06c);\n --pfe-accordion--BorderTopWidth: 0;\n --pfe-accordion--BoxShadow: 0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);\n display: block;\n position: relative;\n opacity: 1;\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host([expanded]),\n :host(.animating) {\n /* IE10+ */\n border-top-width: 0;\n border-left-color: #06c;\n border-left-color: var(--pfe-theme--color--ui-accent, #06c);\n border-right-color: #d2d2d2;\n border-right-color: var(--pfe-theme--color--surface--border, #d2d2d2);\n }\n}\n\n:host([on=\"dark\"][expanded]),\n:host([on=\"dark\"].animating) {\n --pfe-accordion--BackgroundColor: rgba(247, 247, 249, 0.1);\n --pfe-accordion--Color: var(--pfe-broadcasted--text, #3c3f42);\n --pfe-accordion--BorderColor--accent: var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);\n --pfe-accordion--BoxShadow: none;\n --pfe-accordion--accent: var(--pfe-theme--color--ui-accent, #06c);\n --pfe-accordion--BorderTopWidth: 0;\n --pfe-accordion--BoxShadow: none;\n}\n\n:host([on=\"saturated\"][expanded]),\n:host([on=\"saturated\"].animating) {\n --pfe-accordion--BackgroundColor: rgba(0, 0, 0, 0.2);\n --pfe-accordion--Color: var(--pfe-broadcasted--text, #3c3f42);\n --pfe-accordion--BorderColor--accent: var(--pfe-theme--color--ui-accent--on-saturated, #fff);\n --pfe-accordion--BoxShadow: none;\n --pfe-accordion--accent: var(--pfe-theme--color--ui-accent, #06c);\n --pfe-accordion--BorderTopWidth: 0;\n --pfe-accordion--BoxShadow: none;\n}\n\n/*# sourceMappingURL=pfe-accordion-panel.css.map */\n"]} \ No newline at end of file diff --git a/elements/pfe-accordion/dist/pfe-accordion.css.map b/elements/pfe-accordion/dist/pfe-accordion.css.map new file mode 100644 index 0000000000..02ecc0a3d0 --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-accordion.scss","../../pfe-sass/mixins/_custom-properties.scss","../../pfe-sass/functions/_custom-properties.scss","pfe-accordion.css","../../pfe-sass/mixins/_mixins.scss"],"names":[],"mappings":"AAEA;ECkGM,iDAA8C;EAA9C,+EAA8C;EAA9C,6EAA8C;EAA9C,oCAA8C;EAA9C,gFAA8C;EAA9C,qFAA8C;EAA9C,6DAA8C;EAA9C,gCAA8C;EAA9C,iEAA8C;EAJ5C,wEAA8C;ED3FpD,cAAc;EACd,kBAAkB;EAClB,gBAAgB;EAChB,SAAS;EACT,cEsEkC;EFtElC,yEEsEkC;AC/DpC;;ACbM;EJDN;IIC4F,UAAA;IJSxF,iCAAyD;IACzD,yBAAiC;EGUnC;AACF;;AHPA;ECmFM,6EAA8C;AExEpD;;AHPA;EC+EM,+EAA8C;AEpEpD;;AHPA;EC2EM,+EAA8C;EAA9C,8EAA8C;EAA9C,uFAA8C;AE9DpD;;AHRA;EACE,aAAa;AGWf","file":"pfe-accordion.css","sourcesContent":["@import \"shared-assets\";\n\n:host {\n // @TODO remove this eventually to allow empty local variables\n @include pfe-print-local($LOCAL-VARIABLES);\n display: block;\n position: relative;\n overflow: hidden;\n margin: 0;\n color: pfe-local(Color);\n\n @include browser-query(ie11) {\n background-color: pfe-fetch(surface--lightest) !important;\n color: pfe-fetch(text) !important;\n }\n}\n\n:host([on=\"dark\"]) {\n @include pfe-print-local(pfe-accordion-variables($context: dark));\n}\n\n:host([on=\"saturated\"]) {\n @include pfe-print-local(pfe-accordion-variables($context: saturated));\n}\n\n:host([disclosure=\"true\"]) {\n $disclosure: pfe-accordion-variables($variant: disclosure);\n @include pfe-print-local($disclosure);\n}\n\n:host([hidden]) {\n display: none;\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// This will print all the broadcast variables, and set the value to the context of your choosing, like on-dark or on-saturated.\n/// @param {String} $context - Look up values from contexts, i.e. \"light\" or \"saturated\"\n/// @param {List | String} $broadcast [$BROADCAST-VARS] - Optionally specify only one broadcast variable instead of the whole set, i.e. \"text\"\n/// @see $custom-prop-prefix\n/// @see $BROADCAST-VARS\n/// @example - scss - Usage in a container component, i.e. pfe-card\n/// :host {\n/// @include pfe-set-broadcast-context(dark);\n/// }\n/// @example - css - Rendered output\n/// :host {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n///\n@mixin pfe-set-broadcast-context($context, $broadcast: $BROADCAST-VARS) {\n @each $type in $broadcast {\n $list: ();\n $string: \"\";\n $context_string: \"\";\n $state: \"\";\n\n @if str-starts-with($type, \"link\") {\n $list: append($list, \"#{$type}\");\n\n @each $s in (hover, focus, visited) {\n $state: \"--#{$s}\";\n $string: \"#{$type}#{$state}\";\n\n @if not index($list, $string) {\n $list: append($list, \"#{$type}#{$state}\");\n }\n }\n } @else {\n @if not index($list, $string) {\n $list: append($list, \"#{$type}\");\n }\n }\n\n @if index($CONTEXTS, $context) != null {\n @if $context != \"light\" {\n $context_string: \"--on-#{$context}\";\n }\n }\n\n @each $item in $list {\n @if not index($BROADCAST-VARS, $type) {\n @warn \"--#{$custom-prop-prefix}-broadcasted--#{$item} variable is not in the $BROADCAST-VARS list.\";\n } @else if not pfe-broadcasted(#{$item}#{$context_string}) {\n @warn \"#{$item}#{$context_string} value does not currently exist.\";\n } @else {\n @if index($CONTEXTS, $context) != null {\n --#{$custom-prop-prefix}-broadcasted--#{$item}: #{pfe-var(#{$item}#{$context_string})};\n } @else {\n @error \"The #{$context} context does not appear to be part of a supported context.\";\n }\n }\n }\n }\n}\n\n/// Returns CSS Variable for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $value - The value of the css variable being defined\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example - scss\n/// :host {\n/// padding-top: pfe-local(paddingTop);\n/// padding-bottom: pfe-local(paddingBottom);\n/// }\n@mixin pfe-print-local($map: $LOCAL-VARIABLES) {\n @each $property, $value in $map {\n $name: \"--#{$property}\";\n $styles: $value;\n\n @if type-of($value) == \"map\" {\n @each $prop, $v in $value {\n $name: \"__#{$property}--#{$prop}\";\n $styles: $v;\n\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n } @else {\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n }\n}\n\n/// Surface properties\n/// This mixin creates an attribute for all the surface colors, then prints the local background color variable for the component, with the correct context colors.\n/// @param {List | String} $surfaces [$SURFACES] - defaults to the global $SURFACES list of all supported colors\n/// @param {String} $attr-name [pfe-var] - defaults to pfe-var, optionally pass in a custom name for the data attribute\n/// @example - scss - In your component stylesheet\n/// $LOCAL: band;\n/// @include pfe-surfaces;\n/// @example - css - Rendered result\n/// :host([color=\"darker\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darker, #464646);\n/// --context: dark;\n/// }\n/// :host([color=\"darkest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darkest, #131313);\n/// --context: dark;\n/// }\n/// :host([color=\"base\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--base, #dfdfdf);\n/// --context: light;\n/// }\n/// :host([color=\"lighter\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lighter, #ececec);\n/// --context: light;\n/// }\n/// :host([color=\"lightest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n/// --context: light;\n/// }\n/// :host([color=\"accent\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--accent, #ee0000);\n/// --context: saturated;\n/// }\n/// :host([color=\"complement\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--complement, #0477a4);\n/// --context: saturated;\n/// }\n@mixin pfe-surfaces($surfaces: $SURFACE, $attr-name: color) {\n @each $color in $surfaces {\n $context: #{pfe-get-context(surface--#{$color}--context)};\n :host([#{$attr-name}=\"#{$color}\"]) {\n @include pfe-print-local(\n (\n BackgroundColor: pfe-var(surface--#{$color}),\n context: pfe-var(surface--#{$color}--context, #{$context})\n )\n );\n @extend %fallback-surface;\n }\n }\n}\n\n/// Prints the `on` attribute with IE11 fallbacks\n/// @param {List} contexts [$CONTEXTS] - defaults to the global $CONTEXTS list of all supported contexts\n/// @param {Boolean} ie-fallback [true] - defaults to true, prints IE11 fallbacks\n/// @example - scss - In your component styles\n/// @include pfe-contexts; // imports on=\"light\" etc support\n/// @example - css - Rendered outputs\n/// :host([on=\"dark\"]) {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n/// @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n/// :host([on=\"dark\"]) {\n/// color: #fff;\n/// color: var(--pfe-theme--color--text--on-dark, #fff);\n/// }\n/// }\n/// // ...as well as all the values for :host([on=\"saturated\"]) and :host([on=\"light\"])\n@mixin pfe-contexts($contexts: $CONTEXTS, $ie-fallback: true) {\n // Helper attributes to aid in theming\n @each $context in $contexts {\n :host([on=\"#{$context}\"]) {\n @include pfe-set-broadcast-context($context);\n }\n }\n @if $ie-fallback {\n :host {\n @extend %fallback-text;\n }\n }\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}",":host {\n --pfe-accordion--BorderColor--accent: transparent;\n --pfe-accordion--BorderColor: var(--pfe-theme--color--surface--border, #d2d2d2);\n --pfe-accordion--BorderTopWidth: var(--pfe-theme--surface--border-width, 1px);\n --pfe-accordion--BorderRightWidth: 0;\n --pfe-accordion--BorderBottomWidth: var(--pfe-theme--surface--border-width, 1px);\n --pfe-accordion--BorderLeftWidth: var(--pfe-theme--surface--border-width--heavy, 4px);\n --pfe-accordion--Color: var(--pfe-broadcasted--text, #3c3f42);\n --pfe-accordion--TextAlign: left;\n --pfe-accordion--accent: var(--pfe-theme--color--ui-accent, #06c);\n --pfe-accordion__base--Padding: var(--pfe-theme--container-spacer, 1rem);\n display: block;\n position: relative;\n overflow: hidden;\n margin: 0;\n color: var(--pfe-accordion--Color, var(--pfe-broadcasted--text, #3c3f42));\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n background-color: #fff !important;\n color: #151515 !important;\n }\n}\n\n:host([on=\"dark\"]) {\n --pfe-accordion--accent: var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);\n}\n\n:host([on=\"saturated\"]) {\n --pfe-accordion--accent: var(--pfe-theme--color--ui-accent--on-saturated, #fff);\n}\n\n:host([disclosure=\"true\"]) {\n --pfe-accordion--BorderRightWidth: var(--pfe-theme--surface--border-width, 1px);\n --pfe-accordion--BorderLeftWidth: var(--pfe-theme--surface--border-width, 1px);\n --pfe-accordion--BorderColor--accent: var(--pfe-theme--color--surface--border, #d2d2d2);\n}\n\n:host([hidden]) {\n display: none;\n}\n","@mixin browser-query($browser-list) {\n @each $browser in $browser-list {\n @if $browser == ie11 {\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n @content;\n }\n }\n @if $browser == edge12 {\n @supports (-ms-accelerator: true) { /* Microsoft Edge Browser 12+ */\n @content;\n }\n }\n @if $browser == edge {\n @supports (-ms-ime-align: auto) { /* Microsoft Edge Browser 16+ (All) */\n @content;\n }\n }\n @if $browser == firefox {\n @media all and (min--moz-device-pixel-ratio:0) { /* Mozilla Firefox (All) */\n @content;\n }\n }\n }\n}\n\n@mixin pfe-transition($properties...) {\n $return: null;\n @each $property in $properties {\n @if length($property) == 1 {\n $return: append($return, #{$property} 250ms $pfe-global--animation-timing, comma);\n }\n @else if length($property) == 2 {\n $return: append($return, nth($property, 1) nth($property, 2), comma);\n }\n }\n transition: $return;\n}\n\n// Make a CSS arrow\n@mixin pfe-arrow($type, $color, $width: 8px, $height: 5px, $pseudo: false) {\n $direction: (\n up: 180deg,\n down: 0deg,\n right: -90deg,\n left: 90deg,\n );\n border-style: pfe-var(surface--border-style);\n border-width: $width $height 0;\n border-color: transparent;\n border-top-color: $color;\n transform: rotate(map-get($direction, $type));\n @if $pseudo {\n display: inline-block;\n content: \"\";\n @content;\n }\n}\n\n@mixin pfe-arrow-color($color) {\n border-top-color: $color;\n}\n\n@mixin pfe-print-media {\n @media print {\n @content;\n }\n}\n\n@mixin pfe-print-background {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n@mixin pfe-no-print-background {\n @include pfe-print-media {\n background-color: white !important;\n background-image: none !important;\n box-shadow: none !important;\n }\n}\n\n@mixin pfe-hidden {\n @at-root #{&}([hidden]) {\n display: none;\n }\n}\n\n@mixin pfe-pipe( $position: right, $padding: 0, $margin: 0, $color: $border-color) {\n border: pfe-var(surface--border-width) pfe-var(surface--border-style) transparent;\n border-#{$position}-color: $color;\n @if $position == right {\n padding-left: $padding;\n margin-right: $margin;\n }\n @else if $position == left {\n padding-right: $padding;\n margin-left: $margin;\n }\n}\n\n@mixin pfe-retina {\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n @content;\n }\n}\n\n@mixin pfe-icon($path, $display: flex, $size: 1em) {\n display: #{$display};\n @if $path {\n background: #{$path} no-repeat;\n background-size: contain;\n background-position: center;\n }\n width: #{$size};\n height: #{$size};\n @content;\n}\n\n@mixin pfe-local-debug($map: $LOCAL-VARIABLES) {\n :root {\n @include pfe-print-local($map);\n }\n} "],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-accordion/dist/pfe-accordion.js b/elements/pfe-accordion/dist/pfe-accordion.js new file mode 100644 index 0000000000..327df437ee --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion.js @@ -0,0 +1,689 @@ +import PFElement from '../../pfelement/dist/pfelement.js'; + +// @POLYFILL Array.prototype.findIndex +// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex +if (!Array.prototype.findIndex) { + Object.defineProperty(Array.prototype, "findIndex", { + value: function(predicate) { + // 1. Let O be ? ToObject(this value). + if (this == null) { + throw new TypeError('"this" is null or not defined'); + } + + var o = Object(this); + + // 2. Let len be ? ToLength(? Get(O, "length")). + var len = o.length >>> 0; + + // 3. If IsCallable(predicate) is false, throw a TypeError exception. + if (typeof predicate !== "function") { + throw new TypeError("predicate must be a function"); + } + + // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. + var thisArg = arguments[1]; + + // 5. Let k be 0. + var k = 0; + + // 6. Repeat, while k < len + while (k < len) { + // a. Let Pk be ! ToString(k). + // b. Let kValue be ? Get(O, Pk). + // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). + // d. If testResult is true, return k. + var kValue = o[k]; + if (predicate.call(thisArg, kValue, k, o)) { + return k; + } + // e. Increase k by 1. + k++; + } + + // 7. Return -1. + return -1; + } + }); +} + +/*! + * PatternFly Elements: PfeAccordion 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/ + +class PfeAccordion extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + +`; + } + + static get tag() { + return "pfe-accordion"; + } + + static get meta() { + return { + title: "Accordion", + description: "This element renders content sets in an expandable format." + }; + } + + get styleUrl() { + return "pfe-accordion.scss"; + } + + get templateUrl() { + return "pfe-accordion.html"; + } + + static get properties() { + return { + disclosure: { + // Leaving this as a string since it's an opt out + title: "Disclosure", + type: String, + values: ["true", "false"], + observer: "_disclosureChanged", + cascade: ["pfe-accordion-header", "pfe-accordion-panel"] + }, + // @TODO: Deprecated pfe-disclosure in 1.0 + oldDisclosure: { + type: String, + alias: "disclosure", + attr: "pfe-disclosure" + }, + role: { + type: String, + default: "tablist", + values: ["tablist"] + } + }; + } + + static get slots() { + return { + default: { + type: "array", + namedSlot: false, + items: { + oneOf: [ + { + $ref: "pfe-accordion-header" + }, + { + $ref: "pfe-accordion-panel" + } + ] + } + } + }; + } + + static get events() { + return { + change: `${this.tag}:change` + }; + } + + // Declare the type of this component + static get PfeType() { + return PFElement.PfeTypes.Container; + } + + // Each set contains a header and a panel + static get contentTemplate() { + return ` + + + `; + } + + constructor() { + super(PfeAccordion, { type: PfeAccordion.PfeType }); + + this._linkPanels = this._linkPanels.bind(this); + this._observer = new MutationObserver(this._linkPanels); + } + + connectedCallback() { + super.connectedCallback(); + + this.addEventListener(PfeAccordion.events.change, this._changeHandler); + this.addEventListener("keydown", this._keydownHandler); + + Promise.all([ + customElements.whenDefined(PfeAccordionHeader.tag), + customElements.whenDefined(PfeAccordionPanel.tag) + ]).then(() => { + if (this.hasLightDOM()) { + this._linkPanels(); + } + + this._observer.observe(this, { childList: true }); + }); + } + + disconnectedCallback() { + super.disconnectedCallback(); + + this.removeEventListener(PfeAccordion.events.change, this._changeHandler); + this.removeEventListener("keydown", this._keydownHandler); + this._observer.disconnect(); + } + + toggle(index) { + const headers = this._allHeaders(); + const panels = this._allPanels(); + const header = headers[index]; + const panel = panels[index]; + + if (!header || !panel) { + return; + } + + if (!header.expanded) { + this._expandHeader(header); + this._expandPanel(panel); + } else { + this._collapseHeader(header); + this._collapsePanel(panel); + } + } + + expand(index) { + const headers = this._allHeaders(); + const panels = this._allPanels(); + const header = headers[index]; + const panel = panels[index]; + + if (!header || !panel) { + return; + } + + this._expandHeader(header); + this._expandPanel(panel); + } + + expandAll() { + const headers = this._allHeaders(); + const panels = this._allPanels(); + + headers.forEach(header => this._expandHeader(header)); + panels.forEach(panel => this._expandPanel(panel)); + } + + collapse(index) { + const headers = this._allHeaders(); + const panels = this._allPanels(); + const header = headers[index]; + const panel = panels[index]; + + if (!header || !panel) { + return; + } + + this._collapseHeader(header); + this._collapsePanel(panel); + } + + collapseAll() { + const headers = this._allHeaders(); + const panels = this._allPanels(); + + headers.forEach(header => this._collapseHeader(header)); + panels.forEach(panel => this._collapsePanel(panel)); + } + + _disclosureChanged(oldVal, newVal) { + if (newVal === "true") { + this._allHeaders().forEach(header => header.setAttribute("pfe-disclosure", "true")); + this._allPanels().forEach(panel => panel.setAttribute("pfe-disclosure", "true")); + + // @TODO Deprecated in 1.0 + this.oldDisclosure = "true"; + } else { + this._allHeaders().forEach(header => header.setAttribute("pfe-disclosure", "false")); + this._allPanels().forEach(panel => panel.setAttribute("pfe-disclosure", "false")); + + // @TODO Deprecated in 1.0 + this.oldDisclosure = "false"; + } + } + + _linkPanels() { + const headers = this._allHeaders(); + headers.forEach(header => { + const panel = this._panelForHeader(header); + + if (!panel) { + return; + } + + header.ariaControls = panel._id; + panel.ariaLabelledby = header._id; + }); + + if (headers.length === 1) { + if (this.disclosure === "false") { + return; + } + + this.disclosure = "true"; + } + + if (headers.length > 1) { + if (this.disclosure) { + this.disclosure = "false"; + } + } + } + + _changeHandler(evt) { + if (this.classList.contains("animating")) { + return; + } + + const header = evt.target; + const panel = evt.target.nextElementSibling; + + if (evt.detail.expanded) { + this._expandHeader(header); + this._expandPanel(panel); + } else { + this._collapseHeader(header); + this._collapsePanel(panel); + } + } + + _expandHeader(header) { + header.expanded = true; + } + + _expandPanel(panel) { + if (!panel) { + console.error(`${PfeAccordion.tag}: Trying to expand a panel that doesn't exist`); + return; + } + + if (panel.expanded) { + return; + } + + panel.expanded = true; + + const height = panel.getBoundingClientRect().height; + this._animate(panel, 0, height); + } + + _collapseHeader(header) { + header.expanded = false; + } + + _collapsePanel(panel) { + if (!panel) { + console.error(`${PfeAccordion.tag}: Trying to collapse a panel that doesn't exist`); + return; + } + + if (!panel.expanded) { + return; + } + + const height = panel.getBoundingClientRect().height; + panel.expanded = false; + + this._animate(panel, height, 0); + } + + _animate(panel, start, end) { + if (panel) { + const header = panel.previousElementSibling; + if (header) { + header.classList.add("animating"); + } + panel.classList.add("animating"); + panel.style.height = `${start}px`; + + requestAnimationFrame(() => { + requestAnimationFrame(() => { + panel.style.height = `${end}px`; + panel.addEventListener("transitionend", this._transitionEndHandler); + }); + }); + } + } + + _keydownHandler(evt) { + const currentHeader = evt.target; + + if (!this._isHeader(currentHeader)) { + return; + } + + let newHeader; + + switch (evt.key) { + case "ArrowDown": + case "Down": + case "ArrowRight": + case "Right": + newHeader = this._nextHeader(); + break; + case "ArrowUp": + case "Up": + case "ArrowLeft": + case "Left": + newHeader = this._previousHeader(); + break; + case "Home": + newHeader = this._firstHeader(); + break; + case "End": + newHeader = this._lastHeader(); + break; + default: + return; + } + + newHeader.shadowRoot.querySelector("button").focus(); + } + + _transitionEndHandler(evt) { + const header = evt.target.previousElementSibling; + if (header) { + header.classList.remove("animating"); + } + evt.target.style.height = ""; + evt.target.classList.remove("animating"); + evt.target.removeEventListener("transitionend", this._transitionEndHandler); + } + + _allHeaders() { + return [...this.querySelectorAll(PfeAccordionHeader.tag)]; + } + + _allPanels() { + return [...this.querySelectorAll(PfeAccordionPanel.tag)]; + } + + _panelForHeader(header) { + const next = header.nextElementSibling; + + if (!next) { + return; + } + + if (next.tagName.toLowerCase() !== PfeAccordionPanel.tag) { + console.error(`${PfeAccordion.tag}: Sibling element to a header needs to be a panel`); + return; + } + + return next; + } + + _previousHeader() { + const headers = this._allHeaders(); + let newIndex = headers.findIndex(header => header === document.activeElement) - 1; + return headers[(newIndex + headers.length) % headers.length]; + } + + _nextHeader() { + const headers = this._allHeaders(); + let newIndex = headers.findIndex(header => header === document.activeElement) + 1; + return headers[newIndex % headers.length]; + } + + _firstHeader() { + const headers = this._allHeaders(); + return headers[0]; + } + + _lastHeader() { + const headers = this._allHeaders(); + return headers[headers.length - 1]; + } + + _isHeader(element) { + return element.tagName.toLowerCase() === PfeAccordionHeader.tag; + } +} + +class PfeAccordionHeader extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + +`; + } + + static get tag() { + return "pfe-accordion-header"; + } + + get styleUrl() { + return "pfe-accordion-header.scss"; + } + + get templateUrl() { + return "pfe-accordion-header.html"; + } + + static get properties() { + return { + _id: { + type: String, + default: el => `${el.randomId.replace("pfe", el.tag)}`, + prefix: false + }, + role: { + type: String, + default: "heading", + prefix: false + }, + ariaControls: { + type: String, + prefix: false + }, + // @TODO Deprecated pfe-id in 1.0 + oldPfeId: { + type: String, + alias: "_id", + attr: "pfe-id" + }, + expanded: { + title: "Expanded", + type: Boolean, + observer: "_expandedChanged", + cascade: "#pfe-accordion-header--button", + observer: "_expandedChanged" + } + }; + } + + constructor() { + super(PfeAccordionHeader); + + this.button = this.shadowRoot.querySelector("button"); + + this._init = this._init.bind(this); + this._clickHandler = this._clickHandler.bind(this); + this._observer = new MutationObserver(this._init); + } + + connectedCallback() { + super.connectedCallback(); + + if (this.hasLightDOM()) this._init(); + + this.addEventListener("click", this._clickHandler); + this._observer.observe(this, { childList: true }); + } + + disconnectedCallback() { + super.disconnectedCallback(); + + this.removeEventListener("click", this._clickHandler); + this._observer.disconnect(); + } + + _init() { + if (window.ShadyCSS) { + this._observer.disconnect(); + } + + const child = this.children[0]; + let isHeaderTag = false; + + if (child) { + switch (child.tagName) { + case "H1": + case "H2": + case "H3": + case "H4": + case "H5": + case "H6": + isHeaderTag = true; + break; + } + + const wrapperTag = document.createElement(child.tagName); + this.button.innerText = child.innerText; + + wrapperTag.appendChild(this.button); + this.shadowRoot.appendChild(wrapperTag); + } else { + this.button.innerText = this.textContent.trim(); + } + + if (!isHeaderTag) { + this.warn(`The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)`); + } + + if (window.ShadyCSS) { + this._observer.observe(this, { childList: true }); + } + } + + _clickHandler(event) { + this.emitEvent(PfeAccordion.events.change, { + detail: { + expanded: !this.expanded + } + }); + } + + _expandedChanged() { + this.setAttribute("aria-expanded", this.expanded); + this.button.setAttribute("aria-expanded", this.expanded); + } +} + +class PfeAccordionPanel extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + +
+
+ +
+
`; + } + + static get tag() { + return "pfe-accordion-panel"; + } + + get styleUrl() { + return "pfe-accordion-panel.scss"; + } + + get templateUrl() { + return "pfe-accordion-panel.html"; + } + + static get properties() { + return { + _id: { + type: String, + default: el => `${el.randomId.replace("pfe", el.tag)}`, + prefix: false + }, + role: { + type: String, + default: "region", + prefix: false + }, + // @TODO Deprecated pfe-id in 1.0 + oldPfeId: { + type: String, + alias: "_id", + attr: "pfe-id" + }, + expanded: { + title: "Expanded", + type: Boolean, + default: false + }, + ariaLabelledby: { + type: String, + prefix: false + } + }; + } + + constructor() { + super(PfeAccordionPanel); + } + + connectedCallback() { + super.connectedCallback(); + } +} + +PFElement.create(PfeAccordionHeader); +PFElement.create(PfeAccordionPanel); +PFElement.create(PfeAccordion); + +export default PfeAccordion; +//# sourceMappingURL=pfe-accordion.js.map diff --git a/elements/pfe-accordion/dist/pfe-accordion.js.map b/elements/pfe-accordion/dist/pfe-accordion.js.map new file mode 100644 index 0000000000..cec44b8a75 --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-accordion.js","sources":["../_temp/polyfills--pfe-accordion.js","../_temp/pfe-accordion.js"],"sourcesContent":["// @POLYFILL Array.prototype.findIndex\n// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\nif (!Array.prototype.findIndex) {\n Object.defineProperty(Array.prototype, \"findIndex\", {\n value: function(predicate) {\n // 1. Let O be ? ToObject(this value).\n if (this == null) {\n throw new TypeError('\"this\" is null or not defined');\n }\n\n var o = Object(this);\n\n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n var len = o.length >>> 0;\n\n // 3. If IsCallable(predicate) is false, throw a TypeError exception.\n if (typeof predicate !== \"function\") {\n throw new TypeError(\"predicate must be a function\");\n }\n\n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n var thisArg = arguments[1];\n\n // 5. Let k be 0.\n var k = 0;\n\n // 6. Repeat, while k < len\n while (k < len) {\n // a. Let Pk be ! ToString(k).\n // b. Let kValue be ? Get(O, Pk).\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n // d. If testResult is true, return k.\n var kValue = o[k];\n if (predicate.call(thisArg, kValue, k, o)) {\n return k;\n }\n // e. Increase k by 1.\n k++;\n }\n\n // 7. Return -1.\n return -1;\n }\n });\n}\n","/*!\n * PatternFly Elements: PfeAccordion 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: findIndex\nimport \"./polyfills--pfe-accordion.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\nclass PfeAccordion extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n static get tag() {\n return \"pfe-accordion\";\n }\n\n static get meta() {\n return {\n title: \"Accordion\",\n description: \"This element renders content sets in an expandable format.\"\n };\n }\n\n get styleUrl() {\n return \"pfe-accordion.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion.html\";\n }\n\n static get properties() {\n return {\n disclosure: {\n // Leaving this as a string since it's an opt out\n title: \"Disclosure\",\n type: String,\n values: [\"true\", \"false\"],\n observer: \"_disclosureChanged\",\n cascade: [\"pfe-accordion-header\", \"pfe-accordion-panel\"]\n },\n // @TODO: Deprecated pfe-disclosure in 1.0\n oldDisclosure: {\n type: String,\n alias: \"disclosure\",\n attr: \"pfe-disclosure\"\n },\n role: {\n type: String,\n default: \"tablist\",\n values: [\"tablist\"]\n }\n };\n }\n\n static get slots() {\n return {\n default: {\n type: \"array\",\n namedSlot: false,\n items: {\n oneOf: [\n {\n $ref: \"pfe-accordion-header\"\n },\n {\n $ref: \"pfe-accordion-panel\"\n }\n ]\n }\n }\n };\n }\n\n static get events() {\n return {\n change: `${this.tag}:change`\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n // Each set contains a header and a panel\n static get contentTemplate() {\n return `\n \n \n `;\n }\n\n constructor() {\n super(PfeAccordion, { type: PfeAccordion.PfeType });\n\n this._linkPanels = this._linkPanels.bind(this);\n this._observer = new MutationObserver(this._linkPanels);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener(PfeAccordion.events.change, this._changeHandler);\n this.addEventListener(\"keydown\", this._keydownHandler);\n\n Promise.all([\n customElements.whenDefined(PfeAccordionHeader.tag),\n customElements.whenDefined(PfeAccordionPanel.tag)\n ]).then(() => {\n if (this.hasLightDOM()) {\n this._linkPanels();\n }\n\n this._observer.observe(this, { childList: true });\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(PfeAccordion.events.change, this._changeHandler);\n this.removeEventListener(\"keydown\", this._keydownHandler);\n this._observer.disconnect();\n }\n\n toggle(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n if (!header.expanded) {\n this._expandHeader(header);\n this._expandPanel(panel);\n } else {\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n }\n\n expand(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n this._expandHeader(header);\n this._expandPanel(panel);\n }\n\n expandAll() {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n\n headers.forEach(header => this._expandHeader(header));\n panels.forEach(panel => this._expandPanel(panel));\n }\n\n collapse(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n\n collapseAll() {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n\n headers.forEach(header => this._collapseHeader(header));\n panels.forEach(panel => this._collapsePanel(panel));\n }\n\n _disclosureChanged(oldVal, newVal) {\n if (newVal === \"true\") {\n this._allHeaders().forEach(header => header.setAttribute(\"pfe-disclosure\", \"true\"));\n this._allPanels().forEach(panel => panel.setAttribute(\"pfe-disclosure\", \"true\"));\n\n // @TODO Deprecated in 1.0\n this.oldDisclosure = \"true\";\n } else {\n this._allHeaders().forEach(header => header.setAttribute(\"pfe-disclosure\", \"false\"));\n this._allPanels().forEach(panel => panel.setAttribute(\"pfe-disclosure\", \"false\"));\n\n // @TODO Deprecated in 1.0\n this.oldDisclosure = \"false\";\n }\n }\n\n _linkPanels() {\n const headers = this._allHeaders();\n headers.forEach(header => {\n const panel = this._panelForHeader(header);\n\n if (!panel) {\n return;\n }\n\n header.ariaControls = panel._id;\n panel.ariaLabelledby = header._id;\n });\n\n if (headers.length === 1) {\n if (this.disclosure === \"false\") {\n return;\n }\n\n this.disclosure = \"true\";\n }\n\n if (headers.length > 1) {\n if (this.disclosure) {\n this.disclosure = \"false\";\n }\n }\n }\n\n _changeHandler(evt) {\n if (this.classList.contains(\"animating\")) {\n return;\n }\n\n const header = evt.target;\n const panel = evt.target.nextElementSibling;\n\n if (evt.detail.expanded) {\n this._expandHeader(header);\n this._expandPanel(panel);\n } else {\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n }\n\n _expandHeader(header) {\n header.expanded = true;\n }\n\n _expandPanel(panel) {\n if (!panel) {\n console.error(`${PfeAccordion.tag}: Trying to expand a panel that doesn't exist`);\n return;\n }\n\n if (panel.expanded) {\n return;\n }\n\n panel.expanded = true;\n\n const height = panel.getBoundingClientRect().height;\n this._animate(panel, 0, height);\n }\n\n _collapseHeader(header) {\n header.expanded = false;\n }\n\n _collapsePanel(panel) {\n if (!panel) {\n console.error(`${PfeAccordion.tag}: Trying to collapse a panel that doesn't exist`);\n return;\n }\n\n if (!panel.expanded) {\n return;\n }\n\n const height = panel.getBoundingClientRect().height;\n panel.expanded = false;\n\n this._animate(panel, height, 0);\n }\n\n _animate(panel, start, end) {\n if (panel) {\n const header = panel.previousElementSibling;\n if (header) {\n header.classList.add(\"animating\");\n }\n panel.classList.add(\"animating\");\n panel.style.height = `${start}px`;\n\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n panel.style.height = `${end}px`;\n panel.addEventListener(\"transitionend\", this._transitionEndHandler);\n });\n });\n }\n }\n\n _keydownHandler(evt) {\n const currentHeader = evt.target;\n\n if (!this._isHeader(currentHeader)) {\n return;\n }\n\n let newHeader;\n\n switch (evt.key) {\n case \"ArrowDown\":\n case \"Down\":\n case \"ArrowRight\":\n case \"Right\":\n newHeader = this._nextHeader();\n break;\n case \"ArrowUp\":\n case \"Up\":\n case \"ArrowLeft\":\n case \"Left\":\n newHeader = this._previousHeader();\n break;\n case \"Home\":\n newHeader = this._firstHeader();\n break;\n case \"End\":\n newHeader = this._lastHeader();\n break;\n default:\n return;\n }\n\n newHeader.shadowRoot.querySelector(\"button\").focus();\n }\n\n _transitionEndHandler(evt) {\n const header = evt.target.previousElementSibling;\n if (header) {\n header.classList.remove(\"animating\");\n }\n evt.target.style.height = \"\";\n evt.target.classList.remove(\"animating\");\n evt.target.removeEventListener(\"transitionend\", this._transitionEndHandler);\n }\n\n _allHeaders() {\n return [...this.querySelectorAll(PfeAccordionHeader.tag)];\n }\n\n _allPanels() {\n return [...this.querySelectorAll(PfeAccordionPanel.tag)];\n }\n\n _panelForHeader(header) {\n const next = header.nextElementSibling;\n\n if (!next) {\n return;\n }\n\n if (next.tagName.toLowerCase() !== PfeAccordionPanel.tag) {\n console.error(`${PfeAccordion.tag}: Sibling element to a header needs to be a panel`);\n return;\n }\n\n return next;\n }\n\n _previousHeader() {\n const headers = this._allHeaders();\n let newIndex = headers.findIndex(header => header === document.activeElement) - 1;\n return headers[(newIndex + headers.length) % headers.length];\n }\n\n _nextHeader() {\n const headers = this._allHeaders();\n let newIndex = headers.findIndex(header => header === document.activeElement) + 1;\n return headers[newIndex % headers.length];\n }\n\n _firstHeader() {\n const headers = this._allHeaders();\n return headers[0];\n }\n\n _lastHeader() {\n const headers = this._allHeaders();\n return headers[headers.length - 1];\n }\n\n _isHeader(element) {\n return element.tagName.toLowerCase() === PfeAccordionHeader.tag;\n }\n}\n\nclass PfeAccordionHeader extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n static get tag() {\n return \"pfe-accordion-header\";\n }\n\n get styleUrl() {\n return \"pfe-accordion-header.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion-header.html\";\n }\n\n static get properties() {\n return {\n _id: {\n type: String,\n default: el => `${el.randomId.replace(\"pfe\", el.tag)}`,\n prefix: false\n },\n role: {\n type: String,\n default: \"heading\",\n prefix: false\n },\n ariaControls: {\n type: String,\n prefix: false\n },\n // @TODO Deprecated pfe-id in 1.0\n oldPfeId: {\n type: String,\n alias: \"_id\",\n attr: \"pfe-id\"\n },\n expanded: {\n title: \"Expanded\",\n type: Boolean,\n observer: \"_expandedChanged\",\n cascade: \"#pfe-accordion-header--button\",\n observer: \"_expandedChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeAccordionHeader);\n\n this.button = this.shadowRoot.querySelector(\"button\");\n\n this._init = this._init.bind(this);\n this._clickHandler = this._clickHandler.bind(this);\n this._observer = new MutationObserver(this._init);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.hasLightDOM()) this._init();\n\n this.addEventListener(\"click\", this._clickHandler);\n this._observer.observe(this, { childList: true });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"click\", this._clickHandler);\n this._observer.disconnect();\n }\n\n _init() {\n if (window.ShadyCSS) {\n this._observer.disconnect();\n }\n\n const child = this.children[0];\n let isHeaderTag = false;\n\n if (child) {\n switch (child.tagName) {\n case \"H1\":\n case \"H2\":\n case \"H3\":\n case \"H4\":\n case \"H5\":\n case \"H6\":\n isHeaderTag = true;\n break;\n }\n\n const wrapperTag = document.createElement(child.tagName);\n this.button.innerText = child.innerText;\n\n wrapperTag.appendChild(this.button);\n this.shadowRoot.appendChild(wrapperTag);\n } else {\n this.button.innerText = this.textContent.trim();\n }\n\n if (!isHeaderTag) {\n this.warn(`The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)`);\n }\n\n if (window.ShadyCSS) {\n this._observer.observe(this, { childList: true });\n }\n }\n\n _clickHandler(event) {\n this.emitEvent(PfeAccordion.events.change, {\n detail: {\n expanded: !this.expanded\n }\n });\n }\n\n _expandedChanged() {\n this.setAttribute(\"aria-expanded\", this.expanded);\n this.button.setAttribute(\"aria-expanded\", this.expanded);\n }\n}\n\nclass PfeAccordionPanel extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
\n
\n \n
\n
`;\n }\n\n static get tag() {\n return \"pfe-accordion-panel\";\n }\n\n get styleUrl() {\n return \"pfe-accordion-panel.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion-panel.html\";\n }\n\n static get properties() {\n return {\n _id: {\n type: String,\n default: el => `${el.randomId.replace(\"pfe\", el.tag)}`,\n prefix: false\n },\n role: {\n type: String,\n default: \"region\",\n prefix: false\n },\n // @TODO Deprecated pfe-id in 1.0\n oldPfeId: {\n type: String,\n alias: \"_id\",\n attr: \"pfe-id\"\n },\n expanded: {\n title: \"Expanded\",\n type: Boolean,\n default: false\n },\n ariaLabelledby: {\n type: String,\n prefix: false\n }\n };\n }\n\n constructor() {\n super(PfeAccordionPanel);\n }\n\n connectedCallback() {\n super.connectedCallback();\n }\n}\n\nPFElement.create(PfeAccordionHeader);\nPFElement.create(PfeAccordionPanel);\nPFElement.create(PfeAccordion);\n\nexport { PfeAccordion as default };\n"],"names":[],"mappings":";;AAAA;AACA;AACA,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE;AAChC,EAAE,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE;AACtD,IAAI,KAAK,EAAE,SAAS,SAAS,EAAE;AAC/B;AACA,MAAM,IAAI,IAAI,IAAI,IAAI,EAAE;AACxB,QAAQ,MAAM,IAAI,SAAS,CAAC,+BAA+B,CAAC,CAAC;AAC7D,OAAO;AACP;AACA,MAAM,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAC3B;AACA;AACA,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AAC/B;AACA;AACA,MAAM,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE;AAC3C,QAAQ,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;AAC5D,OAAO;AACP;AACA;AACA,MAAM,IAAI,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AACjC;AACA;AACA,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;AAChB;AACA;AACA,MAAM,OAAO,CAAC,GAAG,GAAG,EAAE;AACtB;AACA;AACA;AACA;AACA,QAAQ,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;AACnD,UAAU,OAAO,CAAC,CAAC;AACnB,SAAS;AACT;AACA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,EAAE,QAAQ;AACtB,OAAO;AACP,MAAM,QAAQ,EAAE;AAChB,QAAQ,KAAK,EAAE,UAAU;AACzB,QAAQ,IAAI,EAAE,OAAO;AACrB,QAAQ,OAAO,EAAE,KAAK;AACtB,OAAO;AACP,MAAM,cAAc,EAAE;AACtB,QAAQ,IAAI,EAAE,MAAM;AACpB,QAAQ,MAAM,EAAE,KAAK;AACrB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH;AACA,EAAE,WAAW,GAAG;AAChB,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAC7B,GAAG;AACH;AACA,EAAE,iBAAiB,GAAG;AACtB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;AAC9B,GAAG;AACH,CAAC;AACD;AACA,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACrC,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACpC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/elements/pfe-accordion/dist/pfe-accordion.min.css.map b/elements/pfe-accordion/dist/pfe-accordion.min.css.map new file mode 100644 index 0000000000..1a03cdb190 --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/pfe-accordion.scss","../../../pfe-sass/mixins/_custom-properties.scss","../../../pfe-sass/mixins/_mixins.scss"],"names":[],"mappings":"AAEA,MCkGM,qCAAA,YAAA,6BAAA,kDAAA,gCAAA,6CAAA,kCAAA,EAAA,mCAAA,6CAAA,iCAAA,oDAAA,uBAAA,sCAAA,2BAAA,KAAA,wBAAA,yCAJE,+BAAA,yCD3FN,QAAA,MACA,SAAA,SACA,SAAA,OACA,OAAA,EACA,MAAA,QAAA,MAAA,iEENI,6CAAA,oCFDN,MAUI,iBAAA,eACA,MAAA,mBAIJ,iBCmFM,wBAAA,qDD/EN,sBC+EM,wBAAA,uDD3EN,yBC2EM,kCAAA,6CAAA,iCAAA,6CAAA,qCAAA,kDDtEN,gBACE,QAAA","file":"pfe-accordion.min.css","sourceRoot":"../src","sourcesContent":[]} \ No newline at end of file diff --git a/elements/pfe-accordion/dist/pfe-accordion.min.js b/elements/pfe-accordion/dist/pfe-accordion.min.js new file mode 100644 index 0000000000..8aac888a12 --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion.min.js @@ -0,0 +1,26 @@ +import e from"../../pfelement/dist/pfelement.min.js";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),t=r.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var o=arguments[1],a=0;a:host{--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion__base--Padding:var(--pfe-theme--container-spacer, 1rem);display:block;position:relative;overflow:hidden;margin:0;color:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;color:#151515!important}}:host([on=dark]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7)}:host([on=saturated]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff)}:host([disclosure=true]){--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderLeftWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--surface--border, #d2d2d2)}:host([hidden]){display:none} /*# sourceMappingURL=pfe-accordion.min.css.map */\n"}static get tag(){return"pfe-accordion"}static get meta(){return{title:"Accordion",description:"This element renders content sets in an expandable format."}}get styleUrl(){return"pfe-accordion.scss"}get templateUrl(){return"pfe-accordion.html"}static get properties(){return{disclosure:{title:"Disclosure",type:String,values:["true","false"],observer:"_disclosureChanged",cascade:["pfe-accordion-header","pfe-accordion-panel"]},oldDisclosure:{type:String,alias:"disclosure",attr:"pfe-disclosure"},role:{type:String,default:"tablist",values:["tablist"]}}}static get slots(){return{default:{type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-accordion-header"},{$ref:"pfe-accordion-panel"}]}}}}static get events(){return{change:`${this.tag}:change`}}static get PfeType(){return e.PfeTypes.Container}static get contentTemplate(){return'\n \n \n '}constructor(){super(r,{type:r.PfeType}),this._linkPanels=this._linkPanels.bind(this),this._observer=new MutationObserver(this._linkPanels)}connectedCallback(){super.connectedCallback(),this.addEventListener(r.events.change,this._changeHandler),this.addEventListener("keydown",this._keydownHandler),Promise.all([customElements.whenDefined(t.tag),customElements.whenDefined(o.tag)]).then(()=>{this.hasLightDOM()&&this._linkPanels(),this._observer.observe(this,{childList:!0})})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(r.events.change,this._changeHandler),this.removeEventListener("keydown",this._keydownHandler),this._observer.disconnect()}toggle(e){const r=this._allHeaders(),t=this._allPanels(),o=r[e],a=t[e];o&&a&&(o.expanded?(this._collapseHeader(o),this._collapsePanel(a)):(this._expandHeader(o),this._expandPanel(a)))}expand(e){const r=this._allHeaders(),t=this._allPanels(),o=r[e],a=t[e];o&&a&&(this._expandHeader(o),this._expandPanel(a))}expandAll(){const e=this._allHeaders(),r=this._allPanels();e.forEach(e=>this._expandHeader(e)),r.forEach(e=>this._expandPanel(e))}collapse(e){const r=this._allHeaders(),t=this._allPanels(),o=r[e],a=t[e];o&&a&&(this._collapseHeader(o),this._collapsePanel(a))}collapseAll(){const e=this._allHeaders(),r=this._allPanels();e.forEach(e=>this._collapseHeader(e)),r.forEach(e=>this._collapsePanel(e))}_disclosureChanged(e,r){"true"===r?(this._allHeaders().forEach(e=>e.setAttribute("pfe-disclosure","true")),this._allPanels().forEach(e=>e.setAttribute("pfe-disclosure","true")),this.oldDisclosure="true"):(this._allHeaders().forEach(e=>e.setAttribute("pfe-disclosure","false")),this._allPanels().forEach(e=>e.setAttribute("pfe-disclosure","false")),this.oldDisclosure="false")}_linkPanels(){const e=this._allHeaders();if(e.forEach(e=>{const r=this._panelForHeader(e);r&&(e.ariaControls=r._id,r.ariaLabelledby=e._id)}),1===e.length){if("false"===this.disclosure)return;this.disclosure="true"}e.length>1&&this.disclosure&&(this.disclosure="false")}_changeHandler(e){if(this.classList.contains("animating"))return;const r=e.target,t=e.target.nextElementSibling;e.detail.expanded?(this._expandHeader(r),this._expandPanel(t)):(this._collapseHeader(r),this._collapsePanel(t))}_expandHeader(e){e.expanded=!0}_expandPanel(e){if(!e)return void console.error(`${r.tag}: Trying to expand a panel that doesn't exist`);if(e.expanded)return;e.expanded=!0;const t=e.getBoundingClientRect().height;this._animate(e,0,t)}_collapseHeader(e){e.expanded=!1}_collapsePanel(e){if(!e)return void console.error(`${r.tag}: Trying to collapse a panel that doesn't exist`);if(!e.expanded)return;const t=e.getBoundingClientRect().height;e.expanded=!1,this._animate(e,t,0)}_animate(e,r,t){if(e){const o=e.previousElementSibling;o&&o.classList.add("animating"),e.classList.add("animating"),e.style.height=`${r}px`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.height=`${t}px`,e.addEventListener("transitionend",this._transitionEndHandler)})})}}_keydownHandler(e){const r=e.target;if(!this._isHeader(r))return;let t;switch(e.key){case"ArrowDown":case"Down":case"ArrowRight":case"Right":t=this._nextHeader();break;case"ArrowUp":case"Up":case"ArrowLeft":case"Left":t=this._previousHeader();break;case"Home":t=this._firstHeader();break;case"End":t=this._lastHeader();break;default:return}t.shadowRoot.querySelector("button").focus()}_transitionEndHandler(e){const r=e.target.previousElementSibling;r&&r.classList.remove("animating"),e.target.style.height="",e.target.classList.remove("animating"),e.target.removeEventListener("transitionend",this._transitionEndHandler)}_allHeaders(){return[...this.querySelectorAll(t.tag)]}_allPanels(){return[...this.querySelectorAll(o.tag)]}_panelForHeader(e){const t=e.nextElementSibling;if(t){if(t.tagName.toLowerCase()===o.tag)return t;console.error(`${r.tag}: Sibling element to a header needs to be a panel`)}}_previousHeader(){const e=this._allHeaders();let r=e.findIndex(e=>e===document.activeElement)-1;return e[(r+e.length)%e.length]}_nextHeader(){const e=this._allHeaders();let r=e.findIndex(e=>e===document.activeElement)+1;return e[r%e.length]}_firstHeader(){return this._allHeaders()[0]}_lastHeader(){const e=this._allHeaders();return e[e.length-1]}_isHeader(e){return e.tagName.toLowerCase()===t.tag}}class t extends e{static get version(){return"1.3.0"}get html(){return'\n\n'}static get tag(){return"pfe-accordion-header"}get styleUrl(){return"pfe-accordion-header.scss"}get templateUrl(){return"pfe-accordion-header.html"}static get properties(){return{_id:{type:String,default:e=>`${e.randomId.replace("pfe",e.tag)}`,prefix:!1},role:{type:String,default:"heading",prefix:!1},ariaControls:{type:String,prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,observer:"_expandedChanged",cascade:"#pfe-accordion-header--button",observer:"_expandedChanged"}}}constructor(){super(t),this.button=this.shadowRoot.querySelector("button"),this._init=this._init.bind(this),this._clickHandler=this._clickHandler.bind(this),this._observer=new MutationObserver(this._init)}connectedCallback(){super.connectedCallback(),this.hasLightDOM()&&this._init(),this.addEventListener("click",this._clickHandler),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._clickHandler),this._observer.disconnect()}_init(){window.ShadyCSS&&this._observer.disconnect();const e=this.children[0];let r=!1;if(e){switch(e.tagName){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":r=!0}const t=document.createElement(e.tagName);this.button.innerText=e.innerText,t.appendChild(this.button),this.shadowRoot.appendChild(t)}else this.button.innerText=this.textContent.trim();r||this.warn("The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)"),window.ShadyCSS&&this._observer.observe(this,{childList:!0})}_clickHandler(e){this.emitEvent(r.events.change,{detail:{expanded:!this.expanded}})}_expandedChanged(){this.setAttribute("aria-expanded",this.expanded),this.button.setAttribute("aria-expanded",this.expanded)}}class o extends e{static get version(){return"1.3.0"}get html(){return'\n\n
\n
\n \n
\n
'}static get tag(){return"pfe-accordion-panel"}get styleUrl(){return"pfe-accordion-panel.scss"}get templateUrl(){return"pfe-accordion-panel.html"}static get properties(){return{_id:{type:String,default:e=>`${e.randomId.replace("pfe",e.tag)}`,prefix:!1},role:{type:String,default:"region",prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,default:!1},ariaLabelledby:{type:String,prefix:!1}}}constructor(){super(o)}connectedCallback(){super.connectedCallback()}}e.create(t),e.create(o),e.create(r);export default r; +//# sourceMappingURL=pfe-accordion.min.js.map diff --git a/elements/pfe-accordion/dist/pfe-accordion.min.js.map b/elements/pfe-accordion/dist/pfe-accordion.min.js.map new file mode 100644 index 0000000000..7f6c15393d --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-accordion.min.js","sources":["../_temp/polyfills--pfe-accordion.js","../_temp/pfe-accordion.js"],"sourcesContent":["// @POLYFILL Array.prototype.findIndex\n// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\nif (!Array.prototype.findIndex) {\n Object.defineProperty(Array.prototype, \"findIndex\", {\n value: function(predicate) {\n // 1. Let O be ? ToObject(this value).\n if (this == null) {\n throw new TypeError('\"this\" is null or not defined');\n }\n\n var o = Object(this);\n\n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n var len = o.length >>> 0;\n\n // 3. If IsCallable(predicate) is false, throw a TypeError exception.\n if (typeof predicate !== \"function\") {\n throw new TypeError(\"predicate must be a function\");\n }\n\n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n var thisArg = arguments[1];\n\n // 5. Let k be 0.\n var k = 0;\n\n // 6. Repeat, while k < len\n while (k < len) {\n // a. Let Pk be ! ToString(k).\n // b. Let kValue be ? Get(O, Pk).\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n // d. If testResult is true, return k.\n var kValue = o[k];\n if (predicate.call(thisArg, kValue, k, o)) {\n return k;\n }\n // e. Increase k by 1.\n k++;\n }\n\n // 7. Return -1.\n return -1;\n }\n });\n}\n","/*!\n * PatternFly Elements: PfeAccordion 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: findIndex\nimport \"./polyfills--pfe-accordion.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\nclass PfeAccordion extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n static get tag() {\n return \"pfe-accordion\";\n }\n\n static get meta() {\n return {\n title: \"Accordion\",\n description: \"This element renders content sets in an expandable format.\"\n };\n }\n\n get styleUrl() {\n return \"pfe-accordion.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion.html\";\n }\n\n static get properties() {\n return {\n disclosure: {\n // Leaving this as a string since it's an opt out\n title: \"Disclosure\",\n type: String,\n values: [\"true\", \"false\"],\n observer: \"_disclosureChanged\",\n cascade: [\"pfe-accordion-header\", \"pfe-accordion-panel\"]\n },\n // @TODO: Deprecated pfe-disclosure in 1.0\n oldDisclosure: {\n type: String,\n alias: \"disclosure\",\n attr: \"pfe-disclosure\"\n },\n role: {\n type: String,\n default: \"tablist\",\n values: [\"tablist\"]\n }\n };\n }\n\n static get slots() {\n return {\n default: {\n type: \"array\",\n namedSlot: false,\n items: {\n oneOf: [\n {\n $ref: \"pfe-accordion-header\"\n },\n {\n $ref: \"pfe-accordion-panel\"\n }\n ]\n }\n }\n };\n }\n\n static get events() {\n return {\n change: `${this.tag}:change`\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n // Each set contains a header and a panel\n static get contentTemplate() {\n return `\n \n \n `;\n }\n\n constructor() {\n super(PfeAccordion, { type: PfeAccordion.PfeType });\n\n this._linkPanels = this._linkPanels.bind(this);\n this._observer = new MutationObserver(this._linkPanels);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener(PfeAccordion.events.change, this._changeHandler);\n this.addEventListener(\"keydown\", this._keydownHandler);\n\n Promise.all([\n customElements.whenDefined(PfeAccordionHeader.tag),\n customElements.whenDefined(PfeAccordionPanel.tag)\n ]).then(() => {\n if (this.hasLightDOM()) {\n this._linkPanels();\n }\n\n this._observer.observe(this, { childList: true });\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(PfeAccordion.events.change, this._changeHandler);\n this.removeEventListener(\"keydown\", this._keydownHandler);\n this._observer.disconnect();\n }\n\n toggle(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n if (!header.expanded) {\n this._expandHeader(header);\n this._expandPanel(panel);\n } else {\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n }\n\n expand(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n this._expandHeader(header);\n this._expandPanel(panel);\n }\n\n expandAll() {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n\n headers.forEach(header => this._expandHeader(header));\n panels.forEach(panel => this._expandPanel(panel));\n }\n\n collapse(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n\n collapseAll() {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n\n headers.forEach(header => this._collapseHeader(header));\n panels.forEach(panel => this._collapsePanel(panel));\n }\n\n _disclosureChanged(oldVal, newVal) {\n if (newVal === \"true\") {\n this._allHeaders().forEach(header => header.setAttribute(\"pfe-disclosure\", \"true\"));\n this._allPanels().forEach(panel => panel.setAttribute(\"pfe-disclosure\", \"true\"));\n\n // @TODO Deprecated in 1.0\n this.oldDisclosure = \"true\";\n } else {\n this._allHeaders().forEach(header => header.setAttribute(\"pfe-disclosure\", \"false\"));\n this._allPanels().forEach(panel => panel.setAttribute(\"pfe-disclosure\", \"false\"));\n\n // @TODO Deprecated in 1.0\n this.oldDisclosure = \"false\";\n }\n }\n\n _linkPanels() {\n const headers = this._allHeaders();\n headers.forEach(header => {\n const panel = this._panelForHeader(header);\n\n if (!panel) {\n return;\n }\n\n header.ariaControls = panel._id;\n panel.ariaLabelledby = header._id;\n });\n\n if (headers.length === 1) {\n if (this.disclosure === \"false\") {\n return;\n }\n\n this.disclosure = \"true\";\n }\n\n if (headers.length > 1) {\n if (this.disclosure) {\n this.disclosure = \"false\";\n }\n }\n }\n\n _changeHandler(evt) {\n if (this.classList.contains(\"animating\")) {\n return;\n }\n\n const header = evt.target;\n const panel = evt.target.nextElementSibling;\n\n if (evt.detail.expanded) {\n this._expandHeader(header);\n this._expandPanel(panel);\n } else {\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n }\n\n _expandHeader(header) {\n header.expanded = true;\n }\n\n _expandPanel(panel) {\n if (!panel) {\n console.error(`${PfeAccordion.tag}: Trying to expand a panel that doesn't exist`);\n return;\n }\n\n if (panel.expanded) {\n return;\n }\n\n panel.expanded = true;\n\n const height = panel.getBoundingClientRect().height;\n this._animate(panel, 0, height);\n }\n\n _collapseHeader(header) {\n header.expanded = false;\n }\n\n _collapsePanel(panel) {\n if (!panel) {\n console.error(`${PfeAccordion.tag}: Trying to collapse a panel that doesn't exist`);\n return;\n }\n\n if (!panel.expanded) {\n return;\n }\n\n const height = panel.getBoundingClientRect().height;\n panel.expanded = false;\n\n this._animate(panel, height, 0);\n }\n\n _animate(panel, start, end) {\n if (panel) {\n const header = panel.previousElementSibling;\n if (header) {\n header.classList.add(\"animating\");\n }\n panel.classList.add(\"animating\");\n panel.style.height = `${start}px`;\n\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n panel.style.height = `${end}px`;\n panel.addEventListener(\"transitionend\", this._transitionEndHandler);\n });\n });\n }\n }\n\n _keydownHandler(evt) {\n const currentHeader = evt.target;\n\n if (!this._isHeader(currentHeader)) {\n return;\n }\n\n let newHeader;\n\n switch (evt.key) {\n case \"ArrowDown\":\n case \"Down\":\n case \"ArrowRight\":\n case \"Right\":\n newHeader = this._nextHeader();\n break;\n case \"ArrowUp\":\n case \"Up\":\n case \"ArrowLeft\":\n case \"Left\":\n newHeader = this._previousHeader();\n break;\n case \"Home\":\n newHeader = this._firstHeader();\n break;\n case \"End\":\n newHeader = this._lastHeader();\n break;\n default:\n return;\n }\n\n newHeader.shadowRoot.querySelector(\"button\").focus();\n }\n\n _transitionEndHandler(evt) {\n const header = evt.target.previousElementSibling;\n if (header) {\n header.classList.remove(\"animating\");\n }\n evt.target.style.height = \"\";\n evt.target.classList.remove(\"animating\");\n evt.target.removeEventListener(\"transitionend\", this._transitionEndHandler);\n }\n\n _allHeaders() {\n return [...this.querySelectorAll(PfeAccordionHeader.tag)];\n }\n\n _allPanels() {\n return [...this.querySelectorAll(PfeAccordionPanel.tag)];\n }\n\n _panelForHeader(header) {\n const next = header.nextElementSibling;\n\n if (!next) {\n return;\n }\n\n if (next.tagName.toLowerCase() !== PfeAccordionPanel.tag) {\n console.error(`${PfeAccordion.tag}: Sibling element to a header needs to be a panel`);\n return;\n }\n\n return next;\n }\n\n _previousHeader() {\n const headers = this._allHeaders();\n let newIndex = headers.findIndex(header => header === document.activeElement) - 1;\n return headers[(newIndex + headers.length) % headers.length];\n }\n\n _nextHeader() {\n const headers = this._allHeaders();\n let newIndex = headers.findIndex(header => header === document.activeElement) + 1;\n return headers[newIndex % headers.length];\n }\n\n _firstHeader() {\n const headers = this._allHeaders();\n return headers[0];\n }\n\n _lastHeader() {\n const headers = this._allHeaders();\n return headers[headers.length - 1];\n }\n\n _isHeader(element) {\n return element.tagName.toLowerCase() === PfeAccordionHeader.tag;\n }\n}\n\nclass PfeAccordionHeader extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n static get tag() {\n return \"pfe-accordion-header\";\n }\n\n get styleUrl() {\n return \"pfe-accordion-header.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion-header.html\";\n }\n\n static get properties() {\n return {\n _id: {\n type: String,\n default: el => `${el.randomId.replace(\"pfe\", el.tag)}`,\n prefix: false\n },\n role: {\n type: String,\n default: \"heading\",\n prefix: false\n },\n ariaControls: {\n type: String,\n prefix: false\n },\n // @TODO Deprecated pfe-id in 1.0\n oldPfeId: {\n type: String,\n alias: \"_id\",\n attr: \"pfe-id\"\n },\n expanded: {\n title: \"Expanded\",\n type: Boolean,\n observer: \"_expandedChanged\",\n cascade: \"#pfe-accordion-header--button\",\n observer: \"_expandedChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeAccordionHeader);\n\n this.button = this.shadowRoot.querySelector(\"button\");\n\n this._init = this._init.bind(this);\n this._clickHandler = this._clickHandler.bind(this);\n this._observer = new MutationObserver(this._init);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.hasLightDOM()) this._init();\n\n this.addEventListener(\"click\", this._clickHandler);\n this._observer.observe(this, { childList: true });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"click\", this._clickHandler);\n this._observer.disconnect();\n }\n\n _init() {\n if (window.ShadyCSS) {\n this._observer.disconnect();\n }\n\n const child = this.children[0];\n let isHeaderTag = false;\n\n if (child) {\n switch (child.tagName) {\n case \"H1\":\n case \"H2\":\n case \"H3\":\n case \"H4\":\n case \"H5\":\n case \"H6\":\n isHeaderTag = true;\n break;\n }\n\n const wrapperTag = document.createElement(child.tagName);\n this.button.innerText = child.innerText;\n\n wrapperTag.appendChild(this.button);\n this.shadowRoot.appendChild(wrapperTag);\n } else {\n this.button.innerText = this.textContent.trim();\n }\n\n if (!isHeaderTag) {\n this.warn(`The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)`);\n }\n\n if (window.ShadyCSS) {\n this._observer.observe(this, { childList: true });\n }\n }\n\n _clickHandler(event) {\n this.emitEvent(PfeAccordion.events.change, {\n detail: {\n expanded: !this.expanded\n }\n });\n }\n\n _expandedChanged() {\n this.setAttribute(\"aria-expanded\", this.expanded);\n this.button.setAttribute(\"aria-expanded\", this.expanded);\n }\n}\n\nclass PfeAccordionPanel extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
\n
\n \n
\n
`;\n }\n\n static get tag() {\n return \"pfe-accordion-panel\";\n }\n\n get styleUrl() {\n return \"pfe-accordion-panel.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion-panel.html\";\n }\n\n static get properties() {\n return {\n _id: {\n type: String,\n default: el => `${el.randomId.replace(\"pfe\", el.tag)}`,\n prefix: false\n },\n role: {\n type: String,\n default: \"region\",\n prefix: false\n },\n // @TODO Deprecated pfe-id in 1.0\n oldPfeId: {\n type: String,\n alias: \"_id\",\n attr: \"pfe-id\"\n },\n expanded: {\n title: \"Expanded\",\n type: Boolean,\n default: false\n },\n ariaLabelledby: {\n type: String,\n prefix: false\n }\n };\n }\n\n constructor() {\n super(PfeAccordionPanel);\n }\n\n connectedCallback() {\n super.connectedCallback();\n }\n}\n\nPFElement.create(PfeAccordionHeader);\nPFElement.create(PfeAccordionPanel);\nPFElement.create(PfeAccordion);\n\nexport { PfeAccordion as default };\n"],"names":["Array","prototype","findIndex","Object","defineProperty","value","predicate","this","TypeError","o","len","length","thisArg","arguments","k","kValue","call","PfeAccordion","PFElement","version","html","tag","meta","title","description","styleUrl","templateUrl","properties","disclosure","type","String","values","observer","cascade","oldDisclosure","alias","attr","role","default","slots","namedSlot","items","oneOf","$ref","events","change","PfeType","PfeTypes","Container","contentTemplate","[object Object]","super","_linkPanels","bind","_observer","MutationObserver","connectedCallback","addEventListener","_changeHandler","_keydownHandler","Promise","all","customElements","whenDefined","PfeAccordionHeader","PfeAccordionPanel","then","hasLightDOM","observe","childList","disconnectedCallback","removeEventListener","disconnect","index","headers","_allHeaders","panels","_allPanels","header","panel","expanded","_collapseHeader","_collapsePanel","_expandHeader","_expandPanel","forEach","oldVal","newVal","setAttribute","_panelForHeader","ariaControls","_id","ariaLabelledby","evt","classList","contains","target","nextElementSibling","detail","console","error","height","getBoundingClientRect","_animate","start","end","previousElementSibling","add","style","requestAnimationFrame","_transitionEndHandler","currentHeader","_isHeader","newHeader","key","_nextHeader","_previousHeader","_firstHeader","_lastHeader","shadowRoot","querySelector","focus","remove","querySelectorAll","next","tagName","toLowerCase","newIndex","document","activeElement","element","el","randomId","replace","prefix","oldPfeId","Boolean","button","_init","_clickHandler","window","ShadyCSS","child","children","isHeaderTag","wrapperTag","createElement","innerText","appendChild","textContent","trim","warn","event","emitEvent","create"],"mappings":"qDAEKA,MAAMC,UAAUC,WACnBC,OAAOC,eAAeJ,MAAMC,UAAW,YAAa,CAClDI,MAAO,SAASC,GAEd,GAAY,MAARC,KACF,MAAM,IAAIC,UAAU,iCAGtB,IAAIC,EAAIN,OAAOI,MAGXG,EAAMD,EAAEE,SAAW,EAGvB,GAAyB,mBAAdL,EACT,MAAM,IAAIE,UAAU,gCAUtB,IANA,IAAII,EAAUC,UAAU,GAGpBC,EAAI,EAGDA,EAAIJ,GAAK,CAKd,IAAIK,EAASN,EAAEK,GACf,GAAIR,EAAUU,KAAKJ,EAASG,EAAQD,EAAGL,GACrC,OAAOK,EAGTA,IAIF,OAAQ;;;;;;;;;;;;;;;;;;;;;;;;GCXd,MAAMG,UAAqBC,EAGzBC,qBACE,MAAO,QAITC,WACE,MAAO,k+CAKTC,iBACE,MAAO,gBAGTC,kBACE,MAAO,CACLC,MAAO,YACPC,YAAa,8DAIjBC,eACE,MAAO,qBAGTC,kBACE,MAAO,qBAGTC,wBACE,MAAO,CACLC,WAAY,CAEVL,MAAO,aACPM,KAAMC,OACNC,OAAQ,CAAC,OAAQ,SACjBC,SAAU,qBACVC,QAAS,CAAC,uBAAwB,wBAGpCC,cAAe,CACbL,KAAMC,OACNK,MAAO,aACPC,KAAM,kBAERC,KAAM,CACJR,KAAMC,OACNQ,QAAS,UACTP,OAAQ,CAAC,aAKfQ,mBACE,MAAO,CACLD,QAAS,CACPT,KAAM,QACNW,WAAW,EACXC,MAAO,CACLC,MAAO,CACL,CACEC,KAAM,wBAER,CACEA,KAAM,2BAQlBC,oBACE,MAAO,CACLC,UAAWtC,KAAKc,cAKpByB,qBACE,OAAO5B,E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,CACNlB,UAAWzE,KAAKyE,YAKtB9B,mBACE3C,KAAKiF,aAAa,gBAAiBjF,KAAKyE,UACxCzE,KAAKkI,OAAOjD,aAAa,gBAAiBjF,KAAKyE,WAInD,MAAMf,UAA0B/C,EAG9BC,qBACE,MAAO,QAITC,WACE,MAAO,+7JASTC,iBACE,MAAO,sBAGTI,eACE,MAAO,2BAGTC,kBACE,MAAO,2BAGTC,wBACE,MAAO,CACLgE,IAAK,CACH9D,KAAMC,OACNQ,QAAS6F,MAASA,EAAGC,SAASC,QAAQ,MAAOF,EAAG9G,OAChDiH,QAAQ,GAEVjG,KAAM,CACJR,KAAMC,OACNQ,QAAS,SACTgG,QAAQ,GAGVC,SAAU,CACR1G,KAAMC,OACNK,MAAO,MACPC,KAAM,UAER4C,SAAU,CACRzD,MAAO,WACPM,KAAM2G,QACNlG,SAAS,GAEXsD,eAAgB,CACd/D,KAAMC,OACNwG,QAAQ,IAKdpF,cACEC,MAAMc,GAGRf,oBACEC,MAAMK,qBAIVtC,EAAUwI,OAAO1F,GACjB9C,EAAUwI,OAAOzF,GACjB/C,EAAUwI,OAAOzI"} \ No newline at end of file diff --git a/elements/pfe-accordion/dist/pfe-accordion.umd.js b/elements/pfe-accordion/dist/pfe-accordion.umd.js new file mode 100644 index 0000000000..75e069433e --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion.umd.js @@ -0,0 +1,901 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../../pfelement/dist/pfelement.umd')) : + typeof define === 'function' && define.amd ? define(['../../pfelement/dist/pfelement.umd'], factory) : + (global = global || self, global.PfeAccordion = factory(global.PFElement)); +}(this, (function (PFElement) { 'use strict'; + + PFElement = PFElement && Object.prototype.hasOwnProperty.call(PFElement, 'default') ? PFElement['default'] : PFElement; + + // @POLYFILL Array.prototype.findIndex + // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex + if (!Array.prototype.findIndex) { + Object.defineProperty(Array.prototype, "findIndex", { + value: function value(predicate) { + // 1. Let O be ? ToObject(this value). + if (this == null) { + throw new TypeError('"this" is null or not defined'); + } + + var o = Object(this); + + // 2. Let len be ? ToLength(? Get(O, "length")). + var len = o.length >>> 0; + + // 3. If IsCallable(predicate) is false, throw a TypeError exception. + if (typeof predicate !== "function") { + throw new TypeError("predicate must be a function"); + } + + // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. + var thisArg = arguments[1]; + + // 5. Let k be 0. + var k = 0; + + // 6. Repeat, while k < len + while (k < len) { + // a. Let Pk be ! ToString(k). + // b. Let kValue be ? Get(O, Pk). + // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). + // d. If testResult is true, return k. + var kValue = o[k]; + if (predicate.call(thisArg, kValue, k, o)) { + return k; + } + // e. Increase k by 1. + k++; + } + + // 7. Return -1. + return -1; + } + }); + } + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + var defineProperty = function (obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + }; + + var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } + }; + + var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + }; + + var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + }; + + var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } + }; + + /*! + * PatternFly Elements: PfeAccordion 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + var PfeAccordion = function (_PFElement) { + inherits(PfeAccordion, _PFElement); + createClass(PfeAccordion, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-accordion.scss"; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-accordion.html"; + } + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "tag", + get: function get() { + return "pfe-accordion"; + } + }, { + key: "meta", + get: function get() { + return { + title: "Accordion", + description: "This element renders content sets in an expandable format." + }; + } + }, { + key: "properties", + get: function get() { + return { + disclosure: { + // Leaving this as a string since it's an opt out + title: "Disclosure", + type: String, + values: ["true", "false"], + observer: "_disclosureChanged", + cascade: ["pfe-accordion-header", "pfe-accordion-panel"] + }, + // @TODO: Deprecated pfe-disclosure in 1.0 + oldDisclosure: { + type: String, + alias: "disclosure", + attr: "pfe-disclosure" + }, + role: { + type: String, + default: "tablist", + values: ["tablist"] + } + }; + } + }, { + key: "slots", + get: function get() { + return { + default: { + type: "array", + namedSlot: false, + items: { + oneOf: [{ + $ref: "pfe-accordion-header" + }, { + $ref: "pfe-accordion-panel" + }] + } + } + }; + } + }, { + key: "events", + get: function get() { + return { + change: this.tag + ":change" + }; + } + + // Declare the type of this component + + }, { + key: "PfeType", + get: function get() { + return PFElement.PfeTypes.Container; + } + + // Each set contains a header and a panel + + }, { + key: "contentTemplate", + get: function get() { + return "\n \n \n "; + } + }]); + + function PfeAccordion() { + classCallCheck(this, PfeAccordion); + + var _this = possibleConstructorReturn(this, (PfeAccordion.__proto__ || Object.getPrototypeOf(PfeAccordion)).call(this, PfeAccordion, { type: PfeAccordion.PfeType })); + + _this._linkPanels = _this._linkPanels.bind(_this); + _this._observer = new MutationObserver(_this._linkPanels); + return _this; + } + + createClass(PfeAccordion, [{ + key: "connectedCallback", + value: function connectedCallback() { + var _this2 = this; + + get(PfeAccordion.prototype.__proto__ || Object.getPrototypeOf(PfeAccordion.prototype), "connectedCallback", this).call(this); + + this.addEventListener(PfeAccordion.events.change, this._changeHandler); + this.addEventListener("keydown", this._keydownHandler); + + Promise.all([customElements.whenDefined(PfeAccordionHeader.tag), customElements.whenDefined(PfeAccordionPanel.tag)]).then(function () { + if (_this2.hasLightDOM()) { + _this2._linkPanels(); + } + + _this2._observer.observe(_this2, { childList: true }); + }); + } + }, { + key: "disconnectedCallback", + value: function disconnectedCallback() { + get(PfeAccordion.prototype.__proto__ || Object.getPrototypeOf(PfeAccordion.prototype), "disconnectedCallback", this).call(this); + + this.removeEventListener(PfeAccordion.events.change, this._changeHandler); + this.removeEventListener("keydown", this._keydownHandler); + this._observer.disconnect(); + } + }, { + key: "toggle", + value: function toggle(index) { + var headers = this._allHeaders(); + var panels = this._allPanels(); + var header = headers[index]; + var panel = panels[index]; + + if (!header || !panel) { + return; + } + + if (!header.expanded) { + this._expandHeader(header); + this._expandPanel(panel); + } else { + this._collapseHeader(header); + this._collapsePanel(panel); + } + } + }, { + key: "expand", + value: function expand(index) { + var headers = this._allHeaders(); + var panels = this._allPanels(); + var header = headers[index]; + var panel = panels[index]; + + if (!header || !panel) { + return; + } + + this._expandHeader(header); + this._expandPanel(panel); + } + }, { + key: "expandAll", + value: function expandAll() { + var _this3 = this; + + var headers = this._allHeaders(); + var panels = this._allPanels(); + + headers.forEach(function (header) { + return _this3._expandHeader(header); + }); + panels.forEach(function (panel) { + return _this3._expandPanel(panel); + }); + } + }, { + key: "collapse", + value: function collapse(index) { + var headers = this._allHeaders(); + var panels = this._allPanels(); + var header = headers[index]; + var panel = panels[index]; + + if (!header || !panel) { + return; + } + + this._collapseHeader(header); + this._collapsePanel(panel); + } + }, { + key: "collapseAll", + value: function collapseAll() { + var _this4 = this; + + var headers = this._allHeaders(); + var panels = this._allPanels(); + + headers.forEach(function (header) { + return _this4._collapseHeader(header); + }); + panels.forEach(function (panel) { + return _this4._collapsePanel(panel); + }); + } + }, { + key: "_disclosureChanged", + value: function _disclosureChanged(oldVal, newVal) { + if (newVal === "true") { + this._allHeaders().forEach(function (header) { + return header.setAttribute("pfe-disclosure", "true"); + }); + this._allPanels().forEach(function (panel) { + return panel.setAttribute("pfe-disclosure", "true"); + }); + + // @TODO Deprecated in 1.0 + this.oldDisclosure = "true"; + } else { + this._allHeaders().forEach(function (header) { + return header.setAttribute("pfe-disclosure", "false"); + }); + this._allPanels().forEach(function (panel) { + return panel.setAttribute("pfe-disclosure", "false"); + }); + + // @TODO Deprecated in 1.0 + this.oldDisclosure = "false"; + } + } + }, { + key: "_linkPanels", + value: function _linkPanels() { + var _this5 = this; + + var headers = this._allHeaders(); + headers.forEach(function (header) { + var panel = _this5._panelForHeader(header); + + if (!panel) { + return; + } + + header.ariaControls = panel._id; + panel.ariaLabelledby = header._id; + }); + + if (headers.length === 1) { + if (this.disclosure === "false") { + return; + } + + this.disclosure = "true"; + } + + if (headers.length > 1) { + if (this.disclosure) { + this.disclosure = "false"; + } + } + } + }, { + key: "_changeHandler", + value: function _changeHandler(evt) { + if (this.classList.contains("animating")) { + return; + } + + var header = evt.target; + var panel = evt.target.nextElementSibling; + + if (evt.detail.expanded) { + this._expandHeader(header); + this._expandPanel(panel); + } else { + this._collapseHeader(header); + this._collapsePanel(panel); + } + } + }, { + key: "_expandHeader", + value: function _expandHeader(header) { + header.expanded = true; + } + }, { + key: "_expandPanel", + value: function _expandPanel(panel) { + if (!panel) { + console.error(PfeAccordion.tag + ": Trying to expand a panel that doesn't exist"); + return; + } + + if (panel.expanded) { + return; + } + + panel.expanded = true; + + var height = panel.getBoundingClientRect().height; + this._animate(panel, 0, height); + } + }, { + key: "_collapseHeader", + value: function _collapseHeader(header) { + header.expanded = false; + } + }, { + key: "_collapsePanel", + value: function _collapsePanel(panel) { + if (!panel) { + console.error(PfeAccordion.tag + ": Trying to collapse a panel that doesn't exist"); + return; + } + + if (!panel.expanded) { + return; + } + + var height = panel.getBoundingClientRect().height; + panel.expanded = false; + + this._animate(panel, height, 0); + } + }, { + key: "_animate", + value: function _animate(panel, start, end) { + var _this6 = this; + + if (panel) { + var header = panel.previousElementSibling; + if (header) { + header.classList.add("animating"); + } + panel.classList.add("animating"); + panel.style.height = start + "px"; + + requestAnimationFrame(function () { + requestAnimationFrame(function () { + panel.style.height = end + "px"; + panel.addEventListener("transitionend", _this6._transitionEndHandler); + }); + }); + } + } + }, { + key: "_keydownHandler", + value: function _keydownHandler(evt) { + var currentHeader = evt.target; + + if (!this._isHeader(currentHeader)) { + return; + } + + var newHeader = void 0; + + switch (evt.key) { + case "ArrowDown": + case "Down": + case "ArrowRight": + case "Right": + newHeader = this._nextHeader(); + break; + case "ArrowUp": + case "Up": + case "ArrowLeft": + case "Left": + newHeader = this._previousHeader(); + break; + case "Home": + newHeader = this._firstHeader(); + break; + case "End": + newHeader = this._lastHeader(); + break; + default: + return; + } + + newHeader.shadowRoot.querySelector("button").focus(); + } + }, { + key: "_transitionEndHandler", + value: function _transitionEndHandler(evt) { + var header = evt.target.previousElementSibling; + if (header) { + header.classList.remove("animating"); + } + evt.target.style.height = ""; + evt.target.classList.remove("animating"); + evt.target.removeEventListener("transitionend", this._transitionEndHandler); + } + }, { + key: "_allHeaders", + value: function _allHeaders() { + return [].concat(toConsumableArray(this.querySelectorAll(PfeAccordionHeader.tag))); + } + }, { + key: "_allPanels", + value: function _allPanels() { + return [].concat(toConsumableArray(this.querySelectorAll(PfeAccordionPanel.tag))); + } + }, { + key: "_panelForHeader", + value: function _panelForHeader(header) { + var next = header.nextElementSibling; + + if (!next) { + return; + } + + if (next.tagName.toLowerCase() !== PfeAccordionPanel.tag) { + console.error(PfeAccordion.tag + ": Sibling element to a header needs to be a panel"); + return; + } + + return next; + } + }, { + key: "_previousHeader", + value: function _previousHeader() { + var headers = this._allHeaders(); + var newIndex = headers.findIndex(function (header) { + return header === document.activeElement; + }) - 1; + return headers[(newIndex + headers.length) % headers.length]; + } + }, { + key: "_nextHeader", + value: function _nextHeader() { + var headers = this._allHeaders(); + var newIndex = headers.findIndex(function (header) { + return header === document.activeElement; + }) + 1; + return headers[newIndex % headers.length]; + } + }, { + key: "_firstHeader", + value: function _firstHeader() { + var headers = this._allHeaders(); + return headers[0]; + } + }, { + key: "_lastHeader", + value: function _lastHeader() { + var headers = this._allHeaders(); + return headers[headers.length - 1]; + } + }, { + key: "_isHeader", + value: function _isHeader(element) { + return element.tagName.toLowerCase() === PfeAccordionHeader.tag; + } + }]); + return PfeAccordion; + }(PFElement); + + var PfeAccordionHeader = function (_PFElement2) { + inherits(PfeAccordionHeader, _PFElement2); + createClass(PfeAccordionHeader, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-accordion-header.scss"; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-accordion-header.html"; + } + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "tag", + get: function get() { + return "pfe-accordion-header"; + } + }, { + key: "properties", + get: function get() { + return { + _id: { + type: String, + default: function _default(el) { + return "" + el.randomId.replace("pfe", el.tag); + }, + prefix: false + }, + role: { + type: String, + default: "heading", + prefix: false + }, + ariaControls: { + type: String, + prefix: false + }, + // @TODO Deprecated pfe-id in 1.0 + oldPfeId: { + type: String, + alias: "_id", + attr: "pfe-id" + }, + expanded: defineProperty({ + title: "Expanded", + type: Boolean, + observer: "_expandedChanged", + cascade: "#pfe-accordion-header--button" + }, "observer", "_expandedChanged") + }; + } + }]); + + function PfeAccordionHeader() { + classCallCheck(this, PfeAccordionHeader); + + var _this7 = possibleConstructorReturn(this, (PfeAccordionHeader.__proto__ || Object.getPrototypeOf(PfeAccordionHeader)).call(this, PfeAccordionHeader)); + + _this7.button = _this7.shadowRoot.querySelector("button"); + + _this7._init = _this7._init.bind(_this7); + _this7._clickHandler = _this7._clickHandler.bind(_this7); + _this7._observer = new MutationObserver(_this7._init); + return _this7; + } + + createClass(PfeAccordionHeader, [{ + key: "connectedCallback", + value: function connectedCallback() { + get(PfeAccordionHeader.prototype.__proto__ || Object.getPrototypeOf(PfeAccordionHeader.prototype), "connectedCallback", this).call(this); + + if (this.hasLightDOM()) this._init(); + + this.addEventListener("click", this._clickHandler); + this._observer.observe(this, { childList: true }); + } + }, { + key: "disconnectedCallback", + value: function disconnectedCallback() { + get(PfeAccordionHeader.prototype.__proto__ || Object.getPrototypeOf(PfeAccordionHeader.prototype), "disconnectedCallback", this).call(this); + + this.removeEventListener("click", this._clickHandler); + this._observer.disconnect(); + } + }, { + key: "_init", + value: function _init() { + if (window.ShadyCSS) { + this._observer.disconnect(); + } + + var child = this.children[0]; + var isHeaderTag = false; + + if (child) { + switch (child.tagName) { + case "H1": + case "H2": + case "H3": + case "H4": + case "H5": + case "H6": + isHeaderTag = true; + break; + } + + var wrapperTag = document.createElement(child.tagName); + this.button.innerText = child.innerText; + + wrapperTag.appendChild(this.button); + this.shadowRoot.appendChild(wrapperTag); + } else { + this.button.innerText = this.textContent.trim(); + } + + if (!isHeaderTag) { + this.warn("The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)"); + } + + if (window.ShadyCSS) { + this._observer.observe(this, { childList: true }); + } + } + }, { + key: "_clickHandler", + value: function _clickHandler(event) { + this.emitEvent(PfeAccordion.events.change, { + detail: { + expanded: !this.expanded + } + }); + } + }, { + key: "_expandedChanged", + value: function _expandedChanged() { + this.setAttribute("aria-expanded", this.expanded); + this.button.setAttribute("aria-expanded", this.expanded); + } + }]); + return PfeAccordionHeader; + }(PFElement); + + var PfeAccordionPanel = function (_PFElement3) { + inherits(PfeAccordionPanel, _PFElement3); + createClass(PfeAccordionPanel, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n
\n
\n \n
\n
"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-accordion-panel.scss"; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-accordion-panel.html"; + } + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "tag", + get: function get() { + return "pfe-accordion-panel"; + } + }, { + key: "properties", + get: function get() { + return { + _id: { + type: String, + default: function _default(el) { + return "" + el.randomId.replace("pfe", el.tag); + }, + prefix: false + }, + role: { + type: String, + default: "region", + prefix: false + }, + // @TODO Deprecated pfe-id in 1.0 + oldPfeId: { + type: String, + alias: "_id", + attr: "pfe-id" + }, + expanded: { + title: "Expanded", + type: Boolean, + default: false + }, + ariaLabelledby: { + type: String, + prefix: false + } + }; + } + }]); + + function PfeAccordionPanel() { + classCallCheck(this, PfeAccordionPanel); + return possibleConstructorReturn(this, (PfeAccordionPanel.__proto__ || Object.getPrototypeOf(PfeAccordionPanel)).call(this, PfeAccordionPanel)); + } + + createClass(PfeAccordionPanel, [{ + key: "connectedCallback", + value: function connectedCallback() { + get(PfeAccordionPanel.prototype.__proto__ || Object.getPrototypeOf(PfeAccordionPanel.prototype), "connectedCallback", this).call(this); + } + }]); + return PfeAccordionPanel; + }(PFElement); + + PFElement.create(PfeAccordionHeader); + PFElement.create(PfeAccordionPanel); + PFElement.create(PfeAccordion); + + return PfeAccordion; + +}))); +//# sourceMappingURL=pfe-accordion.umd.js.map diff --git a/elements/pfe-accordion/dist/pfe-accordion.umd.js.map b/elements/pfe-accordion/dist/pfe-accordion.umd.js.map new file mode 100644 index 0000000000..991359bc13 --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-accordion.umd.js","sources":["../_temp/polyfills--pfe-accordion.js","../_temp/pfe-accordion.umd.js"],"sourcesContent":["// @POLYFILL Array.prototype.findIndex\n// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\nif (!Array.prototype.findIndex) {\n Object.defineProperty(Array.prototype, \"findIndex\", {\n value: function(predicate) {\n // 1. Let O be ? ToObject(this value).\n if (this == null) {\n throw new TypeError('\"this\" is null or not defined');\n }\n\n var o = Object(this);\n\n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n var len = o.length >>> 0;\n\n // 3. If IsCallable(predicate) is false, throw a TypeError exception.\n if (typeof predicate !== \"function\") {\n throw new TypeError(\"predicate must be a function\");\n }\n\n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n var thisArg = arguments[1];\n\n // 5. Let k be 0.\n var k = 0;\n\n // 6. Repeat, while k < len\n while (k < len) {\n // a. Let Pk be ! ToString(k).\n // b. Let kValue be ? Get(O, Pk).\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n // d. If testResult is true, return k.\n var kValue = o[k];\n if (predicate.call(thisArg, kValue, k, o)) {\n return k;\n }\n // e. Increase k by 1.\n k++;\n }\n\n // 7. Return -1.\n return -1;\n }\n });\n}\n","/*!\n * PatternFly Elements: PfeAccordion 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: findIndex\nimport \"./polyfills--pfe-accordion.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\n\nclass PfeAccordion extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n static get tag() {\n return \"pfe-accordion\";\n }\n\n static get meta() {\n return {\n title: \"Accordion\",\n description: \"This element renders content sets in an expandable format.\"\n };\n }\n\n get styleUrl() {\n return \"pfe-accordion.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion.html\";\n }\n\n static get properties() {\n return {\n disclosure: {\n // Leaving this as a string since it's an opt out\n title: \"Disclosure\",\n type: String,\n values: [\"true\", \"false\"],\n observer: \"_disclosureChanged\",\n cascade: [\"pfe-accordion-header\", \"pfe-accordion-panel\"]\n },\n // @TODO: Deprecated pfe-disclosure in 1.0\n oldDisclosure: {\n type: String,\n alias: \"disclosure\",\n attr: \"pfe-disclosure\"\n },\n role: {\n type: String,\n default: \"tablist\",\n values: [\"tablist\"]\n }\n };\n }\n\n static get slots() {\n return {\n default: {\n type: \"array\",\n namedSlot: false,\n items: {\n oneOf: [\n {\n $ref: \"pfe-accordion-header\"\n },\n {\n $ref: \"pfe-accordion-panel\"\n }\n ]\n }\n }\n };\n }\n\n static get events() {\n return {\n change: `${this.tag}:change`\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n // Each set contains a header and a panel\n static get contentTemplate() {\n return `\n \n \n `;\n }\n\n constructor() {\n super(PfeAccordion, { type: PfeAccordion.PfeType });\n\n this._linkPanels = this._linkPanels.bind(this);\n this._observer = new MutationObserver(this._linkPanels);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener(PfeAccordion.events.change, this._changeHandler);\n this.addEventListener(\"keydown\", this._keydownHandler);\n\n Promise.all([\n customElements.whenDefined(PfeAccordionHeader.tag),\n customElements.whenDefined(PfeAccordionPanel.tag)\n ]).then(() => {\n if (this.hasLightDOM()) {\n this._linkPanels();\n }\n\n this._observer.observe(this, { childList: true });\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(PfeAccordion.events.change, this._changeHandler);\n this.removeEventListener(\"keydown\", this._keydownHandler);\n this._observer.disconnect();\n }\n\n toggle(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n if (!header.expanded) {\n this._expandHeader(header);\n this._expandPanel(panel);\n } else {\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n }\n\n expand(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n this._expandHeader(header);\n this._expandPanel(panel);\n }\n\n expandAll() {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n\n headers.forEach(header => this._expandHeader(header));\n panels.forEach(panel => this._expandPanel(panel));\n }\n\n collapse(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n\n collapseAll() {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n\n headers.forEach(header => this._collapseHeader(header));\n panels.forEach(panel => this._collapsePanel(panel));\n }\n\n _disclosureChanged(oldVal, newVal) {\n if (newVal === \"true\") {\n this._allHeaders().forEach(header => header.setAttribute(\"pfe-disclosure\", \"true\"));\n this._allPanels().forEach(panel => panel.setAttribute(\"pfe-disclosure\", \"true\"));\n\n // @TODO Deprecated in 1.0\n this.oldDisclosure = \"true\";\n } else {\n this._allHeaders().forEach(header => header.setAttribute(\"pfe-disclosure\", \"false\"));\n this._allPanels().forEach(panel => panel.setAttribute(\"pfe-disclosure\", \"false\"));\n\n // @TODO Deprecated in 1.0\n this.oldDisclosure = \"false\";\n }\n }\n\n _linkPanels() {\n const headers = this._allHeaders();\n headers.forEach(header => {\n const panel = this._panelForHeader(header);\n\n if (!panel) {\n return;\n }\n\n header.ariaControls = panel._id;\n panel.ariaLabelledby = header._id;\n });\n\n if (headers.length === 1) {\n if (this.disclosure === \"false\") {\n return;\n }\n\n this.disclosure = \"true\";\n }\n\n if (headers.length > 1) {\n if (this.disclosure) {\n this.disclosure = \"false\";\n }\n }\n }\n\n _changeHandler(evt) {\n if (this.classList.contains(\"animating\")) {\n return;\n }\n\n const header = evt.target;\n const panel = evt.target.nextElementSibling;\n\n if (evt.detail.expanded) {\n this._expandHeader(header);\n this._expandPanel(panel);\n } else {\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n }\n\n _expandHeader(header) {\n header.expanded = true;\n }\n\n _expandPanel(panel) {\n if (!panel) {\n console.error(`${PfeAccordion.tag}: Trying to expand a panel that doesn't exist`);\n return;\n }\n\n if (panel.expanded) {\n return;\n }\n\n panel.expanded = true;\n\n const height = panel.getBoundingClientRect().height;\n this._animate(panel, 0, height);\n }\n\n _collapseHeader(header) {\n header.expanded = false;\n }\n\n _collapsePanel(panel) {\n if (!panel) {\n console.error(`${PfeAccordion.tag}: Trying to collapse a panel that doesn't exist`);\n return;\n }\n\n if (!panel.expanded) {\n return;\n }\n\n const height = panel.getBoundingClientRect().height;\n panel.expanded = false;\n\n this._animate(panel, height, 0);\n }\n\n _animate(panel, start, end) {\n if (panel) {\n const header = panel.previousElementSibling;\n if (header) {\n header.classList.add(\"animating\");\n }\n panel.classList.add(\"animating\");\n panel.style.height = `${start}px`;\n\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n panel.style.height = `${end}px`;\n panel.addEventListener(\"transitionend\", this._transitionEndHandler);\n });\n });\n }\n }\n\n _keydownHandler(evt) {\n const currentHeader = evt.target;\n\n if (!this._isHeader(currentHeader)) {\n return;\n }\n\n let newHeader;\n\n switch (evt.key) {\n case \"ArrowDown\":\n case \"Down\":\n case \"ArrowRight\":\n case \"Right\":\n newHeader = this._nextHeader();\n break;\n case \"ArrowUp\":\n case \"Up\":\n case \"ArrowLeft\":\n case \"Left\":\n newHeader = this._previousHeader();\n break;\n case \"Home\":\n newHeader = this._firstHeader();\n break;\n case \"End\":\n newHeader = this._lastHeader();\n break;\n default:\n return;\n }\n\n newHeader.shadowRoot.querySelector(\"button\").focus();\n }\n\n _transitionEndHandler(evt) {\n const header = evt.target.previousElementSibling;\n if (header) {\n header.classList.remove(\"animating\");\n }\n evt.target.style.height = \"\";\n evt.target.classList.remove(\"animating\");\n evt.target.removeEventListener(\"transitionend\", this._transitionEndHandler);\n }\n\n _allHeaders() {\n return [...this.querySelectorAll(PfeAccordionHeader.tag)];\n }\n\n _allPanels() {\n return [...this.querySelectorAll(PfeAccordionPanel.tag)];\n }\n\n _panelForHeader(header) {\n const next = header.nextElementSibling;\n\n if (!next) {\n return;\n }\n\n if (next.tagName.toLowerCase() !== PfeAccordionPanel.tag) {\n console.error(`${PfeAccordion.tag}: Sibling element to a header needs to be a panel`);\n return;\n }\n\n return next;\n }\n\n _previousHeader() {\n const headers = this._allHeaders();\n let newIndex = headers.findIndex(header => header === document.activeElement) - 1;\n return headers[(newIndex + headers.length) % headers.length];\n }\n\n _nextHeader() {\n const headers = this._allHeaders();\n let newIndex = headers.findIndex(header => header === document.activeElement) + 1;\n return headers[newIndex % headers.length];\n }\n\n _firstHeader() {\n const headers = this._allHeaders();\n return headers[0];\n }\n\n _lastHeader() {\n const headers = this._allHeaders();\n return headers[headers.length - 1];\n }\n\n _isHeader(element) {\n return element.tagName.toLowerCase() === PfeAccordionHeader.tag;\n }\n}\n\nclass PfeAccordionHeader extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n static get tag() {\n return \"pfe-accordion-header\";\n }\n\n get styleUrl() {\n return \"pfe-accordion-header.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion-header.html\";\n }\n\n static get properties() {\n return {\n _id: {\n type: String,\n default: el => `${el.randomId.replace(\"pfe\", el.tag)}`,\n prefix: false\n },\n role: {\n type: String,\n default: \"heading\",\n prefix: false\n },\n ariaControls: {\n type: String,\n prefix: false\n },\n // @TODO Deprecated pfe-id in 1.0\n oldPfeId: {\n type: String,\n alias: \"_id\",\n attr: \"pfe-id\"\n },\n expanded: {\n title: \"Expanded\",\n type: Boolean,\n observer: \"_expandedChanged\",\n cascade: \"#pfe-accordion-header--button\",\n observer: \"_expandedChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeAccordionHeader);\n\n this.button = this.shadowRoot.querySelector(\"button\");\n\n this._init = this._init.bind(this);\n this._clickHandler = this._clickHandler.bind(this);\n this._observer = new MutationObserver(this._init);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.hasLightDOM()) this._init();\n\n this.addEventListener(\"click\", this._clickHandler);\n this._observer.observe(this, { childList: true });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"click\", this._clickHandler);\n this._observer.disconnect();\n }\n\n _init() {\n if (window.ShadyCSS) {\n this._observer.disconnect();\n }\n\n const child = this.children[0];\n let isHeaderTag = false;\n\n if (child) {\n switch (child.tagName) {\n case \"H1\":\n case \"H2\":\n case \"H3\":\n case \"H4\":\n case \"H5\":\n case \"H6\":\n isHeaderTag = true;\n break;\n }\n\n const wrapperTag = document.createElement(child.tagName);\n this.button.innerText = child.innerText;\n\n wrapperTag.appendChild(this.button);\n this.shadowRoot.appendChild(wrapperTag);\n } else {\n this.button.innerText = this.textContent.trim();\n }\n\n if (!isHeaderTag) {\n this.warn(`The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)`);\n }\n\n if (window.ShadyCSS) {\n this._observer.observe(this, { childList: true });\n }\n }\n\n _clickHandler(event) {\n this.emitEvent(PfeAccordion.events.change, {\n detail: {\n expanded: !this.expanded\n }\n });\n }\n\n _expandedChanged() {\n this.setAttribute(\"aria-expanded\", this.expanded);\n this.button.setAttribute(\"aria-expanded\", this.expanded);\n }\n}\n\nclass PfeAccordionPanel extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
\n
\n \n
\n
`;\n }\n\n static get tag() {\n return \"pfe-accordion-panel\";\n }\n\n get styleUrl() {\n return \"pfe-accordion-panel.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion-panel.html\";\n }\n\n static get properties() {\n return {\n _id: {\n type: String,\n default: el => `${el.randomId.replace(\"pfe\", el.tag)}`,\n prefix: false\n },\n role: {\n type: String,\n default: \"region\",\n prefix: false\n },\n // @TODO Deprecated pfe-id in 1.0\n oldPfeId: {\n type: String,\n alias: \"_id\",\n attr: \"pfe-id\"\n },\n expanded: {\n title: \"Expanded\",\n type: Boolean,\n default: false\n },\n ariaLabelledby: {\n type: String,\n prefix: false\n }\n };\n }\n\n constructor() {\n super(PfeAccordionPanel);\n }\n\n connectedCallback() {\n super.connectedCallback();\n }\n}\n\nPFElement.create(PfeAccordionHeader);\nPFElement.create(PfeAccordionPanel);\nPFElement.create(PfeAccordion);\n\nexport { PfeAccordion as default };\n"],"names":["Array","prototype","findIndex","Object","defineProperty","value","predicate","TypeError","o","len","length","thisArg","arguments","k","kValue","call","PfeAccordion","title","description","disclosure","type","String","values","observer","cascade","oldDisclosure","alias","attr","role","default","namedSlot","items","oneOf","$ref","change","tag","PFElement","PfeTypes","Container","PfeType","_linkPanels","bind","_observer","MutationObserver","addEventListener","events","_changeHandler","_keydownHandler","Promise","all","customElements","whenDefined","PfeAccordionHeader","PfeAccordionPanel","then","hasLightDOM","observe","childList","removeEventListener","disconnect","index","headers","_allHeaders","panels","_allPanels","header","panel","expanded","_expandHeader","_expandPanel","_collapseHeader","_collapsePanel","forEach","oldVal","newVal","setAttribute","_panelForHeader","ariaControls","_id","ariaLabelledby","evt","classList","contains","target","nextElementSibling","detail","console","error","height","getBoundingClientRect","_animate","start","end","previousElementSibling","add","style","requestAnimationFrame","_transitionEndHandler","currentHeader","_isHeader","newHeader","key","_nextHeader","_previousHeader","_firstHeader","_lastHeader","shadowRoot","querySelector","focus","remove","querySelectorAll","next","tagName","toLowerCase","newIndex","document","activeElement","element","el","randomId","replace","prefix","oldPfeId","Boolean","button","_init","_clickHandler","window","ShadyCSS","child","children","isHeaderTag","wrapperTag","createElement","innerText","appendChild","textContent","trim","warn","event","emitEvent","create"],"mappings":";;;;;;;;EAAA;EACA;EACA,IAAI,CAACA,MAAMC,SAAN,CAAgBC,SAArB,EAAgC;EAC9BC,SAAOC,cAAP,CAAsBJ,MAAMC,SAA5B,EAAuC,WAAvC,EAAoD;EAClDI,WAAO,eAASC,SAAT,EAAoB;EACzB;EACA,UAAI,QAAQ,IAAZ,EAAkB;EAChB,cAAM,IAAIC,SAAJ,CAAc,+BAAd,CAAN;EACD;;EAED,UAAIC,IAAIL,OAAO,IAAP,CAAR;;EAEA;EACA,UAAIM,MAAMD,EAAEE,MAAF,KAAa,CAAvB;;EAEA;EACA,UAAI,OAAOJ,SAAP,KAAqB,UAAzB,EAAqC;EACnC,cAAM,IAAIC,SAAJ,CAAc,8BAAd,CAAN;EACD;;EAED;EACA,UAAII,UAAUC,UAAU,CAAV,CAAd;;EAEA;EACA,UAAIC,IAAI,CAAR;;EAEA;EACA,aAAOA,IAAIJ,GAAX,EAAgB;EACd;EACA;EACA;EACA;EACA,YAAIK,SAASN,EAAEK,CAAF,CAAb;EACA,YAAIP,UAAUS,IAAV,CAAeJ,OAAf,EAAwBG,MAAxB,EAAgCD,CAAhC,EAAmCL,CAAnC,CAAJ,EAA2C;EACzC,iBAAOK,CAAP;EACD;EACD;EACAA;EACD;;EAED;EACA,aAAO,CAAC,CAAR;EACD;EAvCiD,GAApD;EAyCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EC5CD;;;;;;;;;;;;;;;;;;;;;;;;;MA8BMG;;;;;;EAOJ;0BACW;EACT;EAGD;;;0BAac;EACb,aAAO,oBAAP;EACD;;;0BAEiB;EAChB,aAAO,oBAAP;EACD;;;;;EA7BD;0BACqB;EACnB,aAAO,OAAP;EACD;;;0BASgB;EACf,aAAO,eAAP;EACD;;;0BAEiB;EAChB,aAAO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F,GAAGnF,GAA9B,CAAT;EAAA,WAFN;EAGHsF,kBAAQ;EAHL,SADA;EAML7F,cAAM;EACJR,gBAAMC,MADF;EAEJQ,mBAAS,QAFL;EAGJ4F,kBAAQ;EAHJ,SAND;EAWL;EACAC,kBAAU;EACRtG,gBAAMC,MADE;EAERK,iBAAO,KAFC;EAGRC,gBAAM;EAHE,SAZL;EAiBLwC,kBAAU;EACRlD,iBAAO,UADC;EAERG,gBAAMuG,OAFE;EAGR9F,mBAAS;EAHD,SAjBL;EAsBLkD,wBAAgB;EACd3D,gBAAMC,MADQ;EAEdoG,kBAAQ;EAFM;EAtBX,OAAP;EA2BD;;;EAED,+BAAc;EAAA;EAAA,gIACNpE,iBADM;EAEb;;;;0CAEmB;EAClB;EACD;;;IAlE6BjB;;EAqEhCA,UAAUyG,MAAV,CAAiBzF,kBAAjB;EACAhB,UAAUyG,MAAV,CAAiBxF,iBAAjB;EACAjB,UAAUyG,MAAV,CAAiB7H,YAAjB;;;;;;;;"} \ No newline at end of file diff --git a/elements/pfe-accordion/dist/pfe-accordion.umd.min.js b/elements/pfe-accordion/dist/pfe-accordion.umd.min.js new file mode 100644 index 0000000000..ecacbfe83c --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion.umd.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../pfelement/dist/pfelement.umd.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min"],t):(e=e||self).PfeAccordion=t(e.PFElement)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var o=arguments[1],a=0;a:host{--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion__base--Padding:var(--pfe-theme--container-spacer, 1rem);display:block;position:relative;overflow:hidden;margin:0;color:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;color:#151515!important}}:host([on=dark]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7)}:host([on=saturated]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff)}:host([disclosure=true]){--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderLeftWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--surface--border, #d2d2d2)}:host([hidden]){display:none} /*# sourceMappingURL=pfe-accordion.min.css.map */\n"}},{key:"styleUrl",get:function(){return"pfe-accordion.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion.html"}}],[{key:"version",get:function(){return"1.3.0"}},{key:"tag",get:function(){return"pfe-accordion"}},{key:"meta",get:function(){return{title:"Accordion",description:"This element renders content sets in an expandable format."}}},{key:"properties",get:function(){return{disclosure:{title:"Disclosure",type:String,values:["true","false"],observer:"_disclosureChanged",cascade:["pfe-accordion-header","pfe-accordion-panel"]},oldDisclosure:{type:String,alias:"disclosure",attr:"pfe-disclosure"},role:{type:String,default:"tablist",values:["tablist"]}}}},{key:"slots",get:function(){return{default:{type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-accordion-header"},{$ref:"pfe-accordion-panel"}]}}}}},{key:"events",get:function(){return{change:this.tag+":change"}}},{key:"PfeType",get:function(){return e.PfeTypes.Container}},{key:"contentTemplate",get:function(){return'\n \n \n '}}]),r(s,[{key:"connectedCallback",value:function(){var e=this;a(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"connectedCallback",this).call(this),this.addEventListener(s.events.change,this._changeHandler),this.addEventListener("keydown",this._keydownHandler),Promise.all([customElements.whenDefined(l.tag),customElements.whenDefined(f.tag)]).then(function(){e.hasLightDOM()&&e._linkPanels(),e._observer.observe(e,{childList:!0})})}},{key:"disconnectedCallback",value:function(){a(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"disconnectedCallback",this).call(this),this.removeEventListener(s.events.change,this._changeHandler),this.removeEventListener("keydown",this._keydownHandler),this._observer.disconnect()}},{key:"toggle",value:function(e){var t=this._allHeaders(),r=this._allPanels(),t=t[e],e=r[e];t&&e&&(t.expanded?(this._collapseHeader(t),this._collapsePanel(e)):(this._expandHeader(t),this._expandPanel(e)))}},{key:"expand",value:function(e){var t=this._allHeaders(),r=this._allPanels(),t=t[e],e=r[e];t&&e&&(this._expandHeader(t),this._expandPanel(e))}},{key:"expandAll",value:function(){var t=this,e=this._allHeaders(),r=this._allPanels();e.forEach(function(e){return t._expandHeader(e)}),r.forEach(function(e){return t._expandPanel(e)})}},{key:"collapse",value:function(e){var t=this._allHeaders(),r=this._allPanels(),t=t[e],e=r[e];t&&e&&(this._collapseHeader(t),this._collapsePanel(e))}},{key:"collapseAll",value:function(){var t=this,e=this._allHeaders(),r=this._allPanels();e.forEach(function(e){return t._collapseHeader(e)}),r.forEach(function(e){return t._collapsePanel(e)})}},{key:"_disclosureChanged",value:function(e,t){"true"===t?(this._allHeaders().forEach(function(e){return e.setAttribute("pfe-disclosure","true")}),this._allPanels().forEach(function(e){return e.setAttribute("pfe-disclosure","true")}),this.oldDisclosure="true"):(this._allHeaders().forEach(function(e){return e.setAttribute("pfe-disclosure","false")}),this._allPanels().forEach(function(e){return e.setAttribute("pfe-disclosure","false")}),this.oldDisclosure="false")}},{key:"_linkPanels",value:function(){var r=this,e=this._allHeaders();if(e.forEach(function(e){var t=r._panelForHeader(e);t&&(e.ariaControls=t._id,t.ariaLabelledby=e._id)}),1===e.length){if("false"===this.disclosure)return;this.disclosure="true"}1:host{-webkit-transition:-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);transition:-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);transition:transform .3s cubic-bezier(.465,.183,.153,.946);transition:transform .3s cubic-bezier(.465,.183,.153,.946),-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);-webkit-transition:-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946)),-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));display:block}:host([hidden]){display:none}:host>*{margin:0}:host button{--pfe-accordion--BorderBottomWidth:0;--pfe-accordion--ZIndex:3;--pfe-accordion__trigger--Padding:var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) 50px var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 1.5);margin:0;width:100%;width:var(--pfe-accordion--Width,100%);max-width:calc(100% - 4px);max-width:calc(100% - var(--pfe-theme--surface--border-width--heavy,4px));height:auto;position:relative;background-color:transparent;background-color:var(--pfe-accordion--BackgroundColor,transparent);color:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42));border-width:0;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);border-color:#d2d2d2;border-color:var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-top-width:1px;border-top-width:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px));border-right-width:0;border-right-width:var(--pfe-accordion--BorderRightWidth,0);border-bottom-width:1px;border-bottom-width:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px));border-left-width:4px;border-left-width:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px));border-left-color:transparent;border-left-color:var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);z-index:var(--pfe-accordion--ZIndex);cursor:pointer;font-family:inherit;font-size:calc(1rem * 1.1);font-size:var(--pfe-accordion--FontSize--header,calc(var(--pfe-theme--font-size,1rem) * 1.1));font-weight:700;font-weight:var(--pfe-theme--font-weight--bold,700);text-align:left;text-align:var(--pfe-accordion--TextAlign,left);line-height:1.5;line-height:var(--pfe-theme--line-height,1.5);padding:var(--pfe-accordion__trigger--Padding)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button{border-top-width:1px;border-right-width:0;border-bottom-width:1px;border-left-width:4px}}:host button:focus,:host button:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button:focus,:host button:hover{border-left-color:#06c}}:host button:hover{outline:0;border-left-width:4px;border-left-width:var(--pfe-theme--surface--border-width--heavy,4px)}:host button:focus{outline:0;text-decoration:underline}:host button::-moz-focus-inner{border:0}@supports (-ms-ime-align:auto){:host button{text-align:left}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button{padding:16px 24px}:host button:hover{border-left-color:#06c}}:host button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #151515);--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);--pfe-accordion--ZIndex:3}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button[aria-expanded=true]{border-bottom-width:0;border-left-color:#06c;border-right-color:#d2d2d2}}:host(:not([disclosure=true])) button::after{content:"";position:absolute;top:calc(1rem + .4em);top:calc(var(--pfe-theme--container-spacer,1rem) + .4em);display:block;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);height:.4em;width:.4em;-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;border-width:0 .1em .1em 0;-webkit-transform:rotate(45deg);transform:rotate(45deg);right:calc(1rem * 1.3125);right:calc(var(--pfe-theme--container-spacer,1rem) * 1.3125)}:host(:not([disclosure=true])) button[aria-expanded=true]::after{-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}:host(:last-of-type) button:not([aria-expanded=true]){--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px)}:host(:last-of-type.animating) button{--pfe-accordion--BorderBottomWidth:0}:host([on=dark]) button[aria-expanded=true]{--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);--pfe-accordion--BoxShadow:none}:host([on=saturated]) button[aria-expanded=true]{--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff);--pfe-accordion--BoxShadow:none}:host([disclosure=true]) button{padding-left:calc(1rem * 3);padding-left:calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([disclosure=true]) button{padding:16px 24px 16px 47px;border-right-color:#d2d2d2;border-left-color:#d2d2d2;border-left-width:1px}}:host([disclosure=true]) button::before{content:"";position:absolute;top:calc(1rem + .55em);top:calc(var(--pfe-theme--container-spacer,1rem) + .55em);display:block;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);height:.4em;width:.4em;-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;border-width:0 .1em .1em 0;-webkit-transform:rotate(45deg);transform:rotate(45deg);left:calc(1rem * 1.3125);left:calc(var(--pfe-theme--container-spacer,1rem) * 1.3125);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}:host([disclosure=true]) button[aria-expanded=true]::before{-webkit-transform:rotate(45deg);transform:rotate(45deg)}:host([disclosure=true]) button:not([aria-expanded=true]):hover,:host([disclosure=true]) button[aria-expanded=true]{padding-left:calc(1rem * 3 - 4px + 1px);padding-left:calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3 - var(--pfe-theme--surface--border-width--heavy,4px) + var(--pfe-theme--surface--border-width,1px))}:host([disclosure=true]) button:not([aria-expanded=true]):hover::before,:host([disclosure=true]) button[aria-expanded=true]::before{margin-left:calc((4px - 1px) * -1);margin-left:calc((var(--pfe-theme--surface--border-width--heavy,4px) - var(--pfe-theme--surface--border-width,1px)) * -1)} /*# sourceMappingURL=pfe-accordion-header.min.css.map */\n'}},{key:"styleUrl",get:function(){return"pfe-accordion-header.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion-header.html"}}],[{key:"version",get:function(){return"1.3.0"}},{key:"tag",get:function(){return"pfe-accordion-header"}},{key:"properties",get:function(){return{_id:{type:String,default:function(e){return""+e.randomId.replace("pfe",e.tag)},prefix:!1},role:{type:String,default:"heading",prefix:!1},ariaControls:{type:String,prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:(e={title:"Expanded",type:Boolean,observer:"_expandedChanged",cascade:"#pfe-accordion-header--button"},r="_expandedChanged",(t="observer")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e)};var e,t,r}}]),r(p,[{key:"connectedCallback",value:function(){a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"connectedCallback",this).call(this),this.hasLightDOM()&&this._init(),this.addEventListener("click",this._clickHandler),this._observer.observe(this,{childList:!0})}},{key:"disconnectedCallback",value:function(){a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("click",this._clickHandler),this._observer.disconnect()}},{key:"_init",value:function(){window.ShadyCSS&&this._observer.disconnect();var e=this.children[0],t=!1;if(e){switch(e.tagName){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":t=!0}var r=document.createElement(e.tagName);this.button.innerText=e.innerText,r.appendChild(this.button),this.shadowRoot.appendChild(r)}else this.button.innerText=this.textContent.trim();t||this.warn("The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)"),window.ShadyCSS&&this._observer.observe(this,{childList:!0})}},{key:"_clickHandler",value:function(e){this.emitEvent(d.events.change,{detail:{expanded:!this.expanded}})}},{key:"_expandedChanged",value:function(){this.setAttribute("aria-expanded",this.expanded),this.button.setAttribute("aria-expanded",this.expanded)}}]),p);function p(){t(this,p);var e=c(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,p));return e.button=e.shadowRoot.querySelector("button"),e._init=e._init.bind(e),e._clickHandler=e._clickHandler.bind(e),e._observer=new MutationObserver(e._init),e}var f=(n(h,e),r(h,[{key:"html",get:function(){return'\n\n
\n
\n \n
\n
'}},{key:"styleUrl",get:function(){return"pfe-accordion-panel.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion-panel.html"}}],[{key:"version",get:function(){return"1.3.0"}},{key:"tag",get:function(){return"pfe-accordion-panel"}},{key:"properties",get:function(){return{_id:{type:String,default:function(e){return""+e.randomId.replace("pfe",e.tag)},prefix:!1},role:{type:String,default:"region",prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,default:!1},ariaLabelledby:{type:String,prefix:!1}}}}]),r(h,[{key:"connectedCallback",value:function(){a(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"connectedCallback",this).call(this)}}]),h);function h(){return t(this,h),c(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h))}return e.create(l),e.create(f),e.create(d),d}); +//# sourceMappingURL=pfe-accordion.umd.min.js.map diff --git a/elements/pfe-accordion/dist/pfe-accordion.umd.min.js.map b/elements/pfe-accordion/dist/pfe-accordion.umd.min.js.map new file mode 100644 index 0000000000..5eb15472e0 --- /dev/null +++ b/elements/pfe-accordion/dist/pfe-accordion.umd.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-accordion.umd.min.js","sources":["../_temp/polyfills--pfe-accordion.js","../_temp/pfe-accordion.umd.js"],"sourcesContent":["// @POLYFILL Array.prototype.findIndex\n// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\nif (!Array.prototype.findIndex) {\n Object.defineProperty(Array.prototype, \"findIndex\", {\n value: function(predicate) {\n // 1. Let O be ? ToObject(this value).\n if (this == null) {\n throw new TypeError('\"this\" is null or not defined');\n }\n\n var o = Object(this);\n\n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n var len = o.length >>> 0;\n\n // 3. If IsCallable(predicate) is false, throw a TypeError exception.\n if (typeof predicate !== \"function\") {\n throw new TypeError(\"predicate must be a function\");\n }\n\n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n var thisArg = arguments[1];\n\n // 5. Let k be 0.\n var k = 0;\n\n // 6. Repeat, while k < len\n while (k < len) {\n // a. Let Pk be ! ToString(k).\n // b. Let kValue be ? Get(O, Pk).\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n // d. If testResult is true, return k.\n var kValue = o[k];\n if (predicate.call(thisArg, kValue, k, o)) {\n return k;\n }\n // e. Increase k by 1.\n k++;\n }\n\n // 7. Return -1.\n return -1;\n }\n });\n}\n","/*!\n * PatternFly Elements: PfeAccordion 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: findIndex\nimport \"./polyfills--pfe-accordion.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\n\nclass PfeAccordion extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n static get tag() {\n return \"pfe-accordion\";\n }\n\n static get meta() {\n return {\n title: \"Accordion\",\n description: \"This element renders content sets in an expandable format.\"\n };\n }\n\n get styleUrl() {\n return \"pfe-accordion.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion.html\";\n }\n\n static get properties() {\n return {\n disclosure: {\n // Leaving this as a string since it's an opt out\n title: \"Disclosure\",\n type: String,\n values: [\"true\", \"false\"],\n observer: \"_disclosureChanged\",\n cascade: [\"pfe-accordion-header\", \"pfe-accordion-panel\"]\n },\n // @TODO: Deprecated pfe-disclosure in 1.0\n oldDisclosure: {\n type: String,\n alias: \"disclosure\",\n attr: \"pfe-disclosure\"\n },\n role: {\n type: String,\n default: \"tablist\",\n values: [\"tablist\"]\n }\n };\n }\n\n static get slots() {\n return {\n default: {\n type: \"array\",\n namedSlot: false,\n items: {\n oneOf: [\n {\n $ref: \"pfe-accordion-header\"\n },\n {\n $ref: \"pfe-accordion-panel\"\n }\n ]\n }\n }\n };\n }\n\n static get events() {\n return {\n change: `${this.tag}:change`\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n // Each set contains a header and a panel\n static get contentTemplate() {\n return `\n \n \n `;\n }\n\n constructor() {\n super(PfeAccordion, { type: PfeAccordion.PfeType });\n\n this._linkPanels = this._linkPanels.bind(this);\n this._observer = new MutationObserver(this._linkPanels);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener(PfeAccordion.events.change, this._changeHandler);\n this.addEventListener(\"keydown\", this._keydownHandler);\n\n Promise.all([\n customElements.whenDefined(PfeAccordionHeader.tag),\n customElements.whenDefined(PfeAccordionPanel.tag)\n ]).then(() => {\n if (this.hasLightDOM()) {\n this._linkPanels();\n }\n\n this._observer.observe(this, { childList: true });\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(PfeAccordion.events.change, this._changeHandler);\n this.removeEventListener(\"keydown\", this._keydownHandler);\n this._observer.disconnect();\n }\n\n toggle(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n if (!header.expanded) {\n this._expandHeader(header);\n this._expandPanel(panel);\n } else {\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n }\n\n expand(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n this._expandHeader(header);\n this._expandPanel(panel);\n }\n\n expandAll() {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n\n headers.forEach(header => this._expandHeader(header));\n panels.forEach(panel => this._expandPanel(panel));\n }\n\n collapse(index) {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n const header = headers[index];\n const panel = panels[index];\n\n if (!header || !panel) {\n return;\n }\n\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n\n collapseAll() {\n const headers = this._allHeaders();\n const panels = this._allPanels();\n\n headers.forEach(header => this._collapseHeader(header));\n panels.forEach(panel => this._collapsePanel(panel));\n }\n\n _disclosureChanged(oldVal, newVal) {\n if (newVal === \"true\") {\n this._allHeaders().forEach(header => header.setAttribute(\"pfe-disclosure\", \"true\"));\n this._allPanels().forEach(panel => panel.setAttribute(\"pfe-disclosure\", \"true\"));\n\n // @TODO Deprecated in 1.0\n this.oldDisclosure = \"true\";\n } else {\n this._allHeaders().forEach(header => header.setAttribute(\"pfe-disclosure\", \"false\"));\n this._allPanels().forEach(panel => panel.setAttribute(\"pfe-disclosure\", \"false\"));\n\n // @TODO Deprecated in 1.0\n this.oldDisclosure = \"false\";\n }\n }\n\n _linkPanels() {\n const headers = this._allHeaders();\n headers.forEach(header => {\n const panel = this._panelForHeader(header);\n\n if (!panel) {\n return;\n }\n\n header.ariaControls = panel._id;\n panel.ariaLabelledby = header._id;\n });\n\n if (headers.length === 1) {\n if (this.disclosure === \"false\") {\n return;\n }\n\n this.disclosure = \"true\";\n }\n\n if (headers.length > 1) {\n if (this.disclosure) {\n this.disclosure = \"false\";\n }\n }\n }\n\n _changeHandler(evt) {\n if (this.classList.contains(\"animating\")) {\n return;\n }\n\n const header = evt.target;\n const panel = evt.target.nextElementSibling;\n\n if (evt.detail.expanded) {\n this._expandHeader(header);\n this._expandPanel(panel);\n } else {\n this._collapseHeader(header);\n this._collapsePanel(panel);\n }\n }\n\n _expandHeader(header) {\n header.expanded = true;\n }\n\n _expandPanel(panel) {\n if (!panel) {\n console.error(`${PfeAccordion.tag}: Trying to expand a panel that doesn't exist`);\n return;\n }\n\n if (panel.expanded) {\n return;\n }\n\n panel.expanded = true;\n\n const height = panel.getBoundingClientRect().height;\n this._animate(panel, 0, height);\n }\n\n _collapseHeader(header) {\n header.expanded = false;\n }\n\n _collapsePanel(panel) {\n if (!panel) {\n console.error(`${PfeAccordion.tag}: Trying to collapse a panel that doesn't exist`);\n return;\n }\n\n if (!panel.expanded) {\n return;\n }\n\n const height = panel.getBoundingClientRect().height;\n panel.expanded = false;\n\n this._animate(panel, height, 0);\n }\n\n _animate(panel, start, end) {\n if (panel) {\n const header = panel.previousElementSibling;\n if (header) {\n header.classList.add(\"animating\");\n }\n panel.classList.add(\"animating\");\n panel.style.height = `${start}px`;\n\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n panel.style.height = `${end}px`;\n panel.addEventListener(\"transitionend\", this._transitionEndHandler);\n });\n });\n }\n }\n\n _keydownHandler(evt) {\n const currentHeader = evt.target;\n\n if (!this._isHeader(currentHeader)) {\n return;\n }\n\n let newHeader;\n\n switch (evt.key) {\n case \"ArrowDown\":\n case \"Down\":\n case \"ArrowRight\":\n case \"Right\":\n newHeader = this._nextHeader();\n break;\n case \"ArrowUp\":\n case \"Up\":\n case \"ArrowLeft\":\n case \"Left\":\n newHeader = this._previousHeader();\n break;\n case \"Home\":\n newHeader = this._firstHeader();\n break;\n case \"End\":\n newHeader = this._lastHeader();\n break;\n default:\n return;\n }\n\n newHeader.shadowRoot.querySelector(\"button\").focus();\n }\n\n _transitionEndHandler(evt) {\n const header = evt.target.previousElementSibling;\n if (header) {\n header.classList.remove(\"animating\");\n }\n evt.target.style.height = \"\";\n evt.target.classList.remove(\"animating\");\n evt.target.removeEventListener(\"transitionend\", this._transitionEndHandler);\n }\n\n _allHeaders() {\n return [...this.querySelectorAll(PfeAccordionHeader.tag)];\n }\n\n _allPanels() {\n return [...this.querySelectorAll(PfeAccordionPanel.tag)];\n }\n\n _panelForHeader(header) {\n const next = header.nextElementSibling;\n\n if (!next) {\n return;\n }\n\n if (next.tagName.toLowerCase() !== PfeAccordionPanel.tag) {\n console.error(`${PfeAccordion.tag}: Sibling element to a header needs to be a panel`);\n return;\n }\n\n return next;\n }\n\n _previousHeader() {\n const headers = this._allHeaders();\n let newIndex = headers.findIndex(header => header === document.activeElement) - 1;\n return headers[(newIndex + headers.length) % headers.length];\n }\n\n _nextHeader() {\n const headers = this._allHeaders();\n let newIndex = headers.findIndex(header => header === document.activeElement) + 1;\n return headers[newIndex % headers.length];\n }\n\n _firstHeader() {\n const headers = this._allHeaders();\n return headers[0];\n }\n\n _lastHeader() {\n const headers = this._allHeaders();\n return headers[headers.length - 1];\n }\n\n _isHeader(element) {\n return element.tagName.toLowerCase() === PfeAccordionHeader.tag;\n }\n}\n\nclass PfeAccordionHeader extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n static get tag() {\n return \"pfe-accordion-header\";\n }\n\n get styleUrl() {\n return \"pfe-accordion-header.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion-header.html\";\n }\n\n static get properties() {\n return {\n _id: {\n type: String,\n default: el => `${el.randomId.replace(\"pfe\", el.tag)}`,\n prefix: false\n },\n role: {\n type: String,\n default: \"heading\",\n prefix: false\n },\n ariaControls: {\n type: String,\n prefix: false\n },\n // @TODO Deprecated pfe-id in 1.0\n oldPfeId: {\n type: String,\n alias: \"_id\",\n attr: \"pfe-id\"\n },\n expanded: {\n title: \"Expanded\",\n type: Boolean,\n observer: \"_expandedChanged\",\n cascade: \"#pfe-accordion-header--button\",\n observer: \"_expandedChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeAccordionHeader);\n\n this.button = this.shadowRoot.querySelector(\"button\");\n\n this._init = this._init.bind(this);\n this._clickHandler = this._clickHandler.bind(this);\n this._observer = new MutationObserver(this._init);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.hasLightDOM()) this._init();\n\n this.addEventListener(\"click\", this._clickHandler);\n this._observer.observe(this, { childList: true });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"click\", this._clickHandler);\n this._observer.disconnect();\n }\n\n _init() {\n if (window.ShadyCSS) {\n this._observer.disconnect();\n }\n\n const child = this.children[0];\n let isHeaderTag = false;\n\n if (child) {\n switch (child.tagName) {\n case \"H1\":\n case \"H2\":\n case \"H3\":\n case \"H4\":\n case \"H5\":\n case \"H6\":\n isHeaderTag = true;\n break;\n }\n\n const wrapperTag = document.createElement(child.tagName);\n this.button.innerText = child.innerText;\n\n wrapperTag.appendChild(this.button);\n this.shadowRoot.appendChild(wrapperTag);\n } else {\n this.button.innerText = this.textContent.trim();\n }\n\n if (!isHeaderTag) {\n this.warn(`The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)`);\n }\n\n if (window.ShadyCSS) {\n this._observer.observe(this, { childList: true });\n }\n }\n\n _clickHandler(event) {\n this.emitEvent(PfeAccordion.events.change, {\n detail: {\n expanded: !this.expanded\n }\n });\n }\n\n _expandedChanged() {\n this.setAttribute(\"aria-expanded\", this.expanded);\n this.button.setAttribute(\"aria-expanded\", this.expanded);\n }\n}\n\nclass PfeAccordionPanel extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
\n
\n \n
\n
`;\n }\n\n static get tag() {\n return \"pfe-accordion-panel\";\n }\n\n get styleUrl() {\n return \"pfe-accordion-panel.scss\";\n }\n\n get templateUrl() {\n return \"pfe-accordion-panel.html\";\n }\n\n static get properties() {\n return {\n _id: {\n type: String,\n default: el => `${el.randomId.replace(\"pfe\", el.tag)}`,\n prefix: false\n },\n role: {\n type: String,\n default: \"region\",\n prefix: false\n },\n // @TODO Deprecated pfe-id in 1.0\n oldPfeId: {\n type: String,\n alias: \"_id\",\n attr: \"pfe-id\"\n },\n expanded: {\n title: \"Expanded\",\n type: Boolean,\n default: false\n },\n ariaLabelledby: {\n type: String,\n prefix: false\n }\n };\n }\n\n constructor() {\n super(PfeAccordionPanel);\n }\n\n connectedCallback() {\n super.connectedCallback();\n }\n}\n\nPFElement.create(PfeAccordionHeader);\nPFElement.create(PfeAccordionPanel);\nPFElement.create(PfeAccordion);\n\nexport { PfeAccordion as default };\n"],"names":["Array","prototype","findIndex","defineProperty","predicate","this","TypeError","o","Object","len","length","thisArg","arguments","k","kValue","call","PfeAccordion","PFElement","String","tag","PfeTypes","Container","addEventListener","events","change","_changeHandler","_keydownHandler","all","customElements","whenDefined","PfeAccordionHeader","PfeAccordionPanel","then","_this2","hasLightDOM","_linkPanels","_observer","observe","childList","removeEventListener","disconnect","index","headers","_allHeaders","panels","_allPanels","header","panel","expanded","_collapseHeader","_collapsePanel","_expandHeader","_expandPanel","forEach","_this3","_this4","oldVal","newVal","setAttribute","oldDisclosure","_this5","_panelForHeader","ariaControls","_id","ariaLabelledby","disclosure","evt","classList","contains","target","nextElementSibling","detail","height","getBoundingClientRect","_animate","error","start","end","previousElementSibling","add","style","_this6","_transitionEndHandler","currentHeader","_isHeader","newHeader","key","_nextHeader","_previousHeader","_firstHeader","_lastHeader","shadowRoot","querySelector","focus","remove","querySelectorAll","next","tagName","toLowerCase","newIndex","document","activeElement","element","type","PfeType","_this","bind","MutationObserver","el","randomId","replace","Boolean","_init","_clickHandler","window","ShadyCSS","child","children","isHeaderTag","wrapperTag","createElement","button","innerText","appendChild","textContent","trim","warn","event","emitEvent","_this7","create"],"mappings":"6WAEKA,MAAMC,UAAUC,kBACZC,eAAeH,MAAMC,UAAW,YAAa,OAC3C,SAASG,MAEF,MAARC,WACI,IAAIC,UAAU,qCAGlBC,EAAIC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,IAAIuE,iBAAiBsB,EAAKjB,aAuEzCjF,OAA0Bd,+gKAuBrB,qEAIA,mEAvBA,0CAeA,+DAYA,KACA,MACGC,eACG,qBAAS0F,EAAGC,SAASC,QAAQ,MAAOF,EAAGzF,cACxC,QAEJ,MACED,eACG,iBACD,YAGA,MACFA,aACC,WACD,mBAEE,OACD,gBACD6F,iBACG,kBAEK,MACR7F,eACE,sPAMNa,WAQVd,EAAUiH,OAAOpG,GACjBb,EAAUiH,OAAOnG,GACjBd,EAAUiH,OAAOlH"} \ No newline at end of file diff --git a/elements/pfe-accordion/package.json b/elements/pfe-accordion/package.json index 6c154475e9..15d76c198f 100644 --- a/elements/pfe-accordion/package.json +++ b/elements/pfe-accordion/package.json @@ -10,7 +10,7 @@ ], "preview": "accordion.svg" }, - "version": "1.2.0", + "version": "1.3.0", "publishConfig": { "access": "public" }, @@ -60,10 +60,10 @@ ], "license": "MIT", "dependencies": { - "@patternfly/pfelement": "^1.2.0" + "@patternfly/pfelement": "^1.3.0" }, "devDependencies": { - "@patternfly/pfe-sass": "^1.2.0" + "@patternfly/pfe-sass": "^1.3.0" }, "generator-pfelement-version": "0.5.5", "bugs": { diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.css.map b/elements/pfe-autocomplete/dist/pfe-autocomplete.css.map new file mode 100644 index 0000000000..7caf61744c --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-autocomplete.scss","../../pfe-sass/extends/_extends.scss","pfe-autocomplete.css","../../pfe-sass/mixins/_mixins.scss","../../pfe-sass/mixins/_custom-properties.scss","../../pfe-sass/functions/_custom-properties.scss"],"names":[],"mappings":"AAwCA;ECNE,kBAAkB;EAClB,gBAAgB;EAChB,sBAAsB;EACtB,WAAW;EACX,UAAU;EACV,YAAY;EACZ,UAAU;EACV,SAAS;AChCX;;ACNM;ECyLF;IDzLwF,UAAA;IFoDxF,yBAAiC;ECxCnC;AACF;;AE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wFAAwE;EAAxE,gFAAwE;EAAxE,wEAAwE;EAAxE,8GAAwE;EACxE,UAAU;EACV,UAAU;AEyCd;;AF1DA;;EAsBI,mBAAmB;EAGnB,WAAW;AEuCf;;AFhEA;EA8BI,mBAAmB;AEsCvB;;AFpEA;;EAmCI,UAAU;AEsCd;;AFzEA;;EAwCI,wBAAwB;AEsC5B;;AF9EA;EA4CI,aAAa;AEsCjB;;AFlFA;;EAiDI,wBAAwB;AEsC5B;;AFlCA;EACE,cK7DkC;EL6DlC,gDK7DkC;EL8DlC,6BAA6B;EAC7B,YAAY;EACZ,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,eAAe;AEqCjB;;AF5CA;EAUI,WAAW;EACX,WAAW;EACX,eAAe;EACf,sBKzEgC;ELyEhC,kEKzEgC;AH+GpC;;AFnDA;EAeM,cK3E8B;EL2E9B,gDK3E8B;AHmHpC;;AFvDA;EAkBM,WAAW;EACX,eK/E8B;EL+E9B,yDK/E8B;AHwHpC;;AF5DA;;EAuBM,UAAU;EACV,YKpF8B;ELoF9B,2CKpF8B;AH8HpC;;AFlEA;;EA8BI,eK1FgC;EL0FhC,yDK1FgC;AHmIpC;;AFvEA;EAkCI,UAAU;EACV,WAAW;AEyCf;;AF5EA;EAsCM,UKlG8B;ELkG9B,yCKlG8B;ELmG9B,WAAW;AE0CjB;;AFjFA;;EA4CM,aKxG8B;ELwG9B,mDKxG8B;AHkJpC;;AFtFA;EAgDM,aK5G8B;EL4G9B,mDK5G8B;AHsJpC;;AFrCA;EACE,iBAAiB;AEwCnB;;AFrCA;EACE,kBAAkB;EAClB,WAAW;EACX,WAAW;EACX,QAAQ;EACR,WAAW;AEwCb;;AF7CA;EAOI,WAAW;EACX,gBAAgB;AE0CpB","file":"pfe-autocomplete.css","sourcesContent":["@import \"../../pfe-sass/pfe-sass\";\n\n$LOCAL: autocomplete;\n\n$LOCAL-VARIABLES: (\n BoxShadow: pfe-var(box-shadow--inset),\n BackgroundColor: pfe-var(surface--lightest),\n Border: pfe-var(ui--border-width) pfe-var(ui--border-style) pfe-var(surface--border)\n);\n\n@include pfe-contexts; // imports on=\"light\" etc support\n\n:host {\n display: block;\n position: relative;\n font-family: pfe-var(font-family);\n @include pfe-print-local($LOCAL-VARIABLES);\n}\n\n:host([button-text]) {\n display: flex;\n #wrapper {\n flex: 1;\n }\n\n #input-box-wrapper {\n position: relative;\n }\n\n button.clear-search {\n right: 10px;\n }\n}\n\n\n// this isn't working, I don't know why\n:host([button-text]) ::slotted(input[type=\"search\"]::-webkit-search-cancel-button) {\n -webkit-appearance: none;\n}\n\n.sr-only {\n @extend %sr-only;\n}\n\n#input-box-wrapper {\n border-color: pfe-var(feedback--info);\n\n ::slotted(input) {\n width: 100%;\n flex: 1;\n box-shadow: pfe-local(BoxShadow) !important;\n padding-left: 10px;\n padding-right: 30px;\n border-radius: pfe-var(ui--border-radius);\n background-color: pfe-local(BackgroundColor);\n border: pfe-local(Border);\n font-size: pfe-var(font-size);\n font-family: pfe-var(font-family);\n height: calc(#{pfe-var(ui--element--size)} * 2);\n transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;\n opacity: 1;\n outline: 0;\n }\n\n ::slotted(input:disabled),\n button:disabled {\n cursor: not-allowed;\n // background-color: transparent;\n // @TODO: Replace with a variable\n color: #ccc;\n // opacity: 0.5;\n }\n\n ::slotted(input:disabled) {\n padding-right: 10px;\n }\n\n button:focus,\n ::slotted(input:focus) {\n outline: 0;\n }\n\n ::slotted(input),\n button {\n -webkit-appearance: none;\n }\n\n ::slotted([type=\"search\"]::-ms-clear) {\n display: none;\n }\n\n ::slotted(input[type=\"search\"]::-webkit-search-cancel-button),\n ::slotted(input[type=\"search\"]::-webkit-search-decoration) {\n -webkit-appearance: none;\n }\n}\n\nbutton {\n color: pfe-var(ui-base);\n background-color: transparent;\n border: none;\n position: absolute;\n top: 0;\n bottom: 0;\n cursor: pointer;\n\n &.clear-search {\n right: 30px;\n width: 20px;\n margin: 2px 1px;\n background-color: pfe-var(surface--lightest);\n &:hover {\n color: pfe-var(ui-base);\n }\n svg {\n width: 12px;\n stroke: pfe-var(surface--border);\n }\n &:hover svg,\n &:focus svg {\n opacity: 1;\n stroke: pfe-var(link);\n }\n }\n\n &[disabled].clear-search:hover svg,\n &[disabled].clear-search:focus svg {\n stroke: pfe-var(surface--border);\n }\n\n &.search-button {\n right: 1px;\n width: 30px;\n\n svg {\n fill: pfe-var(link);\n width: 16px;\n }\n\n &:hover svg,\n &:focus svg {\n fill: pfe-var(link--hover);\n }\n\n &:disabled svg {\n fill: pfe-var(ui-disabled);\n }\n }\n}\n\npfe-button.search-button--textual {\n margin-left: 16px;\n}\n\n.loading {\n position: absolute;\n width: 30px;\n right: 52px;\n top: 0px;\n bottom: 0px;\n svg {\n width: 26px;\n padding-top: 7px;\n }\n}\n","// @todo Change to mixins; no efficiency gain with placeholders in web components\n\n/// Clear box element styles\n%reset-box {\n margin: 0;\n padding: 0;\n}\n\n/// Clear list styles\n%reset-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/// Clear button styles\n%reset-button {\n background-color: transparent;\n border: none;\n margin: 0;\n padding: 0;\n text-align: left;\n}\n\n/// Set up a container element\n%container {\n position: relative;\n display: block;\n width: 100%;\n padding: pfe-var(container-spacer);\n}\n\n/// Screen-reader only content\n%sr-only {\n position: absolute;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n}\n\n/// Fallback surface styles for IE11 only\n%fallback-surface {\n @include browser-query(ie11) {\n background-color: pfe-fetch(surface--lightest) !important;\n color: pfe-fetch(text) !important;\n }\n}\n\n/// Fallback text styles for IE11 only\n%fallback-text {\n @include browser-query(ie11) {\n color: pfe-fetch(text) !important;\n }\n}\n",".sr-only {\n position: absolute;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n color: #151515 !important;\n }\n}\n\n:host([on=\"dark\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #73bcf7);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #bee1f4);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #bee1f4);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #bee1f4);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-dark, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-dark, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-dark, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-dark, none);\n}\n\n:host([on=\"saturated\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-saturated, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-saturated, #fff);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-saturated, #fafafa);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-saturated, #fafafa);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-saturated, #d2d2d2);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-saturated, underline);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-saturated, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-saturated, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-saturated, underline);\n}\n\n:host([on=\"light\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text, #151515);\n --pfe-broadcasted--link: var(--pfe-theme--color--link, #06c);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover, #004080);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus, #004080);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited, #6753ac);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited, none);\n}\n\n:host {\n display: block;\n position: relative;\n font-family: var(--pfe-theme--font-family, \"Red Hat Text\", \"RedHatText\", \"Overpass\", Overpass, Arial, sans-serif);\n --pfe-autocomplete--BoxShadow: var(--pfe-theme--box-shadow--inset, inset 0 0 0.625rem 0 #fafafa);\n --pfe-autocomplete--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n --pfe-autocomplete--Border: var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-theme--color--surface--border, #d2d2d2);\n}\n\n:host([button-text]) {\n display: flex;\n}\n\n:host([button-text]) #wrapper {\n flex: 1;\n}\n\n:host([button-text]) #input-box-wrapper {\n position: relative;\n}\n\n:host([button-text]) button.clear-search {\n right: 10px;\n}\n\n:host([button-text]) ::slotted(input[type=\"search\"]::-webkit-search-cancel-button) {\n -webkit-appearance: none;\n}\n\n#input-box-wrapper {\n border-color: var(--pfe-theme--color--feedback--info, #06c);\n}\n\n#input-box-wrapper ::slotted(input) {\n width: 100%;\n flex: 1;\n box-shadow: var(--pfe-autocomplete--BoxShadow, var(--pfe-theme--box-shadow--inset, inset 0 0 0.625rem 0 #fafafa)) !important;\n padding-left: 10px;\n padding-right: 30px;\n border-radius: var(--pfe-theme--ui--border-radius, 2px);\n background-color: var(--pfe-autocomplete--BackgroundColor, var(--pfe-theme--color--surface--lightest, #fff));\n border: var(--pfe-autocomplete--Border, var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-theme--color--surface--border, #d2d2d2));\n font-size: var(--pfe-theme--font-size, 1rem);\n font-family: var(--pfe-theme--font-family, \"Red Hat Text\", \"RedHatText\", \"Overpass\", Overpass, Arial, sans-serif);\n height: calc(var(--pfe-theme--ui--element--size, 20px) * 2);\n transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;\n opacity: 1;\n outline: 0;\n}\n\n#input-box-wrapper ::slotted(input:disabled),\n#input-box-wrapper button:disabled {\n cursor: not-allowed;\n color: #ccc;\n}\n\n#input-box-wrapper ::slotted(input:disabled) {\n padding-right: 10px;\n}\n\n#input-box-wrapper button:focus,\n#input-box-wrapper ::slotted(input:focus) {\n outline: 0;\n}\n\n#input-box-wrapper ::slotted(input),\n#input-box-wrapper button {\n -webkit-appearance: none;\n}\n\n#input-box-wrapper ::slotted([type=\"search\"]::-ms-clear) {\n display: none;\n}\n\n#input-box-wrapper ::slotted(input[type=\"search\"]::-webkit-search-cancel-button),\n#input-box-wrapper ::slotted(input[type=\"search\"]::-webkit-search-decoration) {\n -webkit-appearance: none;\n}\n\nbutton {\n color: var(--pfe-theme--color--ui-base, #6a6e73);\n background-color: transparent;\n border: none;\n position: absolute;\n top: 0;\n bottom: 0;\n cursor: pointer;\n}\n\nbutton.clear-search {\n right: 30px;\n width: 20px;\n margin: 2px 1px;\n background-color: var(--pfe-theme--color--surface--lightest, #fff);\n}\n\nbutton.clear-search:hover {\n color: var(--pfe-theme--color--ui-base, #6a6e73);\n}\n\nbutton.clear-search svg {\n width: 12px;\n stroke: var(--pfe-theme--color--surface--border, #d2d2d2);\n}\n\nbutton.clear-search:hover svg,\nbutton.clear-search:focus svg {\n opacity: 1;\n stroke: var(--pfe-theme--color--link, #06c);\n}\n\nbutton[disabled].clear-search:hover svg,\nbutton[disabled].clear-search:focus svg {\n stroke: var(--pfe-theme--color--surface--border, #d2d2d2);\n}\n\nbutton.search-button {\n right: 1px;\n width: 30px;\n}\n\nbutton.search-button svg {\n fill: var(--pfe-theme--color--link, #06c);\n width: 16px;\n}\n\nbutton.search-button:hover svg,\nbutton.search-button:focus svg {\n fill: var(--pfe-theme--color--link--hover, #004080);\n}\n\nbutton.search-button:disabled svg {\n fill: var(--pfe-theme--color--ui-disabled, #d2d2d2);\n}\n\npfe-button.search-button--textual {\n margin-left: 16px;\n}\n\n.loading {\n position: absolute;\n width: 30px;\n right: 52px;\n top: 0px;\n bottom: 0px;\n}\n\n.loading svg {\n width: 26px;\n padding-top: 7px;\n}\n","@mixin browser-query($browser-list) {\n @each $browser in $browser-list {\n @if $browser == ie11 {\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n @content;\n }\n }\n @if $browser == edge12 {\n @supports (-ms-accelerator: true) { /* Microsoft Edge Browser 12+ */\n @content;\n }\n }\n @if $browser == edge {\n @supports (-ms-ime-align: auto) { /* Microsoft Edge Browser 16+ (All) */\n @content;\n }\n }\n @if $browser == firefox {\n @media all and (min--moz-device-pixel-ratio:0) { /* Mozilla Firefox (All) */\n @content;\n }\n }\n }\n}\n\n@mixin pfe-transition($properties...) {\n $return: null;\n @each $property in $properties {\n @if length($property) == 1 {\n $return: append($return, #{$property} 250ms $pfe-global--animation-timing, comma);\n }\n @else if length($property) == 2 {\n $return: append($return, nth($property, 1) nth($property, 2), comma);\n }\n }\n transition: $return;\n}\n\n// Make a CSS arrow\n@mixin pfe-arrow($type, $color, $width: 8px, $height: 5px, $pseudo: false) {\n $direction: (\n up: 180deg,\n down: 0deg,\n right: -90deg,\n left: 90deg,\n );\n border-style: pfe-var(surface--border-style);\n border-width: $width $height 0;\n border-color: transparent;\n border-top-color: $color;\n transform: rotate(map-get($direction, $type));\n @if $pseudo {\n display: inline-block;\n content: \"\";\n @content;\n }\n}\n\n@mixin pfe-arrow-color($color) {\n border-top-color: $color;\n}\n\n@mixin pfe-print-media {\n @media print {\n @content;\n }\n}\n\n@mixin pfe-print-background {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n@mixin pfe-no-print-background {\n @include pfe-print-media {\n background-color: white !important;\n background-image: none !important;\n box-shadow: none !important;\n }\n}\n\n@mixin pfe-hidden {\n @at-root #{&}([hidden]) {\n display: none;\n }\n}\n\n@mixin pfe-pipe( $position: right, $padding: 0, $margin: 0, $color: $border-color) {\n border: pfe-var(surface--border-width) pfe-var(surface--border-style) transparent;\n border-#{$position}-color: $color;\n @if $position == right {\n padding-left: $padding;\n margin-right: $margin;\n }\n @else if $position == left {\n padding-right: $padding;\n margin-left: $margin;\n }\n}\n\n@mixin pfe-retina {\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n @content;\n }\n}\n\n@mixin pfe-icon($path, $display: flex, $size: 1em) {\n display: #{$display};\n @if $path {\n background: #{$path} no-repeat;\n background-size: contain;\n background-position: center;\n }\n width: #{$size};\n height: #{$size};\n @content;\n}\n\n@mixin pfe-local-debug($map: $LOCAL-VARIABLES) {\n :root {\n @include pfe-print-local($map);\n }\n} ","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// This will print all the broadcast variables, and set the value to the context of your choosing, like on-dark or on-saturated.\n/// @param {String} $context - Look up values from contexts, i.e. \"light\" or \"saturated\"\n/// @param {List | String} $broadcast [$BROADCAST-VARS] - Optionally specify only one broadcast variable instead of the whole set, i.e. \"text\"\n/// @see $custom-prop-prefix\n/// @see $BROADCAST-VARS\n/// @example - scss - Usage in a container component, i.e. pfe-card\n/// :host {\n/// @include pfe-set-broadcast-context(dark);\n/// }\n/// @example - css - Rendered output\n/// :host {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n///\n@mixin pfe-set-broadcast-context($context, $broadcast: $BROADCAST-VARS) {\n @each $type in $broadcast {\n $list: ();\n $string: \"\";\n $context_string: \"\";\n $state: \"\";\n\n @if str-starts-with($type, \"link\") {\n $list: append($list, \"#{$type}\");\n\n @each $s in (hover, focus, visited) {\n $state: \"--#{$s}\";\n $string: \"#{$type}#{$state}\";\n\n @if not index($list, $string) {\n $list: append($list, \"#{$type}#{$state}\");\n }\n }\n } @else {\n @if not index($list, $string) {\n $list: append($list, \"#{$type}\");\n }\n }\n\n @if index($CONTEXTS, $context) != null {\n @if $context != \"light\" {\n $context_string: \"--on-#{$context}\";\n }\n }\n\n @each $item in $list {\n @if not index($BROADCAST-VARS, $type) {\n @warn \"--#{$custom-prop-prefix}-broadcasted--#{$item} variable is not in the $BROADCAST-VARS list.\";\n } @else if not pfe-broadcasted(#{$item}#{$context_string}) {\n @warn \"#{$item}#{$context_string} value does not currently exist.\";\n } @else {\n @if index($CONTEXTS, $context) != null {\n --#{$custom-prop-prefix}-broadcasted--#{$item}: #{pfe-var(#{$item}#{$context_string})};\n } @else {\n @error \"The #{$context} context does not appear to be part of a supported context.\";\n }\n }\n }\n }\n}\n\n/// Returns CSS Variable for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $value - The value of the css variable being defined\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example - scss\n/// :host {\n/// padding-top: pfe-local(paddingTop);\n/// padding-bottom: pfe-local(paddingBottom);\n/// }\n@mixin pfe-print-local($map: $LOCAL-VARIABLES) {\n @each $property, $value in $map {\n $name: \"--#{$property}\";\n $styles: $value;\n\n @if type-of($value) == \"map\" {\n @each $prop, $v in $value {\n $name: \"__#{$property}--#{$prop}\";\n $styles: $v;\n\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n } @else {\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n }\n}\n\n/// Surface properties\n/// This mixin creates an attribute for all the surface colors, then prints the local background color variable for the component, with the correct context colors.\n/// @param {List | String} $surfaces [$SURFACES] - defaults to the global $SURFACES list of all supported colors\n/// @param {String} $attr-name [pfe-var] - defaults to pfe-var, optionally pass in a custom name for the data attribute\n/// @example - scss - In your component stylesheet\n/// $LOCAL: band;\n/// @include pfe-surfaces;\n/// @example - css - Rendered result\n/// :host([color=\"darker\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darker, #464646);\n/// --context: dark;\n/// }\n/// :host([color=\"darkest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darkest, #131313);\n/// --context: dark;\n/// }\n/// :host([color=\"base\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--base, #dfdfdf);\n/// --context: light;\n/// }\n/// :host([color=\"lighter\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lighter, #ececec);\n/// --context: light;\n/// }\n/// :host([color=\"lightest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n/// --context: light;\n/// }\n/// :host([color=\"accent\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--accent, #ee0000);\n/// --context: saturated;\n/// }\n/// :host([color=\"complement\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--complement, #0477a4);\n/// --context: saturated;\n/// }\n@mixin pfe-surfaces($surfaces: $SURFACE, $attr-name: color) {\n @each $color in $surfaces {\n $context: #{pfe-get-context(surface--#{$color}--context)};\n :host([#{$attr-name}=\"#{$color}\"]) {\n @include pfe-print-local(\n (\n BackgroundColor: pfe-var(surface--#{$color}),\n context: pfe-var(surface--#{$color}--context, #{$context})\n )\n );\n @extend %fallback-surface;\n }\n }\n}\n\n/// Prints the `on` attribute with IE11 fallbacks\n/// @param {List} contexts [$CONTEXTS] - defaults to the global $CONTEXTS list of all supported contexts\n/// @param {Boolean} ie-fallback [true] - defaults to true, prints IE11 fallbacks\n/// @example - scss - In your component styles\n/// @include pfe-contexts; // imports on=\"light\" etc support\n/// @example - css - Rendered outputs\n/// :host([on=\"dark\"]) {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n/// @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n/// :host([on=\"dark\"]) {\n/// color: #fff;\n/// color: var(--pfe-theme--color--text--on-dark, #fff);\n/// }\n/// }\n/// // ...as well as all the values for :host([on=\"saturated\"]) and :host([on=\"light\"])\n@mixin pfe-contexts($contexts: $CONTEXTS, $ie-fallback: true) {\n // Helper attributes to aid in theming\n @each $context in $contexts {\n :host([on=\"#{$context}\"]) {\n @include pfe-set-broadcast-context($context);\n }\n }\n @if $ie-fallback {\n :host {\n @extend %fallback-text;\n }\n }\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.js b/elements/pfe-autocomplete/dist/pfe-autocomplete.js new file mode 100644 index 0000000000..954b468e60 --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.js @@ -0,0 +1,606 @@ +import PFElement from '../../pfelement/dist/pfelement.js'; +import '../../pfe-button/dist/pfe-button.js'; + +/*! + * PatternFly Elements: PfeAutocomplete 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/ + +const KEYCODE = { + ENTER: 13, + DOWN: 40, + UP: 38, + ESC: 27 +}; + +// use this variable to debounce api call when user types very fast +let throttle = false; + +class PfeAutocomplete extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + +
+
+ + + + + + + +
+ +
+ +`; + } + + // @TODO: Deprecating in 1.0 release + // Injected at build-time + static get schemaProperties() { + return {"debounce_timer":{"title":"Debounce","description":"The amount of time that should pass before the next API call is made","type":"string","prefixed":false},"init_value":{"title":"Initial value","description":"An initial value to show in the input field","type":"string","prefixed":false},"is_disabled":{"title":"Is disabled","description":"Disable the input","type":"boolean","prefixed":false},"button-text":{"title":"Button text","description":"Add button with text next to input field","type":"string","prefixed":false}}; + } + + // Injected at build-time + static get slots() { + return {"content":{"title":"Content","type":"array","namedSlot":false,"items":{"oneOf":[{"$ref":"input"}]},"required":true}}; + } + + static get tag() { + return "pfe-autocomplete"; + } + + get schemaUrl() { + return "pfe-autocomplete.json"; + } + + get templateUrl() { + return "pfe-autocomplete.html"; + } + + get styleUrl() { + return "pfe-autocomplete.scss"; + } + + static get properties() { + return { + initValue: { + title: "Initial Value", + type: String, + observer: "_initValueChanged" + }, + loading: { + title: "Loading", + type: Boolean, + default: false, + observer: "_loadingChanged" + }, + isDisabled: { + title: "Is disabled", + type: Boolean, + default: false, + observer: "_isDisabledChanged" + }, + debounce: { + title: "Debounce", + type: Number, + default: 300 + }, + selectedValue: { + title: "Selected value", + type: String + }, + buttonText: { + title: "Button text", + type: String, + observer: "_buttonTextChanged" + } + }; + } + + static get events() { + return { + search: `${this.tag}:search-event`, + select: `${this.tag}:option-selected`, + optionsShown: `${this.tag}:options-shown`, + slotchange: `slotchange` + }; + } + + constructor() { + super(PfeAutocomplete); + + this._inputInit(); + + this._slotchangeHandler = this._slotchangeHandler.bind(this); + + this._slot = this.shadowRoot.querySelector("slot"); + this._slot.addEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler); + + // @TODO: Confirm this is translatable + this._ariaAnnounceTemplate = "There are ${numOptions} suggestions. Use the up and down arrows to browse."; + + // clear button + this._clearBtn = this.shadowRoot.querySelector(".clear-search"); + this._clearBtn.addEventListener("click", this._clear.bind(this)); + + // search button + this._searchBtn = this.shadowRoot.querySelector(".search-button"); + this._searchBtn.addEventListener("click", this._search.bind(this)); + + // textual search button + this._searchBtnTextual = this.shadowRoot.querySelector(".search-button--textual"); + this._searchBtnText = this.shadowRoot.querySelector(".search-button__text"); + this._searchBtnTextual.addEventListener("click", this._search.bind(this)); + + this._dropdown = this.shadowRoot.querySelector("#dropdown"); + this._dropdown.data = []; + + this.activeIndex = null; + + this.addEventListener("keyup", this._inputKeyUp.bind(this)); + + // these two events, fire search + this.addEventListener(PfeAutocomplete.events.search, this._closeDroplist.bind(this)); + this.addEventListener(PfeAutocomplete.events.select, this._optionSelected.bind(this)); + } + + _inputInit() { + // input box + let slotNodes = this.shadowRoot.querySelector("slot").assignedNodes(); + let slotElems = slotNodes.filter(n => n.nodeType === Node.ELEMENT_NODE); + if (slotElems.length === 0) { + console.error(`${PfeAutocomplete.tag}: There must be a input tag in the light DOM`); + return; + } + this._input = slotElems[0]; + + if (this._input.tagName.toLowerCase() !== "input") { + console.error(`${PfeAutocomplete.tag}: The only child in the light DOM must be an input tag`); + + return; + } + + this._input.addEventListener("input", this._inputChanged.bind(this)); + this._input.addEventListener("blur", this._closeDroplist.bind(this)); + + this._input.setAttribute("role", "combobox"); + + if (!this._input.hasAttribute("aria-label")) { + this._input.setAttribute("aria-label", "Search"); + } + + this._input.setAttribute("aria-autocomplete", "both"); + this._input.setAttribute("aria-haspopup", "true"); + this._input.setAttribute("type", "search"); + this._input.setAttribute("autocomplete", "off"); + this._input.setAttribute("autocorrect", "off"); + this._input.setAttribute("autocapitalize", "off"); + this._input.setAttribute("spellcheck", "false"); + } + + disconnectedCallback() { + super.disconnectedCallback(); + + this.removeEventListener("keyup", this._inputKeyUp); + + this.removeEventListener(PfeAutocomplete.events.search, this._closeDroplist); + this.removeEventListener(PfeAutocomplete.events.select, this._optionSelected); + this._slot.removeEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler); + if (this._input) { + this._input.removeEventListener("input", this._inputChanged); + this._input.removeEventListener("blur", this._closeDroplist); + } + + this._clearBtn.removeEventListener("click", this._clear); + this._searchBtn.removeEventListener("click", this._search); + this._searchBtnTextual.removeEventListener("click", this._search); + } + + _initValueChanged(oldVal, newVal) { + if (newVal) { + // set inputbox and buttons in the inner component + this._input.value = newVal; + if (newVal !== "" && !this.isDisabled) { + this._searchBtn.removeAttribute("disabled"); + this._searchBtnTextual.removeAttribute("disabled"); + this._clearBtn.removeAttribute("hidden"); + } else { + this._searchBtn.setAttribute("disabled", ""); + this._searchBtnTextual.setAttribute("disabled", ""); + this._clearBtn.setAttribute("hidden", ""); + } + } + } + + _loadingChanged() { + if (!this.loading || this._input.value === "") { + this.shadowRoot.querySelector(".loading").setAttribute("hidden", ""); + } else { + this.shadowRoot.querySelector(".loading").removeAttribute("hidden"); + } + } + + _isDisabledChanged() { + if (this.isDisabled) { + this._clearBtn.setAttribute("disabled", ""); + this._searchBtn.setAttribute("disabled", ""); + this._searchBtnTextual.setAttribute("disabled", ""); + this._input.setAttribute("disabled", ""); + } else { + this._clearBtn.removeAttribute("disabled"); + this._searchBtn.removeAttribute("disabled"); + this._searchBtnTextual.removeAttribute("disabled"); + this._input.removeAttribute("disabled"); + } + } + + _buttonTextChanged(oldVal, newVal) { + if (oldVal === null) { + this._searchBtn.setAttribute("hidden", ""); + this._searchBtnText.innerHTML = newVal || "Search"; + this._searchBtnTextual.removeAttribute("hidden"); + } else if (newVal === null || newVal === "") { + this._searchBtnTextual.setAttribute("hidden", ""); + this._searchBtn.removeAttribute("hidden"); + } else { + this._searchBtnText.innerHTML = newVal || "Search"; + } + } + + _slotchangeHandler() { + this._inputInit(); + this._dropdown._ariaAnnounceTemplate = this.getAttribute("aria-announce-template") || this._ariaAnnounceTemplate; + } + + _inputChanged() { + if (this._input.value === "") { + this._searchBtn.setAttribute("disabled", ""); + this._searchBtnTextual.setAttribute("disabled", ""); + this._clearBtn.setAttribute("hidden", ""); + + this._reset(); + return; + } else { + if (!this._input.hasAttribute("disabled")) { + this._searchBtn.removeAttribute("disabled"); + this._searchBtnTextual.removeAttribute("disabled"); + } + this._clearBtn.removeAttribute("hidden"); + } + + if (throttle === false) { + throttle = true; + + window.setTimeout(() => { + this._sendAutocompleteRequest(this._input.value); + throttle = false; + }, this.debounce); + } + } + + _clear() { + this._input.value = ""; + this._clearBtn.setAttribute("hidden", ""); + this._searchBtn.setAttribute("disabled", ""); + this._searchBtnTextual.setAttribute("disabled", ""); + this._input.focus(); + } + + _search() { + this._doSearch(this._input.value); + } + + _closeDroplist() { + this._dropdown.open = null; + this._dropdown.removeAttribute("active-index"); + } + + _openDroplist() { + this.activeIndex = null; + this._dropdown.open = true; + this._dropdown.setAttribute("active-index", null); + this.emitEvent(PfeAutocomplete.events.optionsShown, { + composed: true + }); + } + + _optionSelected(e) { + let selectedValue = e.detail.optionValue; + + // update input box with selected value from options list + this._input.value = selectedValue; + + // send search request + this._doSearch(selectedValue); + } + + _doSearch(searchQuery) { + this.emitEvent(PfeAutocomplete.events.search, { + detail: { searchValue: searchQuery }, + composed: true + }); + this._reset(); + this.selectedValue = searchQuery; + } + + _sendAutocompleteRequest(input) { + if (!this.autocompleteRequest) return; + + this.autocompleteRequest({ query: input }, this._autocompleteCallback.bind(this)); + } + + _autocompleteCallback(response) { + this._dropdown.data = response; + this._dropdown.reflow = true; + response.length !== 0 ? this._openDroplist() : this._closeDroplist(); + } + + _reset() { + this._dropdown.activeIndex = null; + this._input.setAttribute("aria-activedescendant", ""); + this._dropdown.data = []; + this._closeDroplist(); + } + + _activeOption(activeIndex) { + if (activeIndex === null || activeIndex === "null") return; + return this._dropdown.shadowRoot.querySelector("li:nth-child(" + (parseInt(activeIndex, 10) + 1) + ")").innerHTML; + } + + _inputKeyUp(e) { + let key = e.keyCode; + + if ( + this._dropdown.data.length === 0 && + key !== KEYCODE.DOWN && + key !== KEYCODE.UP && + key !== KEYCODE.ENTER && + key !== KEYCODE.ESC + ) + return; + + let activeIndex = this._dropdown.activeIndex; + let optionsLength = this._dropdown.data.length; + + if (key == KEYCODE.ESC) { + this._closeDroplist(); + } else if (key === KEYCODE.UP) { + if (!this._dropdown.open) { + return; + } + + activeIndex = activeIndex === null || activeIndex === "null" ? optionsLength : parseInt(activeIndex, 10); + + activeIndex -= 1; + + if (activeIndex < 0) { + activeIndex = optionsLength - 1; + } + + this._input.value = this._activeOption(activeIndex); + } else if (key === KEYCODE.DOWN) { + if (!this._dropdown.open) { + return; + } + + activeIndex = activeIndex === null || activeIndex === "null" ? -1 : parseInt(activeIndex, 10); + activeIndex += 1; + + if (activeIndex > optionsLength - 1) { + activeIndex = 0; + } + + this._input.value = this._activeOption(activeIndex); + } else if (key === KEYCODE.ENTER) { + if (this._activeOption(activeIndex)) { + this.emitEvent(PfeAutocomplete.events.select, { + detail: { optionValue: this._activeOption(activeIndex) }, + composed: true + }); + + return; + } + + let selectedValue = this._input.value; + this._doSearch(selectedValue); + return; + } + + if (activeIndex !== null && activeIndex !== "null") { + this._input.setAttribute("aria-activedescendant", "option-" + activeIndex); + } else { + this._input.setAttribute("aria-activedescendant", ""); + } + + this.activeIndex = activeIndex; + this._dropdown.activeIndex = activeIndex; + } +} + +/* +* - Attributes ------------------------------------ +* open | Set when the combo box dropdown is open +* active-index | Set selected option +* reflow | Re-renders the dropdown + +* - Events ---------------------------------------- +* pfe-autocomplete:option-selected | Fires when an option is selected. + event.details.optionValue contains the selected value. +*/ +class PfeSearchDroplist extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + +
+
+
    +
+
`; + } + + static get tag() { + return "pfe-search-droplist"; + } + + get templateUrl() { + return "pfe-search-droplist.html"; + } + + get styleUrl() { + return "pfe-search-droplist.scss"; + } + + static get properties() { + return { + open: { + title: "Open", + type: Boolean + }, + reflow: { + title: "Reflow", + type: Boolean, + observer: "_renderOptions" + }, + activeIndex: { + title: "Active index", + type: Number, + observer: "_activeIndexChanged" + } + }; + } + + constructor() { + super(PfeSearchDroplist); + } + + connectedCallback() { + super.connectedCallback(); + + this._ariaAnnounce = this.shadowRoot.querySelector(".suggestions-aria-help"); + + this.activeIndex = null; + this._ul = this.shadowRoot.querySelector("ul"); + this._ul.addEventListener("mousedown", this._optionSelected.bind(this)); + } + + disconnectedCallback() { + super.disconnectedCallback(); + this._ul.removeEventListener("mousedown", this._optionSelected); + } + + _optionSelected(e) { + if (e.target.tagName === "LI") { + this.emitEvent(PfeAutocomplete.events.select, { + detail: { optionValue: e.target.innerText }, + composed: true + }); + } + } + + _renderOptions() { + let options = this.data; + let ariaAnnounceText = ""; + + if (this._ariaAnnounceTemplate) { + ariaAnnounceText = this._ariaAnnounceTemplate.replace("${numOptions}", options.length); + } + + this._ariaAnnounce.textContent = ariaAnnounceText; + this._ariaAnnounce.setAttribute("aria-live", "polite"); + + this._ul.innerHTML = `${options + .map((item, index) => { + return `
  • ${item}
  • `; + }) + .join("")}`; + } + + _activeIndexChanged() { + if (!this.data || this.data.length === 0 || this.activeIndex === null || this.activeIndex === "null") return; + + // remove active class + if (this._ul.querySelector(".active")) { + this._ul.querySelector(".active").classList.remove("active"); + } + + // add active class to selected option + let activeOption = this._ul.querySelector("li:nth-child(" + (parseInt(this.activeIndex, 10) + 1) + ")"); + + activeOption.classList.add("active"); + + // scroll to selected element when selected item with keyboard is out of view + let ulWrapper = this.shadowRoot.querySelector(".droplist"); + let activeOptionHeight = activeOption.offsetHeight; + activeOptionHeight += parseInt(window.getComputedStyle(activeOption).getPropertyValue("margin-bottom"), 10); + ulWrapper.scrollTop = activeOption.offsetTop - ulWrapper.offsetHeight + activeOptionHeight; + } +} + +PFElement.create(PfeSearchDroplist); +PFElement.create(PfeAutocomplete); + +export default PfeAutocomplete; +//# sourceMappingURL=pfe-autocomplete.js.map diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.js.map b/elements/pfe-autocomplete/dist/pfe-autocomplete.js.map new file mode 100644 index 0000000000..5f0b4d45cb --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-autocomplete.js","sources":["../_temp/pfe-autocomplete.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeAutocomplete 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\nimport \"../../pfe-button/dist/pfe-button.js\";\n\nconst KEYCODE = {\n ENTER: 13,\n DOWN: 40,\n UP: 38,\n ESC: 27\n};\n\n// use this variable to debounce api call when user types very fast\nlet throttle = false;\n\nclass PfeAutocomplete extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n
    \n \n\n \n\n \n\n \n
    \n \n
    \n\n`;\n }\n\n // @TODO: Deprecating in 1.0 release\n // Injected at build-time\n static get schemaProperties() {\n return {\"debounce_timer\":{\"title\":\"Debounce\",\"description\":\"The amount of time that should pass before the next API call is made\",\"type\":\"string\",\"prefixed\":false},\"init_value\":{\"title\":\"Initial value\",\"description\":\"An initial value to show in the input field\",\"type\":\"string\",\"prefixed\":false},\"is_disabled\":{\"title\":\"Is disabled\",\"description\":\"Disable the input\",\"type\":\"boolean\",\"prefixed\":false},\"button-text\":{\"title\":\"Button text\",\"description\":\"Add button with text next to input field\",\"type\":\"string\",\"prefixed\":false}};\n }\n\n // Injected at build-time\n static get slots() {\n return {\"content\":{\"title\":\"Content\",\"type\":\"array\",\"namedSlot\":false,\"items\":{\"oneOf\":[{\"$ref\":\"input\"}]},\"required\":true}};\n }\n\n static get tag() {\n return \"pfe-autocomplete\";\n }\n\n get schemaUrl() {\n return \"pfe-autocomplete.json\";\n }\n\n get templateUrl() {\n return \"pfe-autocomplete.html\";\n }\n\n get styleUrl() {\n return \"pfe-autocomplete.scss\";\n }\n\n static get properties() {\n return {\n initValue: {\n title: \"Initial Value\",\n type: String,\n observer: \"_initValueChanged\"\n },\n loading: {\n title: \"Loading\",\n type: Boolean,\n default: false,\n observer: \"_loadingChanged\"\n },\n isDisabled: {\n title: \"Is disabled\",\n type: Boolean,\n default: false,\n observer: \"_isDisabledChanged\"\n },\n debounce: {\n title: \"Debounce\",\n type: Number,\n default: 300\n },\n selectedValue: {\n title: \"Selected value\",\n type: String\n },\n buttonText: {\n title: \"Button text\",\n type: String,\n observer: \"_buttonTextChanged\"\n }\n };\n }\n\n static get events() {\n return {\n search: `${this.tag}:search-event`,\n select: `${this.tag}:option-selected`,\n optionsShown: `${this.tag}:options-shown`,\n slotchange: `slotchange`\n };\n }\n\n constructor() {\n super(PfeAutocomplete);\n\n this._inputInit();\n\n this._slotchangeHandler = this._slotchangeHandler.bind(this);\n\n this._slot = this.shadowRoot.querySelector(\"slot\");\n this._slot.addEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler);\n\n // @TODO: Confirm this is translatable\n this._ariaAnnounceTemplate = \"There are ${numOptions} suggestions. Use the up and down arrows to browse.\";\n\n // clear button\n this._clearBtn = this.shadowRoot.querySelector(\".clear-search\");\n this._clearBtn.addEventListener(\"click\", this._clear.bind(this));\n\n // search button\n this._searchBtn = this.shadowRoot.querySelector(\".search-button\");\n this._searchBtn.addEventListener(\"click\", this._search.bind(this));\n\n // textual search button\n this._searchBtnTextual = this.shadowRoot.querySelector(\".search-button--textual\");\n this._searchBtnText = this.shadowRoot.querySelector(\".search-button__text\");\n this._searchBtnTextual.addEventListener(\"click\", this._search.bind(this));\n\n this._dropdown = this.shadowRoot.querySelector(\"#dropdown\");\n this._dropdown.data = [];\n\n this.activeIndex = null;\n\n this.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\n\n // these two events, fire search\n this.addEventListener(PfeAutocomplete.events.search, this._closeDroplist.bind(this));\n this.addEventListener(PfeAutocomplete.events.select, this._optionSelected.bind(this));\n }\n\n _inputInit() {\n // input box\n let slotNodes = this.shadowRoot.querySelector(\"slot\").assignedNodes();\n let slotElems = slotNodes.filter(n => n.nodeType === Node.ELEMENT_NODE);\n if (slotElems.length === 0) {\n console.error(`${PfeAutocomplete.tag}: There must be a input tag in the light DOM`);\n return;\n }\n this._input = slotElems[0];\n\n if (this._input.tagName.toLowerCase() !== \"input\") {\n console.error(`${PfeAutocomplete.tag}: The only child in the light DOM must be an input tag`);\n\n return;\n }\n\n this._input.addEventListener(\"input\", this._inputChanged.bind(this));\n this._input.addEventListener(\"blur\", this._closeDroplist.bind(this));\n\n this._input.setAttribute(\"role\", \"combobox\");\n\n if (!this._input.hasAttribute(\"aria-label\")) {\n this._input.setAttribute(\"aria-label\", \"Search\");\n }\n\n this._input.setAttribute(\"aria-autocomplete\", \"both\");\n this._input.setAttribute(\"aria-haspopup\", \"true\");\n this._input.setAttribute(\"type\", \"search\");\n this._input.setAttribute(\"autocomplete\", \"off\");\n this._input.setAttribute(\"autocorrect\", \"off\");\n this._input.setAttribute(\"autocapitalize\", \"off\");\n this._input.setAttribute(\"spellcheck\", \"false\");\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"keyup\", this._inputKeyUp);\n\n this.removeEventListener(PfeAutocomplete.events.search, this._closeDroplist);\n this.removeEventListener(PfeAutocomplete.events.select, this._optionSelected);\n this._slot.removeEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler);\n if (this._input) {\n this._input.removeEventListener(\"input\", this._inputChanged);\n this._input.removeEventListener(\"blur\", this._closeDroplist);\n }\n\n this._clearBtn.removeEventListener(\"click\", this._clear);\n this._searchBtn.removeEventListener(\"click\", this._search);\n this._searchBtnTextual.removeEventListener(\"click\", this._search);\n }\n\n _initValueChanged(oldVal, newVal) {\n if (newVal) {\n // set inputbox and buttons in the inner component\n this._input.value = newVal;\n if (newVal !== \"\" && !this.isDisabled) {\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n this._clearBtn.removeAttribute(\"hidden\");\n } else {\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._clearBtn.setAttribute(\"hidden\", \"\");\n }\n }\n }\n\n _loadingChanged() {\n if (!this.loading || this._input.value === \"\") {\n this.shadowRoot.querySelector(\".loading\").setAttribute(\"hidden\", \"\");\n } else {\n this.shadowRoot.querySelector(\".loading\").removeAttribute(\"hidden\");\n }\n }\n\n _isDisabledChanged() {\n if (this.isDisabled) {\n this._clearBtn.setAttribute(\"disabled\", \"\");\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._input.setAttribute(\"disabled\", \"\");\n } else {\n this._clearBtn.removeAttribute(\"disabled\");\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n this._input.removeAttribute(\"disabled\");\n }\n }\n\n _buttonTextChanged(oldVal, newVal) {\n if (oldVal === null) {\n this._searchBtn.setAttribute(\"hidden\", \"\");\n this._searchBtnText.innerHTML = newVal || \"Search\";\n this._searchBtnTextual.removeAttribute(\"hidden\");\n } else if (newVal === null || newVal === \"\") {\n this._searchBtnTextual.setAttribute(\"hidden\", \"\");\n this._searchBtn.removeAttribute(\"hidden\");\n } else {\n this._searchBtnText.innerHTML = newVal || \"Search\";\n }\n }\n\n _slotchangeHandler() {\n this._inputInit();\n this._dropdown._ariaAnnounceTemplate = this.getAttribute(\"aria-announce-template\") || this._ariaAnnounceTemplate;\n }\n\n _inputChanged() {\n if (this._input.value === \"\") {\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._clearBtn.setAttribute(\"hidden\", \"\");\n\n this._reset();\n return;\n } else {\n if (!this._input.hasAttribute(\"disabled\")) {\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n }\n this._clearBtn.removeAttribute(\"hidden\");\n }\n\n if (throttle === false) {\n throttle = true;\n\n window.setTimeout(() => {\n this._sendAutocompleteRequest(this._input.value);\n throttle = false;\n }, this.debounce);\n }\n }\n\n _clear() {\n this._input.value = \"\";\n this._clearBtn.setAttribute(\"hidden\", \"\");\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._input.focus();\n }\n\n _search() {\n this._doSearch(this._input.value);\n }\n\n _closeDroplist() {\n this._dropdown.open = null;\n this._dropdown.removeAttribute(\"active-index\");\n }\n\n _openDroplist() {\n this.activeIndex = null;\n this._dropdown.open = true;\n this._dropdown.setAttribute(\"active-index\", null);\n this.emitEvent(PfeAutocomplete.events.optionsShown, {\n composed: true\n });\n }\n\n _optionSelected(e) {\n let selectedValue = e.detail.optionValue;\n\n // update input box with selected value from options list\n this._input.value = selectedValue;\n\n // send search request\n this._doSearch(selectedValue);\n }\n\n _doSearch(searchQuery) {\n this.emitEvent(PfeAutocomplete.events.search, {\n detail: { searchValue: searchQuery },\n composed: true\n });\n this._reset();\n this.selectedValue = searchQuery;\n }\n\n _sendAutocompleteRequest(input) {\n if (!this.autocompleteRequest) return;\n\n this.autocompleteRequest({ query: input }, this._autocompleteCallback.bind(this));\n }\n\n _autocompleteCallback(response) {\n this._dropdown.data = response;\n this._dropdown.reflow = true;\n response.length !== 0 ? this._openDroplist() : this._closeDroplist();\n }\n\n _reset() {\n this._dropdown.activeIndex = null;\n this._input.setAttribute(\"aria-activedescendant\", \"\");\n this._dropdown.data = [];\n this._closeDroplist();\n }\n\n _activeOption(activeIndex) {\n if (activeIndex === null || activeIndex === \"null\") return;\n return this._dropdown.shadowRoot.querySelector(\"li:nth-child(\" + (parseInt(activeIndex, 10) + 1) + \")\").innerHTML;\n }\n\n _inputKeyUp(e) {\n let key = e.keyCode;\n\n if (\n this._dropdown.data.length === 0 &&\n key !== KEYCODE.DOWN &&\n key !== KEYCODE.UP &&\n key !== KEYCODE.ENTER &&\n key !== KEYCODE.ESC\n )\n return;\n\n let activeIndex = this._dropdown.activeIndex;\n let optionsLength = this._dropdown.data.length;\n\n if (key == KEYCODE.ESC) {\n this._closeDroplist();\n } else if (key === KEYCODE.UP) {\n if (!this._dropdown.open) {\n return;\n }\n\n activeIndex = activeIndex === null || activeIndex === \"null\" ? optionsLength : parseInt(activeIndex, 10);\n\n activeIndex -= 1;\n\n if (activeIndex < 0) {\n activeIndex = optionsLength - 1;\n }\n\n this._input.value = this._activeOption(activeIndex);\n } else if (key === KEYCODE.DOWN) {\n if (!this._dropdown.open) {\n return;\n }\n\n activeIndex = activeIndex === null || activeIndex === \"null\" ? -1 : parseInt(activeIndex, 10);\n activeIndex += 1;\n\n if (activeIndex > optionsLength - 1) {\n activeIndex = 0;\n }\n\n this._input.value = this._activeOption(activeIndex);\n } else if (key === KEYCODE.ENTER) {\n if (this._activeOption(activeIndex)) {\n this.emitEvent(PfeAutocomplete.events.select, {\n detail: { optionValue: this._activeOption(activeIndex) },\n composed: true\n });\n\n return;\n }\n\n let selectedValue = this._input.value;\n this._doSearch(selectedValue);\n return;\n }\n\n if (activeIndex !== null && activeIndex !== \"null\") {\n this._input.setAttribute(\"aria-activedescendant\", \"option-\" + activeIndex);\n } else {\n this._input.setAttribute(\"aria-activedescendant\", \"\");\n }\n\n this.activeIndex = activeIndex;\n this._dropdown.activeIndex = activeIndex;\n }\n}\n\n/*\n* - Attributes ------------------------------------\n* open | Set when the combo box dropdown is open\n* active-index | Set selected option\n* reflow | Re-renders the dropdown\n\n* - Events ----------------------------------------\n* pfe-autocomplete:option-selected | Fires when an option is selected.\n event.details.optionValue contains the selected value.\n*/\nclass PfeSearchDroplist extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n
    \n
      \n
    \n
    `;\n }\n\n static get tag() {\n return \"pfe-search-droplist\";\n }\n\n get templateUrl() {\n return \"pfe-search-droplist.html\";\n }\n\n get styleUrl() {\n return \"pfe-search-droplist.scss\";\n }\n\n static get properties() {\n return {\n open: {\n title: \"Open\",\n type: Boolean\n },\n reflow: {\n title: \"Reflow\",\n type: Boolean,\n observer: \"_renderOptions\"\n },\n activeIndex: {\n title: \"Active index\",\n type: Number,\n observer: \"_activeIndexChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeSearchDroplist);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this._ariaAnnounce = this.shadowRoot.querySelector(\".suggestions-aria-help\");\n\n this.activeIndex = null;\n this._ul = this.shadowRoot.querySelector(\"ul\");\n this._ul.addEventListener(\"mousedown\", this._optionSelected.bind(this));\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._ul.removeEventListener(\"mousedown\", this._optionSelected);\n }\n\n _optionSelected(e) {\n if (e.target.tagName === \"LI\") {\n this.emitEvent(PfeAutocomplete.events.select, {\n detail: { optionValue: e.target.innerText },\n composed: true\n });\n }\n }\n\n _renderOptions() {\n let options = this.data;\n let ariaAnnounceText = \"\";\n\n if (this._ariaAnnounceTemplate) {\n ariaAnnounceText = this._ariaAnnounceTemplate.replace(\"${numOptions}\", options.length);\n }\n\n this._ariaAnnounce.textContent = ariaAnnounceText;\n this._ariaAnnounce.setAttribute(\"aria-live\", \"polite\");\n\n this._ul.innerHTML = `${options\n .map((item, index) => {\n return `
  • ${item}
  • `;\n })\n .join(\"\")}`;\n }\n\n _activeIndexChanged() {\n if (!this.data || this.data.length === 0 || this.activeIndex === null || this.activeIndex === \"null\") return;\n\n // remove active class\n if (this._ul.querySelector(\".active\")) {\n this._ul.querySelector(\".active\").classList.remove(\"active\");\n }\n\n // add active class to selected option\n let activeOption = this._ul.querySelector(\"li:nth-child(\" + (parseInt(this.activeIndex, 10) + 1) + \")\");\n\n activeOption.classList.add(\"active\");\n\n // scroll to selected element when selected item with keyboard is out of view\n let ulWrapper = this.shadowRoot.querySelector(\".droplist\");\n let activeOptionHeight = activeOption.offsetHeight;\n activeOptionHeight += parseInt(window.getComputedStyle(activeOption).getPropertyValue(\"margin-bottom\"), 10);\n ulWrapper.scrollTop = activeOption.offsetTop - ulWrapper.offsetHeight + activeOptionHeight;\n }\n}\n\nPFElement.create(PfeSearchDroplist);\nPFElement.create(PfeAutocomplete);\n\nexport default PfeAutocomplete;\n"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA,MAAM,OAAO,GAAG;AAChB,EAAE,KAAK,EAAE,EAAE;AACX,EAAE,IAAI,EAAE,EAAE;AACV,EAAE,EAAE,EAAE,EAAE;AACR,EAAE,GAAG,EAAE,EAAE;AACT,CAAC,CAAC;AACF;AACA;AACA,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB;AACA,MAAM,eAAe,SAAS,SAAS,CAAC;AACxC;AACA;AACA,EAAE,WAAW,OAAO,GAAG;AACvB,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA;AACA,EAAE,IAAI,IAAI,GAAG;AACb,IAAI,OAAO,CAAC;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,CAAC,CAAC;AACf,GAAG;AACH;AACA;AACA;AACA,EAAE,WAAW,gBAAgB,GAAG;AAChC,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,sEAAsE,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,eAAe,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AAC;AAChH,IAAI,SAAS,CAAC,SAAS,GAAG,YAAY,CAAC,SAAS,GAAG,SAAS,CAAC,YAAY,GAAG,kBAAkB,CAAC;AAC/F,GAAG;AACH,CAAC;AACD;AACA,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACpC,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC;;;;"} \ No newline at end of file diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.json b/elements/pfe-autocomplete/dist/pfe-autocomplete.json new file mode 100644 index 0000000000..69a434bb6b --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.json @@ -0,0 +1,63 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Autocomplete", + "description": "Autocomplete provides options in a dropdown list as user types in an input box by showing result from an api call.", + "type": "object", + "tag": "pfe-autocomplete", + "class": "pfe-autocomplete", + "category": "content", + "properties": { + "slots": { + "title": "Slots", + "description": "Definition of the supported slots", + "type": "object", + "properties": { + "content": { + "title": "Content", + "type": "array", + "namedSlot": false, + "items": { + "oneOf": [ + { + "$ref": "input" + } + ] + }, + "required": true + } + } + }, + "attributes": { + "title": "Attributes", + "type": "object", + "properties": { + "debounce_timer": { + "title": "Debounce", + "description": "The amount of time that should pass before the next API call is made", + "type": "string", + "prefixed": false + }, + "init_value": { + "title": "Initial value", + "description": "An initial value to show in the input field", + "type": "string", + "prefixed": false + }, + "is_disabled": { + "title": "Is disabled", + "description": "Disable the input", + "type": "boolean", + "prefixed": false + }, + "button-text": { + "title": "Button text", + "description": "Add button with text next to input field", + "type": "string", + "prefixed": false + } + } + } + }, + "required": ["slots", "attributes"], + "additionalProperties": false +} diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.min.css.map b/elements/pfe-autocomplete/dist/pfe-autocomplete.min.css.map new file mode 100644 index 0000000000..cfb3f5a0b1 --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/pfe-autocomplete.scss","../../../pfe-sass/extends/_extends.scss","../../../pfe-sass/mixins/_mixins.scss","../../../pfe-sass/mixins/_custom-properties.scss","pfe-autocomplete.css"],"names":[],"mappings":"AAwCA,SCNE,SAAA,SACA,SAAA,OACA,KAAA,cACA,OAAA,IACA,MAAA,IACA,OAAA,KACA,QAAA,EACA,OAAA,ECtCI,6CAAA,oCCyLF,MFrIA,MAAA,mBEgIA,iBAtHM,wBAAA,6CAAA,wBAAA,gDAAA,+BAAA,uDAAA,+BAAA,uDAAA,iCAAA,yDAAA,mCAAA,iDAAA,0CAAA,6DAAA,0CAAA,6DAAA,4CAAA,0DAsHN,sBAtHM,wBAAA,kDAAA,wBAAA,kDAAA,+BAAA,4DAAA,+BAAA,4DAAA,iCAAA,8DAAA,mCAAA,2DAAA,0CAAA,kEAAA,0CAAA,kEAAA,4CAAA,oEAsHN,kBAtHM,wBAAA,uCAAA,wBAAA,oCAAA,+BAAA,8CAAA,+BAAA,8CAAA,iCAAA,gDAAA,mCAAA,wCAAA,0CAAA,oDAAA,0CAAA,oDAAA,4CAAA,iDHrDV,MACE,QAAA,MACA,SAAA,SACA,YAAA,cAAA,CAAA,UAAA,CAAA,QAAA,CAAA,QAAA,CAAA,KAAA,CAAA,WAAA,YAAA,qGGqFI,8BAAA,kEAAA,oCAAA,iDAAA,2BAAA,wCAAA,0CAAA,kDHjFN,qBACE,QAAA,YAAA,QAAA,aAAA,QAAA,YAAA,QAAA,KADF,8BAGI,iBAAA,EAAA,aAAA,EAAA,SAAA,EAAA,KAAA,EAHJ,wCAOI,SAAA,SAPJ,yCAWI,MAAA,KAMJ,iFACE,mBAAA,KAOF,mBACE,aAAA,KAAA,aAAA,6CADF,oCAII,MAAA,KACA,iBAAA,EAAA,aAAA,EAAA,SAAA,EAAA,KAAA,EACA,mBAAA,MAAA,EAAA,EAAA,QAAA,EAAA,kBAAA,WAAA,MAAA,EAAA,EAAA,QAAA,EAAA,kBAAA,mBAAA,6GAAA,WAA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MAAA,KACA,IAAA,EACA,OAAA,EALF,aAOI,MAAA,KACA,YAAA","file":"pfe-autocomplete.min.css","sourceRoot":"../src","sourcesContent":[null,null,null,null,".sr-only {\n position: absolute;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n color: #151515 !important;\n }\n}\n\n:host([on=\"dark\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #73bcf7);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #bee1f4);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #bee1f4);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #bee1f4);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-dark, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-dark, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-dark, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-dark, none);\n}\n\n:host([on=\"saturated\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-saturated, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-saturated, #fff);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-saturated, #fafafa);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-saturated, #fafafa);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-saturated, #d2d2d2);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-saturated, underline);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-saturated, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-saturated, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-saturated, underline);\n}\n\n:host([on=\"light\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text, #151515);\n --pfe-broadcasted--link: var(--pfe-theme--color--link, #06c);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover, #004080);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus, #004080);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited, #6753ac);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited, none);\n}\n\n:host {\n display: block;\n position: relative;\n font-family: \"Red Hat Text\", \"RedHatText\", \"Overpass\", Overpass, Arial, sans-serif;\n font-family: var(--pfe-theme--font-family, \"Red Hat Text\", \"RedHatText\", \"Overpass\", Overpass, Arial, sans-serif);\n --pfe-autocomplete--BoxShadow: var(--pfe-theme--box-shadow--inset, inset 0 0 0.625rem 0 #fafafa);\n --pfe-autocomplete--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n --pfe-autocomplete--Border: var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-theme--color--surface--border, #d2d2d2);\n}\n\n:host([button-text]) {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n}\n\n:host([button-text]) #wrapper {\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n\n:host([button-text]) #input-box-wrapper {\n position: relative;\n}\n\n:host([button-text]) button.clear-search {\n right: 10px;\n}\n\n:host([button-text]) ::slotted(input[type=\"search\"]::-webkit-search-cancel-button) {\n -webkit-appearance: none;\n}\n\n#input-box-wrapper {\n border-color: #06c;\n border-color: var(--pfe-theme--color--feedback--info, #06c);\n}\n\n#input-box-wrapper ::slotted(input) {\n width: 100%;\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n -webkit-box-shadow: inset 0 0 0.625rem 0 #fafafa !important;\n box-shadow: inset 0 0 0.625rem 0 #fafafa !important;\n -webkit-box-shadow: var(--pfe-autocomplete--BoxShadow, var(--pfe-theme--box-shadow--inset, inset 0 0 0.625rem 0 #fafafa)) !important;\n box-shadow: var(--pfe-autocomplete--BoxShadow, var(--pfe-theme--box-shadow--inset, inset 0 0 0.625rem 0 #fafafa)) !important;\n padding-left: 10px;\n padding-right: 30px;\n border-radius: 2px;\n border-radius: var(--pfe-theme--ui--border-radius, 2px);\n background-color: #fff;\n background-color: var(--pfe-autocomplete--BackgroundColor, var(--pfe-theme--color--surface--lightest, #fff));\n border: 1px solid #d2d2d2;\n border: var(--pfe-autocomplete--Border, var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-theme--color--surface--border, #d2d2d2));\n font-size: 1rem;\n font-size: var(--pfe-theme--font-size, 1rem);\n font-family: \"Red Hat Text\", \"RedHatText\", \"Overpass\", Overpass, Arial, sans-serif;\n font-family: var(--pfe-theme--font-family, \"Red Hat Text\", \"RedHatText\", \"Overpass\", Overpass, Arial, sans-serif);\n height: calc(20px * 2);\n height: calc(var(--pfe-theme--ui--element--size, 20px) * 2);\n -webkit-transition: border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;\n transition: border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;\n transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;\n transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;\n opacity: 1;\n outline: 0;\n}\n\n#input-box-wrapper ::slotted(input:disabled),\n#input-box-wrapper button:disabled {\n cursor: not-allowed;\n color: #ccc;\n}\n\n#input-box-wrapper ::slotted(input:disabled) {\n padding-right: 10px;\n}\n\n#input-box-wrapper button:focus,\n#input-box-wrapper ::slotted(input:focus) {\n outline: 0;\n}\n\n#input-box-wrapper ::slotted(input),\n#input-box-wrapper button {\n -webkit-appearance: none;\n}\n\n#input-box-wrapper ::slotted([type=\"search\"]::-ms-clear) {\n display: none;\n}\n\n#input-box-wrapper ::slotted(input[type=\"search\"]::-webkit-search-cancel-button),\n#input-box-wrapper ::slotted(input[type=\"search\"]::-webkit-search-decoration) {\n -webkit-appearance: none;\n}\n\nbutton {\n color: #6a6e73;\n color: var(--pfe-theme--color--ui-base, #6a6e73);\n background-color: transparent;\n border: none;\n position: absolute;\n top: 0;\n bottom: 0;\n cursor: pointer;\n}\n\nbutton.clear-search {\n right: 30px;\n width: 20px;\n margin: 2px 1px;\n background-color: #fff;\n background-color: var(--pfe-theme--color--surface--lightest, #fff);\n}\n\nbutton.clear-search:hover {\n color: #6a6e73;\n color: var(--pfe-theme--color--ui-base, #6a6e73);\n}\n\nbutton.clear-search svg {\n width: 12px;\n stroke: #d2d2d2;\n stroke: var(--pfe-theme--color--surface--border, #d2d2d2);\n}\n\nbutton.clear-search:hover svg,\nbutton.clear-search:focus svg {\n opacity: 1;\n stroke: #06c;\n stroke: var(--pfe-theme--color--link, #06c);\n}\n\nbutton[disabled].clear-search:hover svg,\nbutton[disabled].clear-search:focus svg {\n stroke: #d2d2d2;\n stroke: var(--pfe-theme--color--surface--border, #d2d2d2);\n}\n\nbutton.search-button {\n right: 1px;\n width: 30px;\n}\n\nbutton.search-button svg {\n fill: #06c;\n fill: var(--pfe-theme--color--link, #06c);\n width: 16px;\n}\n\nbutton.search-button:hover svg,\nbutton.search-button:focus svg {\n fill: #004080;\n fill: var(--pfe-theme--color--link--hover, #004080);\n}\n\nbutton.search-button:disabled svg {\n fill: #d2d2d2;\n fill: var(--pfe-theme--color--ui-disabled, #d2d2d2);\n}\n\npfe-button.search-button--textual {\n margin-left: 16px;\n}\n\n.loading {\n position: absolute;\n width: 30px;\n right: 52px;\n top: 0px;\n bottom: 0px;\n}\n\n.loading svg {\n width: 26px;\n padding-top: 7px;\n}\n\n/*# sourceMappingURL=pfe-autocomplete.css.map */\n"]} \ No newline at end of file diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.min.js b/elements/pfe-autocomplete/dist/pfe-autocomplete.min.js new file mode 100644 index 0000000000..9d1b7d5d65 --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.min.js @@ -0,0 +1,26 @@ +import e from"../../pfelement/dist/pfelement.min.js";import"../../pfe-button/dist/pfe-button.min.js"; +/*! + * PatternFly Elements: PfeAutocomplete 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/const t={ENTER:13,DOWN:40,UP:38,ESC:27};let i=!1;class o extends e{static get version(){return"1.3.0"}get html(){return'\n\n
    \n
    \n \n\n \n\n \n\n \n
    \n \n
    \n\n'}static get schemaProperties(){return{debounce_timer:{title:"Debounce",description:"The amount of time that should pass before the next API call is made",type:"string",prefixed:!1},init_value:{title:"Initial value",description:"An initial value to show in the input field",type:"string",prefixed:!1},is_disabled:{title:"Is disabled",description:"Disable the input",type:"boolean",prefixed:!1},"button-text":{title:"Button text",description:"Add button with text next to input field",type:"string",prefixed:!1}}}static get slots(){return{content:{title:"Content",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"input"}]},required:!0}}}static get tag(){return"pfe-autocomplete"}get schemaUrl(){return"pfe-autocomplete.json"}get templateUrl(){return"pfe-autocomplete.html"}get styleUrl(){return"pfe-autocomplete.scss"}static get properties(){return{initValue:{title:"Initial Value",type:String,observer:"_initValueChanged"},loading:{title:"Loading",type:Boolean,default:!1,observer:"_loadingChanged"},isDisabled:{title:"Is disabled",type:Boolean,default:!1,observer:"_isDisabledChanged"},debounce:{title:"Debounce",type:Number,default:300},selectedValue:{title:"Selected value",type:String},buttonText:{title:"Button text",type:String,observer:"_buttonTextChanged"}}}static get events(){return{search:`${this.tag}:search-event`,select:`${this.tag}:option-selected`,optionsShown:`${this.tag}:options-shown`,slotchange:"slotchange"}}constructor(){super(o),this._inputInit(),this._slotchangeHandler=this._slotchangeHandler.bind(this),this._slot=this.shadowRoot.querySelector("slot"),this._slot.addEventListener(o.events.slotchange,this._slotchangeHandler),this._ariaAnnounceTemplate="There are ${numOptions} suggestions. Use the up and down arrows to browse.",this._clearBtn=this.shadowRoot.querySelector(".clear-search"),this._clearBtn.addEventListener("click",this._clear.bind(this)),this._searchBtn=this.shadowRoot.querySelector(".search-button"),this._searchBtn.addEventListener("click",this._search.bind(this)),this._searchBtnTextual=this.shadowRoot.querySelector(".search-button--textual"),this._searchBtnText=this.shadowRoot.querySelector(".search-button__text"),this._searchBtnTextual.addEventListener("click",this._search.bind(this)),this._dropdown=this.shadowRoot.querySelector("#dropdown"),this._dropdown.data=[],this.activeIndex=null,this.addEventListener("keyup",this._inputKeyUp.bind(this)),this.addEventListener(o.events.search,this._closeDroplist.bind(this)),this.addEventListener(o.events.select,this._optionSelected.bind(this))}_inputInit(){let e=this.shadowRoot.querySelector("slot").assignedNodes().filter(e=>e.nodeType===Node.ELEMENT_NODE);0!==e.length?(this._input=e[0],"input"===this._input.tagName.toLowerCase()?(this._input.addEventListener("input",this._inputChanged.bind(this)),this._input.addEventListener("blur",this._closeDroplist.bind(this)),this._input.setAttribute("role","combobox"),this._input.hasAttribute("aria-label")||this._input.setAttribute("aria-label","Search"),this._input.setAttribute("aria-autocomplete","both"),this._input.setAttribute("aria-haspopup","true"),this._input.setAttribute("type","search"),this._input.setAttribute("autocomplete","off"),this._input.setAttribute("autocorrect","off"),this._input.setAttribute("autocapitalize","off"),this._input.setAttribute("spellcheck","false")):console.error(`${o.tag}: The only child in the light DOM must be an input tag`)):console.error(`${o.tag}: There must be a input tag in the light DOM`)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keyup",this._inputKeyUp),this.removeEventListener(o.events.search,this._closeDroplist),this.removeEventListener(o.events.select,this._optionSelected),this._slot.removeEventListener(o.events.slotchange,this._slotchangeHandler),this._input&&(this._input.removeEventListener("input",this._inputChanged),this._input.removeEventListener("blur",this._closeDroplist)),this._clearBtn.removeEventListener("click",this._clear),this._searchBtn.removeEventListener("click",this._search),this._searchBtnTextual.removeEventListener("click",this._search)}_initValueChanged(e,t){t&&(this._input.value=t,""===t||this.isDisabled?(this._searchBtn.setAttribute("disabled",""),this._searchBtnTextual.setAttribute("disabled",""),this._clearBtn.setAttribute("hidden","")):(this._searchBtn.removeAttribute("disabled"),this._searchBtnTextual.removeAttribute("disabled"),this._clearBtn.removeAttribute("hidden")))}_loadingChanged(){this.loading&&""!==this._input.value?this.shadowRoot.querySelector(".loading").removeAttribute("hidden"):this.shadowRoot.querySelector(".loading").setAttribute("hidden","")}_isDisabledChanged(){this.isDisabled?(this._clearBtn.setAttribute("disabled",""),this._searchBtn.setAttribute("disabled",""),this._searchBtnTextual.setAttribute("disabled",""),this._input.setAttribute("disabled","")):(this._clearBtn.removeAttribute("disabled"),this._searchBtn.removeAttribute("disabled"),this._searchBtnTextual.removeAttribute("disabled"),this._input.removeAttribute("disabled"))}_buttonTextChanged(e,t){null===e?(this._searchBtn.setAttribute("hidden",""),this._searchBtnText.innerHTML=t||"Search",this._searchBtnTextual.removeAttribute("hidden")):null===t||""===t?(this._searchBtnTextual.setAttribute("hidden",""),this._searchBtn.removeAttribute("hidden")):this._searchBtnText.innerHTML=t||"Search"}_slotchangeHandler(){this._inputInit(),this._dropdown._ariaAnnounceTemplate=this.getAttribute("aria-announce-template")||this._ariaAnnounceTemplate}_inputChanged(){if(""===this._input.value)return this._searchBtn.setAttribute("disabled",""),this._searchBtnTextual.setAttribute("disabled",""),this._clearBtn.setAttribute("hidden",""),void this._reset();this._input.hasAttribute("disabled")||(this._searchBtn.removeAttribute("disabled"),this._searchBtnTextual.removeAttribute("disabled")),this._clearBtn.removeAttribute("hidden"),!1===i&&(i=!0,window.setTimeout(()=>{this._sendAutocompleteRequest(this._input.value),i=!1},this.debounce))}_clear(){this._input.value="",this._clearBtn.setAttribute("hidden",""),this._searchBtn.setAttribute("disabled",""),this._searchBtnTextual.setAttribute("disabled",""),this._input.focus()}_search(){this._doSearch(this._input.value)}_closeDroplist(){this._dropdown.open=null,this._dropdown.removeAttribute("active-index")}_openDroplist(){this.activeIndex=null,this._dropdown.open=!0,this._dropdown.setAttribute("active-index",null),this.emitEvent(o.events.optionsShown,{composed:!0})}_optionSelected(e){let t=e.detail.optionValue;this._input.value=t,this._doSearch(t)}_doSearch(e){this.emitEvent(o.events.search,{detail:{searchValue:e},composed:!0}),this._reset(),this.selectedValue=e}_sendAutocompleteRequest(e){this.autocompleteRequest&&this.autocompleteRequest({query:e},this._autocompleteCallback.bind(this))}_autocompleteCallback(e){this._dropdown.data=e,this._dropdown.reflow=!0,0!==e.length?this._openDroplist():this._closeDroplist()}_reset(){this._dropdown.activeIndex=null,this._input.setAttribute("aria-activedescendant",""),this._dropdown.data=[],this._closeDroplist()}_activeOption(e){if(null!==e&&"null"!==e)return this._dropdown.shadowRoot.querySelector("li:nth-child("+(parseInt(e,10)+1)+")").innerHTML}_inputKeyUp(e){let i=e.keyCode;if(0===this._dropdown.data.length&&i!==t.DOWN&&i!==t.UP&&i!==t.ENTER&&i!==t.ESC)return;let r=this._dropdown.activeIndex,s=this._dropdown.data.length;if(i==t.ESC)this._closeDroplist();else if(i===t.UP){if(!this._dropdown.open)return;r=null===r||"null"===r?s:parseInt(r,10),(r-=1)<0&&(r=s-1),this._input.value=this._activeOption(r)}else if(i===t.DOWN){if(!this._dropdown.open)return;r=null===r||"null"===r?-1:parseInt(r,10),(r+=1)>s-1&&(r=0),this._input.value=this._activeOption(r)}else if(i===t.ENTER){if(this._activeOption(r))return void this.emitEvent(o.events.select,{detail:{optionValue:this._activeOption(r)},composed:!0});let e=this._input.value;return void this._doSearch(e)}null!==r&&"null"!==r?this._input.setAttribute("aria-activedescendant","option-"+r):this._input.setAttribute("aria-activedescendant",""),this.activeIndex=r,this._dropdown.activeIndex=r}}class r extends e{static get version(){return"1.3.0"}get html(){return'\n\n
    \n
    \n
      \n
    \n
    '}static get tag(){return"pfe-search-droplist"}get templateUrl(){return"pfe-search-droplist.html"}get styleUrl(){return"pfe-search-droplist.scss"}static get properties(){return{open:{title:"Open",type:Boolean},reflow:{title:"Reflow",type:Boolean,observer:"_renderOptions"},activeIndex:{title:"Active index",type:Number,observer:"_activeIndexChanged"}}}constructor(){super(r)}connectedCallback(){super.connectedCallback(),this._ariaAnnounce=this.shadowRoot.querySelector(".suggestions-aria-help"),this.activeIndex=null,this._ul=this.shadowRoot.querySelector("ul"),this._ul.addEventListener("mousedown",this._optionSelected.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this._ul.removeEventListener("mousedown",this._optionSelected)}_optionSelected(e){"LI"===e.target.tagName&&this.emitEvent(o.events.select,{detail:{optionValue:e.target.innerText},composed:!0})}_renderOptions(){let e=this.data,t="";this._ariaAnnounceTemplate&&(t=this._ariaAnnounceTemplate.replace("${numOptions}",e.length)),this._ariaAnnounce.textContent=t,this._ariaAnnounce.setAttribute("aria-live","polite"),this._ul.innerHTML=`${e.map((e,t)=>`
  • ${e}
  • `).join("")}`}_activeIndexChanged(){if(!this.data||0===this.data.length||null===this.activeIndex||"null"===this.activeIndex)return;this._ul.querySelector(".active")&&this._ul.querySelector(".active").classList.remove("active");let e=this._ul.querySelector("li:nth-child("+(parseInt(this.activeIndex,10)+1)+")");e.classList.add("active");let t=this.shadowRoot.querySelector(".droplist"),i=e.offsetHeight;i+=parseInt(window.getComputedStyle(e).getPropertyValue("margin-bottom"),10),t.scrollTop=e.offsetTop-t.offsetHeight+i}}e.create(r),e.create(o);export default o; +//# sourceMappingURL=pfe-autocomplete.min.js.map diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.min.js.map b/elements/pfe-autocomplete/dist/pfe-autocomplete.min.js.map new file mode 100644 index 0000000000..c0f64e1433 --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-autocomplete.min.js","sources":["../_temp/pfe-autocomplete.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeAutocomplete 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\nimport \"../../pfe-button/dist/pfe-button.js\";\n\nconst KEYCODE = {\n ENTER: 13,\n DOWN: 40,\n UP: 38,\n ESC: 27\n};\n\n// use this variable to debounce api call when user types very fast\nlet throttle = false;\n\nclass PfeAutocomplete extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n
    \n \n\n \n\n \n\n \n
    \n \n
    \n\n`;\n }\n\n // @TODO: Deprecating in 1.0 release\n // Injected at build-time\n static get schemaProperties() {\n return {\"debounce_timer\":{\"title\":\"Debounce\",\"description\":\"The amount of time that should pass before the next API call is made\",\"type\":\"string\",\"prefixed\":false},\"init_value\":{\"title\":\"Initial value\",\"description\":\"An initial value to show in the input field\",\"type\":\"string\",\"prefixed\":false},\"is_disabled\":{\"title\":\"Is disabled\",\"description\":\"Disable the input\",\"type\":\"boolean\",\"prefixed\":false},\"button-text\":{\"title\":\"Button text\",\"description\":\"Add button with text next to input field\",\"type\":\"string\",\"prefixed\":false}};\n }\n\n // Injected at build-time\n static get slots() {\n return {\"content\":{\"title\":\"Content\",\"type\":\"array\",\"namedSlot\":false,\"items\":{\"oneOf\":[{\"$ref\":\"input\"}]},\"required\":true}};\n }\n\n static get tag() {\n return \"pfe-autocomplete\";\n }\n\n get schemaUrl() {\n return \"pfe-autocomplete.json\";\n }\n\n get templateUrl() {\n return \"pfe-autocomplete.html\";\n }\n\n get styleUrl() {\n return \"pfe-autocomplete.scss\";\n }\n\n static get properties() {\n return {\n initValue: {\n title: \"Initial Value\",\n type: String,\n observer: \"_initValueChanged\"\n },\n loading: {\n title: \"Loading\",\n type: Boolean,\n default: false,\n observer: \"_loadingChanged\"\n },\n isDisabled: {\n title: \"Is disabled\",\n type: Boolean,\n default: false,\n observer: \"_isDisabledChanged\"\n },\n debounce: {\n title: \"Debounce\",\n type: Number,\n default: 300\n },\n selectedValue: {\n title: \"Selected value\",\n type: String\n },\n buttonText: {\n title: \"Button text\",\n type: String,\n observer: \"_buttonTextChanged\"\n }\n };\n }\n\n static get events() {\n return {\n search: `${this.tag}:search-event`,\n select: `${this.tag}:option-selected`,\n optionsShown: `${this.tag}:options-shown`,\n slotchange: `slotchange`\n };\n }\n\n constructor() {\n super(PfeAutocomplete);\n\n this._inputInit();\n\n this._slotchangeHandler = this._slotchangeHandler.bind(this);\n\n this._slot = this.shadowRoot.querySelector(\"slot\");\n this._slot.addEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler);\n\n // @TODO: Confirm this is translatable\n this._ariaAnnounceTemplate = \"There are ${numOptions} suggestions. Use the up and down arrows to browse.\";\n\n // clear button\n this._clearBtn = this.shadowRoot.querySelector(\".clear-search\");\n this._clearBtn.addEventListener(\"click\", this._clear.bind(this));\n\n // search button\n this._searchBtn = this.shadowRoot.querySelector(\".search-button\");\n this._searchBtn.addEventListener(\"click\", this._search.bind(this));\n\n // textual search button\n this._searchBtnTextual = this.shadowRoot.querySelector(\".search-button--textual\");\n this._searchBtnText = this.shadowRoot.querySelector(\".search-button__text\");\n this._searchBtnTextual.addEventListener(\"click\", this._search.bind(this));\n\n this._dropdown = this.shadowRoot.querySelector(\"#dropdown\");\n this._dropdown.data = [];\n\n this.activeIndex = null;\n\n this.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\n\n // these two events, fire search\n this.addEventListener(PfeAutocomplete.events.search, this._closeDroplist.bind(this));\n this.addEventListener(PfeAutocomplete.events.select, this._optionSelected.bind(this));\n }\n\n _inputInit() {\n // input box\n let slotNodes = this.shadowRoot.querySelector(\"slot\").assignedNodes();\n let slotElems = slotNodes.filter(n => n.nodeType === Node.ELEMENT_NODE);\n if (slotElems.length === 0) {\n console.error(`${PfeAutocomplete.tag}: There must be a input tag in the light DOM`);\n return;\n }\n this._input = slotElems[0];\n\n if (this._input.tagName.toLowerCase() !== \"input\") {\n console.error(`${PfeAutocomplete.tag}: The only child in the light DOM must be an input tag`);\n\n return;\n }\n\n this._input.addEventListener(\"input\", this._inputChanged.bind(this));\n this._input.addEventListener(\"blur\", this._closeDroplist.bind(this));\n\n this._input.setAttribute(\"role\", \"combobox\");\n\n if (!this._input.hasAttribute(\"aria-label\")) {\n this._input.setAttribute(\"aria-label\", \"Search\");\n }\n\n this._input.setAttribute(\"aria-autocomplete\", \"both\");\n this._input.setAttribute(\"aria-haspopup\", \"true\");\n this._input.setAttribute(\"type\", \"search\");\n this._input.setAttribute(\"autocomplete\", \"off\");\n this._input.setAttribute(\"autocorrect\", \"off\");\n this._input.setAttribute(\"autocapitalize\", \"off\");\n this._input.setAttribute(\"spellcheck\", \"false\");\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"keyup\", this._inputKeyUp);\n\n this.removeEventListener(PfeAutocomplete.events.search, this._closeDroplist);\n this.removeEventListener(PfeAutocomplete.events.select, this._optionSelected);\n this._slot.removeEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler);\n if (this._input) {\n this._input.removeEventListener(\"input\", this._inputChanged);\n this._input.removeEventListener(\"blur\", this._closeDroplist);\n }\n\n this._clearBtn.removeEventListener(\"click\", this._clear);\n this._searchBtn.removeEventListener(\"click\", this._search);\n this._searchBtnTextual.removeEventListener(\"click\", this._search);\n }\n\n _initValueChanged(oldVal, newVal) {\n if (newVal) {\n // set inputbox and buttons in the inner component\n this._input.value = newVal;\n if (newVal !== \"\" && !this.isDisabled) {\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n this._clearBtn.removeAttribute(\"hidden\");\n } else {\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._clearBtn.setAttribute(\"hidden\", \"\");\n }\n }\n }\n\n _loadingChanged() {\n if (!this.loading || this._input.value === \"\") {\n this.shadowRoot.querySelector(\".loading\").setAttribute(\"hidden\", \"\");\n } else {\n this.shadowRoot.querySelector(\".loading\").removeAttribute(\"hidden\");\n }\n }\n\n _isDisabledChanged() {\n if (this.isDisabled) {\n this._clearBtn.setAttribute(\"disabled\", \"\");\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._input.setAttribute(\"disabled\", \"\");\n } else {\n this._clearBtn.removeAttribute(\"disabled\");\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n this._input.removeAttribute(\"disabled\");\n }\n }\n\n _buttonTextChanged(oldVal, newVal) {\n if (oldVal === null) {\n this._searchBtn.setAttribute(\"hidden\", \"\");\n this._searchBtnText.innerHTML = newVal || \"Search\";\n this._searchBtnTextual.removeAttribute(\"hidden\");\n } else if (newVal === null || newVal === \"\") {\n this._searchBtnTextual.setAttribute(\"hidden\", \"\");\n this._searchBtn.removeAttribute(\"hidden\");\n } else {\n this._searchBtnText.innerHTML = newVal || \"Search\";\n }\n }\n\n _slotchangeHandler() {\n this._inputInit();\n this._dropdown._ariaAnnounceTemplate = this.getAttribute(\"aria-announce-template\") || this._ariaAnnounceTemplate;\n }\n\n _inputChanged() {\n if (this._input.value === \"\") {\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._clearBtn.setAttribute(\"hidden\", \"\");\n\n this._reset();\n return;\n } else {\n if (!this._input.hasAttribute(\"disabled\")) {\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n }\n this._clearBtn.removeAttribute(\"hidden\");\n }\n\n if (throttle === false) {\n throttle = true;\n\n window.setTimeout(() => {\n this._sendAutocompleteRequest(this._input.value);\n throttle = false;\n }, this.debounce);\n }\n }\n\n _clear() {\n this._input.value = \"\";\n this._clearBtn.setAttribute(\"hidden\", \"\");\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._input.focus();\n }\n\n _search() {\n this._doSearch(this._input.value);\n }\n\n _closeDroplist() {\n this._dropdown.open = null;\n this._dropdown.removeAttribute(\"active-index\");\n }\n\n _openDroplist() {\n this.activeIndex = null;\n this._dropdown.open = true;\n this._dropdown.setAttribute(\"active-index\", null);\n this.emitEvent(PfeAutocomplete.events.optionsShown, {\n composed: true\n });\n }\n\n _optionSelected(e) {\n let selectedValue = e.detail.optionValue;\n\n // update input box with selected value from options list\n this._input.value = selectedValue;\n\n // send search request\n this._doSearch(selectedValue);\n }\n\n _doSearch(searchQuery) {\n this.emitEvent(PfeAutocomplete.events.search, {\n detail: { searchValue: searchQuery },\n composed: true\n });\n this._reset();\n this.selectedValue = searchQuery;\n }\n\n _sendAutocompleteRequest(input) {\n if (!this.autocompleteRequest) return;\n\n this.autocompleteRequest({ query: input }, this._autocompleteCallback.bind(this));\n }\n\n _autocompleteCallback(response) {\n this._dropdown.data = response;\n this._dropdown.reflow = true;\n response.length !== 0 ? this._openDroplist() : this._closeDroplist();\n }\n\n _reset() {\n this._dropdown.activeIndex = null;\n this._input.setAttribute(\"aria-activedescendant\", \"\");\n this._dropdown.data = [];\n this._closeDroplist();\n }\n\n _activeOption(activeIndex) {\n if (activeIndex === null || activeIndex === \"null\") return;\n return this._dropdown.shadowRoot.querySelector(\"li:nth-child(\" + (parseInt(activeIndex, 10) + 1) + \")\").innerHTML;\n }\n\n _inputKeyUp(e) {\n let key = e.keyCode;\n\n if (\n this._dropdown.data.length === 0 &&\n key !== KEYCODE.DOWN &&\n key !== KEYCODE.UP &&\n key !== KEYCODE.ENTER &&\n key !== KEYCODE.ESC\n )\n return;\n\n let activeIndex = this._dropdown.activeIndex;\n let optionsLength = this._dropdown.data.length;\n\n if (key == KEYCODE.ESC) {\n this._closeDroplist();\n } else if (key === KEYCODE.UP) {\n if (!this._dropdown.open) {\n return;\n }\n\n activeIndex = activeIndex === null || activeIndex === \"null\" ? optionsLength : parseInt(activeIndex, 10);\n\n activeIndex -= 1;\n\n if (activeIndex < 0) {\n activeIndex = optionsLength - 1;\n }\n\n this._input.value = this._activeOption(activeIndex);\n } else if (key === KEYCODE.DOWN) {\n if (!this._dropdown.open) {\n return;\n }\n\n activeIndex = activeIndex === null || activeIndex === \"null\" ? -1 : parseInt(activeIndex, 10);\n activeIndex += 1;\n\n if (activeIndex > optionsLength - 1) {\n activeIndex = 0;\n }\n\n this._input.value = this._activeOption(activeIndex);\n } else if (key === KEYCODE.ENTER) {\n if (this._activeOption(activeIndex)) {\n this.emitEvent(PfeAutocomplete.events.select, {\n detail: { optionValue: this._activeOption(activeIndex) },\n composed: true\n });\n\n return;\n }\n\n let selectedValue = this._input.value;\n this._doSearch(selectedValue);\n return;\n }\n\n if (activeIndex !== null && activeIndex !== \"null\") {\n this._input.setAttribute(\"aria-activedescendant\", \"option-\" + activeIndex);\n } else {\n this._input.setAttribute(\"aria-activedescendant\", \"\");\n }\n\n this.activeIndex = activeIndex;\n this._dropdown.activeIndex = activeIndex;\n }\n}\n\n/*\n* - Attributes ------------------------------------\n* open | Set when the combo box dropdown is open\n* active-index | Set selected option\n* reflow | Re-renders the dropdown\n\n* - Events ----------------------------------------\n* pfe-autocomplete:option-selected | Fires when an option is selected.\n event.details.optionValue contains the selected value.\n*/\nclass PfeSearchDroplist extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n
    \n
      \n
    \n
    `;\n }\n\n static get tag() {\n return \"pfe-search-droplist\";\n }\n\n get templateUrl() {\n return \"pfe-search-droplist.html\";\n }\n\n get styleUrl() {\n return \"pfe-search-droplist.scss\";\n }\n\n static get properties() {\n return {\n open: {\n title: \"Open\",\n type: Boolean\n },\n reflow: {\n title: \"Reflow\",\n type: Boolean,\n observer: \"_renderOptions\"\n },\n activeIndex: {\n title: \"Active index\",\n type: Number,\n observer: \"_activeIndexChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeSearchDroplist);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this._ariaAnnounce = this.shadowRoot.querySelector(\".suggestions-aria-help\");\n\n this.activeIndex = null;\n this._ul = this.shadowRoot.querySelector(\"ul\");\n this._ul.addEventListener(\"mousedown\", this._optionSelected.bind(this));\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._ul.removeEventListener(\"mousedown\", this._optionSelected);\n }\n\n _optionSelected(e) {\n if (e.target.tagName === \"LI\") {\n this.emitEvent(PfeAutocomplete.events.select, {\n detail: { optionValue: e.target.innerText },\n composed: true\n });\n }\n }\n\n _renderOptions() {\n let options = this.data;\n let ariaAnnounceText = \"\";\n\n if (this._ariaAnnounceTemplate) {\n ariaAnnounceText = this._ariaAnnounceTemplate.replace(\"${numOptions}\", options.length);\n }\n\n this._ariaAnnounce.textContent = ariaAnnounceText;\n this._ariaAnnounce.setAttribute(\"aria-live\", \"polite\");\n\n this._ul.innerHTML = `${options\n .map((item, index) => {\n return `
  • ${item}
  • `;\n })\n .join(\"\")}`;\n }\n\n _activeIndexChanged() {\n if (!this.data || this.data.length === 0 || this.activeIndex === null || this.activeIndex === \"null\") return;\n\n // remove active class\n if (this._ul.querySelector(\".active\")) {\n this._ul.querySelector(\".active\").classList.remove(\"active\");\n }\n\n // add active class to selected option\n let activeOption = this._ul.querySelector(\"li:nth-child(\" + (parseInt(this.activeIndex, 10) + 1) + \")\");\n\n activeOption.classList.add(\"active\");\n\n // scroll to selected element when selected item with keyboard is out of view\n let ulWrapper = this.shadowRoot.querySelector(\".droplist\");\n let activeOptionHeight = activeOption.offsetHeight;\n activeOptionHeight += parseInt(window.getComputedStyle(activeOption).getPropertyValue(\"margin-bottom\"), 10);\n ulWrapper.scrollTop = activeOption.offsetTop - ulWrapper.offsetHeight + activeOptionHeight;\n }\n}\n\nPFElement.create(PfeSearchDroplist);\nPFElement.create(PfeAutocomplete);\n\nexport default PfeAutocomplete;\n"],"names":["KEYCODE","ENTER","DOWN","UP","ESC","throttle","PfeAutocomplete","PFElement","version","html","schemaProperties","debounce_timer","title","description","type","prefixed","init_value","is_disabled","button-text","slots","content","namedSlot","items","oneOf","$ref","required","tag","schemaUrl","templateUrl","styleUrl","properties","initValue","String","observer","loading","Boolean","default","isDisabled","debounce","Number","selectedValue","buttonText","events","search","this","select","optionsShown","slotchange","[object Object]","super","_inputInit","_slotchangeHandler","bind","_slot","shadowRoot","querySelector","addEventListener","_ariaAnnounceTemplate","_clearBtn","_clear","_searchBtn","_search","_searchBtnTextual","_searchBtnText","_dropdown","data","activeIndex","_inputKeyUp","_closeDroplist","_optionSelected","slotElems","assignedNodes","filter","n","nodeType","Node","ELEMENT_NODE","length","_input","tagName","toLowerCase","_inputChanged","setAttribute","hasAttribute","console","error","disconnectedCallback","removeEventListener","oldVal","newVal","value","removeAttribute","innerHTML","getAttribute","_reset","window","setTimeout","_sendAutocompleteRequest","focus","_doSearch","open","emitEvent","composed","e","detail","optionValue","searchQuery","searchValue","input","autocompleteRequest","query","_autocompleteCallback","response","reflow","_openDroplist","parseInt","key","keyCode","optionsLength","_activeOption","PfeSearchDroplist","connectedCallback","_ariaAnnounce","_ul","target","innerText","options","ariaAnnounceText","replace","textContent","map","item","index","join","classList","remove","activeOption","add","ulWrapper","activeOptionHeight","offsetHeight","getComputedStyle","getPropertyValue","scrollTop","offsetTop","create"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA4BA,MAAMA,EAAU,CACdC,MAAO,GACPC,KAAM,GACNC,GAAI,GACJC,IAAK,IAIP,IAAIC,GAAW,EAEf,MAAMC,UAAwBC,EAG5BC,qBACE,MAAO,QAITC,WACE,MAAO,qwSA+CTC,8BACE,MAAO,CAACC,eAAiB,CAACC,MAAQ,WAAWC,YAAc,uEAAuEC,KAAO,SAASC,U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CD,GAAsBxB,SAASpB,OAAO8C,iBAAiBL,GAAcM,iBAAiB,iBAAkB,IACxGJ,EAAUK,UAAYP,EAAaQ,UAAYN,EAAUE,aAAeD,GAI5EpI,EAAU0I,OAAOzB,GACjBjH,EAAU0I,OAAO3I"} \ No newline at end of file diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.js b/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.js new file mode 100644 index 0000000000..efa9c966fb --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.js @@ -0,0 +1,701 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../../pfelement/dist/pfelement.umd'), require('../../pfe-button/dist/pfe-button.umd')) : + typeof define === 'function' && define.amd ? define(['../../pfelement/dist/pfelement.umd', '../../pfe-button/dist/pfe-button.umd'], factory) : + (global = global || self, global.PfeAutocomplete = factory(global.PFElement)); +}(this, (function (PFElement) { 'use strict'; + + PFElement = PFElement && Object.prototype.hasOwnProperty.call(PFElement, 'default') ? PFElement['default'] : PFElement; + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } + }; + + var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + }; + + var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + }; + + /*! + * PatternFly Elements: PfeAutocomplete 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + var KEYCODE = { + ENTER: 13, + DOWN: 40, + UP: 38, + ESC: 27 + }; + + // use this variable to debounce api call when user types very fast + var throttle = false; + + var PfeAutocomplete = function (_PFElement) { + inherits(PfeAutocomplete, _PFElement); + createClass(PfeAutocomplete, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n
    \n
    \n \n\n \n\n \n\n \n
    \n \n
    \n\n"; + } + + // @TODO: Deprecating in 1.0 release + // Injected at build-time + + }, { + key: "schemaUrl", + get: function get() { + return "pfe-autocomplete.json"; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-autocomplete.html"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-autocomplete.scss"; + } + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "schemaProperties", + get: function get() { + return { "debounce_timer": { "title": "Debounce", "description": "The amount of time that should pass before the next API call is made", "type": "string", "prefixed": false }, "init_value": { "title": "Initial value", "description": "An initial value to show in the input field", "type": "string", "prefixed": false }, "is_disabled": { "title": "Is disabled", "description": "Disable the input", "type": "boolean", "prefixed": false }, "button-text": { "title": "Button text", "description": "Add button with text next to input field", "type": "string", "prefixed": false } }; + } + + // Injected at build-time + + }, { + key: "slots", + get: function get() { + return { "content": { "title": "Content", "type": "array", "namedSlot": false, "items": { "oneOf": [{ "$ref": "input" }] }, "required": true } }; + } + }, { + key: "tag", + get: function get() { + return "pfe-autocomplete"; + } + }, { + key: "properties", + get: function get() { + return { + initValue: { + title: "Initial Value", + type: String, + observer: "_initValueChanged" + }, + loading: { + title: "Loading", + type: Boolean, + default: false, + observer: "_loadingChanged" + }, + isDisabled: { + title: "Is disabled", + type: Boolean, + default: false, + observer: "_isDisabledChanged" + }, + debounce: { + title: "Debounce", + type: Number, + default: 300 + }, + selectedValue: { + title: "Selected value", + type: String + }, + buttonText: { + title: "Button text", + type: String, + observer: "_buttonTextChanged" + } + }; + } + }, { + key: "events", + get: function get() { + return { + search: this.tag + ":search-event", + select: this.tag + ":option-selected", + optionsShown: this.tag + ":options-shown", + slotchange: "slotchange" + }; + } + }]); + + function PfeAutocomplete() { + classCallCheck(this, PfeAutocomplete); + + var _this = possibleConstructorReturn(this, (PfeAutocomplete.__proto__ || Object.getPrototypeOf(PfeAutocomplete)).call(this, PfeAutocomplete)); + + _this._inputInit(); + + _this._slotchangeHandler = _this._slotchangeHandler.bind(_this); + + _this._slot = _this.shadowRoot.querySelector("slot"); + _this._slot.addEventListener(PfeAutocomplete.events.slotchange, _this._slotchangeHandler); + + // @TODO: Confirm this is translatable + _this._ariaAnnounceTemplate = "There are ${numOptions} suggestions. Use the up and down arrows to browse."; + + // clear button + _this._clearBtn = _this.shadowRoot.querySelector(".clear-search"); + _this._clearBtn.addEventListener("click", _this._clear.bind(_this)); + + // search button + _this._searchBtn = _this.shadowRoot.querySelector(".search-button"); + _this._searchBtn.addEventListener("click", _this._search.bind(_this)); + + // textual search button + _this._searchBtnTextual = _this.shadowRoot.querySelector(".search-button--textual"); + _this._searchBtnText = _this.shadowRoot.querySelector(".search-button__text"); + _this._searchBtnTextual.addEventListener("click", _this._search.bind(_this)); + + _this._dropdown = _this.shadowRoot.querySelector("#dropdown"); + _this._dropdown.data = []; + + _this.activeIndex = null; + + _this.addEventListener("keyup", _this._inputKeyUp.bind(_this)); + + // these two events, fire search + _this.addEventListener(PfeAutocomplete.events.search, _this._closeDroplist.bind(_this)); + _this.addEventListener(PfeAutocomplete.events.select, _this._optionSelected.bind(_this)); + return _this; + } + + createClass(PfeAutocomplete, [{ + key: "_inputInit", + value: function _inputInit() { + // input box + var slotNodes = this.shadowRoot.querySelector("slot").assignedNodes(); + var slotElems = slotNodes.filter(function (n) { + return n.nodeType === Node.ELEMENT_NODE; + }); + if (slotElems.length === 0) { + console.error(PfeAutocomplete.tag + ": There must be a input tag in the light DOM"); + return; + } + this._input = slotElems[0]; + + if (this._input.tagName.toLowerCase() !== "input") { + console.error(PfeAutocomplete.tag + ": The only child in the light DOM must be an input tag"); + + return; + } + + this._input.addEventListener("input", this._inputChanged.bind(this)); + this._input.addEventListener("blur", this._closeDroplist.bind(this)); + + this._input.setAttribute("role", "combobox"); + + if (!this._input.hasAttribute("aria-label")) { + this._input.setAttribute("aria-label", "Search"); + } + + this._input.setAttribute("aria-autocomplete", "both"); + this._input.setAttribute("aria-haspopup", "true"); + this._input.setAttribute("type", "search"); + this._input.setAttribute("autocomplete", "off"); + this._input.setAttribute("autocorrect", "off"); + this._input.setAttribute("autocapitalize", "off"); + this._input.setAttribute("spellcheck", "false"); + } + }, { + key: "disconnectedCallback", + value: function disconnectedCallback() { + get(PfeAutocomplete.prototype.__proto__ || Object.getPrototypeOf(PfeAutocomplete.prototype), "disconnectedCallback", this).call(this); + + this.removeEventListener("keyup", this._inputKeyUp); + + this.removeEventListener(PfeAutocomplete.events.search, this._closeDroplist); + this.removeEventListener(PfeAutocomplete.events.select, this._optionSelected); + this._slot.removeEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler); + if (this._input) { + this._input.removeEventListener("input", this._inputChanged); + this._input.removeEventListener("blur", this._closeDroplist); + } + + this._clearBtn.removeEventListener("click", this._clear); + this._searchBtn.removeEventListener("click", this._search); + this._searchBtnTextual.removeEventListener("click", this._search); + } + }, { + key: "_initValueChanged", + value: function _initValueChanged(oldVal, newVal) { + if (newVal) { + // set inputbox and buttons in the inner component + this._input.value = newVal; + if (newVal !== "" && !this.isDisabled) { + this._searchBtn.removeAttribute("disabled"); + this._searchBtnTextual.removeAttribute("disabled"); + this._clearBtn.removeAttribute("hidden"); + } else { + this._searchBtn.setAttribute("disabled", ""); + this._searchBtnTextual.setAttribute("disabled", ""); + this._clearBtn.setAttribute("hidden", ""); + } + } + } + }, { + key: "_loadingChanged", + value: function _loadingChanged() { + if (!this.loading || this._input.value === "") { + this.shadowRoot.querySelector(".loading").setAttribute("hidden", ""); + } else { + this.shadowRoot.querySelector(".loading").removeAttribute("hidden"); + } + } + }, { + key: "_isDisabledChanged", + value: function _isDisabledChanged() { + if (this.isDisabled) { + this._clearBtn.setAttribute("disabled", ""); + this._searchBtn.setAttribute("disabled", ""); + this._searchBtnTextual.setAttribute("disabled", ""); + this._input.setAttribute("disabled", ""); + } else { + this._clearBtn.removeAttribute("disabled"); + this._searchBtn.removeAttribute("disabled"); + this._searchBtnTextual.removeAttribute("disabled"); + this._input.removeAttribute("disabled"); + } + } + }, { + key: "_buttonTextChanged", + value: function _buttonTextChanged(oldVal, newVal) { + if (oldVal === null) { + this._searchBtn.setAttribute("hidden", ""); + this._searchBtnText.innerHTML = newVal || "Search"; + this._searchBtnTextual.removeAttribute("hidden"); + } else if (newVal === null || newVal === "") { + this._searchBtnTextual.setAttribute("hidden", ""); + this._searchBtn.removeAttribute("hidden"); + } else { + this._searchBtnText.innerHTML = newVal || "Search"; + } + } + }, { + key: "_slotchangeHandler", + value: function _slotchangeHandler() { + this._inputInit(); + this._dropdown._ariaAnnounceTemplate = this.getAttribute("aria-announce-template") || this._ariaAnnounceTemplate; + } + }, { + key: "_inputChanged", + value: function _inputChanged() { + var _this2 = this; + + if (this._input.value === "") { + this._searchBtn.setAttribute("disabled", ""); + this._searchBtnTextual.setAttribute("disabled", ""); + this._clearBtn.setAttribute("hidden", ""); + + this._reset(); + return; + } else { + if (!this._input.hasAttribute("disabled")) { + this._searchBtn.removeAttribute("disabled"); + this._searchBtnTextual.removeAttribute("disabled"); + } + this._clearBtn.removeAttribute("hidden"); + } + + if (throttle === false) { + throttle = true; + + window.setTimeout(function () { + _this2._sendAutocompleteRequest(_this2._input.value); + throttle = false; + }, this.debounce); + } + } + }, { + key: "_clear", + value: function _clear() { + this._input.value = ""; + this._clearBtn.setAttribute("hidden", ""); + this._searchBtn.setAttribute("disabled", ""); + this._searchBtnTextual.setAttribute("disabled", ""); + this._input.focus(); + } + }, { + key: "_search", + value: function _search() { + this._doSearch(this._input.value); + } + }, { + key: "_closeDroplist", + value: function _closeDroplist() { + this._dropdown.open = null; + this._dropdown.removeAttribute("active-index"); + } + }, { + key: "_openDroplist", + value: function _openDroplist() { + this.activeIndex = null; + this._dropdown.open = true; + this._dropdown.setAttribute("active-index", null); + this.emitEvent(PfeAutocomplete.events.optionsShown, { + composed: true + }); + } + }, { + key: "_optionSelected", + value: function _optionSelected(e) { + var selectedValue = e.detail.optionValue; + + // update input box with selected value from options list + this._input.value = selectedValue; + + // send search request + this._doSearch(selectedValue); + } + }, { + key: "_doSearch", + value: function _doSearch(searchQuery) { + this.emitEvent(PfeAutocomplete.events.search, { + detail: { searchValue: searchQuery }, + composed: true + }); + this._reset(); + this.selectedValue = searchQuery; + } + }, { + key: "_sendAutocompleteRequest", + value: function _sendAutocompleteRequest(input) { + if (!this.autocompleteRequest) return; + + this.autocompleteRequest({ query: input }, this._autocompleteCallback.bind(this)); + } + }, { + key: "_autocompleteCallback", + value: function _autocompleteCallback(response) { + this._dropdown.data = response; + this._dropdown.reflow = true; + response.length !== 0 ? this._openDroplist() : this._closeDroplist(); + } + }, { + key: "_reset", + value: function _reset() { + this._dropdown.activeIndex = null; + this._input.setAttribute("aria-activedescendant", ""); + this._dropdown.data = []; + this._closeDroplist(); + } + }, { + key: "_activeOption", + value: function _activeOption(activeIndex) { + if (activeIndex === null || activeIndex === "null") return; + return this._dropdown.shadowRoot.querySelector("li:nth-child(" + (parseInt(activeIndex, 10) + 1) + ")").innerHTML; + } + }, { + key: "_inputKeyUp", + value: function _inputKeyUp(e) { + var key = e.keyCode; + + if (this._dropdown.data.length === 0 && key !== KEYCODE.DOWN && key !== KEYCODE.UP && key !== KEYCODE.ENTER && key !== KEYCODE.ESC) return; + + var activeIndex = this._dropdown.activeIndex; + var optionsLength = this._dropdown.data.length; + + if (key == KEYCODE.ESC) { + this._closeDroplist(); + } else if (key === KEYCODE.UP) { + if (!this._dropdown.open) { + return; + } + + activeIndex = activeIndex === null || activeIndex === "null" ? optionsLength : parseInt(activeIndex, 10); + + activeIndex -= 1; + + if (activeIndex < 0) { + activeIndex = optionsLength - 1; + } + + this._input.value = this._activeOption(activeIndex); + } else if (key === KEYCODE.DOWN) { + if (!this._dropdown.open) { + return; + } + + activeIndex = activeIndex === null || activeIndex === "null" ? -1 : parseInt(activeIndex, 10); + activeIndex += 1; + + if (activeIndex > optionsLength - 1) { + activeIndex = 0; + } + + this._input.value = this._activeOption(activeIndex); + } else if (key === KEYCODE.ENTER) { + if (this._activeOption(activeIndex)) { + this.emitEvent(PfeAutocomplete.events.select, { + detail: { optionValue: this._activeOption(activeIndex) }, + composed: true + }); + + return; + } + + var selectedValue = this._input.value; + this._doSearch(selectedValue); + return; + } + + if (activeIndex !== null && activeIndex !== "null") { + this._input.setAttribute("aria-activedescendant", "option-" + activeIndex); + } else { + this._input.setAttribute("aria-activedescendant", ""); + } + + this.activeIndex = activeIndex; + this._dropdown.activeIndex = activeIndex; + } + }]); + return PfeAutocomplete; + }(PFElement); + + /* + * - Attributes ------------------------------------ + * open | Set when the combo box dropdown is open + * active-index | Set selected option + * reflow | Re-renders the dropdown + + * - Events ---------------------------------------- + * pfe-autocomplete:option-selected | Fires when an option is selected. + event.details.optionValue contains the selected value. + */ + + + var PfeSearchDroplist = function (_PFElement2) { + inherits(PfeSearchDroplist, _PFElement2); + createClass(PfeSearchDroplist, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n
    \n
    \n
      \n
    \n
    "; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-search-droplist.html"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-search-droplist.scss"; + } + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "tag", + get: function get() { + return "pfe-search-droplist"; + } + }, { + key: "properties", + get: function get() { + return { + open: { + title: "Open", + type: Boolean + }, + reflow: { + title: "Reflow", + type: Boolean, + observer: "_renderOptions" + }, + activeIndex: { + title: "Active index", + type: Number, + observer: "_activeIndexChanged" + } + }; + } + }]); + + function PfeSearchDroplist() { + classCallCheck(this, PfeSearchDroplist); + return possibleConstructorReturn(this, (PfeSearchDroplist.__proto__ || Object.getPrototypeOf(PfeSearchDroplist)).call(this, PfeSearchDroplist)); + } + + createClass(PfeSearchDroplist, [{ + key: "connectedCallback", + value: function connectedCallback() { + get(PfeSearchDroplist.prototype.__proto__ || Object.getPrototypeOf(PfeSearchDroplist.prototype), "connectedCallback", this).call(this); + + this._ariaAnnounce = this.shadowRoot.querySelector(".suggestions-aria-help"); + + this.activeIndex = null; + this._ul = this.shadowRoot.querySelector("ul"); + this._ul.addEventListener("mousedown", this._optionSelected.bind(this)); + } + }, { + key: "disconnectedCallback", + value: function disconnectedCallback() { + get(PfeSearchDroplist.prototype.__proto__ || Object.getPrototypeOf(PfeSearchDroplist.prototype), "disconnectedCallback", this).call(this); + this._ul.removeEventListener("mousedown", this._optionSelected); + } + }, { + key: "_optionSelected", + value: function _optionSelected(e) { + if (e.target.tagName === "LI") { + this.emitEvent(PfeAutocomplete.events.select, { + detail: { optionValue: e.target.innerText }, + composed: true + }); + } + } + }, { + key: "_renderOptions", + value: function _renderOptions() { + var options = this.data; + var ariaAnnounceText = ""; + + if (this._ariaAnnounceTemplate) { + ariaAnnounceText = this._ariaAnnounceTemplate.replace("${numOptions}", options.length); + } + + this._ariaAnnounce.textContent = ariaAnnounceText; + this._ariaAnnounce.setAttribute("aria-live", "polite"); + + this._ul.innerHTML = "" + options.map(function (item, index) { + return "
  • " + item + "
  • "; + }).join(""); + } + }, { + key: "_activeIndexChanged", + value: function _activeIndexChanged() { + if (!this.data || this.data.length === 0 || this.activeIndex === null || this.activeIndex === "null") return; + + // remove active class + if (this._ul.querySelector(".active")) { + this._ul.querySelector(".active").classList.remove("active"); + } + + // add active class to selected option + var activeOption = this._ul.querySelector("li:nth-child(" + (parseInt(this.activeIndex, 10) + 1) + ")"); + + activeOption.classList.add("active"); + + // scroll to selected element when selected item with keyboard is out of view + var ulWrapper = this.shadowRoot.querySelector(".droplist"); + var activeOptionHeight = activeOption.offsetHeight; + activeOptionHeight += parseInt(window.getComputedStyle(activeOption).getPropertyValue("margin-bottom"), 10); + ulWrapper.scrollTop = activeOption.offsetTop - ulWrapper.offsetHeight + activeOptionHeight; + } + }]); + return PfeSearchDroplist; + }(PFElement); + + PFElement.create(PfeSearchDroplist); + PFElement.create(PfeAutocomplete); + + return PfeAutocomplete; + +}))); +//# sourceMappingURL=pfe-autocomplete.umd.js.map diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.js.map b/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.js.map new file mode 100644 index 0000000000..645f1d9e77 --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-autocomplete.umd.js","sources":["../_temp/pfe-autocomplete.umd.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeAutocomplete 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\nimport \"../../pfe-button/dist/pfe-button\";\n\nconst KEYCODE = {\n ENTER: 13,\n DOWN: 40,\n UP: 38,\n ESC: 27\n};\n\n// use this variable to debounce api call when user types very fast\nlet throttle = false;\n\nclass PfeAutocomplete extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n
    \n \n\n \n\n \n\n \n
    \n \n
    \n\n`;\n }\n\n // @TODO: Deprecating in 1.0 release\n // Injected at build-time\n static get schemaProperties() {\n return {\"debounce_timer\":{\"title\":\"Debounce\",\"description\":\"The amount of time that should pass before the next API call is made\",\"type\":\"string\",\"prefixed\":false},\"init_value\":{\"title\":\"Initial value\",\"description\":\"An initial value to show in the input field\",\"type\":\"string\",\"prefixed\":false},\"is_disabled\":{\"title\":\"Is disabled\",\"description\":\"Disable the input\",\"type\":\"boolean\",\"prefixed\":false},\"button-text\":{\"title\":\"Button text\",\"description\":\"Add button with text next to input field\",\"type\":\"string\",\"prefixed\":false}};\n }\n\n // Injected at build-time\n static get slots() {\n return {\"content\":{\"title\":\"Content\",\"type\":\"array\",\"namedSlot\":false,\"items\":{\"oneOf\":[{\"$ref\":\"input\"}]},\"required\":true}};\n }\n\n static get tag() {\n return \"pfe-autocomplete\";\n }\n\n get schemaUrl() {\n return \"pfe-autocomplete.json\";\n }\n\n get templateUrl() {\n return \"pfe-autocomplete.html\";\n }\n\n get styleUrl() {\n return \"pfe-autocomplete.scss\";\n }\n\n static get properties() {\n return {\n initValue: {\n title: \"Initial Value\",\n type: String,\n observer: \"_initValueChanged\"\n },\n loading: {\n title: \"Loading\",\n type: Boolean,\n default: false,\n observer: \"_loadingChanged\"\n },\n isDisabled: {\n title: \"Is disabled\",\n type: Boolean,\n default: false,\n observer: \"_isDisabledChanged\"\n },\n debounce: {\n title: \"Debounce\",\n type: Number,\n default: 300\n },\n selectedValue: {\n title: \"Selected value\",\n type: String\n },\n buttonText: {\n title: \"Button text\",\n type: String,\n observer: \"_buttonTextChanged\"\n }\n };\n }\n\n static get events() {\n return {\n search: `${this.tag}:search-event`,\n select: `${this.tag}:option-selected`,\n optionsShown: `${this.tag}:options-shown`,\n slotchange: `slotchange`\n };\n }\n\n constructor() {\n super(PfeAutocomplete);\n\n this._inputInit();\n\n this._slotchangeHandler = this._slotchangeHandler.bind(this);\n\n this._slot = this.shadowRoot.querySelector(\"slot\");\n this._slot.addEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler);\n\n // @TODO: Confirm this is translatable\n this._ariaAnnounceTemplate = \"There are ${numOptions} suggestions. Use the up and down arrows to browse.\";\n\n // clear button\n this._clearBtn = this.shadowRoot.querySelector(\".clear-search\");\n this._clearBtn.addEventListener(\"click\", this._clear.bind(this));\n\n // search button\n this._searchBtn = this.shadowRoot.querySelector(\".search-button\");\n this._searchBtn.addEventListener(\"click\", this._search.bind(this));\n\n // textual search button\n this._searchBtnTextual = this.shadowRoot.querySelector(\".search-button--textual\");\n this._searchBtnText = this.shadowRoot.querySelector(\".search-button__text\");\n this._searchBtnTextual.addEventListener(\"click\", this._search.bind(this));\n\n this._dropdown = this.shadowRoot.querySelector(\"#dropdown\");\n this._dropdown.data = [];\n\n this.activeIndex = null;\n\n this.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\n\n // these two events, fire search\n this.addEventListener(PfeAutocomplete.events.search, this._closeDroplist.bind(this));\n this.addEventListener(PfeAutocomplete.events.select, this._optionSelected.bind(this));\n }\n\n _inputInit() {\n // input box\n let slotNodes = this.shadowRoot.querySelector(\"slot\").assignedNodes();\n let slotElems = slotNodes.filter(n => n.nodeType === Node.ELEMENT_NODE);\n if (slotElems.length === 0) {\n console.error(`${PfeAutocomplete.tag}: There must be a input tag in the light DOM`);\n return;\n }\n this._input = slotElems[0];\n\n if (this._input.tagName.toLowerCase() !== \"input\") {\n console.error(`${PfeAutocomplete.tag}: The only child in the light DOM must be an input tag`);\n\n return;\n }\n\n this._input.addEventListener(\"input\", this._inputChanged.bind(this));\n this._input.addEventListener(\"blur\", this._closeDroplist.bind(this));\n\n this._input.setAttribute(\"role\", \"combobox\");\n\n if (!this._input.hasAttribute(\"aria-label\")) {\n this._input.setAttribute(\"aria-label\", \"Search\");\n }\n\n this._input.setAttribute(\"aria-autocomplete\", \"both\");\n this._input.setAttribute(\"aria-haspopup\", \"true\");\n this._input.setAttribute(\"type\", \"search\");\n this._input.setAttribute(\"autocomplete\", \"off\");\n this._input.setAttribute(\"autocorrect\", \"off\");\n this._input.setAttribute(\"autocapitalize\", \"off\");\n this._input.setAttribute(\"spellcheck\", \"false\");\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"keyup\", this._inputKeyUp);\n\n this.removeEventListener(PfeAutocomplete.events.search, this._closeDroplist);\n this.removeEventListener(PfeAutocomplete.events.select, this._optionSelected);\n this._slot.removeEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler);\n if (this._input) {\n this._input.removeEventListener(\"input\", this._inputChanged);\n this._input.removeEventListener(\"blur\", this._closeDroplist);\n }\n\n this._clearBtn.removeEventListener(\"click\", this._clear);\n this._searchBtn.removeEventListener(\"click\", this._search);\n this._searchBtnTextual.removeEventListener(\"click\", this._search);\n }\n\n _initValueChanged(oldVal, newVal) {\n if (newVal) {\n // set inputbox and buttons in the inner component\n this._input.value = newVal;\n if (newVal !== \"\" && !this.isDisabled) {\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n this._clearBtn.removeAttribute(\"hidden\");\n } else {\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._clearBtn.setAttribute(\"hidden\", \"\");\n }\n }\n }\n\n _loadingChanged() {\n if (!this.loading || this._input.value === \"\") {\n this.shadowRoot.querySelector(\".loading\").setAttribute(\"hidden\", \"\");\n } else {\n this.shadowRoot.querySelector(\".loading\").removeAttribute(\"hidden\");\n }\n }\n\n _isDisabledChanged() {\n if (this.isDisabled) {\n this._clearBtn.setAttribute(\"disabled\", \"\");\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._input.setAttribute(\"disabled\", \"\");\n } else {\n this._clearBtn.removeAttribute(\"disabled\");\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n this._input.removeAttribute(\"disabled\");\n }\n }\n\n _buttonTextChanged(oldVal, newVal) {\n if (oldVal === null) {\n this._searchBtn.setAttribute(\"hidden\", \"\");\n this._searchBtnText.innerHTML = newVal || \"Search\";\n this._searchBtnTextual.removeAttribute(\"hidden\");\n } else if (newVal === null || newVal === \"\") {\n this._searchBtnTextual.setAttribute(\"hidden\", \"\");\n this._searchBtn.removeAttribute(\"hidden\");\n } else {\n this._searchBtnText.innerHTML = newVal || \"Search\";\n }\n }\n\n _slotchangeHandler() {\n this._inputInit();\n this._dropdown._ariaAnnounceTemplate = this.getAttribute(\"aria-announce-template\") || this._ariaAnnounceTemplate;\n }\n\n _inputChanged() {\n if (this._input.value === \"\") {\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._clearBtn.setAttribute(\"hidden\", \"\");\n\n this._reset();\n return;\n } else {\n if (!this._input.hasAttribute(\"disabled\")) {\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n }\n this._clearBtn.removeAttribute(\"hidden\");\n }\n\n if (throttle === false) {\n throttle = true;\n\n window.setTimeout(() => {\n this._sendAutocompleteRequest(this._input.value);\n throttle = false;\n }, this.debounce);\n }\n }\n\n _clear() {\n this._input.value = \"\";\n this._clearBtn.setAttribute(\"hidden\", \"\");\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._input.focus();\n }\n\n _search() {\n this._doSearch(this._input.value);\n }\n\n _closeDroplist() {\n this._dropdown.open = null;\n this._dropdown.removeAttribute(\"active-index\");\n }\n\n _openDroplist() {\n this.activeIndex = null;\n this._dropdown.open = true;\n this._dropdown.setAttribute(\"active-index\", null);\n this.emitEvent(PfeAutocomplete.events.optionsShown, {\n composed: true\n });\n }\n\n _optionSelected(e) {\n let selectedValue = e.detail.optionValue;\n\n // update input box with selected value from options list\n this._input.value = selectedValue;\n\n // send search request\n this._doSearch(selectedValue);\n }\n\n _doSearch(searchQuery) {\n this.emitEvent(PfeAutocomplete.events.search, {\n detail: { searchValue: searchQuery },\n composed: true\n });\n this._reset();\n this.selectedValue = searchQuery;\n }\n\n _sendAutocompleteRequest(input) {\n if (!this.autocompleteRequest) return;\n\n this.autocompleteRequest({ query: input }, this._autocompleteCallback.bind(this));\n }\n\n _autocompleteCallback(response) {\n this._dropdown.data = response;\n this._dropdown.reflow = true;\n response.length !== 0 ? this._openDroplist() : this._closeDroplist();\n }\n\n _reset() {\n this._dropdown.activeIndex = null;\n this._input.setAttribute(\"aria-activedescendant\", \"\");\n this._dropdown.data = [];\n this._closeDroplist();\n }\n\n _activeOption(activeIndex) {\n if (activeIndex === null || activeIndex === \"null\") return;\n return this._dropdown.shadowRoot.querySelector(\"li:nth-child(\" + (parseInt(activeIndex, 10) + 1) + \")\").innerHTML;\n }\n\n _inputKeyUp(e) {\n let key = e.keyCode;\n\n if (\n this._dropdown.data.length === 0 &&\n key !== KEYCODE.DOWN &&\n key !== KEYCODE.UP &&\n key !== KEYCODE.ENTER &&\n key !== KEYCODE.ESC\n )\n return;\n\n let activeIndex = this._dropdown.activeIndex;\n let optionsLength = this._dropdown.data.length;\n\n if (key == KEYCODE.ESC) {\n this._closeDroplist();\n } else if (key === KEYCODE.UP) {\n if (!this._dropdown.open) {\n return;\n }\n\n activeIndex = activeIndex === null || activeIndex === \"null\" ? optionsLength : parseInt(activeIndex, 10);\n\n activeIndex -= 1;\n\n if (activeIndex < 0) {\n activeIndex = optionsLength - 1;\n }\n\n this._input.value = this._activeOption(activeIndex);\n } else if (key === KEYCODE.DOWN) {\n if (!this._dropdown.open) {\n return;\n }\n\n activeIndex = activeIndex === null || activeIndex === \"null\" ? -1 : parseInt(activeIndex, 10);\n activeIndex += 1;\n\n if (activeIndex > optionsLength - 1) {\n activeIndex = 0;\n }\n\n this._input.value = this._activeOption(activeIndex);\n } else if (key === KEYCODE.ENTER) {\n if (this._activeOption(activeIndex)) {\n this.emitEvent(PfeAutocomplete.events.select, {\n detail: { optionValue: this._activeOption(activeIndex) },\n composed: true\n });\n\n return;\n }\n\n let selectedValue = this._input.value;\n this._doSearch(selectedValue);\n return;\n }\n\n if (activeIndex !== null && activeIndex !== \"null\") {\n this._input.setAttribute(\"aria-activedescendant\", \"option-\" + activeIndex);\n } else {\n this._input.setAttribute(\"aria-activedescendant\", \"\");\n }\n\n this.activeIndex = activeIndex;\n this._dropdown.activeIndex = activeIndex;\n }\n}\n\n/*\n* - Attributes ------------------------------------\n* open | Set when the combo box dropdown is open\n* active-index | Set selected option\n* reflow | Re-renders the dropdown\n\n* - Events ----------------------------------------\n* pfe-autocomplete:option-selected | Fires when an option is selected.\n event.details.optionValue contains the selected value.\n*/\nclass PfeSearchDroplist extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n
    \n
      \n
    \n
    `;\n }\n\n static get tag() {\n return \"pfe-search-droplist\";\n }\n\n get templateUrl() {\n return \"pfe-search-droplist.html\";\n }\n\n get styleUrl() {\n return \"pfe-search-droplist.scss\";\n }\n\n static get properties() {\n return {\n open: {\n title: \"Open\",\n type: Boolean\n },\n reflow: {\n title: \"Reflow\",\n type: Boolean,\n observer: \"_renderOptions\"\n },\n activeIndex: {\n title: \"Active index\",\n type: Number,\n observer: \"_activeIndexChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeSearchDroplist);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this._ariaAnnounce = this.shadowRoot.querySelector(\".suggestions-aria-help\");\n\n this.activeIndex = null;\n this._ul = this.shadowRoot.querySelector(\"ul\");\n this._ul.addEventListener(\"mousedown\", this._optionSelected.bind(this));\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._ul.removeEventListener(\"mousedown\", this._optionSelected);\n }\n\n _optionSelected(e) {\n if (e.target.tagName === \"LI\") {\n this.emitEvent(PfeAutocomplete.events.select, {\n detail: { optionValue: e.target.innerText },\n composed: true\n });\n }\n }\n\n _renderOptions() {\n let options = this.data;\n let ariaAnnounceText = \"\";\n\n if (this._ariaAnnounceTemplate) {\n ariaAnnounceText = this._ariaAnnounceTemplate.replace(\"${numOptions}\", options.length);\n }\n\n this._ariaAnnounce.textContent = ariaAnnounceText;\n this._ariaAnnounce.setAttribute(\"aria-live\", \"polite\");\n\n this._ul.innerHTML = `${options\n .map((item, index) => {\n return `
  • ${item}
  • `;\n })\n .join(\"\")}`;\n }\n\n _activeIndexChanged() {\n if (!this.data || this.data.length === 0 || this.activeIndex === null || this.activeIndex === \"null\") return;\n\n // remove active class\n if (this._ul.querySelector(\".active\")) {\n this._ul.querySelector(\".active\").classList.remove(\"active\");\n }\n\n // add active class to selected option\n let activeOption = this._ul.querySelector(\"li:nth-child(\" + (parseInt(this.activeIndex, 10) + 1) + \")\");\n\n activeOption.classList.add(\"active\");\n\n // scroll to selected element when selected item with keyboard is out of view\n let ulWrapper = this.shadowRoot.querySelector(\".droplist\");\n let activeOptionHeight = activeOption.offsetHeight;\n activeOptionHeight += parseInt(window.getComputedStyle(activeOption).getPropertyValue(\"margin-bottom\"), 10);\n ulWrapper.scrollTop = activeOption.offsetTop - ulWrapper.offsetHeight + activeOptionHeight;\n }\n}\n\nPFElement.create(PfeSearchDroplist);\nPFElement.create(PfeAutocomplete);\n\nexport default PfeAutocomplete;\n"],"names":["KEYCODE","ENTER","DOWN","UP","ESC","throttle","PfeAutocomplete","initValue","title","type","String","observer","loading","Boolean","default","isDisabled","debounce","Number","selectedValue","buttonText","search","tag","select","optionsShown","slotchange","_inputInit","_slotchangeHandler","bind","_slot","shadowRoot","querySelector","addEventListener","events","_ariaAnnounceTemplate","_clearBtn","_clear","_searchBtn","_search","_searchBtnTextual","_searchBtnText","_dropdown","data","activeIndex","_inputKeyUp","_closeDroplist","_optionSelected","slotNodes","assignedNodes","slotElems","filter","n","nodeType","Node","ELEMENT_NODE","length","console","error","_input","tagName","toLowerCase","_inputChanged","setAttribute","hasAttribute","removeEventListener","oldVal","newVal","value","removeAttribute","innerHTML","getAttribute","_reset","window","setTimeout","_sendAutocompleteRequest","focus","_doSearch","open","emitEvent","composed","e","detail","optionValue","searchQuery","searchValue","input","autocompleteRequest","query","_autocompleteCallback","response","reflow","_openDroplist","parseInt","key","keyCode","optionsLength","_activeOption","PFElement","PfeSearchDroplist","_ariaAnnounce","_ul","target","innerText","options","ariaAnnounceText","replace","textContent","map","item","index","join","classList","remove","activeOption","add","ulWrapper","activeOptionHeight","offsetHeight","getComputedStyle","getPropertyValue","scrollTop","offsetTop","create"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;EA4BA,IAAMA,UAAU;EACdC,SAAO,EADO;EAEdC,QAAM,EAFQ;EAGdC,MAAI,EAHU;EAIdC,OAAK;EAJS,CAAhB;;EAOA;EACA,IAAIC,WAAW,KAAf;;MAEMC;;;;;;EAOJ;0BACW;EACT;EA2CD;;EAED;EACA;;;;0BAcgB;EACd,aAAO,uBAAP;EACD;;;0BAEiB;EAChB,aAAO,uBAAP;EACD;;;0BAEc;EACb,aAAO,uBAAP;EACD;;;;;EA7ED;0BACqB;EACnB,aAAO,OAAP;EACD;;;0BAmD6B;EAC5B,aAAO,EAAC,kBAAiB,EAAC,SAAQ,UAAT,EAAoB,eAAc,sEAAlC,EAAyG,QAAO,QAAhH,EAAyH,YAAW,KAApI,EAAlB,EAA6J,cAAa,EAAC,SAAQ,eAAT,EAAyB,eAAc,6CAAvC,EAAqF,QAAO,QAA5F,EAAqG,YAAW,KAAhH,EAA1K,EAAiS,eAAc,EAAC,SAAQ,aAAT,EAAuB,eAAc,mBAArC,EAAyD,QAAO,SAAhE,EAA0E,YAAW,KAArF,EAA/S,EAA2Y,eAAc,EAAC,SAAQ,aAAT,EAAuB,eA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H,aAAaI,YAAtC;EACAD,4BAAsBxB,SAASpB,OAAO8C,gBAAP,CAAwBL,YAAxB,EAAsCM,gBAAtC,CAAuD,eAAvD,CAAT,EAAkF,EAAlF,CAAtB;EACAJ,gBAAUK,SAAV,GAAsBP,aAAaQ,SAAb,GAAyBN,UAAUE,YAAnC,GAAkDD,kBAAxE;EACD;;;IAjH6BnB;;EAoHhCA,UAAUyB,MAAV,CAAiBxB,iBAAjB;EACAD,UAAUyB,MAAV,CAAiBnH,eAAjB;;;;;;;;"} \ No newline at end of file diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.min.js b/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.min.js new file mode 100644 index 0000000000..47734e191e --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../pfelement/dist/pfelement.umd.min"),require("../../pfe-button/dist/pfe-button.umd.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min","../../pfe-button/dist/pfe-button.umd.min"],t):(e=e||self).PfeAutocomplete=t(e.PFElement)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(e,t,o){return t&&i(e.prototype,t),o&&i(e,o),e};function i(e,t){for(var o=0;o.sr-only{position:absolute;overflow:hidden;clip:rect(0,0,0,0);height:1px;width:1px;margin:-1px;padding:0;border:0}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#151515!important}}:host([on=dark]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-dark, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-dark, #73bcf7);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-dark, #bee1f4);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-dark, #bee1f4);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-dark, #bee1f4);--pfe-broadcasted--link-decoration:var(--pfe-theme--link-decoration--on-dark, none);--pfe-broadcasted--link-decoration--hover:var(--pfe-theme--link-decoration--hover--on-dark, underline);--pfe-broadcasted--link-decoration--focus:var(--pfe-theme--link-decoration--focus--on-dark, underline);--pfe-broadcasted--link-decoration--visited:var(--pfe-theme--link-decoration--visited--on-dark, none)}:host([on=saturated]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-saturated, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-saturated, #fff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-saturated, #fafafa);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-saturated, #fafafa);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-saturated, #d2d2d2);--pfe-broadcasted--link-decoration:var(--pfe-theme--link-decoration--on-saturated, underline);--pfe-broadcasted--link-decoration--hover:var(--pfe-theme--link-decoration--hover--on-saturated, underline);--pfe-broadcasted--link-decoration--focus:var(--pfe-theme--link-decoration--focus--on-saturated, underline);--pfe-broadcasted--link-decoration--visited:var(--pfe-theme--link-decoration--visited--on-saturated, underline)}:host([on=light]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #151515);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #004080);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #004080);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, #6753ac);--pfe-broadcasted--link-decoration:var(--pfe-theme--link-decoration, none);--pfe-broadcasted--link-decoration--hover:var(--pfe-theme--link-decoration--hover, underline);--pfe-broadcasted--link-decoration--focus:var(--pfe-theme--link-decoration--focus, underline);--pfe-broadcasted--link-decoration--visited:var(--pfe-theme--link-decoration--visited, none)}:host{display:block;position:relative;font-family:"Red Hat Text",RedHatText,Overpass,Overpass,Arial,sans-serif;font-family:var(--pfe-theme--font-family, "Red Hat Text", "RedHatText", "Overpass", Overpass, Arial, sans-serif);--pfe-autocomplete--BoxShadow:var(--pfe-theme--box-shadow--inset, inset 0 0 0.625rem 0 #fafafa);--pfe-autocomplete--BackgroundColor:var(--pfe-theme--color--surface--lightest, #fff);--pfe-autocomplete--Border:var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-theme--color--surface--border, #d2d2d2)}:host([button-text]){display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}:host([button-text]) #wrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}:host([button-text]) #input-box-wrapper{position:relative}:host([button-text]) button.clear-search{right:10px}:host([button-text]) ::slotted(input[type=search]::-webkit-search-cancel-button){-webkit-appearance:none}#input-box-wrapper{border-color:#06c;border-color:var(--pfe-theme--color--feedback--info,#06c)}#input-box-wrapper ::slotted(input){width:100%;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-box-shadow:inset 0 0 .625rem 0 #fafafa!important;box-shadow:inset 0 0 .625rem 0 #fafafa!important;-webkit-box-shadow:var(--pfe-autocomplete--BoxShadow,var(--pfe-theme--box-shadow--inset,inset 0 0 .625rem 0 #fafafa))!important;box-shadow:var(--pfe-autocomplete--BoxShadow,var(--pfe-theme--box-shadow--inset,inset 0 0 .625rem 0 #fafafa))!important;padding-left:10px;padding-right:30px;border-radius:2px;border-radius:var(--pfe-theme--ui--border-radius,2px);background-color:#fff;background-color:var(--pfe-autocomplete--BackgroundColor,var(--pfe-theme--color--surface--lightest,#fff));border:1px solid #d2d2d2;border:var(--pfe-autocomplete--Border,var(--pfe-theme--ui--border-width,1px) var(--pfe-theme--ui--border-style,solid) var(--pfe-theme--color--surface--border,#d2d2d2));font-size:1rem;font-size:var(--pfe-theme--font-size,1rem);font-family:"Red Hat Text",RedHatText,Overpass,Overpass,Arial,sans-serif;font-family:var(--pfe-theme--font-family, "Red Hat Text", "RedHatText", "Overpass", Overpass, Arial, sans-serif);height:calc(20px * 2);height:calc(var(--pfe-theme--ui--element--size,20px) * 2);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;opacity:1;outline:0}#input-box-wrapper ::slotted(input:disabled),#input-box-wrapper button:disabled{cursor:not-allowed;color:#ccc}#input-box-wrapper ::slotted(input:disabled){padding-right:10px}#input-box-wrapper ::slotted(input:focus),#input-box-wrapper button:focus{outline:0}#input-box-wrapper ::slotted(input),#input-box-wrapper button{-webkit-appearance:none}#input-box-wrapper ::slotted([type=search]::-ms-clear){display:none}#input-box-wrapper ::slotted(input[type=search]::-webkit-search-cancel-button),#input-box-wrapper ::slotted(input[type=search]::-webkit-search-decoration){-webkit-appearance:none}button{color:#6a6e73;color:var(--pfe-theme--color--ui-base,#6a6e73);background-color:transparent;border:none;position:absolute;top:0;bottom:0;cursor:pointer}button.clear-search{right:30px;width:20px;margin:2px 1px;background-color:#fff;background-color:var(--pfe-theme--color--surface--lightest,#fff)}button.clear-search:hover{color:#6a6e73;color:var(--pfe-theme--color--ui-base,#6a6e73)}button.clear-search svg{width:12px;stroke:#d2d2d2;stroke:var(--pfe-theme--color--surface--border,#d2d2d2)}button.clear-search:focus svg,button.clear-search:hover svg{opacity:1;stroke:#06c;stroke:var(--pfe-theme--color--link,#06c)}button[disabled].clear-search:focus svg,button[disabled].clear-search:hover svg{stroke:#d2d2d2;stroke:var(--pfe-theme--color--surface--border,#d2d2d2)}button.search-button{right:1px;width:30px}button.search-button svg{fill:#06c;fill:var(--pfe-theme--color--link,#06c);width:16px}button.search-button:focus svg,button.search-button:hover svg{fill:#004080;fill:var(--pfe-theme--color--link--hover,#004080)}button.search-button:disabled svg{fill:#d2d2d2;fill:var(--pfe-theme--color--ui-disabled,#d2d2d2)}pfe-button.search-button--textual{margin-left:16px}.loading{position:absolute;width:30px;right:52px;top:0;bottom:0}.loading svg{width:26px;padding-top:7px} /*# sourceMappingURL=pfe-autocomplete.min.css.map */\n
    \n
    \n \n\n \n\n \n\n \n
    \n \n
    \n\n'}},{key:"schemaUrl",get:function(){return"pfe-autocomplete.json"}},{key:"templateUrl",get:function(){return"pfe-autocomplete.html"}},{key:"styleUrl",get:function(){return"pfe-autocomplete.scss"}}],[{key:"version",get:function(){return"1.3.0"}},{key:"schemaProperties",get:function(){return{debounce_timer:{title:"Debounce",description:"The amount of time that should pass before the next API call is made",type:"string",prefixed:!1},init_value:{title:"Initial value",description:"An initial value to show in the input field",type:"string",prefixed:!1},is_disabled:{title:"Is disabled",description:"Disable the input",type:"boolean",prefixed:!1},"button-text":{title:"Button text",description:"Add button with text next to input field",type:"string",prefixed:!1}}}},{key:"slots",get:function(){return{content:{title:"Content",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"input"}]},required:!0}}}},{key:"tag",get:function(){return"pfe-autocomplete"}},{key:"properties",get:function(){return{initValue:{title:"Initial Value",type:String,observer:"_initValueChanged"},loading:{title:"Loading",type:Boolean,default:!1,observer:"_loadingChanged"},isDisabled:{title:"Is disabled",type:Boolean,default:!1,observer:"_isDisabledChanged"},debounce:{title:"Debounce",type:Number,default:300},selectedValue:{title:"Selected value",type:String},buttonText:{title:"Button text",type:String,observer:"_buttonTextChanged"}}}},{key:"events",get:function(){return{search:this.tag+":search-event",select:this.tag+":option-selected",optionsShown:this.tag+":options-shown",slotchange:"slotchange"}}}]),o(h,[{key:"_inputInit",value:function(){var e=this.shadowRoot.querySelector("slot").assignedNodes().filter(function(e){return e.nodeType===Node.ELEMENT_NODE});0!==e.length?(this._input=e[0],"input"===this._input.tagName.toLowerCase()?(this._input.addEventListener("input",this._inputChanged.bind(this)),this._input.addEventListener("blur",this._closeDroplist.bind(this)),this._input.setAttribute("role","combobox"),this._input.hasAttribute("aria-label")||this._input.setAttribute("aria-label","Search"),this._input.setAttribute("aria-autocomplete","both"),this._input.setAttribute("aria-haspopup","true"),this._input.setAttribute("type","search"),this._input.setAttribute("autocomplete","off"),this._input.setAttribute("autocorrect","off"),this._input.setAttribute("autocapitalize","off"),this._input.setAttribute("spellcheck","false")):console.error(h.tag+": The only child in the light DOM must be an input tag")):console.error(h.tag+": There must be a input tag in the light DOM")}},{key:"disconnectedCallback",value:function(){n(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("keyup",this._inputKeyUp),this.removeEventListener(h.events.search,this._closeDroplist),this.removeEventListener(h.events.select,this._optionSelected),this._slot.removeEventListener(h.events.slotchange,this._slotchangeHandler),this._input&&(this._input.removeEventListener("input",this._inputChanged),this._input.removeEventListener("blur",this._closeDroplist)),this._clearBtn.removeEventListener("click",this._clear),this._searchBtn.removeEventListener("click",this._search),this._searchBtnTextual.removeEventListener("click",this._search)}},{key:"_initValueChanged",value:function(e,t){t&&(""===(this._input.value=t)||this.isDisabled?(this._searchBtn.setAttribute("disabled",""),this._searchBtnTextual.setAttribute("disabled",""),this._clearBtn.setAttribute("hidden","")):(this._searchBtn.removeAttribute("disabled"),this._searchBtnTextual.removeAttribute("disabled"),this._clearBtn.removeAttribute("hidden")))}},{key:"_loadingChanged",value:function(){this.loading&&""!==this._input.value?this.shadowRoot.querySelector(".loading").removeAttribute("hidden"):this.shadowRoot.querySelector(".loading").setAttribute("hidden","")}},{key:"_isDisabledChanged",value:function(){this.isDisabled?(this._clearBtn.setAttribute("disabled",""),this._searchBtn.setAttribute("disabled",""),this._searchBtnTextual.setAttribute("disabled",""),this._input.setAttribute("disabled","")):(this._clearBtn.removeAttribute("disabled"),this._searchBtn.removeAttribute("disabled"),this._searchBtnTextual.removeAttribute("disabled"),this._input.removeAttribute("disabled"))}},{key:"_buttonTextChanged",value:function(e,t){null===e?(this._searchBtn.setAttribute("hidden",""),this._searchBtnText.innerHTML=t||"Search",this._searchBtnTextual.removeAttribute("hidden")):null===t||""===t?(this._searchBtnTextual.setAttribute("hidden",""),this._searchBtn.removeAttribute("hidden")):this._searchBtnText.innerHTML=t||"Search"}},{key:"_slotchangeHandler",value:function(){this._inputInit(),this._dropdown._ariaAnnounceTemplate=this.getAttribute("aria-announce-template")||this._ariaAnnounceTemplate}},{key:"_inputChanged",value:function(){var e=this;if(""===this._input.value)return this._searchBtn.setAttribute("disabled",""),this._searchBtnTextual.setAttribute("disabled",""),this._clearBtn.setAttribute("hidden",""),void this._reset();this._input.hasAttribute("disabled")||(this._searchBtn.removeAttribute("disabled"),this._searchBtnTextual.removeAttribute("disabled")),this._clearBtn.removeAttribute("hidden"),!1===u&&(u=!0,window.setTimeout(function(){e._sendAutocompleteRequest(e._input.value),u=!1},this.debounce))}},{key:"_clear",value:function(){this._input.value="",this._clearBtn.setAttribute("hidden",""),this._searchBtn.setAttribute("disabled",""),this._searchBtnTextual.setAttribute("disabled",""),this._input.focus()}},{key:"_search",value:function(){this._doSearch(this._input.value)}},{key:"_closeDroplist",value:function(){this._dropdown.open=null,this._dropdown.removeAttribute("active-index")}},{key:"_openDroplist",value:function(){this.activeIndex=null,this._dropdown.open=!0,this._dropdown.setAttribute("active-index",null),this.emitEvent(h.events.optionsShown,{composed:!0})}},{key:"_optionSelected",value:function(e){e=e.detail.optionValue;this._input.value=e,this._doSearch(e)}},{key:"_doSearch",value:function(e){this.emitEvent(h.events.search,{detail:{searchValue:e},composed:!0}),this._reset(),this.selectedValue=e}},{key:"_sendAutocompleteRequest",value:function(e){this.autocompleteRequest&&this.autocompleteRequest({query:e},this._autocompleteCallback.bind(this))}},{key:"_autocompleteCallback",value:function(e){this._dropdown.data=e,this._dropdown.reflow=!0,0!==e.length?this._openDroplist():this._closeDroplist()}},{key:"_reset",value:function(){this._dropdown.activeIndex=null,this._input.setAttribute("aria-activedescendant",""),this._dropdown.data=[],this._closeDroplist()}},{key:"_activeOption",value:function(e){if(null!==e&&"null"!==e)return this._dropdown.shadowRoot.querySelector("li:nth-child("+(parseInt(e,10)+1)+")").innerHTML}},{key:"_inputKeyUp",value:function(e){var t=e.keyCode;if(0!==this._dropdown.data.length||t===l||t===d||t===s||t===c){var o=this._dropdown.activeIndex,e=this._dropdown.data.length;if(t==c)this._closeDroplist();else if(t===d){if(!this._dropdown.open)return;o=null===o||"null"===o?e:parseInt(o,10),--o<0&&(o=e-1),this._input.value=this._activeOption(o)}else if(t===l){if(!this._dropdown.open)return;o=null===o||"null"===o?-1:parseInt(o,10),e-1<(o+=1)&&(o=0),this._input.value=this._activeOption(o)}else if(t===s){if(this._activeOption(o))return void this.emitEvent(h.events.select,{detail:{optionValue:this._activeOption(o)},composed:!0});t=this._input.value;return void this._doSearch(t)}null!==o&&"null"!==o?this._input.setAttribute("aria-activedescendant","option-"+o):this._input.setAttribute("aria-activedescendant",""),this.activeIndex=o,this._dropdown.activeIndex=o}}}]),h);function h(){t(this,h);var e=a(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h));return e._inputInit(),e._slotchangeHandler=e._slotchangeHandler.bind(e),e._slot=e.shadowRoot.querySelector("slot"),e._slot.addEventListener(h.events.slotchange,e._slotchangeHandler),e._ariaAnnounceTemplate="There are ${numOptions} suggestions. Use the up and down arrows to browse.",e._clearBtn=e.shadowRoot.querySelector(".clear-search"),e._clearBtn.addEventListener("click",e._clear.bind(e)),e._searchBtn=e.shadowRoot.querySelector(".search-button"),e._searchBtn.addEventListener("click",e._search.bind(e)),e._searchBtnTextual=e.shadowRoot.querySelector(".search-button--textual"),e._searchBtnText=e.shadowRoot.querySelector(".search-button__text"),e._searchBtnTextual.addEventListener("click",e._search.bind(e)),e._dropdown=e.shadowRoot.querySelector("#dropdown"),e._dropdown.data=[],e.activeIndex=null,e.addEventListener("keyup",e._inputKeyUp.bind(e)),e.addEventListener(h.events.search,e._closeDroplist.bind(e)),e.addEventListener(h.events.select,e._optionSelected.bind(e)),e}r(f,e),o(f,[{key:"html",get:function(){return'\n\n
    \n
    \n
      \n
    \n
    '}},{key:"templateUrl",get:function(){return"pfe-search-droplist.html"}},{key:"styleUrl",get:function(){return"pfe-search-droplist.scss"}}],[{key:"version",get:function(){return"1.3.0"}},{key:"tag",get:function(){return"pfe-search-droplist"}},{key:"properties",get:function(){return{open:{title:"Open",type:Boolean},reflow:{title:"Reflow",type:Boolean,observer:"_renderOptions"},activeIndex:{title:"Active index",type:Number,observer:"_activeIndexChanged"}}}}]),o(f,[{key:"connectedCallback",value:function(){n(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"connectedCallback",this).call(this),this._ariaAnnounce=this.shadowRoot.querySelector(".suggestions-aria-help"),this.activeIndex=null,this._ul=this.shadowRoot.querySelector("ul"),this._ul.addEventListener("mousedown",this._optionSelected.bind(this))}},{key:"disconnectedCallback",value:function(){n(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"disconnectedCallback",this).call(this),this._ul.removeEventListener("mousedown",this._optionSelected)}},{key:"_optionSelected",value:function(e){"LI"===e.target.tagName&&this.emitEvent(p.events.select,{detail:{optionValue:e.target.innerText},composed:!0})}},{key:"_renderOptions",value:function(){var e=this.data,t="";this._ariaAnnounceTemplate&&(t=this._ariaAnnounceTemplate.replace("${numOptions}",e.length)),this._ariaAnnounce.textContent=t,this._ariaAnnounce.setAttribute("aria-live","polite"),this._ul.innerHTML=""+e.map(function(e,t){return'
  • '+e+"
  • "}).join("")}},{key:"_activeIndexChanged",value:function(){var e,t,o;this.data&&0!==this.data.length&&null!==this.activeIndex&&"null"!==this.activeIndex&&(this._ul.querySelector(".active")&&this._ul.querySelector(".active").classList.remove("active"),(e=this._ul.querySelector("li:nth-child("+(parseInt(this.activeIndex,10)+1)+")")).classList.add("active"),t=this.shadowRoot.querySelector(".droplist"),o=e.offsetHeight,o+=parseInt(window.getComputedStyle(e).getPropertyValue("margin-bottom"),10),t.scrollTop=e.offsetTop-t.offsetHeight+o)}}]),o=f;function f(){return t(this,f),a(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,f))}return e.create(o),e.create(p),p}); +//# sourceMappingURL=pfe-autocomplete.umd.min.js.map diff --git a/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.min.js.map b/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.min.js.map new file mode 100644 index 0000000000..464427f5ad --- /dev/null +++ b/elements/pfe-autocomplete/dist/pfe-autocomplete.umd.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-autocomplete.umd.min.js","sources":["../_temp/pfe-autocomplete.umd.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeAutocomplete 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\nimport \"../../pfe-button/dist/pfe-button\";\n\nconst KEYCODE = {\n ENTER: 13,\n DOWN: 40,\n UP: 38,\n ESC: 27\n};\n\n// use this variable to debounce api call when user types very fast\nlet throttle = false;\n\nclass PfeAutocomplete extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n
    \n \n\n \n\n \n\n \n
    \n \n
    \n\n`;\n }\n\n // @TODO: Deprecating in 1.0 release\n // Injected at build-time\n static get schemaProperties() {\n return {\"debounce_timer\":{\"title\":\"Debounce\",\"description\":\"The amount of time that should pass before the next API call is made\",\"type\":\"string\",\"prefixed\":false},\"init_value\":{\"title\":\"Initial value\",\"description\":\"An initial value to show in the input field\",\"type\":\"string\",\"prefixed\":false},\"is_disabled\":{\"title\":\"Is disabled\",\"description\":\"Disable the input\",\"type\":\"boolean\",\"prefixed\":false},\"button-text\":{\"title\":\"Button text\",\"description\":\"Add button with text next to input field\",\"type\":\"string\",\"prefixed\":false}};\n }\n\n // Injected at build-time\n static get slots() {\n return {\"content\":{\"title\":\"Content\",\"type\":\"array\",\"namedSlot\":false,\"items\":{\"oneOf\":[{\"$ref\":\"input\"}]},\"required\":true}};\n }\n\n static get tag() {\n return \"pfe-autocomplete\";\n }\n\n get schemaUrl() {\n return \"pfe-autocomplete.json\";\n }\n\n get templateUrl() {\n return \"pfe-autocomplete.html\";\n }\n\n get styleUrl() {\n return \"pfe-autocomplete.scss\";\n }\n\n static get properties() {\n return {\n initValue: {\n title: \"Initial Value\",\n type: String,\n observer: \"_initValueChanged\"\n },\n loading: {\n title: \"Loading\",\n type: Boolean,\n default: false,\n observer: \"_loadingChanged\"\n },\n isDisabled: {\n title: \"Is disabled\",\n type: Boolean,\n default: false,\n observer: \"_isDisabledChanged\"\n },\n debounce: {\n title: \"Debounce\",\n type: Number,\n default: 300\n },\n selectedValue: {\n title: \"Selected value\",\n type: String\n },\n buttonText: {\n title: \"Button text\",\n type: String,\n observer: \"_buttonTextChanged\"\n }\n };\n }\n\n static get events() {\n return {\n search: `${this.tag}:search-event`,\n select: `${this.tag}:option-selected`,\n optionsShown: `${this.tag}:options-shown`,\n slotchange: `slotchange`\n };\n }\n\n constructor() {\n super(PfeAutocomplete);\n\n this._inputInit();\n\n this._slotchangeHandler = this._slotchangeHandler.bind(this);\n\n this._slot = this.shadowRoot.querySelector(\"slot\");\n this._slot.addEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler);\n\n // @TODO: Confirm this is translatable\n this._ariaAnnounceTemplate = \"There are ${numOptions} suggestions. Use the up and down arrows to browse.\";\n\n // clear button\n this._clearBtn = this.shadowRoot.querySelector(\".clear-search\");\n this._clearBtn.addEventListener(\"click\", this._clear.bind(this));\n\n // search button\n this._searchBtn = this.shadowRoot.querySelector(\".search-button\");\n this._searchBtn.addEventListener(\"click\", this._search.bind(this));\n\n // textual search button\n this._searchBtnTextual = this.shadowRoot.querySelector(\".search-button--textual\");\n this._searchBtnText = this.shadowRoot.querySelector(\".search-button__text\");\n this._searchBtnTextual.addEventListener(\"click\", this._search.bind(this));\n\n this._dropdown = this.shadowRoot.querySelector(\"#dropdown\");\n this._dropdown.data = [];\n\n this.activeIndex = null;\n\n this.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\n\n // these two events, fire search\n this.addEventListener(PfeAutocomplete.events.search, this._closeDroplist.bind(this));\n this.addEventListener(PfeAutocomplete.events.select, this._optionSelected.bind(this));\n }\n\n _inputInit() {\n // input box\n let slotNodes = this.shadowRoot.querySelector(\"slot\").assignedNodes();\n let slotElems = slotNodes.filter(n => n.nodeType === Node.ELEMENT_NODE);\n if (slotElems.length === 0) {\n console.error(`${PfeAutocomplete.tag}: There must be a input tag in the light DOM`);\n return;\n }\n this._input = slotElems[0];\n\n if (this._input.tagName.toLowerCase() !== \"input\") {\n console.error(`${PfeAutocomplete.tag}: The only child in the light DOM must be an input tag`);\n\n return;\n }\n\n this._input.addEventListener(\"input\", this._inputChanged.bind(this));\n this._input.addEventListener(\"blur\", this._closeDroplist.bind(this));\n\n this._input.setAttribute(\"role\", \"combobox\");\n\n if (!this._input.hasAttribute(\"aria-label\")) {\n this._input.setAttribute(\"aria-label\", \"Search\");\n }\n\n this._input.setAttribute(\"aria-autocomplete\", \"both\");\n this._input.setAttribute(\"aria-haspopup\", \"true\");\n this._input.setAttribute(\"type\", \"search\");\n this._input.setAttribute(\"autocomplete\", \"off\");\n this._input.setAttribute(\"autocorrect\", \"off\");\n this._input.setAttribute(\"autocapitalize\", \"off\");\n this._input.setAttribute(\"spellcheck\", \"false\");\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"keyup\", this._inputKeyUp);\n\n this.removeEventListener(PfeAutocomplete.events.search, this._closeDroplist);\n this.removeEventListener(PfeAutocomplete.events.select, this._optionSelected);\n this._slot.removeEventListener(PfeAutocomplete.events.slotchange, this._slotchangeHandler);\n if (this._input) {\n this._input.removeEventListener(\"input\", this._inputChanged);\n this._input.removeEventListener(\"blur\", this._closeDroplist);\n }\n\n this._clearBtn.removeEventListener(\"click\", this._clear);\n this._searchBtn.removeEventListener(\"click\", this._search);\n this._searchBtnTextual.removeEventListener(\"click\", this._search);\n }\n\n _initValueChanged(oldVal, newVal) {\n if (newVal) {\n // set inputbox and buttons in the inner component\n this._input.value = newVal;\n if (newVal !== \"\" && !this.isDisabled) {\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n this._clearBtn.removeAttribute(\"hidden\");\n } else {\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._clearBtn.setAttribute(\"hidden\", \"\");\n }\n }\n }\n\n _loadingChanged() {\n if (!this.loading || this._input.value === \"\") {\n this.shadowRoot.querySelector(\".loading\").setAttribute(\"hidden\", \"\");\n } else {\n this.shadowRoot.querySelector(\".loading\").removeAttribute(\"hidden\");\n }\n }\n\n _isDisabledChanged() {\n if (this.isDisabled) {\n this._clearBtn.setAttribute(\"disabled\", \"\");\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._input.setAttribute(\"disabled\", \"\");\n } else {\n this._clearBtn.removeAttribute(\"disabled\");\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n this._input.removeAttribute(\"disabled\");\n }\n }\n\n _buttonTextChanged(oldVal, newVal) {\n if (oldVal === null) {\n this._searchBtn.setAttribute(\"hidden\", \"\");\n this._searchBtnText.innerHTML = newVal || \"Search\";\n this._searchBtnTextual.removeAttribute(\"hidden\");\n } else if (newVal === null || newVal === \"\") {\n this._searchBtnTextual.setAttribute(\"hidden\", \"\");\n this._searchBtn.removeAttribute(\"hidden\");\n } else {\n this._searchBtnText.innerHTML = newVal || \"Search\";\n }\n }\n\n _slotchangeHandler() {\n this._inputInit();\n this._dropdown._ariaAnnounceTemplate = this.getAttribute(\"aria-announce-template\") || this._ariaAnnounceTemplate;\n }\n\n _inputChanged() {\n if (this._input.value === \"\") {\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._clearBtn.setAttribute(\"hidden\", \"\");\n\n this._reset();\n return;\n } else {\n if (!this._input.hasAttribute(\"disabled\")) {\n this._searchBtn.removeAttribute(\"disabled\");\n this._searchBtnTextual.removeAttribute(\"disabled\");\n }\n this._clearBtn.removeAttribute(\"hidden\");\n }\n\n if (throttle === false) {\n throttle = true;\n\n window.setTimeout(() => {\n this._sendAutocompleteRequest(this._input.value);\n throttle = false;\n }, this.debounce);\n }\n }\n\n _clear() {\n this._input.value = \"\";\n this._clearBtn.setAttribute(\"hidden\", \"\");\n this._searchBtn.setAttribute(\"disabled\", \"\");\n this._searchBtnTextual.setAttribute(\"disabled\", \"\");\n this._input.focus();\n }\n\n _search() {\n this._doSearch(this._input.value);\n }\n\n _closeDroplist() {\n this._dropdown.open = null;\n this._dropdown.removeAttribute(\"active-index\");\n }\n\n _openDroplist() {\n this.activeIndex = null;\n this._dropdown.open = true;\n this._dropdown.setAttribute(\"active-index\", null);\n this.emitEvent(PfeAutocomplete.events.optionsShown, {\n composed: true\n });\n }\n\n _optionSelected(e) {\n let selectedValue = e.detail.optionValue;\n\n // update input box with selected value from options list\n this._input.value = selectedValue;\n\n // send search request\n this._doSearch(selectedValue);\n }\n\n _doSearch(searchQuery) {\n this.emitEvent(PfeAutocomplete.events.search, {\n detail: { searchValue: searchQuery },\n composed: true\n });\n this._reset();\n this.selectedValue = searchQuery;\n }\n\n _sendAutocompleteRequest(input) {\n if (!this.autocompleteRequest) return;\n\n this.autocompleteRequest({ query: input }, this._autocompleteCallback.bind(this));\n }\n\n _autocompleteCallback(response) {\n this._dropdown.data = response;\n this._dropdown.reflow = true;\n response.length !== 0 ? this._openDroplist() : this._closeDroplist();\n }\n\n _reset() {\n this._dropdown.activeIndex = null;\n this._input.setAttribute(\"aria-activedescendant\", \"\");\n this._dropdown.data = [];\n this._closeDroplist();\n }\n\n _activeOption(activeIndex) {\n if (activeIndex === null || activeIndex === \"null\") return;\n return this._dropdown.shadowRoot.querySelector(\"li:nth-child(\" + (parseInt(activeIndex, 10) + 1) + \")\").innerHTML;\n }\n\n _inputKeyUp(e) {\n let key = e.keyCode;\n\n if (\n this._dropdown.data.length === 0 &&\n key !== KEYCODE.DOWN &&\n key !== KEYCODE.UP &&\n key !== KEYCODE.ENTER &&\n key !== KEYCODE.ESC\n )\n return;\n\n let activeIndex = this._dropdown.activeIndex;\n let optionsLength = this._dropdown.data.length;\n\n if (key == KEYCODE.ESC) {\n this._closeDroplist();\n } else if (key === KEYCODE.UP) {\n if (!this._dropdown.open) {\n return;\n }\n\n activeIndex = activeIndex === null || activeIndex === \"null\" ? optionsLength : parseInt(activeIndex, 10);\n\n activeIndex -= 1;\n\n if (activeIndex < 0) {\n activeIndex = optionsLength - 1;\n }\n\n this._input.value = this._activeOption(activeIndex);\n } else if (key === KEYCODE.DOWN) {\n if (!this._dropdown.open) {\n return;\n }\n\n activeIndex = activeIndex === null || activeIndex === \"null\" ? -1 : parseInt(activeIndex, 10);\n activeIndex += 1;\n\n if (activeIndex > optionsLength - 1) {\n activeIndex = 0;\n }\n\n this._input.value = this._activeOption(activeIndex);\n } else if (key === KEYCODE.ENTER) {\n if (this._activeOption(activeIndex)) {\n this.emitEvent(PfeAutocomplete.events.select, {\n detail: { optionValue: this._activeOption(activeIndex) },\n composed: true\n });\n\n return;\n }\n\n let selectedValue = this._input.value;\n this._doSearch(selectedValue);\n return;\n }\n\n if (activeIndex !== null && activeIndex !== \"null\") {\n this._input.setAttribute(\"aria-activedescendant\", \"option-\" + activeIndex);\n } else {\n this._input.setAttribute(\"aria-activedescendant\", \"\");\n }\n\n this.activeIndex = activeIndex;\n this._dropdown.activeIndex = activeIndex;\n }\n}\n\n/*\n* - Attributes ------------------------------------\n* open | Set when the combo box dropdown is open\n* active-index | Set selected option\n* reflow | Re-renders the dropdown\n\n* - Events ----------------------------------------\n* pfe-autocomplete:option-selected | Fires when an option is selected.\n event.details.optionValue contains the selected value.\n*/\nclass PfeSearchDroplist extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n
    \n
      \n
    \n
    `;\n }\n\n static get tag() {\n return \"pfe-search-droplist\";\n }\n\n get templateUrl() {\n return \"pfe-search-droplist.html\";\n }\n\n get styleUrl() {\n return \"pfe-search-droplist.scss\";\n }\n\n static get properties() {\n return {\n open: {\n title: \"Open\",\n type: Boolean\n },\n reflow: {\n title: \"Reflow\",\n type: Boolean,\n observer: \"_renderOptions\"\n },\n activeIndex: {\n title: \"Active index\",\n type: Number,\n observer: \"_activeIndexChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeSearchDroplist);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this._ariaAnnounce = this.shadowRoot.querySelector(\".suggestions-aria-help\");\n\n this.activeIndex = null;\n this._ul = this.shadowRoot.querySelector(\"ul\");\n this._ul.addEventListener(\"mousedown\", this._optionSelected.bind(this));\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._ul.removeEventListener(\"mousedown\", this._optionSelected);\n }\n\n _optionSelected(e) {\n if (e.target.tagName === \"LI\") {\n this.emitEvent(PfeAutocomplete.events.select, {\n detail: { optionValue: e.target.innerText },\n composed: true\n });\n }\n }\n\n _renderOptions() {\n let options = this.data;\n let ariaAnnounceText = \"\";\n\n if (this._ariaAnnounceTemplate) {\n ariaAnnounceText = this._ariaAnnounceTemplate.replace(\"${numOptions}\", options.length);\n }\n\n this._ariaAnnounce.textContent = ariaAnnounceText;\n this._ariaAnnounce.setAttribute(\"aria-live\", \"polite\");\n\n this._ul.innerHTML = `${options\n .map((item, index) => {\n return `
  • ${item}
  • `;\n })\n .join(\"\")}`;\n }\n\n _activeIndexChanged() {\n if (!this.data || this.data.length === 0 || this.activeIndex === null || this.activeIndex === \"null\") return;\n\n // remove active class\n if (this._ul.querySelector(\".active\")) {\n this._ul.querySelector(\".active\").classList.remove(\"active\");\n }\n\n // add active class to selected option\n let activeOption = this._ul.querySelector(\"li:nth-child(\" + (parseInt(this.activeIndex, 10) + 1) + \")\");\n\n activeOption.classList.add(\"active\");\n\n // scroll to selected element when selected item with keyboard is out of view\n let ulWrapper = this.shadowRoot.querySelector(\".droplist\");\n let activeOptionHeight = activeOption.offsetHeight;\n activeOptionHeight += parseInt(window.getComputedStyle(activeOption).getPropertyValue(\"margin-bottom\"), 10);\n ulWrapper.scrollTop = activeOption.offsetTop - ulWrapper.offsetHeight + activeOptionHeight;\n }\n}\n\nPFElement.create(PfeSearchDroplist);\nPFElement.create(PfeAutocomplete);\n\nexport default PfeAutocomplete;\n"],"names":["KEYCODE","throttle","PfeAutocomplete","PFElement","debounce_timer","title","description","type","prefixed","init_value","is_disabled","button-text","content","namedSlot","items","oneOf","$ref","required","String","Boolean","Number","this","tag","slotElems","shadowRoot","querySelector","assignedNodes","filter","n","nodeType","Node","ELEMENT_NODE","length","_input","tagName","toLowerCase","addEventListener","_inputChanged","bind","_closeDroplist","setAttribute","hasAttribute","error","removeEventListener","_inputKeyUp","events","search","select","_optionSelected","_slot","slotchange","_slotchangeHandler","_clearBtn","_clear","_searchBtn","_search","_searchBtnTextual","oldVal","newVal","value","isDisabled","removeAttribute","loading","_searchBtnText","innerHTML","_inputInit","_dropdown","_ariaAnnounceTemplate","getAttribute","_reset","setTimeout","_sendAutocompleteRequest","_this2","debounce","focus","_doSearch","open","activeIndex","emitEvent","optionsShown","e","selectedValue","detail","optionValue","searchQuery","searchValue","input","autocompleteRequest","query","_autocompleteCallback","response","data","reflow","_openDroplist","parseInt","key","keyCode","optionsLength","_activeOption","_this","_ariaAnnounce","_ul","target","innerText","options","ariaAnnounceText","replace","textContent","map","item","index","join","activeOption","ulWrapper","activeOptionHeight","classList","remove","add","offsetHeight","window","getComputedStyle","getPropertyValue","scrollTop","offsetTop","PfeSearchDroplist","create"],"mappings":"k+CA4BMA,EACG,GADHA,EAEE,GAFFA,EAGA,GAHAA,EAIC,GAIHC,GAAW,EAETC,OAAwBC,s1SAsEnB,kEAIA,+DAIA,gEA1EA,uDAqDA,CAACC,eAAiB,CAACC,MAAQ,WAAWC,YAAc,uEAAuEC,KAAO,SAASC,UAAW,GAAOC,WAAa,CAACJ,MAAQ,gBAAgBC,YAAc,8CAA8CC,KAAO,SAASC,UAAW,GAAOE,YAAc,CAACL,MAAQ,cAAcC,YAAc,oBAAoBC,KAAO,UAAUC,UAAW,GAAOG,cAAc,CAACN,MAAQ,cAAcC,YAAc,2CAA2CC,KAAO,SAASC,UAAW,wCAKpgB,CAACI,QAAU,CAACP,MAAQ,UAAUE,KAAO,QAAQM,WAAY,EAAMC,MAAQ,CAACC,MAAQ,CAAC,CAACC,KAAO,WAAWC,UAAW,sCAI/G,4DAgBA,WACM,OACF,qBACDC,gBACI,6BAEH,OACA,eACDC,iBACG,WACC,8BAEA,OACH,mBACDA,iBACG,WACC,+BAEF,OACD,gBACDC,eACG,mBAEI,OACN,sBACDF,mBAEI,OACH,mBACDA,gBACI,4DAMP,QACMG,KAAKC,2BACLD,KAAKC,oCACCD,KAAKC,8FA8CpBC,EADYF,KAAKG,WAAWC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gB/E,KAAKG,WAAWC,cAAc,+BAE9CoD,YAAc,UACdwB,IAAMhF,KAAKG,WAAWC,cAAc,WACpC4E,IAAIjE,iBAAiB,YAAaf,KAAK2B,gBAAgBV,KAAKjB,+JAK5DgF,IAAI1D,oBAAoB,YAAatB,KAAK2B,yDAGjCgC,GACW,OAArBA,EAAEsB,OAAOpE,cACN4C,UAAU5E,EAAgB2C,OAAOE,OAAQ,QACpC,CAAEoC,YAAaH,EAAEsB,OAAOC,qBACtB,iDAMVC,EAAUnF,KAAKsE,KACfc,EAAmB,GAEnBpF,KAAK8C,0BACY9C,KAAK8C,sBAAsBuC,QAAQ,gBAAiBF,EAAQxE,cAG5EoE,cAAcO,YAAcF,OAC5BL,cAAc5D,aAAa,YAAa,eAExC6D,IAAIrC,aAAewC,EACrBI,IAAI,SAACC,EAAMC,2BACeA,0CAA6CD,OAASA,YAEhFE,KAAK,sDAYJC,EAKAC,EACAC,EAdC7F,KAAKsE,MAA6B,IAArBtE,KAAKsE,KAAK3D,QAAqC,OAArBX,KAAKwD,aAA6C,SAArBxD,KAAKwD,cAG1ExD,KAAKgF,IAAI5E,cAAc,iBACpB4E,IAAI5E,cAAc,WAAW0F,UAAUC,OAAO,WAIjDJ,EAAe3F,KAAKgF,IAAI5E,cAAc,iBAAmBqE,SAASzE,KAAKwD,YAAa,IAAM,GAAK,MAEtFsC,UAAUE,IAAI,UAGvBJ,EAAY5F,KAAKG,WAAWC,cAAc,aAC1CyF,EAAqBF,EAAaM,gBAChBxB,SAASyB,OAAOC,iBAAiBR,GAAcS,iBAAiB,iBAAkB,MAC9FC,UAAYV,EAAaW,UAAYV,EAAUK,aAAeJ,OAhHtEU,2FAkDIA,WAkEVzH,EAAU0H,OAAOD,GACjBzH,EAAU0H,OAAO3H"} \ No newline at end of file diff --git a/elements/pfe-autocomplete/package.json b/elements/pfe-autocomplete/package.json index a6e0c9438f..f365c36dd9 100644 --- a/elements/pfe-autocomplete/package.json +++ b/elements/pfe-autocomplete/package.json @@ -5,7 +5,7 @@ "elementName": "pfe-autocomplete", "preview": "pfe-autocomplete-screenshot.png" }, - "version": "1.2.0", + "version": "1.3.0", "description": "Autocomplete element for PatternFly Elements", "keywords": [ "web-components", @@ -47,10 +47,10 @@ ], "license": "MIT", "dependencies": { - "@patternfly/pfelement": "^1.2.0" + "@patternfly/pfelement": "^1.3.0" }, "devDependencies": { - "@patternfly/pfe-sass": "^1.2.0" + "@patternfly/pfe-sass": "^1.3.0" }, "generator-pfelement-version": "0.5.5", "bugs": { diff --git a/elements/pfe-avatar/dist/pfe-avatar.css.map b/elements/pfe-avatar/dist/pfe-avatar.css.map new file mode 100644 index 0000000000..a8034c9ad1 --- /dev/null +++ b/elements/pfe-avatar/dist/pfe-avatar.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-avatar.scss","../../pfe-sass/functions/_custom-properties.scss","pfe-avatar.css"],"names":[],"mappings":"AAcA;EACE,cAAc;EACd,kBAAkB;EAElB,YC6DkC;ED7DlC,+DC6DkC;ED5DlC,aC4DkC;ED5DlC,gEC4DkC;AC1EpC;;AFSA;EAQI,WAAW;EACX,YAAY;EAEZ,8BAA8B;EAAE,yBAAA;EAChC,iCAAiC;EAAE,YAAA;EACnC,0CAA0C;EAAE,WAAA;EAC5C,+BAA+B;EAAE,kCAAA;EACjC,6BAA0B;EAA1B,0BAA0B;EAAE,4BAAA;EAC5B,wCAAwC;EAAE,OAAA;AER9C;;AFYA;;EAOI,oCAAiD;EAAjD,uFAAiD;AEdrD;;AFkBA;;EAGI,kBAAkB;AEhBtB;;AFqBA;EAEI,aAAa;AEnBjB;;AFiBA;EAMI,cAAc;EACd,WAAW;EACX,YAAY;EACZ,oBAAiB;KAAjB,iBAAiB;AEnBrB;;AFwBA;EACE,aAAa;AErBf;;AFwBA;EACE,aAAa;AErBf","file":"pfe-avatar.css","sourcesContent":["@import \"../../pfe-sass/pfe-sass\";\n\n$LOCAL: avatar;\n$LOCAL-VARIABLES: (\n size: 128px\n);\n\n // TODO: This will be removed at 1.0 in favor of size\n $backwards-compatibility: (\n size: pfe-local(width, $fallback: 128px)\n );\n\n $LOCAL-VARIABLES: map-deep-merge($LOCAL-VARIABLES, $backwards-compatibility);\n\n:host {\n display: block;\n position: relative;\n\n width: pfe-local(size);\n height: pfe-local(size);\n\n canvas {\n width: 100%;\n height: 100%;\n\n image-rendering: optimizeSpeed; /* Older versions of FF */\n image-rendering: -moz-crisp-edges; /* FF 6.0+ */\n image-rendering: -webkit-optimize-contrast; /* Safari */\n image-rendering: -o-crisp-edges; /* OS X & Windows Opera (12.02+) */\n image-rendering: pixelated; /* Awesome future-browsers */\n -ms-interpolation-mode: nearest-neighbor; /* IE */\n }\n}\n\n:host([shape=\"rounded\"]) {\n // When border radius lines up with the size of the avatar's random\n // patterns, it looks nice, so make border-radius the same size as the\n // patterns, ie 1/8th the width of the avatars. add 1px beacuse it looks\n // just a little bit better.\n img,\n canvas {\n border-radius: calc(#{pfe-local(size)} / 8 + 1px);\n }\n}\n\n:host([shape=\"circle\"]) {\n img,\n canvas {\n border-radius: 50%;\n }\n}\n\n// when src attribute is provided, show the img but hide the canvas\n:host([src]) {\n canvas {\n display: none;\n }\n\n img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n}\n\n// when src attribute is not present, hide the img\n:host(:not([src])) img {\n display: none;\n}\n\n:host([hidden]) {\n display: none;\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}",":host {\n display: block;\n position: relative;\n width: var(--pfe-avatar--size, var(--pfe-avatar--width, 128px));\n height: var(--pfe-avatar--size, var(--pfe-avatar--width, 128px));\n}\n\n:host canvas {\n width: 100%;\n height: 100%;\n image-rendering: optimizeSpeed;\n /* Older versions of FF */\n image-rendering: -moz-crisp-edges;\n /* FF 6.0+ */\n image-rendering: -webkit-optimize-contrast;\n /* Safari */\n image-rendering: -o-crisp-edges;\n /* OS X & Windows Opera (12.02+) */\n image-rendering: pixelated;\n /* Awesome future-browsers */\n -ms-interpolation-mode: nearest-neighbor;\n /* IE */\n}\n\n:host([shape=\"rounded\"]) img,\n:host([shape=\"rounded\"]) canvas {\n border-radius: calc(var(--pfe-avatar--size, var(--pfe-avatar--width, 128px)) / 8 + 1px);\n}\n\n:host([shape=\"circle\"]) img,\n:host([shape=\"circle\"]) canvas {\n border-radius: 50%;\n}\n\n:host([src]) canvas {\n display: none;\n}\n\n:host([src]) img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n:host(:not([src])) img {\n display: none;\n}\n\n:host([hidden]) {\n display: none;\n}\n"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-avatar/dist/pfe-avatar.js b/elements/pfe-avatar/dist/pfe-avatar.js new file mode 100644 index 0000000000..4bbfe62571 --- /dev/null +++ b/elements/pfe-avatar/dist/pfe-avatar.js @@ -0,0 +1,483 @@ +import PFElement from '../../pfelement/dist/pfelement.js'; + +/** + * djb2 string hashing function. + * + * @see http://www.cse.yorku.ca/~oz/hash.html + * @param {String} str the string to hash. + * @return {Number} a positive integer + */ + +function hash(str) { + let hash = 5381; + let i = str.length; + + while (i) { + hash = (hash * 33) ^ str.charCodeAt(--i); + } + + return hash >>> 0; +} + +function h2rgb(v1, v2, vH) { + if (vH < 0) vH += 1; + if (vH > 1) vH -= 1; + if (6 * vH < 1) return v1 + (v2 - v1) * 6 * vH; + if (2 * vH < 1) return v2; + if (3 * vH < 2) return v1 + (v2 - v1) * (2 / 3 - vH) * 6; + return v1; +} + +/** + * Convert an HSL color to RGB. + * + * @param {Number} H the hue component + * @param {Number} S the saturation component + * @param {Number} L the luminance component + * @return {Array} [R, G, B] + * + * @see https://www.easyrgb.com/en/math.php + */ +function hsl2rgb(_H, _S, _L) { + let R, G, B; + + const H = Math.max(0, Math.min(1, _H)); + const S = Math.max(0, Math.min(1, _S)); + const L = Math.max(0, Math.min(1, _L)); + + if (S == 0) { + R = L * 255; + G = L * 255; + B = L * 255; + } else { + let a, b; + + if (L < 0.5) { + b = L * (1 + S); + } else { + b = L + S - S * L; + } + + a = 2 * L - b; + + R = Math.floor(255 * h2rgb(a, b, H + 1 / 3)); + G = Math.floor(255 * h2rgb(a, b, H)); + B = Math.floor(255 * h2rgb(a, b, H - 1 / 3)); + } + + return [R, G, B]; +} + +/** + * Convert an RGBcolor to HSL. + * + * @param {Number} R the red component + * @param {Number} G the green component + * @param {Number} B the blue component + * @return {Array} [H, S, L] + * + * @see https://www.easyrgb.com/en/math.php + */ +function rgb2hsl(_R, _G, _B) { + let H, S, L; + + const R = Math.max(0, Math.min(255, _R)); + const G = Math.max(0, Math.min(255, _G)); + const B = Math.max(0, Math.min(255, _B)); + + const r = R / 255; + const g = G / 255; + const b = B / 255; + + const var_min = Math.min(Math.min(r, g), b); + const var_max = Math.max(Math.max(r, g), b); + const del_max = var_max - var_min; + + L = (var_max + var_min) / 2; + + if (del_max === 0) { + H = 0; + S = 0; + } else { + if (L < 0.5) { + S = del_max / (var_max + var_min); + } else { + S = del_max / (2 - var_max - var_min); + } + + const del_r = ((var_max - r) / 6 + del_max / 2) / del_max; + const del_g = ((var_max - g) / 6 + del_max / 2) / del_max; + const del_b = ((var_max - b) / 6 + del_max / 2) / del_max; + + if (r == var_max) { + H = del_b - del_g; + } else if (g == var_max) { + H = 1 / 3 + del_r - del_b; + } else if (b == var_max) { + H = 2 / 3 + del_g - del_r; + } + + if (H < 0) { + H += 1; + } else if (H > 1) { + H -= 1; + } + } + + return [H, S, L]; +} + +/*! + * PatternFly Elements: PfeAvatar 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/ + +class PfeAvatar extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + + +`; + } + + static get tag() { + return "pfe-avatar"; + } + + static get properties() { + return { + name: { + title: "Username", + type: String, + default: "", + observer: "_updateWhenConnected" + }, + src: { + title: "Avatar image URL", + type: String, + observer: "_updateWhenConnected" + }, + pattern: { + title: "Shape pattern", + type: String, + default: PfeAvatar.patterns.squares, + observer: "_updateWhenConnected" + }, + // @TODO Deprecated pfe-name in 1.0 + oldName: { + alias: "name", + attr: "pfe-name" + }, + // @TODO Deprecated pfe-src in 1.0 + oldSrc: { + alias: "src", + attr: "pfe-src" + }, + // @TODO Deprecated pfe-pattern in 1.0 + oldPattern: { + alias: "pattern", + attr: "pfe-pattern" + } + }; + } + + get templateUrl() { + return "pfe-avatar.html"; + } + + get styleUrl() { + return "pfe-avatar.scss"; + } + + static get events() { + return { + connected: `${this.tag}:connected` + }; + } + + static get patterns() { + return { + triangles: "triangles", + squares: "squares" + }; + } + + static get defaultSize() { + return 128; + } + + static get defaultColors() { + return "#67accf #448087 #709c6b #a35252 #826cbb"; + } + + get customColors() { + return this.cssVariable("pfe-avatar--colors"); + } + + constructor() { + super(PfeAvatar); + + this._initCanvas = this._initCanvas.bind(this); + } + + connectedCallback() { + // initCanvas comes before parent's connectedCallback because the + // connectedCallback sets attribute values, triggering, the observer + // functions, which require the canvas to already be initialized. + this._initCanvas(); + + super.connectedCallback(); + + this.emitEvent(PfeAvatar.events.connected, { + bubbles: false + }); + } + + _initCanvas() { + this._canvas = this.shadowRoot.querySelector("canvas"); + const cssVarWidth = this.cssVariable("pfe-avatar--width"); + const size = (cssVarWidth && cssVarWidth.replace(/px$/, "")) || PfeAvatar.defaultSize; + this._canvas.width = size; + this._canvas.height = size; + + this._squareSize = this._canvas.width / 8; + this._triangleSize = this._canvas.width / 4; + + this._ctx = this._canvas.getContext("2d"); + } + + static _registerColors() { + this.colors = []; + const contextColors = this.customColors || this.defaultColors; + + contextColors.split(/\s+/).forEach(colorCode => { + let pattern; + switch (colorCode.length) { + case 4: // ex: "#0fc" + pattern = /^#([A-f0-9])([A-f0-9])([A-f0-9])$/.exec(colorCode); + if (pattern) { + pattern.shift(); + const color = pattern.map(c => parseInt(c + c, 16)); + this._registerColor(color); + } else { + this.log(`[pfe-avatar] invalid color ${colorCode}`); + } + break; + case 7: // ex: "#00ffcc" + pattern = /^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/.exec(colorCode); + if (pattern) { + pattern.shift(); + const color = pattern.map(c => parseInt(c, 16)); + this._registerColor(color); + } else { + this.log(`[pfe-avatar] invalid color ${colorCode}`); + } + } + }); + + return this.colors; + } + + static _registerColor(color) { + PfeAvatar.colors.push({ + color1: `rgb(${color.join(",")})`, + color2: `rgb(${this._adjustColor(color).join(",")})` + }); + } + + static _adjustColor(color) { + const dark = 0.1; + const l_adj = 0.1; // luminance adjustment + const hsl = rgb2hsl(...color); + + // if luminance is too dark already, then lighten the alternate color + // instead of darkening it. + hsl[2] += hsl[2] > dark ? -l_adj : l_adj; + + return hsl2rgb(...hsl); + } + + _updateWhenConnected() { + if (this.hasAttribute("pfelement")) { + this.update(); + } else { + this.addEventListener(PfeAvatar.events.connected, () => this.update()); + } + } + + update() { + // if we have a src element, update the img, otherwise update the random pattern + if (this.src) { + this.shadowRoot.querySelector("img").src = this.src; + } else { + const bitPattern = hash(this.name).toString(2); + const arrPattern = bitPattern.split("").map(n => Number(n)); + this._colorIndex = Math.floor((PfeAvatar.colors.length * parseInt(bitPattern, 2)) / Math.pow(2, 32)); + this.color1 = PfeAvatar.colors[this._colorIndex].color1; + this.color2 = PfeAvatar.colors[this._colorIndex].color2; + + this._clear(); + this._drawBackground(); + if (this.pattern === PfeAvatar.patterns.squares) { + this._drawSquarePattern(arrPattern); + } else if (this.pattern === PfeAvatar.patterns.triangles) { + this._drawTrianglePattern(arrPattern); + } + // this._drawGradient(); + } + } + + _clear() { + this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height); + } + + _drawBackground() { + this._ctx.fillStyle = this.color1; + this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); + } + + _drawSquarePattern(pattern) { + this._ctx.fillStyle = this.color2; + if (this._ctx) { + let i = pattern.length; + while (i--) { + if (pattern[i]) { + this._drawMirroredSquare(i % 4, Math.floor(i / 4)); + } + } + } + } + + /** + * Draw a square at the given position, mirrored onto both the left and right half of the canvas. + */ + _drawMirroredSquare(x, y) { + if (this._ctx) { + this._drawSquare(x, y); + this._drawSquare(7 - x, y); + } + } + + _drawSquare(x, y) { + this._ctx.fillRect(this._squareSize * x, this._squareSize * y, this._squareSize, this._squareSize); + } + + _drawTrianglePattern(pattern) { + this._ctx.fillStyle = this.color2; + if (this._ctx) { + let i = pattern.length; + while (i--) { + if (pattern[i]) { + const x = Math.floor(i / 2) % 2; + const y = Math.floor(i / 4); + const alt = i % 4; + + const p1 = [x, y]; + const p2 = [x, y]; + const p3 = [x, y]; + + switch (alt) { + case 0: + p2[1]++; + p3[0]++; + p3[1]++; + break; + case 1: + p2[0]++; + p3[0]++; + p3[1]++; + break; + case 2: + p2[0]++; + p3[1]++; + break; + case 3: + p1[0]++; + p2[0]++; + p2[1]++; + p3[1]++; + break; + } + + this._drawMirroredTriangle(p1, p2, p3); + } + } + } + } + + /** + * Draw a square at the given position in the top-left quadrant of the + * canvas, and mirrored to the other three quadrants. + */ + _drawMirroredTriangle(p1, p2, p3) { + if (this._ctx) { + this._drawTriangle(p1, p2, p3); + this._drawTriangle([4 - p1[0], p1[1]], [4 - p2[0], p2[1]], [4 - p3[0], p3[1]]); + } + } + + _drawTriangle(p1, p2, p3) { + this._ctx.beginPath(); + this._ctx.moveTo(...p1.map(c => c * this._triangleSize)); + this._ctx.lineTo(...p2.map(c => c * this._triangleSize)); + this._ctx.lineTo(...p3.map(c => c * this._triangleSize)); + this._ctx.closePath(); + this._ctx.fill(); + this._ctx.fill(); + } + + _drawGradient() { + const gradient = this._ctx.createLinearGradient(0, this._canvas.height, this._canvas.width, 0); + const color = this.color2; + let gradientColor1 = color; + let gradientColor2 = color; + if (/^#[A-f0-9]{3}$/.test(color)) { + // color is of the form "#fff" + gradientColor1 += "c"; + gradientColor2 += "0"; + } else if (/^#[A-f0-9]{6}$/.test(color)) { + // color is of the form "#ffffff" + gradientColor1 += "cc"; + gradientColor2 += "00"; + } + gradient.addColorStop(0, gradientColor1); + gradient.addColorStop(1, gradientColor2); + gradient.addColorStop(1, gradientColor1); + this._ctx.fillStyle = gradient; + this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); + } +} + +PfeAvatar._registerColors(); + +PFElement.create(PfeAvatar); + +export default PfeAvatar; +//# sourceMappingURL=pfe-avatar.js.map diff --git a/elements/pfe-avatar/dist/pfe-avatar.js.map b/elements/pfe-avatar/dist/pfe-avatar.js.map new file mode 100644 index 0000000000..3229b3233f --- /dev/null +++ b/elements/pfe-avatar/dist/pfe-avatar.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-avatar.js","sources":["../_temp/djb-hash.js","../_temp/hslrgb.js","../_temp/pfe-avatar.js"],"sourcesContent":["/**\n * djb2 string hashing function.\n *\n * @see http://www.cse.yorku.ca/~oz/hash.html\n * @param {String} str the string to hash.\n * @return {Number} a positive integer\n */\n\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n\n while (i) {\n hash = (hash * 33) ^ str.charCodeAt(--i);\n }\n\n return hash >>> 0;\n}\n\nexport { hash };\n","function h2rgb(v1, v2, vH) {\n if (vH < 0) vH += 1;\n if (vH > 1) vH -= 1;\n if (6 * vH < 1) return v1 + (v2 - v1) * 6 * vH;\n if (2 * vH < 1) return v2;\n if (3 * vH < 2) return v1 + (v2 - v1) * (2 / 3 - vH) * 6;\n return v1;\n}\n\n/**\n * Convert an HSL color to RGB.\n *\n * @param {Number} H the hue component\n * @param {Number} S the saturation component\n * @param {Number} L the luminance component\n * @return {Array} [R, G, B]\n *\n * @see https://www.easyrgb.com/en/math.php\n */\nexport function hsl2rgb(_H, _S, _L) {\n let R, G, B;\n\n const H = Math.max(0, Math.min(1, _H));\n const S = Math.max(0, Math.min(1, _S));\n const L = Math.max(0, Math.min(1, _L));\n\n if (S == 0) {\n R = L * 255;\n G = L * 255;\n B = L * 255;\n } else {\n let a, b;\n\n if (L < 0.5) {\n b = L * (1 + S);\n } else {\n b = L + S - S * L;\n }\n\n a = 2 * L - b;\n\n R = Math.floor(255 * h2rgb(a, b, H + 1 / 3));\n G = Math.floor(255 * h2rgb(a, b, H));\n B = Math.floor(255 * h2rgb(a, b, H - 1 / 3));\n }\n\n return [R, G, B];\n}\n\n/**\n * Convert an RGBcolor to HSL.\n *\n * @param {Number} R the red component\n * @param {Number} G the green component\n * @param {Number} B the blue component\n * @return {Array} [H, S, L]\n *\n * @see https://www.easyrgb.com/en/math.php\n */\nexport function rgb2hsl(_R, _G, _B) {\n let H, S, L;\n\n const R = Math.max(0, Math.min(255, _R));\n const G = Math.max(0, Math.min(255, _G));\n const B = Math.max(0, Math.min(255, _B));\n\n const r = R / 255;\n const g = G / 255;\n const b = B / 255;\n\n const var_min = Math.min(Math.min(r, g), b);\n const var_max = Math.max(Math.max(r, g), b);\n const del_max = var_max - var_min;\n\n L = (var_max + var_min) / 2;\n\n if (del_max === 0) {\n H = 0;\n S = 0;\n } else {\n if (L < 0.5) {\n S = del_max / (var_max + var_min);\n } else {\n S = del_max / (2 - var_max - var_min);\n }\n\n const del_r = ((var_max - r) / 6 + del_max / 2) / del_max;\n const del_g = ((var_max - g) / 6 + del_max / 2) / del_max;\n const del_b = ((var_max - b) / 6 + del_max / 2) / del_max;\n\n if (r == var_max) {\n H = del_b - del_g;\n } else if (g == var_max) {\n H = 1 / 3 + del_r - del_b;\n } else if (b == var_max) {\n H = 2 / 3 + del_g - del_r;\n }\n\n if (H < 0) {\n H += 1;\n } else if (H > 1) {\n H -= 1;\n }\n }\n\n return [H, S, L];\n}\n","/*!\n * PatternFly Elements: PfeAvatar 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\nimport { hash } from \"./djb-hash.js\";\nimport { hsl2rgb, rgb2hsl } from \"./hslrgb.js\";\n\nclass PfeAvatar extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n\n`;\n }\n\n static get tag() {\n return \"pfe-avatar\";\n }\n\n static get properties() {\n return {\n name: {\n title: \"Username\",\n type: String,\n default: \"\",\n observer: \"_updateWhenConnected\"\n },\n src: {\n title: \"Avatar image URL\",\n type: String,\n observer: \"_updateWhenConnected\"\n },\n pattern: {\n title: \"Shape pattern\",\n type: String,\n default: PfeAvatar.patterns.squares,\n observer: \"_updateWhenConnected\"\n },\n // @TODO Deprecated pfe-name in 1.0\n oldName: {\n alias: \"name\",\n attr: \"pfe-name\"\n },\n // @TODO Deprecated pfe-src in 1.0\n oldSrc: {\n alias: \"src\",\n attr: \"pfe-src\"\n },\n // @TODO Deprecated pfe-pattern in 1.0\n oldPattern: {\n alias: \"pattern\",\n attr: \"pfe-pattern\"\n }\n };\n }\n\n get templateUrl() {\n return \"pfe-avatar.html\";\n }\n\n get styleUrl() {\n return \"pfe-avatar.scss\";\n }\n\n static get events() {\n return {\n connected: `${this.tag}:connected`\n };\n }\n\n static get patterns() {\n return {\n triangles: \"triangles\",\n squares: \"squares\"\n };\n }\n\n static get defaultSize() {\n return 128;\n }\n\n static get defaultColors() {\n return \"#67accf #448087 #709c6b #a35252 #826cbb\";\n }\n\n get customColors() {\n return this.cssVariable(\"pfe-avatar--colors\");\n }\n\n constructor() {\n super(PfeAvatar);\n\n this._initCanvas = this._initCanvas.bind(this);\n }\n\n connectedCallback() {\n // initCanvas comes before parent's connectedCallback because the\n // connectedCallback sets attribute values, triggering, the observer\n // functions, which require the canvas to already be initialized.\n this._initCanvas();\n\n super.connectedCallback();\n\n this.emitEvent(PfeAvatar.events.connected, {\n bubbles: false\n });\n }\n\n _initCanvas() {\n this._canvas = this.shadowRoot.querySelector(\"canvas\");\n const cssVarWidth = this.cssVariable(\"pfe-avatar--width\");\n const size = (cssVarWidth && cssVarWidth.replace(/px$/, \"\")) || PfeAvatar.defaultSize;\n this._canvas.width = size;\n this._canvas.height = size;\n\n this._squareSize = this._canvas.width / 8;\n this._triangleSize = this._canvas.width / 4;\n\n this._ctx = this._canvas.getContext(\"2d\");\n }\n\n static _registerColors() {\n this.colors = [];\n const contextColors = this.customColors || this.defaultColors;\n\n contextColors.split(/\\s+/).forEach(colorCode => {\n let pattern;\n switch (colorCode.length) {\n case 4: // ex: \"#0fc\"\n pattern = /^#([A-f0-9])([A-f0-9])([A-f0-9])$/.exec(colorCode);\n if (pattern) {\n pattern.shift();\n const color = pattern.map(c => parseInt(c + c, 16));\n this._registerColor(color);\n } else {\n this.log(`[pfe-avatar] invalid color ${colorCode}`);\n }\n break;\n case 7: // ex: \"#00ffcc\"\n pattern = /^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/.exec(colorCode);\n if (pattern) {\n pattern.shift();\n const color = pattern.map(c => parseInt(c, 16));\n this._registerColor(color);\n } else {\n this.log(`[pfe-avatar] invalid color ${colorCode}`);\n }\n }\n });\n\n return this.colors;\n }\n\n static _registerColor(color) {\n PfeAvatar.colors.push({\n color1: `rgb(${color.join(\",\")})`,\n color2: `rgb(${this._adjustColor(color).join(\",\")})`\n });\n }\n\n static _adjustColor(color) {\n const dark = 0.1;\n const l_adj = 0.1; // luminance adjustment\n const hsl = rgb2hsl(...color);\n\n // if luminance is too dark already, then lighten the alternate color\n // instead of darkening it.\n hsl[2] += hsl[2] > dark ? -l_adj : l_adj;\n\n return hsl2rgb(...hsl);\n }\n\n _updateWhenConnected() {\n if (this.hasAttribute(\"pfelement\")) {\n this.update();\n } else {\n this.addEventListener(PfeAvatar.events.connected, () => this.update());\n }\n }\n\n update() {\n // if we have a src element, update the img, otherwise update the random pattern\n if (this.src) {\n this.shadowRoot.querySelector(\"img\").src = this.src;\n } else {\n const bitPattern = hash(this.name).toString(2);\n const arrPattern = bitPattern.split(\"\").map(n => Number(n));\n this._colorIndex = Math.floor((PfeAvatar.colors.length * parseInt(bitPattern, 2)) / Math.pow(2, 32));\n this.color1 = PfeAvatar.colors[this._colorIndex].color1;\n this.color2 = PfeAvatar.colors[this._colorIndex].color2;\n\n this._clear();\n this._drawBackground();\n if (this.pattern === PfeAvatar.patterns.squares) {\n this._drawSquarePattern(arrPattern);\n } else if (this.pattern === PfeAvatar.patterns.triangles) {\n this._drawTrianglePattern(arrPattern);\n }\n // this._drawGradient();\n }\n }\n\n _clear() {\n this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n }\n\n _drawBackground() {\n this._ctx.fillStyle = this.color1;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n\n _drawSquarePattern(pattern) {\n this._ctx.fillStyle = this.color2;\n if (this._ctx) {\n let i = pattern.length;\n while (i--) {\n if (pattern[i]) {\n this._drawMirroredSquare(i % 4, Math.floor(i / 4));\n }\n }\n }\n }\n\n /**\n * Draw a square at the given position, mirrored onto both the left and right half of the canvas.\n */\n _drawMirroredSquare(x, y) {\n if (this._ctx) {\n this._drawSquare(x, y);\n this._drawSquare(7 - x, y);\n }\n }\n\n _drawSquare(x, y) {\n this._ctx.fillRect(this._squareSize * x, this._squareSize * y, this._squareSize, this._squareSize);\n }\n\n _drawTrianglePattern(pattern) {\n this._ctx.fillStyle = this.color2;\n if (this._ctx) {\n let i = pattern.length;\n while (i--) {\n if (pattern[i]) {\n const x = Math.floor(i / 2) % 2;\n const y = Math.floor(i / 4);\n const alt = i % 4;\n\n const p1 = [x, y];\n const p2 = [x, y];\n const p3 = [x, y];\n\n switch (alt) {\n case 0:\n p2[1]++;\n p3[0]++;\n p3[1]++;\n break;\n case 1:\n p2[0]++;\n p3[0]++;\n p3[1]++;\n break;\n case 2:\n p2[0]++;\n p3[1]++;\n break;\n case 3:\n p1[0]++;\n p2[0]++;\n p2[1]++;\n p3[1]++;\n break;\n }\n\n this._drawMirroredTriangle(p1, p2, p3);\n }\n }\n }\n }\n\n /**\n * Draw a square at the given position in the top-left quadrant of the\n * canvas, and mirrored to the other three quadrants.\n */\n _drawMirroredTriangle(p1, p2, p3) {\n if (this._ctx) {\n this._drawTriangle(p1, p2, p3);\n this._drawTriangle([4 - p1[0], p1[1]], [4 - p2[0], p2[1]], [4 - p3[0], p3[1]]);\n }\n }\n\n _drawTriangle(p1, p2, p3) {\n this._ctx.beginPath();\n this._ctx.moveTo(...p1.map(c => c * this._triangleSize));\n this._ctx.lineTo(...p2.map(c => c * this._triangleSize));\n this._ctx.lineTo(...p3.map(c => c * this._triangleSize));\n this._ctx.closePath();\n this._ctx.fill();\n this._ctx.fill();\n }\n\n _drawGradient() {\n const gradient = this._ctx.createLinearGradient(0, this._canvas.height, this._canvas.width, 0);\n const color = this.color2;\n let gradientColor1 = color;\n let gradientColor2 = color;\n if (/^#[A-f0-9]{3}$/.test(color)) {\n // color is of the form \"#fff\"\n gradientColor1 += \"c\";\n gradientColor2 += \"0\";\n } else if (/^#[A-f0-9]{6}$/.test(color)) {\n // color is of the form \"#ffffff\"\n gradientColor1 += \"cc\";\n gradientColor2 += \"00\";\n }\n gradient.addColorStop(0, gradientColor1);\n gradient.addColorStop(1, gradientColor2);\n gradient.addColorStop(1, gradientColor1);\n this._ctx.fillStyle = gradient;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n}\n\nPfeAvatar._registerColors();\n\nPFElement.create(PfeAvatar);\n\nexport default PfeAvatar;\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI,CAAC,GAAG,EAAE;AACnB,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC;AAClB,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;AACrB;AACA,EAAE,OAAO,CAAC,EAAE;AACZ,IAAI,IAAI,GAAG,CAAC,IAAI,GAAG,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7C,GAAG;AACH;AACA,EAAE,OAAO,IAAI,KAAK,CAAC,CAAC;AACpB;;ACjBA,SAAS,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;AAC3B,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AACtB,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AACtB,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAA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AAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;AAC7C;AACA,MAAM,cAAc,IAAI,IAAI,CAAC;AAC7B,MAAM,cAAc,IAAI,IAAI,CAAC;AAC7B,KAAK;AACL,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;AAC7C,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;AAC7C,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;AAC7C,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;AACnC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACtE,GAAG;AACH,CAAC;AACD;AACA,SAAS,CAAC,eAAe,EAAE,CAAC;AAC5B;AACA,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/elements/pfe-avatar/dist/pfe-avatar.min.css.map b/elements/pfe-avatar/dist/pfe-avatar.min.css.map new file mode 100644 index 0000000000..8411683229 --- /dev/null +++ b/elements/pfe-avatar/dist/pfe-avatar.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/pfe-avatar.scss","pfe-avatar.css"],"names":[],"mappings":"AAcA,MACE,QAAA,MACA,SAAA,SAEA,MAAA,MAAA,MAAA,uDACA,OAAA,MAAA,OAAA,uDALF,aAQI,MAAA,KACA,OAAA,KAEA,gBAAA,cACA,gBAAA,iBACA,gBAAA,0BACA,gBAAA,eACA,gBAAA,aAAA,gBAAA,UACA,uBAAA,iBCFJ,8BDMA,2BAOI,cAAA,sBAAA,cAAA,sECPJ,6BDWA,0BAGI,cAAA,IAKJ,oBAEI,QAAA,KAFJ,iBAMI,QAAA,MACA,MAAA,KACA,OAAA,KACA,cAAA,MAAA,WAAA,MAKJ,uBACE,QAAA,KAGF,gBACE,QAAA","file":"pfe-avatar.min.css","sourceRoot":"../src","sourcesContent":[null,":host {\n display: block;\n position: relative;\n width: 128px;\n width: var(--pfe-avatar--size, var(--pfe-avatar--width, 128px));\n height: 128px;\n height: var(--pfe-avatar--size, var(--pfe-avatar--width, 128px));\n}\n\n:host canvas {\n width: 100%;\n height: 100%;\n image-rendering: optimizeSpeed;\n /* Older versions of FF */\n image-rendering: -moz-crisp-edges;\n /* FF 6.0+ */\n image-rendering: -webkit-optimize-contrast;\n /* Safari */\n image-rendering: -o-crisp-edges;\n /* OS X & Windows Opera (12.02+) */\n image-rendering: -o-pixelated;\n image-rendering: pixelated;\n /* Awesome future-browsers */\n -ms-interpolation-mode: nearest-neighbor;\n /* IE */\n}\n\n:host([shape=\"rounded\"]) img,\n:host([shape=\"rounded\"]) canvas {\n border-radius: calc(128px / 8 + 1px);\n border-radius: calc(var(--pfe-avatar--size, var(--pfe-avatar--width, 128px)) / 8 + 1px);\n}\n\n:host([shape=\"circle\"]) img,\n:host([shape=\"circle\"]) canvas {\n border-radius: 50%;\n}\n\n:host([src]) canvas {\n display: none;\n}\n\n:host([src]) img {\n display: block;\n width: 100%;\n height: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n}\n\n:host(:not([src])) img {\n display: none;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n/*# sourceMappingURL=pfe-avatar.css.map */\n"]} \ No newline at end of file diff --git a/elements/pfe-avatar/dist/pfe-avatar.min.js b/elements/pfe-avatar/dist/pfe-avatar.min.js new file mode 100644 index 0000000000..ce1808b392 --- /dev/null +++ b/elements/pfe-avatar/dist/pfe-avatar.min.js @@ -0,0 +1,27 @@ +import t from"../../pfelement/dist/pfelement.min.js";function e(t,e,a){return a<0&&(a+=1),a>1&&(a-=1),6*a<1?t+6*(e-t)*a:2*a<1?e:3*a<2?t+(e-t)*(2/3-a)*6:t} +/*! + * PatternFly Elements: PfeAvatar 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/ +class a extends t{static get version(){return"1.3.0"}get html(){return"\n\n\n"}static get tag(){return"pfe-avatar"}static get properties(){return{name:{title:"Username",type:String,default:"",observer:"_updateWhenConnected"},src:{title:"Avatar image URL",type:String,observer:"_updateWhenConnected"},pattern:{title:"Shape pattern",type:String,default:a.patterns.squares,observer:"_updateWhenConnected"},oldName:{alias:"name",attr:"pfe-name"},oldSrc:{alias:"src",attr:"pfe-src"},oldPattern:{alias:"pattern",attr:"pfe-pattern"}}}get templateUrl(){return"pfe-avatar.html"}get styleUrl(){return"pfe-avatar.scss"}static get events(){return{connected:`${this.tag}:connected`}}static get patterns(){return{triangles:"triangles",squares:"squares"}}static get defaultSize(){return 128}static get defaultColors(){return"#67accf #448087 #709c6b #a35252 #826cbb"}get customColors(){return this.cssVariable("pfe-avatar--colors")}constructor(){super(a),this._initCanvas=this._initCanvas.bind(this)}connectedCallback(){this._initCanvas(),super.connectedCallback(),this.emitEvent(a.events.connected,{bubbles:!1})}_initCanvas(){this._canvas=this.shadowRoot.querySelector("canvas");const t=this.cssVariable("pfe-avatar--width"),e=t&&t.replace(/px$/,"")||a.defaultSize;this._canvas.width=e,this._canvas.height=e,this._squareSize=this._canvas.width/8,this._triangleSize=this._canvas.width/4,this._ctx=this._canvas.getContext("2d")}static _registerColors(){return this.colors=[],(this.customColors||this.defaultColors).split(/\s+/).forEach(t=>{let e;switch(t.length){case 4:if(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/.exec(t)){e.shift();const t=e.map(t=>parseInt(t+t,16));this._registerColor(t)}else this.log(`[pfe-avatar] invalid color ${t}`);break;case 7:if(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/.exec(t)){e.shift();const t=e.map(t=>parseInt(t,16));this._registerColor(t)}else this.log(`[pfe-avatar] invalid color ${t}`)}}),this.colors}static _registerColor(t){a.colors.push({color1:`rgb(${t.join(",")})`,color2:`rgb(${this._adjustColor(t).join(",")})`})}static _adjustColor(t){const a=function(t,e,a){let i,r,s;const n=Math.max(0,Math.min(255,t))/255,o=Math.max(0,Math.min(255,e))/255,h=Math.max(0,Math.min(255,a))/255,c=Math.min(Math.min(n,o),h),l=Math.max(Math.max(n,o),h),d=l-c;if(s=(l+c)/2,0===d)i=0,r=0;else{r=s<.5?d/(l+c):d/(2-l-c);const t=((l-n)/6+d/2)/d,e=((l-o)/6+d/2)/d,a=((l-h)/6+d/2)/d;n==l?i=a-e:o==l?i=1/3+t-a:h==l&&(i=2/3+e-t),i<0?i+=1:i>1&&(i-=1)}return[i,r,s]}(...t);return a[2]+=a[2]>.1?-.1:.1,function(t,a,i){let r,s,n;const o=Math.max(0,Math.min(1,t)),h=Math.max(0,Math.min(1,a)),c=Math.max(0,Math.min(1,i));if(0==h)r=255*c,s=255*c,n=255*c;else{let t,a;t=2*c-(a=c<.5?c*(1+h):c+h-h*c),r=Math.floor(255*e(t,a,o+1/3)),s=Math.floor(255*e(t,a,o)),n=Math.floor(255*e(t,a,o-1/3))}return[r,s,n]}(...a)}_updateWhenConnected(){this.hasAttribute("pfelement")?this.update():this.addEventListener(a.events.connected,()=>this.update())}update(){if(this.src)this.shadowRoot.querySelector("img").src=this.src;else{const t=function(t){let e=5381,a=t.length;for(;a;)e=33*e^t.charCodeAt(--a);return e>>>0}(this.name).toString(2),e=t.split("").map(t=>Number(t));this._colorIndex=Math.floor(a.colors.length*parseInt(t,2)/Math.pow(2,32)),this.color1=a.colors[this._colorIndex].color1,this.color2=a.colors[this._colorIndex].color2,this._clear(),this._drawBackground(),this.pattern===a.patterns.squares?this._drawSquarePattern(e):this.pattern===a.patterns.triangles&&this._drawTrianglePattern(e)}}_clear(){this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height)}_drawBackground(){this._ctx.fillStyle=this.color1,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)}_drawSquarePattern(t){if(this._ctx.fillStyle=this.color2,this._ctx){let e=t.length;for(;e--;)t[e]&&this._drawMirroredSquare(e%4,Math.floor(e/4))}}_drawMirroredSquare(t,e){this._ctx&&(this._drawSquare(t,e),this._drawSquare(7-t,e))}_drawSquare(t,e){this._ctx.fillRect(this._squareSize*t,this._squareSize*e,this._squareSize,this._squareSize)}_drawTrianglePattern(t){if(this._ctx.fillStyle=this.color2,this._ctx){let e=t.length;for(;e--;)if(t[e]){const t=Math.floor(e/2)%2,a=Math.floor(e/4),i=[t,a],r=[t,a],s=[t,a];switch(e%4){case 0:r[1]++,s[0]++,s[1]++;break;case 1:r[0]++,s[0]++,s[1]++;break;case 2:r[0]++,s[1]++;break;case 3:i[0]++,r[0]++,r[1]++,s[1]++}this._drawMirroredTriangle(i,r,s)}}}_drawMirroredTriangle(t,e,a){this._ctx&&(this._drawTriangle(t,e,a),this._drawTriangle([4-t[0],t[1]],[4-e[0],e[1]],[4-a[0],a[1]]))}_drawTriangle(t,e,a){this._ctx.beginPath(),this._ctx.moveTo(...t.map(t=>t*this._triangleSize)),this._ctx.lineTo(...e.map(t=>t*this._triangleSize)),this._ctx.lineTo(...a.map(t=>t*this._triangleSize)),this._ctx.closePath(),this._ctx.fill(),this._ctx.fill()}_drawGradient(){const t=this._ctx.createLinearGradient(0,this._canvas.height,this._canvas.width,0),e=this.color2;let a=e,i=e;/^#[A-f0-9]{3}$/.test(e)?(a+="c",i+="0"):/^#[A-f0-9]{6}$/.test(e)&&(a+="cc",i+="00"),t.addColorStop(0,a),t.addColorStop(1,i),t.addColorStop(1,a),this._ctx.fillStyle=t,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)}}a._registerColors(),t.create(a);export default a; +//# sourceMappingURL=pfe-avatar.min.js.map diff --git a/elements/pfe-avatar/dist/pfe-avatar.min.js.map b/elements/pfe-avatar/dist/pfe-avatar.min.js.map new file mode 100644 index 0000000000..8215bde74b --- /dev/null +++ b/elements/pfe-avatar/dist/pfe-avatar.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-avatar.min.js","sources":["../_temp/hslrgb.js","../_temp/pfe-avatar.js","../_temp/djb-hash.js"],"sourcesContent":["function h2rgb(v1, v2, vH) {\n if (vH < 0) vH += 1;\n if (vH > 1) vH -= 1;\n if (6 * vH < 1) return v1 + (v2 - v1) * 6 * vH;\n if (2 * vH < 1) return v2;\n if (3 * vH < 2) return v1 + (v2 - v1) * (2 / 3 - vH) * 6;\n return v1;\n}\n\n/**\n * Convert an HSL color to RGB.\n *\n * @param {Number} H the hue component\n * @param {Number} S the saturation component\n * @param {Number} L the luminance component\n * @return {Array} [R, G, B]\n *\n * @see https://www.easyrgb.com/en/math.php\n */\nexport function hsl2rgb(_H, _S, _L) {\n let R, G, B;\n\n const H = Math.max(0, Math.min(1, _H));\n const S = Math.max(0, Math.min(1, _S));\n const L = Math.max(0, Math.min(1, _L));\n\n if (S == 0) {\n R = L * 255;\n G = L * 255;\n B = L * 255;\n } else {\n let a, b;\n\n if (L < 0.5) {\n b = L * (1 + S);\n } else {\n b = L + S - S * L;\n }\n\n a = 2 * L - b;\n\n R = Math.floor(255 * h2rgb(a, b, H + 1 / 3));\n G = Math.floor(255 * h2rgb(a, b, H));\n B = Math.floor(255 * h2rgb(a, b, H - 1 / 3));\n }\n\n return [R, G, B];\n}\n\n/**\n * Convert an RGBcolor to HSL.\n *\n * @param {Number} R the red component\n * @param {Number} G the green component\n * @param {Number} B the blue component\n * @return {Array} [H, S, L]\n *\n * @see https://www.easyrgb.com/en/math.php\n */\nexport function rgb2hsl(_R, _G, _B) {\n let H, S, L;\n\n const R = Math.max(0, Math.min(255, _R));\n const G = Math.max(0, Math.min(255, _G));\n const B = Math.max(0, Math.min(255, _B));\n\n const r = R / 255;\n const g = G / 255;\n const b = B / 255;\n\n const var_min = Math.min(Math.min(r, g), b);\n const var_max = Math.max(Math.max(r, g), b);\n const del_max = var_max - var_min;\n\n L = (var_max + var_min) / 2;\n\n if (del_max === 0) {\n H = 0;\n S = 0;\n } else {\n if (L < 0.5) {\n S = del_max / (var_max + var_min);\n } else {\n S = del_max / (2 - var_max - var_min);\n }\n\n const del_r = ((var_max - r) / 6 + del_max / 2) / del_max;\n const del_g = ((var_max - g) / 6 + del_max / 2) / del_max;\n const del_b = ((var_max - b) / 6 + del_max / 2) / del_max;\n\n if (r == var_max) {\n H = del_b - del_g;\n } else if (g == var_max) {\n H = 1 / 3 + del_r - del_b;\n } else if (b == var_max) {\n H = 2 / 3 + del_g - del_r;\n }\n\n if (H < 0) {\n H += 1;\n } else if (H > 1) {\n H -= 1;\n }\n }\n\n return [H, S, L];\n}\n","/*!\n * PatternFly Elements: PfeAvatar 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\nimport { hash } from \"./djb-hash.js\";\nimport { hsl2rgb, rgb2hsl } from \"./hslrgb.js\";\n\nclass PfeAvatar extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n\n`;\n }\n\n static get tag() {\n return \"pfe-avatar\";\n }\n\n static get properties() {\n return {\n name: {\n title: \"Username\",\n type: String,\n default: \"\",\n observer: \"_updateWhenConnected\"\n },\n src: {\n title: \"Avatar image URL\",\n type: String,\n observer: \"_updateWhenConnected\"\n },\n pattern: {\n title: \"Shape pattern\",\n type: String,\n default: PfeAvatar.patterns.squares,\n observer: \"_updateWhenConnected\"\n },\n // @TODO Deprecated pfe-name in 1.0\n oldName: {\n alias: \"name\",\n attr: \"pfe-name\"\n },\n // @TODO Deprecated pfe-src in 1.0\n oldSrc: {\n alias: \"src\",\n attr: \"pfe-src\"\n },\n // @TODO Deprecated pfe-pattern in 1.0\n oldPattern: {\n alias: \"pattern\",\n attr: \"pfe-pattern\"\n }\n };\n }\n\n get templateUrl() {\n return \"pfe-avatar.html\";\n }\n\n get styleUrl() {\n return \"pfe-avatar.scss\";\n }\n\n static get events() {\n return {\n connected: `${this.tag}:connected`\n };\n }\n\n static get patterns() {\n return {\n triangles: \"triangles\",\n squares: \"squares\"\n };\n }\n\n static get defaultSize() {\n return 128;\n }\n\n static get defaultColors() {\n return \"#67accf #448087 #709c6b #a35252 #826cbb\";\n }\n\n get customColors() {\n return this.cssVariable(\"pfe-avatar--colors\");\n }\n\n constructor() {\n super(PfeAvatar);\n\n this._initCanvas = this._initCanvas.bind(this);\n }\n\n connectedCallback() {\n // initCanvas comes before parent's connectedCallback because the\n // connectedCallback sets attribute values, triggering, the observer\n // functions, which require the canvas to already be initialized.\n this._initCanvas();\n\n super.connectedCallback();\n\n this.emitEvent(PfeAvatar.events.connected, {\n bubbles: false\n });\n }\n\n _initCanvas() {\n this._canvas = this.shadowRoot.querySelector(\"canvas\");\n const cssVarWidth = this.cssVariable(\"pfe-avatar--width\");\n const size = (cssVarWidth && cssVarWidth.replace(/px$/, \"\")) || PfeAvatar.defaultSize;\n this._canvas.width = size;\n this._canvas.height = size;\n\n this._squareSize = this._canvas.width / 8;\n this._triangleSize = this._canvas.width / 4;\n\n this._ctx = this._canvas.getContext(\"2d\");\n }\n\n static _registerColors() {\n this.colors = [];\n const contextColors = this.customColors || this.defaultColors;\n\n contextColors.split(/\\s+/).forEach(colorCode => {\n let pattern;\n switch (colorCode.length) {\n case 4: // ex: \"#0fc\"\n pattern = /^#([A-f0-9])([A-f0-9])([A-f0-9])$/.exec(colorCode);\n if (pattern) {\n pattern.shift();\n const color = pattern.map(c => parseInt(c + c, 16));\n this._registerColor(color);\n } else {\n this.log(`[pfe-avatar] invalid color ${colorCode}`);\n }\n break;\n case 7: // ex: \"#00ffcc\"\n pattern = /^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/.exec(colorCode);\n if (pattern) {\n pattern.shift();\n const color = pattern.map(c => parseInt(c, 16));\n this._registerColor(color);\n } else {\n this.log(`[pfe-avatar] invalid color ${colorCode}`);\n }\n }\n });\n\n return this.colors;\n }\n\n static _registerColor(color) {\n PfeAvatar.colors.push({\n color1: `rgb(${color.join(\",\")})`,\n color2: `rgb(${this._adjustColor(color).join(\",\")})`\n });\n }\n\n static _adjustColor(color) {\n const dark = 0.1;\n const l_adj = 0.1; // luminance adjustment\n const hsl = rgb2hsl(...color);\n\n // if luminance is too dark already, then lighten the alternate color\n // instead of darkening it.\n hsl[2] += hsl[2] > dark ? -l_adj : l_adj;\n\n return hsl2rgb(...hsl);\n }\n\n _updateWhenConnected() {\n if (this.hasAttribute(\"pfelement\")) {\n this.update();\n } else {\n this.addEventListener(PfeAvatar.events.connected, () => this.update());\n }\n }\n\n update() {\n // if we have a src element, update the img, otherwise update the random pattern\n if (this.src) {\n this.shadowRoot.querySelector(\"img\").src = this.src;\n } else {\n const bitPattern = hash(this.name).toString(2);\n const arrPattern = bitPattern.split(\"\").map(n => Number(n));\n this._colorIndex = Math.floor((PfeAvatar.colors.length * parseInt(bitPattern, 2)) / Math.pow(2, 32));\n this.color1 = PfeAvatar.colors[this._colorIndex].color1;\n this.color2 = PfeAvatar.colors[this._colorIndex].color2;\n\n this._clear();\n this._drawBackground();\n if (this.pattern === PfeAvatar.patterns.squares) {\n this._drawSquarePattern(arrPattern);\n } else if (this.pattern === PfeAvatar.patterns.triangles) {\n this._drawTrianglePattern(arrPattern);\n }\n // this._drawGradient();\n }\n }\n\n _clear() {\n this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n }\n\n _drawBackground() {\n this._ctx.fillStyle = this.color1;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n\n _drawSquarePattern(pattern) {\n this._ctx.fillStyle = this.color2;\n if (this._ctx) {\n let i = pattern.length;\n while (i--) {\n if (pattern[i]) {\n this._drawMirroredSquare(i % 4, Math.floor(i / 4));\n }\n }\n }\n }\n\n /**\n * Draw a square at the given position, mirrored onto both the left and right half of the canvas.\n */\n _drawMirroredSquare(x, y) {\n if (this._ctx) {\n this._drawSquare(x, y);\n this._drawSquare(7 - x, y);\n }\n }\n\n _drawSquare(x, y) {\n this._ctx.fillRect(this._squareSize * x, this._squareSize * y, this._squareSize, this._squareSize);\n }\n\n _drawTrianglePattern(pattern) {\n this._ctx.fillStyle = this.color2;\n if (this._ctx) {\n let i = pattern.length;\n while (i--) {\n if (pattern[i]) {\n const x = Math.floor(i / 2) % 2;\n const y = Math.floor(i / 4);\n const alt = i % 4;\n\n const p1 = [x, y];\n const p2 = [x, y];\n const p3 = [x, y];\n\n switch (alt) {\n case 0:\n p2[1]++;\n p3[0]++;\n p3[1]++;\n break;\n case 1:\n p2[0]++;\n p3[0]++;\n p3[1]++;\n break;\n case 2:\n p2[0]++;\n p3[1]++;\n break;\n case 3:\n p1[0]++;\n p2[0]++;\n p2[1]++;\n p3[1]++;\n break;\n }\n\n this._drawMirroredTriangle(p1, p2, p3);\n }\n }\n }\n }\n\n /**\n * Draw a square at the given position in the top-left quadrant of the\n * canvas, and mirrored to the other three quadrants.\n */\n _drawMirroredTriangle(p1, p2, p3) {\n if (this._ctx) {\n this._drawTriangle(p1, p2, p3);\n this._drawTriangle([4 - p1[0], p1[1]], [4 - p2[0], p2[1]], [4 - p3[0], p3[1]]);\n }\n }\n\n _drawTriangle(p1, p2, p3) {\n this._ctx.beginPath();\n this._ctx.moveTo(...p1.map(c => c * this._triangleSize));\n this._ctx.lineTo(...p2.map(c => c * this._triangleSize));\n this._ctx.lineTo(...p3.map(c => c * this._triangleSize));\n this._ctx.closePath();\n this._ctx.fill();\n this._ctx.fill();\n }\n\n _drawGradient() {\n const gradient = this._ctx.createLinearGradient(0, this._canvas.height, this._canvas.width, 0);\n const color = this.color2;\n let gradientColor1 = color;\n let gradientColor2 = color;\n if (/^#[A-f0-9]{3}$/.test(color)) {\n // color is of the form \"#fff\"\n gradientColor1 += \"c\";\n gradientColor2 += \"0\";\n } else if (/^#[A-f0-9]{6}$/.test(color)) {\n // color is of the form \"#ffffff\"\n gradientColor1 += \"cc\";\n gradientColor2 += \"00\";\n }\n gradient.addColorStop(0, gradientColor1);\n gradient.addColorStop(1, gradientColor2);\n gradient.addColorStop(1, gradientColor1);\n this._ctx.fillStyle = gradient;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n}\n\nPfeAvatar._registerColors();\n\nPFElement.create(PfeAvatar);\n\nexport default PfeAvatar;\n","/**\n * djb2 string hashing function.\n *\n * @see http://www.cse.yorku.ca/~oz/hash.html\n * @param {String} str the string to hash.\n * @return {Number} a positive integer\n */\n\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n\n while (i) {\n hash = (hash * 33) ^ str.charCodeAt(--i);\n }\n\n return hash >>> 0;\n}\n\nexport { hash };\n"],"names":["h2rgb","v1","v2","vH","PfeAvatar","PFElement","version","html","tag","properties","name","title","type","String","default","observer","src","pattern","patterns","squares","oldName","alias","attr","oldSrc","oldPattern","templateUrl","styleUrl","events","connected","this","triangles","defaultSize","defaultColors","customColors","cssVariable","[object Object]","super","_initCanvas","bind","connectedCallback","emitEvent","bubbles","_canvas","shadowRoot","querySelector","cssVarWidth","size","replace","width","height","_squareSize","_triangleSize","_ctx","getContext","colors","split","forEach","colorCode","length","exec","shift","color","map","c","parseInt","_registerColor","log","push","color1","join","color2","_adjustColor","hsl","_R","_G","_B","H","S","L","r","Math","max","min","g","b","var_min","var_max","del_max","del_r","del_g","del_b","rgb2hsl","_H","_S","_L","R","G","B","a","floor","hsl2rgb","hasAttribute","update","addEventListener","bitPattern","str","hash","i","charCodeAt","toString","arrPattern","n","Number","_colorIndex","pow","_clear","_drawBackground","_drawSquarePattern","_drawTrianglePattern","clearRect","fillStyle","fillRect","_drawMirroredSquare","x","y","_drawSquare","p1","p2","p3","_drawMirroredTriangle","_drawTriangle","beginPath","moveTo","lineTo","closePath","fill","gradient","createLinearGradient","gradientColor1","gradientColor2","test","addColorStop","_registerColors","create"],"mappings":"qDAAA,SAASA,EAAMC,EAAIC,EAAIC,GAGrB,OAFIA,EAAK,IAAGA,GAAM,GACdA,EAAK,IAAGA,GAAM,GACd,EAAIA,EAAK,EAAUF,EAAiB,GAAXC,EAAKD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AAKuB,KAAKiF,UAAUL,EAAGlE,IAAIC,GAAKA,EAAIlC,KAAKsB,gBACzCtB,KAAKuB,KAAKkF,YACVzG,KAAKuB,KAAKmF,OACV1G,KAAKuB,KAAKmF,OAGZpG,gBACE,MAAMqG,EAAW3G,KAAKuB,KAAKqF,qBAAqB,EAAG5G,KAAKa,QAAQO,OAAQpB,KAAKa,QAAQM,MAAO,GACtFa,EAAQhC,KAAKyC,OACnB,IAAIoE,EAAiB7E,EACjB8E,EAAiB9E,EACjB,iBAAiB+E,KAAK/E,IAExB6E,GAAkB,IAClBC,GAAkB,KACT,iBAAiBC,KAAK/E,KAE/B6E,GAAkB,KAClBC,GAAkB,MAEpBH,EAASK,aAAa,EAAGH,GACzBF,EAASK,aAAa,EAAGF,GACzBH,EAASK,aAAa,EAAGH,GACzB7G,KAAKuB,KAAKoE,UAAYgB,EACtB3G,KAAKuB,KAAKqE,SAAS,EAAG,EAAG5F,KAAKa,QAAQM,MAAOnB,KAAKa,QAAQO,SAI9D7C,EAAU0I,kBAEVzI,EAAU0I,OAAO3I"} \ No newline at end of file diff --git a/elements/pfe-avatar/dist/pfe-avatar.umd.js b/elements/pfe-avatar/dist/pfe-avatar.umd.js new file mode 100644 index 0000000000..2a0e7a9e85 --- /dev/null +++ b/elements/pfe-avatar/dist/pfe-avatar.umd.js @@ -0,0 +1,644 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../../pfelement/dist/pfelement.umd')) : + typeof define === 'function' && define.amd ? define(['../../pfelement/dist/pfelement.umd'], factory) : + (global = global || self, global.PfeAvatar = factory(global.PFElement)); +}(this, (function (PFElement) { 'use strict'; + + PFElement = PFElement && Object.prototype.hasOwnProperty.call(PFElement, 'default') ? PFElement['default'] : PFElement; + + /** + * djb2 string hashing function. + * + * @see http://www.cse.yorku.ca/~oz/hash.html + * @param {String} str the string to hash. + * @return {Number} a positive integer + */ + + function hash(str) { + var hash = 5381; + var i = str.length; + + while (i) { + hash = hash * 33 ^ str.charCodeAt(--i); + } + + return hash >>> 0; + } + + function h2rgb(v1, v2, vH) { + if (vH < 0) vH += 1; + if (vH > 1) vH -= 1; + if (6 * vH < 1) return v1 + (v2 - v1) * 6 * vH; + if (2 * vH < 1) return v2; + if (3 * vH < 2) return v1 + (v2 - v1) * (2 / 3 - vH) * 6; + return v1; + } + + /** + * Convert an HSL color to RGB. + * + * @param {Number} H the hue component + * @param {Number} S the saturation component + * @param {Number} L the luminance component + * @return {Array} [R, G, B] + * + * @see https://www.easyrgb.com/en/math.php + */ + function hsl2rgb(_H, _S, _L) { + var R = void 0, + G = void 0, + B = void 0; + + var H = Math.max(0, Math.min(1, _H)); + var S = Math.max(0, Math.min(1, _S)); + var L = Math.max(0, Math.min(1, _L)); + + if (S == 0) { + R = L * 255; + G = L * 255; + B = L * 255; + } else { + var a = void 0, + b = void 0; + + if (L < 0.5) { + b = L * (1 + S); + } else { + b = L + S - S * L; + } + + a = 2 * L - b; + + R = Math.floor(255 * h2rgb(a, b, H + 1 / 3)); + G = Math.floor(255 * h2rgb(a, b, H)); + B = Math.floor(255 * h2rgb(a, b, H - 1 / 3)); + } + + return [R, G, B]; + } + + /** + * Convert an RGBcolor to HSL. + * + * @param {Number} R the red component + * @param {Number} G the green component + * @param {Number} B the blue component + * @return {Array} [H, S, L] + * + * @see https://www.easyrgb.com/en/math.php + */ + function rgb2hsl(_R, _G, _B) { + var H = void 0, + S = void 0, + L = void 0; + + var R = Math.max(0, Math.min(255, _R)); + var G = Math.max(0, Math.min(255, _G)); + var B = Math.max(0, Math.min(255, _B)); + + var r = R / 255; + var g = G / 255; + var b = B / 255; + + var var_min = Math.min(Math.min(r, g), b); + var var_max = Math.max(Math.max(r, g), b); + var del_max = var_max - var_min; + + L = (var_max + var_min) / 2; + + if (del_max === 0) { + H = 0; + S = 0; + } else { + if (L < 0.5) { + S = del_max / (var_max + var_min); + } else { + S = del_max / (2 - var_max - var_min); + } + + var del_r = ((var_max - r) / 6 + del_max / 2) / del_max; + var del_g = ((var_max - g) / 6 + del_max / 2) / del_max; + var del_b = ((var_max - b) / 6 + del_max / 2) / del_max; + + if (r == var_max) { + H = del_b - del_g; + } else if (g == var_max) { + H = 1 / 3 + del_r - del_b; + } else if (b == var_max) { + H = 2 / 3 + del_g - del_r; + } + + if (H < 0) { + H += 1; + } else if (H > 1) { + H -= 1; + } + } + + return [H, S, L]; + } + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } + }; + + var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + }; + + var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + }; + + var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } + }; + + /*! + * PatternFly Elements: PfeAvatar 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + var PfeAvatar = function (_PFElement) { + inherits(PfeAvatar, _PFElement); + createClass(PfeAvatar, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n\n"; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-avatar.html"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-avatar.scss"; + } + }, { + key: "customColors", + get: function get() { + return this.cssVariable("pfe-avatar--colors"); + } + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "tag", + get: function get() { + return "pfe-avatar"; + } + }, { + key: "properties", + get: function get() { + return { + name: { + title: "Username", + type: String, + default: "", + observer: "_updateWhenConnected" + }, + src: { + title: "Avatar image URL", + type: String, + observer: "_updateWhenConnected" + }, + pattern: { + title: "Shape pattern", + type: String, + default: PfeAvatar.patterns.squares, + observer: "_updateWhenConnected" + }, + // @TODO Deprecated pfe-name in 1.0 + oldName: { + alias: "name", + attr: "pfe-name" + }, + // @TODO Deprecated pfe-src in 1.0 + oldSrc: { + alias: "src", + attr: "pfe-src" + }, + // @TODO Deprecated pfe-pattern in 1.0 + oldPattern: { + alias: "pattern", + attr: "pfe-pattern" + } + }; + } + }, { + key: "events", + get: function get() { + return { + connected: this.tag + ":connected" + }; + } + }, { + key: "patterns", + get: function get() { + return { + triangles: "triangles", + squares: "squares" + }; + } + }, { + key: "defaultSize", + get: function get() { + return 128; + } + }, { + key: "defaultColors", + get: function get() { + return "#67accf #448087 #709c6b #a35252 #826cbb"; + } + }]); + + function PfeAvatar() { + classCallCheck(this, PfeAvatar); + + var _this = possibleConstructorReturn(this, (PfeAvatar.__proto__ || Object.getPrototypeOf(PfeAvatar)).call(this, PfeAvatar)); + + _this._initCanvas = _this._initCanvas.bind(_this); + return _this; + } + + createClass(PfeAvatar, [{ + key: "connectedCallback", + value: function connectedCallback() { + // initCanvas comes before parent's connectedCallback because the + // connectedCallback sets attribute values, triggering, the observer + // functions, which require the canvas to already be initialized. + this._initCanvas(); + + get(PfeAvatar.prototype.__proto__ || Object.getPrototypeOf(PfeAvatar.prototype), "connectedCallback", this).call(this); + + this.emitEvent(PfeAvatar.events.connected, { + bubbles: false + }); + } + }, { + key: "_initCanvas", + value: function _initCanvas() { + this._canvas = this.shadowRoot.querySelector("canvas"); + var cssVarWidth = this.cssVariable("pfe-avatar--width"); + var size = cssVarWidth && cssVarWidth.replace(/px$/, "") || PfeAvatar.defaultSize; + this._canvas.width = size; + this._canvas.height = size; + + this._squareSize = this._canvas.width / 8; + this._triangleSize = this._canvas.width / 4; + + this._ctx = this._canvas.getContext("2d"); + } + }, { + key: "_updateWhenConnected", + value: function _updateWhenConnected() { + var _this2 = this; + + if (this.hasAttribute("pfelement")) { + this.update(); + } else { + this.addEventListener(PfeAvatar.events.connected, function () { + return _this2.update(); + }); + } + } + }, { + key: "update", + value: function update() { + // if we have a src element, update the img, otherwise update the random pattern + if (this.src) { + this.shadowRoot.querySelector("img").src = this.src; + } else { + var bitPattern = hash(this.name).toString(2); + var arrPattern = bitPattern.split("").map(function (n) { + return Number(n); + }); + this._colorIndex = Math.floor(PfeAvatar.colors.length * parseInt(bitPattern, 2) / Math.pow(2, 32)); + this.color1 = PfeAvatar.colors[this._colorIndex].color1; + this.color2 = PfeAvatar.colors[this._colorIndex].color2; + + this._clear(); + this._drawBackground(); + if (this.pattern === PfeAvatar.patterns.squares) { + this._drawSquarePattern(arrPattern); + } else if (this.pattern === PfeAvatar.patterns.triangles) { + this._drawTrianglePattern(arrPattern); + } + // this._drawGradient(); + } + } + }, { + key: "_clear", + value: function _clear() { + this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height); + } + }, { + key: "_drawBackground", + value: function _drawBackground() { + this._ctx.fillStyle = this.color1; + this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); + } + }, { + key: "_drawSquarePattern", + value: function _drawSquarePattern(pattern) { + this._ctx.fillStyle = this.color2; + if (this._ctx) { + var i = pattern.length; + while (i--) { + if (pattern[i]) { + this._drawMirroredSquare(i % 4, Math.floor(i / 4)); + } + } + } + } + + /** + * Draw a square at the given position, mirrored onto both the left and right half of the canvas. + */ + + }, { + key: "_drawMirroredSquare", + value: function _drawMirroredSquare(x, y) { + if (this._ctx) { + this._drawSquare(x, y); + this._drawSquare(7 - x, y); + } + } + }, { + key: "_drawSquare", + value: function _drawSquare(x, y) { + this._ctx.fillRect(this._squareSize * x, this._squareSize * y, this._squareSize, this._squareSize); + } + }, { + key: "_drawTrianglePattern", + value: function _drawTrianglePattern(pattern) { + this._ctx.fillStyle = this.color2; + if (this._ctx) { + var i = pattern.length; + while (i--) { + if (pattern[i]) { + var x = Math.floor(i / 2) % 2; + var y = Math.floor(i / 4); + var alt = i % 4; + + var p1 = [x, y]; + var p2 = [x, y]; + var p3 = [x, y]; + + switch (alt) { + case 0: + p2[1]++; + p3[0]++; + p3[1]++; + break; + case 1: + p2[0]++; + p3[0]++; + p3[1]++; + break; + case 2: + p2[0]++; + p3[1]++; + break; + case 3: + p1[0]++; + p2[0]++; + p2[1]++; + p3[1]++; + break; + } + + this._drawMirroredTriangle(p1, p2, p3); + } + } + } + } + + /** + * Draw a square at the given position in the top-left quadrant of the + * canvas, and mirrored to the other three quadrants. + */ + + }, { + key: "_drawMirroredTriangle", + value: function _drawMirroredTriangle(p1, p2, p3) { + if (this._ctx) { + this._drawTriangle(p1, p2, p3); + this._drawTriangle([4 - p1[0], p1[1]], [4 - p2[0], p2[1]], [4 - p3[0], p3[1]]); + } + } + }, { + key: "_drawTriangle", + value: function _drawTriangle(p1, p2, p3) { + var _ctx, + _this3 = this, + _ctx2, + _ctx3; + + this._ctx.beginPath(); + (_ctx = this._ctx).moveTo.apply(_ctx, toConsumableArray(p1.map(function (c) { + return c * _this3._triangleSize; + }))); + (_ctx2 = this._ctx).lineTo.apply(_ctx2, toConsumableArray(p2.map(function (c) { + return c * _this3._triangleSize; + }))); + (_ctx3 = this._ctx).lineTo.apply(_ctx3, toConsumableArray(p3.map(function (c) { + return c * _this3._triangleSize; + }))); + this._ctx.closePath(); + this._ctx.fill(); + this._ctx.fill(); + } + }, { + key: "_drawGradient", + value: function _drawGradient() { + var gradient = this._ctx.createLinearGradient(0, this._canvas.height, this._canvas.width, 0); + var color = this.color2; + var gradientColor1 = color; + var gradientColor2 = color; + if (/^#[A-f0-9]{3}$/.test(color)) { + // color is of the form "#fff" + gradientColor1 += "c"; + gradientColor2 += "0"; + } else if (/^#[A-f0-9]{6}$/.test(color)) { + // color is of the form "#ffffff" + gradientColor1 += "cc"; + gradientColor2 += "00"; + } + gradient.addColorStop(0, gradientColor1); + gradient.addColorStop(1, gradientColor2); + gradient.addColorStop(1, gradientColor1); + this._ctx.fillStyle = gradient; + this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); + } + }], [{ + key: "_registerColors", + value: function _registerColors() { + var _this4 = this; + + this.colors = []; + var contextColors = this.customColors || this.defaultColors; + + contextColors.split(/\s+/).forEach(function (colorCode) { + var pattern = void 0; + switch (colorCode.length) { + case 4: + // ex: "#0fc" + pattern = /^#([A-f0-9])([A-f0-9])([A-f0-9])$/.exec(colorCode); + if (pattern) { + pattern.shift(); + var color = pattern.map(function (c) { + return parseInt(c + c, 16); + }); + _this4._registerColor(color); + } else { + _this4.log("[pfe-avatar] invalid color " + colorCode); + } + break; + case 7: + // ex: "#00ffcc" + pattern = /^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/.exec(colorCode); + if (pattern) { + pattern.shift(); + var _color = pattern.map(function (c) { + return parseInt(c, 16); + }); + _this4._registerColor(_color); + } else { + _this4.log("[pfe-avatar] invalid color " + colorCode); + } + } + }); + + return this.colors; + } + }, { + key: "_registerColor", + value: function _registerColor(color) { + PfeAvatar.colors.push({ + color1: "rgb(" + color.join(",") + ")", + color2: "rgb(" + this._adjustColor(color).join(",") + ")" + }); + } + }, { + key: "_adjustColor", + value: function _adjustColor(color) { + var dark = 0.1; + var l_adj = 0.1; // luminance adjustment + var hsl = rgb2hsl.apply(undefined, toConsumableArray(color)); + + // if luminance is too dark already, then lighten the alternate color + // instead of darkening it. + hsl[2] += hsl[2] > dark ? -l_adj : l_adj; + + return hsl2rgb.apply(undefined, toConsumableArray(hsl)); + } + }]); + return PfeAvatar; + }(PFElement); + + PfeAvatar._registerColors(); + + PFElement.create(PfeAvatar); + + return PfeAvatar; + +}))); +//# sourceMappingURL=pfe-avatar.umd.js.map diff --git a/elements/pfe-avatar/dist/pfe-avatar.umd.js.map b/elements/pfe-avatar/dist/pfe-avatar.umd.js.map new file mode 100644 index 0000000000..15e02ca7cf --- /dev/null +++ b/elements/pfe-avatar/dist/pfe-avatar.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-avatar.umd.js","sources":["../_temp/djb-hash.js","../_temp/hslrgb.js","../_temp/pfe-avatar.umd.js"],"sourcesContent":["/**\n * djb2 string hashing function.\n *\n * @see http://www.cse.yorku.ca/~oz/hash.html\n * @param {String} str the string to hash.\n * @return {Number} a positive integer\n */\n\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n\n while (i) {\n hash = (hash * 33) ^ str.charCodeAt(--i);\n }\n\n return hash >>> 0;\n}\n\nexport { hash };\n","function h2rgb(v1, v2, vH) {\n if (vH < 0) vH += 1;\n if (vH > 1) vH -= 1;\n if (6 * vH < 1) return v1 + (v2 - v1) * 6 * vH;\n if (2 * vH < 1) return v2;\n if (3 * vH < 2) return v1 + (v2 - v1) * (2 / 3 - vH) * 6;\n return v1;\n}\n\n/**\n * Convert an HSL color to RGB.\n *\n * @param {Number} H the hue component\n * @param {Number} S the saturation component\n * @param {Number} L the luminance component\n * @return {Array} [R, G, B]\n *\n * @see https://www.easyrgb.com/en/math.php\n */\nexport function hsl2rgb(_H, _S, _L) {\n let R, G, B;\n\n const H = Math.max(0, Math.min(1, _H));\n const S = Math.max(0, Math.min(1, _S));\n const L = Math.max(0, Math.min(1, _L));\n\n if (S == 0) {\n R = L * 255;\n G = L * 255;\n B = L * 255;\n } else {\n let a, b;\n\n if (L < 0.5) {\n b = L * (1 + S);\n } else {\n b = L + S - S * L;\n }\n\n a = 2 * L - b;\n\n R = Math.floor(255 * h2rgb(a, b, H + 1 / 3));\n G = Math.floor(255 * h2rgb(a, b, H));\n B = Math.floor(255 * h2rgb(a, b, H - 1 / 3));\n }\n\n return [R, G, B];\n}\n\n/**\n * Convert an RGBcolor to HSL.\n *\n * @param {Number} R the red component\n * @param {Number} G the green component\n * @param {Number} B the blue component\n * @return {Array} [H, S, L]\n *\n * @see https://www.easyrgb.com/en/math.php\n */\nexport function rgb2hsl(_R, _G, _B) {\n let H, S, L;\n\n const R = Math.max(0, Math.min(255, _R));\n const G = Math.max(0, Math.min(255, _G));\n const B = Math.max(0, Math.min(255, _B));\n\n const r = R / 255;\n const g = G / 255;\n const b = B / 255;\n\n const var_min = Math.min(Math.min(r, g), b);\n const var_max = Math.max(Math.max(r, g), b);\n const del_max = var_max - var_min;\n\n L = (var_max + var_min) / 2;\n\n if (del_max === 0) {\n H = 0;\n S = 0;\n } else {\n if (L < 0.5) {\n S = del_max / (var_max + var_min);\n } else {\n S = del_max / (2 - var_max - var_min);\n }\n\n const del_r = ((var_max - r) / 6 + del_max / 2) / del_max;\n const del_g = ((var_max - g) / 6 + del_max / 2) / del_max;\n const del_b = ((var_max - b) / 6 + del_max / 2) / del_max;\n\n if (r == var_max) {\n H = del_b - del_g;\n } else if (g == var_max) {\n H = 1 / 3 + del_r - del_b;\n } else if (b == var_max) {\n H = 2 / 3 + del_g - del_r;\n }\n\n if (H < 0) {\n H += 1;\n } else if (H > 1) {\n H -= 1;\n }\n }\n\n return [H, S, L];\n}\n","/*!\n * PatternFly Elements: PfeAvatar 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\nimport { hash } from \"./djb-hash.js\";\nimport { hsl2rgb, rgb2hsl } from \"./hslrgb.js\";\n\nclass PfeAvatar extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n\n`;\n }\n\n static get tag() {\n return \"pfe-avatar\";\n }\n\n static get properties() {\n return {\n name: {\n title: \"Username\",\n type: String,\n default: \"\",\n observer: \"_updateWhenConnected\"\n },\n src: {\n title: \"Avatar image URL\",\n type: String,\n observer: \"_updateWhenConnected\"\n },\n pattern: {\n title: \"Shape pattern\",\n type: String,\n default: PfeAvatar.patterns.squares,\n observer: \"_updateWhenConnected\"\n },\n // @TODO Deprecated pfe-name in 1.0\n oldName: {\n alias: \"name\",\n attr: \"pfe-name\"\n },\n // @TODO Deprecated pfe-src in 1.0\n oldSrc: {\n alias: \"src\",\n attr: \"pfe-src\"\n },\n // @TODO Deprecated pfe-pattern in 1.0\n oldPattern: {\n alias: \"pattern\",\n attr: \"pfe-pattern\"\n }\n };\n }\n\n get templateUrl() {\n return \"pfe-avatar.html\";\n }\n\n get styleUrl() {\n return \"pfe-avatar.scss\";\n }\n\n static get events() {\n return {\n connected: `${this.tag}:connected`\n };\n }\n\n static get patterns() {\n return {\n triangles: \"triangles\",\n squares: \"squares\"\n };\n }\n\n static get defaultSize() {\n return 128;\n }\n\n static get defaultColors() {\n return \"#67accf #448087 #709c6b #a35252 #826cbb\";\n }\n\n get customColors() {\n return this.cssVariable(\"pfe-avatar--colors\");\n }\n\n constructor() {\n super(PfeAvatar);\n\n this._initCanvas = this._initCanvas.bind(this);\n }\n\n connectedCallback() {\n // initCanvas comes before parent's connectedCallback because the\n // connectedCallback sets attribute values, triggering, the observer\n // functions, which require the canvas to already be initialized.\n this._initCanvas();\n\n super.connectedCallback();\n\n this.emitEvent(PfeAvatar.events.connected, {\n bubbles: false\n });\n }\n\n _initCanvas() {\n this._canvas = this.shadowRoot.querySelector(\"canvas\");\n const cssVarWidth = this.cssVariable(\"pfe-avatar--width\");\n const size = (cssVarWidth && cssVarWidth.replace(/px$/, \"\")) || PfeAvatar.defaultSize;\n this._canvas.width = size;\n this._canvas.height = size;\n\n this._squareSize = this._canvas.width / 8;\n this._triangleSize = this._canvas.width / 4;\n\n this._ctx = this._canvas.getContext(\"2d\");\n }\n\n static _registerColors() {\n this.colors = [];\n const contextColors = this.customColors || this.defaultColors;\n\n contextColors.split(/\\s+/).forEach(colorCode => {\n let pattern;\n switch (colorCode.length) {\n case 4: // ex: \"#0fc\"\n pattern = /^#([A-f0-9])([A-f0-9])([A-f0-9])$/.exec(colorCode);\n if (pattern) {\n pattern.shift();\n const color = pattern.map(c => parseInt(c + c, 16));\n this._registerColor(color);\n } else {\n this.log(`[pfe-avatar] invalid color ${colorCode}`);\n }\n break;\n case 7: // ex: \"#00ffcc\"\n pattern = /^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/.exec(colorCode);\n if (pattern) {\n pattern.shift();\n const color = pattern.map(c => parseInt(c, 16));\n this._registerColor(color);\n } else {\n this.log(`[pfe-avatar] invalid color ${colorCode}`);\n }\n }\n });\n\n return this.colors;\n }\n\n static _registerColor(color) {\n PfeAvatar.colors.push({\n color1: `rgb(${color.join(\",\")})`,\n color2: `rgb(${this._adjustColor(color).join(\",\")})`\n });\n }\n\n static _adjustColor(color) {\n const dark = 0.1;\n const l_adj = 0.1; // luminance adjustment\n const hsl = rgb2hsl(...color);\n\n // if luminance is too dark already, then lighten the alternate color\n // instead of darkening it.\n hsl[2] += hsl[2] > dark ? -l_adj : l_adj;\n\n return hsl2rgb(...hsl);\n }\n\n _updateWhenConnected() {\n if (this.hasAttribute(\"pfelement\")) {\n this.update();\n } else {\n this.addEventListener(PfeAvatar.events.connected, () => this.update());\n }\n }\n\n update() {\n // if we have a src element, update the img, otherwise update the random pattern\n if (this.src) {\n this.shadowRoot.querySelector(\"img\").src = this.src;\n } else {\n const bitPattern = hash(this.name).toString(2);\n const arrPattern = bitPattern.split(\"\").map(n => Number(n));\n this._colorIndex = Math.floor((PfeAvatar.colors.length * parseInt(bitPattern, 2)) / Math.pow(2, 32));\n this.color1 = PfeAvatar.colors[this._colorIndex].color1;\n this.color2 = PfeAvatar.colors[this._colorIndex].color2;\n\n this._clear();\n this._drawBackground();\n if (this.pattern === PfeAvatar.patterns.squares) {\n this._drawSquarePattern(arrPattern);\n } else if (this.pattern === PfeAvatar.patterns.triangles) {\n this._drawTrianglePattern(arrPattern);\n }\n // this._drawGradient();\n }\n }\n\n _clear() {\n this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n }\n\n _drawBackground() {\n this._ctx.fillStyle = this.color1;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n\n _drawSquarePattern(pattern) {\n this._ctx.fillStyle = this.color2;\n if (this._ctx) {\n let i = pattern.length;\n while (i--) {\n if (pattern[i]) {\n this._drawMirroredSquare(i % 4, Math.floor(i / 4));\n }\n }\n }\n }\n\n /**\n * Draw a square at the given position, mirrored onto both the left and right half of the canvas.\n */\n _drawMirroredSquare(x, y) {\n if (this._ctx) {\n this._drawSquare(x, y);\n this._drawSquare(7 - x, y);\n }\n }\n\n _drawSquare(x, y) {\n this._ctx.fillRect(this._squareSize * x, this._squareSize * y, this._squareSize, this._squareSize);\n }\n\n _drawTrianglePattern(pattern) {\n this._ctx.fillStyle = this.color2;\n if (this._ctx) {\n let i = pattern.length;\n while (i--) {\n if (pattern[i]) {\n const x = Math.floor(i / 2) % 2;\n const y = Math.floor(i / 4);\n const alt = i % 4;\n\n const p1 = [x, y];\n const p2 = [x, y];\n const p3 = [x, y];\n\n switch (alt) {\n case 0:\n p2[1]++;\n p3[0]++;\n p3[1]++;\n break;\n case 1:\n p2[0]++;\n p3[0]++;\n p3[1]++;\n break;\n case 2:\n p2[0]++;\n p3[1]++;\n break;\n case 3:\n p1[0]++;\n p2[0]++;\n p2[1]++;\n p3[1]++;\n break;\n }\n\n this._drawMirroredTriangle(p1, p2, p3);\n }\n }\n }\n }\n\n /**\n * Draw a square at the given position in the top-left quadrant of the\n * canvas, and mirrored to the other three quadrants.\n */\n _drawMirroredTriangle(p1, p2, p3) {\n if (this._ctx) {\n this._drawTriangle(p1, p2, p3);\n this._drawTriangle([4 - p1[0], p1[1]], [4 - p2[0], p2[1]], [4 - p3[0], p3[1]]);\n }\n }\n\n _drawTriangle(p1, p2, p3) {\n this._ctx.beginPath();\n this._ctx.moveTo(...p1.map(c => c * this._triangleSize));\n this._ctx.lineTo(...p2.map(c => c * this._triangleSize));\n this._ctx.lineTo(...p3.map(c => c * this._triangleSize));\n this._ctx.closePath();\n this._ctx.fill();\n this._ctx.fill();\n }\n\n _drawGradient() {\n const gradient = this._ctx.createLinearGradient(0, this._canvas.height, this._canvas.width, 0);\n const color = this.color2;\n let gradientColor1 = color;\n let gradientColor2 = color;\n if (/^#[A-f0-9]{3}$/.test(color)) {\n // color is of the form \"#fff\"\n gradientColor1 += \"c\";\n gradientColor2 += \"0\";\n } else if (/^#[A-f0-9]{6}$/.test(color)) {\n // color is of the form \"#ffffff\"\n gradientColor1 += \"cc\";\n gradientColor2 += \"00\";\n }\n gradient.addColorStop(0, gradientColor1);\n gradient.addColorStop(1, gradientColor2);\n gradient.addColorStop(1, gradientColor1);\n this._ctx.fillStyle = gradient;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n}\n\nPfeAvatar._registerColors();\n\nPFElement.create(PfeAvatar);\n\nexport default PfeAvatar;\n"],"names":["hash","str","i","length","charCodeAt","h2rgb","v1","v2","vH","hsl2rgb","_H","_S","_L","R","G","B","H","Math","max","min","S","L","a","b","floor","rgb2hsl","_R","_G","_B","r","g","var_min","var_max","del_max","del_r","del_g","del_b","PfeAvatar","cssVariable","name","title","type","String","default","observer","src","pattern","patterns","squares","oldName","alias","attr","oldSrc","oldPattern","connected","tag","triangles","_initCanvas","bind","emitEvent","events","bubbles","_canvas","shadowRoot","querySelector","cssVarWidth","size","replace","defaultSize","width","height","_squareSize","_triangleSize","_ctx","getContext","hasAttribute","update","addEventListener","bitPattern","toString","arrPattern","split","map","Number","n","_colorIndex","colors","parseInt","pow","color1","color2","_clear","_drawBackground","_drawSquarePattern","_drawTrianglePattern","clearRect","fillStyle","fillRect","_drawMirroredSquare","x","y","_drawSquare","alt","p1","p2","p3","_drawMirroredTriangle","_drawTriangle","beginPath","moveTo","c","lineTo","closePath","fill","gradient","createLinearGradient","color","gradientColor1","gradientColor2","test","addColorStop","contextColors","customColors","defaultColors","forEach","colorCode","exec","shift","_registerColor","log","push","join","_adjustColor","dark","l_adj","hsl","PFElement","_registerColors","create"],"mappings":";;;;;;;;EAAA;;;;;;;;EAQA,SAASA,IAAT,CAAcC,GAAd,EAAmB;EACjB,MAAID,OAAO,IAAX;EACA,MAAIE,IAAID,IAAIE,MAAZ;;EAEA,SAAOD,CAAP,EAAU;EACRF,WAAQA,OAAO,EAAR,GAAcC,IAAIG,UAAJ,CAAe,EAAEF,CAAjB,CAArB;EACD;;EAED,SAAOF,SAAS,CAAhB;EACD;;ECjBD,SAASK,KAAT,CAAeC,EAAf,EAAmBC,EAAnB,EAAuBC,EAAvB,EAA2B;EACzB,MAAIA,KAAK,CAAT,EAAYA,MAAM,CAAN;EACZ,MAAIA,KAAK,CAAT,EAAYA,MAAM,CAAN;EACZ,MAAI,IAAIA,EAAJ,GAAS,CAAb,EAAgB,OAAOF,KAAK,CAACC,KAAKD,EAAN,IAAY,CAAZ,GAAgBE,EAA5B;EAChB,MAAI,IAAIA,EAAJ,GAAS,CAAb,EAAgB,OAAOD,EAAP;EAChB,MAAI,IAAIC,EAAJ,GAAS,CAAb,EAAgB,OAAOF,KAAK,CAACC,KAAKD,EAAN,KAAa,IAAI,CAAJ,GAAQE,EAArB,IAA2B,CAAvC;EAChB,SAAOF,EAAP;EACD;;EAED;;;;;;;;;;AAUA,EAAO,SAASG,OAAT,CAAiBC,EAAjB,EAAqBC,EAArB,EAAyBC,EAAzB,EAA6B;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EAFoB,OAAtB;EAID;;;mCAEmBf,OAAO;EACzB,UAAMiB,OAAO,GAAb;EACA,UAAMC,QAAQ,GAAd,CAFyB;EAGzB,UAAMC,MAAM9G,2CAAW2F,KAAX,EAAZ;;EAEA;EACA;EACAmB,UAAI,CAAJ,KAAUA,IAAI,CAAJ,IAASF,IAAT,GAAgB,CAACC,KAAjB,GAAyBA,KAAnC;;EAEA,aAAO7H,2CAAW8H,GAAX,EAAP;EACD;;;IA1KqBC;;EAmUxBnG,UAAUoG,eAAV;;EAEAD,UAAUE,MAAV,CAAiBrG,SAAjB;;;;;;;;"} \ No newline at end of file diff --git a/elements/pfe-avatar/dist/pfe-avatar.umd.min.js b/elements/pfe-avatar/dist/pfe-avatar.umd.min.js new file mode 100644 index 0000000000..7358a056a9 --- /dev/null +++ b/elements/pfe-avatar/dist/pfe-avatar.umd.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("../../pfelement/dist/pfelement.umd.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min"],e):(t=t||self).PfeAvatar=e(t.PFElement)}(this,function(t){"use strict";function c(t,e,r){return r<0&&(r+=1),1:host{display:block;position:relative;width:128px;width:var(--pfe-avatar--size,var(--pfe-avatar--width,128px));height:128px;height:var(--pfe-avatar--size,var(--pfe-avatar--width,128px))}:host canvas{width:100%;height:100%;image-rendering:optimizeSpeed;image-rendering:-moz-crisp-edges;image-rendering:-webkit-optimize-contrast;image-rendering:-o-crisp-edges;image-rendering:-o-pixelated;image-rendering:pixelated;-ms-interpolation-mode:nearest-neighbor}:host([shape=rounded]) canvas,:host([shape=rounded]) img{border-radius:calc(128px / 8 + 1px);border-radius:calc(var(--pfe-avatar--size,var(--pfe-avatar--width,128px))/ 8 + 1px)}:host([shape=circle]) canvas,:host([shape=circle]) img{border-radius:50%}:host([src]) canvas{display:none}:host([src]) img{display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}:host(:not([src])) img{display:none}:host([hidden]){display:none} /*# sourceMappingURL=pfe-avatar.min.css.map */\n\n"}},{key:"templateUrl",get:function(){return"pfe-avatar.html"}},{key:"styleUrl",get:function(){return"pfe-avatar.scss"}},{key:"customColors",get:function(){return this.cssVariable("pfe-avatar--colors")}}],[{key:"version",get:function(){return"1.3.0"}},{key:"tag",get:function(){return"pfe-avatar"}},{key:"properties",get:function(){return{name:{title:"Username",type:String,default:"",observer:"_updateWhenConnected"},src:{title:"Avatar image URL",type:String,observer:"_updateWhenConnected"},pattern:{title:"Shape pattern",type:String,default:s.patterns.squares,observer:"_updateWhenConnected"},oldName:{alias:"name",attr:"pfe-name"},oldSrc:{alias:"src",attr:"pfe-src"},oldPattern:{alias:"pattern",attr:"pfe-pattern"}}}},{key:"events",get:function(){return{connected:this.tag+":connected"}}},{key:"patterns",get:function(){return{triangles:"triangles",squares:"squares"}}},{key:"defaultSize",get:function(){return 128}},{key:"defaultColors",get:function(){return"#67accf #448087 #709c6b #a35252 #826cbb"}}]),r(s,[{key:"connectedCallback",value:function(){this._initCanvas(),i(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"connectedCallback",this).call(this),this.emitEvent(s.events.connected,{bubbles:!1})}},{key:"_initCanvas",value:function(){this._canvas=this.shadowRoot.querySelector("canvas");var t=this.cssVariable("pfe-avatar--width"),t=t&&t.replace(/px$/,"")||s.defaultSize;this._canvas.width=t,this._canvas.height=t,this._squareSize=this._canvas.width/8,this._triangleSize=this._canvas.width/4,this._ctx=this._canvas.getContext("2d")}},{key:"_updateWhenConnected",value:function(){var t=this;this.hasAttribute("pfelement")?this.update():this.addEventListener(s.events.connected,function(){return t.update()})}},{key:"update",value:function(){var t,e;this.src?this.shadowRoot.querySelector("img").src=this.src:(e=(t=function(t){for(var e=5381,r=t.length;r;)e=33*e^t.charCodeAt(--r);return e>>>0}(this.name).toString(2)).split("").map(function(t){return Number(t)}),this._colorIndex=Math.floor(s.colors.length*parseInt(t,2)/Math.pow(2,32)),this.color1=s.colors[this._colorIndex].color1,this.color2=s.colors[this._colorIndex].color2,this._clear(),this._drawBackground(),this.pattern===s.patterns.squares?this._drawSquarePattern(e):this.pattern===s.patterns.triangles&&this._drawTrianglePattern(e))}},{key:"_clear",value:function(){this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height)}},{key:"_drawBackground",value:function(){this._ctx.fillStyle=this.color1,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)}},{key:"_drawSquarePattern",value:function(t){if(this._ctx.fillStyle=this.color2,this._ctx)for(var e=t.length;e--;)t[e]&&this._drawMirroredSquare(e%4,Math.floor(e/4))}},{key:"_drawMirroredSquare",value:function(t,e){this._ctx&&(this._drawSquare(t,e),this._drawSquare(7-t,e))}},{key:"_drawSquare",value:function(t,e){this._ctx.fillRect(this._squareSize*t,this._squareSize*e,this._squareSize,this._squareSize)}},{key:"_drawTrianglePattern",value:function(t){if(this._ctx.fillStyle=this.color2,this._ctx)for(var e=t.length;e--;)if(t[e]){var r=Math.floor(e/2)%2,a=Math.floor(e/4),i=[r,a],n=[r,a],o=[r,a];switch(e%4){case 0:n[1]++,o[0]++,o[1]++;break;case 1:n[0]++,o[0]++,o[1]++;break;case 2:n[0]++,o[1]++;break;case 3:i[0]++,n[0]++,n[1]++,o[1]++}this._drawMirroredTriangle(i,n,o)}}},{key:"_drawMirroredTriangle",value:function(t,e,r){this._ctx&&(this._drawTriangle(t,e,r),this._drawTriangle([4-t[0],t[1]],[4-e[0],e[1]],[4-r[0],r[1]]))}},{key:"_drawTriangle",value:function(t,e,r){var a,i=this;this._ctx.beginPath(),(a=this._ctx).moveTo.apply(a,n(t.map(function(t){return t*i._triangleSize}))),(t=this._ctx).lineTo.apply(t,n(e.map(function(t){return t*i._triangleSize}))),(e=this._ctx).lineTo.apply(e,n(r.map(function(t){return t*i._triangleSize}))),this._ctx.closePath(),this._ctx.fill(),this._ctx.fill()}},{key:"_drawGradient",value:function(){var t=this._ctx.createLinearGradient(0,this._canvas.height,this._canvas.width,0),e=this.color2,r=e,a=e;/^#[A-f0-9]{3}$/.test(e)?(r+="c",a+="0"):/^#[A-f0-9]{6}$/.test(e)&&(r+="cc",a+="00"),t.addColorStop(0,r),t.addColorStop(1,a),t.addColorStop(1,r),this._ctx.fillStyle=t,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)}}],[{key:"_registerColors",value:function(){var a=this;return this.colors=[],(this.customColors||this.defaultColors).split(/\s+/).forEach(function(t){var e,r=void 0;switch(t.length){case 4:(r=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/.exec(t))?(r.shift(),e=r.map(function(t){return parseInt(t+t,16)}),a._registerColor(e)):a.log("[pfe-avatar] invalid color "+t);break;case 7:(r=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/.exec(t))?(r.shift(),e=r.map(function(t){return parseInt(t,16)}),a._registerColor(e)):a.log("[pfe-avatar] invalid color "+t)}}),this.colors}},{key:"_registerColor",value:function(t){s.colors.push({color1:"rgb("+t.join(",")+")",color2:"rgb("+this._adjustColor(t).join(",")+")"})}},{key:"_adjustColor",value:function(t){t=function(t,e,r){var a=void 0,i=void 0,n=Math.max(0,Math.min(255,t))/255,o=Math.max(0,Math.min(255,e))/255,s=Math.max(0,Math.min(255,r))/255,c=Math.min(Math.min(n,o),s),l=((t=Math.max(Math.max(n,o),s))+c)/2;return 0==(e=t-c)?i=a=0:(i=l<.5?e/(t+c):e/(2-t-c),r=((t-n)/6+e/2)/e,c=((t-o)/6+e/2)/e,e=((t-s)/6+e/2)/e,n==t?a=e-c:o==t?a=1/3+r-e:s==t&&(a=2/3+c-r),a<0?a+=1:1 1) vH -= 1;\n if (6 * vH < 1) return v1 + (v2 - v1) * 6 * vH;\n if (2 * vH < 1) return v2;\n if (3 * vH < 2) return v1 + (v2 - v1) * (2 / 3 - vH) * 6;\n return v1;\n}\n\n/**\n * Convert an HSL color to RGB.\n *\n * @param {Number} H the hue component\n * @param {Number} S the saturation component\n * @param {Number} L the luminance component\n * @return {Array} [R, G, B]\n *\n * @see https://www.easyrgb.com/en/math.php\n */\nexport function hsl2rgb(_H, _S, _L) {\n let R, G, B;\n\n const H = Math.max(0, Math.min(1, _H));\n const S = Math.max(0, Math.min(1, _S));\n const L = Math.max(0, Math.min(1, _L));\n\n if (S == 0) {\n R = L * 255;\n G = L * 255;\n B = L * 255;\n } else {\n let a, b;\n\n if (L < 0.5) {\n b = L * (1 + S);\n } else {\n b = L + S - S * L;\n }\n\n a = 2 * L - b;\n\n R = Math.floor(255 * h2rgb(a, b, H + 1 / 3));\n G = Math.floor(255 * h2rgb(a, b, H));\n B = Math.floor(255 * h2rgb(a, b, H - 1 / 3));\n }\n\n return [R, G, B];\n}\n\n/**\n * Convert an RGBcolor to HSL.\n *\n * @param {Number} R the red component\n * @param {Number} G the green component\n * @param {Number} B the blue component\n * @return {Array} [H, S, L]\n *\n * @see https://www.easyrgb.com/en/math.php\n */\nexport function rgb2hsl(_R, _G, _B) {\n let H, S, L;\n\n const R = Math.max(0, Math.min(255, _R));\n const G = Math.max(0, Math.min(255, _G));\n const B = Math.max(0, Math.min(255, _B));\n\n const r = R / 255;\n const g = G / 255;\n const b = B / 255;\n\n const var_min = Math.min(Math.min(r, g), b);\n const var_max = Math.max(Math.max(r, g), b);\n const del_max = var_max - var_min;\n\n L = (var_max + var_min) / 2;\n\n if (del_max === 0) {\n H = 0;\n S = 0;\n } else {\n if (L < 0.5) {\n S = del_max / (var_max + var_min);\n } else {\n S = del_max / (2 - var_max - var_min);\n }\n\n const del_r = ((var_max - r) / 6 + del_max / 2) / del_max;\n const del_g = ((var_max - g) / 6 + del_max / 2) / del_max;\n const del_b = ((var_max - b) / 6 + del_max / 2) / del_max;\n\n if (r == var_max) {\n H = del_b - del_g;\n } else if (g == var_max) {\n H = 1 / 3 + del_r - del_b;\n } else if (b == var_max) {\n H = 2 / 3 + del_g - del_r;\n }\n\n if (H < 0) {\n H += 1;\n } else if (H > 1) {\n H -= 1;\n }\n }\n\n return [H, S, L];\n}\n","/*!\n * PatternFly Elements: PfeAvatar 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\nimport { hash } from \"./djb-hash.js\";\nimport { hsl2rgb, rgb2hsl } from \"./hslrgb.js\";\n\nclass PfeAvatar extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n\n`;\n }\n\n static get tag() {\n return \"pfe-avatar\";\n }\n\n static get properties() {\n return {\n name: {\n title: \"Username\",\n type: String,\n default: \"\",\n observer: \"_updateWhenConnected\"\n },\n src: {\n title: \"Avatar image URL\",\n type: String,\n observer: \"_updateWhenConnected\"\n },\n pattern: {\n title: \"Shape pattern\",\n type: String,\n default: PfeAvatar.patterns.squares,\n observer: \"_updateWhenConnected\"\n },\n // @TODO Deprecated pfe-name in 1.0\n oldName: {\n alias: \"name\",\n attr: \"pfe-name\"\n },\n // @TODO Deprecated pfe-src in 1.0\n oldSrc: {\n alias: \"src\",\n attr: \"pfe-src\"\n },\n // @TODO Deprecated pfe-pattern in 1.0\n oldPattern: {\n alias: \"pattern\",\n attr: \"pfe-pattern\"\n }\n };\n }\n\n get templateUrl() {\n return \"pfe-avatar.html\";\n }\n\n get styleUrl() {\n return \"pfe-avatar.scss\";\n }\n\n static get events() {\n return {\n connected: `${this.tag}:connected`\n };\n }\n\n static get patterns() {\n return {\n triangles: \"triangles\",\n squares: \"squares\"\n };\n }\n\n static get defaultSize() {\n return 128;\n }\n\n static get defaultColors() {\n return \"#67accf #448087 #709c6b #a35252 #826cbb\";\n }\n\n get customColors() {\n return this.cssVariable(\"pfe-avatar--colors\");\n }\n\n constructor() {\n super(PfeAvatar);\n\n this._initCanvas = this._initCanvas.bind(this);\n }\n\n connectedCallback() {\n // initCanvas comes before parent's connectedCallback because the\n // connectedCallback sets attribute values, triggering, the observer\n // functions, which require the canvas to already be initialized.\n this._initCanvas();\n\n super.connectedCallback();\n\n this.emitEvent(PfeAvatar.events.connected, {\n bubbles: false\n });\n }\n\n _initCanvas() {\n this._canvas = this.shadowRoot.querySelector(\"canvas\");\n const cssVarWidth = this.cssVariable(\"pfe-avatar--width\");\n const size = (cssVarWidth && cssVarWidth.replace(/px$/, \"\")) || PfeAvatar.defaultSize;\n this._canvas.width = size;\n this._canvas.height = size;\n\n this._squareSize = this._canvas.width / 8;\n this._triangleSize = this._canvas.width / 4;\n\n this._ctx = this._canvas.getContext(\"2d\");\n }\n\n static _registerColors() {\n this.colors = [];\n const contextColors = this.customColors || this.defaultColors;\n\n contextColors.split(/\\s+/).forEach(colorCode => {\n let pattern;\n switch (colorCode.length) {\n case 4: // ex: \"#0fc\"\n pattern = /^#([A-f0-9])([A-f0-9])([A-f0-9])$/.exec(colorCode);\n if (pattern) {\n pattern.shift();\n const color = pattern.map(c => parseInt(c + c, 16));\n this._registerColor(color);\n } else {\n this.log(`[pfe-avatar] invalid color ${colorCode}`);\n }\n break;\n case 7: // ex: \"#00ffcc\"\n pattern = /^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/.exec(colorCode);\n if (pattern) {\n pattern.shift();\n const color = pattern.map(c => parseInt(c, 16));\n this._registerColor(color);\n } else {\n this.log(`[pfe-avatar] invalid color ${colorCode}`);\n }\n }\n });\n\n return this.colors;\n }\n\n static _registerColor(color) {\n PfeAvatar.colors.push({\n color1: `rgb(${color.join(\",\")})`,\n color2: `rgb(${this._adjustColor(color).join(\",\")})`\n });\n }\n\n static _adjustColor(color) {\n const dark = 0.1;\n const l_adj = 0.1; // luminance adjustment\n const hsl = rgb2hsl(...color);\n\n // if luminance is too dark already, then lighten the alternate color\n // instead of darkening it.\n hsl[2] += hsl[2] > dark ? -l_adj : l_adj;\n\n return hsl2rgb(...hsl);\n }\n\n _updateWhenConnected() {\n if (this.hasAttribute(\"pfelement\")) {\n this.update();\n } else {\n this.addEventListener(PfeAvatar.events.connected, () => this.update());\n }\n }\n\n update() {\n // if we have a src element, update the img, otherwise update the random pattern\n if (this.src) {\n this.shadowRoot.querySelector(\"img\").src = this.src;\n } else {\n const bitPattern = hash(this.name).toString(2);\n const arrPattern = bitPattern.split(\"\").map(n => Number(n));\n this._colorIndex = Math.floor((PfeAvatar.colors.length * parseInt(bitPattern, 2)) / Math.pow(2, 32));\n this.color1 = PfeAvatar.colors[this._colorIndex].color1;\n this.color2 = PfeAvatar.colors[this._colorIndex].color2;\n\n this._clear();\n this._drawBackground();\n if (this.pattern === PfeAvatar.patterns.squares) {\n this._drawSquarePattern(arrPattern);\n } else if (this.pattern === PfeAvatar.patterns.triangles) {\n this._drawTrianglePattern(arrPattern);\n }\n // this._drawGradient();\n }\n }\n\n _clear() {\n this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n }\n\n _drawBackground() {\n this._ctx.fillStyle = this.color1;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n\n _drawSquarePattern(pattern) {\n this._ctx.fillStyle = this.color2;\n if (this._ctx) {\n let i = pattern.length;\n while (i--) {\n if (pattern[i]) {\n this._drawMirroredSquare(i % 4, Math.floor(i / 4));\n }\n }\n }\n }\n\n /**\n * Draw a square at the given position, mirrored onto both the left and right half of the canvas.\n */\n _drawMirroredSquare(x, y) {\n if (this._ctx) {\n this._drawSquare(x, y);\n this._drawSquare(7 - x, y);\n }\n }\n\n _drawSquare(x, y) {\n this._ctx.fillRect(this._squareSize * x, this._squareSize * y, this._squareSize, this._squareSize);\n }\n\n _drawTrianglePattern(pattern) {\n this._ctx.fillStyle = this.color2;\n if (this._ctx) {\n let i = pattern.length;\n while (i--) {\n if (pattern[i]) {\n const x = Math.floor(i / 2) % 2;\n const y = Math.floor(i / 4);\n const alt = i % 4;\n\n const p1 = [x, y];\n const p2 = [x, y];\n const p3 = [x, y];\n\n switch (alt) {\n case 0:\n p2[1]++;\n p3[0]++;\n p3[1]++;\n break;\n case 1:\n p2[0]++;\n p3[0]++;\n p3[1]++;\n break;\n case 2:\n p2[0]++;\n p3[1]++;\n break;\n case 3:\n p1[0]++;\n p2[0]++;\n p2[1]++;\n p3[1]++;\n break;\n }\n\n this._drawMirroredTriangle(p1, p2, p3);\n }\n }\n }\n }\n\n /**\n * Draw a square at the given position in the top-left quadrant of the\n * canvas, and mirrored to the other three quadrants.\n */\n _drawMirroredTriangle(p1, p2, p3) {\n if (this._ctx) {\n this._drawTriangle(p1, p2, p3);\n this._drawTriangle([4 - p1[0], p1[1]], [4 - p2[0], p2[1]], [4 - p3[0], p3[1]]);\n }\n }\n\n _drawTriangle(p1, p2, p3) {\n this._ctx.beginPath();\n this._ctx.moveTo(...p1.map(c => c * this._triangleSize));\n this._ctx.lineTo(...p2.map(c => c * this._triangleSize));\n this._ctx.lineTo(...p3.map(c => c * this._triangleSize));\n this._ctx.closePath();\n this._ctx.fill();\n this._ctx.fill();\n }\n\n _drawGradient() {\n const gradient = this._ctx.createLinearGradient(0, this._canvas.height, this._canvas.width, 0);\n const color = this.color2;\n let gradientColor1 = color;\n let gradientColor2 = color;\n if (/^#[A-f0-9]{3}$/.test(color)) {\n // color is of the form \"#fff\"\n gradientColor1 += \"c\";\n gradientColor2 += \"0\";\n } else if (/^#[A-f0-9]{6}$/.test(color)) {\n // color is of the form \"#ffffff\"\n gradientColor1 += \"cc\";\n gradientColor2 += \"00\";\n }\n gradient.addColorStop(0, gradientColor1);\n gradient.addColorStop(1, gradientColor2);\n gradient.addColorStop(1, gradientColor1);\n this._ctx.fillStyle = gradient;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n}\n\nPfeAvatar._registerColors();\n\nPFElement.create(PfeAvatar);\n\nexport default PfeAvatar;\n","/**\n * djb2 string hashing function.\n *\n * @see http://www.cse.yorku.ca/~oz/hash.html\n * @param {String} str the string to hash.\n * @return {Number} a positive integer\n */\n\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n\n while (i) {\n hash = (hash * 33) ^ str.charCodeAt(--i);\n }\n\n return hash >>> 0;\n}\n\nexport { hash };\n"],"names":["h2rgb","v1","v2","vH","PfeAvatar","PFElement","this","cssVariable","String","patterns","squares","tag","_initCanvas","emitEvent","events","connected","_canvas","shadowRoot","querySelector","cssVarWidth","size","replace","defaultSize","width","height","_squareSize","_triangleSize","_ctx","getContext","hasAttribute","update","addEventListener","_this2","bitPattern","arrPattern","src","str","hash","i","length","charCodeAt","name","toString","split","map","Number","n","_colorIndex","Math","floor","colors","parseInt","pow","color1","color2","_clear","_drawBackground","pattern","_drawSquarePattern","triangles","_drawTrianglePattern","clearRect","fillStyle","fillRect","_drawMirroredSquare","x","y","_drawSquare","p1","p2","p3","_drawMirroredTriangle","_drawTriangle","beginPath","moveTo","c","_this3","lineTo","closePath","fill","gradient","createLinearGradient","color","gradientColor1","gradientColor2","test","addColorStop","customColors","defaultColors","forEach","colorCode","exec","shift","_registerColor","log","push","join","_adjustColor","hsl","_R","_G","_B","H","S","r","max","min","g","b","var_min","var_max","del_max","L","del_r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IAAI,EAAGzD,KAAK0D,IAAI,EAAGY,aAEzB,GAALf,MACM,IAAJS,GAIGJ,EAAHc,WAQA,EAAIV,KANJA,EAAI,GACFA,GAAK,EAAIT,GAETS,EAAIT,EAAIA,EAAIS,KAKdhE,KAAKC,MAAM,IAAMjD,EAAM0H,EAAGd,EAAGN,EAAI,EAAI,MACrCtD,KAAKC,MAAM,IAAMjD,EAAM0H,EAAGd,EAAGN,IAC7BtD,KAAKC,MAAM,IAAMjD,EAAM0H,EAAGd,EAAGN,EAAI,EAAI,KAGpC,CAACiB,EAAGC,EAAGC,mBCwJMvB,iGA/EZ9F,aAEDQ,YAAc+G,EAAK/G,YAAYgH,iBAuOxCxH,EAAUyH,kBAEVxH,EAAUyH,OAAO1H"} \ No newline at end of file diff --git a/elements/pfe-avatar/package.json b/elements/pfe-avatar/package.json index 4956738c0d..d642176b2d 100644 --- a/elements/pfe-avatar/package.json +++ b/elements/pfe-avatar/package.json @@ -5,7 +5,7 @@ "elementName": "pfe-avatar", "preview": "squares.png" }, - "version": "1.2.0", + "version": "1.3.0", "description": "Avatar for PatternFly Elements", "keywords": [ "web-components", @@ -47,10 +47,10 @@ ], "license": "MIT", "dependencies": { - "@patternfly/pfelement": "^1.2.0" + "@patternfly/pfelement": "^1.3.0" }, "devDependencies": { - "@patternfly/pfe-sass": "^1.2.0" + "@patternfly/pfe-sass": "^1.3.0" }, "generator-pfelement-version": "0.6.8", "bugs": { diff --git a/elements/pfe-badge/dist/pfe-badge.css.map b/elements/pfe-badge/dist/pfe-badge.css.map new file mode 100644 index 0000000000..4736d12410 --- /dev/null +++ b/elements/pfe-badge/dist/pfe-badge.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-badge.scss","pfe-badge.css","../../pfe-sass/functions/_custom-properties.scss","../../pfe-sass/mixins/_custom-properties.scss"],"names":[],"mappings":"AAkBA;EACE,qBAAqB;EACrB,6BAAiD;EAAjD,4DAAiD;EACjD,kBAAkB;EAClB,kCAAkC;ACjBpC;;ADoBA;EACE,yBEqDkC;EFrDlC,kHEqDkC;EFpDlC,6BEoDkC;EFpDlC,kGEoDkC;EFnDlC,cEmDkC;EFnDlC,sEEmDkC;EFlDlC,4BEkDkC;EFlDlC,qFEkDkC;EFjDlC,gBEiDkC;EFjDlC,wFEiDkC;EFhDlC,wBEgDkC;EFhDlC,wFEgDkC;EF/ClC,4BE+CkC;EF/ClC,gGE+CkC;EF9ClC,6BE8CkC;EF9ClC,kGE8CkC;AD/DpC;;ADqBE;EG+DI,kFAA8C;EAA9C,gEAA8C;AF/EpD;;ADgBE;EG+DI,mFAA8C;EAA9C,gEAA8C;AF1EpD;;ADWE;EG+DI,kFAA8C;EAA9C,gEAA8C;AFrEpD;;ADME;EG+DI,iFAA8C;EAA9C,gEAA8C;AFhEpD;;ADCE;EG+DI,2EAA8C;EAA9C,gEAA8C;AF3DpD;;ADYA;EACE,aAAa;ACTf","file":"pfe-badge.css","sourcesContent":["@import \"../../pfe-sass/pfe-sass\";\n$LOCAL: badge;\n\n$LOCAL-VARIABLES: (\n BackgroundColor: pfe-var(feedback--default--lightest),\n BorderRadius: calc(#{pfe-var(ui--border-radius)} * 30),\n\n Color: pfe-var(text),\n\n FontSize: calc(#{pfe-var(font-size)} * 0.75),\n FontWeight: pfe-var(font-weight--semi-bold),\n\n MinWidth: calc(#{pfe-var(ui--border-width)} * 2),\n\n PaddingLeft: calc(#{pfe-var(container-padding)} / 2),\n PaddingRight: calc(#{pfe-var(container-padding)} / 2)\n);\n\n:host {\n display: inline-block;\n line-height: calc(#{pfe-var(line-height)} * 0.75);\n text-align: center;\n text-rendering: optimizelegibility;\n}\n\nspan {\n background-color: pfe-local(BackgroundColor);\n border-radius: pfe-local(BorderRadius);\n color: pfe-local(Color);\n font-size: pfe-local(FontSize);\n font-weight: pfe-local(FontWeight);\n min-width: pfe-local(MinWidth);\n padding-left: pfe-local(PaddingLeft);\n padding-right: pfe-local(PaddingRight);\n}\n\n@each $state in (moderate, important, critical, success, info) {\n :host([state=\"#{$state}\"]) {\n $state: (\n BackgroundColor: pfe-var(feedback--#{$state}),\n Color: pfe-var(text--on-dark)\n );\n\n @if ($state == 'moderate') {\n $state: map-merge($state, (Color: pfe-var(text)));\n }\n\n span {\n @include pfe-print-local($state);\n }\n }\n}\n\n:host([hidden]) {\n display: none;\n}\n",":host {\n display: inline-block;\n line-height: calc(var(--pfe-theme--line-height, 1.5) * 0.75);\n text-align: center;\n text-rendering: optimizelegibility;\n}\n\nspan {\n background-color: var(--pfe-badge--BackgroundColor, var(--pfe-theme--color--feedback--default--lightest, #f0f0f0));\n border-radius: var(--pfe-badge--BorderRadius, calc(var(--pfe-theme--ui--border-radius, 2px) * 30));\n color: var(--pfe-badge--Color, var(--pfe-theme--color--text, #151515));\n font-size: var(--pfe-badge--FontSize, calc(var(--pfe-theme--font-size, 1rem) * 0.75));\n font-weight: var(--pfe-badge--FontWeight, var(--pfe-theme--font-weight--semi-bold, 600));\n min-width: var(--pfe-badge--MinWidth, calc(var(--pfe-theme--ui--border-width, 1px) * 2));\n padding-left: var(--pfe-badge--PaddingLeft, calc(var(--pfe-theme--container-padding, 1rem) / 2));\n padding-right: var(--pfe-badge--PaddingRight, calc(var(--pfe-theme--container-padding, 1rem) / 2));\n}\n\n:host([state=\"moderate\"]) span {\n --pfe-badge--BackgroundColor: var(--pfe-theme--color--feedback--moderate, #f0ab00);\n --pfe-badge--Color: var(--pfe-theme--color--text--on-dark, #fff);\n}\n\n:host([state=\"important\"]) span {\n --pfe-badge--BackgroundColor: var(--pfe-theme--color--feedback--important, #c9190b);\n --pfe-badge--Color: var(--pfe-theme--color--text--on-dark, #fff);\n}\n\n:host([state=\"critical\"]) span {\n --pfe-badge--BackgroundColor: var(--pfe-theme--color--feedback--critical, #a30000);\n --pfe-badge--Color: var(--pfe-theme--color--text--on-dark, #fff);\n}\n\n:host([state=\"success\"]) span {\n --pfe-badge--BackgroundColor: var(--pfe-theme--color--feedback--success, #3e8635);\n --pfe-badge--Color: var(--pfe-theme--color--text--on-dark, #fff);\n}\n\n:host([state=\"info\"]) span {\n --pfe-badge--BackgroundColor: var(--pfe-theme--color--feedback--info, #06c);\n --pfe-badge--Color: var(--pfe-theme--color--text--on-dark, #fff);\n}\n\n:host([hidden]) {\n display: none;\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// This will print all the broadcast variables, and set the value to the context of your choosing, like on-dark or on-saturated.\n/// @param {String} $context - Look up values from contexts, i.e. \"light\" or \"saturated\"\n/// @param {List | String} $broadcast [$BROADCAST-VARS] - Optionally specify only one broadcast variable instead of the whole set, i.e. \"text\"\n/// @see $custom-prop-prefix\n/// @see $BROADCAST-VARS\n/// @example - scss - Usage in a container component, i.e. pfe-card\n/// :host {\n/// @include pfe-set-broadcast-context(dark);\n/// }\n/// @example - css - Rendered output\n/// :host {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n///\n@mixin pfe-set-broadcast-context($context, $broadcast: $BROADCAST-VARS) {\n @each $type in $broadcast {\n $list: ();\n $string: \"\";\n $context_string: \"\";\n $state: \"\";\n\n @if str-starts-with($type, \"link\") {\n $list: append($list, \"#{$type}\");\n\n @each $s in (hover, focus, visited) {\n $state: \"--#{$s}\";\n $string: \"#{$type}#{$state}\";\n\n @if not index($list, $string) {\n $list: append($list, \"#{$type}#{$state}\");\n }\n }\n } @else {\n @if not index($list, $string) {\n $list: append($list, \"#{$type}\");\n }\n }\n\n @if index($CONTEXTS, $context) != null {\n @if $context != \"light\" {\n $context_string: \"--on-#{$context}\";\n }\n }\n\n @each $item in $list {\n @if not index($BROADCAST-VARS, $type) {\n @warn \"--#{$custom-prop-prefix}-broadcasted--#{$item} variable is not in the $BROADCAST-VARS list.\";\n } @else if not pfe-broadcasted(#{$item}#{$context_string}) {\n @warn \"#{$item}#{$context_string} value does not currently exist.\";\n } @else {\n @if index($CONTEXTS, $context) != null {\n --#{$custom-prop-prefix}-broadcasted--#{$item}: #{pfe-var(#{$item}#{$context_string})};\n } @else {\n @error \"The #{$context} context does not appear to be part of a supported context.\";\n }\n }\n }\n }\n}\n\n/// Returns CSS Variable for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $value - The value of the css variable being defined\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example - scss\n/// :host {\n/// padding-top: pfe-local(paddingTop);\n/// padding-bottom: pfe-local(paddingBottom);\n/// }\n@mixin pfe-print-local($map: $LOCAL-VARIABLES) {\n @each $property, $value in $map {\n $name: \"--#{$property}\";\n $styles: $value;\n\n @if type-of($value) == \"map\" {\n @each $prop, $v in $value {\n $name: \"__#{$property}--#{$prop}\";\n $styles: $v;\n\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n } @else {\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n }\n}\n\n/// Surface properties\n/// This mixin creates an attribute for all the surface colors, then prints the local background color variable for the component, with the correct context colors.\n/// @param {List | String} $surfaces [$SURFACES] - defaults to the global $SURFACES list of all supported colors\n/// @param {String} $attr-name [pfe-var] - defaults to pfe-var, optionally pass in a custom name for the data attribute\n/// @example - scss - In your component stylesheet\n/// $LOCAL: band;\n/// @include pfe-surfaces;\n/// @example - css - Rendered result\n/// :host([color=\"darker\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darker, #464646);\n/// --context: dark;\n/// }\n/// :host([color=\"darkest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darkest, #131313);\n/// --context: dark;\n/// }\n/// :host([color=\"base\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--base, #dfdfdf);\n/// --context: light;\n/// }\n/// :host([color=\"lighter\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lighter, #ececec);\n/// --context: light;\n/// }\n/// :host([color=\"lightest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n/// --context: light;\n/// }\n/// :host([color=\"accent\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--accent, #ee0000);\n/// --context: saturated;\n/// }\n/// :host([color=\"complement\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--complement, #0477a4);\n/// --context: saturated;\n/// }\n@mixin pfe-surfaces($surfaces: $SURFACE, $attr-name: color) {\n @each $color in $surfaces {\n $context: #{pfe-get-context(surface--#{$color}--context)};\n :host([#{$attr-name}=\"#{$color}\"]) {\n @include pfe-print-local(\n (\n BackgroundColor: pfe-var(surface--#{$color}),\n context: pfe-var(surface--#{$color}--context, #{$context})\n )\n );\n @extend %fallback-surface;\n }\n }\n}\n\n/// Prints the `on` attribute with IE11 fallbacks\n/// @param {List} contexts [$CONTEXTS] - defaults to the global $CONTEXTS list of all supported contexts\n/// @param {Boolean} ie-fallback [true] - defaults to true, prints IE11 fallbacks\n/// @example - scss - In your component styles\n/// @include pfe-contexts; // imports on=\"light\" etc support\n/// @example - css - Rendered outputs\n/// :host([on=\"dark\"]) {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n/// @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n/// :host([on=\"dark\"]) {\n/// color: #fff;\n/// color: var(--pfe-theme--color--text--on-dark, #fff);\n/// }\n/// }\n/// // ...as well as all the values for :host([on=\"saturated\"]) and :host([on=\"light\"])\n@mixin pfe-contexts($contexts: $CONTEXTS, $ie-fallback: true) {\n // Helper attributes to aid in theming\n @each $context in $contexts {\n :host([on=\"#{$context}\"]) {\n @include pfe-set-broadcast-context($context);\n }\n }\n @if $ie-fallback {\n :host {\n @extend %fallback-text;\n }\n }\n}\n"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-badge/dist/pfe-badge.js b/elements/pfe-badge/dist/pfe-badge.js new file mode 100644 index 0000000000..cb724f2bd2 --- /dev/null +++ b/elements/pfe-badge/dist/pfe-badge.js @@ -0,0 +1,109 @@ +import PFElement from '../../pfelement/dist/pfelement.js'; + +/*! + * PatternFly Elements: PfeBadge 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/ + +class PfeBadge extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + +`; + } + + static get tag() { + return "pfe-badge"; + } + + get templateUrl() { + return "pfe-badge.html"; + } + + get styleUrl() { + return "pfe-badge.scss"; + } + + static get properties() { + return { + state: { + title: "State", + type: String, + values: ["default", "moderate", "important", "critical", "success", "info"], + default: "default" + }, + // @TODO: Deprecated property in 1.0 + pfeState: { + type: String, + prefix: false, + alias: "state" + }, + number: { + title: "Number", + type: Number, + observer: "_numberChanged" + }, + threshold: { + title: "Threshold", + type: Number, + observer: "_thresholdChanged" + }, + // @TODO: Deprecated property in 1.0 + pfeThreshold: { + type: Number, + alias: "threshold", + prefix: false + } + }; + } + + constructor() { + super(PfeBadge); + this._textContainer = this.shadowRoot.querySelector("span"); + } + + attributeChangedCallback(attr, oldVal, newVal) { + super.attributeChangedCallback(...arguments); + this._textContainer.textContent = this.textContent; + } + + _thresholdChanged(oldVal, newVal) { + this.textContent = Number(this.threshold) < Number(this.textContent) ? `${this.threshold}+` : this.textContent; + } + + _numberChanged(oldVal, newVal) { + this.textContent = this.threshold && Number(this.threshold) < Number(newVal) ? `${this.threshold}+` : newVal; + } +} + +PFElement.create(PfeBadge); + +export default PfeBadge; +//# sourceMappingURL=pfe-badge.js.map diff --git a/elements/pfe-badge/dist/pfe-badge.js.map b/elements/pfe-badge/dist/pfe-badge.js.map new file mode 100644 index 0000000000..f284b8d087 --- /dev/null +++ b/elements/pfe-badge/dist/pfe-badge.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-badge.js","sources":["../_temp/pfe-badge.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeBadge 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\nclass PfeBadge extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n static get tag() {\n return \"pfe-badge\";\n }\n\n get templateUrl() {\n return \"pfe-badge.html\";\n }\n\n get styleUrl() {\n return \"pfe-badge.scss\";\n }\n\n static get properties() {\n return {\n state: {\n title: \"State\",\n type: String,\n values: [\"default\", \"moderate\", \"important\", \"critical\", \"success\", \"info\"],\n default: \"default\"\n },\n // @TODO: Deprecated property in 1.0\n pfeState: {\n type: String,\n prefix: false,\n alias: \"state\"\n },\n number: {\n title: \"Number\",\n type: Number,\n observer: \"_numberChanged\"\n },\n threshold: {\n title: \"Threshold\",\n type: Number,\n observer: \"_thresholdChanged\"\n },\n // @TODO: Deprecated property in 1.0\n pfeThreshold: {\n type: Number,\n alias: \"threshold\",\n prefix: false\n }\n };\n }\n\n constructor() {\n super(PfeBadge);\n this._textContainer = this.shadowRoot.querySelector(\"span\");\n }\n\n attributeChangedCallback(attr, oldVal, newVal) {\n super.attributeChangedCallback(...arguments);\n this._textContainer.textContent = this.textContent;\n }\n\n _thresholdChanged(oldVal, newVal) {\n this.textContent = Number(this.threshold) < Number(this.textContent) ? `${this.threshold}+` : this.textContent;\n }\n\n _numberChanged(oldVal, newVal) {\n this.textContent = this.threshold && Number(this.threshold) < Number(newVal) ? `${this.threshold}+` : newVal;\n }\n}\n\nPFElement.create(PfeBadge);\n\nexport default PfeBadge;\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA,MAAM,QAAQ,SAAS,SAAS,CAAC;AACjC;AACA;AACA,EAAE,WAAW,OAAO,GAAG;AACvB,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA;AACA,EAAE,IAAI,IAAI,GAAG;AACb,IAAI,OAAO,CAAC;AACZ;AACA,aAAa,CAAC,CAAC;AACf,GAAG;AACH;AACA,EAAE,WAAW,GAAG,GAAG;AACnB,IAAI,OAAO,WAAW,CAAC;AACvB,GAAG;AACH;AACA,EAAE,IAAI,WAAW,GAAG;AACpB,IAAI,OAAO,gBAAgB,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,QAAQ,GAAG;AACjB,IAAI,OAAO,gBAAgB,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,WAAW,UAAU,GAAG;AAC1B,IAAI,OAAO;AACX,MAAM,KAAK,EAAE;AACb,QAAQ,KAAK,EAAE,OAAO;AACtB,QAAQ,IAAI,EAAE,MAAM;AACpB,QAAQ,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC;AACnF,QAAQ,OAAO,EAAE,SA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ACH;AACA,EAAE,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE;AACjC,IAAI,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AACjH,GAAG;AACH,CAAC;AACD;AACA,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC;;;;"} \ No newline at end of file diff --git a/elements/pfe-badge/dist/pfe-badge.json b/elements/pfe-badge/dist/pfe-badge.json new file mode 100644 index 0000000000..247b269fc0 --- /dev/null +++ b/elements/pfe-badge/dist/pfe-badge.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Badge", + "description": "This element creates a badge with a numerical value.", + "type": "object", + "tag": "pfe-badge", + "class": "pfe-badge", + "category": "content", + "properties": { + "slots": { + "title": "Slots", + "description": "Definition of the supported slots", + "type": "object", + "properties": {} + }, + "attributes": { + "title": "Attributes", + "type": "object", + "properties": { + "state": { + "title": "Background color", + "type": "string", + "enum": ["default", "moderate", "important", "critical", "success", "info"], + "default": "default", + "prefixed": true + }, + "number": { + "title": "Numeric Value", + "type": "number", + "prefixed": false + }, + "pfe-threshold": { + "title": "Threshold Value", + "type": "number", + "prefixed": false + } + } + } + }, + "required": ["slots", "attributes"], + "additionalProperties": false +} diff --git a/elements/pfe-badge/dist/pfe-badge.min.css.map b/elements/pfe-badge/dist/pfe-badge.min.css.map new file mode 100644 index 0000000000..ce1dd6c14e --- /dev/null +++ b/elements/pfe-badge/dist/pfe-badge.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/pfe-badge.scss","../../../pfe-sass/mixins/_custom-properties.scss"],"names":[],"mappings":"AAkBA,MACE,QAAA,aACA,YAAA,gBAAA,YAAA,8CACA,WAAA,OACA,eAAA,mBAGF,KACE,iBAAA,QAAA,iBAAA,+FACA,cAAA,eAAA,cAAA,kFACA,MAAA,QAAA,MAAA,8DACA,UAAA,iBAAA,UAAA,wEACA,YAAA,IAAA,YAAA,0EACA,UAAA,cAAA,UAAA,4EACA,aAAA,eAAA,aAAA,gFACA,cAAA,eAAA,cAAA,iFAIA,6BC+DI,6BAAA,qDAAA,mBAAA,6CD/DJ,8BC+DI,6BAAA,sDAAA,mBAAA,6CD/DJ,6BC+DI,6BAAA,qDAAA,mBAAA,6CD/DJ,4BC+DI,6BAAA,oDAAA,mBAAA,6CD/DJ,yBC+DI,6BAAA,8CAAA,mBAAA,6CD/CN,gBACE,QAAA","file":"pfe-badge.min.css","sourceRoot":"../src","sourcesContent":[]} \ No newline at end of file diff --git a/elements/pfe-badge/dist/pfe-badge.min.js b/elements/pfe-badge/dist/pfe-badge.min.js new file mode 100644 index 0000000000..0bc16b723a --- /dev/null +++ b/elements/pfe-badge/dist/pfe-badge.min.js @@ -0,0 +1,26 @@ +import e from"../../pfelement/dist/pfelement.min.js"; +/*! + * PatternFly Elements: PfeBadge 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/class t extends e{static get version(){return"1.3.0"}get html(){return"\n\n"}static get tag(){return"pfe-badge"}get templateUrl(){return"pfe-badge.html"}get styleUrl(){return"pfe-badge.scss"}static get properties(){return{state:{title:"State",type:String,values:["default","moderate","important","critical","success","info"],default:"default"},pfeState:{type:String,prefix:!1,alias:"state"},number:{title:"Number",type:Number,observer:"_numberChanged"},threshold:{title:"Threshold",type:Number,observer:"_thresholdChanged"},pfeThreshold:{type:Number,alias:"threshold",prefix:!1}}}constructor(){super(t),this._textContainer=this.shadowRoot.querySelector("span")}attributeChangedCallback(e,t,r){super.attributeChangedCallback(...arguments),this._textContainer.textContent=this.textContent}_thresholdChanged(e,t){this.textContent=Number(this.threshold):host{display:inline-block;line-height:calc(1.5 * .75);line-height:calc(var(--pfe-theme--line-height,1.5) * .75);text-align:center;text-rendering:optimizelegibility}span{background-color:#f0f0f0;background-color:var(--pfe-badge--BackgroundColor,var(--pfe-theme--color--feedback--default--lightest,#f0f0f0));border-radius:calc(2px * 30);border-radius:var(--pfe-badge--BorderRadius,calc(var(--pfe-theme--ui--border-radius,2px) * 30));color:#151515;color:var(--pfe-badge--Color,var(--pfe-theme--color--text,#151515));font-size:calc(1rem * .75);font-size:var(--pfe-badge--FontSize,calc(var(--pfe-theme--font-size,1rem) * .75));font-weight:600;font-weight:var(--pfe-badge--FontWeight,var(--pfe-theme--font-weight--semi-bold,600));min-width:calc(1px * 2);min-width:var(--pfe-badge--MinWidth,calc(var(--pfe-theme--ui--border-width,1px) * 2));padding-left:calc(1rem / 2);padding-left:var(--pfe-badge--PaddingLeft,calc(var(--pfe-theme--container-padding,1rem)/ 2));padding-right:calc(1rem / 2);padding-right:var(--pfe-badge--PaddingRight,calc(var(--pfe-theme--container-padding,1rem)/ 2))}:host([state=moderate]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--moderate, #f0ab00);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=important]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--important, #c9190b);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=critical]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--critical, #a30000);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=success]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--success, #3e8635);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=info]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--info, #06c);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([hidden]){display:none} /*# sourceMappingURL=pfe-badge.min.css.map */\n`;\n }\n\n static get tag() {\n return \"pfe-badge\";\n }\n\n get templateUrl() {\n return \"pfe-badge.html\";\n }\n\n get styleUrl() {\n return \"pfe-badge.scss\";\n }\n\n static get properties() {\n return {\n state: {\n title: \"State\",\n type: String,\n values: [\"default\", \"moderate\", \"important\", \"critical\", \"success\", \"info\"],\n default: \"default\"\n },\n // @TODO: Deprecated property in 1.0\n pfeState: {\n type: String,\n prefix: false,\n alias: \"state\"\n },\n number: {\n title: \"Number\",\n type: Number,\n observer: \"_numberChanged\"\n },\n threshold: {\n title: \"Threshold\",\n type: Number,\n observer: \"_thresholdChanged\"\n },\n // @TODO: Deprecated property in 1.0\n pfeThreshold: {\n type: Number,\n alias: \"threshold\",\n prefix: false\n }\n };\n }\n\n constructor() {\n super(PfeBadge);\n this._textContainer = this.shadowRoot.querySelector(\"span\");\n }\n\n attributeChangedCallback(attr, oldVal, newVal) {\n super.attributeChangedCallback(...arguments);\n this._textContainer.textContent = this.textContent;\n }\n\n _thresholdChanged(oldVal, newVal) {\n this.textContent = Number(this.threshold) < Number(this.textContent) ? `${this.threshold}+` : this.textContent;\n }\n\n _numberChanged(oldVal, newVal) {\n this.textContent = this.threshold && Number(this.threshold) < Number(newVal) ? `${this.threshold}+` : newVal;\n }\n}\n\nPFElement.create(PfeBadge);\n\nexport default PfeBadge;\n"],"names":["PfeBadge","PFElement","version","html","tag","templateUrl","styleUrl","properties","state","title","type","String","values","default","pfeState","prefix","alias","number","Number","observer","threshold","pfeThreshold","[object Object]","super","this","_textContainer","shadowRoot","querySelector","attr","oldVal","newVal","attributeChangedCallback","arguments","textContent","create"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAMA,UAAiBC,EAGrBC,qBACE,MAAO,QAITC,WACE,MAAO,sgEAKTC,iBACE,MAAO,YAGTC,kBACE,MAAO,iBAGTC,eACE,MAAO,iBAGTC,wBACE,MAAO,CACLC,MAAO,CACLC,MAAO,QACPC,KAAMC,OACNC,OAAQ,CAAC,UAAW,WAAY,YAAa,WAAY,UAAW,QACpEC,QAAS,WAGXC,SAAU,CACRJ,KAAMC,OACNI,QAAQ,EACRC,MAAO,SAETC,OAAQ,CACNR,MAAO,SACPC,KAAMQ,OACNC,SAAU,kBAEZC,UAAW,CACTX,MAAO,YACPC,KAAMQ,OACNC,SAAU,qBAGZE,aAAc,CACZX,KAAMQ,OACNF,MAAO,YACPD,QAAQ,IAKdO,cACEC,MAAMvB,GACNwB,KAAKC,eAAiBD,KAAKE,WAAWC,cAAc,QAGtDL,yBAAyBM,EAAMC,EAAQC,GACrCP,MAAMQ,4BAA4BC,WAClCR,KAAKC,eAAeQ,YAAcT,KAAKS,YAGzCX,kBAAkBO,EAAQC,GACxBN,KAAKS,YAAcf,OAAOM,KAAKJ,WAAaF,OAAOM,KAAKS,gBAAkBT,KAAKJ,aAAeI,KAAKS,YAGrGX,eAAeO,EAAQC,GACrBN,KAAKS,YAAcT,KAAKJ,WAAaF,OAAOM,KAAKJ,WAAaF,OAAOY,MAAaN,KAAKJ,aAAeU,GAI1G7B,EAAUiC,OAAOlC"} \ No newline at end of file diff --git a/elements/pfe-badge/dist/pfe-badge.umd.js b/elements/pfe-badge/dist/pfe-badge.umd.js new file mode 100644 index 0000000000..7c17b6b832 --- /dev/null +++ b/elements/pfe-badge/dist/pfe-badge.umd.js @@ -0,0 +1,210 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../../pfelement/dist/pfelement.umd')) : + typeof define === 'function' && define.amd ? define(['../../pfelement/dist/pfelement.umd'], factory) : + (global = global || self, global.PfeBadge = factory(global.PFElement)); +}(this, (function (PFElement) { 'use strict'; + + PFElement = PFElement && Object.prototype.hasOwnProperty.call(PFElement, 'default') ? PFElement['default'] : PFElement; + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } + }; + + var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + }; + + var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + }; + + /*! + * PatternFly Elements: PfeBadge 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + var PfeBadge = function (_PFElement) { + inherits(PfeBadge, _PFElement); + createClass(PfeBadge, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n"; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-badge.html"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-badge.scss"; + } + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "tag", + get: function get() { + return "pfe-badge"; + } + }, { + key: "properties", + get: function get() { + return { + state: { + title: "State", + type: String, + values: ["default", "moderate", "important", "critical", "success", "info"], + default: "default" + }, + // @TODO: Deprecated property in 1.0 + pfeState: { + type: String, + prefix: false, + alias: "state" + }, + number: { + title: "Number", + type: Number, + observer: "_numberChanged" + }, + threshold: { + title: "Threshold", + type: Number, + observer: "_thresholdChanged" + }, + // @TODO: Deprecated property in 1.0 + pfeThreshold: { + type: Number, + alias: "threshold", + prefix: false + } + }; + } + }]); + + function PfeBadge() { + classCallCheck(this, PfeBadge); + + var _this = possibleConstructorReturn(this, (PfeBadge.__proto__ || Object.getPrototypeOf(PfeBadge)).call(this, PfeBadge)); + + _this._textContainer = _this.shadowRoot.querySelector("span"); + return _this; + } + + createClass(PfeBadge, [{ + key: "attributeChangedCallback", + value: function attributeChangedCallback(attr, oldVal, newVal) { + get(PfeBadge.prototype.__proto__ || Object.getPrototypeOf(PfeBadge.prototype), "attributeChangedCallback", this).apply(this, arguments); + this._textContainer.textContent = this.textContent; + } + }, { + key: "_thresholdChanged", + value: function _thresholdChanged(oldVal, newVal) { + this.textContent = Number(this.threshold) < Number(this.textContent) ? this.threshold + "+" : this.textContent; + } + }, { + key: "_numberChanged", + value: function _numberChanged(oldVal, newVal) { + this.textContent = this.threshold && Number(this.threshold) < Number(newVal) ? this.threshold + "+" : newVal; + } + }]); + return PfeBadge; + }(PFElement); + + PFElement.create(PfeBadge); + + return PfeBadge; + +}))); +//# sourceMappingURL=pfe-badge.umd.js.map diff --git a/elements/pfe-badge/dist/pfe-badge.umd.js.map b/elements/pfe-badge/dist/pfe-badge.umd.js.map new file mode 100644 index 0000000000..3c20992051 --- /dev/null +++ b/elements/pfe-badge/dist/pfe-badge.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-badge.umd.js","sources":["../_temp/pfe-badge.umd.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeBadge 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\n\nclass PfeBadge extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n static get tag() {\n return \"pfe-badge\";\n }\n\n get templateUrl() {\n return \"pfe-badge.html\";\n }\n\n get styleUrl() {\n return \"pfe-badge.scss\";\n }\n\n static get properties() {\n return {\n state: {\n title: \"State\",\n type: String,\n values: [\"default\", \"moderate\", \"important\", \"critical\", \"success\", \"info\"],\n default: \"default\"\n },\n // @TODO: Deprecated property in 1.0\n pfeState: {\n type: String,\n prefix: false,\n alias: \"state\"\n },\n number: {\n title: \"Number\",\n type: Number,\n observer: \"_numberChanged\"\n },\n threshold: {\n title: \"Threshold\",\n type: Number,\n observer: \"_thresholdChanged\"\n },\n // @TODO: Deprecated property in 1.0\n pfeThreshold: {\n type: Number,\n alias: \"threshold\",\n prefix: false\n }\n };\n }\n\n constructor() {\n super(PfeBadge);\n this._textContainer = this.shadowRoot.querySelector(\"span\");\n }\n\n attributeChangedCallback(attr, oldVal, newVal) {\n super.attributeChangedCallback(...arguments);\n this._textContainer.textContent = this.textContent;\n }\n\n _thresholdChanged(oldVal, newVal) {\n this.textContent = Number(this.threshold) < Number(this.textContent) ? `${this.threshold}+` : this.textContent;\n }\n\n _numberChanged(oldVal, newVal) {\n this.textContent = this.threshold && Number(this.threshold) < Number(newVal) ? `${this.threshold}+` : newVal;\n }\n}\n\nPFElement.create(PfeBadge);\n\nexport default PfeBadge;\n"],"names":["PfeBadge","state","title","type","String","values","default","pfeState","prefix","alias","number","Number","observer","threshold","pfeThreshold","_textContainer","shadowRoot","querySelector","attr","oldVal","newVal","arguments","textContent","PFElement","create"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;MA2BMA;;;;;;EAOJ;0BACW;EACT;EAGD;;;0BAMiB;EAChB,aAAO,gBAAP;EACD;;;0BAEc;EACb,aAAO,gBAAP;EACD;;;;;EAtBD;0BACqB;EACnB,aAAO,OAAP;EACD;;;0BASgB;EACf,aAAO,WAAP;EACD;;;0BAUuB;EACtB,aAAO;EACLC,eAAO;EACLC,iBAAO,OADF;EAELC,gBAAMC,MAFD;EAGLC,kBAAQ,CAAC,SAAD,EAAY,UAAZ,EAAwB,WAAxB,EAAqC,UAArC,EAAiD,SAAjD,EAA4D,MAA5D,CAHH;EAILC,mBAAS;EAJJ,SADF;EAOL;EACAC,kBAAU;EACRJ,gBAAMC,MADE;EAERI,kBAAQ,KAFA;EAGRC,iBAAO;EAHC,SARL;EAaLC,gBAAQ;EACNR,iBAAO,QADD;EAENC,gBAAMQ,MAFA;EAGNC,oBAAU;EAHJ,SAbH;EAkBLC,mBAAW;EACTX,iBAAO,WADE;EAETC,gBAAMQ,MAFG;EAGTC,oBAAU;EAHD,SAlBN;EAuBL;EACAE,sBAAc;EACZX,gBAAMQ,MADM;EAEZF,iBAAO,WAFK;EAGZD,kBAAQ;EAHI;EAxBT,OAAP;EA8BD;;;EAED,sBAAc;EAAA;;EAAA,mHACNR,QADM;;EAEZ,UAAKe,cAAL,GAAsB,MAAKC,UAAL,CAAgBC,aAAhB,CAA8B,MAA9B,CAAtB;EAFY;EAGb;;;;+CAEwBC,MAAMC,QAAQC,QAAQ;EAC7C,mIAAkCC,SAAlC;EACA,WAAKN,cAAL,CAAoBO,WAApB,GAAkC,KAAKA,WAAvC;EACD;;;wCAEiBH,QAAQC,QAAQ;EAChC,WAAKE,WAAL,GAAmBX,OAAO,KAAKE,SAAZ,IAAyBF,OAAO,KAAKW,WAAZ,CAAzB,GAAuD,KAAKT,SAA5D,SAA2E,KAAKS,WAAnG;EACD;;;qCAEcH,QAAQC,QAAQ;EAC7B,WAAKE,WAAL,GAAmB,KAAKT,SAAL,IAAkBF,OAAO,KAAKE,SAAZ,IAAyBF,OAAOS,MAAP,CAA3C,GAA+D,KAAKP,SAApE,SAAmFO,MAAtG;EACD;;;IA3EoBG;;EA8EvBA,UAAUC,MAAV,CAAiBxB,QAAjB;;;;;;;;"} \ No newline at end of file diff --git a/elements/pfe-badge/dist/pfe-badge.umd.min.js b/elements/pfe-badge/dist/pfe-badge.umd.min.js new file mode 100644 index 0000000000..2887bbaa53 --- /dev/null +++ b/elements/pfe-badge/dist/pfe-badge.umd.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../pfelement/dist/pfelement.umd.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min"],t):(e=e||self).PfeBadge=t(e.PFElement)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),e};function o(e,t){for(var r=0;r:host{display:inline-block;line-height:calc(1.5 * .75);line-height:calc(var(--pfe-theme--line-height,1.5) * .75);text-align:center;text-rendering:optimizelegibility}span{background-color:#f0f0f0;background-color:var(--pfe-badge--BackgroundColor,var(--pfe-theme--color--feedback--default--lightest,#f0f0f0));border-radius:calc(2px * 30);border-radius:var(--pfe-badge--BorderRadius,calc(var(--pfe-theme--ui--border-radius,2px) * 30));color:#151515;color:var(--pfe-badge--Color,var(--pfe-theme--color--text,#151515));font-size:calc(1rem * .75);font-size:var(--pfe-badge--FontSize,calc(var(--pfe-theme--font-size,1rem) * .75));font-weight:600;font-weight:var(--pfe-badge--FontWeight,var(--pfe-theme--font-weight--semi-bold,600));min-width:calc(1px * 2);min-width:var(--pfe-badge--MinWidth,calc(var(--pfe-theme--ui--border-width,1px) * 2));padding-left:calc(1rem / 2);padding-left:var(--pfe-badge--PaddingLeft,calc(var(--pfe-theme--container-padding,1rem)/ 2));padding-right:calc(1rem / 2);padding-right:var(--pfe-badge--PaddingRight,calc(var(--pfe-theme--container-padding,1rem)/ 2))}:host([state=moderate]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--moderate, #f0ab00);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=important]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--important, #c9190b);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=critical]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--critical, #a30000);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=success]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--success, #3e8635);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=info]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--info, #06c);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([hidden]){display:none} /*# sourceMappingURL=pfe-badge.min.css.map */\n"}},{key:"templateUrl",get:function(){return"pfe-badge.html"}},{key:"styleUrl",get:function(){return"pfe-badge.scss"}}],[{key:"version",get:function(){return"1.3.0"}},{key:"tag",get:function(){return"pfe-badge"}},{key:"properties",get:function(){return{state:{title:"State",type:String,values:["default","moderate","important","critical","success","info"],default:"default"},pfeState:{type:String,prefix:!1,alias:"state"},number:{title:"Number",type:Number,observer:"_numberChanged"},threshold:{title:"Threshold",type:Number,observer:"_thresholdChanged"},pfeThreshold:{type:Number,alias:"threshold",prefix:!1}}}}]),r(i,[{key:"attributeChangedCallback",value:function(e,t,r){n(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"attributeChangedCallback",this).apply(this,arguments),this._textContainer.textContent=this.textContent}},{key:"_thresholdChanged",value:function(e,t){this.textContent=Number(this.threshold):host{display:inline-block;line-height:calc(1.5 * .75);line-height:calc(var(--pfe-theme--line-height,1.5) * .75);text-align:center;text-rendering:optimizelegibility}span{background-color:#f0f0f0;background-color:var(--pfe-badge--BackgroundColor,var(--pfe-theme--color--feedback--default--lightest,#f0f0f0));border-radius:calc(2px * 30);border-radius:var(--pfe-badge--BorderRadius,calc(var(--pfe-theme--ui--border-radius,2px) * 30));color:#151515;color:var(--pfe-badge--Color,var(--pfe-theme--color--text,#151515));font-size:calc(1rem * .75);font-size:var(--pfe-badge--FontSize,calc(var(--pfe-theme--font-size,1rem) * .75));font-weight:600;font-weight:var(--pfe-badge--FontWeight,var(--pfe-theme--font-weight--semi-bold,600));min-width:calc(1px * 2);min-width:var(--pfe-badge--MinWidth,calc(var(--pfe-theme--ui--border-width,1px) * 2));padding-left:calc(1rem / 2);padding-left:var(--pfe-badge--PaddingLeft,calc(var(--pfe-theme--container-padding,1rem)/ 2));padding-right:calc(1rem / 2);padding-right:var(--pfe-badge--PaddingRight,calc(var(--pfe-theme--container-padding,1rem)/ 2))}:host([state=moderate]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--moderate, #f0ab00);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=important]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--important, #c9190b);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=critical]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--critical, #a30000);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=success]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--success, #3e8635);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([state=info]) span{--pfe-badge--BackgroundColor:var(--pfe-theme--color--feedback--info, #06c);--pfe-badge--Color:var(--pfe-theme--color--text--on-dark, #fff)}:host([hidden]){display:none} /*# sourceMappingURL=pfe-badge.min.css.map */\n`;\n }\n\n static get tag() {\n return \"pfe-badge\";\n }\n\n get templateUrl() {\n return \"pfe-badge.html\";\n }\n\n get styleUrl() {\n return \"pfe-badge.scss\";\n }\n\n static get properties() {\n return {\n state: {\n title: \"State\",\n type: String,\n values: [\"default\", \"moderate\", \"important\", \"critical\", \"success\", \"info\"],\n default: \"default\"\n },\n // @TODO: Deprecated property in 1.0\n pfeState: {\n type: String,\n prefix: false,\n alias: \"state\"\n },\n number: {\n title: \"Number\",\n type: Number,\n observer: \"_numberChanged\"\n },\n threshold: {\n title: \"Threshold\",\n type: Number,\n observer: \"_thresholdChanged\"\n },\n // @TODO: Deprecated property in 1.0\n pfeThreshold: {\n type: Number,\n alias: \"threshold\",\n prefix: false\n }\n };\n }\n\n constructor() {\n super(PfeBadge);\n this._textContainer = this.shadowRoot.querySelector(\"span\");\n }\n\n attributeChangedCallback(attr, oldVal, newVal) {\n super.attributeChangedCallback(...arguments);\n this._textContainer.textContent = this.textContent;\n }\n\n _thresholdChanged(oldVal, newVal) {\n this.textContent = Number(this.threshold) < Number(this.textContent) ? `${this.threshold}+` : this.textContent;\n }\n\n _numberChanged(oldVal, newVal) {\n this.textContent = this.threshold && Number(this.threshold) < Number(newVal) ? `${this.threshold}+` : newVal;\n }\n}\n\nPFElement.create(PfeBadge);\n\nexport default PfeBadge;\n"],"names":["PfeBadge","PFElement","String","Number","attr","oldVal","newVal","arguments","_textContainer","textContent","this","threshold","_this","shadowRoot","querySelector","create"],"mappings":"ikCA2BMA,+TAAiBC,ylEAmBZ,wDAIA,yDAnBA,0CAWA,qDAYA,OACE,OACE,aACDC,cACE,CAAC,UAAW,WAAY,YAAa,WAAY,UAAW,gBAC3D,oBAGD,MACFA,eACE,QACD,gBAED,OACC,cACDC,gBACI,4BAED,OACF,iBACDA,gBACI,kCAGE,MACNA,aACC,oBACC,4DAUWC,EAAMC,EAAQC,2GACHC,gBAC7BC,eAAeC,YAAcC,KAAKD,sDAGvBJ,EAAQC,QACnBG,YAAcN,OAAOO,KAAKC,WAAaR,OAAOO,KAAKD,aAAkBC,KAAKC,cAAeD,KAAKD,mDAGtFJ,EAAQC,QAChBG,YAAcC,KAAKC,WAAaR,OAAOO,KAAKC,WAAaR,OAAOG,GAAaI,KAAKC,cAAeL,+FAdhGN,aACDQ,eAAiBI,EAAKC,WAAWC,cAAc,iBAiBxDb,EAAUc,OAAOf"} \ No newline at end of file diff --git a/elements/pfe-badge/package.json b/elements/pfe-badge/package.json index ff63d25a09..12d07a5a37 100644 --- a/elements/pfe-badge/package.json +++ b/elements/pfe-badge/package.json @@ -5,7 +5,7 @@ "elementName": "pfe-badge", "preview": "badge--screenshot.png" }, - "version": "1.2.0", + "version": "1.3.0", "description": "Badge element for PatternFly Elements", "keywords": [ "web-components", @@ -57,10 +57,10 @@ ], "license": "MIT", "dependencies": { - "@patternfly/pfelement": "^1.2.0" + "@patternfly/pfelement": "^1.3.0" }, "devDependencies": { - "@patternfly/pfe-sass": "^1.2.0" + "@patternfly/pfe-sass": "^1.3.0" }, "generator-pfelement-version": "1.3.0" } diff --git a/elements/pfe-band/dist/pfe-band.css.map b/elements/pfe-band/dist/pfe-band.css.map new file mode 100644 index 0000000000..03c03380de --- /dev/null +++ b/elements/pfe-band/dist/pfe-band.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../pfe-sass/mixins/_mixins.scss","../../pfe-sass/mixins/_custom-properties.scss","../../pfe-sass/extends/_extends.scss","pfe-band.css","pfe-band.scss","../../pfe-sass/functions/_custom-properties.scss","../../pfe-sass/mixins/_containers.scss","../../pfe-sass/maps/_general.scss","../../../node_modules/@patternfly/pat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A,mBAAA;IP2YE;IC3FF;MMhTA,gBAAA;MAAA,qBAAA;MAAA,mBAAA;IP2YE;IC3FF;MMhTA,gBAAA;MAAA,qBAAA;MAAA,mBAAA;IP2YE;IC3FF;MMhTA,gBAAA;MAAA,qBAAA;MAAA,mBAAA;IP2YE;GO3YF;ENiUM;IACE,iBAAa;IAAb,aAAa;IACb,mBAAwB;IAAxB,wBAAwB;IACxB,qBCrP4B;IDqP5B,0BCrP4B;IDqP5B,qDCrP4B;IDqP5B,0DCrP4B;IDuP5B,kBCvP4B;IDuP5B,gGCvP4B;IDwP5B,aCxP4B;IDwP5B,2FCxP4B;IDyP5B,+BCzP4B;IDyP5B,+GCzP4B;ID0P5B,kCC1P4B;OD0P5B,+BC1P4B;YD0P5B,0BC1P4B;ID0P5B,kHC1P4B;OD0P5B,+GC1P4B;YD0P5B,0GC1P4B;EFqUlC;ECnFI;IMjUN,gBAAA;IAAA,mBAAA;EPoZE;ECnFI;IMjUN,gBAAA;IAAA,mBAAA;EPoZE;AACF;;AHlZM;EAAsF,UAAA;EI+U1F;IEvUE,WAAW;IACX,WAAW;IACX,cAAc;EHgZhB;ECvEA;;;IAGE,WAAW;EDyEb;ECvEE;;;IACE,YAAY;ED2EhB;ECxEE;;;IACE,UAAU;ED4Ed;ECvHA;IAgDE,WAAW;ED0Eb;EC/HF;IAyDI,mBAAY;IAAZ,oBAAY;QAAZ,oBAAY;YAAZ,YAAY;IACZ,8BAAsB;QAAtB,0BAAsB;YAAtB,sBAAsB;IAEtB,YAAY;IAEZ,UAAU;IACV,cAAc;EDuEhB;ECrEE;IACE,WAAW;EDuEf;ECnEA;IACE,UAAU;IACV,WAAW;EDqEb;ECnEE;IACE,YAAY;EDqEhB;AACF","file":"pfe-band.css","sourcesContent":["@mixin browser-query($browser-list) {\n @each $browser in $browser-list {\n @if $browser == ie11 {\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n @content;\n }\n }\n @if $browser == edge12 {\n @supports (-ms-accelerator: true) { /* Microsoft Edge Browser 12+ */\n @content;\n }\n }\n @if $browser == edge {\n @supports (-ms-ime-align: auto) { /* Microsoft Edge Browser 16+ (All) */\n @content;\n }\n }\n @if $browser == firefox {\n @media all and (min--moz-device-pixel-ratio:0) { /* Mozilla Firefox (All) */\n @content;\n }\n }\n }\n}\n\n@mixin pfe-transition($properties...) {\n $return: null;\n @each $property in $properties {\n @if length($property) == 1 {\n $return: append($return, #{$property} 250ms $pfe-global--animation-timing, comma);\n }\n @else if length($property) == 2 {\n $return: append($return, nth($property, 1) nth($property, 2), comma);\n }\n }\n transition: $return;\n}\n\n// Make a CSS arrow\n@mixin pfe-arrow($type, $color, $width: 8px, $height: 5px, $pseudo: false) {\n $direction: (\n up: 180deg,\n down: 0deg,\n right: -90deg,\n left: 90deg,\n );\n border-style: pfe-var(surface--border-style);\n border-width: $width $height 0;\n border-color: transparent;\n border-top-color: $color;\n transform: rotate(map-get($direction, $type));\n @if $pseudo {\n display: inline-block;\n content: \"\";\n @content;\n }\n}\n\n@mixin pfe-arrow-color($color) {\n border-top-color: $color;\n}\n\n@mixin pfe-print-media {\n @media print {\n @content;\n }\n}\n\n@mixin pfe-print-background {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n@mixin pfe-no-print-background {\n @include pfe-print-media {\n background-color: white !important;\n background-image: none !important;\n box-shadow: none !important;\n }\n}\n\n@mixin pfe-hidden {\n @at-root #{&}([hidden]) {\n display: none;\n }\n}\n\n@mixin pfe-pipe( $position: right, $padding: 0, $margin: 0, $color: $border-color) {\n border: pfe-var(surface--border-width) pfe-var(surface--border-style) transparent;\n border-#{$position}-color: $color;\n @if $position == right {\n padding-left: $padding;\n margin-right: $margin;\n }\n @else if $position == left {\n padding-right: $padding;\n margin-left: $margin;\n }\n}\n\n@mixin pfe-retina {\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n @content;\n }\n}\n\n@mixin pfe-icon($path, $display: flex, $size: 1em) {\n display: #{$display};\n @if $path {\n background: #{$path} no-repeat;\n background-size: contain;\n background-position: center;\n }\n width: #{$size};\n height: #{$size};\n @content;\n}\n\n@mixin pfe-local-debug($map: $LOCAL-VARIABLES) {\n :root {\n @include pfe-print-local($map);\n }\n} ","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// This will print all the broadcast variables, and set the value to the context of your choosing, like on-dark or on-saturated.\n/// @param {String} $context - Look up values from contexts, i.e. \"light\" or \"saturated\"\n/// @param {List | String} $broadcast [$BROADCAST-VARS] - Optionally specify only one broadcast variable instead of the whole set, i.e. \"text\"\n/// @see $custom-prop-prefix\n/// @see $BROADCAST-VARS\n/// @example - scss - Usage in a container component, i.e. pfe-card\n/// :host {\n/// @include pfe-set-broadcast-context(dark);\n/// }\n/// @example - css - Rendered output\n/// :host {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n///\n@mixin pfe-set-broadcast-context($context, $broadcast: $BROADCAST-VARS) {\n @each $type in $broadcast {\n $list: ();\n $string: \"\";\n $context_string: \"\";\n $state: \"\";\n\n @if str-starts-with($type, \"link\") {\n $list: append($list, \"#{$type}\");\n\n @each $s in (hover, focus, visited) {\n $state: \"--#{$s}\";\n $string: \"#{$type}#{$state}\";\n\n @if not index($list, $string) {\n $list: append($list, \"#{$type}#{$state}\");\n }\n }\n } @else {\n @if not index($list, $string) {\n $list: append($list, \"#{$type}\");\n }\n }\n\n @if index($CONTEXTS, $context) != null {\n @if $context != \"light\" {\n $context_string: \"--on-#{$context}\";\n }\n }\n\n @each $item in $list {\n @if not index($BROADCAST-VARS, $type) {\n @warn \"--#{$custom-prop-prefix}-broadcasted--#{$item} variable is not in the $BROADCAST-VARS list.\";\n } @else if not pfe-broadcasted(#{$item}#{$context_string}) {\n @warn \"#{$item}#{$context_string} value does not currently exist.\";\n } @else {\n @if index($CONTEXTS, $context) != null {\n --#{$custom-prop-prefix}-broadcasted--#{$item}: #{pfe-var(#{$item}#{$context_string})};\n } @else {\n @error \"The #{$context} context does not appear to be part of a supported context.\";\n }\n }\n }\n }\n}\n\n/// Returns CSS Variable for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $value - The value of the css variable being defined\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example - scss\n/// :host {\n/// padding-top: pfe-local(paddingTop);\n/// padding-bottom: pfe-local(paddingBottom);\n/// }\n@mixin pfe-print-local($map: $LOCAL-VARIABLES) {\n @each $property, $value in $map {\n $name: \"--#{$property}\";\n $styles: $value;\n\n @if type-of($value) == \"map\" {\n @each $prop, $v in $value {\n $name: \"__#{$property}--#{$prop}\";\n $styles: $v;\n\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n } @else {\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n }\n}\n\n/// Surface properties\n/// This mixin creates an attribute for all the surface colors, then prints the local background color variable for the component, with the correct context colors.\n/// @param {List | String} $surfaces [$SURFACES] - defaults to the global $SURFACES list of all supported colors\n/// @param {String} $attr-name [pfe-var] - defaults to pfe-var, optionally pass in a custom name for the data attribute\n/// @example - scss - In your component stylesheet\n/// $LOCAL: band;\n/// @include pfe-surfaces;\n/// @example - css - Rendered result\n/// :host([color=\"darker\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darker, #464646);\n/// --context: dark;\n/// }\n/// :host([color=\"darkest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darkest, #131313);\n/// --context: dark;\n/// }\n/// :host([color=\"base\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--base, #dfdfdf);\n/// --context: light;\n/// }\n/// :host([color=\"lighter\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lighter, #ececec);\n/// --context: light;\n/// }\n/// :host([color=\"lightest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n/// --context: light;\n/// }\n/// :host([color=\"accent\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--accent, #ee0000);\n/// --context: saturated;\n/// }\n/// :host([color=\"complement\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--complement, #0477a4);\n/// --context: saturated;\n/// }\n@mixin pfe-surfaces($surfaces: $SURFACE, $attr-name: color) {\n @each $color in $surfaces {\n $context: #{pfe-get-context(surface--#{$color}--context)};\n :host([#{$attr-name}=\"#{$color}\"]) {\n @include pfe-print-local(\n (\n BackgroundColor: pfe-var(surface--#{$color}),\n context: pfe-var(surface--#{$color}--context, #{$context})\n )\n );\n @extend %fallback-surface;\n }\n }\n}\n\n/// Prints the `on` attribute with IE11 fallbacks\n/// @param {List} contexts [$CONTEXTS] - defaults to the global $CONTEXTS list of all supported contexts\n/// @param {Boolean} ie-fallback [true] - defaults to true, prints IE11 fallbacks\n/// @example - scss - In your component styles\n/// @include pfe-contexts; // imports on=\"light\" etc support\n/// @example - css - Rendered outputs\n/// :host([on=\"dark\"]) {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n/// @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n/// :host([on=\"dark\"]) {\n/// color: #fff;\n/// color: var(--pfe-theme--color--text--on-dark, #fff);\n/// }\n/// }\n/// // ...as well as all the values for :host([on=\"saturated\"]) and :host([on=\"light\"])\n@mixin pfe-contexts($contexts: $CONTEXTS, $ie-fallback: true) {\n // Helper attributes to aid in theming\n @each $context in $contexts {\n :host([on=\"#{$context}\"]) {\n @include pfe-set-broadcast-context($context);\n }\n }\n @if $ie-fallback {\n :host {\n @extend %fallback-text;\n }\n }\n}\n","// @todo Change to mixins; no efficiency gain with placeholders in web components\n\n/// Clear box element styles\n%reset-box {\n margin: 0;\n padding: 0;\n}\n\n/// Clear list styles\n%reset-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/// Clear button styles\n%reset-button {\n background-color: transparent;\n border: none;\n margin: 0;\n padding: 0;\n text-align: left;\n}\n\n/// Set up a container element\n%container {\n position: relative;\n display: block;\n width: 100%;\n padding: pfe-var(container-spacer);\n}\n\n/// Screen-reader only content\n%sr-only {\n position: absolute;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n}\n\n/// Fallback surface styles for IE11 only\n%fallback-surface {\n @include browser-query(ie11) {\n background-color: pfe-fetch(surface--lightest) !important;\n color: pfe-fetch(text) !important;\n }\n}\n\n/// Fallback text styles for IE11 only\n%fallback-text {\n @include browser-query(ie11) {\n color: pfe-fetch(text) !important;\n }\n}\n","@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host([color=\"darker\"]), :host([color=\"darkest\"]), :host([color=\"base\"]), :host([color=\"lighter\"]), :host([color=\"lightest\"]), :host([color=\"accent\"]), :host([color=\"complement\"]) {\n /* IE10+ */\n background-color: #fff !important;\n color: #151515 !important;\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n color: #151515 !important;\n }\n}\n\n:host {\n --context: var(--pfe-band--context, light);\n display: block;\n border: var(--pfe-band--Border, var(--pfe-theme--surface--border-width, 1px) var(--pfe-theme--surface--border-style, solid) transparent);\n background-color: var(--pfe-band--BackgroundColor, var(--pfe-theme--color--surface--base, #f0f0f0));\n background-position: var(--pfe-band--BackgroundPosition, center center);\n color: var(--pfe-broadcasted--text, #3c3f42);\n padding: calc(var(--pfe-band--Padding--vertical, calc( var(--pfe-theme--container-spacer, 1rem) * 4)) / 2) var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1));\n}\n\n@media (min-width: 576px) {\n :host {\n padding: var(--pfe-band--Padding, var(--pfe-band--Padding--vertical, calc( var(--pfe-theme--container-spacer, 1rem) * 4)) var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1)));\n }\n}\n\n:host *,\n:host *::before,\n:host *::after {\n box-sizing: border-box;\n}\n\n@media print {\n :host {\n background-color: white !important;\n background-image: none !important;\n box-shadow: none !important;\n }\n}\n\n@media print {\n :host {\n border-radius: 3px;\n border: 1px solid #d2d2d2;\n padding: 2rem 1rem;\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n background-color: #fff !important;\n background-image: none !important;\n color: #151515 !important;\n padding: 2rem 1rem;\n }\n}\n\n@media screen and (-ms-high-contrast: active) and (min-width: 576px), screen and (-ms-high-contrast: none) and (min-width: 576px) {\n :host {\n padding: 4rem 1rem;\n }\n}\n\n:host([on=\"dark\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #73bcf7);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #bee1f4);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #bee1f4);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #bee1f4);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-dark, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-dark, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-dark, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-dark, none);\n}\n\n:host([on=\"saturated\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-saturated, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-saturated, #fff);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-saturated, #fafafa);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-saturated, #fafafa);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-saturated, #d2d2d2);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-saturated, underline);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-saturated, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-saturated, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-saturated, underline);\n}\n\n:host([on=\"light\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text, #151515);\n --pfe-broadcasted--link: var(--pfe-theme--color--link, #06c);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover, #004080);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus, #004080);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited, #6753ac);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited, none);\n}\n\n:host([color=\"darker\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darker, #3c3f42);\n --pfe-band--context: var(--pfe-theme--color--surface--darker--context, dark);\n}\n\n:host([color=\"darkest\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darkest, #151515);\n --pfe-band--context: var(--pfe-theme--color--surface--darkest--context, dark);\n}\n\n:host([color=\"base\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--base, #f0f0f0);\n --pfe-band--context: var(--pfe-theme--color--surface--base--context, light);\n}\n\n:host([color=\"lighter\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lighter, #f0f0f0);\n --pfe-band--context: var(--pfe-theme--color--surface--lighter--context, light);\n}\n\n:host([color=\"lightest\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n --pfe-band--context: var(--pfe-theme--color--surface--lightest--context, light);\n}\n\n:host([color=\"accent\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--accent, #004080);\n --pfe-band--context: var(--pfe-theme--color--surface--accent--context, saturated);\n}\n\n:host([color=\"complement\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--complement, #002952);\n --pfe-band--context: var(--pfe-theme--color--surface--complement--context, saturated);\n}\n\n:host([size=\"small\"]) {\n padding: calc(var(--pfe-band--Padding--vertical, calc( var(--pfe-theme--container-spacer, 1rem) * 4)) / 4) var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1));\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host([size=\"small\"]) {\n /* IE10+ */\n padding: 1rem;\n }\n}\n\n.pfe-band__container {\n max-width: var(--pfe-band--Width, auto);\n margin: 0 auto;\n}\n\n@media screen and (min-width: 768px) {\n .pfe-band__container {\n max-width: var(--pfe-band--Width, calc(768px - (var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1)) * 4)));\n }\n}\n\n@media screen and (min-width: 992px) {\n .pfe-band__container {\n max-width: var(--pfe-band--Width, calc(992px - (var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1)) * 4)));\n }\n}\n\n@media screen and (min-width: 1200px) {\n .pfe-band__container {\n max-width: var(--pfe-band--Width, calc(1200px - (var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1)) * 4)));\n }\n}\n\n@supports (display: grid) {\n .pfe-band__container {\n display: grid;\n grid-template-rows: auto;\n grid-template-columns: auto;\n grid-template-areas: \"body\";\n grid-row-gap: var(--pfe-band--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n row-gap: var(--pfe-band--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n grid-column-gap: var(--pfe-band--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n column-gap: var(--pfe-band--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n }\n :host([has_header]) .pfe-band__container {\n grid-template-areas: \"header\" \"body\";\n }\n :host([has_aside]) .pfe-band__container {\n grid-template-areas: \"body\" \"aside\";\n }\n @media (max-width: 767px) {\n :host([has_aside][aside-mobile=\"top\"]) .pfe-band__container {\n grid-template-areas: \"aside\" \"body\";\n }\n }\n @media (min-width: 768px) {\n :host([has_aside]) .pfe-band__container {\n grid-template-areas: \"body aside\";\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container {\n grid-template-areas: \"aside body\";\n }\n }\n :host([has_footer]) .pfe-band__container {\n grid-template-areas: \"body\" \"footer\";\n }\n :host([has_header][has_aside]) .pfe-band__container {\n grid-template-areas: \"header\" \"body\" \"aside\";\n }\n @media (max-width: 767px) {\n :host([has_header][has_aside][aside-mobile=\"top\"]) .pfe-band__container {\n grid-template-areas: \"aside\" \"header\" \"body\";\n }\n }\n @media (min-width: 768px) {\n :host([has_header][has_aside]) .pfe-band__container {\n grid-template-areas: \"header header\" \"body aside\";\n }\n :host([has_header][has_aside][aside-desktop=\"left\"]) .pfe-band__container {\n grid-template-areas: \"header header\" \"aside body\";\n }\n :host([has_header][has_aside][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"header aside\" \"body aside\";\n }\n :host([has_header][has_aside][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"aside header\" \"aside body\";\n }\n }\n :host([has_header][has_footer]) .pfe-band__container {\n grid-template-areas: \"header\" \"body\" \"footer\";\n }\n :host([has_footer][has_aside]) .pfe-band__container {\n grid-template-areas: \"body\" \"aside\" \"footer\";\n }\n @media (max-width: 767px) {\n :host([has_footer][has_aside][aside-mobile=\"top\"]) .pfe-band__container {\n grid-template-areas: \"aside\" \"body\" \"footer\";\n }\n }\n @media (min-width: 768px) {\n :host([has_footer][has_aside]) .pfe-band__container {\n grid-template-areas: \"body aside\" \"footer footer\";\n }\n :host([has_footer][has_aside][aside-desktop=\"left\"]) .pfe-band__container {\n grid-template-areas: \"aside body\" \"footer footer\";\n }\n :host([has_footer][has_aside][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"body aside\" \"footer aside\";\n }\n :host([has_footer][has_aside][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"aside body\" \"aside footer\";\n }\n }\n :host([has_header][has_aside][has_footer]) .pfe-band__container {\n grid-template-areas: \"header\" \"body\" \"footer\" \"aside\";\n }\n @media (max-width: 767px) {\n :host([has_header][has_aside][has_footer][aside-mobile=\"top\"]) .pfe-band__container {\n grid-template-areas: \"aside\" \"header\" \"body\" \"footer\";\n }\n }\n @media (min-width: 768px) {\n :host([has_header][has_aside][has_footer]) .pfe-band__container {\n grid-template-areas: \"header header\" \"body aside\" \"footer footer\";\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"]) .pfe-band__container {\n grid-template-areas: \"header header\" \"aside body\" \"footer footer\";\n }\n :host([has_header][has_aside][has_footer][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"header aside\" \"body aside\" \"footer aside\";\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"aside header\" \"aside body\" \"aside footer\";\n }\n }\n @media (min-width: 768px) {\n .pfe-band__container {\n grid-template-rows: auto;\n grid-template-columns: 1fr;\n }\n :host([has_aside]) .pfe-band__container {\n grid-template-rows: auto;\n grid-template-columns: 1fr var(--pfe-band--Width__aside--sm, 240px);\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container {\n grid-template-rows: auto;\n grid-template-columns: var(--pfe-band--Width__aside--sm, 240px) 1fr;\n }\n }\n @media (min-width: 992px) {\n :host([has_aside]) .pfe-band__container {\n grid-template-rows: auto;\n grid-template-columns: var(--pfe-band--layout, 1fr var(--pfe-band--Width__aside--lg, 300px));\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container {\n grid-template-rows: auto;\n grid-template-columns: var(--pfe-band--layout, var(--pfe-band--Width__aside--lg, 300px) 1fr);\n }\n }\n}\n\n.pfe-band__container,\n.pfe-band__wrapper {\n margin-bottom: calc(-1 * var(--pfe-band--gutter--vertical, var(--pfe-theme--container-spacer, 1rem)));\n margin-right: calc(-1 * var(--pfe-band--gutter--vertical, var(--pfe-theme--container-spacer, 1rem)));\n}\n\n@supports (display: grid) {\n .pfe-band__container,\n .pfe-band__wrapper {\n margin: 0 auto;\n }\n}\n\n.pfe-band__aside {\n height: 100%;\n}\n\n.pfe-band__header {\n margin-bottom: var(--pfe-band__header--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n margin-right: var(--pfe-band__header--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n}\n\n@supports (display: grid) {\n .pfe-band__header {\n grid-area: header;\n margin-bottom: 0;\n margin-right: 0;\n }\n :host([use-grid]) .pfe-band__header {\n display: grid;\n grid-template-rows: auto;\n grid-template-columns: var(--pfe-band__header--layout, 1fr);\n grid-row-gap: var(--pfe-band__header--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n row-gap: var(--pfe-band__header--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n grid-column-gap: var(--pfe-band__header--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n column-gap: var(--pfe-band__header--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n }\n}\n\n.pfe-band__body {\n margin-bottom: var(--pfe-band__body--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n margin-right: var(--pfe-band__body--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n}\n\n@supports (display: grid) {\n .pfe-band__body {\n grid-area: body;\n margin-bottom: 0;\n margin-right: 0;\n }\n :host([use-grid]) .pfe-band__body {\n display: grid;\n grid-template-rows: auto;\n grid-template-columns: var(--pfe-band__body--layout, 1fr);\n grid-row-gap: var(--pfe-band__body--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n row-gap: var(--pfe-band__body--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n grid-column-gap: var(--pfe-band__body--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n column-gap: var(--pfe-band__body--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n }\n}\n\n.pfe-band__footer {\n margin-bottom: var(--pfe-band__footer--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n margin-right: var(--pfe-band__footer--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n}\n\n@supports (display: grid) {\n .pfe-band__footer {\n grid-area: footer;\n margin-bottom: 0;\n margin-right: 0;\n }\n :host([use-grid]) .pfe-band__footer {\n display: grid;\n grid-template-rows: auto;\n grid-template-columns: var(--pfe-band__footer--layout, 1fr);\n grid-row-gap: var(--pfe-band__footer--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n row-gap: var(--pfe-band__footer--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n grid-column-gap: var(--pfe-band__footer--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n column-gap: var(--pfe-band__footer--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n }\n}\n\n.pfe-band__aside {\n margin-bottom: var(--pfe-band__aside--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n margin-right: var(--pfe-band__aside--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n}\n\n@supports (display: grid) {\n .pfe-band__aside {\n grid-area: aside;\n margin-bottom: 0;\n margin-right: 0;\n }\n :host([use-grid]) .pfe-band__aside {\n display: grid;\n grid-template-rows: auto;\n grid-template-columns: var(--pfe-band__aside--layout, 1fr);\n grid-row-gap: var(--pfe-band__aside--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n row-gap: var(--pfe-band__aside--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n grid-column-gap: var(--pfe-band__aside--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n column-gap: var(--pfe-band__aside--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n /* IE10+ */\n .pfe-band__container::after {\n clear: both;\n content: \"\";\n display: table;\n }\n .pfe-band__header,\n .pfe-band__body,\n .pfe-band__footer {\n float: left;\n }\n :host([aside-mobile=\"top\"]) .pfe-band__header, :host([aside-mobile=\"top\"])\n .pfe-band__body, :host([aside-mobile=\"top\"])\n .pfe-band__footer {\n float: right;\n }\n :host(:not([aside-height=\"full\"])) .pfe-band__header, :host(:not([aside-height=\"full\"]))\n .pfe-band__body, :host(:not([aside-height=\"full\"]))\n .pfe-band__footer {\n width: 60%;\n }\n .pfe-band__footer {\n clear: both;\n }\n .pfe-band__aside {\n flex-grow: 1;\n align-self: flex-start;\n float: right;\n width: 35%;\n margin: 0 1.9%;\n }\n :host([aside-desktop=\"left\"]) .pfe-band__aside {\n float: left;\n }\n .pfe-band__wrapper {\n width: 60%;\n float: left;\n }\n :host([aside-desktop=\"left\"]) .pfe-band__wrapper {\n float: right;\n }\n}\n","@import \"../../pfe-sass/pfe-sass\";\n\n$LOCAL: band;\n\n\n$LOCAL-VARIABLES: (\n // Default spacing values\n Padding--vertical: calc( #{pfe-var(container-spacer)} * 4),\n Padding--horizontal: calc( #{pfe-var(container-spacer)} * 1),\n\n // Surface colors\n BackgroundColor: pfe-var(surface--base),\n context: light,\n BackgroundPosition: center center,\n\n // Border settings\n Border: pfe-var(surface--border-width) pfe-var(surface--border-style) transparent,\n\n // Layouts, grid layouts\n layout: 1fr,\n \n header: (\n layout: 1fr,\n gutter--vertical: pfe-var(container-spacer),\n gutter--horizontal: calc(#{pfe-var(container-spacer)} * 3)\n ),\n body: (\n layout: 1fr,\n gutter--vertical: pfe-var(container-spacer),\n gutter--horizontal: calc(#{pfe-var(container-spacer)} * 3)\n ),\n footer: (\n layout: 1fr,\n gutter--vertical: pfe-var(container-spacer),\n gutter--horizontal: calc(#{pfe-var(container-spacer)} * 3)\n ),\n aside: (\n layout: 1fr,\n gutter--vertical: pfe-var(container-spacer),\n gutter--horizontal: calc(#{pfe-var(container-spacer)} * 3)\n ),\n\n // Vertical spacing\n gutter--vertical: pfe-var(container-spacer),\n gutter--horizontal: calc(#{pfe-var(container-spacer)} * 3),\n\n // Band width logic\n // Initialize at mobile breakpoint\n Width: auto,\n Width__aside--sm: 240px,\n Width__aside--lg: 300px,\n);\n\n// Nested internal variables (pfe-local calls), maps cannot \"self-reference\"\n$LOCAL-VARIABLES: map-deep-merge($LOCAL-VARIABLES, (\n // Bring them together for ease of use below\n Padding: pfe-local(Padding--vertical) pfe-local(Padding--horizontal)\n));\n\n$regions-grid: (\n header:\n \"header\"\n \"body\",\n aside:\n \"body\"\n \"aside\",\n footer:\n \"body\"\n \"footer\",\n header-aside:\n \"header\"\n \"body\"\n \"aside\",\n header-footer:\n \"header\"\n \"body\"\n \"footer\",\n footer-aside:\n \"body\"\n \"aside\"\n \"footer\",\n header-aside-footer: \n \"header\"\n \"body\"\n \"footer\"\n \"aside\"\n);\n\n@function aside-grid($list, $full: false, $position: right, $bp: mobile) {\n // Initialize the return list to empty\n $return: ();\n\n // Remove the aside from the list for manipulation below\n $list: remove($list, \"aside\");\n\n // For desktop-sized viewports:\n @if ($bp == \"desktop\") {\n @each $section in $list {\n // If the aside region is full-height OR\n // the aside is body height & this is the body region\n @if $full or (not $full and $section == \"body\") {\n // Inject the aside region to the right or left\n // depending on the position variable\n @if $position != right {\n $return: append($return, \"aside #{$section}\");\n } @else {\n $return: append($return, \"#{$section} aside\");\n }\n } @else {\n // Otherwise region should span the grid 100%\n $return: append($return, \"#{$section} #{$section}\");\n }\n }\n\n // Return with this value for desktop, below is mobile-specific\n @return $return;\n }\n\n // Aside mobile top\n // Note: we don't have a setting for top specifically because you don't need\n // to use the function on mobile if the aside is not moved to the top\n @return \"aside\" $list;\n}\n\n:host {\n // @include pfe-set-broadcast-context(light);\n --context: #{pfe-local(context)};\n\n // Wrapper sets padding and background visuals\n display: block;\n\n // Border styles\n border: pfe-local(Border);\n\n // Base colors\n background-color: pfe-local(BackgroundColor);\n background-position: pfe-local(BackgroundPosition);\n color: pfe-broadcasted(text);\n\n // Custom padding on mobile\n padding: calc(#{pfe-local(Padding--vertical)} / 2) pfe-local(Padding--horizontal);\n\n // Variable padding on desktop\n @media (min-width: pfe-breakpoint(sm)) {\n padding: pfe-local(Padding);\n }\n\n // Apply box-sizing styles\n @include pfe-box-sizing;\n\n // Remove background color for print\n @include pfe-no-print-background;\n\n @include pfe-print-media {\n // Add the border to the card for print\n border-radius: pfe-fetch(surface--border-radius);\n border: pfe-fetch(surface--border-width) pfe-fetch(surface--border-style) pfe-fetch(surface--border);\n // Reduce padding for print\n padding: #{pfe-fetch(container-spacer) * 2} pfe-fetch(container-spacer);\n }\n\n @include browser-query(ie11) {\n background-color: pfe-fetch(surface--lightest) !important;\n background-image: none !important;\n color: pfe-fetch(text) !important;\n\n padding: #{pfe-fetch(container-spacer) * 2} pfe-fetch(container-spacer);\n @media (min-width: pfe-breakpoint(sm)) {\n padding: #{pfe-fetch(container-spacer) * 4} pfe-fetch(container-spacer);\n }\n }\n}\n\n// Use-case for transparent backgrounds\n@include pfe-contexts; // imports on=\"light\" etc support\n\n// Pull in pfe-var settings for all supported surface colors\n@include pfe-surfaces;\n\n// thinner padding on top & bottom\n:host([size=\"small\"]) {\n padding: calc(#{pfe-local(Padding--vertical)} / 4) #{pfe-local(Padding--horizontal)};\n @include browser-query(ie11) {\n padding: pfe-fetch(container-spacer);\n }\n}\n\n.pfe-band__container {\n max-width: pfe-local(Width);\n margin: 0 auto;\n\n // Loop through the other breakpoints\n @each $size in (md, lg, xl) {\n @media screen and (min-width: pfe-breakpoint(#{$size})) {\n max-width: pfe-local(Width, $fallback: calc(#{pfe-breakpoint(#{$size})} - (#{pfe-local(Padding--horizontal)} * 4) ));\n }\n }\n\n @supports (display: grid) {\n display: grid;\n grid-template-rows: auto;\n grid-template-columns: auto;\n\n grid-template-areas: \"body\";\n\n grid-row-gap: pfe-local(gutter--vertical);\n row-gap: pfe-local(gutter--vertical);\n grid-column-gap: pfe-local(gutter--horizontal);\n column-gap: pfe-local(gutter--horizontal);\n \n // Styles for the different combination of regions\n //-- Grid template area styles --//\n @each $selectors, $layout in $regions-grid {\n $sets: ();\n $has_aside: str-index($selectors, \"aside\");\n\n @each $region in str-split($selectors, \"-\") {\n $sets: append($sets, \"[has_#{$region}]\");\n }\n\n // Combine the sets into a selector\n $regions: to-string($sets, \"\");\n\n // Declare the mobile-first layouts\n :host(#{$regions}) & {\n grid-template-areas: $layout;\n }\n\n // If there is an aside region, create variants for \n // 1. mobile top placement\n // 2. desktop left positioning\n // 3. full height layout\n\n @if ($has_aside) {\n // 0-MD breakpoint\n @media (max-width: pfe-breakpoint(md, $max: true)) {\n :host(#{$regions}[aside-mobile=\"top\"]) & {\n grid-template-areas: aside-grid($layout);\n }\n }\n\n // MD+ breakpoint\n @media (min-width: pfe-breakpoint(md)) {\n :host(#{$regions}) & {\n grid-template-areas: aside-grid($layout, $bp: desktop);\n }\n\n :host(#{$regions}[aside-desktop=\"left\"]) & {\n grid-template-areas: aside-grid($layout, $position: left, $bp: desktop);\n }\n\n @if length($layout) > 2 {\n :host(#{$regions}[aside-height=\"full\"]) & {\n grid-template-areas: aside-grid($layout, $full: true, $bp: desktop);\n }\n\n :host(#{$regions}[aside-desktop=\"left\"][aside-height=\"full\"]) & {\n grid-template-areas: aside-grid($layout, $full: true, $position: left, $bp: desktop);\n }\n }\n }\n }\n\n }\n //-- END grid template area styles --//\n\n @media (min-width: pfe-breakpoint(md)) {\n grid-template-rows: auto;\n grid-template-columns: 1fr;\n\n :host([has_aside]) & {\n grid-template-rows: auto;\n grid-template-columns: 1fr pfe-local(Width__aside--sm);\n }\n\n :host([has_aside][aside-desktop=\"left\"]) & {\n grid-template-rows: auto;\n grid-template-columns: pfe-local(Width__aside--sm) 1fr;\n }\n }\n\n @media (min-width: pfe-breakpoint(lg)) { \n :host([has_aside]) & {\n grid-template-rows: auto;\n grid-template-columns: pfe-local(layout, $fallback: 1fr pfe-local(Width__aside--lg));\n }\n :host([has_aside][aside-desktop=\"left\"]) & {\n grid-template-rows: auto;\n grid-template-columns: pfe-local(layout, $fallback: pfe-local(Width__aside--lg) 1fr);\n }\n }\n }\n}\n\n.pfe-band__container,\n.pfe-band__wrapper {\n // Fallback margins if grid is not used\n margin-bottom: calc(-1 * #{pfe-local(gutter--vertical)});\n margin-right: calc(-1 * #{pfe-local(gutter--vertical)});\n @supports (display: grid) {\n margin: 0 auto;\n }\n}\n\n.pfe-band__aside {\n height: 100%;\n}\n\n@each $section in (header, body, footer, aside) {\n .pfe-band__#{$section} {\n // Fallback margins if grid is not used\n margin-bottom: pfe-local(gutter--vertical, $region: $section);\n margin-right: pfe-local(gutter--vertical, $region: $section);\n\n // Apply the grid layout\n @supports (display: grid) {\n // Apply the section as a named grid-area\n grid-area: $section;\n margin-bottom: 0;\n margin-right: 0;\n\n :host([use-grid]) & {\n display: grid;\n grid-template-rows: auto;\n grid-template-columns: pfe-local(layout, $region: $section);\n\n grid-row-gap: pfe-local(gutter--vertical, $region: $section);\n row-gap: pfe-local(gutter--vertical, $region: $section);\n grid-column-gap: pfe-local(gutter--horizontal, $region: $section);\n column-gap: pfe-local(gutter--horizontal, $region: $section);\n }\n }\n }\n}\n\n// For each section in the band layout,\n// define their internal behavior for slotted elements\n@include browser-query(ie11) {\n .pfe-band__container {\n @include pfe-clearfix;\n }\n\n .pfe-band__header,\n .pfe-band__body,\n .pfe-band__footer {\n float: left;\n\n :host([aside-mobile=\"top\"]) & {\n float: right;\n }\n \n :host(:not([aside-height=\"full\"])) & {\n width: 60%;\n }\n }\n\n .pfe-band__footer {\n clear: both;\n }\n\n .pfe-band__aside {\n flex-grow: 1;\n align-self: flex-start;\n\n float: right;\n \n width: 35%;\n margin: 0 1.9%;\n \n :host([aside-desktop=\"left\"]) & {\n float: left;\n }\n }\n\n .pfe-band__wrapper {\n width: 60%;\n float: left;\n \n :host([aside-desktop=\"left\"]) & {\n float: right;\n }\n }\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}","// $boxSize = any box-sizing property, default is border-box\n@mixin pfe-box-sizing($boxSize: border-box) {\n *,\n *::before,\n *::after {\n box-sizing: $boxSize;\n }\n}\n\n@mixin pfe-clearfix {\n &::after {\n clear: both;\n content: \"\";\n display: table;\n }\n}\n\n@mixin pfe-container {\n @extend %container;\n\n padding: calc(#{pfe-local(Padding--vertical)} / 2) #{pfe-local(Padding--horizontal)};\n\n @media (min-width: pfe-breakpoint(sm)) {\n padding: pfe-local(Padding);\n }\n}\n\n@mixin pfe-collapsible($state: closed) {\n @if $state != closed {\n display: block;\n position: relative;\n opacity: 1;\n } @else {\n display: none;\n overflow: hidden;\n will-change: height;\n border-color: transparent;\n opacity: 0;\n }\n}\n","@import \"@patternfly/patternfly/sass-utilities/scss-variables\";\n\n////\n/// @group maps\n/// @type Map\n////\n\n/// Variables for typography, spacing, sizing\n$pfe-vars: (\n\n container-spacer: pf-font-prem($pf-spacer), // 16px\n container-padding: pf-font-prem($pf-spacer), // 16px\n content-spacer: pf-font-prem($pf-spacer-sm), // 24px\n\n content-spacer--heading--lg: pf-font-prem($pf-spacer-md), // 32px \n content-spacer--heading--md: pf-font-prem($pf-spacer-sm), // 24px \n content-spacer--heading--sm: pf-font-prem($pf-spacer), // 16px\n content-spacer--body--md: pf-font-prem($pf-spacer), // 16px\n content-spacer--body--sm: pf-font-prem($pf-spacer-xs), // 8px\n\n surface--border-width: 1px, //\n surface--border-width--heavy: 4px, //\n surface--border-style: solid, //\n surface--border-radius: 3px, //\n surface--border-width--active: 3px, //\n\n icon-size: 1em, //\n\n ui--element--size: 20px, //\n ui--indent: 20px, //\n ui--border-width--sm: 1px, //\n ui--border-width--md: 2px, //\n ui--border-width--lg: 3px, //\n\n ui--border-width: 1px, //\n ui--border-width--active: 3px, //\n \n ui--border-style: solid, //\n ui--border-radius: 2px, //\n\n ui--focus-outline-width: 1px, //\n ui--focus-outline-style: solid, //\n\n grid-breakpoint--xs: 0, //\n grid-breakpoint--sm: 576px, //\n grid-breakpoint--md: 768px, //\n grid-breakpoint--lg: 992px, //\n grid-breakpoint--xl: 1200px, //\n\n box-shadow--sm: #{0 #{pfe-size-prem(1)} #{pfe-size-prem(2)} 0 rgba($pf-color-black-1000, .2)}, //\n box-shadow--md: #{0 #{pfe-size-prem(2)} #{pfe-size-prem(1)} #{pfe-size-prem(1)} rgba($pf-color-black-1000, .12), 0 #{pfe-size-prem(4)} #{pfe-size-prem(11)} #{pfe-size-prem(6)} rgba($pf-color-black-1000, .05)}, //\n box-shadow--lg: #{0 #{pfe-size-prem(3)} #{pfe-size-prem(7)} #{pfe-size-prem(3)} rgba($pf-color-black-1000, .13), 0 #{pfe-size-prem(11)} #{pfe-size-prem(24)} #{pfe-size-prem(16)} rgba($pf-color-black-1000, .12)}, //\n box-shadow--inset: #{inset 0 0 #{pfe-size-prem(10)} 0 $pf-color-black-100}, //\n\n animation-speed: .3s, //\n animation-timing: cubic-bezier(0.465, 0.183, 0.153, 0.946), //\n opacity: .09 //\n);","// Colors\n$pf-color-black-100: #fafafa !default;\n$pf-color-black-150: #f5f5f5 !default;\n$pf-color-black-200: #f0f0f0 !default;\n$pf-color-black-300: #d2d2d2 !default;\n$pf-color-black-400: #b8bbbe !default;\n$pf-color-black-500: #8a8d90 !default;\n$pf-color-black-600: #6a6e73 !default;\n$pf-color-black-700: #4f5255 !default;\n$pf-color-black-800: #3c3f42 !default;\n$pf-color-black-850: #212427 !default;\n$pf-color-black-900: #151515 !default;\n$pf-color-black-1000: #030303 !default;\n$pf-color-blue-50: #e7f1fa !default;\n$pf-color-blue-100: #bee1f4 !default;\n$pf-color-blue-200: #73bcf7 !default;\n$pf-color-blue-300: #2b9af3 !default;\n$pf-color-blue-400: #06c !default;\n$pf-color-blue-500: #004080 !default;\n$pf-color-blue-600: #002952 !default;\n$pf-color-blue-700: #001223 !default;\n$pf-color-cyan-50: #f2f9f9 !default;\n$pf-color-cyan-100: #a2d9d9 !default;\n$pf-color-cyan-200: #73c5c5 !default;\n$pf-color-cyan-300: #009596 !default;\n$pf-color-cyan-400: #005f60 !default;\n$pf-color-cyan-500: #003737 !default;\n$pf-color-cyan-600: #002323 !default;\n$pf-color-cyan-700: #000f0f !default;\n$pf-color-gold-50: #fdf7e7 !default;\n$pf-color-gold-100: #f9e0a2 !default;\n$pf-color-gold-200: #f6d173 !default;\n$pf-color-gold-300: #f4c145 !default;\n$pf-color-gold-400: #f0ab00 !default;\n$pf-color-gold-500: #c58c00 !default;\n$pf-color-gold-600: #795600 !default;\n$pf-color-gold-700: #3d2c00 !default;\n$pf-color-green-50: #f3faf2 !default;\n$pf-color-green-100: #bde5b8 !default;\n$pf-color-green-200: #95d58e !default;\n$pf-color-green-300: #6ec664 !default;\n$pf-color-green-400: #5ba352 !default;\n$pf-color-green-500: #3e8635 !default;\n$pf-color-green-600: #1e4f18 !default;\n$pf-color-green-700: #0f280d !default;\n$pf-color-light-blue-100: #beedf9 !default;\n$pf-color-light-blue-200: #7cdbf3 !default;\n$pf-color-light-blue-300: #35caed !default;\n$pf-color-light-blue-400: #00b9e4 !default;\n$pf-color-light-blue-500: #008bad !default;\n$pf-color-light-blue-600: #005c73 !default;\n$pf-color-light-blue-700: #002d39 !default;\n$pf-color-light-green-100: #e4f5bc !default;\n$pf-color-light-green-200: #c8eb79 !default;\n$pf-color-light-green-300: #ace12e !default;\n$pf-color-light-green-400: #92d400 !default;\n$pf-color-light-green-500: #6ca100 !default;\n$pf-color-light-green-600: #486b00 !default;\n$pf-color-light-green-700: #253600 !default;\n$pf-color-orange-100: #f4b678 !default;\n$pf-color-orange-200: #ef9234 !default;\n$pf-color-orange-300: #ec7a08 !default;\n$pf-color-orange-400: #c46100 !default;\n$pf-color-orange-500: #8f4700 !default;\n$pf-color-orange-600: #773d00 !default;\n$pf-color-orange-700: #3b1f00 !default;\n$pf-color-purple-50: #f2f0fc !default;\n$pf-color-purple-100: #cbc1ff !default;\n$pf-color-purple-200: #b2a3ff !default;\n$pf-color-purple-300: #a18fff !default;\n$pf-color-purple-400: #8476d1 !default;\n$pf-color-purple-500: #6753ac !default;\n$pf-color-purple-600: #40199a !default;\n$pf-color-purple-700: #1f0066 !default;\n$pf-color-red-50: #faeae8 !default;\n$pf-color-red-100: #c9190b !default;\n$pf-color-red-200: #a30000 !default;\n$pf-color-red-300: #7d1007 !default;\n$pf-color-red-400: #470000 !default;\n$pf-color-red-500: #2c0000 !default;\n$pf-color-white: #fff !default;\n","//\n// PatternFly functions\n// --------------------------------------------------\n\n// Transform px to rems\n@function pf-strip-unit($num) {\n @return $num / ($num * 0 + 1);\n}\n\n@function pf-size-prem($pxval, $base: $pf-global--space-size-root) {\n @return pf-strip-unit($pxval) / $base * 1rem;\n}\n\n@function pf-font-prem($pxval, $base: $pf-global--font-size-root) {\n @return pf-strip-unit($pxval) / $base * 1rem;\n}\n\n@function pf-bg-svg($svg-coordinates, $viewBox: \"512\", $svg-color: \"currentColor\") {\n $color: str-slice(#{$svg-color}, 2);\n\n @return url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 #{$viewBox} 512'%3E%3Cpath fill='%23#{$color}' d='#{$svg-coordinates}'/%3E%3C/svg%3E\");\n}\n\n// Return breakpoint value if it exists\n@function pf-breakpoint-value($breakpoint, $breakpoint-map: $pf-global--breakpoint-name-map) {\n $breakpoint-value: if(map-has-key($breakpoint-map, #{$breakpoint}), map-get($breakpoint-map, #{$breakpoint}), false);\n\n @return #{$breakpoint-value};\n}\n\n// Build breakpoint map\n// Based on $pf-global--breakpoint-name-map\n@function build-breakpoint-map($map-items...) {\n $map: ();\n\n @if length($map-items) == 0 {\n $map: (\"base\": null);\n $map: map-merge($map, $pf-global--breakpoint-name-map);\n }\n\n @else {\n @each $breakpoint in $map-items {\n @if not map-has-key($pf-global--breakpoint-name-map, $breakpoint) and $breakpoint != \"base\" {\n $map: map-merge($map, (\"invalid breakpoint #{$breakpoint}\": null));\n }\n\n @else if $breakpoint == \"base\" {\n $map: map-merge($map, ($breakpoint: null));\n }\n\n @else {\n $map: map-merge($map, ($breakpoint: map-get($pf-global--breakpoint-name-map, #{$breakpoint})));\n }\n }\n }\n\n @return $map;\n}\n\n// Build spacer map\n// Based on $pf-global--spacer-map\n@function build-spacer-map($map-items...) {\n $map: ();\n\n @if length($map-items) == 0 {\n $map: (\"none\": 0);\n $map: map-merge($map, $pf-global--spacer-map);\n $map: map-remove($map, \"auto\", \"0\");\n }\n\n @each $spacer in $map-items {\n @if not map-has-key($pf-global--spacer-map, $spacer) and $spacer != \"none\" {\n $map: map-merge($map, (\"invalid spacer #{$spacer}\": null));\n }\n\n @else if $spacer == \"none\" {\n $map: map-merge($map, ($spacer: 0));\n }\n\n @else {\n $map: map-merge($map, ($spacer: map-get($pf-global--spacer-map, #{$spacer})));\n }\n }\n\n @return $map;\n}\n\n// Build variable map\n// Based on custom map\n@function build-variable-map($namespace, $map: ()) {\n $new-map: ();\n\n @each $size, $value in $map {\n $new-map: map-merge($new-map, (map-get($map, $size): --#{$namespace}--#{$size}));\n }\n\n @return $new-map;\n}\n",null],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-band/dist/pfe-band.js b/elements/pfe-band/dist/pfe-band.js new file mode 100644 index 0000000000..c5700c4ae5 --- /dev/null +++ b/elements/pfe-band/dist/pfe-band.js @@ -0,0 +1,272 @@ +import PFElement from '../../pfelement/dist/pfelement.js'; + +// @POLYFILL Element.matches +// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches +if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; +} + +// @POLYFILL Element.closest +// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest +if (!Element.prototype.closest) { + Element.prototype.closest = function(s) { + var el = this; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + return null; + }; +} + +/*! + * PatternFly Elements: PfeBand 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/ + +class PfeBand extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + +
    + ${this.hasSlot("pfe-band--aside") && this.asidePosition.mobile === "top" ? `` : ""} + ${this.asideHeight === "full" ? `
    ` : ""} + ${this.hasSlot("pfe-band--header") ? `
    + +
    ` : ""} +
    + +
    + ${this.asideHeight !== "full" && this.hasSlot("pfe-band--aside") && this.asidePosition.mobile !== "top" ? `` : ""} + ${this.hasSlot("pfe-band--footer") ? `
    + +
    ` : ""} + ${this.asideHeight === "full" ? `
    ` : ""} + ${this.asideHeight === "full" && this.hasSlot("pfe-band--aside") && this.asidePosition.mobile !== "top" ? `` : ""} +
    `; + } + + static get tag() { + return "pfe-band"; + } + + static get meta() { + return { + title: "Band", + description: + "This element creates a header, body, footer, and aside region in which to place content or other components." + }; + } + + get templateUrl() { + return "pfe-band.html"; + } + + get styleUrl() { + return "pfe-band.scss"; + } + + get asidePosition() { + return { + desktop: this.asideDesktop, + mobile: this.asideMobile, + height: this.asideHeight + }; + } + + static get properties() { + return { + imgSrc: { + title: "Background image", + type: String, + observer: "_imgSrcChanged" + }, + // @TODO: Deprecated property in 1.0 + oldImgSrc: { + alias: "imgSrc", + attr: "pfe-img-src" + }, + color: { + title: "Background color", + type: String, + values: ["lightest", "base", "darker", "darkest", "complement", "accent"], + default: "base", + observer: "_colorChanged" + }, + // @TODO: Deprecated property in 1.0 + oldColor: { + alias: "color", + attr: "pfe-color" + }, + asideDesktop: { + title: "side positioning (desktop)", + type: String, + values: ["right", "left"], + default: "right" + }, + // @TODO: Deprecated property in 1.0 + oldAsideDesktop: { + alias: "asideDesktop", + attr: "pfe-aside-desktop" + }, + asideMobile: { + title: "Aside positioning (mobile)", + type: String, + values: ["top", "bottom"], + default: "bottom" + }, + // @TODO: Deprecated property in 1.0 + oldAsideMobile: { + alias: "asideMobile", + attr: "pfe-aside-mobile" + }, + asideHeight: { + title: "Aside height", + type: String, + values: ["full", "body"], + default: "body" + }, + // @TODO: Deprecated property in 1.0 + oldAsideHeight: { + alias: "asideHeight", + attr: "pfe-aside-height" + }, + size: { + title: "Padding size", + type: String, + values: ["small"] + }, + // @TODO: Deprecated property in 1.0 + oldSize: { + alias: "size", + attr: "pfe-size" + }, + useGrid: { + title: "Default grid on for the light DOM regions (header, body, footer, aside)", + type: Boolean, + default: false + } + }; + } + + static get slots() { + return { + header: { + title: "Header", + type: "array", + namedSlot: true, + maxItems: 3, + items: { + $ref: "raw" + } + }, + body: { + title: "Body", + type: "array", + namedSlot: false, + items: { + oneOf: [ + { + $ref: "pfe-card" + }, + { + $ref: "raw" + } + ] + } + }, + footer: { + title: "Footer", + type: "array", + namedSlot: true, + maxItems: 3, + items: { + oneOf: [ + { + $ref: "pfe-cta" + }, + { + $ref: "raw" + } + ] + } + }, + aside: { + title: "Aside", + type: "array", + namedSlot: true, + maxItems: 5, + items: { + oneOf: [ + { + $ref: "pfe-card" + }, + { + $ref: "raw" + } + ] + } + } + }; + } + + // Declare the type of this component + static get PfeType() { + return PFElement.PfeTypes.Container; + } + + constructor() { + super(PfeBand, { type: PfeBand.PfeType }); + } + + _colorChanged() { + // Update the context + this.resetContext(); + } + + // Update the background image + _imgSrcChanged(oldVal, newVal) { + // Set the image as the background image + this.style.backgroundImage = newVal ? `url('${newVal}')` : ``; + } +} + +PFElement.create(PfeBand); + +export default PfeBand; +//# sourceMappingURL=pfe-band.js.map diff --git a/elements/pfe-band/dist/pfe-band.js.map b/elements/pfe-band/dist/pfe-band.js.map new file mode 100644 index 0000000000..5c6929384d --- /dev/null +++ b/elements/pfe-band/dist/pfe-band.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-band.js","sources":["../_temp/polyfills--pfe-band.js","../_temp/pfe-band.js"],"sourcesContent":["// @POLYFILL Element.matches\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n// @POLYFILL Element.closest\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\nif (!Element.prototype.closest) {\n Element.prototype.closest = function(s) {\n var el = this;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n}\n","/*!\n * PatternFly Elements: PfeBand 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: matches, closest, includes\nimport \"./polyfills--pfe-band.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\nclass PfeBand extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n ${this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile === \"top\" ? `` : \"\"}\n ${this.asideHeight === \"full\" ? `
    ` : \"\"}\n ${this.hasSlot(\"pfe-band--header\") ? `
    \n \n
    ` : \"\"}\n
    \n \n
    \n ${this.asideHeight !== \"full\" && this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile !== \"top\" ? `\n \n ` : \"\"}\n ${this.hasSlot(\"pfe-band--footer\") ? `
    \n \n
    ` : \"\"}\n ${this.asideHeight === \"full\" ? `
    ` : \"\"}\n ${this.asideHeight === \"full\" && this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile !== \"top\" ? `\n \n ` : \"\"}\n
    `;\n }\n\n static get tag() {\n return \"pfe-band\";\n }\n\n static get meta() {\n return {\n title: \"Band\",\n description:\n \"This element creates a header, body, footer, and aside region in which to place content or other components.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-band.html\";\n }\n\n get styleUrl() {\n return \"pfe-band.scss\";\n }\n\n get asidePosition() {\n return {\n desktop: this.asideDesktop,\n mobile: this.asideMobile,\n height: this.asideHeight\n };\n }\n\n static get properties() {\n return {\n imgSrc: {\n title: \"Background image\",\n type: String,\n observer: \"_imgSrcChanged\"\n },\n // @TODO: Deprecated property in 1.0\n oldImgSrc: {\n alias: \"imgSrc\",\n attr: \"pfe-img-src\"\n },\n color: {\n title: \"Background color\",\n type: String,\n values: [\"lightest\", \"base\", \"darker\", \"darkest\", \"complement\", \"accent\"],\n default: \"base\",\n observer: \"_colorChanged\"\n },\n // @TODO: Deprecated property in 1.0\n oldColor: {\n alias: \"color\",\n attr: \"pfe-color\"\n },\n asideDesktop: {\n title: \"side positioning (desktop)\",\n type: String,\n values: [\"right\", \"left\"],\n default: \"right\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideDesktop: {\n alias: \"asideDesktop\",\n attr: \"pfe-aside-desktop\"\n },\n asideMobile: {\n title: \"Aside positioning (mobile)\",\n type: String,\n values: [\"top\", \"bottom\"],\n default: \"bottom\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideMobile: {\n alias: \"asideMobile\",\n attr: \"pfe-aside-mobile\"\n },\n asideHeight: {\n title: \"Aside height\",\n type: String,\n values: [\"full\", \"body\"],\n default: \"body\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideHeight: {\n alias: \"asideHeight\",\n attr: \"pfe-aside-height\"\n },\n size: {\n title: \"Padding size\",\n type: String,\n values: [\"small\"]\n },\n // @TODO: Deprecated property in 1.0\n oldSize: {\n alias: \"size\",\n attr: \"pfe-size\"\n },\n useGrid: {\n title: \"Default grid on for the light DOM regions (header, body, footer, aside)\",\n type: Boolean,\n default: false\n }\n };\n }\n\n static get slots() {\n return {\n header: {\n title: \"Header\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n $ref: \"raw\"\n }\n },\n body: {\n title: \"Body\",\n type: \"array\",\n namedSlot: false,\n items: {\n oneOf: [\n {\n $ref: \"pfe-card\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n },\n footer: {\n title: \"Footer\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n oneOf: [\n {\n $ref: \"pfe-cta\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n },\n aside: {\n title: \"Aside\",\n type: \"array\",\n namedSlot: true,\n maxItems: 5,\n items: {\n oneOf: [\n {\n $ref: \"pfe-card\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n }\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n constructor() {\n super(PfeBand, { type: PfeBand.PfeType });\n }\n\n _colorChanged() {\n // Update the context\n this.resetContext();\n }\n\n // Update the background image\n _imgSrcChanged(oldVal, newVal) {\n // Set the image as the background image\n this.style.backgroundImage = newVal ? `url('${newVal}')` : ``;\n }\n}\n\nPFElement.create(PfeBand);\n\nexport { PfeBand as default };\n"],"names":[],"mappings":";;AAAA;AACA;AACA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E,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE;AACjC;AACA,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,GAAG;AACH,CAAC;AACD;AACA,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/elements/pfe-band/dist/pfe-band.min.css.map b/elements/pfe-band/dist/pfe-band.min.css.map new file mode 100644 index 0000000000..ad4d734a24 --- /dev/null +++ b/elements/pfe-band/dist/pfe-band.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../pfe-sass/mixins/_mixins.scss","../../../pfe-sass/mixins/_custom-properties.scss","../../../pfe-sass/extends/_extends.scss","../../src/pfe-band.scss","pfe-band.css","../../../pfe-sass/mixins/_containers.scss","../../src/"],"names":[],"mappings":"AAGM,6CAAA,oCC6IF,sBAAA,oBAAA,0BAAA,sBAAA,uBAAA,uBAAA,wBCjGA,iBAAA,eACA,MAAA,mBF7CE,6CAAA,oCCyLF,MCrIA,MAAA,mBCqEJ,MAEE,UAAA,gCAGA,QAAA,MAGA,OAAA,IAAA,MAAA,YAAA,OAAA,8HAGA,iBAAA,QAAA,iBAAA,gFACA,oBAAA,OAAA,OAAA,oBAAA,kDACA,MAAA,QAAA,MAAA,qCAGA,QAAA,wBAAA,eAAA,QAAA,8FAAA,uFAGA,yBAnBF,MAoBI,QAAA,eAAA,eAAA,QAAA,sMApBJ,QCrFA,cADA,eCjCI,mBAAA,WAAA,WAAA,WL0DF,aG6DF,MHjDI,iBAAA,eACA,iBAAA,eACA,mBAAA,eAAA,WAAA,gBAdF,aG6DF,MA+BI,cAAA,IACA,OAAA,IAAA,MAAA,QAEA,QAAA,KAAA,MH3JE,6CAAA,oCGyHN,MAsCI,iBAAA,eACA,iBAAA,eACA,MAAA,kBAEA,QAAA,KAAA,MACA,mEAAA,0DA3CJ,MA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A,wFGhTA,aAAA,EAAA,kBAAA,EAAA,gBAAA,EHgTA,4GGhTA,aAAA,EAAA,kBAAA,EAAA,gBAAA,EHgTA,iFGhTA,aAAA,EAAA,kBAAA,EAAA,gBAAA,EHgTA,qGGhTA,aAAA,EAAA,kBAAA,EAAA,gBAAA,EHgTA,oGGhTA,aAAA,EAAA,kBAAA,EAAA,gBAAA,EHgTA,wHGhTA,aAAA,EAAA,kBAAA,EAAA,gBAAA,GHiUM,mCACE,QAAA,SAAA,QAAA,KACA,cAAA,KAAA,mBAAA,KACA,iBAAA,IAAA,sBAAA,IAAA,iBAAA,mCAAA,sBAAA,mCAEA,aAAA,KAAA,aAAA,iFACA,QAAA,KAAA,QAAA,iFACA,gBAAA,eAAA,gBAAA,6FACA,mBAAA,eAAA,gBAAA,eAAA,WAAA,eAAA,mBAAA,6FAAA,gBAAA,6FAAA,WAAA,6FARF,iDGjUN,aAAA,EAAA,gBAAA,EHiUM,iDGjUN,aAAA,EAAA,gBAAA,GNGM,6CAAA,oCG+UJ,4BEvUE,MAAA,KACA,QAAA,GACA,QAAA,MDq6BF,gBACA,kBD7lBA,kBAGE,MAAA,KAEA,0CC4lBe,4CD5lBf,4CACE,MAAA,MAGF,iDC6lBe,mDD7lBf,mDACE,MAAA,IA3CJ,kBAgDE,MAAA,KArDJ,iBAyDI,iBAAA,EAAA,kBAAA,EAAA,kBAAA,EAAA,UAAA,EACA,mBAAA,WAAA,oBAAA,MAAA,WAAA,WAEA,MAAA,MAEA,MAAA,IACA,OAAA,EAAA,KAEA,6CACE,MAAA,KAIJ,mBACE,MAAA,IACA,MAAA,KAEA,+CACE,MAAA","file":"pfe-band.min.css","sourceRoot":"../src","sourcesContent":[null,null,null,null,"@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host([color=\"darker\"]), :host([color=\"darkest\"]), :host([color=\"base\"]), :host([color=\"lighter\"]), :host([color=\"lightest\"]), :host([color=\"accent\"]), :host([color=\"complement\"]) {\n /* IE10+ */\n background-color: #fff !important;\n color: #151515 !important;\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n color: #151515 !important;\n }\n}\n\n:host {\n --context: var(--pfe-band--context, light);\n display: block;\n border: 1px solid transparent;\n border: var(--pfe-band--Border, var(--pfe-theme--surface--border-width, 1px) var(--pfe-theme--surface--border-style, solid) transparent);\n background-color: #f0f0f0;\n background-color: var(--pfe-band--BackgroundColor, var(--pfe-theme--color--surface--base, #f0f0f0));\n background-position: center center;\n background-position: var(--pfe-band--BackgroundPosition, center center);\n color: #3c3f42;\n color: var(--pfe-broadcasted--text, #3c3f42);\n padding: calc(calc( 1rem * 4) / 2) calc( 1rem * 1);\n padding: calc(var(--pfe-band--Padding--vertical, calc( var(--pfe-theme--container-spacer, 1rem) * 4)) / 2) var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1));\n}\n\n@media (min-width: 576px) {\n :host {\n padding: calc( 1rem * 4) calc( 1rem * 1);\n padding: var(--pfe-band--Padding, var(--pfe-band--Padding--vertical, calc( var(--pfe-theme--container-spacer, 1rem) * 4)) var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1)));\n }\n}\n\n:host *,\n:host *::before,\n:host *::after {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n@media print {\n :host {\n background-color: white !important;\n background-image: none !important;\n -webkit-box-shadow: none !important;\n box-shadow: none !important;\n }\n}\n\n@media print {\n :host {\n border-radius: 3px;\n border: 1px solid #d2d2d2;\n padding: 2rem 1rem;\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n background-color: #fff !important;\n background-image: none !important;\n color: #151515 !important;\n padding: 2rem 1rem;\n }\n}\n\n@media screen and (-ms-high-contrast: active) and (min-width: 576px), screen and (-ms-high-contrast: none) and (min-width: 576px) {\n :host {\n padding: 4rem 1rem;\n }\n}\n\n:host([on=\"dark\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #73bcf7);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #bee1f4);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #bee1f4);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #bee1f4);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-dark, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-dark, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-dark, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-dark, none);\n}\n\n:host([on=\"saturated\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-saturated, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-saturated, #fff);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-saturated, #fafafa);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-saturated, #fafafa);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-saturated, #d2d2d2);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-saturated, underline);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-saturated, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-saturated, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-saturated, underline);\n}\n\n:host([on=\"light\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text, #151515);\n --pfe-broadcasted--link: var(--pfe-theme--color--link, #06c);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover, #004080);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus, #004080);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited, #6753ac);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited, none);\n}\n\n:host([color=\"darker\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darker, #3c3f42);\n --pfe-band--context: var(--pfe-theme--color--surface--darker--context, dark);\n}\n\n:host([color=\"darkest\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darkest, #151515);\n --pfe-band--context: var(--pfe-theme--color--surface--darkest--context, dark);\n}\n\n:host([color=\"base\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--base, #f0f0f0);\n --pfe-band--context: var(--pfe-theme--color--surface--base--context, light);\n}\n\n:host([color=\"lighter\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lighter, #f0f0f0);\n --pfe-band--context: var(--pfe-theme--color--surface--lighter--context, light);\n}\n\n:host([color=\"lightest\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n --pfe-band--context: var(--pfe-theme--color--surface--lightest--context, light);\n}\n\n:host([color=\"accent\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--accent, #004080);\n --pfe-band--context: var(--pfe-theme--color--surface--accent--context, saturated);\n}\n\n:host([color=\"complement\"]) {\n --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--complement, #002952);\n --pfe-band--context: var(--pfe-theme--color--surface--complement--context, saturated);\n}\n\n:host([size=\"small\"]) {\n padding: calc(calc( 1rem * 4) / 4) calc( 1rem * 1);\n padding: calc(var(--pfe-band--Padding--vertical, calc( var(--pfe-theme--container-spacer, 1rem) * 4)) / 4) var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1));\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host([size=\"small\"]) {\n /* IE10+ */\n padding: 1rem;\n }\n}\n\n.pfe-band__container {\n max-width: auto;\n max-width: var(--pfe-band--Width, auto);\n margin: 0 auto;\n}\n\n@media screen and (min-width: 768px) {\n .pfe-band__container {\n max-width: calc(768px - (calc( 1rem * 1) * 4));\n max-width: var(--pfe-band--Width, calc(768px - (var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1)) * 4)));\n }\n}\n\n@media screen and (min-width: 992px) {\n .pfe-band__container {\n max-width: calc(992px - (calc( 1rem * 1) * 4));\n max-width: var(--pfe-band--Width, calc(992px - (var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1)) * 4)));\n }\n}\n\n@media screen and (min-width: 1200px) {\n .pfe-band__container {\n max-width: calc(1200px - (calc( 1rem * 1) * 4));\n max-width: var(--pfe-band--Width, calc(1200px - (var(--pfe-band--Padding--horizontal, calc( var(--pfe-theme--container-spacer, 1rem) * 1)) * 4)));\n }\n}\n\n@supports (display: grid) {\n .pfe-band__container {\n display: -ms-grid;\n display: grid;\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n -ms-grid-columns: auto;\n grid-template-columns: auto;\n grid-template-areas: \"body\";\n grid-row-gap: 1rem;\n grid-row-gap: var(--pfe-band--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n row-gap: 1rem;\n row-gap: var(--pfe-band--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n grid-column-gap: calc(1rem * 3);\n grid-column-gap: var(--pfe-band--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n -webkit-column-gap: calc(1rem * 3);\n -moz-column-gap: calc(1rem * 3);\n column-gap: calc(1rem * 3);\n -webkit-column-gap: var(--pfe-band--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n -moz-column-gap: var(--pfe-band--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n column-gap: var(--pfe-band--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n }\n :host([has_header]) .pfe-band__container {\n grid-template-areas: \"header\" \"body\";\n }\n :host([has_aside]) .pfe-band__container {\n grid-template-areas: \"body\" \"aside\";\n }\n @media (max-width: 767px) {\n :host([has_aside][aside-mobile=\"top\"]) .pfe-band__container {\n grid-template-areas: \"aside\" \"body\";\n }\n }\n @media (min-width: 768px) {\n :host([has_aside]) .pfe-band__container {\n grid-template-areas: \"body aside\";\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container {\n grid-template-areas: \"aside body\";\n }\n }\n :host([has_footer]) .pfe-band__container {\n grid-template-areas: \"body\" \"footer\";\n }\n :host([has_header][has_aside]) .pfe-band__container {\n grid-template-areas: \"header\" \"body\" \"aside\";\n }\n @media (max-width: 767px) {\n :host([has_header][has_aside][aside-mobile=\"top\"]) .pfe-band__container {\n grid-template-areas: \"aside\" \"header\" \"body\";\n }\n }\n @media (min-width: 768px) {\n :host([has_header][has_aside]) .pfe-band__container {\n grid-template-areas: \"header header\" \"body aside\";\n }\n :host([has_header][has_aside][aside-desktop=\"left\"]) .pfe-band__container {\n grid-template-areas: \"header header\" \"aside body\";\n }\n :host([has_header][has_aside][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"header aside\" \"body aside\";\n }\n :host([has_header][has_aside][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"aside header\" \"aside body\";\n }\n }\n :host([has_header][has_footer]) .pfe-band__container {\n grid-template-areas: \"header\" \"body\" \"footer\";\n }\n :host([has_footer][has_aside]) .pfe-band__container {\n grid-template-areas: \"body\" \"aside\" \"footer\";\n }\n @media (max-width: 767px) {\n :host([has_footer][has_aside][aside-mobile=\"top\"]) .pfe-band__container {\n grid-template-areas: \"aside\" \"body\" \"footer\";\n }\n }\n @media (min-width: 768px) {\n :host([has_footer][has_aside]) .pfe-band__container {\n grid-template-areas: \"body aside\" \"footer footer\";\n }\n :host([has_footer][has_aside][aside-desktop=\"left\"]) .pfe-band__container {\n grid-template-areas: \"aside body\" \"footer footer\";\n }\n :host([has_footer][has_aside][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"body aside\" \"footer aside\";\n }\n :host([has_footer][has_aside][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"aside body\" \"aside footer\";\n }\n }\n :host([has_header][has_aside][has_footer]) .pfe-band__container {\n grid-template-areas: \"header\" \"body\" \"footer\" \"aside\";\n }\n @media (max-width: 767px) {\n :host([has_header][has_aside][has_footer][aside-mobile=\"top\"]) .pfe-band__container {\n grid-template-areas: \"aside\" \"header\" \"body\" \"footer\";\n }\n }\n @media (min-width: 768px) {\n :host([has_header][has_aside][has_footer]) .pfe-band__container {\n grid-template-areas: \"header header\" \"body aside\" \"footer footer\";\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"]) .pfe-band__container {\n grid-template-areas: \"header header\" \"aside body\" \"footer footer\";\n }\n :host([has_header][has_aside][has_footer][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"header aside\" \"body aside\" \"footer aside\";\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container {\n grid-template-areas: \"aside header\" \"aside body\" \"aside footer\";\n }\n }\n @media (min-width: 768px) {\n .pfe-band__container {\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n -ms-grid-columns: 1fr;\n grid-template-columns: 1fr;\n }\n .pfe-band__container > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_aside]) .pfe-band__container {\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n -ms-grid-columns: 1fr 240px;\n grid-template-columns: 1fr 240px;\n -ms-grid-columns: 1fr var(--pfe-band--Width__aside--sm, 240px);\n grid-template-columns: 1fr var(--pfe-band--Width__aside--sm, 240px);\n }\n :host([has_aside]) .pfe-band__container > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_aside]) .pfe-band__container > *:nth-child(2) {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n }\n :host([has_aside]) .pfe-band__container > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_aside]) .pfe-band__container > *:nth-child(2) {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container {\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n -ms-grid-columns: 240px 1fr;\n grid-template-columns: 240px 1fr;\n -ms-grid-columns: var(--pfe-band--Width__aside--sm, 240px) 1fr;\n grid-template-columns: var(--pfe-band--Width__aside--sm, 240px) 1fr;\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container > *:nth-child(2) {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container > *:nth-child(2) {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n }\n }\n @media (min-width: 992px) {\n :host([has_aside]) .pfe-band__container {\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n -ms-grid-columns: 1fr 300px;\n grid-template-columns: 1fr 300px;\n -ms-grid-columns: var(--pfe-band--layout, 1fr var(--pfe-band--Width__aside--lg, 300px));\n grid-template-columns: var(--pfe-band--layout, 1fr var(--pfe-band--Width__aside--lg, 300px));\n }\n :host([has_aside]) .pfe-band__container > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_aside]) .pfe-band__container > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_aside]) .pfe-band__container > *:nth-child(2) {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container {\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n -ms-grid-columns: 300px 1fr;\n grid-template-columns: 300px 1fr;\n -ms-grid-columns: var(--pfe-band--layout, var(--pfe-band--Width__aside--lg, 300px) 1fr);\n grid-template-columns: var(--pfe-band--layout, var(--pfe-band--Width__aside--lg, 300px) 1fr);\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container > *:nth-child(2) {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n }\n }\n}\n\n.pfe-band__container,\n.pfe-band__wrapper {\n margin-bottom: calc(-1 * 1rem);\n margin-bottom: calc(-1 * var(--pfe-band--gutter--vertical, var(--pfe-theme--container-spacer, 1rem)));\n margin-right: calc(-1 * 1rem);\n margin-right: calc(-1 * var(--pfe-band--gutter--vertical, var(--pfe-theme--container-spacer, 1rem)));\n}\n\n@supports (display: grid) {\n .pfe-band__container,\n .pfe-band__wrapper {\n margin: 0 auto;\n }\n}\n\n.pfe-band__aside {\n height: 100%;\n}\n\n.pfe-band__header {\n margin-bottom: 1rem;\n margin-bottom: var(--pfe-band__header--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n margin-right: 1rem;\n margin-right: var(--pfe-band__header--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n}\n\n@supports (display: grid) {\n .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n grid-area: header;\n margin-bottom: 0;\n margin-right: 0;\n }\n :host([has_header][has_aside]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_header][has_footer]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n :host([has_header][has_aside][has_footer]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n :host([use-grid]) .pfe-band__header {\n display: -ms-grid;\n display: grid;\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n -ms-grid-columns: 1fr;\n grid-template-columns: 1fr;\n -ms-grid-columns: var(--pfe-band__header--layout, 1fr);\n grid-template-columns: var(--pfe-band__header--layout, 1fr);\n grid-row-gap: 1rem;\n grid-row-gap: var(--pfe-band__header--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n row-gap: 1rem;\n row-gap: var(--pfe-band__header--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n grid-column-gap: calc(1rem * 3);\n grid-column-gap: var(--pfe-band__header--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n -webkit-column-gap: calc(1rem * 3);\n -moz-column-gap: calc(1rem * 3);\n column-gap: calc(1rem * 3);\n -webkit-column-gap: var(--pfe-band__header--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n -moz-column-gap: var(--pfe-band__header--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n column-gap: var(--pfe-band__header--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n }\n :host([use-grid]) .pfe-band__header > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([use-grid]) .pfe-band__header > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n}\n\n.pfe-band__body {\n margin-bottom: 1rem;\n margin-bottom: var(--pfe-band__body--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n margin-right: 1rem;\n margin-right: var(--pfe-band__body--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n}\n\n@supports (display: grid) {\n .pfe-band__body {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n grid-area: body;\n margin-bottom: 0;\n margin-right: 0;\n }\n :host([has_header]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_aside]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_footer]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_header][has_footer]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_footer][has_aside]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([use-grid]) .pfe-band__body {\n display: -ms-grid;\n display: grid;\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n -ms-grid-columns: 1fr;\n grid-template-columns: 1fr;\n -ms-grid-columns: var(--pfe-band__body--layout, 1fr);\n grid-template-columns: var(--pfe-band__body--layout, 1fr);\n grid-row-gap: 1rem;\n grid-row-gap: var(--pfe-band__body--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n row-gap: 1rem;\n row-gap: var(--pfe-band__body--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n grid-column-gap: calc(1rem * 3);\n grid-column-gap: var(--pfe-band__body--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n -webkit-column-gap: calc(1rem * 3);\n -moz-column-gap: calc(1rem * 3);\n column-gap: calc(1rem * 3);\n -webkit-column-gap: var(--pfe-band__body--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n -moz-column-gap: var(--pfe-band__body--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n column-gap: var(--pfe-band__body--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n }\n :host([use-grid]) .pfe-band__body > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([use-grid]) .pfe-band__body > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n}\n\n.pfe-band__footer {\n margin-bottom: 1rem;\n margin-bottom: var(--pfe-band__footer--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n margin-right: 1rem;\n margin-right: var(--pfe-band__footer--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n}\n\n@supports (display: grid) {\n .pfe-band__footer {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n grid-area: footer;\n margin-bottom: 0;\n margin-right: 0;\n }\n :host([has_header][has_footer]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n }\n :host([has_footer][has_aside]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n :host([use-grid]) .pfe-band__footer {\n display: -ms-grid;\n display: grid;\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n -ms-grid-columns: 1fr;\n grid-template-columns: 1fr;\n -ms-grid-columns: var(--pfe-band__footer--layout, 1fr);\n grid-template-columns: var(--pfe-band__footer--layout, 1fr);\n grid-row-gap: 1rem;\n grid-row-gap: var(--pfe-band__footer--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n row-gap: 1rem;\n row-gap: var(--pfe-band__footer--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n grid-column-gap: calc(1rem * 3);\n grid-column-gap: var(--pfe-band__footer--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n -webkit-column-gap: calc(1rem * 3);\n -moz-column-gap: calc(1rem * 3);\n column-gap: calc(1rem * 3);\n -webkit-column-gap: var(--pfe-band__footer--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n -moz-column-gap: var(--pfe-band__footer--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n column-gap: var(--pfe-band__footer--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n }\n :host([use-grid]) .pfe-band__footer > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([use-grid]) .pfe-band__footer > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n}\n\n.pfe-band__aside {\n margin-bottom: 1rem;\n margin-bottom: var(--pfe-band__aside--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n margin-right: 1rem;\n margin-right: var(--pfe-band__aside--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n}\n\n@supports (display: grid) {\n .pfe-band__aside {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n grid-area: aside;\n margin-bottom: 0;\n margin-right: 0;\n }\n :host([has_header][has_aside]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n }\n :host([has_footer][has_aside]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 2;\n -ms-grid-row-span: 1;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 4;\n -ms-grid-row-span: 1;\n -ms-grid-column: 1;\n }\n @media (max-width: 767px) {\n :host([has_header][has_aside][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n :host([has_aside][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n }\n :host([has_footer][has_aside][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n }\n :host([has_footer][has_aside][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 4;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n :host([has_aside][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_footer][has_aside][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-row-span: 1;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer][aside-mobile=\"top\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-row-span: 1;\n -ms-grid-column: 1;\n }\n }\n @media (min-width: 768px) {\n :host([has_header][has_aside]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n -ms-grid-column-span: 2;\n }\n :host([has_header][has_aside][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n -ms-grid-column-span: 2;\n }\n :host([has_header][has_aside][aside-height=\"full\"]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n :host([has_header][has_aside][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n -ms-grid-column-span: 1;\n }\n :host([has_header][has_aside][has_footer]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n -ms-grid-column-span: 2;\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n -ms-grid-column-span: 2;\n }\n :host([has_header][has_aside][has_footer][aside-height=\"full\"]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container > .pfe-band__header {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n -ms-grid-column-span: 1;\n }\n :host([has_aside]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n }\n :host([has_header][has_aside]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 2;\n }\n :host([has_header][has_aside][aside-height=\"full\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 2;\n }\n :host([has_footer][has_aside]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_footer][has_aside][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n }\n :host([has_footer][has_aside][aside-height=\"full\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_footer][has_aside][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n }\n :host([has_header][has_aside][has_footer]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 2;\n }\n :host([has_header][has_aside][has_footer][aside-height=\"full\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container > .pfe-band__body {\n -ms-grid-row: 2;\n -ms-grid-column: 2;\n }\n :host([has_footer][has_aside]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n -ms-grid-column-span: 2;\n }\n :host([has_footer][has_aside][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n -ms-grid-column-span: 2;\n }\n :host([has_footer][has_aside][aside-height=\"full\"]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n :host([has_footer][has_aside][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 2;\n -ms-grid-column: 2;\n -ms-grid-column-span: 1;\n }\n :host([has_header][has_aside][has_footer]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n -ms-grid-column-span: 2;\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n -ms-grid-column-span: 2;\n }\n :host([has_header][has_aside][has_footer][aside-height=\"full\"]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container > .pfe-band__footer {\n -ms-grid-row: 3;\n -ms-grid-column: 2;\n -ms-grid-column-span: 1;\n }\n .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n }\n :host([has_aside][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 2;\n -ms-grid-column: 2;\n }\n :host([has_header][has_aside][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 2;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][aside-height=\"full\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-row-span: 2;\n -ms-grid-column: 2;\n }\n :host([has_header][has_aside][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-row-span: 2;\n -ms-grid-column: 1;\n }\n :host([has_footer][has_aside]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-row-span: 1;\n -ms-grid-column: 2;\n }\n :host([has_footer][has_aside][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-row-span: 1;\n -ms-grid-column: 1;\n }\n :host([has_footer][has_aside][aside-height=\"full\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-row-span: 2;\n -ms-grid-column: 2;\n }\n :host([has_footer][has_aside][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-row-span: 2;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 2;\n -ms-grid-row-span: 1;\n -ms-grid-column: 2;\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 2;\n -ms-grid-row-span: 1;\n -ms-grid-column: 1;\n }\n :host([has_header][has_aside][has_footer][aside-height=\"full\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-row-span: 3;\n -ms-grid-column: 2;\n }\n :host([has_header][has_aside][has_footer][aside-desktop=\"left\"][aside-height=\"full\"]) .pfe-band__container > .pfe-band__aside {\n -ms-grid-row: 1;\n -ms-grid-row-span: 3;\n -ms-grid-column: 1;\n }\n }\n :host([use-grid]) .pfe-band__aside {\n display: -ms-grid;\n display: grid;\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n -ms-grid-columns: 1fr;\n grid-template-columns: 1fr;\n -ms-grid-columns: var(--pfe-band__aside--layout, 1fr);\n grid-template-columns: var(--pfe-band__aside--layout, 1fr);\n grid-row-gap: 1rem;\n grid-row-gap: var(--pfe-band__aside--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n row-gap: 1rem;\n row-gap: var(--pfe-band__aside--gutter--vertical, var(--pfe-theme--container-spacer, 1rem));\n grid-column-gap: calc(1rem * 3);\n grid-column-gap: var(--pfe-band__aside--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n -webkit-column-gap: calc(1rem * 3);\n -moz-column-gap: calc(1rem * 3);\n column-gap: calc(1rem * 3);\n -webkit-column-gap: var(--pfe-band__aside--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n -moz-column-gap: var(--pfe-band__aside--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n column-gap: var(--pfe-band__aside--gutter--horizontal, calc(var(--pfe-theme--container-spacer, 1rem) * 3));\n }\n :host([use-grid]) .pfe-band__aside > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n :host([use-grid]) .pfe-band__aside > *:nth-child(1) {\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n /* IE10+ */\n .pfe-band__container::after {\n clear: both;\n content: \"\";\n display: table;\n }\n .pfe-band__header,\n .pfe-band__body,\n .pfe-band__footer {\n float: left;\n }\n :host([aside-mobile=\"top\"]) .pfe-band__header, :host([aside-mobile=\"top\"])\n .pfe-band__body, :host([aside-mobile=\"top\"])\n .pfe-band__footer {\n float: right;\n }\n :host(:not([aside-height=\"full\"])) .pfe-band__header, :host(:not([aside-height=\"full\"]))\n .pfe-band__body, :host(:not([aside-height=\"full\"]))\n .pfe-band__footer {\n width: 60%;\n }\n .pfe-band__footer {\n clear: both;\n }\n .pfe-band__aside {\n -webkit-box-flex: 1;\n -webkit-flex-grow: 1;\n -ms-flex-positive: 1;\n flex-grow: 1;\n -webkit-align-self: flex-start;\n -ms-flex-item-align: start;\n align-self: flex-start;\n float: right;\n width: 35%;\n margin: 0 1.9%;\n }\n :host([aside-desktop=\"left\"]) .pfe-band__aside {\n float: left;\n }\n .pfe-band__wrapper {\n width: 60%;\n float: left;\n }\n :host([aside-desktop=\"left\"]) .pfe-band__wrapper {\n float: right;\n }\n}\n\n/*# sourceMappingURL=pfe-band.css.map */\n"]} \ No newline at end of file diff --git a/elements/pfe-band/dist/pfe-band.min.js b/elements/pfe-band/dist/pfe-band.min.js new file mode 100644 index 0000000000..42824dbc1f --- /dev/null +++ b/elements/pfe-band/dist/pfe-band.min.js @@ -0,0 +1,26 @@ +import e from"../../pfelement/dist/pfelement.min.js";Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var a=this;do{if(a.matches(e))return a;a=a.parentElement||a.parentNode}while(null!==a&&1===a.nodeType);return null}) +/*! + * PatternFly Elements: PfeBand 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/;class a extends e{static get version(){return"1.3.0"}get html(){return`\n\n
    \n ${this.hasSlot("pfe-band--aside")&&"top"===this.asidePosition.mobile?'':""}\n ${"full"===this.asideHeight?'
    ':""}\n ${this.hasSlot("pfe-band--header")?'
    \n \n
    ':""}\n
    \n \n
    \n ${"full"!==this.asideHeight&&this.hasSlot("pfe-band--aside")&&"top"!==this.asidePosition.mobile?'\n \n ':""}\n ${this.hasSlot("pfe-band--footer")?'
    \n \n
    ':""}\n ${"full"===this.asideHeight?"
    ":""}\n ${"full"===this.asideHeight&&this.hasSlot("pfe-band--aside")&&"top"!==this.asidePosition.mobile?'\n \n ':""}\n
    `}static get tag(){return"pfe-band"}static get meta(){return{title:"Band",description:"This element creates a header, body, footer, and aside region in which to place content or other components."}}get templateUrl(){return"pfe-band.html"}get styleUrl(){return"pfe-band.scss"}get asidePosition(){return{desktop:this.asideDesktop,mobile:this.asideMobile,height:this.asideHeight}}static get properties(){return{imgSrc:{title:"Background image",type:String,observer:"_imgSrcChanged"},oldImgSrc:{alias:"imgSrc",attr:"pfe-img-src"},color:{title:"Background color",type:String,values:["lightest","base","darker","darkest","complement","accent"],default:"base",observer:"_colorChanged"},oldColor:{alias:"color",attr:"pfe-color"},asideDesktop:{title:"side positioning (desktop)",type:String,values:["right","left"],default:"right"},oldAsideDesktop:{alias:"asideDesktop",attr:"pfe-aside-desktop"},asideMobile:{title:"Aside positioning (mobile)",type:String,values:["top","bottom"],default:"bottom"},oldAsideMobile:{alias:"asideMobile",attr:"pfe-aside-mobile"},asideHeight:{title:"Aside height",type:String,values:["full","body"],default:"body"},oldAsideHeight:{alias:"asideHeight",attr:"pfe-aside-height"},size:{title:"Padding size",type:String,values:["small"]},oldSize:{alias:"size",attr:"pfe-size"},useGrid:{title:"Default grid on for the light DOM regions (header, body, footer, aside)",type:Boolean,default:!1}}}static get slots(){return{header:{title:"Header",type:"array",namedSlot:!0,maxItems:3,items:{$ref:"raw"}},body:{title:"Body",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-card"},{$ref:"raw"}]}},footer:{title:"Footer",type:"array",namedSlot:!0,maxItems:3,items:{oneOf:[{$ref:"pfe-cta"},{$ref:"raw"}]}},aside:{title:"Aside",type:"array",namedSlot:!0,maxItems:5,items:{oneOf:[{$ref:"pfe-card"},{$ref:"raw"}]}}}}static get PfeType(){return e.PfeTypes.Container}constructor(){super(a,{type:a.PfeType})}_colorChanged(){this.resetContext()}_imgSrcChanged(e,a){this.style.backgroundImage=a?`url('${a}')`:""}}e.create(a);export default a; +//# sourceMappingURL=pfe-band.min.js.map diff --git a/elements/pfe-band/dist/pfe-band.min.js.map b/elements/pfe-band/dist/pfe-band.min.js.map new file mode 100644 index 0000000000..bf5150eb26 --- /dev/null +++ b/elements/pfe-band/dist/pfe-band.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-band.min.js","sources":["../_temp/polyfills--pfe-band.js","../_temp/pfe-band.js"],"sourcesContent":["// @POLYFILL Element.matches\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n// @POLYFILL Element.closest\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\nif (!Element.prototype.closest) {\n Element.prototype.closest = function(s) {\n var el = this;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n}\n","/*!\n * PatternFly Elements: PfeBand 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: matches, closest, includes\nimport \"./polyfills--pfe-band.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\nclass PfeBand extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n ${this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile === \"top\" ? `` : \"\"}\n ${this.asideHeight === \"full\" ? `
    ` : \"\"}\n ${this.hasSlot(\"pfe-band--header\") ? `
    \n \n
    ` : \"\"}\n
    \n \n
    \n ${this.asideHeight !== \"full\" && this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile !== \"top\" ? `\n \n ` : \"\"}\n ${this.hasSlot(\"pfe-band--footer\") ? `
    \n \n
    ` : \"\"}\n ${this.asideHeight === \"full\" ? `
    ` : \"\"}\n ${this.asideHeight === \"full\" && this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile !== \"top\" ? `\n \n ` : \"\"}\n
    `;\n }\n\n static get tag() {\n return \"pfe-band\";\n }\n\n static get meta() {\n return {\n title: \"Band\",\n description:\n \"This element creates a header, body, footer, and aside region in which to place content or other components.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-band.html\";\n }\n\n get styleUrl() {\n return \"pfe-band.scss\";\n }\n\n get asidePosition() {\n return {\n desktop: this.asideDesktop,\n mobile: this.asideMobile,\n height: this.asideHeight\n };\n }\n\n static get properties() {\n return {\n imgSrc: {\n title: \"Background image\",\n type: String,\n observer: \"_imgSrcChanged\"\n },\n // @TODO: Deprecated property in 1.0\n oldImgSrc: {\n alias: \"imgSrc\",\n attr: \"pfe-img-src\"\n },\n color: {\n title: \"Background color\",\n type: String,\n values: [\"lightest\", \"base\", \"darker\", \"darkest\", \"complement\", \"accent\"],\n default: \"base\",\n observer: \"_colorChanged\"\n },\n // @TODO: Deprecated property in 1.0\n oldColor: {\n alias: \"color\",\n attr: \"pfe-color\"\n },\n asideDesktop: {\n title: \"side positioning (desktop)\",\n type: String,\n values: [\"right\", \"left\"],\n default: \"right\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideDesktop: {\n alias: \"asideDesktop\",\n attr: \"pfe-aside-desktop\"\n },\n asideMobile: {\n title: \"Aside positioning (mobile)\",\n type: String,\n values: [\"top\", \"bottom\"],\n default: \"bottom\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideMobile: {\n alias: \"asideMobile\",\n attr: \"pfe-aside-mobile\"\n },\n asideHeight: {\n title: \"Aside height\",\n type: String,\n values: [\"full\", \"body\"],\n default: \"body\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideHeight: {\n alias: \"asideHeight\",\n attr: \"pfe-aside-height\"\n },\n size: {\n title: \"Padding size\",\n type: String,\n values: [\"small\"]\n },\n // @TODO: Deprecated property in 1.0\n oldSize: {\n alias: \"size\",\n attr: \"pfe-size\"\n },\n useGrid: {\n title: \"Default grid on for the light DOM regions (header, body, footer, aside)\",\n type: Boolean,\n default: false\n }\n };\n }\n\n static get slots() {\n return {\n header: {\n title: \"Header\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n $ref: \"raw\"\n }\n },\n body: {\n title: \"Body\",\n type: \"array\",\n namedSlot: false,\n items: {\n oneOf: [\n {\n $ref: \"pfe-card\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n },\n footer: {\n title: \"Footer\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n oneOf: [\n {\n $ref: \"pfe-cta\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n },\n aside: {\n title: \"Aside\",\n type: \"array\",\n namedSlot: true,\n maxItems: 5,\n items: {\n oneOf: [\n {\n $ref: \"pfe-card\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n }\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n constructor() {\n super(PfeBand, { type: PfeBand.PfeType });\n }\n\n _colorChanged() {\n // Update the context\n this.resetContext();\n }\n\n // Update the background image\n _imgSrcChanged(oldVal, newVal) {\n // Set the image as the background image\n this.style.backgroundImage = newVal ? `url('${newVal}')` : ``;\n }\n}\n\nPFElement.create(PfeBand);\n\nexport { PfeBand as default };\n"],"names":["Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","this","parentElement","parentNode","nodeType","PfeBand","PFElement","version","html","hasSlot","asidePosition","mobile","asideHeight","tag","meta","title","description","templateUrl","styleUrl","desktop","asideDesktop","asideMobile","height","properties","imgSrc","type","String","observer","oldImgSrc","alias","attr","color","values","default","oldColor","oldAsideDesktop","oldAsideMobile","oldAsideHeight","size","oldSize","useGrid","Boolean","slots","header","namedSlot","maxItems","items","$ref","body","oneOf","footer","aside","PfeType","PfeTypes","Container","[object Object]","super","resetContext","oldVal","newVal","style","backgroundImage","create"],"mappings":"qDAEKA,QAAQC,UAAUC,UACrBF,QAAQC,UAAUC,QAAUF,QAAQC,UAAUE,mBAAqBH,QAAQC,UAAUG,uBAKlFJ,QAAQC,UAAUI,UACrBL,QAAQC,UAAUI,QAAU,SAASC,GACnC,IAAIC,EAAKC,KACT,EAAG,CACD,GAAID,EAAGL,QAAQI,GAAI,OAAOC,EAC1BA,EAAKA,EAAGE,eAAiBF,EAAGG,iBACd,OAAPH,GAA+B,IAAhBA,EAAGI,UAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;GCeX,MAAMC,UAAgBC,EAGpBC,qBACE,MAAO,QAITC,WACE,ig8BAGAP,KAAKQ,QAAQ,oBAAoD,QAA9BR,KAAKS,cAAcC,OAAmB,wFAE/D,SACW,SAArBV,KAAKW,YAAyB,kCAAoC,WAChEX,KAAKQ,QAAQ,oBAAsB,gGAExB,sFAIU,SAArBR,KAAKW,aAA0BX,KAAKQ,QAAQ,oBAAoD,QAA9BR,KAAKS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,CACLC,KAAM,QAGVC,KAAM,CACJjC,MAAO,OACPU,KAAM,QACNmB,WAAW,EACXE,MAAO,CACLG,MAAO,CACL,CACEF,KAAM,YAER,CACEA,KAAM,UAKdG,OAAQ,CACNnC,MAAO,SACPU,KAAM,QACNmB,WAAW,EACXC,SAAU,EACVC,MAAO,CACLG,MAAO,CACL,CACEF,KAAM,WAER,CACEA,KAAM,UAKdI,MAAO,CACLpC,MAAO,QACPU,KAAM,QACNmB,WAAW,EACXC,SAAU,EACVC,MAAO,CACLG,MAAO,CACL,CACEF,KAAM,YAER,CACEA,KAAM,WASlBK,qBACE,OAAO9C,EAAU+C,SAASC,UAG5BC,cACEC,MAAMnD,EAAS,CAAEoB,KAAMpB,EAAQ+C,UAGjCG,gBAEEtD,KAAKwD,eAIPF,eAAeG,EAAQC,GAErB1D,KAAK2D,MAAMC,gBAAkBF,UAAiBA,MAAa,IAI/DrD,EAAUwD,OAAOzD"} \ No newline at end of file diff --git a/elements/pfe-band/dist/pfe-band.umd.js b/elements/pfe-band/dist/pfe-band.umd.js new file mode 100644 index 0000000000..d03d58c040 --- /dev/null +++ b/elements/pfe-band/dist/pfe-band.umd.js @@ -0,0 +1,319 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../../pfelement/dist/pfelement.umd')) : + typeof define === 'function' && define.amd ? define(['../../pfelement/dist/pfelement.umd'], factory) : + (global = global || self, global.PfeBand = factory(global.PFElement)); +}(this, (function (PFElement) { 'use strict'; + + PFElement = PFElement && Object.prototype.hasOwnProperty.call(PFElement, 'default') ? PFElement['default'] : PFElement; + + // @POLYFILL Element.matches + // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + } + + // @POLYFILL Element.closest + // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest + if (!Element.prototype.closest) { + Element.prototype.closest = function (s) { + var el = this; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + return null; + }; + } + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + }; + + var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + }; + + /*! + * PatternFly Elements: PfeBand 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + var PfeBand = function (_PFElement) { + inherits(PfeBand, _PFElement); + createClass(PfeBand, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n
    \n " + (this.hasSlot("pfe-band--aside") && this.asidePosition.mobile === "top" ? "" : "") + "\n " + (this.asideHeight === "full" ? "
    " : "") + "\n " + (this.hasSlot("pfe-band--header") ? "
    \n \n
    " : "") + "\n
    \n \n
    \n " + (this.asideHeight !== "full" && this.hasSlot("pfe-band--aside") && this.asidePosition.mobile !== "top" ? "\n \n " : "") + "\n " + (this.hasSlot("pfe-band--footer") ? "
    \n \n
    " : "") + "\n " + (this.asideHeight === "full" ? "
    " : "") + "\n " + (this.asideHeight === "full" && this.hasSlot("pfe-band--aside") && this.asidePosition.mobile !== "top" ? "\n \n " : "") + "\n
    "; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-band.html"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-band.scss"; + } + }, { + key: "asidePosition", + get: function get() { + return { + desktop: this.asideDesktop, + mobile: this.asideMobile, + height: this.asideHeight + }; + } + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "tag", + get: function get() { + return "pfe-band"; + } + }, { + key: "meta", + get: function get() { + return { + title: "Band", + description: "This element creates a header, body, footer, and aside region in which to place content or other components." + }; + } + }, { + key: "properties", + get: function get() { + return { + imgSrc: { + title: "Background image", + type: String, + observer: "_imgSrcChanged" + }, + // @TODO: Deprecated property in 1.0 + oldImgSrc: { + alias: "imgSrc", + attr: "pfe-img-src" + }, + color: { + title: "Background color", + type: String, + values: ["lightest", "base", "darker", "darkest", "complement", "accent"], + default: "base", + observer: "_colorChanged" + }, + // @TODO: Deprecated property in 1.0 + oldColor: { + alias: "color", + attr: "pfe-color" + }, + asideDesktop: { + title: "side positioning (desktop)", + type: String, + values: ["right", "left"], + default: "right" + }, + // @TODO: Deprecated property in 1.0 + oldAsideDesktop: { + alias: "asideDesktop", + attr: "pfe-aside-desktop" + }, + asideMobile: { + title: "Aside positioning (mobile)", + type: String, + values: ["top", "bottom"], + default: "bottom" + }, + // @TODO: Deprecated property in 1.0 + oldAsideMobile: { + alias: "asideMobile", + attr: "pfe-aside-mobile" + }, + asideHeight: { + title: "Aside height", + type: String, + values: ["full", "body"], + default: "body" + }, + // @TODO: Deprecated property in 1.0 + oldAsideHeight: { + alias: "asideHeight", + attr: "pfe-aside-height" + }, + size: { + title: "Padding size", + type: String, + values: ["small"] + }, + // @TODO: Deprecated property in 1.0 + oldSize: { + alias: "size", + attr: "pfe-size" + }, + useGrid: { + title: "Default grid on for the light DOM regions (header, body, footer, aside)", + type: Boolean, + default: false + } + }; + } + }, { + key: "slots", + get: function get() { + return { + header: { + title: "Header", + type: "array", + namedSlot: true, + maxItems: 3, + items: { + $ref: "raw" + } + }, + body: { + title: "Body", + type: "array", + namedSlot: false, + items: { + oneOf: [{ + $ref: "pfe-card" + }, { + $ref: "raw" + }] + } + }, + footer: { + title: "Footer", + type: "array", + namedSlot: true, + maxItems: 3, + items: { + oneOf: [{ + $ref: "pfe-cta" + }, { + $ref: "raw" + }] + } + }, + aside: { + title: "Aside", + type: "array", + namedSlot: true, + maxItems: 5, + items: { + oneOf: [{ + $ref: "pfe-card" + }, { + $ref: "raw" + }] + } + } + }; + } + + // Declare the type of this component + + }, { + key: "PfeType", + get: function get() { + return PFElement.PfeTypes.Container; + } + }]); + + function PfeBand() { + classCallCheck(this, PfeBand); + return possibleConstructorReturn(this, (PfeBand.__proto__ || Object.getPrototypeOf(PfeBand)).call(this, PfeBand, { type: PfeBand.PfeType })); + } + + createClass(PfeBand, [{ + key: "_colorChanged", + value: function _colorChanged() { + // Update the context + this.resetContext(); + } + + // Update the background image + + }, { + key: "_imgSrcChanged", + value: function _imgSrcChanged(oldVal, newVal) { + // Set the image as the background image + this.style.backgroundImage = newVal ? "url('" + newVal + "')" : ""; + } + }]); + return PfeBand; + }(PFElement); + + PFElement.create(PfeBand); + + return PfeBand; + +}))); +//# sourceMappingURL=pfe-band.umd.js.map diff --git a/elements/pfe-band/dist/pfe-band.umd.js.map b/elements/pfe-band/dist/pfe-band.umd.js.map new file mode 100644 index 0000000000..418fc13b8e --- /dev/null +++ b/elements/pfe-band/dist/pfe-band.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-band.umd.js","sources":["../_temp/polyfills--pfe-band.js","../_temp/pfe-band.umd.js"],"sourcesContent":["// @POLYFILL Element.matches\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n// @POLYFILL Element.closest\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\nif (!Element.prototype.closest) {\n Element.prototype.closest = function(s) {\n var el = this;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n}\n","/*!\n * PatternFly Elements: PfeBand 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: matches, closest, includes\nimport \"./polyfills--pfe-band.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\n\nclass PfeBand extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n ${this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile === \"top\" ? `` : \"\"}\n ${this.asideHeight === \"full\" ? `
    ` : \"\"}\n ${this.hasSlot(\"pfe-band--header\") ? `
    \n \n
    ` : \"\"}\n
    \n \n
    \n ${this.asideHeight !== \"full\" && this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile !== \"top\" ? `\n \n ` : \"\"}\n ${this.hasSlot(\"pfe-band--footer\") ? `
    \n \n
    ` : \"\"}\n ${this.asideHeight === \"full\" ? `
    ` : \"\"}\n ${this.asideHeight === \"full\" && this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile !== \"top\" ? `\n \n ` : \"\"}\n
    `;\n }\n\n static get tag() {\n return \"pfe-band\";\n }\n\n static get meta() {\n return {\n title: \"Band\",\n description:\n \"This element creates a header, body, footer, and aside region in which to place content or other components.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-band.html\";\n }\n\n get styleUrl() {\n return \"pfe-band.scss\";\n }\n\n get asidePosition() {\n return {\n desktop: this.asideDesktop,\n mobile: this.asideMobile,\n height: this.asideHeight\n };\n }\n\n static get properties() {\n return {\n imgSrc: {\n title: \"Background image\",\n type: String,\n observer: \"_imgSrcChanged\"\n },\n // @TODO: Deprecated property in 1.0\n oldImgSrc: {\n alias: \"imgSrc\",\n attr: \"pfe-img-src\"\n },\n color: {\n title: \"Background color\",\n type: String,\n values: [\"lightest\", \"base\", \"darker\", \"darkest\", \"complement\", \"accent\"],\n default: \"base\",\n observer: \"_colorChanged\"\n },\n // @TODO: Deprecated property in 1.0\n oldColor: {\n alias: \"color\",\n attr: \"pfe-color\"\n },\n asideDesktop: {\n title: \"side positioning (desktop)\",\n type: String,\n values: [\"right\", \"left\"],\n default: \"right\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideDesktop: {\n alias: \"asideDesktop\",\n attr: \"pfe-aside-desktop\"\n },\n asideMobile: {\n title: \"Aside positioning (mobile)\",\n type: String,\n values: [\"top\", \"bottom\"],\n default: \"bottom\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideMobile: {\n alias: \"asideMobile\",\n attr: \"pfe-aside-mobile\"\n },\n asideHeight: {\n title: \"Aside height\",\n type: String,\n values: [\"full\", \"body\"],\n default: \"body\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideHeight: {\n alias: \"asideHeight\",\n attr: \"pfe-aside-height\"\n },\n size: {\n title: \"Padding size\",\n type: String,\n values: [\"small\"]\n },\n // @TODO: Deprecated property in 1.0\n oldSize: {\n alias: \"size\",\n attr: \"pfe-size\"\n },\n useGrid: {\n title: \"Default grid on for the light DOM regions (header, body, footer, aside)\",\n type: Boolean,\n default: false\n }\n };\n }\n\n static get slots() {\n return {\n header: {\n title: \"Header\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n $ref: \"raw\"\n }\n },\n body: {\n title: \"Body\",\n type: \"array\",\n namedSlot: false,\n items: {\n oneOf: [\n {\n $ref: \"pfe-card\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n },\n footer: {\n title: \"Footer\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n oneOf: [\n {\n $ref: \"pfe-cta\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n },\n aside: {\n title: \"Aside\",\n type: \"array\",\n namedSlot: true,\n maxItems: 5,\n items: {\n oneOf: [\n {\n $ref: \"pfe-card\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n }\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n constructor() {\n super(PfeBand, { type: PfeBand.PfeType });\n }\n\n _colorChanged() {\n // Update the context\n this.resetContext();\n }\n\n // Update the background image\n _imgSrcChanged(oldVal, newVal) {\n // Set the image as the background image\n this.style.backgroundImage = newVal ? `url('${newVal}')` : ``;\n }\n}\n\nPFElement.create(PfeBand);\n\nexport { PfeBand as default };\n"],"names":["Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","parentElement","parentNode","nodeType","PfeBand","hasSlot","asidePosition","mobile","asideHeight","desktop","asideDesktop","asideMobile","height","title","description","imgSrc","type","String","observer","oldImgSrc","alias","attr","color","values","default","oldColor","oldAsideDesktop","oldAsideMobile","oldAsideHeight","size","oldSize","useGrid","Boolean","header","namedSlot","maxItems","items","$ref","body","oneOf","footer","aside","PFElement","PfeTypes","Container","PfeType","resetContext","oldVal","newVal","style","backgroundImage","create"],"mappings":";;;;;;;;EAAA;EACA;EACA,IAAI,CAACA,QAAQC,SAAR,CAAkBC,OAAvB,EAAgC;EAC9BF,UAAQC,SAAR,CAAkBC,OAAlB,GAA4BF,QAAQC,SAAR,CAAkBE,iBAAlB,IAAuCH,QAAQC,SAAR,CAAkBG,qBAArF;EACD;;EAED;EACA;EACA,IAAI,CAACJ,QAAQC,SAAR,CAAkBI,OAAvB,EAAgC;EAC9BL,UAAQC,SAAR,CAAkBI,OAAlB,GAA4B,UAASC,CAAT,EAAY;EACtC,QAAIC,KAAK,IAAT;EACA,OAAG;EACD,UAAIA,GAAGL,OAAH,CAAWI,CAAX,CAAJ,EAAmB,OAAOC,EAAP;EACnBA,WAAKA,GAAGC,aAAH,IAAoBD,GAAGE,UAA5B;EACD,KAHD,QAGSF,OAAO,IAAP,IAAeA,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AGNkB,qBAAW,IAHL;EAINC,oBAAU,CAJJ;EAKNC,iBAAO;EACLC,kBAAM;EADD;EALD,SADH;EAULC,cAAM;EACJzB,iBAAO,MADH;EAEJG,gBAAM,OAFF;EAGJkB,qBAAW,KAHP;EAIJE,iBAAO;EACLG,mBAAO,CACL;EACEF,oBAAM;EADR,aADK,EAIL;EACEA,oBAAM;EADR,aAJK;EADF;EAJH,SAVD;EAyBLG,gBAAQ;EACN3B,iBAAO,QADD;EAENG,gBAAM,OAFA;EAGNkB,qBAAW,IAHL;EAINC,oBAAU,CAJJ;EAKNC,iBAAO;EACLG,mBAAO,CACL;EACEF,oBAAM;EADR,aADK,EAIL;EACEA,oBAAM;EADR,aAJK;EADF;EALD,SAzBH;EAyCLI,eAAO;EACL5B,iBAAO,OADF;EAELG,gBAAM,OAFD;EAGLkB,qBAAW,IAHN;EAILC,oBAAU,CAJL;EAKLC,iBAAO;EACLG,mBAAO,CACL;EACEF,oBAAM;EADR,aADK,EAIL;EACEA,oBAAM;EADR,aAJK;EADF;EALF;EAzCF,OAAP;EA0DD;;EAED;;;;0BACqB;EACnB,aAAOK,UAAUC,QAAV,CAAmBC,SAA1B;EACD;;;EAED,qBAAc;EAAA;EAAA,4GACNxC,OADM,EACG,EAAEY,MAAMZ,QAAQyC,OAAhB,EADH;EAEb;;;;sCAEe;EACd;EACA,WAAKC,YAAL;EACD;;EAED;;;;qCACeC,QAAQC,QAAQ;EAC7B;EACA,WAAKC,KAAL,CAAWC,eAAX,GAA6BF,mBAAiBA,MAAjB,YAA7B;EACD;;;IA3NmBN;;EA8NtBA,UAAUS,MAAV,CAAiB/C,OAAjB;;;;;;;;"} \ No newline at end of file diff --git a/elements/pfe-band/dist/pfe-band.umd.min.js b/elements/pfe-band/dist/pfe-band.umd.min.js new file mode 100644 index 0000000000..6477adff96 --- /dev/null +++ b/elements/pfe-band/dist/pfe-band.umd.min.js @@ -0,0 +1,2 @@ +!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("../../pfelement/dist/pfelement.umd.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min"],a):(e=e||self).PfeBand=a(e.PFElement)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var a=this;do{if(a.matches(e))return a}while(null!==(a=a.parentElement||a.parentNode)&&1===a.nodeType);return null});var a=function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")},r=function(e,a,r){return a&&o(e.prototype,a),r&&o(e,r),e};function o(e,a){for(var r=0;r@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([color=accent]),:host([color=base]),:host([color=complement]),:host([color=darker]),:host([color=darkest]),:host([color=lighter]),:host([color=lightest]){background-color:#fff!important;color:#151515!important}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#151515!important}}:host{--context:var(--pfe-band--context, light);display:block;border:1px solid transparent;border:var(--pfe-band--Border,var(--pfe-theme--surface--border-width,1px) var(--pfe-theme--surface--border-style,solid) transparent);background-color:#f0f0f0;background-color:var(--pfe-band--BackgroundColor,var(--pfe-theme--color--surface--base,#f0f0f0));background-position:center center;background-position:var(--pfe-band--BackgroundPosition,center center);color:#3c3f42;color:var(--pfe-broadcasted--text,#3c3f42);padding:calc(calc(1rem * 4)/ 2) calc(1rem * 1);padding:calc(var(--pfe-band--Padding--vertical,calc(var(--pfe-theme--container-spacer,1rem) * 4))/ 2) var(--pfe-band--Padding--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 1))}@media (min-width:576px){:host{padding:calc(1rem * 4) calc(1rem * 1);padding:var(--pfe-band--Padding,var(--pfe-band--Padding--vertical,calc(var(--pfe-theme--container-spacer,1rem) * 4)) var(--pfe-band--Padding--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 1)))}}:host *,:host ::after,:host ::before{-webkit-box-sizing:border-box;box-sizing:border-box}@media print{:host{background-color:#fff!important;background-image:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}}@media print{:host{border-radius:3px;border:1px solid #d2d2d2;padding:2rem 1rem}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;background-image:none!important;color:#151515!important;padding:2rem 1rem}}@media screen and (-ms-high-contrast:active) and (min-width:576px),screen and (-ms-high-contrast:none) and (min-width:576px){:host{padding:4rem 1rem}}:host([on=dark]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-dark, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-dark, #73bcf7);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-dark, #bee1f4);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-dark, #bee1f4);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-dark, #bee1f4);--pfe-broadcasted--link-decoration:var(--pfe-theme--link-decoration--on-dark, none);--pfe-broadcasted--link-decoration--hover:var(--pfe-theme--link-decoration--hover--on-dark, underline);--pfe-broadcasted--link-decoration--focus:var(--pfe-theme--link-decoration--focus--on-dark, underline);--pfe-broadcasted--link-decoration--visited:var(--pfe-theme--link-decoration--visited--on-dark, none)}:host([on=saturated]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-saturated, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-saturated, #fff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-saturated, #fafafa);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-saturated, #fafafa);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-saturated, #d2d2d2);--pfe-broadcasted--link-decoration:var(--pfe-theme--link-decoration--on-saturated, underline);--pfe-broadcasted--link-decoration--hover:var(--pfe-theme--link-decoration--hover--on-saturated, underline);--pfe-broadcasted--link-decoration--focus:var(--pfe-theme--link-decoration--focus--on-saturated, underline);--pfe-broadcasted--link-decoration--visited:var(--pfe-theme--link-decoration--visited--on-saturated, underline)}:host([on=light]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #151515);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #004080);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #004080);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, #6753ac);--pfe-broadcasted--link-decoration:var(--pfe-theme--link-decoration, none);--pfe-broadcasted--link-decoration--hover:var(--pfe-theme--link-decoration--hover, underline);--pfe-broadcasted--link-decoration--focus:var(--pfe-theme--link-decoration--focus, underline);--pfe-broadcasted--link-decoration--visited:var(--pfe-theme--link-decoration--visited, none)}:host([color=darker]){--pfe-band--BackgroundColor:var(--pfe-theme--color--surface--darker, #3c3f42);--pfe-band--context:var(--pfe-theme--color--surface--darker--context, dark)}:host([color=darkest]){--pfe-band--BackgroundColor:var(--pfe-theme--color--surface--darkest, #151515);--pfe-band--context:var(--pfe-theme--color--surface--darkest--context, dark)}:host([color=base]){--pfe-band--BackgroundColor:var(--pfe-theme--color--surface--base, #f0f0f0);--pfe-band--context:var(--pfe-theme--color--surface--base--context, light)}:host([color=lighter]){--pfe-band--BackgroundColor:var(--pfe-theme--color--surface--lighter, #f0f0f0);--pfe-band--context:var(--pfe-theme--color--surface--lighter--context, light)}:host([color=lightest]){--pfe-band--BackgroundColor:var(--pfe-theme--color--surface--lightest, #fff);--pfe-band--context:var(--pfe-theme--color--surface--lightest--context, light)}:host([color=accent]){--pfe-band--BackgroundColor:var(--pfe-theme--color--surface--accent, #004080);--pfe-band--context:var(--pfe-theme--color--surface--accent--context, saturated)}:host([color=complement]){--pfe-band--BackgroundColor:var(--pfe-theme--color--surface--complement, #002952);--pfe-band--context:var(--pfe-theme--color--surface--complement--context, saturated)}:host([size=small]){padding:calc(calc(1rem * 4)/ 4) calc(1rem * 1);padding:calc(var(--pfe-band--Padding--vertical,calc(var(--pfe-theme--container-spacer,1rem) * 4))/ 4) var(--pfe-band--Padding--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 1))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([size=small]){padding:1rem}}.pfe-band__container{max-width:auto;max-width:var(--pfe-band--Width,auto);margin:0 auto}@media screen and (min-width:768px){.pfe-band__container{max-width:calc(768px - (calc(1rem * 1) * 4));max-width:var(--pfe-band--Width,calc(768px - (var(--pfe-band--Padding--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 1)) * 4)))}}@media screen and (min-width:992px){.pfe-band__container{max-width:calc(992px - (calc(1rem * 1) * 4));max-width:var(--pfe-band--Width,calc(992px - (var(--pfe-band--Padding--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 1)) * 4)))}}@media screen and (min-width:1200px){.pfe-band__container{max-width:calc(1200px - (calc(1rem * 1) * 4));max-width:var(--pfe-band--Width,calc(1200px - (var(--pfe-band--Padding--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 1)) * 4)))}}@supports (display:grid){.pfe-band__container{display:-ms-grid;display:grid;-ms-grid-rows:auto;grid-template-rows:auto;-ms-grid-columns:auto;grid-template-columns:auto;grid-template-areas:"body";grid-row-gap:1rem;grid-row-gap:var(--pfe-band--gutter--vertical,var(--pfe-theme--container-spacer,1rem));row-gap:1rem;row-gap:var(--pfe-band--gutter--vertical,var(--pfe-theme--container-spacer,1rem));grid-column-gap:calc(1rem * 3);grid-column-gap:var(--pfe-band--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));-webkit-column-gap:calc(1rem * 3);-moz-column-gap:calc(1rem * 3);column-gap:calc(1rem * 3);-webkit-column-gap:var(--pfe-band--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));-moz-column-gap:var(--pfe-band--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));column-gap:var(--pfe-band--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3))}:host([has_header]) .pfe-band__container{grid-template-areas:"header" "body"}:host([has_aside]) .pfe-band__container{grid-template-areas:"body" "aside"}@media (max-width:767px){:host([has_aside][aside-mobile=top]) .pfe-band__container{grid-template-areas:"aside" "body"}}@media (min-width:768px){:host([has_aside]) .pfe-band__container{grid-template-areas:"body aside"}:host([has_aside][aside-desktop=left]) .pfe-band__container{grid-template-areas:"aside body"}}:host([has_footer]) .pfe-band__container{grid-template-areas:"body" "footer"}:host([has_header][has_aside]) .pfe-band__container{grid-template-areas:"header" "body" "aside"}@media (max-width:767px){:host([has_header][has_aside][aside-mobile=top]) .pfe-band__container{grid-template-areas:"aside" "header" "body"}}@media (min-width:768px){:host([has_header][has_aside]) .pfe-band__container{grid-template-areas:"header header" "body aside"}:host([has_header][has_aside][aside-desktop=left]) .pfe-band__container{grid-template-areas:"header header" "aside body"}:host([has_header][has_aside][aside-height=full]) .pfe-band__container{grid-template-areas:"header aside" "body aside"}:host([has_header][has_aside][aside-desktop=left][aside-height=full]) .pfe-band__container{grid-template-areas:"aside header" "aside body"}}:host([has_header][has_footer]) .pfe-band__container{grid-template-areas:"header" "body" "footer"}:host([has_footer][has_aside]) .pfe-band__container{grid-template-areas:"body" "aside" "footer"}@media (max-width:767px){:host([has_footer][has_aside][aside-mobile=top]) .pfe-band__container{grid-template-areas:"aside" "body" "footer"}}@media (min-width:768px){:host([has_footer][has_aside]) .pfe-band__container{grid-template-areas:"body aside" "footer footer"}:host([has_footer][has_aside][aside-desktop=left]) .pfe-band__container{grid-template-areas:"aside body" "footer footer"}:host([has_footer][has_aside][aside-height=full]) .pfe-band__container{grid-template-areas:"body aside" "footer aside"}:host([has_footer][has_aside][aside-desktop=left][aside-height=full]) .pfe-band__container{grid-template-areas:"aside body" "aside footer"}}:host([has_header][has_aside][has_footer]) .pfe-band__container{grid-template-areas:"header" "body" "footer" "aside"}@media (max-width:767px){:host([has_header][has_aside][has_footer][aside-mobile=top]) .pfe-band__container{grid-template-areas:"aside" "header" "body" "footer"}}@media (min-width:768px){:host([has_header][has_aside][has_footer]) .pfe-band__container{grid-template-areas:"header header" "body aside" "footer footer"}:host([has_header][has_aside][has_footer][aside-desktop=left]) .pfe-band__container{grid-template-areas:"header header" "aside body" "footer footer"}:host([has_header][has_aside][has_footer][aside-height=full]) .pfe-band__container{grid-template-areas:"header aside" "body aside" "footer aside"}:host([has_header][has_aside][has_footer][aside-desktop=left][aside-height=full]) .pfe-band__container{grid-template-areas:"aside header" "aside body" "aside footer"}}@media (min-width:768px){.pfe-band__container{-ms-grid-rows:auto;grid-template-rows:auto;-ms-grid-columns:1fr;grid-template-columns:1fr}.pfe-band__container>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([has_aside]) .pfe-band__container{-ms-grid-rows:auto;grid-template-rows:auto;-ms-grid-columns:1fr 240px;grid-template-columns:1fr 240px;-ms-grid-columns:1fr var(--pfe-band--Width__aside--sm,240px);grid-template-columns:1fr var(--pfe-band--Width__aside--sm,240px)}:host([has_aside]) .pfe-band__container>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([has_aside]) .pfe-band__container>:nth-child(2){-ms-grid-row:1;-ms-grid-column:2}:host([has_aside]) .pfe-band__container>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([has_aside]) .pfe-band__container>:nth-child(2){-ms-grid-row:1;-ms-grid-column:2}:host([has_aside][aside-desktop=left]) .pfe-band__container{-ms-grid-rows:auto;grid-template-rows:auto;-ms-grid-columns:240px 1fr;grid-template-columns:240px 1fr;-ms-grid-columns:var(--pfe-band--Width__aside--sm,240px) 1fr;grid-template-columns:var(--pfe-band--Width__aside--sm,240px) 1fr}:host([has_aside][aside-desktop=left]) .pfe-band__container>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([has_aside][aside-desktop=left]) .pfe-band__container>:nth-child(2){-ms-grid-row:1;-ms-grid-column:2}:host([has_aside][aside-desktop=left]) .pfe-band__container>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([has_aside][aside-desktop=left]) .pfe-band__container>:nth-child(2){-ms-grid-row:1;-ms-grid-column:2}}@media (min-width:992px){:host([has_aside]) .pfe-band__container{-ms-grid-rows:auto;grid-template-rows:auto;-ms-grid-columns:1fr 300px;grid-template-columns:1fr 300px;-ms-grid-columns:var(--pfe-band--layout,1fr var(--pfe-band--Width__aside--lg,300px));grid-template-columns:var(--pfe-band--layout,1fr var(--pfe-band--Width__aside--lg,300px))}:host([has_aside]) .pfe-band__container>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([has_aside]) .pfe-band__container>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([has_aside]) .pfe-band__container>:nth-child(2){-ms-grid-row:1;-ms-grid-column:2}:host([has_aside][aside-desktop=left]) .pfe-band__container{-ms-grid-rows:auto;grid-template-rows:auto;-ms-grid-columns:300px 1fr;grid-template-columns:300px 1fr;-ms-grid-columns:var(--pfe-band--layout,var(--pfe-band--Width__aside--lg,300px) 1fr);grid-template-columns:var(--pfe-band--layout,var(--pfe-band--Width__aside--lg,300px) 1fr)}:host([has_aside][aside-desktop=left]) .pfe-band__container>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([has_aside][aside-desktop=left]) .pfe-band__container>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([has_aside][aside-desktop=left]) .pfe-band__container>:nth-child(2){-ms-grid-row:1;-ms-grid-column:2}}}.pfe-band__container,.pfe-band__wrapper{margin-bottom:calc(-1 * 1rem);margin-bottom:calc(-1 * var(--pfe-band--gutter--vertical,var(--pfe-theme--container-spacer,1rem)));margin-right:calc(-1 * 1rem);margin-right:calc(-1 * var(--pfe-band--gutter--vertical,var(--pfe-theme--container-spacer,1rem)))}@supports (display:grid){.pfe-band__container,.pfe-band__wrapper{margin:0 auto}}.pfe-band__aside{height:100%}.pfe-band__header{margin-bottom:1rem;margin-bottom:var(--pfe-band__header--gutter--vertical,var(--pfe-theme--container-spacer,1rem));margin-right:1rem;margin-right:var(--pfe-band__header--gutter--vertical,var(--pfe-theme--container-spacer,1rem))}@supports (display:grid){.pfe-band__header{-ms-grid-row:1;-ms-grid-column:1;grid-area:header;margin-bottom:0;margin-right:0}:host([has_header][has_aside]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:1}:host([has_header][has_footer]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-column-span:1}:host([has_header][has_aside][has_footer]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-column-span:1}:host([use-grid]) .pfe-band__header{display:-ms-grid;display:grid;-ms-grid-rows:auto;grid-template-rows:auto;-ms-grid-columns:1fr;grid-template-columns:1fr;-ms-grid-columns:var(--pfe-band__header--layout,1fr);grid-template-columns:var(--pfe-band__header--layout,1fr);grid-row-gap:1rem;grid-row-gap:var(--pfe-band__header--gutter--vertical,var(--pfe-theme--container-spacer,1rem));row-gap:1rem;row-gap:var(--pfe-band__header--gutter--vertical,var(--pfe-theme--container-spacer,1rem));grid-column-gap:calc(1rem * 3);grid-column-gap:var(--pfe-band__header--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));-webkit-column-gap:calc(1rem * 3);-moz-column-gap:calc(1rem * 3);column-gap:calc(1rem * 3);-webkit-column-gap:var(--pfe-band__header--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));-moz-column-gap:var(--pfe-band__header--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));column-gap:var(--pfe-band__header--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3))}:host([use-grid]) .pfe-band__header>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([use-grid]) .pfe-band__header>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}}.pfe-band__body{margin-bottom:1rem;margin-bottom:var(--pfe-band__body--gutter--vertical,var(--pfe-theme--container-spacer,1rem));margin-right:1rem;margin-right:var(--pfe-band__body--gutter--vertical,var(--pfe-theme--container-spacer,1rem))}@supports (display:grid){.pfe-band__body{-ms-grid-row:1;-ms-grid-column:1;grid-area:body;margin-bottom:0;margin-right:0}:host([has_header]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:1}:host([has_aside]) .pfe-band__container>.pfe-band__body{-ms-grid-row:1;-ms-grid-column:1}:host([has_footer]) .pfe-band__container>.pfe-band__body{-ms-grid-row:1;-ms-grid-column:1}:host([has_header][has_aside]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:1}:host([has_header][has_footer]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:1}:host([has_footer][has_aside]) .pfe-band__container>.pfe-band__body{-ms-grid-row:1;-ms-grid-column:1}:host([has_header][has_aside][has_footer]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:1}:host([use-grid]) .pfe-band__body{display:-ms-grid;display:grid;-ms-grid-rows:auto;grid-template-rows:auto;-ms-grid-columns:1fr;grid-template-columns:1fr;-ms-grid-columns:var(--pfe-band__body--layout,1fr);grid-template-columns:var(--pfe-band__body--layout,1fr);grid-row-gap:1rem;grid-row-gap:var(--pfe-band__body--gutter--vertical,var(--pfe-theme--container-spacer,1rem));row-gap:1rem;row-gap:var(--pfe-band__body--gutter--vertical,var(--pfe-theme--container-spacer,1rem));grid-column-gap:calc(1rem * 3);grid-column-gap:var(--pfe-band__body--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));-webkit-column-gap:calc(1rem * 3);-moz-column-gap:calc(1rem * 3);column-gap:calc(1rem * 3);-webkit-column-gap:var(--pfe-band__body--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));-moz-column-gap:var(--pfe-band__body--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));column-gap:var(--pfe-band__body--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3))}:host([use-grid]) .pfe-band__body>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([use-grid]) .pfe-band__body>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}}.pfe-band__footer{margin-bottom:1rem;margin-bottom:var(--pfe-band__footer--gutter--vertical,var(--pfe-theme--container-spacer,1rem));margin-right:1rem;margin-right:var(--pfe-band__footer--gutter--vertical,var(--pfe-theme--container-spacer,1rem))}@supports (display:grid){.pfe-band__footer{-ms-grid-row:2;-ms-grid-column:1;grid-area:footer;margin-bottom:0;margin-right:0}:host([has_header][has_footer]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:3;-ms-grid-column:1}:host([has_footer][has_aside]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:3;-ms-grid-column:1}:host([has_header][has_aside][has_footer]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:3;-ms-grid-column:1;-ms-grid-column-span:1}:host([use-grid]) .pfe-band__footer{display:-ms-grid;display:grid;-ms-grid-rows:auto;grid-template-rows:auto;-ms-grid-columns:1fr;grid-template-columns:1fr;-ms-grid-columns:var(--pfe-band__footer--layout,1fr);grid-template-columns:var(--pfe-band__footer--layout,1fr);grid-row-gap:1rem;grid-row-gap:var(--pfe-band__footer--gutter--vertical,var(--pfe-theme--container-spacer,1rem));row-gap:1rem;row-gap:var(--pfe-band__footer--gutter--vertical,var(--pfe-theme--container-spacer,1rem));grid-column-gap:calc(1rem * 3);grid-column-gap:var(--pfe-band__footer--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));-webkit-column-gap:calc(1rem * 3);-moz-column-gap:calc(1rem * 3);column-gap:calc(1rem * 3);-webkit-column-gap:var(--pfe-band__footer--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));-moz-column-gap:var(--pfe-band__footer--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));column-gap:var(--pfe-band__footer--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3))}:host([use-grid]) .pfe-band__footer>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([use-grid]) .pfe-band__footer>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}}.pfe-band__aside{margin-bottom:1rem;margin-bottom:var(--pfe-band__aside--gutter--vertical,var(--pfe-theme--container-spacer,1rem));margin-right:1rem;margin-right:var(--pfe-band__aside--gutter--vertical,var(--pfe-theme--container-spacer,1rem))}@supports (display:grid){.pfe-band__aside{-ms-grid-row:2;-ms-grid-column:1;grid-area:aside;margin-bottom:0;margin-right:0}:host([has_header][has_aside]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:3;-ms-grid-column:1}:host([has_footer][has_aside]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:2;-ms-grid-row-span:1;-ms-grid-column:1}:host([has_header][has_aside][has_footer]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:4;-ms-grid-row-span:1;-ms-grid-column:1}@media (max-width:767px){:host([has_header][has_aside][aside-mobile=top]) .pfe-band__container>.pfe-band__header{-ms-grid-row:2;-ms-grid-column:1}:host([has_header][has_aside][has_footer][aside-mobile=top]) .pfe-band__container>.pfe-band__header{-ms-grid-row:2;-ms-grid-column:1;-ms-grid-column-span:1}:host([has_aside][aside-mobile=top]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:1}:host([has_header][has_aside][aside-mobile=top]) .pfe-band__container>.pfe-band__body{-ms-grid-row:3;-ms-grid-column:1}:host([has_footer][has_aside][aside-mobile=top]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:1}:host([has_header][has_aside][has_footer][aside-mobile=top]) .pfe-band__container>.pfe-band__body{-ms-grid-row:3;-ms-grid-column:1}:host([has_footer][has_aside][aside-mobile=top]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:3;-ms-grid-column:1}:host([has_header][has_aside][has_footer][aside-mobile=top]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:4;-ms-grid-column:1;-ms-grid-column-span:1}:host([has_aside][aside-mobile=top]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-column:1}:host([has_header][has_aside][aside-mobile=top]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-column:1}:host([has_footer][has_aside][aside-mobile=top]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-row-span:1;-ms-grid-column:1}:host([has_header][has_aside][has_footer][aside-mobile=top]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-row-span:1;-ms-grid-column:1}}@media (min-width:768px){:host([has_header][has_aside]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-column-span:2}:host([has_header][has_aside][aside-desktop=left]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-column-span:2}:host([has_header][has_aside][aside-height=full]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-column-span:1}:host([has_header][has_aside][aside-desktop=left][aside-height=full]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:2;-ms-grid-column-span:1}:host([has_header][has_aside][has_footer]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-column-span:2}:host([has_header][has_aside][has_footer][aside-desktop=left]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-column-span:2}:host([has_header][has_aside][has_footer][aside-height=full]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:1;-ms-grid-column-span:1}:host([has_header][has_aside][has_footer][aside-desktop=left][aside-height=full]) .pfe-band__container>.pfe-band__header{-ms-grid-row:1;-ms-grid-column:2;-ms-grid-column-span:1}:host([has_aside]) .pfe-band__container>.pfe-band__body{-ms-grid-row:1;-ms-grid-column:1}:host([has_aside][aside-desktop=left]) .pfe-band__container>.pfe-band__body{-ms-grid-row:1;-ms-grid-column:2}:host([has_header][has_aside]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:1}:host([has_header][has_aside][aside-desktop=left]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:2}:host([has_header][has_aside][aside-height=full]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:1}:host([has_header][has_aside][aside-desktop=left][aside-height=full]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:2}:host([has_footer][has_aside]) .pfe-band__container>.pfe-band__body{-ms-grid-row:1;-ms-grid-column:1}:host([has_footer][has_aside][aside-desktop=left]) .pfe-band__container>.pfe-band__body{-ms-grid-row:1;-ms-grid-column:2}:host([has_footer][has_aside][aside-height=full]) .pfe-band__container>.pfe-band__body{-ms-grid-row:1;-ms-grid-column:1}:host([has_footer][has_aside][aside-desktop=left][aside-height=full]) .pfe-band__container>.pfe-band__body{-ms-grid-row:1;-ms-grid-column:2}:host([has_header][has_aside][has_footer]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:1}:host([has_header][has_aside][has_footer][aside-desktop=left]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:2}:host([has_header][has_aside][has_footer][aside-height=full]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:1}:host([has_header][has_aside][has_footer][aside-desktop=left][aside-height=full]) .pfe-band__container>.pfe-band__body{-ms-grid-row:2;-ms-grid-column:2}:host([has_footer][has_aside]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:2;-ms-grid-column:1;-ms-grid-column-span:2}:host([has_footer][has_aside][aside-desktop=left]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:2;-ms-grid-column:1;-ms-grid-column-span:2}:host([has_footer][has_aside][aside-height=full]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:2;-ms-grid-column:1;-ms-grid-column-span:1}:host([has_footer][has_aside][aside-desktop=left][aside-height=full]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:2;-ms-grid-column:2;-ms-grid-column-span:1}:host([has_header][has_aside][has_footer]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:3;-ms-grid-column:1;-ms-grid-column-span:2}:host([has_header][has_aside][has_footer][aside-desktop=left]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:3;-ms-grid-column:1;-ms-grid-column-span:2}:host([has_header][has_aside][has_footer][aside-height=full]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:3;-ms-grid-column:1;-ms-grid-column-span:1}:host([has_header][has_aside][has_footer][aside-desktop=left][aside-height=full]) .pfe-band__container>.pfe-band__footer{-ms-grid-row:3;-ms-grid-column:2;-ms-grid-column-span:1}.pfe-band__aside{-ms-grid-row:1;-ms-grid-column:2}:host([has_aside][aside-desktop=left]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-column:1}:host([has_header][has_aside]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:2;-ms-grid-column:2}:host([has_header][has_aside][aside-desktop=left]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:2;-ms-grid-column:1}:host([has_header][has_aside][aside-height=full]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-row-span:2;-ms-grid-column:2}:host([has_header][has_aside][aside-desktop=left][aside-height=full]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-row-span:2;-ms-grid-column:1}:host([has_footer][has_aside]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-row-span:1;-ms-grid-column:2}:host([has_footer][has_aside][aside-desktop=left]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-row-span:1;-ms-grid-column:1}:host([has_footer][has_aside][aside-height=full]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-row-span:2;-ms-grid-column:2}:host([has_footer][has_aside][aside-desktop=left][aside-height=full]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-row-span:2;-ms-grid-column:1}:host([has_header][has_aside][has_footer]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:2;-ms-grid-row-span:1;-ms-grid-column:2}:host([has_header][has_aside][has_footer][aside-desktop=left]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:2;-ms-grid-row-span:1;-ms-grid-column:1}:host([has_header][has_aside][has_footer][aside-height=full]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-row-span:3;-ms-grid-column:2}:host([has_header][has_aside][has_footer][aside-desktop=left][aside-height=full]) .pfe-band__container>.pfe-band__aside{-ms-grid-row:1;-ms-grid-row-span:3;-ms-grid-column:1}}:host([use-grid]) .pfe-band__aside{display:-ms-grid;display:grid;-ms-grid-rows:auto;grid-template-rows:auto;-ms-grid-columns:1fr;grid-template-columns:1fr;-ms-grid-columns:var(--pfe-band__aside--layout,1fr);grid-template-columns:var(--pfe-band__aside--layout,1fr);grid-row-gap:1rem;grid-row-gap:var(--pfe-band__aside--gutter--vertical,var(--pfe-theme--container-spacer,1rem));row-gap:1rem;row-gap:var(--pfe-band__aside--gutter--vertical,var(--pfe-theme--container-spacer,1rem));grid-column-gap:calc(1rem * 3);grid-column-gap:var(--pfe-band__aside--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));-webkit-column-gap:calc(1rem * 3);-moz-column-gap:calc(1rem * 3);column-gap:calc(1rem * 3);-webkit-column-gap:var(--pfe-band__aside--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));-moz-column-gap:var(--pfe-band__aside--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3));column-gap:var(--pfe-band__aside--gutter--horizontal,calc(var(--pfe-theme--container-spacer,1rem) * 3))}:host([use-grid]) .pfe-band__aside>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}:host([use-grid]) .pfe-band__aside>:nth-child(1){-ms-grid-row:1;-ms-grid-column:1}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){.pfe-band__container::after{clear:both;content:"";display:table}.pfe-band__body,.pfe-band__footer,.pfe-band__header{float:left}:host([aside-mobile=top]) .pfe-band__body,:host([aside-mobile=top]) .pfe-band__footer,:host([aside-mobile=top]) .pfe-band__header{float:right}:host(:not([aside-height=full])) .pfe-band__body,:host(:not([aside-height=full])) .pfe-band__footer,:host(:not([aside-height=full])) .pfe-band__header{width:60%}.pfe-band__footer{clear:both}.pfe-band__aside{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;float:right;width:35%;margin:0 1.9%}:host([aside-desktop=left]) .pfe-band__aside{float:left}.pfe-band__wrapper{width:60%;float:left}:host([aside-desktop=left]) .pfe-band__wrapper{float:right}} /*# sourceMappingURL=pfe-band.min.css.map */\n
    \n '+(this.hasSlot("pfe-band--aside")&&"top"===this.asidePosition.mobile?'':"")+"\n "+("full"===this.asideHeight?'
    ':"")+"\n "+(this.hasSlot("pfe-band--header")?'
    \n \n
    ':"")+'\n
    \n \n
    \n '+("full"!==this.asideHeight&&this.hasSlot("pfe-band--aside")&&"top"!==this.asidePosition.mobile?'\n \n ':"")+"\n "+(this.hasSlot("pfe-band--footer")?'
    \n \n
    ':"")+"\n "+("full"===this.asideHeight?"
    ":"")+"\n "+("full"===this.asideHeight&&this.hasSlot("pfe-band--aside")&&"top"!==this.asidePosition.mobile?'\n \n ':"")+"\n
    "}},{key:"templateUrl",get:function(){return"pfe-band.html"}},{key:"styleUrl",get:function(){return"pfe-band.scss"}},{key:"asidePosition",get:function(){return{desktop:this.asideDesktop,mobile:this.asideMobile,height:this.asideHeight}}}],[{key:"version",get:function(){return"1.3.0"}},{key:"tag",get:function(){return"pfe-band"}},{key:"meta",get:function(){return{title:"Band",description:"This element creates a header, body, footer, and aside region in which to place content or other components."}}},{key:"properties",get:function(){return{imgSrc:{title:"Background image",type:String,observer:"_imgSrcChanged"},oldImgSrc:{alias:"imgSrc",attr:"pfe-img-src"},color:{title:"Background color",type:String,values:["lightest","base","darker","darkest","complement","accent"],default:"base",observer:"_colorChanged"},oldColor:{alias:"color",attr:"pfe-color"},asideDesktop:{title:"side positioning (desktop)",type:String,values:["right","left"],default:"right"},oldAsideDesktop:{alias:"asideDesktop",attr:"pfe-aside-desktop"},asideMobile:{title:"Aside positioning (mobile)",type:String,values:["top","bottom"],default:"bottom"},oldAsideMobile:{alias:"asideMobile",attr:"pfe-aside-mobile"},asideHeight:{title:"Aside height",type:String,values:["full","body"],default:"body"},oldAsideHeight:{alias:"asideHeight",attr:"pfe-aside-height"},size:{title:"Padding size",type:String,values:["small"]},oldSize:{alias:"size",attr:"pfe-size"},useGrid:{title:"Default grid on for the light DOM regions (header, body, footer, aside)",type:Boolean,default:!1}}}},{key:"slots",get:function(){return{header:{title:"Header",type:"array",namedSlot:!0,maxItems:3,items:{$ref:"raw"}},body:{title:"Body",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-card"},{$ref:"raw"}]}},footer:{title:"Footer",type:"array",namedSlot:!0,maxItems:3,items:{oneOf:[{$ref:"pfe-cta"},{$ref:"raw"}]}},aside:{title:"Aside",type:"array",namedSlot:!0,maxItems:5,items:{oneOf:[{$ref:"pfe-card"},{$ref:"raw"}]}}}}},{key:"PfeType",get:function(){return e.PfeTypes.Container}}]),r(d,[{key:"_colorChanged",value:function(){this.resetContext()}},{key:"_imgSrcChanged",value:function(e,a){this.style.backgroundImage=a?"url('"+a+"')":""}}]),d);function d(){return a(this,d),t(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,d,{type:d.PfeType}))}return e.create(r),r}); +//# sourceMappingURL=pfe-band.umd.min.js.map diff --git a/elements/pfe-band/dist/pfe-band.umd.min.js.map b/elements/pfe-band/dist/pfe-band.umd.min.js.map new file mode 100644 index 0000000000..ed18b929e5 --- /dev/null +++ b/elements/pfe-band/dist/pfe-band.umd.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-band.umd.min.js","sources":["../_temp/polyfills--pfe-band.js","../_temp/pfe-band.umd.js"],"sourcesContent":["// @POLYFILL Element.matches\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n// @POLYFILL Element.closest\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\nif (!Element.prototype.closest) {\n Element.prototype.closest = function(s) {\n var el = this;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n}\n","/*!\n * PatternFly Elements: PfeBand 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: matches, closest, includes\nimport \"./polyfills--pfe-band.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\n\nclass PfeBand extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n ${this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile === \"top\" ? `` : \"\"}\n ${this.asideHeight === \"full\" ? `
    ` : \"\"}\n ${this.hasSlot(\"pfe-band--header\") ? `
    \n \n
    ` : \"\"}\n
    \n \n
    \n ${this.asideHeight !== \"full\" && this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile !== \"top\" ? `\n \n ` : \"\"}\n ${this.hasSlot(\"pfe-band--footer\") ? `
    \n \n
    ` : \"\"}\n ${this.asideHeight === \"full\" ? `
    ` : \"\"}\n ${this.asideHeight === \"full\" && this.hasSlot(\"pfe-band--aside\") && this.asidePosition.mobile !== \"top\" ? `\n \n ` : \"\"}\n
    `;\n }\n\n static get tag() {\n return \"pfe-band\";\n }\n\n static get meta() {\n return {\n title: \"Band\",\n description:\n \"This element creates a header, body, footer, and aside region in which to place content or other components.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-band.html\";\n }\n\n get styleUrl() {\n return \"pfe-band.scss\";\n }\n\n get asidePosition() {\n return {\n desktop: this.asideDesktop,\n mobile: this.asideMobile,\n height: this.asideHeight\n };\n }\n\n static get properties() {\n return {\n imgSrc: {\n title: \"Background image\",\n type: String,\n observer: \"_imgSrcChanged\"\n },\n // @TODO: Deprecated property in 1.0\n oldImgSrc: {\n alias: \"imgSrc\",\n attr: \"pfe-img-src\"\n },\n color: {\n title: \"Background color\",\n type: String,\n values: [\"lightest\", \"base\", \"darker\", \"darkest\", \"complement\", \"accent\"],\n default: \"base\",\n observer: \"_colorChanged\"\n },\n // @TODO: Deprecated property in 1.0\n oldColor: {\n alias: \"color\",\n attr: \"pfe-color\"\n },\n asideDesktop: {\n title: \"side positioning (desktop)\",\n type: String,\n values: [\"right\", \"left\"],\n default: \"right\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideDesktop: {\n alias: \"asideDesktop\",\n attr: \"pfe-aside-desktop\"\n },\n asideMobile: {\n title: \"Aside positioning (mobile)\",\n type: String,\n values: [\"top\", \"bottom\"],\n default: \"bottom\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideMobile: {\n alias: \"asideMobile\",\n attr: \"pfe-aside-mobile\"\n },\n asideHeight: {\n title: \"Aside height\",\n type: String,\n values: [\"full\", \"body\"],\n default: \"body\"\n },\n // @TODO: Deprecated property in 1.0\n oldAsideHeight: {\n alias: \"asideHeight\",\n attr: \"pfe-aside-height\"\n },\n size: {\n title: \"Padding size\",\n type: String,\n values: [\"small\"]\n },\n // @TODO: Deprecated property in 1.0\n oldSize: {\n alias: \"size\",\n attr: \"pfe-size\"\n },\n useGrid: {\n title: \"Default grid on for the light DOM regions (header, body, footer, aside)\",\n type: Boolean,\n default: false\n }\n };\n }\n\n static get slots() {\n return {\n header: {\n title: \"Header\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n $ref: \"raw\"\n }\n },\n body: {\n title: \"Body\",\n type: \"array\",\n namedSlot: false,\n items: {\n oneOf: [\n {\n $ref: \"pfe-card\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n },\n footer: {\n title: \"Footer\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n oneOf: [\n {\n $ref: \"pfe-cta\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n },\n aside: {\n title: \"Aside\",\n type: \"array\",\n namedSlot: true,\n maxItems: 5,\n items: {\n oneOf: [\n {\n $ref: \"pfe-card\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n }\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n constructor() {\n super(PfeBand, { type: PfeBand.PfeType });\n }\n\n _colorChanged() {\n // Update the context\n this.resetContext();\n }\n\n // Update the background image\n _imgSrcChanged(oldVal, newVal) {\n // Set the image as the background image\n this.style.backgroundImage = newVal ? `url('${newVal}')` : ``;\n }\n}\n\nPFElement.create(PfeBand);\n\nexport { PfeBand as default };\n"],"names":["Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","this","parentElement","parentNode","nodeType","PfeBand","PFElement","hasSlot","asidePosition","mobile","asideHeight","asideDesktop","asideMobile","String","Boolean","PfeTypes","Container","resetContext","oldVal","newVal","style","backgroundImage","type","PfeType","create"],"mappings":"wWAEKA,QAAQC,UAAUC,kBACbD,UAAUC,QAAUF,QAAQC,UAAUE,mBAAqBH,QAAQC,UAAUG,uBAKlFJ,QAAQC,UAAUI,kBACbJ,UAAUI,QAAU,SAASC,OAC/BC,EAAKC,WAEHD,EAAGL,QAAQI,GAAI,OAAOC,QAEZ,UADTA,EAAGE,eAAiBF,EAAGG,aACU,IAAhBH,EAAGI,iBACpB,kfCeLC,+TAAgBC,qi8BAYlBL,KAAKM,QAAQ,oBAAoD,QAA9BN,KAAKO,cAAcC,+FAE5C,YACW,SAArBR,KAAKS,8CAA6D,cAChET,KAAKM,QAAQ,oHAEF,yFAIU,SAArBN,KAAKS,aAA0BT,KAAKM,QAAQ,oBAAoD,QAA9BN,KAAKO,cAAcC,0GAG3E,cACVR,KAAKM,QAAQ,oHAEF,cACU,SAArBN,KAAKS,qBAAoC,YACtB,SAArBT,KAAKS,aAA0BT,KAAKM,QAAQ,oBAAoD,QAA9BN,KAAKO,cAAcC,oGAG3E,6DAiBH,uDAIA,4DAIA,SACIR,KAAKU,oBACNV,KAAKW,mBACLX,KAAKS,qDAzDR,0CAkCA,8CAIA,OACE,mBAEL,yJAqBG,QACG,OACC,wBACDG,gBACI,4BAGD,OACF,cACD,qBAED,OACE,wBACDA,cACE,CAAC,WAAY,OAAQ,SAAU,UAAW,aAAc,kBACvD,gBACC,0BAGF,OACD,aACD,0BAEM,OACL,kCACDA,cACE,CAAC,QAAS,gBACT,yBAGM,OACR,oBACD,iCAEK,OACJ,kCACDA,cACE,CAAC,MAAO,kBACP,yBAGK,OACP,mBACD,gCAEK,OACJ,oBACDA,cACE,CAAC,OAAQ,gBACR,uBAGK,OACP,mBACD,yBAEF,OACG,oBACDA,cACE,CAAC,kBAGF,OACA,YACD,oBAEC,OACA,+EACDC,iBACG,wCAMN,QACG,OACC,cACD,mBACK,WACD,QACH,MACC,aAGJ,OACG,YACD,mBACK,QACJ,OACE,CACL,MACQ,YAER,MACQ,iBAKN,OACC,cACD,mBACK,WACD,QACH,OACE,CACL,MACQ,WAER,MACQ,gBAKP,OACE,aACD,mBACK,WACD,QACH,OACE,CACL,MACQ,YAER,MACQ,kDAUTR,EAAUS,SAASC,8DASrBC,sDAIQC,EAAQC,QAEhBC,MAAMC,gBAAkBF,UAAiBA,wGAXxCd,EAAS,CAAEiB,KAAMjB,EAAQkB,kBAenCjB,EAAUkB,OAAOnB"} \ No newline at end of file diff --git a/elements/pfe-band/package.json b/elements/pfe-band/package.json index 9282f5225b..10442c107e 100644 --- a/elements/pfe-band/package.json +++ b/elements/pfe-band/package.json @@ -10,7 +10,7 @@ }, "preview": "band--screenshot.png" }, - "version": "1.2.0", + "version": "1.3.0", "description": "Band container for PatternFly Elements", "keywords": [ "web-components", @@ -53,10 +53,10 @@ ], "license": "MIT", "dependencies": { - "@patternfly/pfelement": "^1.2.0" + "@patternfly/pfelement": "^1.3.0" }, "devDependencies": { - "@patternfly/pfe-sass": "^1.2.0" + "@patternfly/pfe-sass": "^1.3.0" }, "bugs": { "url": "https://github.com/patternfly/patternfly-elements/issues" diff --git a/elements/pfe-button/dist/pfe-button.css.map b/elements/pfe-button/dist/pfe-button.css.map new file mode 100644 index 0000000000..3d33d68c86 --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-button.scss","pfe-button.css","../../pfe-sass/functions/_custom-properties.scss"],"names":[],"mappings":"AA+BA;EACE,qBAAqB;AC9BvB;;ADiCA;EACE,aAAa;AC9Bf;;ADkCE;EAEE,sBEqCgC;EFrChC,8FEqCgC;EFpChC,WEoCgC;EFpChC,6EEoCgC;EFnChC,eEmCgC;EFnChC,4EEmCgC;EFlChC,oBERgC;EFQhC,mDERgC;EFShC,4BEiCgC;EFjChC,kIEiCgC;EFhChC,eAAe;EACf,kBE+BgC;EF/BhC,6FE+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idance on using these tools\n@import \"../../pfe-sass/pfe-sass\";\n\n$LOCAL: button;\n\n$LOCAL-VARIABLES: (\n BackgroundColor: pfe-var(ui-accent),\n BackgroundColor--hover: pfe-var(ui-accent--hover),\n Color: pfe-var(ui-base--text),\n FontSize: pfe-var(FontSize--md),\n Border: 0,\n BorderRadius: pfe-var(surface--border-radius),\n Padding: calc(#{pfe-var(container-padding)} / 2) pfe-var(container-padding),\n LineHeight: pfe-var(line-height),\n after: (\n BorderColor: transparent,\n BorderColor--hover: transparent,\n ),\n);\n\n// Nested internal variables (pfe-local calls), maps cannot \"self-reference\"\n$LOCAL-VARIABLES: map-deep-merge(\n $LOCAL-VARIABLES,\n (\n after: (\n Border: pfe-var(ui--border-width) pfe-var(ui--border-style) pfe-local(BorderColor, $region: after),\n Border--hover: pfe-var(ui--border-width) pfe-var(ui--border-style) pfe-local(BorderColor--hover, $region: after),\n ),\n )\n);\n\n:host {\n display: inline-block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\nbutton {\n :host([variant=\"primary\"]) &,\n & {\n background-color: pfe-local(BackgroundColor);\n color: pfe-local(Color);\n font-size: pfe-local(FontSize);\n font-family: pfe-var(font-family, $fallback: inherit);\n padding: pfe-local(Padding);\n cursor: pointer;\n border-radius: pfe-local(BorderRadius);\n border: pfe-local(Border);\n position: relative;\n line-height: pfe-local(LineHeight);\n\n &::after {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: \"\";\n border: pfe-local(Border, $region: after);\n border-radius: pfe-local(BorderRadius);\n }\n\n &:hover,\n &:focus {\n --pfe-button--BackgroundColor: #{pfe-local(BackgroundColor--hover)};\n --pfe-button__after--Border: #{pfe-local(Border--hover, $region: after)};\n }\n }\n\n :host([variant=\"danger\"]) & {\n background-color: pfe-local(BackgroundColor, pfe-var(feedback--critical--lighter));\n\n &:hover,\n &:focus {\n --pfe-button--BackgroundColor: #{pfe-local(BackgroundColor--hover, pfe-var(feedback--critical))};\n }\n }\n\n :host([variant=\"secondary\"]) &,\n :host([variant=\"tertiary\"]) &,\n :host([variant=\"control\"]) & {\n background-color: pfe-local(BackgroundColor, transparent);\n\n &:hover,\n &:focus {\n --pfe-button--BackgroundColor: #{pfe-local(BackgroundColor--hover, transparent)};\n --pfe-button__after--Border: #{pfe-local(Border--hover, $region: after, $fallback: pfe-var(ui--border-width--md) pfe-var(ui--border-style) pfe-local(BorderColor, $region: after))};\n }\n }\n\n :host([variant=\"secondary\"]) & {\n color: pfe-local(Color, pfe-var(ui-accent));\n\n &::after {\n border-color: pfe-local(BorderColor, $region: after, $fallback: pfe-var(ui-accent));\n }\n }\n\n :host([variant=\"tertiary\"]) & {\n color: pfe-local(Color, pfe-var(text));\n\n &::after {\n border-color: pfe-local(BorderColor, $region: after, $fallback: pfe-var(text));\n }\n }\n\n :host([variant=\"control\"]) & {\n color: pfe-local(Color, pfe-var(text));\n border-radius: pfe-local(BorderRadius, 0);\n\n &:hover,\n &:focus {\n --pfe-button__after--BorderColor: #{pfe-local(BorderColor--hover, pfe-var(ui--border--lightest))};\n \n &::after {\n border-bottom-width: pfe-var(ui--border-width--md);\n border-bottom-color: pfe-var(ui-accent);\n }\n }\n\n &::after {\n border-color: pfe-local(BorderColor, $region: after, $fallback: pfe-var(ui--border--lightest));\n border-bottom-color: pfe-var(ui--border);\n }\n }\n\n :host([variant=\"control\"][disabled]) & {\n background-color: pfe-local(BackgroundColor, pfe-var(surface--lighter));\n }\n\n :host([disabled]) & {\n background-color: pfe-local(BackgroundColor, pfe-var(ui-disabled));\n color: pfe-local(Color, pfe-var(ui-disabled--text));\n pointer-events: none;\n &::after {\n border: pfe-local(Border, $region: after, $fallback: 0);\n }\n\n &:hover,\n &:focus {\n --pfe-button--BackgroundColor: #{pfe-local(BackgroundColor--hover, pfe-var(ui-disabled))};\n --pfe-button__after--Border: #{pfe-local(Border--hover, $region: after, $fallback: 0)};\n }\n }\n}\n",":host {\n display: inline-block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host([variant=\"primary\"]) button, button {\n background-color: var(--pfe-button--BackgroundColor, var(--pfe-theme--color--ui-accent, #06c));\n color: var(--pfe-button--Color, var(--pfe-theme--color--ui-base--text, #fff));\n font-size: var(--pfe-button--FontSize, var(--pf-global--FontSize--md, 1rem));\n font-family: var(--pfe-theme--font-family, inherit);\n padding: var(--pfe-button--Padding, calc(var(--pfe-theme--container-padding, 1rem) / 2) var(--pfe-theme--container-padding, 1rem));\n cursor: pointer;\n border-radius: var(--pfe-button--BorderRadius, var(--pfe-theme--surface--border-radius, 3px));\n border: var(--pfe-button--Border, 0);\n position: relative;\n line-height: var(--pfe-button--LineHeight, var(--pfe-theme--line-height, 1.5));\n}\n\n:host([variant=\"primary\"]) button::after, button::after {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: \"\";\n border: var(--pfe-button__after--Border, var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-button__after--BorderColor, transparent));\n border-radius: var(--pfe-button--BorderRadius, var(--pfe-theme--surface--border-radius, 3px));\n}\n\n:host([variant=\"primary\"]) button:hover, :host([variant=\"primary\"]) button:focus, button:hover, button:focus {\n --pfe-button--BackgroundColor: var(--pfe-button--BackgroundColor--hover, var(--pfe-theme--color--ui-accent--hover, #004080));\n --pfe-button__after--Border: var(--pfe-button__after--Border--hover, var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-button__after--BorderColor--hover, transparent));\n}\n\n:host([variant=\"danger\"]) button {\n background-color: var(--pfe-button--BackgroundColor, var(--pfe-theme--color--feedback--critical--lighter, #c9190b));\n}\n\n:host([variant=\"danger\"]) button:hover, :host([variant=\"danger\"]) button:focus {\n --pfe-button--BackgroundColor: var(--pfe-button--BackgroundColor--hover, var(--pfe-theme--color--feedback--critical, #a30000));\n}\n\n:host([variant=\"secondary\"]) button,\n:host([variant=\"tertiary\"]) button,\n:host([variant=\"control\"]) button {\n background-color: var(--pfe-button--BackgroundColor, transparent);\n}\n\n:host([variant=\"secondary\"]) button:hover, :host([variant=\"secondary\"]) button:focus,\n:host([variant=\"tertiary\"]) button:hover,\n:host([variant=\"tertiary\"]) button:focus,\n:host([variant=\"control\"]) button:hover,\n:host([variant=\"control\"]) button:focus {\n --pfe-button--BackgroundColor: var(--pfe-button--BackgroundColor--hover, transparent);\n --pfe-button__after--Border: var(--pfe-button__after--Border--hover, var(--pfe-theme--ui--border-width--md, 2px) var(--pfe-theme--ui--border-style, solid) var(--pfe-button__after--BorderColor, transparent));\n}\n\n:host([variant=\"secondary\"]) button {\n color: var(--pfe-button--Color, var(--pfe-theme--color--ui-accent, #06c));\n}\n\n:host([variant=\"secondary\"]) button::after {\n border-color: var(--pfe-button__after--BorderColor, var(--pfe-theme--color--ui-accent, #06c));\n}\n\n:host([variant=\"tertiary\"]) button {\n color: var(--pfe-button--Color, var(--pfe-theme--color--text, #151515));\n}\n\n:host([variant=\"tertiary\"]) button::after {\n border-color: var(--pfe-button__after--BorderColor, var(--pfe-theme--color--text, #151515));\n}\n\n:host([variant=\"control\"]) button {\n color: var(--pfe-button--Color, var(--pfe-theme--color--text, #151515));\n border-radius: var(--pfe-button--BorderRadius, 0);\n}\n\n:host([variant=\"control\"]) button:hover, :host([variant=\"control\"]) button:focus {\n --pfe-button__after--BorderColor: var(--pfe-button--BorderColor--hover, var(--pfe-theme--color--ui--border--lightest, #f0f0f0));\n}\n\n:host([variant=\"control\"]) button:hover::after, :host([variant=\"control\"]) button:focus::after {\n border-bottom-width: var(--pfe-theme--ui--border-width--md, 2px);\n border-bottom-color: var(--pfe-theme--color--ui-accent, #06c);\n}\n\n:host([variant=\"control\"]) button::after {\n border-color: var(--pfe-button__after--BorderColor, var(--pfe-theme--color--ui--border--lightest, #f0f0f0));\n border-bottom-color: var(--pfe-theme--color--ui--border, #8a8d90);\n}\n\n:host([variant=\"control\"][disabled]) button {\n background-color: var(--pfe-button--BackgroundColor, var(--pfe-theme--color--surface--lighter, #f0f0f0));\n}\n\n:host([disabled]) button {\n background-color: var(--pfe-button--BackgroundColor, var(--pfe-theme--color--ui-disabled, #d2d2d2));\n color: var(--pfe-button--Color, var(--pfe-theme--color--ui-disabled--text, #6a6e73));\n pointer-events: none;\n}\n\n:host([disabled]) button::after {\n border: var(--pfe-button__after--Border, 0);\n}\n\n:host([disabled]) button:hover, :host([disabled]) button:focus {\n --pfe-button--BackgroundColor: var(--pfe-button--BackgroundColor--hover, var(--pfe-theme--color--ui-disabled, #d2d2d2));\n --pfe-button__after--Border: var(--pfe-button__after--Border--hover, 0);\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-button/dist/pfe-button.js b/elements/pfe-button/dist/pfe-button.js new file mode 100644 index 0000000000..6aa7bc5403 --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.js @@ -0,0 +1,236 @@ +import PFElement from '../../pfelement/dist/pfelement.js'; + +/*! + * PatternFly Elements: PfeButton 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/ + +// @IE11 +// watching for addition and removal of nodes so +// we can make sure we have the correct light DOM +// and so we can set the _externalBtn property +const parentObserverConfig = { + childList: true +}; + +// watching for changes on the _externalBtn so we can +// update text in our shadow DOM when the _externalBtn +// changes +const externalBtnObserverConfig = { + characterData: true, + attributes: true, + subtree: true, + childList: true +}; + +// list of attributes that we DO NOT want to pass from +// the _externalBtn to our shadow DOM button. For example, +// the style attribute could ruin our encapsulated styles +// in the shadow DOM +const denylistAttributes = ["style"]; + +class PfeButton extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + +`; + } + + // Injected at build-time + static get slots() { + return {"default":{"title":"Default slot","type":"array","namedSlot":false,"items":{"oneOf":[{"$ref":"button"}]}}}; + } + + static get tag() { + return "pfe-button"; + } + + get schemaUrl() { + return "pfe-button.json"; + } + + get templateUrl() { + return "pfe-button.html"; + } + + get styleUrl() { + return "pfe-button.scss"; + } + + static get events() { + return { + click: `${this.tag}:click` + }; + } + + static get PfeType() { + return PFElement.PfeTypes.Content; + } + + static get properties() { + return { + variant: { + title: "Style variant", + type: String, + values: ["primary", "secondary", "tertiary", "danger", "control"] + }, + pfeVariant: { + type: String, + values: ["primary", "secondary", "tertiary", "danger", "control"], + alias: "variant" + }, + disabled: { + title: "Disabled", + type: Boolean, + prefix: false, + observer: "_disabledChanged" + } + }; + } + + constructor() { + super(PfeButton, { type: PfeButton.PfeType }); + + this._init = this._init.bind(this); + this._parentObserverHandler = this._parentObserverHandler.bind(this); + this._clickHandler = this._clickHandler.bind(this); + this._internalBtnContainer = this.shadowRoot.querySelector("#internalBtn"); + this._observer = new MutationObserver(this._parentObserverHandler); + this._externalBtnClickHandler = this._externalBtnClickHandler.bind(this); + this._externalBtnObserver = new MutationObserver(this._init); + + this.addEventListener("click", this._clickHandler); + } + + get _externalBtn() { + return this.querySelector("button"); + } + + connectedCallback() { + super.connectedCallback(); + + if (this.hasLightDOM()) this._init(); + + this._observer.observe(this, parentObserverConfig); + + if (this._externalBtn) { + this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig); + } + } + + disconnectedCallback() { + super.disconnectedCallback(); + + this.removeEventListener("click", this._clickHandler); + this._observer.disconnect(); + this._externalBtnObserver.disconnect(); + } + + _disabledChanged(oldVal, newVal) { + if (!this._externalBtn) { + return; + } + + if (newVal) { + this._externalBtn.setAttribute("disabled", ""); + } else { + this._externalBtn.removeAttribute("disabled"); + } + } + + _init() { + if (!this._isValidLightDom()) { + return; + } + + if (!this._externalBtn) { + return; + } + + this._externalBtnObserver.disconnect(); + + // If the external button has a disabled attribute + if (this._externalBtn.hasAttribute("disabled")) { + // Set it on the wrapper too + this.setAttribute("disabled", ""); + } + + const clone = this._externalBtn.cloneNode(true); + denylistAttributes.forEach(attribute => { + if (clone.hasAttribute) { + clone.removeAttribute(attribute); + } + }); + + this._internalBtnContainer.innerHTML = clone.outerHTML; + this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig); + + this._externalBtn.addEventListener("click", this._externalBtnClickHandler); + } + + _isValidLightDom() { + if (!this.hasLightDOM()) { + this.warn(`You must have a button in the light DOM`); + return false; + } + if (this.children[0].tagName !== "BUTTON") { + this.warn(`The only child in the light DOM must be a button tag`); + + return false; + } + + return true; + } + + // when the parent changes, make sure the light DOM is valid, + // initialize the component + _parentObserverHandler() { + if (!this._isValidLightDom()) { + return; + } + + this._init(); + } + + // programmatically clicking the _externalBtn is what makes + // this web component button work in a form as you'd expect + _clickHandler() { + this._externalBtn.click(); + } + + _externalBtnClickHandler() { + this.emitEvent(PfeButton.events.click); + } +} + +PFElement.create(PfeButton); + +export default PfeButton; +//# sourceMappingURL=pfe-button.js.map diff --git a/elements/pfe-button/dist/pfe-button.js.map b/elements/pfe-button/dist/pfe-button.js.map new file mode 100644 index 0000000000..54c43d0acc --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-button.js","sources":["../_temp/pfe-button.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeButton 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\n// @IE11\n// watching for addition and removal of nodes so\n// we can make sure we have the correct light DOM\n// and so we can set the _externalBtn property\nconst parentObserverConfig = {\n childList: true\n};\n\n// watching for changes on the _externalBtn so we can\n// update text in our shadow DOM when the _externalBtn\n// changes\nconst externalBtnObserverConfig = {\n characterData: true,\n attributes: true,\n subtree: true,\n childList: true\n};\n\n// list of attributes that we DO NOT want to pass from\n// the _externalBtn to our shadow DOM button. For example,\n// the style attribute could ruin our encapsulated styles\n// in the shadow DOM\nconst denylistAttributes = [\"style\"];\n\nclass PfeButton extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n // Injected at build-time\n static get slots() {\n return {\"default\":{\"title\":\"Default slot\",\"type\":\"array\",\"namedSlot\":false,\"items\":{\"oneOf\":[{\"$ref\":\"button\"}]}}};\n }\n\n static get tag() {\n return \"pfe-button\";\n }\n\n get schemaUrl() {\n return \"pfe-button.json\";\n }\n\n get templateUrl() {\n return \"pfe-button.html\";\n }\n\n get styleUrl() {\n return \"pfe-button.scss\";\n }\n\n static get events() {\n return {\n click: `${this.tag}:click`\n };\n }\n\n static get PfeType() {\n return PFElement.PfeTypes.Content;\n }\n\n static get properties() {\n return {\n variant: {\n title: \"Style variant\",\n type: String,\n values: [\"primary\", \"secondary\", \"tertiary\", \"danger\", \"control\"]\n },\n pfeVariant: {\n type: String,\n values: [\"primary\", \"secondary\", \"tertiary\", \"danger\", \"control\"],\n alias: \"variant\"\n },\n disabled: {\n title: \"Disabled\",\n type: Boolean,\n prefix: false,\n observer: \"_disabledChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeButton, { type: PfeButton.PfeType });\n\n this._init = this._init.bind(this);\n this._parentObserverHandler = this._parentObserverHandler.bind(this);\n this._clickHandler = this._clickHandler.bind(this);\n this._internalBtnContainer = this.shadowRoot.querySelector(\"#internalBtn\");\n this._observer = new MutationObserver(this._parentObserverHandler);\n this._externalBtnClickHandler = this._externalBtnClickHandler.bind(this);\n this._externalBtnObserver = new MutationObserver(this._init);\n\n this.addEventListener(\"click\", this._clickHandler);\n }\n\n get _externalBtn() {\n return this.querySelector(\"button\");\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.hasLightDOM()) this._init();\n\n this._observer.observe(this, parentObserverConfig);\n\n if (this._externalBtn) {\n this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"click\", this._clickHandler);\n this._observer.disconnect();\n this._externalBtnObserver.disconnect();\n }\n\n _disabledChanged(oldVal, newVal) {\n if (!this._externalBtn) {\n return;\n }\n\n if (newVal) {\n this._externalBtn.setAttribute(\"disabled\", \"\");\n } else {\n this._externalBtn.removeAttribute(\"disabled\");\n }\n }\n\n _init() {\n if (!this._isValidLightDom()) {\n return;\n }\n\n if (!this._externalBtn) {\n return;\n }\n\n this._externalBtnObserver.disconnect();\n\n // If the external button has a disabled attribute\n if (this._externalBtn.hasAttribute(\"disabled\")) {\n // Set it on the wrapper too\n this.setAttribute(\"disabled\", \"\");\n }\n\n const clone = this._externalBtn.cloneNode(true);\n denylistAttributes.forEach(attribute => {\n if (clone.hasAttribute) {\n clone.removeAttribute(attribute);\n }\n });\n\n this._internalBtnContainer.innerHTML = clone.outerHTML;\n this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig);\n\n this._externalBtn.addEventListener(\"click\", this._externalBtnClickHandler);\n }\n\n _isValidLightDom() {\n if (!this.hasLightDOM()) {\n this.warn(`You must have a button in the light DOM`);\n return false;\n }\n if (this.children[0].tagName !== \"BUTTON\") {\n this.warn(`The only child in the light DOM must be a button tag`);\n\n return false;\n }\n\n return true;\n }\n\n // when the parent changes, make sure the light DOM is valid,\n // initialize the component\n _parentObserverHandler() {\n if (!this._isValidLightDom()) {\n return;\n }\n\n this._init();\n }\n\n // programmatically clicking the _externalBtn is what makes\n // this web component button work in a form as you'd expect\n _clickHandler() {\n this._externalBtn.click();\n }\n\n _externalBtnClickHandler() {\n this.emitEvent(PfeButton.events.click);\n }\n}\n\nPFElement.create(PfeButton);\n\nexport default PfeButton;\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA,MAAM,oBAAoB,GAAG;AAC7B,EAAE,SAAS,EAAE,IAAI;AACjB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA,MAAM,yBAAyB,GAAG;AAClC,EAAE,aAAa,EAAE,IAAI;AACrB,EAAE,UAAU,EAAE,IAAI;AAClB,EAAE,OAAO,EAAE,IAAI;AACf,EAAE,SAAS,EAAE,IAAI;AACjB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,CAAC,OAAO,CAAC,CAAC;AACrC;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AC,OAAO,KAAK,QAAQ,EAAE;AAC/C,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,oDAAoD,CAAC,CAAC,CAAC;AACxE;AACA,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL;AACA,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH;AACA;AACA;AACA,EAAE,sBAAsB,GAAG;AAC3B,IAAI,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE;AAClC,MAAM,OAAO;AACb,KAAK;AACL;AACA,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AACjB,GAAG;AACH;AACA;AACA;AACA,EAAE,aAAa,GAAG;AAClB,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;AAC9B,GAAG;AACH;AACA,EAAE,wBAAwB,GAAG;AAC7B,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3C,GAAG;AACH,CAAC;AACD;AACA,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC;;;;"} \ No newline at end of file diff --git a/elements/pfe-button/dist/pfe-button.json b/elements/pfe-button/dist/pfe-button.json new file mode 100644 index 0000000000..d34f896162 --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.json @@ -0,0 +1,45 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Button", + "description": "", + "type": "object", + "tag": "pfe-button", + "class": "PfeButton", + "category": "content", + "properties": { + "slots": { + "title": "Slots", + "description": "Definition of the supported slots", + "type": "object", + "properties": { + "default": { + "title": "Default slot", + "type": "array", + "namedSlot": false, + "items": { + "oneOf": [ + { + "$ref": "button" + } + ] + } + } + }, + "required": ["default"] + }, + "events": { + "title": "Events", + "description": "Definition of the supported events", + "type": "object", + "properties": { + "click": { + "title": "Click", + "type": "string", + "default": "pfe-button:click" + } + } + } + }, + "required": ["slots", "attributes", "events"], + "additionalProperties": false +} diff --git a/elements/pfe-button/dist/pfe-button.min.css.map b/elements/pfe-button/dist/pfe-button.min.css.map new file mode 100644 index 0000000000..172f4bf49e --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/pfe-button.scss","pfe-button.css"],"names":[],"mappings":"AA+BA,MACE,QAAA,aAGF,gBACE,QAAA,KAIA,gCAAA,OAEE,iBAAA,KAAA,iBAAA,2EACA,MAAA,KAAA,MAAA,qEACA,UAAA,KAAA,UAAA,gEACA,YAAA,QAAA,YAAA,sCACA,QAAA,eAAA,KAAA,QAAA,sHACA,OAAA,QACA,cAAA,IAAA,cAAA,6EACA,OAAA,EAAA,OAAA,4BACA,SAAA,SACA,YAAA,IAAA,YAAA,gEAXF,uCAAA,cAcI,SAAA,SACA,IAAA,EACA,KAAA,EACA,MAAA,EACA,OAAA,EACA,QAAA,GACA,OAAA,IAAA,MAAA,YAAA,OAAA,mKACA,cAAA,IAAA,cAAA,6EArBJ,sCAAA,sCAAA,aAAA,aA0BI,8BAAA,8FACA,4BAAA,qLAIJ,+BACE,iBAAA,QAAA,iBAAA,gGADF,qCAAA,qCAKI,8BAAA,gGClBN,gCDsBE,kCCvBF,iCD0BI,iBAAA,YAAA,iBAAA,+CChBJ,sCADA,sCDcE,wCAAA,wCCfF,uCADA,uCDuBM,8BAAA,uDACA,4BAAA,kLAIJ,kCACE,MAAA,KAAA,MAAA,iEADF,yCAII,aAAA,KAAA,aAAA,8EAIJ,iCACE,MAAA,QAAA,MAAA,+DADF,wCAII,aAAA,QAAA,aAAA,4EAIJ,gCACE,MAAA,QAAA,MAAA,+DACA,cAAA,EAAA,cAAA,kCAFF,sCAAA,sCAMI,iCAAA,8FANJ,6CAAA,6CASM,oBAAA,IAAA,oBAAA,2CACA,oBAAA,KAAA,oBAAA,wCAVN,uCAeI,aAAA,QAAA,aAAA,4FACA,oBAAA,QAAA,oBAAA,4CAIJ,0CACE,iBAAA,QAAA,iBAAA,qFAGF,yBACE,iBAAA,QAAA,iBAAA,gFACA,MAAA,QAAA,MAAA,4EACA,eAAA,KAHF,gCAKI,OAAA,EAAA,OAAA,mCALJ,+BAAA,+BAUI,8BAAA,yFACA,4BAAA","file":"pfe-button.min.css","sourceRoot":"../src","sourcesContent":[null,":host {\n display: inline-block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host([variant=\"primary\"]) button, button {\n background-color: #06c;\n background-color: var(--pfe-button--BackgroundColor, var(--pfe-theme--color--ui-accent, #06c));\n color: #fff;\n color: var(--pfe-button--Color, var(--pfe-theme--color--ui-base--text, #fff));\n font-size: 1rem;\n font-size: var(--pfe-button--FontSize, var(--pf-global--FontSize--md, 1rem));\n font-family: inherit;\n font-family: var(--pfe-theme--font-family, inherit);\n padding: calc(1rem / 2) 1rem;\n padding: var(--pfe-button--Padding, calc(var(--pfe-theme--container-padding, 1rem) / 2) var(--pfe-theme--container-padding, 1rem));\n cursor: pointer;\n border-radius: 3px;\n border-radius: var(--pfe-button--BorderRadius, var(--pfe-theme--surface--border-radius, 3px));\n border: 0;\n border: var(--pfe-button--Border, 0);\n position: relative;\n line-height: 1.5;\n line-height: var(--pfe-button--LineHeight, var(--pfe-theme--line-height, 1.5));\n}\n\n:host([variant=\"primary\"]) button::after, button::after {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: \"\";\n border: 1px solid transparent;\n border: var(--pfe-button__after--Border, var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-button__after--BorderColor, transparent));\n border-radius: 3px;\n border-radius: var(--pfe-button--BorderRadius, var(--pfe-theme--surface--border-radius, 3px));\n}\n\n:host([variant=\"primary\"]) button:hover, :host([variant=\"primary\"]) button:focus, button:hover, button:focus {\n --pfe-button--BackgroundColor: var(--pfe-button--BackgroundColor--hover, var(--pfe-theme--color--ui-accent--hover, #004080));\n --pfe-button__after--Border: var(--pfe-button__after--Border--hover, var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-button__after--BorderColor--hover, transparent));\n}\n\n:host([variant=\"danger\"]) button {\n background-color: #c9190b;\n background-color: var(--pfe-button--BackgroundColor, var(--pfe-theme--color--feedback--critical--lighter, #c9190b));\n}\n\n:host([variant=\"danger\"]) button:hover, :host([variant=\"danger\"]) button:focus {\n --pfe-button--BackgroundColor: var(--pfe-button--BackgroundColor--hover, var(--pfe-theme--color--feedback--critical, #a30000));\n}\n\n:host([variant=\"secondary\"]) button,\n:host([variant=\"tertiary\"]) button,\n:host([variant=\"control\"]) button {\n background-color: transparent;\n background-color: var(--pfe-button--BackgroundColor, transparent);\n}\n\n:host([variant=\"secondary\"]) button:hover, :host([variant=\"secondary\"]) button:focus,\n:host([variant=\"tertiary\"]) button:hover,\n:host([variant=\"tertiary\"]) button:focus,\n:host([variant=\"control\"]) button:hover,\n:host([variant=\"control\"]) button:focus {\n --pfe-button--BackgroundColor: var(--pfe-button--BackgroundColor--hover, transparent);\n --pfe-button__after--Border: var(--pfe-button__after--Border--hover, var(--pfe-theme--ui--border-width--md, 2px) var(--pfe-theme--ui--border-style, solid) var(--pfe-button__after--BorderColor, transparent));\n}\n\n:host([variant=\"secondary\"]) button {\n color: #06c;\n color: var(--pfe-button--Color, var(--pfe-theme--color--ui-accent, #06c));\n}\n\n:host([variant=\"secondary\"]) button::after {\n border-color: #06c;\n border-color: var(--pfe-button__after--BorderColor, var(--pfe-theme--color--ui-accent, #06c));\n}\n\n:host([variant=\"tertiary\"]) button {\n color: #151515;\n color: var(--pfe-button--Color, var(--pfe-theme--color--text, #151515));\n}\n\n:host([variant=\"tertiary\"]) button::after {\n border-color: #151515;\n border-color: var(--pfe-button__after--BorderColor, var(--pfe-theme--color--text, #151515));\n}\n\n:host([variant=\"control\"]) button {\n color: #151515;\n color: var(--pfe-button--Color, var(--pfe-theme--color--text, #151515));\n border-radius: 0;\n border-radius: var(--pfe-button--BorderRadius, 0);\n}\n\n:host([variant=\"control\"]) button:hover, :host([variant=\"control\"]) button:focus {\n --pfe-button__after--BorderColor: var(--pfe-button--BorderColor--hover, var(--pfe-theme--color--ui--border--lightest, #f0f0f0));\n}\n\n:host([variant=\"control\"]) button:hover::after, :host([variant=\"control\"]) button:focus::after {\n border-bottom-width: 2px;\n border-bottom-width: var(--pfe-theme--ui--border-width--md, 2px);\n border-bottom-color: #06c;\n border-bottom-color: var(--pfe-theme--color--ui-accent, #06c);\n}\n\n:host([variant=\"control\"]) button::after {\n border-color: #f0f0f0;\n border-color: var(--pfe-button__after--BorderColor, var(--pfe-theme--color--ui--border--lightest, #f0f0f0));\n border-bottom-color: #8a8d90;\n border-bottom-color: var(--pfe-theme--color--ui--border, #8a8d90);\n}\n\n:host([variant=\"control\"][disabled]) button {\n background-color: #f0f0f0;\n background-color: var(--pfe-button--BackgroundColor, var(--pfe-theme--color--surface--lighter, #f0f0f0));\n}\n\n:host([disabled]) button {\n background-color: #d2d2d2;\n background-color: var(--pfe-button--BackgroundColor, var(--pfe-theme--color--ui-disabled, #d2d2d2));\n color: #6a6e73;\n color: var(--pfe-button--Color, var(--pfe-theme--color--ui-disabled--text, #6a6e73));\n pointer-events: none;\n}\n\n:host([disabled]) button::after {\n border: 0;\n border: var(--pfe-button__after--Border, 0);\n}\n\n:host([disabled]) button:hover, :host([disabled]) button:focus {\n --pfe-button--BackgroundColor: var(--pfe-button--BackgroundColor--hover, var(--pfe-theme--color--ui-disabled, #d2d2d2));\n --pfe-button__after--Border: var(--pfe-button__after--Border--hover, 0);\n}\n\n/*# sourceMappingURL=pfe-button.css.map */\n"]} \ No newline at end of file diff --git a/elements/pfe-button/dist/pfe-button.min.js b/elements/pfe-button/dist/pfe-button.min.js new file mode 100644 index 0000000000..f970002d7d --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.min.js @@ -0,0 +1,27 @@ +import t from"../../pfelement/dist/pfelement.min.js"; +/*! + * PatternFly Elements: PfeButton 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/ +const r={childList:!0},e={characterData:!0,attributes:!0,subtree:!0,childList:!0},o=["style"];class a extends t{static get version(){return"1.3.0"}get html(){return'\n\n'}static get slots(){return{default:{title:"Default slot",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"button"}]}}}}static get tag(){return"pfe-button"}get schemaUrl(){return"pfe-button.json"}get templateUrl(){return"pfe-button.html"}get styleUrl(){return"pfe-button.scss"}static get events(){return{click:`${this.tag}:click`}}static get PfeType(){return t.PfeTypes.Content}static get properties(){return{variant:{title:"Style variant",type:String,values:["primary","secondary","tertiary","danger","control"]},pfeVariant:{type:String,values:["primary","secondary","tertiary","danger","control"],alias:"variant"},disabled:{title:"Disabled",type:Boolean,prefix:!1,observer:"_disabledChanged"}}}constructor(){super(a,{type:a.PfeType}),this._init=this._init.bind(this),this._parentObserverHandler=this._parentObserverHandler.bind(this),this._clickHandler=this._clickHandler.bind(this),this._internalBtnContainer=this.shadowRoot.querySelector("#internalBtn"),this._observer=new MutationObserver(this._parentObserverHandler),this._externalBtnClickHandler=this._externalBtnClickHandler.bind(this),this._externalBtnObserver=new MutationObserver(this._init),this.addEventListener("click",this._clickHandler)}get _externalBtn(){return this.querySelector("button")}connectedCallback(){super.connectedCallback(),this.hasLightDOM()&&this._init(),this._observer.observe(this,r),this._externalBtn&&this._externalBtnObserver.observe(this._externalBtn,e)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._clickHandler),this._observer.disconnect(),this._externalBtnObserver.disconnect()}_disabledChanged(t,r){this._externalBtn&&(r?this._externalBtn.setAttribute("disabled",""):this._externalBtn.removeAttribute("disabled"))}_init(){if(!this._isValidLightDom())return;if(!this._externalBtn)return;this._externalBtnObserver.disconnect(),this._externalBtn.hasAttribute("disabled")&&this.setAttribute("disabled","");const t=this._externalBtn.cloneNode(!0);o.forEach(r=>{t.hasAttribute&&t.removeAttribute(r)}),this._internalBtnContainer.innerHTML=t.outerHTML,this._externalBtnObserver.observe(this._externalBtn,e),this._externalBtn.addEventListener("click",this._externalBtnClickHandler)}_isValidLightDom(){return this.hasLightDOM()?"BUTTON"===this.children[0].tagName||(this.warn("The only child in the light DOM must be a button tag"),!1):(this.warn("You must have a button in the light DOM"),!1)}_parentObserverHandler(){this._isValidLightDom()&&this._init()}_clickHandler(){this._externalBtn.click()}_externalBtnClickHandler(){this.emitEvent(a.events.click)}}t.create(a);export default a; +//# sourceMappingURL=pfe-button.min.js.map diff --git a/elements/pfe-button/dist/pfe-button.min.js.map b/elements/pfe-button/dist/pfe-button.min.js.map new file mode 100644 index 0000000000..b04b30d1e9 --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-button.min.js","sources":["../_temp/pfe-button.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeButton 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\n// @IE11\n// watching for addition and removal of nodes so\n// we can make sure we have the correct light DOM\n// and so we can set the _externalBtn property\nconst parentObserverConfig = {\n childList: true\n};\n\n// watching for changes on the _externalBtn so we can\n// update text in our shadow DOM when the _externalBtn\n// changes\nconst externalBtnObserverConfig = {\n characterData: true,\n attributes: true,\n subtree: true,\n childList: true\n};\n\n// list of attributes that we DO NOT want to pass from\n// the _externalBtn to our shadow DOM button. For example,\n// the style attribute could ruin our encapsulated styles\n// in the shadow DOM\nconst denylistAttributes = [\"style\"];\n\nclass PfeButton extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n // Injected at build-time\n static get slots() {\n return {\"default\":{\"title\":\"Default slot\",\"type\":\"array\",\"namedSlot\":false,\"items\":{\"oneOf\":[{\"$ref\":\"button\"}]}}};\n }\n\n static get tag() {\n return \"pfe-button\";\n }\n\n get schemaUrl() {\n return \"pfe-button.json\";\n }\n\n get templateUrl() {\n return \"pfe-button.html\";\n }\n\n get styleUrl() {\n return \"pfe-button.scss\";\n }\n\n static get events() {\n return {\n click: `${this.tag}:click`\n };\n }\n\n static get PfeType() {\n return PFElement.PfeTypes.Content;\n }\n\n static get properties() {\n return {\n variant: {\n title: \"Style variant\",\n type: String,\n values: [\"primary\", \"secondary\", \"tertiary\", \"danger\", \"control\"]\n },\n pfeVariant: {\n type: String,\n values: [\"primary\", \"secondary\", \"tertiary\", \"danger\", \"control\"],\n alias: \"variant\"\n },\n disabled: {\n title: \"Disabled\",\n type: Boolean,\n prefix: false,\n observer: \"_disabledChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeButton, { type: PfeButton.PfeType });\n\n this._init = this._init.bind(this);\n this._parentObserverHandler = this._parentObserverHandler.bind(this);\n this._clickHandler = this._clickHandler.bind(this);\n this._internalBtnContainer = this.shadowRoot.querySelector(\"#internalBtn\");\n this._observer = new MutationObserver(this._parentObserverHandler);\n this._externalBtnClickHandler = this._externalBtnClickHandler.bind(this);\n this._externalBtnObserver = new MutationObserver(this._init);\n\n this.addEventListener(\"click\", this._clickHandler);\n }\n\n get _externalBtn() {\n return this.querySelector(\"button\");\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.hasLightDOM()) this._init();\n\n this._observer.observe(this, parentObserverConfig);\n\n if (this._externalBtn) {\n this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"click\", this._clickHandler);\n this._observer.disconnect();\n this._externalBtnObserver.disconnect();\n }\n\n _disabledChanged(oldVal, newVal) {\n if (!this._externalBtn) {\n return;\n }\n\n if (newVal) {\n this._externalBtn.setAttribute(\"disabled\", \"\");\n } else {\n this._externalBtn.removeAttribute(\"disabled\");\n }\n }\n\n _init() {\n if (!this._isValidLightDom()) {\n return;\n }\n\n if (!this._externalBtn) {\n return;\n }\n\n this._externalBtnObserver.disconnect();\n\n // If the external button has a disabled attribute\n if (this._externalBtn.hasAttribute(\"disabled\")) {\n // Set it on the wrapper too\n this.setAttribute(\"disabled\", \"\");\n }\n\n const clone = this._externalBtn.cloneNode(true);\n denylistAttributes.forEach(attribute => {\n if (clone.hasAttribute) {\n clone.removeAttribute(attribute);\n }\n });\n\n this._internalBtnContainer.innerHTML = clone.outerHTML;\n this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig);\n\n this._externalBtn.addEventListener(\"click\", this._externalBtnClickHandler);\n }\n\n _isValidLightDom() {\n if (!this.hasLightDOM()) {\n this.warn(`You must have a button in the light DOM`);\n return false;\n }\n if (this.children[0].tagName !== \"BUTTON\") {\n this.warn(`The only child in the light DOM must be a button tag`);\n\n return false;\n }\n\n return true;\n }\n\n // when the parent changes, make sure the light DOM is valid,\n // initialize the component\n _parentObserverHandler() {\n if (!this._isValidLightDom()) {\n return;\n }\n\n this._init();\n }\n\n // programmatically clicking the _externalBtn is what makes\n // this web component button work in a form as you'd expect\n _clickHandler() {\n this._externalBtn.click();\n }\n\n _externalBtnClickHandler() {\n this.emitEvent(PfeButton.events.click);\n }\n}\n\nPFElement.create(PfeButton);\n\nexport default PfeButton;\n"],"names":["parentObserverConfig","childList","externalBtnObserverConfig","characterData","attributes","subtree","denylistAttributes","PfeButton","PFElement","version","html","slots","default","title","type","namedSlot","items","oneOf","$ref","tag","schemaUrl","templateUrl","styleUrl","events","click","this","PfeType","PfeTypes","Content","properties","variant","String","values","pfeVariant","alias","disabled","Boolean","prefix","observer","[object Object]","super","_init","bind","_parentObserverHandler","_clickHandler","_internalBtnContainer","shadowRoot","querySelector","_observer","MutationObserver","_externalBtnClickHandler","_externalBtnObserver","addEventListener","_externalBtn","connectedCallback","hasLightDOM","observe","disconnectedCallback","removeEventListener","disconnect","oldVal","newVal","setAttribute","removeAttribute","_isValidLightDom","hasAttribute","clone","cloneNode","forEach","attribute","innerHTML","outerHTML","children","tagName","warn","emitEvent","create"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAMA,EAAuB,CAC3BC,WAAW,GAMPC,EAA4B,CACh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AAUQ,QAAQ/B,KAAMzB,GAEzByB,KAAK4B,cACP5B,KAAK0B,qBAAqBK,QAAQ/B,KAAK4B,aAAcnD,GAIzDqC,uBACEC,MAAMiB,uBAENhC,KAAKiC,oBAAoB,QAASjC,KAAKmB,eACvCnB,KAAKuB,UAAUW,aACflC,KAAK0B,qBAAqBQ,aAG5BpB,iBAAiBqB,EAAQC,GAClBpC,KAAK4B,eAINQ,EACFpC,KAAK4B,aAAaS,aAAa,WAAY,IAE3CrC,KAAK4B,aAAaU,gBAAgB,aAItCxB,QACE,IAAKd,KAAKuC,mBACR,OAGF,IAAKvC,KAAK4B,aACR,OAGF5B,KAAK0B,qBAAqBQ,aAGtBlC,KAAK4B,aAAaY,aAAa,aAEjCxC,KAAKqC,aAAa,WAAY,IAGhC,MAAMI,EAAQzC,KAAK4B,aAAac,WAAU,GAC1C7D,EAAmB8D,QAAQC,IACrBH,EAAMD,cACRC,EAAMH,gBAAgBM,KAI1B5C,KAAKoB,sBAAsByB,UAAYJ,EAAMK,UAC7C9C,KAAK0B,qBAAqBK,QAAQ/B,KAAK4B,aAAcnD,GAErDuB,KAAK4B,aAAaD,iBAAiB,QAAS3B,KAAKyB,0BAGnDX,mBACE,OAAKd,KAAK8B,cAIuB,WAA7B9B,KAAK+C,SAAS,GAAGC,UACnBhD,KAAKiD,KAAK,yDAEH,IANPjD,KAAKiD,KAAK,4CACH,GAaXnC,yBACOd,KAAKuC,oBAIVvC,KAAKgB,QAKPF,gBACEd,KAAK4B,aAAa7B,QAGpBe,2BACEd,KAAKkD,UAAUpE,EAAUgB,OAAOC,QAIpChB,EAAUoE,OAAOrE"} \ No newline at end of file diff --git a/elements/pfe-button/dist/pfe-button.umd.js b/elements/pfe-button/dist/pfe-button.umd.js new file mode 100644 index 0000000000..4c9212affb --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.umd.js @@ -0,0 +1,352 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../../pfelement/dist/pfelement.umd')) : + typeof define === 'function' && define.amd ? define(['../../pfelement/dist/pfelement.umd'], factory) : + (global = global || self, global.PfeButton = factory(global.PFElement)); +}(this, (function (PFElement) { 'use strict'; + + PFElement = PFElement && Object.prototype.hasOwnProperty.call(PFElement, 'default') ? PFElement['default'] : PFElement; + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } + }; + + var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + }; + + var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + }; + + /*! + * PatternFly Elements: PfeButton 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + // @IE11 + // watching for addition and removal of nodes so + // we can make sure we have the correct light DOM + // and so we can set the _externalBtn property + var parentObserverConfig = { + childList: true + }; + + // watching for changes on the _externalBtn so we can + // update text in our shadow DOM when the _externalBtn + // changes + var externalBtnObserverConfig = { + characterData: true, + attributes: true, + subtree: true, + childList: true + }; + + // list of attributes that we DO NOT want to pass from + // the _externalBtn to our shadow DOM button. For example, + // the style attribute could ruin our encapsulated styles + // in the shadow DOM + var denylistAttributes = ["style"]; + + var PfeButton = function (_PFElement) { + inherits(PfeButton, _PFElement); + createClass(PfeButton, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n"; + } + + // Injected at build-time + + }, { + key: "schemaUrl", + get: function get() { + return "pfe-button.json"; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-button.html"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-button.scss"; + } + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "slots", + get: function get() { + return { "default": { "title": "Default slot", "type": "array", "namedSlot": false, "items": { "oneOf": [{ "$ref": "button" }] } } }; + } + }, { + key: "tag", + get: function get() { + return "pfe-button"; + } + }, { + key: "events", + get: function get() { + return { + click: this.tag + ":click" + }; + } + }, { + key: "PfeType", + get: function get() { + return PFElement.PfeTypes.Content; + } + }, { + key: "properties", + get: function get() { + return { + variant: { + title: "Style variant", + type: String, + values: ["primary", "secondary", "tertiary", "danger", "control"] + }, + pfeVariant: { + type: String, + values: ["primary", "secondary", "tertiary", "danger", "control"], + alias: "variant" + }, + disabled: { + title: "Disabled", + type: Boolean, + prefix: false, + observer: "_disabledChanged" + } + }; + } + }]); + + function PfeButton() { + classCallCheck(this, PfeButton); + + var _this = possibleConstructorReturn(this, (PfeButton.__proto__ || Object.getPrototypeOf(PfeButton)).call(this, PfeButton, { type: PfeButton.PfeType })); + + _this._init = _this._init.bind(_this); + _this._parentObserverHandler = _this._parentObserverHandler.bind(_this); + _this._clickHandler = _this._clickHandler.bind(_this); + _this._internalBtnContainer = _this.shadowRoot.querySelector("#internalBtn"); + _this._observer = new MutationObserver(_this._parentObserverHandler); + _this._externalBtnClickHandler = _this._externalBtnClickHandler.bind(_this); + _this._externalBtnObserver = new MutationObserver(_this._init); + + _this.addEventListener("click", _this._clickHandler); + return _this; + } + + createClass(PfeButton, [{ + key: "connectedCallback", + value: function connectedCallback() { + get(PfeButton.prototype.__proto__ || Object.getPrototypeOf(PfeButton.prototype), "connectedCallback", this).call(this); + + if (this.hasLightDOM()) this._init(); + + this._observer.observe(this, parentObserverConfig); + + if (this._externalBtn) { + this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig); + } + } + }, { + key: "disconnectedCallback", + value: function disconnectedCallback() { + get(PfeButton.prototype.__proto__ || Object.getPrototypeOf(PfeButton.prototype), "disconnectedCallback", this).call(this); + + this.removeEventListener("click", this._clickHandler); + this._observer.disconnect(); + this._externalBtnObserver.disconnect(); + } + }, { + key: "_disabledChanged", + value: function _disabledChanged(oldVal, newVal) { + if (!this._externalBtn) { + return; + } + + if (newVal) { + this._externalBtn.setAttribute("disabled", ""); + } else { + this._externalBtn.removeAttribute("disabled"); + } + } + }, { + key: "_init", + value: function _init() { + if (!this._isValidLightDom()) { + return; + } + + if (!this._externalBtn) { + return; + } + + this._externalBtnObserver.disconnect(); + + // If the external button has a disabled attribute + if (this._externalBtn.hasAttribute("disabled")) { + // Set it on the wrapper too + this.setAttribute("disabled", ""); + } + + var clone = this._externalBtn.cloneNode(true); + denylistAttributes.forEach(function (attribute) { + if (clone.hasAttribute) { + clone.removeAttribute(attribute); + } + }); + + this._internalBtnContainer.innerHTML = clone.outerHTML; + this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig); + + this._externalBtn.addEventListener("click", this._externalBtnClickHandler); + } + }, { + key: "_isValidLightDom", + value: function _isValidLightDom() { + if (!this.hasLightDOM()) { + this.warn("You must have a button in the light DOM"); + return false; + } + if (this.children[0].tagName !== "BUTTON") { + this.warn("The only child in the light DOM must be a button tag"); + + return false; + } + + return true; + } + + // when the parent changes, make sure the light DOM is valid, + // initialize the component + + }, { + key: "_parentObserverHandler", + value: function _parentObserverHandler() { + if (!this._isValidLightDom()) { + return; + } + + this._init(); + } + + // programmatically clicking the _externalBtn is what makes + // this web component button work in a form as you'd expect + + }, { + key: "_clickHandler", + value: function _clickHandler() { + this._externalBtn.click(); + } + }, { + key: "_externalBtnClickHandler", + value: function _externalBtnClickHandler() { + this.emitEvent(PfeButton.events.click); + } + }, { + key: "_externalBtn", + get: function get() { + return this.querySelector("button"); + } + }]); + return PfeButton; + }(PFElement); + + PFElement.create(PfeButton); + + return PfeButton; + +}))); +//# sourceMappingURL=pfe-button.umd.js.map diff --git a/elements/pfe-button/dist/pfe-button.umd.js.map b/elements/pfe-button/dist/pfe-button.umd.js.map new file mode 100644 index 0000000000..b7f6414c41 --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-button.umd.js","sources":["../_temp/pfe-button.umd.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeButton 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\n\n// @IE11\n// watching for addition and removal of nodes so\n// we can make sure we have the correct light DOM\n// and so we can set the _externalBtn property\nconst parentObserverConfig = {\n childList: true\n};\n\n// watching for changes on the _externalBtn so we can\n// update text in our shadow DOM when the _externalBtn\n// changes\nconst externalBtnObserverConfig = {\n characterData: true,\n attributes: true,\n subtree: true,\n childList: true\n};\n\n// list of attributes that we DO NOT want to pass from\n// the _externalBtn to our shadow DOM button. For example,\n// the style attribute could ruin our encapsulated styles\n// in the shadow DOM\nconst denylistAttributes = [\"style\"];\n\nclass PfeButton extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n // Injected at build-time\n static get slots() {\n return {\"default\":{\"title\":\"Default slot\",\"type\":\"array\",\"namedSlot\":false,\"items\":{\"oneOf\":[{\"$ref\":\"button\"}]}}};\n }\n\n static get tag() {\n return \"pfe-button\";\n }\n\n get schemaUrl() {\n return \"pfe-button.json\";\n }\n\n get templateUrl() {\n return \"pfe-button.html\";\n }\n\n get styleUrl() {\n return \"pfe-button.scss\";\n }\n\n static get events() {\n return {\n click: `${this.tag}:click`\n };\n }\n\n static get PfeType() {\n return PFElement.PfeTypes.Content;\n }\n\n static get properties() {\n return {\n variant: {\n title: \"Style variant\",\n type: String,\n values: [\"primary\", \"secondary\", \"tertiary\", \"danger\", \"control\"]\n },\n pfeVariant: {\n type: String,\n values: [\"primary\", \"secondary\", \"tertiary\", \"danger\", \"control\"],\n alias: \"variant\"\n },\n disabled: {\n title: \"Disabled\",\n type: Boolean,\n prefix: false,\n observer: \"_disabledChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeButton, { type: PfeButton.PfeType });\n\n this._init = this._init.bind(this);\n this._parentObserverHandler = this._parentObserverHandler.bind(this);\n this._clickHandler = this._clickHandler.bind(this);\n this._internalBtnContainer = this.shadowRoot.querySelector(\"#internalBtn\");\n this._observer = new MutationObserver(this._parentObserverHandler);\n this._externalBtnClickHandler = this._externalBtnClickHandler.bind(this);\n this._externalBtnObserver = new MutationObserver(this._init);\n\n this.addEventListener(\"click\", this._clickHandler);\n }\n\n get _externalBtn() {\n return this.querySelector(\"button\");\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.hasLightDOM()) this._init();\n\n this._observer.observe(this, parentObserverConfig);\n\n if (this._externalBtn) {\n this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"click\", this._clickHandler);\n this._observer.disconnect();\n this._externalBtnObserver.disconnect();\n }\n\n _disabledChanged(oldVal, newVal) {\n if (!this._externalBtn) {\n return;\n }\n\n if (newVal) {\n this._externalBtn.setAttribute(\"disabled\", \"\");\n } else {\n this._externalBtn.removeAttribute(\"disabled\");\n }\n }\n\n _init() {\n if (!this._isValidLightDom()) {\n return;\n }\n\n if (!this._externalBtn) {\n return;\n }\n\n this._externalBtnObserver.disconnect();\n\n // If the external button has a disabled attribute\n if (this._externalBtn.hasAttribute(\"disabled\")) {\n // Set it on the wrapper too\n this.setAttribute(\"disabled\", \"\");\n }\n\n const clone = this._externalBtn.cloneNode(true);\n denylistAttributes.forEach(attribute => {\n if (clone.hasAttribute) {\n clone.removeAttribute(attribute);\n }\n });\n\n this._internalBtnContainer.innerHTML = clone.outerHTML;\n this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig);\n\n this._externalBtn.addEventListener(\"click\", this._externalBtnClickHandler);\n }\n\n _isValidLightDom() {\n if (!this.hasLightDOM()) {\n this.warn(`You must have a button in the light DOM`);\n return false;\n }\n if (this.children[0].tagName !== \"BUTTON\") {\n this.warn(`The only child in the light DOM must be a button tag`);\n\n return false;\n }\n\n return true;\n }\n\n // when the parent changes, make sure the light DOM is valid,\n // initialize the component\n _parentObserverHandler() {\n if (!this._isValidLightDom()) {\n return;\n }\n\n this._init();\n }\n\n // programmatically clicking the _externalBtn is what makes\n // this web component button work in a form as you'd expect\n _clickHandler() {\n this._externalBtn.click();\n }\n\n _externalBtnClickHandler() {\n this.emitEvent(PfeButton.events.click);\n }\n}\n\nPFElement.create(PfeButton);\n\nexport default PfeButton;\n"],"names":["parentObserverConfig","childList","externalBtnObserverConfig","characterData","attributes","subtree","denylistAttributes","PfeButton","click","tag","PFElement","PfeTypes","Content","variant","title","type","String","values","pfeVariant","alias","disabled","Boolean","prefix","observer","PfeType","_init","bind","_parentObserverHandler","_clickHandler","_internalBtnContainer","shadowRoot","querySelector","_observer","MutationObserver","_externalBtnClickHandler","_externalBtnObserver","addEventListener","hasLightDOM","observe","_externalBtn","removeEventListener","disconnect","oldVal","newVal","setAttribute","removeAttribute","_isValidLightDom","hasAttribute","clone","cloneNode","forEach","attribute","innerHTML","outerHTML","warn","children","tagName","emitEvent","events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B;EACd,WAAKc,YAAL,CAAkB/B,KAAlB;EACD;;;iDAE0B;EACzB,WAAKiD,SAAL,CAAelD,UAAUmD,MAAV,CAAiBlD,KAAhC;EACD;;;0BAlGkB;EACjB,aAAO,KAAKuB,aAAL,CAAmB,QAAnB,CAAP;EACD;;;IAlFqBrB;;EAqLxBA,UAAUiD,MAAV,CAAiBpD,SAAjB;;;;;;;;"} \ No newline at end of file diff --git a/elements/pfe-button/dist/pfe-button.umd.min.js b/elements/pfe-button/dist/pfe-button.umd.min.js new file mode 100644 index 0000000000..0e6a33d263 --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.umd.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("../../pfelement/dist/pfelement.umd.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min"],e):(t=t||self).PfeButton=e(t.PFElement)}(this,function(t){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),t};function o(t,e){for(var r=0;r:host{display:inline-block}:host([hidden]){display:none}:host([variant=primary]) button,button{background-color:#06c;background-color:var(--pfe-button--BackgroundColor,var(--pfe-theme--color--ui-accent,#06c));color:#fff;color:var(--pfe-button--Color,var(--pfe-theme--color--ui-base--text,#fff));font-size:1rem;font-size:var(--pfe-button--FontSize,var(--pf-global--FontSize--md,1rem));font-family:inherit;font-family:var(--pfe-theme--font-family,inherit);padding:calc(1rem / 2) 1rem;padding:var(--pfe-button--Padding,calc(var(--pfe-theme--container-padding,1rem)/ 2) var(--pfe-theme--container-padding,1rem));cursor:pointer;border-radius:3px;border-radius:var(--pfe-button--BorderRadius,var(--pfe-theme--surface--border-radius,3px));border:0;border:var(--pfe-button--Border,0);position:relative;line-height:1.5;line-height:var(--pfe-button--LineHeight,var(--pfe-theme--line-height,1.5))}:host([variant=primary]) button::after,button::after{position:absolute;top:0;left:0;right:0;bottom:0;content:"";border:1px solid transparent;border:var(--pfe-button__after--Border,var(--pfe-theme--ui--border-width,1px) var(--pfe-theme--ui--border-style,solid) var(--pfe-button__after--BorderColor,transparent));border-radius:3px;border-radius:var(--pfe-button--BorderRadius,var(--pfe-theme--surface--border-radius,3px))}:host([variant=primary]) button:focus,:host([variant=primary]) button:hover,button:focus,button:hover{--pfe-button--BackgroundColor:var(--pfe-button--BackgroundColor--hover, var(--pfe-theme--color--ui-accent--hover, #004080));--pfe-button__after--Border:var(--pfe-button__after--Border--hover, var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-button__after--BorderColor--hover, transparent))}:host([variant=danger]) button{background-color:#c9190b;background-color:var(--pfe-button--BackgroundColor,var(--pfe-theme--color--feedback--critical--lighter,#c9190b))}:host([variant=danger]) button:focus,:host([variant=danger]) button:hover{--pfe-button--BackgroundColor:var(--pfe-button--BackgroundColor--hover, var(--pfe-theme--color--feedback--critical, #a30000))}:host([variant=control]) button,:host([variant=secondary]) button,:host([variant=tertiary]) button{background-color:transparent;background-color:var(--pfe-button--BackgroundColor,transparent)}:host([variant=control]) button:focus,:host([variant=control]) button:hover,:host([variant=secondary]) button:focus,:host([variant=secondary]) button:hover,:host([variant=tertiary]) button:focus,:host([variant=tertiary]) button:hover{--pfe-button--BackgroundColor:var(--pfe-button--BackgroundColor--hover, transparent);--pfe-button__after--Border:var(--pfe-button__after--Border--hover, var(--pfe-theme--ui--border-width--md, 2px) var(--pfe-theme--ui--border-style, solid) var(--pfe-button__after--BorderColor, transparent))}:host([variant=secondary]) button{color:#06c;color:var(--pfe-button--Color,var(--pfe-theme--color--ui-accent,#06c))}:host([variant=secondary]) button::after{border-color:#06c;border-color:var(--pfe-button__after--BorderColor,var(--pfe-theme--color--ui-accent,#06c))}:host([variant=tertiary]) button{color:#151515;color:var(--pfe-button--Color,var(--pfe-theme--color--text,#151515))}:host([variant=tertiary]) button::after{border-color:#151515;border-color:var(--pfe-button__after--BorderColor,var(--pfe-theme--color--text,#151515))}:host([variant=control]) button{color:#151515;color:var(--pfe-button--Color,var(--pfe-theme--color--text,#151515));border-radius:0;border-radius:var(--pfe-button--BorderRadius,0)}:host([variant=control]) button:focus,:host([variant=control]) button:hover{--pfe-button__after--BorderColor:var(--pfe-button--BorderColor--hover, var(--pfe-theme--color--ui--border--lightest, #f0f0f0))}:host([variant=control]) button:focus::after,:host([variant=control]) button:hover::after{border-bottom-width:2px;border-bottom-width:var(--pfe-theme--ui--border-width--md,2px);border-bottom-color:#06c;border-bottom-color:var(--pfe-theme--color--ui-accent,#06c)}:host([variant=control]) button::after{border-color:#f0f0f0;border-color:var(--pfe-button__after--BorderColor,var(--pfe-theme--color--ui--border--lightest,#f0f0f0));border-bottom-color:#8a8d90;border-bottom-color:var(--pfe-theme--color--ui--border,#8a8d90)}:host([variant=control][disabled]) button{background-color:#f0f0f0;background-color:var(--pfe-button--BackgroundColor,var(--pfe-theme--color--surface--lighter,#f0f0f0))}:host([disabled]) button{background-color:#d2d2d2;background-color:var(--pfe-button--BackgroundColor,var(--pfe-theme--color--ui-disabled,#d2d2d2));color:#6a6e73;color:var(--pfe-button--Color,var(--pfe-theme--color--ui-disabled--text,#6a6e73));pointer-events:none}:host([disabled]) button::after{border:0;border:var(--pfe-button__after--Border,0)}:host([disabled]) button:focus,:host([disabled]) button:hover{--pfe-button--BackgroundColor:var(--pfe-button--BackgroundColor--hover, var(--pfe-theme--color--ui-disabled, #d2d2d2));--pfe-button__after--Border:var(--pfe-button__after--Border--hover, 0)} /*# sourceMappingURL=pfe-button.min.css.map */\n'}},{key:"schemaUrl",get:function(){return"pfe-button.json"}},{key:"templateUrl",get:function(){return"pfe-button.html"}},{key:"styleUrl",get:function(){return"pfe-button.scss"}}],[{key:"version",get:function(){return"1.3.0"}},{key:"slots",get:function(){return{default:{title:"Default slot",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"button"}]}}}}},{key:"tag",get:function(){return"pfe-button"}},{key:"events",get:function(){return{click:this.tag+":click"}}},{key:"PfeType",get:function(){return t.PfeTypes.Content}},{key:"properties",get:function(){return{variant:{title:"Style variant",type:String,values:["primary","secondary","tertiary","danger","control"]},pfeVariant:{type:String,values:["primary","secondary","tertiary","danger","control"],alias:"variant"},disabled:{title:"Disabled",type:Boolean,prefix:!1,observer:"_disabledChanged"}}}}]),r(u,[{key:"connectedCallback",value:function(){n(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"connectedCallback",this).call(this),this.hasLightDOM()&&this._init(),this._observer.observe(this,i),this._externalBtn&&this._externalBtnObserver.observe(this._externalBtn,l)}},{key:"disconnectedCallback",value:function(){n(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("click",this._clickHandler),this._observer.disconnect(),this._externalBtnObserver.disconnect()}},{key:"_disabledChanged",value:function(t,e){this._externalBtn&&(e?this._externalBtn.setAttribute("disabled",""):this._externalBtn.removeAttribute("disabled"))}},{key:"_init",value:function(){var e;this._isValidLightDom()&&this._externalBtn&&(this._externalBtnObserver.disconnect(),this._externalBtn.hasAttribute("disabled")&&this.setAttribute("disabled",""),e=this._externalBtn.cloneNode(!0),c.forEach(function(t){e.hasAttribute&&e.removeAttribute(t)}),this._internalBtnContainer.innerHTML=e.outerHTML,this._externalBtnObserver.observe(this._externalBtn,l),this._externalBtn.addEventListener("click",this._externalBtnClickHandler))}},{key:"_isValidLightDom",value:function(){return this.hasLightDOM()?"BUTTON"===this.children[0].tagName||(this.warn("The only child in the light DOM must be a button tag"),!1):(this.warn("You must have a button in the light DOM"),!1)}},{key:"_parentObserverHandler",value:function(){this._isValidLightDom()&&this._init()}},{key:"_clickHandler",value:function(){this._externalBtn.click()}},{key:"_externalBtnClickHandler",value:function(){this.emitEvent(u.events.click)}},{key:"_externalBtn",get:function(){return this.querySelector("button")}}]),u);function u(){e(this,u);var t=a(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,u,{type:u.PfeType}));return t._init=t._init.bind(t),t._parentObserverHandler=t._parentObserverHandler.bind(t),t._clickHandler=t._clickHandler.bind(t),t._internalBtnContainer=t.shadowRoot.querySelector("#internalBtn"),t._observer=new MutationObserver(t._parentObserverHandler),t._externalBtnClickHandler=t._externalBtnClickHandler.bind(t),t._externalBtnObserver=new MutationObserver(t._init),t.addEventListener("click",t._clickHandler),t}return t.create(r),r}); +//# sourceMappingURL=pfe-button.umd.min.js.map diff --git a/elements/pfe-button/dist/pfe-button.umd.min.js.map b/elements/pfe-button/dist/pfe-button.umd.min.js.map new file mode 100644 index 0000000000..67df68b58a --- /dev/null +++ b/elements/pfe-button/dist/pfe-button.umd.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-button.umd.min.js","sources":["../_temp/pfe-button.umd.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeButton 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\n\n// @IE11\n// watching for addition and removal of nodes so\n// we can make sure we have the correct light DOM\n// and so we can set the _externalBtn property\nconst parentObserverConfig = {\n childList: true\n};\n\n// watching for changes on the _externalBtn so we can\n// update text in our shadow DOM when the _externalBtn\n// changes\nconst externalBtnObserverConfig = {\n characterData: true,\n attributes: true,\n subtree: true,\n childList: true\n};\n\n// list of attributes that we DO NOT want to pass from\n// the _externalBtn to our shadow DOM button. For example,\n// the style attribute could ruin our encapsulated styles\n// in the shadow DOM\nconst denylistAttributes = [\"style\"];\n\nclass PfeButton extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n`;\n }\n\n // Injected at build-time\n static get slots() {\n return {\"default\":{\"title\":\"Default slot\",\"type\":\"array\",\"namedSlot\":false,\"items\":{\"oneOf\":[{\"$ref\":\"button\"}]}}};\n }\n\n static get tag() {\n return \"pfe-button\";\n }\n\n get schemaUrl() {\n return \"pfe-button.json\";\n }\n\n get templateUrl() {\n return \"pfe-button.html\";\n }\n\n get styleUrl() {\n return \"pfe-button.scss\";\n }\n\n static get events() {\n return {\n click: `${this.tag}:click`\n };\n }\n\n static get PfeType() {\n return PFElement.PfeTypes.Content;\n }\n\n static get properties() {\n return {\n variant: {\n title: \"Style variant\",\n type: String,\n values: [\"primary\", \"secondary\", \"tertiary\", \"danger\", \"control\"]\n },\n pfeVariant: {\n type: String,\n values: [\"primary\", \"secondary\", \"tertiary\", \"danger\", \"control\"],\n alias: \"variant\"\n },\n disabled: {\n title: \"Disabled\",\n type: Boolean,\n prefix: false,\n observer: \"_disabledChanged\"\n }\n };\n }\n\n constructor() {\n super(PfeButton, { type: PfeButton.PfeType });\n\n this._init = this._init.bind(this);\n this._parentObserverHandler = this._parentObserverHandler.bind(this);\n this._clickHandler = this._clickHandler.bind(this);\n this._internalBtnContainer = this.shadowRoot.querySelector(\"#internalBtn\");\n this._observer = new MutationObserver(this._parentObserverHandler);\n this._externalBtnClickHandler = this._externalBtnClickHandler.bind(this);\n this._externalBtnObserver = new MutationObserver(this._init);\n\n this.addEventListener(\"click\", this._clickHandler);\n }\n\n get _externalBtn() {\n return this.querySelector(\"button\");\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.hasLightDOM()) this._init();\n\n this._observer.observe(this, parentObserverConfig);\n\n if (this._externalBtn) {\n this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"click\", this._clickHandler);\n this._observer.disconnect();\n this._externalBtnObserver.disconnect();\n }\n\n _disabledChanged(oldVal, newVal) {\n if (!this._externalBtn) {\n return;\n }\n\n if (newVal) {\n this._externalBtn.setAttribute(\"disabled\", \"\");\n } else {\n this._externalBtn.removeAttribute(\"disabled\");\n }\n }\n\n _init() {\n if (!this._isValidLightDom()) {\n return;\n }\n\n if (!this._externalBtn) {\n return;\n }\n\n this._externalBtnObserver.disconnect();\n\n // If the external button has a disabled attribute\n if (this._externalBtn.hasAttribute(\"disabled\")) {\n // Set it on the wrapper too\n this.setAttribute(\"disabled\", \"\");\n }\n\n const clone = this._externalBtn.cloneNode(true);\n denylistAttributes.forEach(attribute => {\n if (clone.hasAttribute) {\n clone.removeAttribute(attribute);\n }\n });\n\n this._internalBtnContainer.innerHTML = clone.outerHTML;\n this._externalBtnObserver.observe(this._externalBtn, externalBtnObserverConfig);\n\n this._externalBtn.addEventListener(\"click\", this._externalBtnClickHandler);\n }\n\n _isValidLightDom() {\n if (!this.hasLightDOM()) {\n this.warn(`You must have a button in the light DOM`);\n return false;\n }\n if (this.children[0].tagName !== \"BUTTON\") {\n this.warn(`The only child in the light DOM must be a button tag`);\n\n return false;\n }\n\n return true;\n }\n\n // when the parent changes, make sure the light DOM is valid,\n // initialize the component\n _parentObserverHandler() {\n if (!this._isValidLightDom()) {\n return;\n }\n\n this._init();\n }\n\n // programmatically clicking the _externalBtn is what makes\n // this web component button work in a form as you'd expect\n _clickHandler() {\n this._externalBtn.click();\n }\n\n _externalBtnClickHandler() {\n this.emitEvent(PfeButton.events.click);\n }\n}\n\nPFElement.create(PfeButton);\n\nexport default PfeButton;\n"],"names":["parentObserverConfig","externalBtnObserverConfig","denylistAttributes","PfeButton","PFElement","default","title","type","namedSlot","items","oneOf","$ref","this","tag","PfeTypes","Content","String","Boolean","hasLightDOM","_init","_observer","observe","_externalBtn","_externalBtnObserver","removeEventListener","_clickHandler","disconnect","oldVal","newVal","setAttribute","removeAttribute","clone","_isValidLightDom","hasAttribute","cloneNode","forEach","attribute","_internalBtnContainer","innerHTML","outerHTML","addEventListener","_externalBtnClickHandler","children","tagName","warn","click","emitEvent","events","querySelector","PfeType","_this","bind","_parentObserverHandler","shadowRoot","MutationObserver","create"],"mappings":"kkCA+BMA,EAAuB,YAChB,GAMPC,EAA4B,gBACjB,cACH,WACH,aACE,GAOPC,EAAqB,CAAC,SAEtBC,+TAAkBC,ulKAwBb,4DAIA,yDAIA,0DA5BA,4CAYA,CAACC,QAAU,CAACC,MAAQ,eAAeC,KAAO,QAAQC,WAAY,EAAMC,MAAQ,CAACC,MAAQ,CAAC,CAACC,KAAO,gDAI9F,kDAgBA,OACKC,KAAKC,qDAKVT,EAAUU,SAASC,iDAInB,SACI,OACA,qBACDC,cACE,CAAC,UAAW,YAAa,WAAY,SAAU,uBAE7C,MACJA,cACE,CAAC,UAAW,YAAa,WAAY,SAAU,iBAChD,oBAEC,OACD,gBACDC,gBACE,WACE,yKA0BVL,KAAKM,eAAeN,KAAKO,aAExBC,UAAUC,QAAQT,KAAMZ,GAEzBY,KAAKU,mBACFC,qBAAqBF,QAAQT,KAAKU,aAAcrB,2JAOlDuB,oBAAoB,QAASZ,KAAKa,oBAClCL,UAAUM,kBACVH,qBAAqBG,sDAGXC,EAAQC,GAClBhB,KAAKU,eAINM,OACGN,aAAaO,aAAa,WAAY,SAEtCP,aAAaQ,gBAAgB,iDAqB9BC,EAhBDnB,KAAKoB,oBAILpB,KAAKU,oBAILC,qBAAqBG,aAGtBd,KAAKU,aAAaW,aAAa,kBAE5BJ,aAAa,WAAY,IAG1BE,EAAQnB,KAAKU,aAAaY,WAAU,KACvBC,QAAQ,YACrBJ,EAAME,gBACFH,gBAAgBM,UAIrBC,sBAAsBC,UAAYP,EAAMQ,eACxChB,qBAAqBF,QAAQT,KAAKU,aAAcrB,QAEhDqB,aAAakB,iBAAiB,QAAS5B,KAAK6B,6EAI5C7B,KAAKM,cAIuB,WAA7BN,KAAK8B,SAAS,GAAGC,eACdC,8DAEE,SANFA,iDACE,oDAcJhC,KAAKoB,yBAILb,qDAMAG,aAAauB,gEAIbC,UAAU3C,EAAU4C,OAAOF,mDAhGzBjC,KAAKoC,cAAc,uGAdpB7C,EAAW,CAAEI,KAAMJ,EAAU8C,oBAE9B9B,MAAQ+B,EAAK/B,MAAMgC,UACnBC,uBAAyBF,EAAKE,uBAAuBD,UACrD1B,cAAgByB,EAAKzB,cAAc0B,UACnCd,sBAAwBa,EAAKG,WAAWL,cAAc,kBACtD5B,UAAY,IAAIkC,iBAAiBJ,EAAKE,0BACtCX,yBAA2BS,EAAKT,yBAAyBU,UACzD5B,qBAAuB,IAAI+B,iBAAiBJ,EAAK/B,SAEjDqB,iBAAiB,QAASU,EAAKzB,wBAwGxCrB,EAAUmD,OAAOpD"} \ No newline at end of file diff --git a/elements/pfe-button/package.json b/elements/pfe-button/package.json index 700b814e1c..a4bced3766 100644 --- a/elements/pfe-button/package.json +++ b/elements/pfe-button/package.json @@ -12,7 +12,7 @@ "assets": [], "preview": "button.svg" }, - "version": "1.2.0", + "version": "1.3.0", "keywords": [ "web-components", "html" @@ -60,9 +60,9 @@ ], "license": "MIT", "dependencies": { - "@patternfly/pfelement": "^1.2.0" + "@patternfly/pfelement": "^1.3.0" }, "devDependencies": { - "@patternfly/pfe-sass": "^1.2.0" + "@patternfly/pfe-sass": "^1.3.0" } } diff --git a/elements/pfe-card/dist/pfe-card--lightdom.css b/elements/pfe-card/dist/pfe-card--lightdom.css new file mode 100644 index 0000000000..bac8a70bdc --- /dev/null +++ b/elements/pfe-card/dist/pfe-card--lightdom.css @@ -0,0 +1,8 @@ +@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { + /* IE10+ */ + pfe-card img[overflow] { + max-width: 100%; + } +} + +/*# sourceMappingURL=pfe-card--lightdom.css.map */ diff --git a/elements/pfe-card/dist/pfe-card--lightdom.css.map b/elements/pfe-card/dist/pfe-card--lightdom.css.map new file mode 100644 index 0000000000..40033769e4 --- /dev/null +++ b/elements/pfe-card/dist/pfe-card--lightdom.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../pfe-sass/mixins/_mixins.scss","pfe-card--lightdom.scss","pfe-card--lightdom.css"],"names":[],"mappings":"AAGM;EAAsF,UAAA;ECCxF;IACI,eAAe;ECDrB;AACF","file":"pfe-card--lightdom.css","sourcesContent":["@mixin browser-query($browser-list) {\n @each $browser in $browser-list {\n @if $browser == ie11 {\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n @content;\n }\n }\n @if $browser == edge12 {\n @supports (-ms-accelerator: true) { /* Microsoft Edge Browser 12+ */\n @content;\n }\n }\n @if $browser == edge {\n @supports (-ms-ime-align: auto) { /* Microsoft Edge Browser 16+ (All) */\n @content;\n }\n }\n @if $browser == firefox {\n @media all and (min--moz-device-pixel-ratio:0) { /* Mozilla Firefox (All) */\n @content;\n }\n }\n }\n}\n\n@mixin pfe-transition($properties...) {\n $return: null;\n @each $property in $properties {\n @if length($property) == 1 {\n $return: append($return, #{$property} 250ms $pfe-global--animation-timing, comma);\n }\n @else if length($property) == 2 {\n $return: append($return, nth($property, 1) nth($property, 2), comma);\n }\n }\n transition: $return;\n}\n\n// Make a CSS arrow\n@mixin pfe-arrow($type, $color, $width: 8px, $height: 5px, $pseudo: false) {\n $direction: (\n up: 180deg,\n down: 0deg,\n right: -90deg,\n left: 90deg,\n );\n border-style: pfe-var(surface--border-style);\n border-width: $width $height 0;\n border-color: transparent;\n border-top-color: $color;\n transform: rotate(map-get($direction, $type));\n @if $pseudo {\n display: inline-block;\n content: \"\";\n @content;\n }\n}\n\n@mixin pfe-arrow-color($color) {\n border-top-color: $color;\n}\n\n@mixin pfe-print-media {\n @media print {\n @content;\n }\n}\n\n@mixin pfe-print-background {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n@mixin pfe-no-print-background {\n @include pfe-print-media {\n background-color: white !important;\n background-image: none !important;\n box-shadow: none !important;\n }\n}\n\n@mixin pfe-hidden {\n @at-root #{&}([hidden]) {\n display: none;\n }\n}\n\n@mixin pfe-pipe( $position: right, $padding: 0, $margin: 0, $color: $border-color) {\n border: pfe-var(surface--border-width) pfe-var(surface--border-style) transparent;\n border-#{$position}-color: $color;\n @if $position == right {\n padding-left: $padding;\n margin-right: $margin;\n }\n @else if $position == left {\n padding-right: $padding;\n margin-left: $margin;\n }\n}\n\n@mixin pfe-retina {\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n @content;\n }\n}\n\n@mixin pfe-icon($path, $display: flex, $size: 1em) {\n display: #{$display};\n @if $path {\n background: #{$path} no-repeat;\n background-size: contain;\n background-position: center;\n }\n width: #{$size};\n height: #{$size};\n @content;\n}\n\n@mixin pfe-local-debug($map: $LOCAL-VARIABLES) {\n :root {\n @include pfe-print-local($map);\n }\n} ","@import \"../../pfe-sass/pfe-sass\";\n$LOCAL: card;\n\n@include browser-query(ie11) {\n pfe-card img[overflow] {\n max-width: 100%;\n }\n}\n","@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n /* IE10+ */\n pfe-card img[overflow] {\n max-width: 100%;\n }\n}\n"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-card/dist/pfe-card--lightdom.min.css b/elements/pfe-card/dist/pfe-card--lightdom.min.css new file mode 100644 index 0000000000..453952fbe0 --- /dev/null +++ b/elements/pfe-card/dist/pfe-card--lightdom.min.css @@ -0,0 +1,2 @@ +@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){pfe-card img[overflow]{max-width:100%}} +/*# sourceMappingURL=pfe-card--lightdom.min.css.map */ diff --git a/elements/pfe-card/dist/pfe-card--lightdom.min.css.map b/elements/pfe-card/dist/pfe-card--lightdom.min.css.map new file mode 100644 index 0000000000..afbc18e81c --- /dev/null +++ b/elements/pfe-card/dist/pfe-card--lightdom.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../pfe-sass/mixins/_mixins.scss","../../src/pfe-card--lightdom.scss"],"names":[],"mappings":"AAGM,6CAAA,oCCCF,uBACI,UAAA","file":"pfe-card--lightdom.min.css","sourceRoot":"../src","sourcesContent":[]} \ No newline at end of file diff --git a/elements/pfe-card/dist/pfe-card.css.map b/elements/pfe-card/dist/pfe-card.css.map new file mode 100644 index 0000000000..e2393b7c31 --- /dev/null +++ b/elements/pfe-card/dist/pfe-card.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../pfe-sass/mixins/_mixins.scss","../../pfe-sass/mixins/_custom-properties.scss","../../pfe-sass/extends/_extends.scss","pfe-card.css","pfe-card.scss","../../pfe-sass/functions/_custom-properties.scss","../../pfe-sass/maps/_general.scss","../../../node_modules/@patternfly/patternfly/sass-utilities/colors.scss"],"names":[],"mappings":"AAGM;EC6IF;ID7IwF,UAAA;IE4CxF,iCAAyD;IACzD,yBAAiC;EC3CnC;AACF;;AHHM;ECyLF;IDzLwF,UAAA;IEoDxF,yBAAiC;EC3CnC;AACF;;ACwCA;EACE,2FAAU;EAGV,oBAAa;EAAb,qBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,4BAAsB;EAAtB,6BAAsB;EAAtB,8BAAsB;MAAtB,0BAAsB;UAAtB,sBAAsB;EACtB,yBAAyB;EAEzB,2BAAmB;MAAnB,4BAAmB;cAAnB,2BAAmB;UAAnB,mBAAmB;EAEnB,oECgBkC;EDhBlC,wWCgBkC;EDflC,uBCekC;EDflC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I;EACE,aAAa;ADiEnB;;AC9DE;EAEE,mBCtMgC;EDsMhC,qHCtMgC;AFsQpC;;AClEG;EASK,aAAa;AD6DrB;;ACtEG;EASK,aAAa;ADiErB;;AC1EG;EASK,aAAa;ADqErB;;AC9EG;EASK,aAAa;ADyErB;;AClFG;EASK,aAAa;AD6ErB;;ACtFG;EASK,aAAa;ADiFrB;;AC1FG;EASK,aAAa;ADqFrB","file":"pfe-card.css","sourcesContent":["@mixin browser-query($browser-list) {\n @each $browser in $browser-list {\n @if $browser == ie11 {\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n @content;\n }\n }\n @if $browser == edge12 {\n @supports (-ms-accelerator: true) { /* Microsoft Edge Browser 12+ */\n @content;\n }\n }\n @if $browser == edge {\n @supports (-ms-ime-align: auto) { /* Microsoft Edge Browser 16+ (All) */\n @content;\n }\n }\n @if $browser == firefox {\n @media all and (min--moz-device-pixel-ratio:0) { /* Mozilla Firefox (All) */\n @content;\n }\n }\n }\n}\n\n@mixin pfe-transition($properties...) {\n $return: null;\n @each $property in $properties {\n @if length($property) == 1 {\n $return: append($return, #{$property} 250ms $pfe-global--animation-timing, comma);\n }\n @else if length($property) == 2 {\n $return: append($return, nth($property, 1) nth($property, 2), comma);\n }\n }\n transition: $return;\n}\n\n// Make a CSS arrow\n@mixin pfe-arrow($type, $color, $width: 8px, $height: 5px, $pseudo: false) {\n $direction: (\n up: 180deg,\n down: 0deg,\n right: -90deg,\n left: 90deg,\n );\n border-style: pfe-var(surface--border-style);\n border-width: $width $height 0;\n border-color: transparent;\n border-top-color: $color;\n transform: rotate(map-get($direction, $type));\n @if $pseudo {\n display: inline-block;\n content: \"\";\n @content;\n }\n}\n\n@mixin pfe-arrow-color($color) {\n border-top-color: $color;\n}\n\n@mixin pfe-print-media {\n @media print {\n @content;\n }\n}\n\n@mixin pfe-print-background {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n@mixin pfe-no-print-background {\n @include pfe-print-media {\n background-color: white !important;\n background-image: none !important;\n box-shadow: none !important;\n }\n}\n\n@mixin pfe-hidden {\n @at-root #{&}([hidden]) {\n display: none;\n }\n}\n\n@mixin pfe-pipe( $position: right, $padding: 0, $margin: 0, $color: $border-color) {\n border: pfe-var(surface--border-width) pfe-var(surface--border-style) transparent;\n border-#{$position}-color: $color;\n @if $position == right {\n padding-left: $padding;\n margin-right: $margin;\n }\n @else if $position == left {\n padding-right: $padding;\n margin-left: $margin;\n }\n}\n\n@mixin pfe-retina {\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n @content;\n }\n}\n\n@mixin pfe-icon($path, $display: flex, $size: 1em) {\n display: #{$display};\n @if $path {\n background: #{$path} no-repeat;\n background-size: contain;\n background-position: center;\n }\n width: #{$size};\n height: #{$size};\n @content;\n}\n\n@mixin pfe-local-debug($map: $LOCAL-VARIABLES) {\n :root {\n @include pfe-print-local($map);\n }\n} ","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// This will print all the broadcast variables, and set the value to the context of your choosing, like on-dark or on-saturated.\n/// @param {String} $context - Look up values from contexts, i.e. \"light\" or \"saturated\"\n/// @param {List | String} $broadcast [$BROADCAST-VARS] - Optionally specify only one broadcast variable instead of the whole set, i.e. \"text\"\n/// @see $custom-prop-prefix\n/// @see $BROADCAST-VARS\n/// @example - scss - Usage in a container component, i.e. pfe-card\n/// :host {\n/// @include pfe-set-broadcast-context(dark);\n/// }\n/// @example - css - Rendered output\n/// :host {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n///\n@mixin pfe-set-broadcast-context($context, $broadcast: $BROADCAST-VARS) {\n @each $type in $broadcast {\n $list: ();\n $string: \"\";\n $context_string: \"\";\n $state: \"\";\n\n @if str-starts-with($type, \"link\") {\n $list: append($list, \"#{$type}\");\n\n @each $s in (hover, focus, visited) {\n $state: \"--#{$s}\";\n $string: \"#{$type}#{$state}\";\n\n @if not index($list, $string) {\n $list: append($list, \"#{$type}#{$state}\");\n }\n }\n } @else {\n @if not index($list, $string) {\n $list: append($list, \"#{$type}\");\n }\n }\n\n @if index($CONTEXTS, $context) != null {\n @if $context != \"light\" {\n $context_string: \"--on-#{$context}\";\n }\n }\n\n @each $item in $list {\n @if not index($BROADCAST-VARS, $type) {\n @warn \"--#{$custom-prop-prefix}-broadcasted--#{$item} variable is not in the $BROADCAST-VARS list.\";\n } @else if not pfe-broadcasted(#{$item}#{$context_string}) {\n @warn \"#{$item}#{$context_string} value does not currently exist.\";\n } @else {\n @if index($CONTEXTS, $context) != null {\n --#{$custom-prop-prefix}-broadcasted--#{$item}: #{pfe-var(#{$item}#{$context_string})};\n } @else {\n @error \"The #{$context} context does not appear to be part of a supported context.\";\n }\n }\n }\n }\n}\n\n/// Returns CSS Variable for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $value - The value of the css variable being defined\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example - scss\n/// :host {\n/// padding-top: pfe-local(paddingTop);\n/// padding-bottom: pfe-local(paddingBottom);\n/// }\n@mixin pfe-print-local($map: $LOCAL-VARIABLES) {\n @each $property, $value in $map {\n $name: \"--#{$property}\";\n $styles: $value;\n\n @if type-of($value) == \"map\" {\n @each $prop, $v in $value {\n $name: \"__#{$property}--#{$prop}\";\n $styles: $v;\n\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n } @else {\n // Print the variable definition\n --#{$custom-prop-prefix}-#{$LOCAL}#{$name}: #{$styles};\n }\n }\n}\n\n/// Surface properties\n/// This mixin creates an attribute for all the surface colors, then prints the local background color variable for the component, with the correct context colors.\n/// @param {List | String} $surfaces [$SURFACES] - defaults to the global $SURFACES list of all supported colors\n/// @param {String} $attr-name [pfe-var] - defaults to pfe-var, optionally pass in a custom name for the data attribute\n/// @example - scss - In your component stylesheet\n/// $LOCAL: band;\n/// @include pfe-surfaces;\n/// @example - css - Rendered result\n/// :host([color=\"darker\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darker, #464646);\n/// --context: dark;\n/// }\n/// :host([color=\"darkest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--darkest, #131313);\n/// --context: dark;\n/// }\n/// :host([color=\"base\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--base, #dfdfdf);\n/// --context: light;\n/// }\n/// :host([color=\"lighter\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lighter, #ececec);\n/// --context: light;\n/// }\n/// :host([color=\"lightest\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n/// --context: light;\n/// }\n/// :host([color=\"accent\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--accent, #ee0000);\n/// --context: saturated;\n/// }\n/// :host([color=\"complement\"]) {\n/// --pfe-band--BackgroundColor: var(--pfe-theme--color--surface--complement, #0477a4);\n/// --context: saturated;\n/// }\n@mixin pfe-surfaces($surfaces: $SURFACE, $attr-name: color) {\n @each $color in $surfaces {\n $context: #{pfe-get-context(surface--#{$color}--context)};\n :host([#{$attr-name}=\"#{$color}\"]) {\n @include pfe-print-local(\n (\n BackgroundColor: pfe-var(surface--#{$color}),\n context: pfe-var(surface--#{$color}--context, #{$context})\n )\n );\n @extend %fallback-surface;\n }\n }\n}\n\n/// Prints the `on` attribute with IE11 fallbacks\n/// @param {List} contexts [$CONTEXTS] - defaults to the global $CONTEXTS list of all supported contexts\n/// @param {Boolean} ie-fallback [true] - defaults to true, prints IE11 fallbacks\n/// @example - scss - In your component styles\n/// @include pfe-contexts; // imports on=\"light\" etc support\n/// @example - css - Rendered outputs\n/// :host([on=\"dark\"]) {\n/// --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n/// --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #99ccff);\n/// --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #cce6ff);\n/// --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #b38cd9);\n/// --pfe-broadcasted--link-decoration: none;\n/// --pfe-broadcasted--link-decoration--hover: underline;\n/// --pfe-broadcasted--link-decoration--focus: underline;\n/// --pfe-broadcasted--link-decoration--visited: none;\n/// }\n/// @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n/// :host([on=\"dark\"]) {\n/// color: #fff;\n/// color: var(--pfe-theme--color--text--on-dark, #fff);\n/// }\n/// }\n/// // ...as well as all the values for :host([on=\"saturated\"]) and :host([on=\"light\"])\n@mixin pfe-contexts($contexts: $CONTEXTS, $ie-fallback: true) {\n // Helper attributes to aid in theming\n @each $context in $contexts {\n :host([on=\"#{$context}\"]) {\n @include pfe-set-broadcast-context($context);\n }\n }\n @if $ie-fallback {\n :host {\n @extend %fallback-text;\n }\n }\n}\n","// @todo Change to mixins; no efficiency gain with placeholders in web components\n\n/// Clear box element styles\n%reset-box {\n margin: 0;\n padding: 0;\n}\n\n/// Clear list styles\n%reset-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/// Clear button styles\n%reset-button {\n background-color: transparent;\n border: none;\n margin: 0;\n padding: 0;\n text-align: left;\n}\n\n/// Set up a container element\n%container {\n position: relative;\n display: block;\n width: 100%;\n padding: pfe-var(container-spacer);\n}\n\n/// Screen-reader only content\n%sr-only {\n position: absolute;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n}\n\n/// Fallback surface styles for IE11 only\n%fallback-surface {\n @include browser-query(ie11) {\n background-color: pfe-fetch(surface--lightest) !important;\n color: pfe-fetch(text) !important;\n }\n}\n\n/// Fallback text styles for IE11 only\n%fallback-text {\n @include browser-query(ie11) {\n color: pfe-fetch(text) !important;\n }\n}\n","@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host([color=\"darker\"]), :host([color=\"darkest\"]), :host([color=\"base\"]), :host([color=\"lighter\"]), :host([color=\"lightest\"]), :host([color=\"accent\"]), :host([color=\"complement\"]) {\n /* IE10+ */\n background-color: #fff !important;\n color: #151515 !important;\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n color: #151515 !important;\n }\n}\n\n:host {\n --context: var(--pfe-card--context, var(--pfe-theme--color--surface--base--context, light));\n display: flex;\n flex-direction: column;\n justify-items: flex-start;\n align-self: stretch;\n padding: var(--pfe-card--Padding, var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2)));\n border: var(--pfe-card--Border, var(--pfe-card--BorderWidth, 0) var(--pfe-card--BorderStyle, solid) var(--pfe-card--BorderColor, var(--pfe-theme--color--surface--border, #d2d2d2)));\n border-radius: var(--pfe-card--BorderRadius, var(--pfe-theme--surface--border-radius, 3px));\n overflow: hidden;\n background-color: var(--pfe-card--BackgroundColor, var(--pfe-theme--color--surface--base, #f0f0f0));\n background-position: var(--pfe-card--BackgroundPosition, center center);\n color: var(--pfe-broadcasted--text, #3c3f42);\n}\n\n@media print {\n :host {\n background-color: white !important;\n background-image: none !important;\n box-shadow: none !important;\n }\n}\n\n@media print {\n :host {\n border-radius: 3px;\n border: 1px solid #d2d2d2;\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n background-color: var(--pfe-theme--color--surface--lightest, #fff) !important;\n color: var(--pfe-theme--color--text, #151515) !important;\n background-image: none !important;\n border-radius: 3px;\n border: 1px solid #d2d2d2;\n padding: var(--pfe-theme--container-spacer, 1rem);\n }\n}\n\n:host([color=\"darker\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--darker, #3c3f42);\n --pfe-card--context: var(--pfe-theme--color--surface--darker--context, dark);\n}\n\n:host([color=\"darkest\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--darkest, #151515);\n --pfe-card--context: var(--pfe-theme--color--surface--darkest--context, dark);\n}\n\n:host([color=\"base\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--base, #f0f0f0);\n --pfe-card--context: var(--pfe-theme--color--surface--base--context, light);\n}\n\n:host([color=\"lighter\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--lighter, #f0f0f0);\n --pfe-card--context: var(--pfe-theme--color--surface--lighter--context, light);\n}\n\n:host([color=\"lightest\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n --pfe-card--context: var(--pfe-theme--color--surface--lightest--context, light);\n}\n\n:host([color=\"accent\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--accent, #004080);\n --pfe-card--context: var(--pfe-theme--color--surface--accent--context, saturated);\n}\n\n:host([color=\"complement\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--complement, #002952);\n --pfe-card--context: var(--pfe-theme--color--surface--complement--context, saturated);\n}\n\n:host([on=\"dark\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #73bcf7);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #bee1f4);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #bee1f4);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #bee1f4);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-dark, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-dark, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-dark, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-dark, none);\n}\n\n:host([on=\"saturated\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-saturated, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-saturated, #fff);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-saturated, #fafafa);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-saturated, #fafafa);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-saturated, #d2d2d2);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-saturated, underline);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-saturated, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-saturated, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-saturated, underline);\n}\n\n:host([on=\"light\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text, #151515);\n --pfe-broadcasted--link: var(--pfe-theme--color--link, #06c);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover, #004080);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus, #004080);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited, #6753ac);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited, none);\n}\n\n:host([size=\"small\"]) {\n --pfe-card--PaddingTop: var(--pfe-theme--container-spacer, 1rem);\n --pfe-card--PaddingRight: var(--pfe-theme--container-spacer, 1rem);\n --pfe-card--PaddingBottom: var(--pfe-theme--container-spacer, 1rem);\n --pfe-card--PaddingLeft: var(--pfe-theme--container-spacer, 1rem);\n}\n\n:host([border]:not([border=\"false\"])) {\n --pfe-card--BorderWidth: 1px;\n}\n\n.pfe-card__header ::slotted([overflow~=\"top\"]),\n.pfe-card__header ::slotted([overflow~=\"top\"]), .pfe-card__body ::slotted([overflow~=\"top\"]),\n.pfe-card__body ::slotted([overflow~=\"top\"]), .pfe-card__footer ::slotted([overflow~=\"top\"]),\n.pfe-card__footer ::slotted([overflow~=\"top\"]) {\n z-index: 1;\n margin-top: -2rem;\n margin-top: calc(-1 * var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2))) !important;\n}\n\n:host([has_header]) .pfe-card__header ::slotted([overflow~=\"top\"]), :host([has_header])\n.pfe-card__header ::slotted([overflow~=\"top\"]), :host([has_header]) .pfe-card__body ::slotted([overflow~=\"top\"]), :host([has_header])\n.pfe-card__body ::slotted([overflow~=\"top\"]), :host([has_header]) .pfe-card__footer ::slotted([overflow~=\"top\"]), :host([has_header])\n.pfe-card__footer ::slotted([overflow~=\"top\"]) {\n padding-top: var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem));\n}\n\n.pfe-card__header ::slotted([overflow~=\"right\"]),\n.pfe-card__header ::slotted([overflow~=\"right\"]), .pfe-card__body ::slotted([overflow~=\"right\"]),\n.pfe-card__body ::slotted([overflow~=\"right\"]), .pfe-card__footer ::slotted([overflow~=\"right\"]),\n.pfe-card__footer ::slotted([overflow~=\"right\"]) {\n margin-right: -2rem;\n margin-right: calc(-1 * var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2)));\n}\n\n.pfe-card__header ::slotted([overflow~=\"bottom\"]),\n.pfe-card__header ::slotted([overflow~=\"bottom\"]), .pfe-card__body ::slotted([overflow~=\"bottom\"]),\n.pfe-card__body ::slotted([overflow~=\"bottom\"]), .pfe-card__footer ::slotted([overflow~=\"bottom\"]),\n.pfe-card__footer ::slotted([overflow~=\"bottom\"]) {\n margin-bottom: -2rem;\n margin-bottom: calc(-1 * calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) + var(--pfe-card--BorderRadius, var(--pfe-theme--surface--border-radius, 3px))));\n align-self: flex-end;\n}\n\n.pfe-card__header ::slotted([overflow~=\"left\"]),\n.pfe-card__header ::slotted([overflow~=\"left\"]), .pfe-card__body ::slotted([overflow~=\"left\"]),\n.pfe-card__body ::slotted([overflow~=\"left\"]), .pfe-card__footer ::slotted([overflow~=\"left\"]),\n.pfe-card__footer ::slotted([overflow~=\"left\"]) {\n margin-left: -2rem;\n margin-left: calc(-1 * var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2)));\n}\n\n.pfe-card__header ::slotted(img), .pfe-card__body ::slotted(img), .pfe-card__footer ::slotted(img) {\n max-width: 100% !important;\n align-self: flex-start;\n object-fit: cover;\n}\n\n.pfe-card__header ::slotted(img:not[overflow]),\n.pfe-card__header ::slotted(img:not[overflow]), .pfe-card__body ::slotted(img:not[overflow]),\n.pfe-card__body ::slotted(img:not[overflow]), .pfe-card__footer ::slotted(img:not[overflow]),\n.pfe-card__footer ::slotted(img:not[overflow]) {\n align-self: flex-start;\n}\n\n.pfe-card__header ::slotted(img[overflow]),\n.pfe-card__header ::slotted(img[overflow]), .pfe-card__body ::slotted(img[overflow]),\n.pfe-card__body ::slotted(img[overflow]), .pfe-card__footer ::slotted(img[overflow]),\n.pfe-card__footer ::slotted(img[overflow]) {\n max-width: unset !important;\n}\n\n.pfe-card__header ::slotted(img[overflow~=\"right\"]),\n.pfe-card__header ::slotted(img[overflow~=\"right\"]), .pfe-card__body ::slotted(img[overflow~=\"right\"]),\n.pfe-card__body ::slotted(img[overflow~=\"right\"]), .pfe-card__footer ::slotted(img[overflow~=\"right\"]),\n.pfe-card__footer ::slotted(img[overflow~=\"right\"]) {\n width: calc(100% + 2rem) !important;\n width: calc(100% + var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2))) !important;\n}\n\n.pfe-card__header ::slotted(img[overflow~=\"left\"]),\n.pfe-card__header ::slotted(img[overflow~=\"left\"]), .pfe-card__body ::slotted(img[overflow~=\"left\"]),\n.pfe-card__body ::slotted(img[overflow~=\"left\"]), .pfe-card__footer ::slotted(img[overflow~=\"left\"]),\n.pfe-card__footer ::slotted(img[overflow~=\"left\"]) {\n width: calc(100% + 2rem) !important;\n width: calc(100% + var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2))) !important;\n}\n\n.pfe-card__header ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]),\n.pfe-card__header ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]), .pfe-card__body ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]),\n.pfe-card__body ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]), .pfe-card__footer ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]),\n.pfe-card__footer ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]) {\n width: calc(100% + 4rem) !important;\n width: calc(100% + var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) + var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2))) !important;\n}\n\n.pfe-card__header {\n z-index: 2;\n background-color: var(--pfe-card__header--BackgroundColor, rgba(0, 0, 0, var(--pfe-theme--opacity, 0.09)));\n color: var(--pfe-card__header--Color, var(--pfe-broadcasted--text, #3c3f42));\n margin-top: calc(var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1) !important;\n margin-right: calc(var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n margin-bottom: var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem)));\n margin-left: calc(var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n padding-top: var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem)));\n padding-right: var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2));\n padding-left: var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2));\n padding-bottom: var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem)));\n}\n\n:host([on=\"dark\"]) .pfe-card__header {\n background-color: var(--pfe-card__header--BackgroundColor--dark, rgba(255, 255, 255, var(--pfe-theme--opacity, 0.09)));\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n .pfe-card__header {\n /* IE10+ */\n background-color: #fff !important;\n color: #151515 !important;\n }\n}\n\n:host(:not([has_body]):not([has_footer])) .pfe-card__header {\n margin-bottom: var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2));\n}\n\n.pfe-card__header ::slotted([overflow~=\"top\"]),\n.pfe-card__header ::slotted([overflow~=\"top\"]) {\n --pfe-card__overflow--MarginTop: calc(var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n}\n\n:host(:not([has_header])) .pfe-card__header {\n display: none;\n}\n\n:host([has_body], [has_footer]) .pfe-card__header ::slotted([overflow~=\"bottom\"]),\n:host([has_body], [has_footer]) .pfe-card__header ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem))) * -1);\n}\n\n.pfe-card__header ::slotted([overflow~=\"bottom\"]),\n.pfe-card__header ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n}\n\n.pfe-card__header ::slotted(h1) {\n margin-bottom: 0;\n}\n\n.pfe-card__header ::slotted(h2) {\n margin-bottom: 0;\n}\n\n.pfe-card__header ::slotted(h3) {\n margin-bottom: 0;\n}\n\n.pfe-card__header ::slotted(h4) {\n margin-bottom: 0;\n}\n\n.pfe-card__header ::slotted(h5) {\n margin-bottom: 0;\n}\n\n.pfe-card__header ::slotted(h6) {\n margin-bottom: 0;\n}\n\n:host(:not([has_header])) .pfe-card__body ::slotted([overflow~=\"top\"]),\n:host(:not([has_header])) .pfe-card__body ::slotted([overflow~=\"top\"]) {\n --pfe-card__overflow--MarginTop: calc(var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n}\n\n.pfe-card__body ::slotted([overflow~=\"top\"]),\n.pfe-card__body ::slotted([overflow~=\"top\"]) {\n z-index: 1;\n --pfe-card__overflow--MarginTop: calc(var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem))) * -1);\n}\n\n.pfe-card__body ::slotted([overflow~=\"bottom\"]),\n.pfe-card__body ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n}\n\n:host([has_footer]) .pfe-card__body ::slotted([overflow~=\"bottom\"]),\n:host([has_footer]) .pfe-card__body ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem))) * -1);\n}\n\n:host(:not([has_footer])) .pfe-card__body {\n margin-bottom: 0;\n}\n\n.pfe-card__footer {\n margin-top: auto;\n display: flex;\n flex-direction: var(--pfe-card__footer--Row, row);\n flex-wrap: var(--pfe-card__footer--Wrap, wrap);\n align-items: var(--pfe-card__footer--AlignItems, baseline);\n}\n\n.pfe-card__footer ::slotted([overflow~=\"bottom\"]),\n.pfe-card__footer ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n}\n\n:host(:not([has_footer])) .pfe-card__footer {\n display: none;\n}\n\n.pfe-card__header, .pfe-card__body {\n margin-bottom: var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem)));\n}\n\n.pfe-card__header ::slotted(p:first-child), .pfe-card__body ::slotted(p:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h1:first-child), .pfe-card__body ::slotted(h1:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h2:first-child), .pfe-card__body ::slotted(h2:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h3:first-child), .pfe-card__body ::slotted(h3:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h4:first-child), .pfe-card__body ::slotted(h4:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h5:first-child), .pfe-card__body ::slotted(h5:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h6:first-child), .pfe-card__body ::slotted(h6:first-child) {\n margin-top: 0;\n}\n","@import \"../../pfe-sass/pfe-sass\";\n\n$LOCAL: card;\n\n$LOCAL-VARIABLES: (\n // Individual padding overrides available\n PaddingTop: calc(#{pfe-var(container-spacer)} * 2),\n PaddingRight: calc(#{pfe-var(container-spacer)} * 2),\n PaddingBottom: calc(#{pfe-var(container-spacer)} * 2),\n PaddingLeft: calc(#{pfe-var(container-spacer)} * 2),\n\n //-- Border settings\n BorderRadius: pfe-var(surface--border-radius),\n\n //-- Color properties\n BackgroundColor: pfe-var(surface--base),\n context: pfe-var(surface--base--context),\n BackgroundPosition: center center,\n\n spacing: pfe-var(container-spacer),\n\n header: (\n BackgroundColor: rgba(0, 0, 0, pfe-var(opacity)),\n BackgroundColor--dark: rgba(255, 255, 255, pfe-var(opacity)),\n Color: pfe-broadcasted(text)\n ),\n\n footer: (\n spacing--horizontal: calc(#{pfe-var(container-spacer)} / 2)\n )\n\n);\n\n// Nested internal variables (pfe-local calls), maps cannot \"self-reference\"\n$LOCAL-VARIABLES: map-deep-merge($LOCAL-VARIABLES, (\n // Internal spacing; elements inside the card (header, body, footer regions)\n spacing--vertical: pfe-local(spacing),\n\n // Combine above variables or allow single override point via variable\n Padding: pfe-local(PaddingTop) pfe-local(PaddingRight) pfe-local(PaddingBottom) pfe-local(PaddingLeft),\n\n //-- Border variable encompasses width, style, and color\n Border: pfe-local(BorderWidth, 0) pfe-local(BorderStyle, solid) pfe-local(BorderColor, pfe-var(surface--border))\n));\n\n$size-small: (\n PaddingTop: pfe-var(container-spacer),\n PaddingRight: pfe-var(container-spacer),\n PaddingBottom: pfe-var(container-spacer),\n PaddingLeft: pfe-var(container-spacer)\n);\n\n\n:host {\n --context: #{pfe-local(context)};\n\n // Start of style declarations for host element\n display: flex;\n flex-direction: column;\n justify-items: flex-start;\n // This allows the card to fill it's container if necessary\n align-self: stretch;\n\n padding: pfe-local(Padding);\n border: pfe-local(Border); // @TODO add automatic border when lightest card is on lightest background?\n border-radius: pfe-local(BorderRadius);\n\n // This property ensures that children in the slots do no overflow\n // the border-radius being set on the container\n overflow: hidden;\n\n // Base colors\n background-color: pfe-local(BackgroundColor);\n background-position: pfe-local(BackgroundPosition);\n color: pfe-broadcasted(text);\n\n // Remove background color for print\n @include pfe-no-print-background;\n\n // Add the border to the card for print\n @include pfe-print-media {\n border-radius: pfe-fetch(surface--border-radius);\n border: pfe-fetch(surface--border-width) pfe-fetch(surface--border-style) pfe-fetch(surface--border);\n }\n\n @include browser-query(ie11) {\n background-color: pfe-var(surface--lightest) !important;\n color: pfe-var(text) !important;\n background-image: none !important;\n border-radius: pfe-fetch(surface--border-radius);\n border: pfe-fetch(surface--border-width) pfe-fetch(surface--border-style) pfe-fetch(surface--border);\n padding: pfe-var(container-spacer);\n }\n}\n\n// Pull in pfe-var settings for all supported surface colors\n@include pfe-surfaces;\n\n@include pfe-contexts; // imports on=\"light\" etc support\n\n:host([size=\"small\"]) {\n @include pfe-print-local($size-small);\n}\n\n:host([border]:not([border=\"false\"])) {\n --pfe-card--BorderWidth: #{pfe-fetch(surface--border-width)};\n}\n\n// Targets the wrappers in the shadow DOM\n.pfe-card {\n &__header,\n &__body,\n &__footer {\n ::slotted([overflow~=\"top\"]),\n ::slotted([overflow~=\"top\"]) {\n z-index: 1;\n margin-top: -2rem; //IE11 fallback\n margin-top: calc(-1 * #{pfe-local(PaddingTop)}) !important;\n :host([has_header]) & {\n padding-top: pfe-local(spacing);\n }\n }\n\n ::slotted([overflow~=\"right\"]),\n ::slotted([overflow~=\"right\"]) {\n margin-right: -2rem; //IE11 fallback\n margin-right: calc(-1 * #{pfe-local(PaddingRight)});\n }\n\n ::slotted([overflow~=\"bottom\"]),\n ::slotted([overflow~=\"bottom\"]) {\n margin-bottom: -2rem; //IE11 fallback\n margin-bottom: calc(-1 * calc(#{pfe-local(PaddingBottom)} + #{pfe-local(BorderRadius)}));\n align-self: flex-end;\n }\n\n ::slotted([overflow~=\"left\"]),\n ::slotted([overflow~=\"left\"]) {\n margin-left: -2rem; //IE11 fallback\n margin-left: calc(-1 * #{pfe-local(PaddingLeft)});\n }\n\n ::slotted(img) {\n max-width: 100% !important;\n align-self: flex-start; //Don't stretch image 100% with other Flexbox items in card.\n object-fit: cover; // Fix distortion\n }\n\n ::slotted(img:not[overflow]),\n ::slotted(img:not[overflow]) {\n align-self: flex-start; //Don't stretch image 100% with other Flexbox items in card.\n }\n\n ::slotted(img[overflow]),\n ::slotted(img[overflow]) {\n max-width: unset !important;\n }\n\n ::slotted(img[overflow~=\"right\"]),\n ::slotted(img[overflow~=\"right\"]) {\n width: calc(100% + 2rem) !important; //IE11 fallback\n width: calc(100% + #{pfe-local(PaddingRight)}) !important;\n }\n\n ::slotted(img[overflow~=\"left\"]),\n ::slotted(img[overflow~=\"left\"]) {\n width: calc(100% + 2rem) !important; //IE11 fallback\n width: calc(100% + #{pfe-local(PaddingLeft)}) !important;\n }\n\n ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]),\n ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]) {\n width: calc(100% + 4rem) !important; //IE11 fallback\n width: calc(100% + #{pfe-local(PaddingRight)} + #{pfe-local(PaddingLeft)}) !important;\n }\n }\n &__header {\n z-index: 2;\n // Declare the header background color\n background-color: pfe-local(BackgroundColor, $region: header);\n color: pfe-local($cssvar: Color, $region: header);\n :host([on=\"dark\"]) & {\n // Declare the header background color\n background-color: pfe-local(BackgroundColor--dark, $region: header);\n }\n @include browser-query(ie11) {\n background-color: pfe-fetch(surface--lightest) !important;\n color: pfe-fetch(text) !important;\n }\n\n // Margin styles on header region\n margin-top: calc(#{pfe-local(PaddingTop)} * -1) !important;\n margin-right: calc(#{pfe-local(PaddingRight)} * -1);\n margin-bottom: pfe-local(spacing--vertical);\n margin-left: calc(#{pfe-local(PaddingLeft)} * -1);\n\n // Padding for the header region\n padding-top: pfe-local(spacing--vertical);\n padding-right: pfe-local(PaddingRight);\n padding-left: pfe-local(PaddingLeft);\n padding-bottom: pfe-local(spacing--vertical);\n\n :host(:not([has_body],[has_footer])) & {\n margin-bottom: pfe-local(PaddingBottom);\n }\n\n ::slotted([overflow~=\"top\"]),\n ::slotted([overflow~=\"top\"]) {\n --pfe-card__overflow--MarginTop: calc(#{pfe-local(PaddingTop)} * -1);\n }\n\n :host(:not([has_header])) & {\n display: none;\n }\n\n :host([has_body],[has_footer]) & ::slotted([overflow~=\"bottom\"]),\n :host([has_body],[has_footer]) & ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(#{pfe-local(spacing--vertical)} * -1);\n }\n\n ::slotted([overflow~=\"bottom\"]),\n ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(#{pfe-local(PaddingBottom)} * -1);\n }\n\n @each $tag in (h1, h2, h3, h4, h5, h6) {\n ::slotted(#{$tag}) {\n margin-bottom: 0;\n }\n }\n }\n &__body {\n :host(:not([has_header])) & ::slotted([overflow~=\"top\"]),\n :host(:not([has_header])) & ::slotted([overflow~=\"top\"]) {\n --pfe-card__overflow--MarginTop: calc(#{pfe-local(PaddingTop)} * -1);\n }\n\n ::slotted([overflow~=\"top\"]),\n ::slotted([overflow~=\"top\"]) {\n z-index: 1;\n --pfe-card__overflow--MarginTop: calc(#{pfe-local(spacing--vertical)} * -1);\n }\n\n ::slotted([overflow~=\"bottom\"]),\n ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(#{pfe-local(PaddingBottom)} * -1);\n }\n\n :host([has_footer]) & ::slotted([overflow~=\"bottom\"]),\n :host([has_footer]) & ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(#{pfe-local(spacing--vertical)} * -1);\n }\n\n :host(:not([has_footer])) & {\n margin-bottom: 0;\n }\n }\n &__footer {\n margin-top: auto; // This allows the footer to move to the very bottom\n\n display: flex;\n flex-direction: pfe-local(Row, row, $region: footer);\n flex-wrap: pfe-local(Wrap, wrap, $region: footer);\n // Aligns buttons and CTAs\n align-items: pfe-local(AlignItems, baseline, $region: footer);\n\n ::slotted([overflow~=\"bottom\"]),\n ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(#{pfe-local(PaddingBottom)} * -1);\n }\n\n :host(:not([has_footer])) & {\n display: none;\n }\n }\n &__header,\n &__body {\n margin-bottom: pfe-local(spacing--vertical);\n\n //-- Slotted styles for typography\n // Remove margins from typography inside the slots\n @each $tag in (p, h1, h2, h3, h4, h5, h6) {\n ::slotted(#{$tag}:first-child) {\n // Remove top margins\n margin-top: 0;\n }\n }\n }\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}","@import \"@patternfly/patternfly/sass-utilities/scss-variables\";\n\n////\n/// @group maps\n/// @type Map\n////\n\n/// Variables for typography, spacing, sizing\n$pfe-vars: (\n\n container-spacer: pf-font-prem($pf-spacer), // 16px\n container-padding: pf-font-prem($pf-spacer), // 16px\n content-spacer: pf-font-prem($pf-spacer-sm), // 24px\n\n content-spacer--heading--lg: pf-font-prem($pf-spacer-md), // 32px \n content-spacer--heading--md: pf-font-prem($pf-spacer-sm), // 24px \n content-spacer--heading--sm: pf-font-prem($pf-spacer), // 16px\n content-spacer--body--md: pf-font-prem($pf-spacer), // 16px\n content-spacer--body--sm: pf-font-prem($pf-spacer-xs), // 8px\n\n surface--border-width: 1px, //\n surface--border-width--heavy: 4px, //\n surface--border-style: solid, //\n surface--border-radius: 3px, //\n surface--border-width--active: 3px, //\n\n icon-size: 1em, //\n\n ui--element--size: 20px, //\n ui--indent: 20px, //\n ui--border-width--sm: 1px, //\n ui--border-width--md: 2px, //\n ui--border-width--lg: 3px, //\n\n ui--border-width: 1px, //\n ui--border-width--active: 3px, //\n \n ui--border-style: solid, //\n ui--border-radius: 2px, //\n\n ui--focus-outline-width: 1px, //\n ui--focus-outline-style: solid, //\n\n grid-breakpoint--xs: 0, //\n grid-breakpoint--sm: 576px, //\n grid-breakpoint--md: 768px, //\n grid-breakpoint--lg: 992px, //\n grid-breakpoint--xl: 1200px, //\n\n box-shadow--sm: #{0 #{pfe-size-prem(1)} #{pfe-size-prem(2)} 0 rgba($pf-color-black-1000, .2)}, //\n box-shadow--md: #{0 #{pfe-size-prem(2)} #{pfe-size-prem(1)} #{pfe-size-prem(1)} rgba($pf-color-black-1000, .12), 0 #{pfe-size-prem(4)} #{pfe-size-prem(11)} #{pfe-size-prem(6)} rgba($pf-color-black-1000, .05)}, //\n box-shadow--lg: #{0 #{pfe-size-prem(3)} #{pfe-size-prem(7)} #{pfe-size-prem(3)} rgba($pf-color-black-1000, .13), 0 #{pfe-size-prem(11)} #{pfe-size-prem(24)} #{pfe-size-prem(16)} rgba($pf-color-black-1000, .12)}, //\n box-shadow--inset: #{inset 0 0 #{pfe-size-prem(10)} 0 $pf-color-black-100}, //\n\n animation-speed: .3s, //\n animation-timing: cubic-bezier(0.465, 0.183, 0.153, 0.946), //\n opacity: .09 //\n);","// Colors\n$pf-color-black-100: #fafafa !default;\n$pf-color-black-150: #f5f5f5 !default;\n$pf-color-black-200: #f0f0f0 !default;\n$pf-color-black-300: #d2d2d2 !default;\n$pf-color-black-400: #b8bbbe !default;\n$pf-color-black-500: #8a8d90 !default;\n$pf-color-black-600: #6a6e73 !default;\n$pf-color-black-700: #4f5255 !default;\n$pf-color-black-800: #3c3f42 !default;\n$pf-color-black-850: #212427 !default;\n$pf-color-black-900: #151515 !default;\n$pf-color-black-1000: #030303 !default;\n$pf-color-blue-50: #e7f1fa !default;\n$pf-color-blue-100: #bee1f4 !default;\n$pf-color-blue-200: #73bcf7 !default;\n$pf-color-blue-300: #2b9af3 !default;\n$pf-color-blue-400: #06c !default;\n$pf-color-blue-500: #004080 !default;\n$pf-color-blue-600: #002952 !default;\n$pf-color-blue-700: #001223 !default;\n$pf-color-cyan-50: #f2f9f9 !default;\n$pf-color-cyan-100: #a2d9d9 !default;\n$pf-color-cyan-200: #73c5c5 !default;\n$pf-color-cyan-300: #009596 !default;\n$pf-color-cyan-400: #005f60 !default;\n$pf-color-cyan-500: #003737 !default;\n$pf-color-cyan-600: #002323 !default;\n$pf-color-cyan-700: #000f0f !default;\n$pf-color-gold-50: #fdf7e7 !default;\n$pf-color-gold-100: #f9e0a2 !default;\n$pf-color-gold-200: #f6d173 !default;\n$pf-color-gold-300: #f4c145 !default;\n$pf-color-gold-400: #f0ab00 !default;\n$pf-color-gold-500: #c58c00 !default;\n$pf-color-gold-600: #795600 !default;\n$pf-color-gold-700: #3d2c00 !default;\n$pf-color-green-50: #f3faf2 !default;\n$pf-color-green-100: #bde5b8 !default;\n$pf-color-green-200: #95d58e !default;\n$pf-color-green-300: #6ec664 !default;\n$pf-color-green-400: #5ba352 !default;\n$pf-color-green-500: #3e8635 !default;\n$pf-color-green-600: #1e4f18 !default;\n$pf-color-green-700: #0f280d !default;\n$pf-color-light-blue-100: #beedf9 !default;\n$pf-color-light-blue-200: #7cdbf3 !default;\n$pf-color-light-blue-300: #35caed !default;\n$pf-color-light-blue-400: #00b9e4 !default;\n$pf-color-light-blue-500: #008bad !default;\n$pf-color-light-blue-600: #005c73 !default;\n$pf-color-light-blue-700: #002d39 !default;\n$pf-color-light-green-100: #e4f5bc !default;\n$pf-color-light-green-200: #c8eb79 !default;\n$pf-color-light-green-300: #ace12e !default;\n$pf-color-light-green-400: #92d400 !default;\n$pf-color-light-green-500: #6ca100 !default;\n$pf-color-light-green-600: #486b00 !default;\n$pf-color-light-green-700: #253600 !default;\n$pf-color-orange-100: #f4b678 !default;\n$pf-color-orange-200: #ef9234 !default;\n$pf-color-orange-300: #ec7a08 !default;\n$pf-color-orange-400: #c46100 !default;\n$pf-color-orange-500: #8f4700 !default;\n$pf-color-orange-600: #773d00 !default;\n$pf-color-orange-700: #3b1f00 !default;\n$pf-color-purple-50: #f2f0fc !default;\n$pf-color-purple-100: #cbc1ff !default;\n$pf-color-purple-200: #b2a3ff !default;\n$pf-color-purple-300: #a18fff !default;\n$pf-color-purple-400: #8476d1 !default;\n$pf-color-purple-500: #6753ac !default;\n$pf-color-purple-600: #40199a !default;\n$pf-color-purple-700: #1f0066 !default;\n$pf-color-red-50: #faeae8 !default;\n$pf-color-red-100: #c9190b !default;\n$pf-color-red-200: #a30000 !default;\n$pf-color-red-300: #7d1007 !default;\n$pf-color-red-400: #470000 !default;\n$pf-color-red-500: #2c0000 !default;\n$pf-color-white: #fff !default;\n"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-card/dist/pfe-card.js b/elements/pfe-card/dist/pfe-card.js new file mode 100644 index 0000000000..7f05394e6e --- /dev/null +++ b/elements/pfe-card/dist/pfe-card.js @@ -0,0 +1,204 @@ +import PFElement from '../../pfelement/dist/pfelement.js'; + +// @POLYFILL Element.matches +// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches +if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; +} + +// @POLYFILL Element.closest +// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest +if (!Element.prototype.closest) { + Element.prototype.closest = function(s) { + var el = this; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + return null; + }; +} + +/*! + * PatternFly Elements: PfeCard 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/ + +class PfeCard extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + +
    + +
    +
    + +
    +`; + } + + static get tag() { + return "pfe-card"; + } + + static get meta() { + return { + title: "Card", + description: + "This element creates a header, body, and footer region in which to place content or other components." + }; + } + + get templateUrl() { + return "pfe-card.html"; + } + + get styleUrl() { + return "pfe-card.scss"; + } + + // @TODO: How do we handle attributes for slotted content? + static get properties() { + return { + color: { + title: "Background color", + type: String, + values: ["lightest", "base", "darker", "darkest", "complement", "accent"], + default: "base", + observer: "_colorChanged" + }, + // @TODO: Deprecate property in 1.0 + oldColor: { + type: String, + prefix: false, + alias: "color", + attr: "pfe-color" + }, + imgSrc: { + title: "Background image", + type: String, + observer: "_imageSrcChanged" + }, + // @TODO: Deprecate property in 1.0 + pfeImgSrc: { + type: String, + prefix: false, + alias: "imgSrc" + }, + size: { + title: "Padding size", + type: String, + values: ["small"] + }, + // @TODO: Deprecate property in 1.0 + pfeSize: { + type: String, + values: ["small"], + prefix: false, + alias: "size" + }, + border: { + title: "Border", + type: Boolean + }, + // @TODO: Deprecate property in 1.0 + oldBorder: { + alias: "border", + attr: "pfe-border" + } + }; + } + + static get slots() { + return { + header: { + title: "Header", + type: "array", + namedSlot: true, + maxItems: 3, + items: { + $ref: "raw" + } + }, + body: { + title: "Body", + type: "array", + namedSlot: false, + items: { + $ref: "raw" + } + }, + footer: { + title: "Footer", + type: "array", + namedSlot: true, + maxItems: 3, + items: { + oneOf: [ + { + $ref: "pfe-cta" + }, + { + $ref: "raw" + } + ] + } + } + }; + } + + // Declare the type of this component + static get PfeType() { + return PFElement.PfeTypes.Container; + } + + constructor() { + super(PfeCard, { type: PfeCard.PfeType }); + } + + // If the color changes, update the context + _colorChanged() { + // Update the context + this.resetContext(); + } + + // Update the background image + _imageSrcChanged(oldValue, newValue) { + // Set the image as the background image + this.style.backgroundImage = newValue ? `url('${newValue}')` : ``; + } +} + +PFElement.create(PfeCard); + +export default PfeCard; +//# sourceMappingURL=pfe-card.js.map diff --git a/elements/pfe-card/dist/pfe-card.js.map b/elements/pfe-card/dist/pfe-card.js.map new file mode 100644 index 0000000000..5a42c608ca --- /dev/null +++ b/elements/pfe-card/dist/pfe-card.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-card.js","sources":["../_temp/polyfills--pfe-card.js","../_temp/pfe-card.js"],"sourcesContent":["// @POLYFILL Element.matches\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n// @POLYFILL Element.closest\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\nif (!Element.prototype.closest) {\n Element.prototype.closest = function(s) {\n var el = this;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n}\n","/*!\n * PatternFly Elements: PfeCard 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: matches, closest, includes\nimport \"./polyfills--pfe-card.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\nclass PfeCard extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n \n
    \n
    \n \n
    \n
    \n \n
    `;\n }\n\n static get tag() {\n return \"pfe-card\";\n }\n\n static get meta() {\n return {\n title: \"Card\",\n description:\n \"This element creates a header, body, and footer region in which to place content or other components.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-card.html\";\n }\n\n get styleUrl() {\n return \"pfe-card.scss\";\n }\n\n // @TODO: How do we handle attributes for slotted content?\n static get properties() {\n return {\n color: {\n title: \"Background color\",\n type: String,\n values: [\"lightest\", \"base\", \"darker\", \"darkest\", \"complement\", \"accent\"],\n default: \"base\",\n observer: \"_colorChanged\"\n },\n // @TODO: Deprecate property in 1.0\n oldColor: {\n type: String,\n prefix: false,\n alias: \"color\",\n attr: \"pfe-color\"\n },\n imgSrc: {\n title: \"Background image\",\n type: String,\n observer: \"_imageSrcChanged\"\n },\n // @TODO: Deprecate property in 1.0\n pfeImgSrc: {\n type: String,\n prefix: false,\n alias: \"imgSrc\"\n },\n size: {\n title: \"Padding size\",\n type: String,\n values: [\"small\"]\n },\n // @TODO: Deprecate property in 1.0\n pfeSize: {\n type: String,\n values: [\"small\"],\n prefix: false,\n alias: \"size\"\n },\n border: {\n title: \"Border\",\n type: Boolean\n },\n // @TODO: Deprecate property in 1.0\n oldBorder: {\n alias: \"border\",\n attr: \"pfe-border\"\n }\n };\n }\n\n static get slots() {\n return {\n header: {\n title: \"Header\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n $ref: \"raw\"\n }\n },\n body: {\n title: \"Body\",\n type: \"array\",\n namedSlot: false,\n items: {\n $ref: \"raw\"\n }\n },\n footer: {\n title: \"Footer\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n oneOf: [\n {\n $ref: \"pfe-cta\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n }\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n constructor() {\n super(PfeCard, { type: PfeCard.PfeType });\n }\n\n // If the color changes, update the context\n _colorChanged() {\n // Update the context\n this.resetContext();\n }\n\n // Update the background image\n _imageSrcChanged(oldValue, newValue) {\n // Set the image as the background image\n this.style.backgroundImage = newValue ? `url('${newValue}')` : ``;\n }\n}\n\nPFElement.create(PfeCard);\n\nexport { PfeCard as default };\n"],"names":[],"mappings":";;AAAA;AACA;AACA,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE;AAChC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,iBAAiB,IAAI,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC;AAC7G,CAAC;AACD;AACA;AACA;AACA,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE;AAChC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,EAAE;AAC1C,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC;AAClB,IAAI,GAAG;AACP,MAAM,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;AACnC,MAAM,EAAE,GAAG,EAAE,CAAC,aAAa,IAAI,EAAE,CAAC,UAAU,CAAC;AAC7C,KAAK,QAAQ,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC,QAAQ,KAAK,CAAC,EAAE;AAC/C,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AAKA;AACA,MAAM,OAAO,SAAS,SAAS,CAAC;AAChC;AACA;AACA,EAAE,WAAW,OAAO,GAAG;AACvB,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA;AACA,EAA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AU,KAAK,EAAE;AACjB,YAAY;AACZ,cAAc,IAAI,EAAE,SAAS;AAC7B,aAAa;AACb,YAAY;AACZ,cAAc,IAAI,EAAE,KAAK;AACzB,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH;AACA;AACA,EAAE,WAAW,OAAO,GAAG;AACvB,IAAI,OAAO,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC;AACxC,GAAG;AACH;AACA,EAAE,WAAW,GAAG;AAChB,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;AAC9C,GAAG;AACH;AACA;AACA,EAAE,aAAa,GAAG;AAClB;AACA,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;AACxB,GAAG;AACH;AACA;AACA,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE;AACvC;AACA,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,QAAQ,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACtE,GAAG;AACH,CAAC;AACD;AACA,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/elements/pfe-card/dist/pfe-card.min.css.map b/elements/pfe-card/dist/pfe-card.min.css.map new file mode 100644 index 0000000000..77796a5643 --- /dev/null +++ b/elements/pfe-card/dist/pfe-card.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../pfe-sass/mixins/_mixins.scss","../../../pfe-sass/mixins/_custom-properties.scss","../../../pfe-sass/extends/_extends.scss","../../src/pfe-card.scss","pfe-card.css"],"names":[],"mappings":"AAGM,6CAAA,oCC6IF,sBAAA,oBAAA,0BAAA,sBAAA,uBAAA,uBAAA,wBCjGA,iBAAA,eACA,MAAA,mBF7CE,6CAAA,oCCyLF,MCrIA,MAAA,mBCFJ,MACE,UAAA,iF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,6CAAA,oCG6KJ,kBAUI,iBAAA,eACA,MAAA,mBAeF,4DACE,cAAA,eAAA,cAAA,iFA3BH,6CAgCG,gCAAA,2FAGF,4CACE,QAAA,KAGF,+EAEE,mCAAA,kHAzCH,gDA8CG,mCAAA,8FA9CH,gCAmDK,cAAA,EAnDL,gCAmDK,cAAA,EAnDL,gCAmDK,cAAA,EAnDL,gCAmDK,cAAA,EAnDL,gCAmDK,cAAA,EAnDL,gCAmDK,cAAA,EAKJ,qEAEE,gCAAA,2FAHH,2CAQG,QAAA,EACA,gCAAA,kHATH,8CAcG,mCAAA,8FAGF,kEAEE,mCAAA,kHAGF,0CACE,cAAA,EAGJ,kBACE,WAAA,KAEA,QAAA,YAAA,QAAA,aAAA,QAAA,YAAA,QAAA,KACA,mBAAA,WAAA,sBAAA,OAAA,uBAAA,IAAA,mBAAA,IAAA,eAAA,IAAA,eAAA,iCACA,kBAAA,KAAA,cAAA,KAAA,UAAA,KAAA,kBAAA,mCAAA,cAAA,mCAAA,UAAA,mCAEA,kBAAA,SAAA,oBAAA,SAAA,eAAA,SAAA,YAAA,SAAA,kBAAA,6CAAA,oBAAA,6CAAA,eAAA,6CAAA,YAAA,6CAPD,gDAWG,mCAAA,8FAGF,4CACE,QAAA,KAGJ,gBAAA,kBAEE,cAAA,KAAA,cAAA,oGAFD,yCAAA,2CASK,WAAA,EATL,0CAAA,4CASK,WAAA,EATL,0CAAA,4CASK,WAAA,EATL,0CAAA,4CASK,WAAA,EATL,0CAAA,4CASK,WAAA,EATL,0CAAA,4CASK,WAAA,EATL,0CAAA,4CASK,WAAA","file":"pfe-card.min.css","sourceRoot":"../src","sourcesContent":[null,null,null,null,"@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host([color=\"darker\"]), :host([color=\"darkest\"]), :host([color=\"base\"]), :host([color=\"lighter\"]), :host([color=\"lightest\"]), :host([color=\"accent\"]), :host([color=\"complement\"]) {\n /* IE10+ */\n background-color: #fff !important;\n color: #151515 !important;\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n color: #151515 !important;\n }\n}\n\n:host {\n --context: var(--pfe-card--context, var(--pfe-theme--color--surface--base--context, light));\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n justify-items: flex-start;\n -webkit-align-self: stretch;\n -ms-flex-item-align: stretch;\n -ms-grid-row-align: stretch;\n align-self: stretch;\n padding: calc(1rem * 2) calc(1rem * 2) calc(1rem * 2) calc(1rem * 2);\n padding: var(--pfe-card--Padding, var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2)));\n border: 0 solid #d2d2d2;\n border: var(--pfe-card--Border, var(--pfe-card--BorderWidth, 0) var(--pfe-card--BorderStyle, solid) var(--pfe-card--BorderColor, var(--pfe-theme--color--surface--border, #d2d2d2)));\n border-radius: 3px;\n border-radius: var(--pfe-card--BorderRadius, var(--pfe-theme--surface--border-radius, 3px));\n overflow: hidden;\n background-color: #f0f0f0;\n background-color: var(--pfe-card--BackgroundColor, var(--pfe-theme--color--surface--base, #f0f0f0));\n background-position: center center;\n background-position: var(--pfe-card--BackgroundPosition, center center);\n color: #3c3f42;\n color: var(--pfe-broadcasted--text, #3c3f42);\n}\n\n@media print {\n :host {\n background-color: white !important;\n background-image: none !important;\n -webkit-box-shadow: none !important;\n box-shadow: none !important;\n }\n}\n\n@media print {\n :host {\n border-radius: 3px;\n border: 1px solid #d2d2d2;\n }\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n :host {\n /* IE10+ */\n background-color: #fff !important;\n background-color: var(--pfe-theme--color--surface--lightest, #fff) !important;\n color: #151515 !important;\n color: var(--pfe-theme--color--text, #151515) !important;\n background-image: none !important;\n border-radius: 3px;\n border: 1px solid #d2d2d2;\n padding: 1rem;\n padding: var(--pfe-theme--container-spacer, 1rem);\n }\n}\n\n:host([color=\"darker\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--darker, #3c3f42);\n --pfe-card--context: var(--pfe-theme--color--surface--darker--context, dark);\n}\n\n:host([color=\"darkest\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--darkest, #151515);\n --pfe-card--context: var(--pfe-theme--color--surface--darkest--context, dark);\n}\n\n:host([color=\"base\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--base, #f0f0f0);\n --pfe-card--context: var(--pfe-theme--color--surface--base--context, light);\n}\n\n:host([color=\"lighter\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--lighter, #f0f0f0);\n --pfe-card--context: var(--pfe-theme--color--surface--lighter--context, light);\n}\n\n:host([color=\"lightest\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--lightest, #fff);\n --pfe-card--context: var(--pfe-theme--color--surface--lightest--context, light);\n}\n\n:host([color=\"accent\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--accent, #004080);\n --pfe-card--context: var(--pfe-theme--color--surface--accent--context, saturated);\n}\n\n:host([color=\"complement\"]) {\n --pfe-card--BackgroundColor: var(--pfe-theme--color--surface--complement, #002952);\n --pfe-card--context: var(--pfe-theme--color--surface--complement--context, saturated);\n}\n\n:host([on=\"dark\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-dark, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-dark, #73bcf7);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-dark, #bee1f4);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-dark, #bee1f4);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-dark, #bee1f4);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-dark, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-dark, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-dark, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-dark, none);\n}\n\n:host([on=\"saturated\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text--on-saturated, #fff);\n --pfe-broadcasted--link: var(--pfe-theme--color--link--on-saturated, #fff);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover--on-saturated, #fafafa);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus--on-saturated, #fafafa);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited--on-saturated, #d2d2d2);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration--on-saturated, underline);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover--on-saturated, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus--on-saturated, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited--on-saturated, underline);\n}\n\n:host([on=\"light\"]) {\n --pfe-broadcasted--text: var(--pfe-theme--color--text, #151515);\n --pfe-broadcasted--link: var(--pfe-theme--color--link, #06c);\n --pfe-broadcasted--link--hover: var(--pfe-theme--color--link--hover, #004080);\n --pfe-broadcasted--link--focus: var(--pfe-theme--color--link--focus, #004080);\n --pfe-broadcasted--link--visited: var(--pfe-theme--color--link--visited, #6753ac);\n --pfe-broadcasted--link-decoration: var(--pfe-theme--link-decoration, none);\n --pfe-broadcasted--link-decoration--hover: var(--pfe-theme--link-decoration--hover, underline);\n --pfe-broadcasted--link-decoration--focus: var(--pfe-theme--link-decoration--focus, underline);\n --pfe-broadcasted--link-decoration--visited: var(--pfe-theme--link-decoration--visited, none);\n}\n\n:host([size=\"small\"]) {\n --pfe-card--PaddingTop: var(--pfe-theme--container-spacer, 1rem);\n --pfe-card--PaddingRight: var(--pfe-theme--container-spacer, 1rem);\n --pfe-card--PaddingBottom: var(--pfe-theme--container-spacer, 1rem);\n --pfe-card--PaddingLeft: var(--pfe-theme--container-spacer, 1rem);\n}\n\n:host([border]:not([border=\"false\"])) {\n --pfe-card--BorderWidth: 1px;\n}\n\n.pfe-card__header ::slotted([overflow~=\"top\"]),\n.pfe-card__header ::slotted([overflow~=\"top\"]), .pfe-card__body ::slotted([overflow~=\"top\"]),\n.pfe-card__body ::slotted([overflow~=\"top\"]), .pfe-card__footer ::slotted([overflow~=\"top\"]),\n.pfe-card__footer ::slotted([overflow~=\"top\"]) {\n z-index: 1;\n margin-top: -2rem;\n margin-top: calc(-1 * calc(1rem * 2)) !important;\n margin-top: calc(-1 * var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2))) !important;\n}\n\n:host([has_header]) .pfe-card__header ::slotted([overflow~=\"top\"]), :host([has_header])\n.pfe-card__header ::slotted([overflow~=\"top\"]), :host([has_header]) .pfe-card__body ::slotted([overflow~=\"top\"]), :host([has_header])\n.pfe-card__body ::slotted([overflow~=\"top\"]), :host([has_header]) .pfe-card__footer ::slotted([overflow~=\"top\"]), :host([has_header])\n.pfe-card__footer ::slotted([overflow~=\"top\"]) {\n padding-top: 1rem;\n padding-top: var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem));\n}\n\n.pfe-card__header ::slotted([overflow~=\"right\"]),\n.pfe-card__header ::slotted([overflow~=\"right\"]), .pfe-card__body ::slotted([overflow~=\"right\"]),\n.pfe-card__body ::slotted([overflow~=\"right\"]), .pfe-card__footer ::slotted([overflow~=\"right\"]),\n.pfe-card__footer ::slotted([overflow~=\"right\"]) {\n margin-right: -2rem;\n margin-right: calc(-1 * calc(1rem * 2));\n margin-right: calc(-1 * var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2)));\n}\n\n.pfe-card__header ::slotted([overflow~=\"bottom\"]),\n.pfe-card__header ::slotted([overflow~=\"bottom\"]), .pfe-card__body ::slotted([overflow~=\"bottom\"]),\n.pfe-card__body ::slotted([overflow~=\"bottom\"]), .pfe-card__footer ::slotted([overflow~=\"bottom\"]),\n.pfe-card__footer ::slotted([overflow~=\"bottom\"]) {\n margin-bottom: -2rem;\n margin-bottom: calc(-1 * calc(calc(1rem * 2) + 3px));\n margin-bottom: calc(-1 * calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) + var(--pfe-card--BorderRadius, var(--pfe-theme--surface--border-radius, 3px))));\n -webkit-align-self: flex-end;\n -ms-flex-item-align: end;\n align-self: flex-end;\n}\n\n.pfe-card__header ::slotted([overflow~=\"left\"]),\n.pfe-card__header ::slotted([overflow~=\"left\"]), .pfe-card__body ::slotted([overflow~=\"left\"]),\n.pfe-card__body ::slotted([overflow~=\"left\"]), .pfe-card__footer ::slotted([overflow~=\"left\"]),\n.pfe-card__footer ::slotted([overflow~=\"left\"]) {\n margin-left: -2rem;\n margin-left: calc(-1 * calc(1rem * 2));\n margin-left: calc(-1 * var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2)));\n}\n\n.pfe-card__header ::slotted(img), .pfe-card__body ::slotted(img), .pfe-card__footer ::slotted(img) {\n max-width: 100% !important;\n -webkit-align-self: flex-start;\n -ms-flex-item-align: start;\n align-self: flex-start;\n -o-object-fit: cover;\n object-fit: cover;\n}\n\n.pfe-card__header ::slotted(img:not[overflow]),\n.pfe-card__header ::slotted(img:not[overflow]), .pfe-card__body ::slotted(img:not[overflow]),\n.pfe-card__body ::slotted(img:not[overflow]), .pfe-card__footer ::slotted(img:not[overflow]),\n.pfe-card__footer ::slotted(img:not[overflow]) {\n -webkit-align-self: flex-start;\n -ms-flex-item-align: start;\n align-self: flex-start;\n}\n\n.pfe-card__header ::slotted(img[overflow]),\n.pfe-card__header ::slotted(img[overflow]), .pfe-card__body ::slotted(img[overflow]),\n.pfe-card__body ::slotted(img[overflow]), .pfe-card__footer ::slotted(img[overflow]),\n.pfe-card__footer ::slotted(img[overflow]) {\n max-width: unset !important;\n}\n\n.pfe-card__header ::slotted(img[overflow~=\"right\"]),\n.pfe-card__header ::slotted(img[overflow~=\"right\"]), .pfe-card__body ::slotted(img[overflow~=\"right\"]),\n.pfe-card__body ::slotted(img[overflow~=\"right\"]), .pfe-card__footer ::slotted(img[overflow~=\"right\"]),\n.pfe-card__footer ::slotted(img[overflow~=\"right\"]) {\n width: calc(100% + 2rem) !important;\n width: calc(100% + calc(1rem * 2)) !important;\n width: calc(100% + var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2))) !important;\n}\n\n.pfe-card__header ::slotted(img[overflow~=\"left\"]),\n.pfe-card__header ::slotted(img[overflow~=\"left\"]), .pfe-card__body ::slotted(img[overflow~=\"left\"]),\n.pfe-card__body ::slotted(img[overflow~=\"left\"]), .pfe-card__footer ::slotted(img[overflow~=\"left\"]),\n.pfe-card__footer ::slotted(img[overflow~=\"left\"]) {\n width: calc(100% + 2rem) !important;\n width: calc(100% + calc(1rem * 2)) !important;\n width: calc(100% + var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2))) !important;\n}\n\n.pfe-card__header ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]),\n.pfe-card__header ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]), .pfe-card__body ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]),\n.pfe-card__body ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]), .pfe-card__footer ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]),\n.pfe-card__footer ::slotted(img[overflow~=\"right\"][overflow~=\"left\"]) {\n width: calc(100% + 4rem) !important;\n width: calc(100% + calc(1rem * 2) + calc(1rem * 2)) !important;\n width: calc(100% + var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) + var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2))) !important;\n}\n\n.pfe-card__header {\n z-index: 2;\n background-color: rgba(0, 0, 0, 0.09);\n background-color: var(--pfe-card__header--BackgroundColor, rgba(0, 0, 0, var(--pfe-theme--opacity, 0.09)));\n color: #3c3f42;\n color: var(--pfe-card__header--Color, var(--pfe-broadcasted--text, #3c3f42));\n margin-top: calc(calc(1rem * 2) * -1) !important;\n margin-top: calc(var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1) !important;\n margin-right: calc(calc(1rem * 2) * -1);\n margin-right: calc(var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n margin-bottom: 1rem;\n margin-bottom: var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem)));\n margin-left: calc(calc(1rem * 2) * -1);\n margin-left: calc(var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n padding-top: 1rem;\n padding-top: var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem)));\n padding-right: calc(1rem * 2);\n padding-right: var(--pfe-card--PaddingRight, calc(var(--pfe-theme--container-spacer, 1rem) * 2));\n padding-left: calc(1rem * 2);\n padding-left: var(--pfe-card--PaddingLeft, calc(var(--pfe-theme--container-spacer, 1rem) * 2));\n padding-bottom: 1rem;\n padding-bottom: var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem)));\n}\n\n:host([on=\"dark\"]) .pfe-card__header {\n background-color: rgba(255, 255, 255, 0.09);\n background-color: var(--pfe-card__header--BackgroundColor--dark, rgba(255, 255, 255, var(--pfe-theme--opacity, 0.09)));\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n .pfe-card__header {\n /* IE10+ */\n background-color: #fff !important;\n color: #151515 !important;\n }\n}\n\n:host(:not([has_body]):not([has_footer])) .pfe-card__header {\n margin-bottom: calc(1rem * 2);\n margin-bottom: var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2));\n}\n\n.pfe-card__header ::slotted([overflow~=\"top\"]),\n.pfe-card__header ::slotted([overflow~=\"top\"]) {\n --pfe-card__overflow--MarginTop: calc(var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n}\n\n:host(:not([has_header])) .pfe-card__header {\n display: none;\n}\n\n:host([has_body], [has_footer]) .pfe-card__header ::slotted([overflow~=\"bottom\"]),\n:host([has_body], [has_footer]) .pfe-card__header ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem))) * -1);\n}\n\n.pfe-card__header ::slotted([overflow~=\"bottom\"]),\n.pfe-card__header ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n}\n\n.pfe-card__header ::slotted(h1) {\n margin-bottom: 0;\n}\n\n.pfe-card__header ::slotted(h2) {\n margin-bottom: 0;\n}\n\n.pfe-card__header ::slotted(h3) {\n margin-bottom: 0;\n}\n\n.pfe-card__header ::slotted(h4) {\n margin-bottom: 0;\n}\n\n.pfe-card__header ::slotted(h5) {\n margin-bottom: 0;\n}\n\n.pfe-card__header ::slotted(h6) {\n margin-bottom: 0;\n}\n\n:host(:not([has_header])) .pfe-card__body ::slotted([overflow~=\"top\"]),\n:host(:not([has_header])) .pfe-card__body ::slotted([overflow~=\"top\"]) {\n --pfe-card__overflow--MarginTop: calc(var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n}\n\n.pfe-card__body ::slotted([overflow~=\"top\"]),\n.pfe-card__body ::slotted([overflow~=\"top\"]) {\n z-index: 1;\n --pfe-card__overflow--MarginTop: calc(var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem))) * -1);\n}\n\n.pfe-card__body ::slotted([overflow~=\"bottom\"]),\n.pfe-card__body ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n}\n\n:host([has_footer]) .pfe-card__body ::slotted([overflow~=\"bottom\"]),\n:host([has_footer]) .pfe-card__body ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem))) * -1);\n}\n\n:host(:not([has_footer])) .pfe-card__body {\n margin-bottom: 0;\n}\n\n.pfe-card__footer {\n margin-top: auto;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n -ms-flex-direction: row;\n flex-direction: row;\n flex-direction: var(--pfe-card__footer--Row, row);\n -webkit-flex-wrap: wrap;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n -webkit-flex-wrap: var(--pfe-card__footer--Wrap, wrap);\n -ms-flex-wrap: var(--pfe-card__footer--Wrap, wrap);\n flex-wrap: var(--pfe-card__footer--Wrap, wrap);\n -webkit-box-align: baseline;\n -webkit-align-items: baseline;\n -ms-flex-align: baseline;\n align-items: baseline;\n -webkit-box-align: var(--pfe-card__footer--AlignItems, baseline);\n -webkit-align-items: var(--pfe-card__footer--AlignItems, baseline);\n -ms-flex-align: var(--pfe-card__footer--AlignItems, baseline);\n align-items: var(--pfe-card__footer--AlignItems, baseline);\n}\n\n.pfe-card__footer ::slotted([overflow~=\"bottom\"]),\n.pfe-card__footer ::slotted([overflow~=\"bottom\"]) {\n --pfe-card__overflow--MarginBottom: calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1);\n}\n\n:host(:not([has_footer])) .pfe-card__footer {\n display: none;\n}\n\n.pfe-card__header, .pfe-card__body {\n margin-bottom: 1rem;\n margin-bottom: var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem)));\n}\n\n.pfe-card__header ::slotted(p:first-child), .pfe-card__body ::slotted(p:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h1:first-child), .pfe-card__body ::slotted(h1:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h2:first-child), .pfe-card__body ::slotted(h2:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h3:first-child), .pfe-card__body ::slotted(h3:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h4:first-child), .pfe-card__body ::slotted(h4:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h5:first-child), .pfe-card__body ::slotted(h5:first-child) {\n margin-top: 0;\n}\n\n.pfe-card__header ::slotted(h6:first-child), .pfe-card__body ::slotted(h6:first-child) {\n margin-top: 0;\n}\n\n/*# sourceMappingURL=pfe-card.css.map */\n"]} \ No newline at end of file diff --git a/elements/pfe-card/dist/pfe-card.min.js b/elements/pfe-card/dist/pfe-card.min.js new file mode 100644 index 0000000000..54777974a6 --- /dev/null +++ b/elements/pfe-card/dist/pfe-card.min.js @@ -0,0 +1,26 @@ +import e from"../../pfelement/dist/pfelement.min.js";Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var r=this;do{if(r.matches(e))return r;r=r.parentElement||r.parentNode}while(null!==r&&1===r.nodeType);return null}) +/*! + * PatternFly Elements: PfeCard 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/;class r extends e{static get version(){return"1.3.0"}get html(){return'\n\n
    \n \n
    \n
    \n \n
    \n'}static get tag(){return"pfe-card"}static get meta(){return{title:"Card",description:"This element creates a header, body, and footer region in which to place content or other components."}}get templateUrl(){return"pfe-card.html"}get styleUrl(){return"pfe-card.scss"}static get properties(){return{color:{title:"Background color",type:String,values:["lightest","base","darker","darkest","complement","accent"],default:"base",observer:"_colorChanged"},oldColor:{type:String,prefix:!1,alias:"color",attr:"pfe-color"},imgSrc:{title:"Background image",type:String,observer:"_imageSrcChanged"},pfeImgSrc:{type:String,prefix:!1,alias:"imgSrc"},size:{title:"Padding size",type:String,values:["small"]},pfeSize:{type:String,values:["small"],prefix:!1,alias:"size"},border:{title:"Border",type:Boolean},oldBorder:{alias:"border",attr:"pfe-border"}}}static get slots(){return{header:{title:"Header",type:"array",namedSlot:!0,maxItems:3,items:{$ref:"raw"}},body:{title:"Body",type:"array",namedSlot:!1,items:{$ref:"raw"}},footer:{title:"Footer",type:"array",namedSlot:!0,maxItems:3,items:{oneOf:[{$ref:"pfe-cta"},{$ref:"raw"}]}}}}static get PfeType(){return e.PfeTypes.Container}constructor(){super(r,{type:r.PfeType})}_colorChanged(){this.resetContext()}_imageSrcChanged(e,r){this.style.backgroundImage=r?`url('${r}')`:""}}e.create(r);export default r; +//# sourceMappingURL=pfe-card.min.js.map diff --git a/elements/pfe-card/dist/pfe-card.min.js.map b/elements/pfe-card/dist/pfe-card.min.js.map new file mode 100644 index 0000000000..cedd0bc73c --- /dev/null +++ b/elements/pfe-card/dist/pfe-card.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-card.min.js","sources":["../_temp/polyfills--pfe-card.js","../_temp/pfe-card.js"],"sourcesContent":["// @POLYFILL Element.matches\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n// @POLYFILL Element.closest\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\nif (!Element.prototype.closest) {\n Element.prototype.closest = function(s) {\n var el = this;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n}\n","/*!\n * PatternFly Elements: PfeCard 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: matches, closest, includes\nimport \"./polyfills--pfe-card.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\nclass PfeCard extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n \n
    \n
    \n \n
    \n
    \n \n
    `;\n }\n\n static get tag() {\n return \"pfe-card\";\n }\n\n static get meta() {\n return {\n title: \"Card\",\n description:\n \"This element creates a header, body, and footer region in which to place content or other components.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-card.html\";\n }\n\n get styleUrl() {\n return \"pfe-card.scss\";\n }\n\n // @TODO: How do we handle attributes for slotted content?\n static get properties() {\n return {\n color: {\n title: \"Background color\",\n type: String,\n values: [\"lightest\", \"base\", \"darker\", \"darkest\", \"complement\", \"accent\"],\n default: \"base\",\n observer: \"_colorChanged\"\n },\n // @TODO: Deprecate property in 1.0\n oldColor: {\n type: String,\n prefix: false,\n alias: \"color\",\n attr: \"pfe-color\"\n },\n imgSrc: {\n title: \"Background image\",\n type: String,\n observer: \"_imageSrcChanged\"\n },\n // @TODO: Deprecate property in 1.0\n pfeImgSrc: {\n type: String,\n prefix: false,\n alias: \"imgSrc\"\n },\n size: {\n title: \"Padding size\",\n type: String,\n values: [\"small\"]\n },\n // @TODO: Deprecate property in 1.0\n pfeSize: {\n type: String,\n values: [\"small\"],\n prefix: false,\n alias: \"size\"\n },\n border: {\n title: \"Border\",\n type: Boolean\n },\n // @TODO: Deprecate property in 1.0\n oldBorder: {\n alias: \"border\",\n attr: \"pfe-border\"\n }\n };\n }\n\n static get slots() {\n return {\n header: {\n title: \"Header\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n $ref: \"raw\"\n }\n },\n body: {\n title: \"Body\",\n type: \"array\",\n namedSlot: false,\n items: {\n $ref: \"raw\"\n }\n },\n footer: {\n title: \"Footer\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n oneOf: [\n {\n $ref: \"pfe-cta\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n }\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n constructor() {\n super(PfeCard, { type: PfeCard.PfeType });\n }\n\n // If the color changes, update the context\n _colorChanged() {\n // Update the context\n this.resetContext();\n }\n\n // Update the background image\n _imageSrcChanged(oldValue, newValue) {\n // Set the image as the background image\n this.style.backgroundImage = newValue ? `url('${newValue}')` : ``;\n }\n}\n\nPFElement.create(PfeCard);\n\nexport { PfeCard as default };\n"],"names":["Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","this","parentElement","parentNode","nodeType","PfeCard","PFElement","version","html","tag","meta","title","description","templateUrl","styleUrl","properties","color","type","String","values","default","observer","oldColor","prefix","alias","attr","imgSrc","pfeImgSrc","size","pfeSize","border","Boolean","oldBorder","slots","header","namedSlot","maxItems","items","$ref","body","footer","oneOf","PfeType","PfeTypes","Container","[object Object]","super","resetContext","oldValue","newValue","style","backgroundImage","create"],"mappings":"qDAEKA,QAAQC,UAAUC,UACrBF,QAAQC,UAAUC,QAAUF,QAAQC,UAAUE,mBAAqBH,QAAQC,UAAUG,uBAKlFJ,QAAQC,UAAUI,UACrBL,QAAQC,UAAUI,QAAU,SAASC,GACnC,IAAIC,EAAKC,KACT,EAAG,CACD,GAAID,EAAGL,QAAQI,GAAI,OAAOC,EAC1BA,EAAKA,EAAGE,eAAiBF,EAAGG,iBACd,OAAPH,GAA+B,IAAhBA,EAAGI,UAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;GCeX,MAA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elements/pfe-card/dist/pfe-card.umd.js new file mode 100644 index 0000000000..3d00dfc019 --- /dev/null +++ b/elements/pfe-card/dist/pfe-card.umd.js @@ -0,0 +1,275 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../../pfelement/dist/pfelement.umd')) : + typeof define === 'function' && define.amd ? define(['../../pfelement/dist/pfelement.umd'], factory) : + (global = global || self, global.PfeCard = factory(global.PFElement)); +}(this, (function (PFElement) { 'use strict'; + + PFElement = PFElement && Object.prototype.hasOwnProperty.call(PFElement, 'default') ? PFElement['default'] : PFElement; + + // @POLYFILL Element.matches + // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + } + + // @POLYFILL Element.closest + // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest + if (!Element.prototype.closest) { + Element.prototype.closest = function (s) { + var el = this; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + return null; + }; + } + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + }; + + var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + }; + + /*! + * PatternFly Elements: PfeCard 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + var PfeCard = function (_PFElement) { + inherits(PfeCard, _PFElement); + createClass(PfeCard, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n
    \n \n
    \n
    \n \n
    \n
    \n \n
    "; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-card.html"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-card.scss"; + } + + // @TODO: How do we handle attributes for slotted content? + + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "tag", + get: function get() { + return "pfe-card"; + } + }, { + key: "meta", + get: function get() { + return { + title: "Card", + description: "This element creates a header, body, and footer region in which to place content or other components." + }; + } + }, { + key: "properties", + get: function get() { + return { + color: { + title: "Background color", + type: String, + values: ["lightest", "base", "darker", "darkest", "complement", "accent"], + default: "base", + observer: "_colorChanged" + }, + // @TODO: Deprecate property in 1.0 + oldColor: { + type: String, + prefix: false, + alias: "color", + attr: "pfe-color" + }, + imgSrc: { + title: "Background image", + type: String, + observer: "_imageSrcChanged" + }, + // @TODO: Deprecate property in 1.0 + pfeImgSrc: { + type: String, + prefix: false, + alias: "imgSrc" + }, + size: { + title: "Padding size", + type: String, + values: ["small"] + }, + // @TODO: Deprecate property in 1.0 + pfeSize: { + type: String, + values: ["small"], + prefix: false, + alias: "size" + }, + border: { + title: "Border", + type: Boolean + }, + // @TODO: Deprecate property in 1.0 + oldBorder: { + alias: "border", + attr: "pfe-border" + } + }; + } + }, { + key: "slots", + get: function get() { + return { + header: { + title: "Header", + type: "array", + namedSlot: true, + maxItems: 3, + items: { + $ref: "raw" + } + }, + body: { + title: "Body", + type: "array", + namedSlot: false, + items: { + $ref: "raw" + } + }, + footer: { + title: "Footer", + type: "array", + namedSlot: true, + maxItems: 3, + items: { + oneOf: [{ + $ref: "pfe-cta" + }, { + $ref: "raw" + }] + } + } + }; + } + + // Declare the type of this component + + }, { + key: "PfeType", + get: function get() { + return PFElement.PfeTypes.Container; + } + }]); + + function PfeCard() { + classCallCheck(this, PfeCard); + return possibleConstructorReturn(this, (PfeCard.__proto__ || Object.getPrototypeOf(PfeCard)).call(this, PfeCard, { type: PfeCard.PfeType })); + } + + // If the color changes, update the context + + + createClass(PfeCard, [{ + key: "_colorChanged", + value: function _colorChanged() { + // Update the context + this.resetContext(); + } + + // Update the background image + + }, { + key: "_imageSrcChanged", + value: function _imageSrcChanged(oldValue, newValue) { + // Set the image as the background image + this.style.backgroundImage = newValue ? "url('" + newValue + "')" : ""; + } + }]); + return PfeCard; + }(PFElement); + + PFElement.create(PfeCard); + + return PfeCard; + +}))); +//# sourceMappingURL=pfe-card.umd.js.map diff --git a/elements/pfe-card/dist/pfe-card.umd.js.map b/elements/pfe-card/dist/pfe-card.umd.js.map new file mode 100644 index 0000000000..ecd9eed7d4 --- /dev/null +++ b/elements/pfe-card/dist/pfe-card.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-card.umd.js","sources":["../_temp/polyfills--pfe-card.js","../_temp/pfe-card.umd.js"],"sourcesContent":["// @POLYFILL Element.matches\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n// @POLYFILL Element.closest\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\nif (!Element.prototype.closest) {\n Element.prototype.closest = function(s) {\n var el = this;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n}\n","/*!\n * PatternFly Elements: PfeCard 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: matches, closest, includes\nimport \"./polyfills--pfe-card.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\n\nclass PfeCard extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n \n
    \n
    \n \n
    \n
    \n \n
    `;\n }\n\n static get tag() {\n return \"pfe-card\";\n }\n\n static get meta() {\n return {\n title: \"Card\",\n description:\n \"This element creates a header, body, and footer region in which to place content or other components.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-card.html\";\n }\n\n get styleUrl() {\n return \"pfe-card.scss\";\n }\n\n // @TODO: How do we handle attributes for slotted content?\n static get properties() {\n return {\n color: {\n title: \"Background color\",\n type: String,\n values: [\"lightest\", \"base\", \"darker\", \"darkest\", \"complement\", \"accent\"],\n default: \"base\",\n observer: \"_colorChanged\"\n },\n // @TODO: Deprecate property in 1.0\n oldColor: {\n type: String,\n prefix: false,\n alias: \"color\",\n attr: \"pfe-color\"\n },\n imgSrc: {\n title: \"Background image\",\n type: String,\n observer: \"_imageSrcChanged\"\n },\n // @TODO: Deprecate property in 1.0\n pfeImgSrc: {\n type: String,\n prefix: false,\n alias: \"imgSrc\"\n },\n size: {\n title: \"Padding size\",\n type: String,\n values: [\"small\"]\n },\n // @TODO: Deprecate property in 1.0\n pfeSize: {\n type: String,\n values: [\"small\"],\n prefix: false,\n alias: \"size\"\n },\n border: {\n title: \"Border\",\n type: Boolean\n },\n // @TODO: Deprecate property in 1.0\n oldBorder: {\n alias: \"border\",\n attr: \"pfe-border\"\n }\n };\n }\n\n static get slots() {\n return {\n header: {\n title: \"Header\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n $ref: \"raw\"\n }\n },\n body: {\n title: \"Body\",\n type: \"array\",\n namedSlot: false,\n items: {\n $ref: \"raw\"\n }\n },\n footer: {\n title: \"Footer\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n oneOf: [\n {\n $ref: \"pfe-cta\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n }\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n constructor() {\n super(PfeCard, { type: PfeCard.PfeType });\n }\n\n // If the color changes, update the context\n _colorChanged() {\n // Update the context\n this.resetContext();\n }\n\n // Update the background image\n _imageSrcChanged(oldValue, newValue) {\n // Set the image as the background image\n this.style.backgroundImage = newValue ? `url('${newValue}')` : ``;\n }\n}\n\nPFElement.create(PfeCard);\n\nexport { PfeCard as default };\n"],"names":["Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","parentElement","parentNode","nodeType","PfeCard","title","description","color","type","String","values","default","observer","oldColor","prefix","alias","attr","imgSrc","pfeImgSrc","size","pfeSize","border","Boolean","oldBorder","header","namedSlot","maxItems","items","$ref","body","footer","oneOf","PFElement","PfeTypes","Container","PfeType","resetContext","oldValue","newValue","style","backgroundImage","create"],"mappings":";;;;;;;;EAAA;EACA;EACA,IAAI,CAACA,QAAQC,SAAR,CAAkBC,OAAvB,EAAgC;EAC9BF,UAAQC,SAAR,CAAkBC,OAAlB,GAA4BF,QAAQC,SAAR,CAAkBE,iBAAlB,IAAuCH,QAAQC,SAAR,CAAkBG,qBAArF;EACD;;EAED;EACA;EACA,IAAI,CAACJ,QAAQC,SAAR,CAAkBI,OAAvB,EAAgC;EAC9BL,UAAQC,SAAR,CAAkBI,OAAlB,GAA4B,UAASC,CAAT,EAAY;EACtC,QAAIC,KAAK,IAAT;EACA,OAAG;EACD,UAAIA,GAAGL,OAAH,CAAWI,CAAX,CAAJ,EAAmB,OAAOC,EAAP;EACnBA,WAAKA,GAAGC,aAAH,IAAoBD,GAAGE,UAA5B;EACD,KAHD,QAGSF,OAAO,IAAP,IAAeA,GAAGG,QAAH,KAAgB,CAHxC;EAIA,WAAO,IAAP;EACD,GAPD;EAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAGNiB,qBAAW,IAHL;EAINC,oBAAU,CAJJ;EAKNC,iBAAO;EACLC,kBAAM;EADD;EALD,SADH;EAULC,cAAM;EACJxB,iBAAO,MADH;EAEJG,gBAAM,OAFF;EAGJiB,qBAAW,KAHP;EAIJE,iBAAO;EACLC,kBAAM;EADD;EAJH,SAVD;EAkBLE,gBAAQ;EACNzB,iBAAO,QADD;EAENG,gBAAM,OAFA;EAGNiB,qBAAW,IAHL;EAINC,oBAAU,CAJJ;EAKNC,iBAAO;EACLI,mBAAO,CACL;EACEH,oBAAM;EADR,aADK,EAIL;EACEA,oBAAM;EADR,aAJK;EADF;EALD;EAlBH,OAAP;EAmCD;;EAED;;;;0BACqB;EACnB,aAAOI,UAAUC,QAAV,CAAmBC,SAA1B;EACD;;;EAED,qBAAc;EAAA;EAAA,4GACN9B,OADM,EACG,EAAEI,MAAMJ,QAAQ+B,OAAhB,EADH;EAEb;;EAED;;;;;sCACgB;EACd;EACA,WAAKC,YAAL;EACD;;EAED;;;;uCACiBC,UAAUC,UAAU;EACnC;EACA,WAAKC,KAAL,CAAWC,eAAX,GAA6BF,qBAAmBA,QAAnB,YAA7B;EACD;;;IAvJmBN;;EA0JtBA,UAAUS,MAAV,CAAiBrC,OAAjB;;;;;;;;"} \ No newline at end of file diff --git a/elements/pfe-card/dist/pfe-card.umd.min.js b/elements/pfe-card/dist/pfe-card.umd.min.js new file mode 100644 index 0000000000..0ac4aef7f9 --- /dev/null +++ b/elements/pfe-card/dist/pfe-card.umd.min.js @@ -0,0 +1,2 @@ +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("../../pfelement/dist/pfelement.umd.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min"],r):(e=e||self).PfeCard=r(e.PFElement)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var r=this;do{if(r.matches(e))return r}while(null!==(r=r.parentElement||r.parentNode)&&1===r.nodeType);return null});var r=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},t=function(e,r,t){return r&&a(e.prototype,r),t&&a(e,t),e};function a(e,r){for(var t=0;t@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([color=accent]),:host([color=base]),:host([color=complement]),:host([color=darker]),:host([color=darkest]),:host([color=lighter]),:host([color=lightest]){background-color:#fff!important;color:#151515!important}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#151515!important}}:host{--context:var(--pfe-card--context, var(--pfe-theme--color--surface--base--context, light));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;justify-items:flex-start;-webkit-align-self:stretch;-ms-flex-item-align:stretch;-ms-grid-row-align:stretch;align-self:stretch;padding:calc(1rem * 2) calc(1rem * 2) calc(1rem * 2) calc(1rem * 2);padding:var(--pfe-card--Padding,var(--pfe-card--PaddingTop,calc(var(--pfe-theme--container-spacer,1rem) * 2)) var(--pfe-card--PaddingRight,calc(var(--pfe-theme--container-spacer,1rem) * 2)) var(--pfe-card--PaddingBottom,calc(var(--pfe-theme--container-spacer,1rem) * 2)) var(--pfe-card--PaddingLeft,calc(var(--pfe-theme--container-spacer,1rem) * 2)));border:0 solid #d2d2d2;border:var(--pfe-card--Border,var(--pfe-card--BorderWidth,0) var(--pfe-card--BorderStyle,solid) var(--pfe-card--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2)));border-radius:3px;border-radius:var(--pfe-card--BorderRadius,var(--pfe-theme--surface--border-radius,3px));overflow:hidden;background-color:#f0f0f0;background-color:var(--pfe-card--BackgroundColor,var(--pfe-theme--color--surface--base,#f0f0f0));background-position:center center;background-position:var(--pfe-card--BackgroundPosition,center center);color:#3c3f42;color:var(--pfe-broadcasted--text,#3c3f42)}@media print{:host{background-color:#fff!important;background-image:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}}@media print{:host{border-radius:3px;border:1px solid #d2d2d2}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;background-color:var(--pfe-theme--color--surface--lightest,#fff)!important;color:#151515!important;color:var(--pfe-theme--color--text,#151515)!important;background-image:none!important;border-radius:3px;border:1px solid #d2d2d2;padding:1rem;padding:var(--pfe-theme--container-spacer,1rem)}}:host([color=darker]){--pfe-card--BackgroundColor:var(--pfe-theme--color--surface--darker, #3c3f42);--pfe-card--context:var(--pfe-theme--color--surface--darker--context, dark)}:host([color=darkest]){--pfe-card--BackgroundColor:var(--pfe-theme--color--surface--darkest, #151515);--pfe-card--context:var(--pfe-theme--color--surface--darkest--context, dark)}:host([color=base]){--pfe-card--BackgroundColor:var(--pfe-theme--color--surface--base, #f0f0f0);--pfe-card--context:var(--pfe-theme--color--surface--base--context, light)}:host([color=lighter]){--pfe-card--BackgroundColor:var(--pfe-theme--color--surface--lighter, #f0f0f0);--pfe-card--context:var(--pfe-theme--color--surface--lighter--context, light)}:host([color=lightest]){--pfe-card--BackgroundColor:var(--pfe-theme--color--surface--lightest, #fff);--pfe-card--context:var(--pfe-theme--color--surface--lightest--context, light)}:host([color=accent]){--pfe-card--BackgroundColor:var(--pfe-theme--color--surface--accent, #004080);--pfe-card--context:var(--pfe-theme--color--surface--accent--context, saturated)}:host([color=complement]){--pfe-card--BackgroundColor:var(--pfe-theme--color--surface--complement, #002952);--pfe-card--context:var(--pfe-theme--color--surface--complement--context, saturated)}:host([on=dark]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-dark, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-dark, #73bcf7);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-dark, #bee1f4);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-dark, #bee1f4);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-dark, #bee1f4);--pfe-broadcasted--link-decoration:var(--pfe-theme--link-decoration--on-dark, none);--pfe-broadcasted--link-decoration--hover:var(--pfe-theme--link-decoration--hover--on-dark, underline);--pfe-broadcasted--link-decoration--focus:var(--pfe-theme--link-decoration--focus--on-dark, underline);--pfe-broadcasted--link-decoration--visited:var(--pfe-theme--link-decoration--visited--on-dark, none)}:host([on=saturated]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-saturated, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-saturated, #fff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-saturated, #fafafa);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-saturated, #fafafa);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-saturated, #d2d2d2);--pfe-broadcasted--link-decoration:var(--pfe-theme--link-decoration--on-saturated, underline);--pfe-broadcasted--link-decoration--hover:var(--pfe-theme--link-decoration--hover--on-saturated, underline);--pfe-broadcasted--link-decoration--focus:var(--pfe-theme--link-decoration--focus--on-saturated, underline);--pfe-broadcasted--link-decoration--visited:var(--pfe-theme--link-decoration--visited--on-saturated, underline)}:host([on=light]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #151515);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #004080);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #004080);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, #6753ac);--pfe-broadcasted--link-decoration:var(--pfe-theme--link-decoration, none);--pfe-broadcasted--link-decoration--hover:var(--pfe-theme--link-decoration--hover, underline);--pfe-broadcasted--link-decoration--focus:var(--pfe-theme--link-decoration--focus, underline);--pfe-broadcasted--link-decoration--visited:var(--pfe-theme--link-decoration--visited, none)}:host([size=small]){--pfe-card--PaddingTop:var(--pfe-theme--container-spacer, 1rem);--pfe-card--PaddingRight:var(--pfe-theme--container-spacer, 1rem);--pfe-card--PaddingBottom:var(--pfe-theme--container-spacer, 1rem);--pfe-card--PaddingLeft:var(--pfe-theme--container-spacer, 1rem)}:host([border]:not([border=false])){--pfe-card--BorderWidth:1px}.pfe-card__body ::slotted([overflow~=top]),.pfe-card__footer ::slotted([overflow~=top]),.pfe-card__header ::slotted([overflow~=top]){z-index:1;margin-top:-2rem;margin-top:calc(-1 * calc(1rem * 2))!important;margin-top:calc(-1 * var(--pfe-card--PaddingTop,calc(var(--pfe-theme--container-spacer,1rem) * 2)))!important}:host([has_header]) .pfe-card__body ::slotted([overflow~=top]),:host([has_header]) .pfe-card__footer ::slotted([overflow~=top]),:host([has_header]) .pfe-card__header ::slotted([overflow~=top]){padding-top:1rem;padding-top:var(--pfe-card--spacing,var(--pfe-theme--container-spacer,1rem))}.pfe-card__body ::slotted([overflow~=right]),.pfe-card__footer ::slotted([overflow~=right]),.pfe-card__header ::slotted([overflow~=right]){margin-right:-2rem;margin-right:calc(-1 * calc(1rem * 2));margin-right:calc(-1 * var(--pfe-card--PaddingRight,calc(var(--pfe-theme--container-spacer,1rem) * 2)))}.pfe-card__body ::slotted([overflow~=bottom]),.pfe-card__footer ::slotted([overflow~=bottom]),.pfe-card__header ::slotted([overflow~=bottom]){margin-bottom:-2rem;margin-bottom:calc(-1 * calc(calc(1rem * 2) + 3px));margin-bottom:calc(-1 * calc(var(--pfe-card--PaddingBottom,calc(var(--pfe-theme--container-spacer,1rem) * 2)) + var(--pfe-card--BorderRadius,var(--pfe-theme--surface--border-radius,3px))));-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end}.pfe-card__body ::slotted([overflow~=left]),.pfe-card__footer ::slotted([overflow~=left]),.pfe-card__header ::slotted([overflow~=left]){margin-left:-2rem;margin-left:calc(-1 * calc(1rem * 2));margin-left:calc(-1 * var(--pfe-card--PaddingLeft,calc(var(--pfe-theme--container-spacer,1rem) * 2)))}.pfe-card__body ::slotted(img),.pfe-card__footer ::slotted(img),.pfe-card__header ::slotted(img){max-width:100%!important;-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;-o-object-fit:cover;object-fit:cover}.pfe-card__body ::slotted(img:not[overflow]),.pfe-card__footer ::slotted(img:not[overflow]),.pfe-card__header ::slotted(img:not[overflow]){-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start}.pfe-card__body ::slotted(img[overflow]),.pfe-card__footer ::slotted(img[overflow]),.pfe-card__header ::slotted(img[overflow]){max-width:unset!important}.pfe-card__body ::slotted(img[overflow~=right]),.pfe-card__footer ::slotted(img[overflow~=right]),.pfe-card__header ::slotted(img[overflow~=right]){width:calc(100% + 2rem)!important;width:calc(100% + calc(1rem * 2))!important;width:calc(100% + var(--pfe-card--PaddingRight,calc(var(--pfe-theme--container-spacer,1rem) * 2)))!important}.pfe-card__body ::slotted(img[overflow~=left]),.pfe-card__footer ::slotted(img[overflow~=left]),.pfe-card__header ::slotted(img[overflow~=left]){width:calc(100% + 2rem)!important;width:calc(100% + calc(1rem * 2))!important;width:calc(100% + var(--pfe-card--PaddingLeft,calc(var(--pfe-theme--container-spacer,1rem) * 2)))!important}.pfe-card__body ::slotted(img[overflow~=right][overflow~=left]),.pfe-card__footer ::slotted(img[overflow~=right][overflow~=left]),.pfe-card__header ::slotted(img[overflow~=right][overflow~=left]){width:calc(100% + 4rem)!important;width:calc(100% + calc(1rem * 2) + calc(1rem * 2))!important;width:calc(100% + var(--pfe-card--PaddingRight,calc(var(--pfe-theme--container-spacer,1rem) * 2)) + var(--pfe-card--PaddingLeft,calc(var(--pfe-theme--container-spacer,1rem) * 2)))!important}.pfe-card__header{z-index:2;background-color:rgba(0,0,0,.09);background-color:var(--pfe-card__header--BackgroundColor,rgba(0,0,0,var(--pfe-theme--opacity,.09)));color:#3c3f42;color:var(--pfe-card__header--Color,var(--pfe-broadcasted--text,#3c3f42));margin-top:calc(calc(1rem * 2) * -1)!important;margin-top:calc(var(--pfe-card--PaddingTop,calc(var(--pfe-theme--container-spacer,1rem) * 2)) * -1)!important;margin-right:calc(calc(1rem * 2) * -1);margin-right:calc(var(--pfe-card--PaddingRight,calc(var(--pfe-theme--container-spacer,1rem) * 2)) * -1);margin-bottom:1rem;margin-bottom:var(--pfe-card--spacing--vertical,var(--pfe-card--spacing,var(--pfe-theme--container-spacer,1rem)));margin-left:calc(calc(1rem * 2) * -1);margin-left:calc(var(--pfe-card--PaddingLeft,calc(var(--pfe-theme--container-spacer,1rem) * 2)) * -1);padding-top:1rem;padding-top:var(--pfe-card--spacing--vertical,var(--pfe-card--spacing,var(--pfe-theme--container-spacer,1rem)));padding-right:calc(1rem * 2);padding-right:var(--pfe-card--PaddingRight,calc(var(--pfe-theme--container-spacer,1rem) * 2));padding-left:calc(1rem * 2);padding-left:var(--pfe-card--PaddingLeft,calc(var(--pfe-theme--container-spacer,1rem) * 2));padding-bottom:1rem;padding-bottom:var(--pfe-card--spacing--vertical,var(--pfe-card--spacing,var(--pfe-theme--container-spacer,1rem)))}:host([on=dark]) .pfe-card__header{background-color:rgba(255,255,255,.09);background-color:var(--pfe-card__header--BackgroundColor--dark,rgba(255,255,255,var(--pfe-theme--opacity,.09)))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){.pfe-card__header{background-color:#fff!important;color:#151515!important}}:host(:not([has_body]):not([has_footer])) .pfe-card__header{margin-bottom:calc(1rem * 2);margin-bottom:var(--pfe-card--PaddingBottom,calc(var(--pfe-theme--container-spacer,1rem) * 2))}.pfe-card__header ::slotted([overflow~=top]){--pfe-card__overflow--MarginTop:calc(var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1)}:host(:not([has_header])) .pfe-card__header{display:none}:host([has_body],[has_footer]) .pfe-card__header ::slotted([overflow~=bottom]){--pfe-card__overflow--MarginBottom:calc(var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem))) * -1)}.pfe-card__header ::slotted([overflow~=bottom]){--pfe-card__overflow--MarginBottom:calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1)}.pfe-card__header ::slotted(h1){margin-bottom:0}.pfe-card__header ::slotted(h2){margin-bottom:0}.pfe-card__header ::slotted(h3){margin-bottom:0}.pfe-card__header ::slotted(h4){margin-bottom:0}.pfe-card__header ::slotted(h5){margin-bottom:0}.pfe-card__header ::slotted(h6){margin-bottom:0}:host(:not([has_header])) .pfe-card__body ::slotted([overflow~=top]){--pfe-card__overflow--MarginTop:calc(var(--pfe-card--PaddingTop, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1)}.pfe-card__body ::slotted([overflow~=top]){z-index:1;--pfe-card__overflow--MarginTop:calc(var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem))) * -1)}.pfe-card__body ::slotted([overflow~=bottom]){--pfe-card__overflow--MarginBottom:calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1)}:host([has_footer]) .pfe-card__body ::slotted([overflow~=bottom]){--pfe-card__overflow--MarginBottom:calc(var(--pfe-card--spacing--vertical, var(--pfe-card--spacing, var(--pfe-theme--container-spacer, 1rem))) * -1)}:host(:not([has_footer])) .pfe-card__body{margin-bottom:0}.pfe-card__footer{margin-top:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;flex-direction:var(--pfe-card__footer--Row,row);-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-wrap:var(--pfe-card__footer--Wrap,wrap);-ms-flex-wrap:var(--pfe-card__footer--Wrap,wrap);flex-wrap:var(--pfe-card__footer--Wrap,wrap);-webkit-box-align:baseline;-webkit-align-items:baseline;-ms-flex-align:baseline;align-items:baseline;-webkit-box-align:var(--pfe-card__footer--AlignItems,baseline);-webkit-align-items:var(--pfe-card__footer--AlignItems,baseline);-ms-flex-align:var(--pfe-card__footer--AlignItems,baseline);align-items:var(--pfe-card__footer--AlignItems,baseline)}.pfe-card__footer ::slotted([overflow~=bottom]){--pfe-card__overflow--MarginBottom:calc(var(--pfe-card--PaddingBottom, calc(var(--pfe-theme--container-spacer, 1rem) * 2)) * -1)}:host(:not([has_footer])) .pfe-card__footer{display:none}.pfe-card__body,.pfe-card__header{margin-bottom:1rem;margin-bottom:var(--pfe-card--spacing--vertical,var(--pfe-card--spacing,var(--pfe-theme--container-spacer,1rem)))}.pfe-card__body ::slotted(p:first-child),.pfe-card__header ::slotted(p:first-child){margin-top:0}.pfe-card__body ::slotted(h1:first-child),.pfe-card__header ::slotted(h1:first-child){margin-top:0}.pfe-card__body ::slotted(h2:first-child),.pfe-card__header ::slotted(h2:first-child){margin-top:0}.pfe-card__body ::slotted(h3:first-child),.pfe-card__header ::slotted(h3:first-child){margin-top:0}.pfe-card__body ::slotted(h4:first-child),.pfe-card__header ::slotted(h4:first-child){margin-top:0}.pfe-card__body ::slotted(h5:first-child),.pfe-card__header ::slotted(h5:first-child){margin-top:0}.pfe-card__body ::slotted(h6:first-child),.pfe-card__header ::slotted(h6:first-child){margin-top:0} /*# sourceMappingURL=pfe-card.min.css.map */\n
    \n \n
    \n
    \n \n
    \n'}},{key:"templateUrl",get:function(){return"pfe-card.html"}},{key:"styleUrl",get:function(){return"pfe-card.scss"}}],[{key:"version",get:function(){return"1.3.0"}},{key:"tag",get:function(){return"pfe-card"}},{key:"meta",get:function(){return{title:"Card",description:"This element creates a header, body, and footer region in which to place content or other components."}}},{key:"properties",get:function(){return{color:{title:"Background color",type:String,values:["lightest","base","darker","darkest","complement","accent"],default:"base",observer:"_colorChanged"},oldColor:{type:String,prefix:!1,alias:"color",attr:"pfe-color"},imgSrc:{title:"Background image",type:String,observer:"_imageSrcChanged"},pfeImgSrc:{type:String,prefix:!1,alias:"imgSrc"},size:{title:"Padding size",type:String,values:["small"]},pfeSize:{type:String,values:["small"],prefix:!1,alias:"size"},border:{title:"Border",type:Boolean},oldBorder:{alias:"border",attr:"pfe-border"}}}},{key:"slots",get:function(){return{header:{title:"Header",type:"array",namedSlot:!0,maxItems:3,items:{$ref:"raw"}},body:{title:"Body",type:"array",namedSlot:!1,items:{$ref:"raw"}},footer:{title:"Footer",type:"array",namedSlot:!0,maxItems:3,items:{oneOf:[{$ref:"pfe-cta"},{$ref:"raw"}]}}}}},{key:"PfeType",get:function(){return e.PfeTypes.Container}}]),t(c,[{key:"_colorChanged",value:function(){this.resetContext()}},{key:"_imageSrcChanged",value:function(e,r){this.style.backgroundImage=r?"url('"+r+"')":""}}]),c);function c(){return r(this,c),o(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,c,{type:c.PfeType}))}return e.create(t),t}); +//# sourceMappingURL=pfe-card.umd.min.js.map diff --git a/elements/pfe-card/dist/pfe-card.umd.min.js.map b/elements/pfe-card/dist/pfe-card.umd.min.js.map new file mode 100644 index 0000000000..66aea87d97 --- /dev/null +++ b/elements/pfe-card/dist/pfe-card.umd.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-card.umd.min.js","sources":["../_temp/polyfills--pfe-card.js","../_temp/pfe-card.umd.js"],"sourcesContent":["// @POLYFILL Element.matches\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n// @POLYFILL Element.closest\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\nif (!Element.prototype.closest) {\n Element.prototype.closest = function(s) {\n var el = this;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n}\n","/*!\n * PatternFly Elements: PfeCard 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: matches, closest, includes\nimport \"./polyfills--pfe-card.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\n\nclass PfeCard extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
    \n \n
    \n
    \n \n
    \n
    \n \n
    `;\n }\n\n static get tag() {\n return \"pfe-card\";\n }\n\n static get meta() {\n return {\n title: \"Card\",\n description:\n \"This element creates a header, body, and footer region in which to place content or other components.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-card.html\";\n }\n\n get styleUrl() {\n return \"pfe-card.scss\";\n }\n\n // @TODO: How do we handle attributes for slotted content?\n static get properties() {\n return {\n color: {\n title: \"Background color\",\n type: String,\n values: [\"lightest\", \"base\", \"darker\", \"darkest\", \"complement\", \"accent\"],\n default: \"base\",\n observer: \"_colorChanged\"\n },\n // @TODO: Deprecate property in 1.0\n oldColor: {\n type: String,\n prefix: false,\n alias: \"color\",\n attr: \"pfe-color\"\n },\n imgSrc: {\n title: \"Background image\",\n type: String,\n observer: \"_imageSrcChanged\"\n },\n // @TODO: Deprecate property in 1.0\n pfeImgSrc: {\n type: String,\n prefix: false,\n alias: \"imgSrc\"\n },\n size: {\n title: \"Padding size\",\n type: String,\n values: [\"small\"]\n },\n // @TODO: Deprecate property in 1.0\n pfeSize: {\n type: String,\n values: [\"small\"],\n prefix: false,\n alias: \"size\"\n },\n border: {\n title: \"Border\",\n type: Boolean\n },\n // @TODO: Deprecate property in 1.0\n oldBorder: {\n alias: \"border\",\n attr: \"pfe-border\"\n }\n };\n }\n\n static get slots() {\n return {\n header: {\n title: \"Header\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n $ref: \"raw\"\n }\n },\n body: {\n title: \"Body\",\n type: \"array\",\n namedSlot: false,\n items: {\n $ref: \"raw\"\n }\n },\n footer: {\n title: \"Footer\",\n type: \"array\",\n namedSlot: true,\n maxItems: 3,\n items: {\n oneOf: [\n {\n $ref: \"pfe-cta\"\n },\n {\n $ref: \"raw\"\n }\n ]\n }\n }\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Container;\n }\n\n constructor() {\n super(PfeCard, { type: PfeCard.PfeType });\n }\n\n // If the color changes, update the context\n _colorChanged() {\n // Update the context\n this.resetContext();\n }\n\n // Update the background image\n _imageSrcChanged(oldValue, newValue) {\n // Set the image as the background image\n this.style.backgroundImage = newValue ? `url('${newValue}')` : ``;\n }\n}\n\nPFElement.create(PfeCard);\n\nexport { PfeCard as default };\n"],"names":["Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","this","parentElement","parentNode","nodeType","PfeCard","PFElement","String","Boolean","PfeTypes","Container","resetContext","oldValue","newValue","style","backgroundImage","type","PfeType","create"],"mappings":"wWAEKA,QAAQC,UAAUC,kBACbD,UAAUC,QAAUF,QAAQC,UAAUE,mBAAqBH,QAAQC,UAAUG,uBAKlFJ,QAAQC,UAAUI,kBACbJ,UAAUI,QAAU,SAASC,OAC/BC,EAAKC,WAEHD,EAAGL,QAAQI,GAAI,OAAOC,QAEZ,UADTA,EAAGE,eAAiBF,EAAGG,aACU,IAAhBH,EAAGI,iBACpB,kfCeLC,+TAAgBC,u9eAmCX,uDAIA,wDAnCA,0CAmBA,8CAIA,OACE,mBAEL,kJAcG,OACE,OACE,wBACDC,cACE,CAAC,WAAY,OAAQ,SAAU,UAAW,aAAc,kBACvD,gBACC,0BAGF,MACFA,eACE,QACD,aACD,oBAEA,OACC,wBACDA,gBACI,8BAGD,MACHA,eACE,QACD,eAEH,OACG,oBACDA,cACE,CAAC,kBAGF,MACDA,cACE,CAAC,iBACD,QACD,eAED,OACC,cACDC,mBAGG,OACF,cACD,mDAMH,QACG,OACC,cACD,mBACK,WACD,QACH,MACC,aAGJ,OACG,YACD,mBACK,QACJ,MACC,eAGF,OACC,cACD,mBACK,WACD,QACH,OACE,CACL,MACQ,WAER,MACQ,kDAUTF,EAAUG,SAASC,8DAUrBC,wDAIUC,EAAUC,QAEpBC,MAAMC,gBAAkBF,UAAmBA,wGAZ1CR,EAAS,CAAEW,KAAMX,EAAQY,kBAgBnCX,EAAUY,OAAOb"} \ No newline at end of file diff --git a/elements/pfe-card/package.json b/elements/pfe-card/package.json index d3eaed9d47..700dedcac2 100644 --- a/elements/pfe-card/package.json +++ b/elements/pfe-card/package.json @@ -5,7 +5,7 @@ "elementName": "pfe-card", "preview": "card.svg" }, - "version": "1.2.0", + "version": "1.3.0", "publishConfig": { "access": "public" }, @@ -56,10 +56,10 @@ ], "license": "MIT", "dependencies": { - "@patternfly/pfelement": "^1.2.0" + "@patternfly/pfelement": "^1.3.0" }, "devDependencies": { - "@patternfly/pfe-sass": "^1.2.0" + "@patternfly/pfe-sass": "^1.3.0" }, "generator-pfelement-version": "0.5.0", "bugs": { diff --git a/elements/pfe-clipboard/dist/pfe-clipboard.css.map b/elements/pfe-clipboard/dist/pfe-clipboard.css.map new file mode 100644 index 0000000000..ed5e1d7874 --- /dev/null +++ b/elements/pfe-clipboard/dist/pfe-clipboard.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-clipboard.scss","../../pfe-sass/functions/_custom-properties.scss","pfe-clipboard.css","../../pfe-sass/mixins/_mixins.scss"],"names":[],"mappings":"AAoBA;EACE,oBAAa;EAAb,qBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,mBAAc;EAAd,sBAAc;MAAd,kBAAc;UAAd,cAAc;EACd,yBAAmB;EAAnB,2BAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;EACnB,8BAAsB;EAAtB,2BAAsB;EAAtB,sBAAsB;EACtB,sBAAkC;EAAlC,iFAAkC;EAClC,gBCqDkC;EDrDlC,wFCqDkC;EDpDlC,0BAAyC;EAAzC,0DAAyC;EACzC,eAAe;EACf,iBCkDkC;EDlDlC,gDCkDkC;ACrEpC;;AFsBA;EACE,aAAa;AEnBf;;AFwBE;EACE,oBAAa;EAAb,qBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,UCuCgC;EDvChC,0ECuCgC;EDrChC,YCqCgC;EDrChC,gDCqCgC;EDpChC,uBCoCgC;EDpChC,2DCoCgC;EDlChC,mGAAkB;AEvBtB;;AFgBG;EAUG,wBAAuC;EAAvC,iGAAuC;AEtB7C;;AFyBE;EACE,sBAAkC;EAAlC,iFAAkC;AEtBtC;;AFyBE;EACE,yBAAiD;EAAjD,iHAAiD;AEtBrD;;AF2BA;;EAEE,wBAAwB;AExB1B;;AF0BA;;EAEE,wBAAwB;AEvB1B;;AF4BA;;EAEE,WAAW;AEzBb;;AF6BA;;EAEE,wGAAuB;AE1BzB;;AF8BA;;EAEE,wGAAuB;AE3BzB;;ACxDM;EAAsF,UAAA;EHuF1F;IAEE,qBAAqB;EE3BvB;EF6BA;IACE,qBAAqB;IACrB,eAAe;EE3BjB;EF6BA;IACE,qBAAqB;EE3BvB;EF6BA;IACE,qBAAqB;EE3BvB;AACF","file":"pfe-clipboard.css","sourcesContent":["// Please see the pfe-sass README for guidance on using these tools\n@import \"../../pfe-sass/pfe-sass\";\n\n$LOCAL: clipboard;\n\n// This variable is global so that helper functions can reference it\n$LOCAL-VARIABLES: (\n FontSize: 1rem,\n Padding: 6px 16px,\n FontWeight: pfe-var(font-weight--light),\n Color: pfe-broadcasted(link),\n Color--hover: pfe-broadcasted(link--hover),\n Color--focus: pfe-broadcasted(link--focus),\n text--success--Color: pfe-var(feedback--success),\n icon--Width: pfe-var(icon-size),\n icon--Height: auto,\n icon--Margin: 0 0.4825rem 0 0, // 7.72px\n icon--Color: pfe-var(text--muted)\n);\n\n:host {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n max-width: fit-content;\n color: pfe-local(Color) !important;\n font-weight: pfe-local(FontWeight);\n font-size: pfe-local(FontSize) !important;\n cursor: pointer;\n padding: pfe-local(Padding);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n//-- Custom styles applied to slot's shadow element\n.pfe-clipboard {\n &__icon {\n display: flex;\n width: pfe-local(icon--Width);\n // This is needed if the icon isn't square\n height: pfe-local(icon--Height);\n margin: pfe-local(icon--Margin);\n // Customize icon color for pfe-icons\n --pfe-icon--Color: #{pfe-local(icon--Color)};\n svg {\n // Customize icon color of fallback svg icon\n fill: pfe-local(icon--Color) !important;\n }\n }\n &__text {\n color: pfe-local(Color) !important;\n }\n\n &__text--success {\n color: pfe-local(text--success--Color) !important;\n }\n}\n\n// Flipped clipboard text and success text\n:host([copied]) .pfe-clipboard__text,\n.pfe-clipboard[copied] .pfe-clipboard__text {\n display: none !important;\n}\n:host(:not([copied])) .pfe-clipboard__text--success,\n.pfe-clipboard:not([copied]) .pfe-clipboard__text--success {\n display: none !important;\n}\n\n//-- Custom styles applied to slot\n// Targets icon in the shadowdom and lightdom\n::slotted([slot=\"icon\"]),\n.pfe-clipboard__icon > * {\n width: 100%;\n}\n\n// Note: Focus states need to be defined before hover states\n:host(:not([aria-disabled=\"true\"]):focus),\n:host(:not([aria-disabled=\"true\"]).focus-within) {\n --pfe-clipboard--Color: #{pfe-local(Color--focus)};\n}\n\n// Note: Hover states need to be defined after focus states\n:host(:not([aria-disabled=\"true\"]):hover),\n:host(:not([aria-disabled=\"true\"])) ::slotted(:hover) {\n --pfe-clipboard--Color: #{pfe-local(Color--hover)};\n}\n\n@include browser-query(ie11) {\n :host {\n // fallback for inline-flex\n display: inline-block;\n }\n .pfe-clipboard__icon {\n display: inline-block;\n margin-right: 0;\n }\n .pfe-clipboard__text {\n display: inline-block;\n }\n .pfe-clipboard__text--success {\n display: inline-block;\n }\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}",":host {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n max-width: fit-content;\n color: var(--pfe-clipboard--Color, var(--pfe-broadcasted--link, #06c)) !important;\n font-weight: var(--pfe-clipboard--FontWeight, var(--pfe-theme--font-weight--light, 300));\n font-size: var(--pfe-clipboard--FontSize, 1rem) !important;\n cursor: pointer;\n padding: var(--pfe-clipboard--Padding, 6px 16px);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.pfe-clipboard__icon {\n display: flex;\n width: var(--pfe-clipboard--icon--Width, var(--pfe-theme--icon-size, 1em));\n height: var(--pfe-clipboard--icon--Height, auto);\n margin: var(--pfe-clipboard--icon--Margin, 0 0.4825rem 0 0);\n --pfe-icon--Color: var(--pfe-clipboard--icon--Color, var(--pfe-theme--color--text--muted, #6a6e73));\n}\n\n.pfe-clipboard__icon svg {\n fill: var(--pfe-clipboard--icon--Color, var(--pfe-theme--color--text--muted, #6a6e73)) !important;\n}\n\n.pfe-clipboard__text {\n color: var(--pfe-clipboard--Color, var(--pfe-broadcasted--link, #06c)) !important;\n}\n\n.pfe-clipboard__text--success {\n color: var(--pfe-clipboard--text--success--Color, var(--pfe-theme--color--feedback--success, #3e8635)) !important;\n}\n\n:host([copied]) .pfe-clipboard__text,\n.pfe-clipboard[copied] .pfe-clipboard__text {\n display: none !important;\n}\n\n:host(:not([copied])) .pfe-clipboard__text--success,\n.pfe-clipboard:not([copied]) .pfe-clipboard__text--success {\n display: none !important;\n}\n\n::slotted([slot=\"icon\"]),\n.pfe-clipboard__icon > * {\n width: 100%;\n}\n\n:host(:not([aria-disabled=\"true\"]):focus),\n:host(:not([aria-disabled=\"true\"]).focus-within) {\n --pfe-clipboard--Color: var(--pfe-clipboard--Color--focus, var(--pfe-broadcasted--link--focus, #004080));\n}\n\n:host(:not([aria-disabled=\"true\"]):hover),\n:host(:not([aria-disabled=\"true\"])) ::slotted(:hover) {\n --pfe-clipboard--Color: var(--pfe-clipboard--Color--hover, var(--pfe-broadcasted--link--hover, #004080));\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n /* IE10+ */\n :host {\n display: inline-block;\n }\n .pfe-clipboard__icon {\n display: inline-block;\n margin-right: 0;\n }\n .pfe-clipboard__text {\n display: inline-block;\n }\n .pfe-clipboard__text--success {\n display: inline-block;\n }\n}\n","@mixin browser-query($browser-list) {\n @each $browser in $browser-list {\n @if $browser == ie11 {\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */\n @content;\n }\n }\n @if $browser == edge12 {\n @supports (-ms-accelerator: true) { /* Microsoft Edge Browser 12+ */\n @content;\n }\n }\n @if $browser == edge {\n @supports (-ms-ime-align: auto) { /* Microsoft Edge Browser 16+ (All) */\n @content;\n }\n }\n @if $browser == firefox {\n @media all and (min--moz-device-pixel-ratio:0) { /* Mozilla Firefox (All) */\n @content;\n }\n }\n }\n}\n\n@mixin pfe-transition($properties...) {\n $return: null;\n @each $property in $properties {\n @if length($property) == 1 {\n $return: append($return, #{$property} 250ms $pfe-global--animation-timing, comma);\n }\n @else if length($property) == 2 {\n $return: append($return, nth($property, 1) nth($property, 2), comma);\n }\n }\n transition: $return;\n}\n\n// Make a CSS arrow\n@mixin pfe-arrow($type, $color, $width: 8px, $height: 5px, $pseudo: false) {\n $direction: (\n up: 180deg,\n down: 0deg,\n right: -90deg,\n left: 90deg,\n );\n border-style: pfe-var(surface--border-style);\n border-width: $width $height 0;\n border-color: transparent;\n border-top-color: $color;\n transform: rotate(map-get($direction, $type));\n @if $pseudo {\n display: inline-block;\n content: \"\";\n @content;\n }\n}\n\n@mixin pfe-arrow-color($color) {\n border-top-color: $color;\n}\n\n@mixin pfe-print-media {\n @media print {\n @content;\n }\n}\n\n@mixin pfe-print-background {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n@mixin pfe-no-print-background {\n @include pfe-print-media {\n background-color: white !important;\n background-image: none !important;\n box-shadow: none !important;\n }\n}\n\n@mixin pfe-hidden {\n @at-root #{&}([hidden]) {\n display: none;\n }\n}\n\n@mixin pfe-pipe( $position: right, $padding: 0, $margin: 0, $color: $border-color) {\n border: pfe-var(surface--border-width) pfe-var(surface--border-style) transparent;\n border-#{$position}-color: $color;\n @if $position == right {\n padding-left: $padding;\n margin-right: $margin;\n }\n @else if $position == left {\n padding-right: $padding;\n margin-left: $margin;\n }\n}\n\n@mixin pfe-retina {\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n @content;\n }\n}\n\n@mixin pfe-icon($path, $display: flex, $size: 1em) {\n display: #{$display};\n @if $path {\n background: #{$path} no-repeat;\n background-size: contain;\n background-position: center;\n }\n width: #{$size};\n height: #{$size};\n @content;\n}\n\n@mixin pfe-local-debug($map: $LOCAL-VARIABLES) {\n :root {\n @include pfe-print-local($map);\n }\n} "],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-clipboard/dist/pfe-clipboard.js b/elements/pfe-clipboard/dist/pfe-clipboard.js new file mode 100644 index 0000000000..c1ccb9cd7f --- /dev/null +++ b/elements/pfe-clipboard/dist/pfe-clipboard.js @@ -0,0 +1,251 @@ +import PFElement from '../../pfelement/dist/pfelement.js'; + +/*! + * PatternFly Elements: PfeClipboard 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/ + +class PfeClipboard extends PFElement { + + // Injected at build-time + static get version() { + return "1.3.0"; + } + + // Injected at build-time + get html() { + return ` + +${!this.noIcon ? ` +
    + + + +
    +` : ""} +
    + Copy URL +
    +`; + } + + static get tag() { + return "pfe-clipboard"; + } + + static get meta() { + return { + title: "Clipboard", + description: "Copy current URL to clipboard." + }; + } + + get templateUrl() { + return "pfe-clipboard.html"; + } + + get styleUrl() { + return "pfe-clipboard.scss"; + } + + static get events() { + return { + copied: `${this.tag}:copied` + }; + } + + // Declare the type of this component + static get PfeType() { + return PFElement.PfeTypes.Content; + } + + static get properties() { + return { + noIcon: { + title: "No icon", + type: Boolean, + observer: "_noIconChanged" + }, + copiedDuration: { + title: "Success message duration (in seconds)", + type: Number, + default: 3 + }, + role: { + type: String, + default: "button" + }, + tabindex: { + type: Number, + default: 0 + } + }; + } + + static get slots() { + return { + icon: { + title: "Icon", + description: "This field can accept an SVG, pfe-icon component, or other format for displaying an icon.", + slotName: "icon", + slotClass: "pfe-clipboard__icon", + slotId: "icon" + }, + text: { + title: "Default text", + slotName: "text", + slotClass: "pfe-clipboard__text", + slotId: "text" + }, + textSuccess: { + title: "Success message", + description: "Shown when the URL is successfully copied to the clipboard.", + slotName: "text--success", + slotClass: "pfe-clipboard__text--success", + slotId: "text--success" + } + }; + } + + constructor() { + super(PfeClipboard, { type: PfeClipboard.PfeType }); + } + + connectedCallback() { + super.connectedCallback(); + + // Since this element as the role of button we are going to listen + // for click and as well as 'enter' and 'space' commands to trigger + // the copy functionality + this.addEventListener("click", this._clickHandler.bind(this)); + this.addEventListener("keydown", this._keydownHandler.bind(this)); + } + + disconnectedCallback() { + this.removeEventListener("click", this._clickHandler.bind(this)); + this.removeEventListener("keydown", this._keydownHandler.bind(this)); + this.shadowRoot.removeEventListener("slotchange", this._slotchangeHandler.bind(this)); + super.disconnectedCallback(); + } + + _noIconChanged(previousValue) { + // dirty check to see if we should rerender the template + if (this._rendered && this.noIcon !== previousValue) { + this.render(); + } + } + + _clickHandler(event) { + // Execute the copy to clipboard functionality + this.copyURLToClipboard() + .then(url => { + // Emit event that lets others know the user has "copied" + // the url. We are also going to include the url that was + // copied. + this.emitEvent(PfeClipboard.events.copied, { + detail: { + url + } + }); + // Toggle the copied state. Use the this._formattedCopiedTimeout function + // to an appropraite setTimout length. + this.setAttribute("copied", ""); + setTimeout(() => { + this.removeAttribute("copied"); + }, this._formattedCopiedTimeout()); + }) + .catch(error => { + this.warn(error); + }); + } + + // Formatted copied timeout value. Use the formattedCopiedTimeout function + // to get a type safe, millisecond value of the timeout duration. + _formattedCopiedTimeout() { + const copiedDuration = Number(this.copiedDuration * 1000); + if (!(copiedDuration > -1)) { + this.warn(`copied-duration must be a valid number. Defaulting to 3 seconds.`); + // default to 3 seconds + return 3000; + } else { + return copiedDuration; + } + } + + // Listen for keyboard events and map them to their + // corresponding mouse events. + _keydownHandler(event) { + let key = event.key || event.keyCode; + switch (key) { + case "Enter" : + this._clickHandler(event); + break; + case " " : + // Prevent the browser from scolling when the user hits the space key + event.stopPropagation(); + event.preventDefault(); + this._clickHandler(event); + break; + } + } + + /** + * Copy url to the user's system clipboard + * + * If available, it will use the new Navigator API to access the system clipboard + * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard + * + * If unavailable, it will use the legacy execCommand("copy") + * https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand + * @async + * @return {Promise} url + */ + copyURLToClipboard() { + return new Promise((resolve, reject) => { + const url = window.location.href; + // If the Clipboard API is available then use that + if (navigator.clipboard) { + navigator.clipboard.writeText(url).then(resolve(url)); + } + // If execCommand("copy") exists then use that method + else if (document.queryCommandEnabled("copy")) { + const dummy = document.createElement("input"); + document.body.appendChild(dummy); + dummy.value = url; + dummy.select(); + document.execCommand("copy"); + document.body.removeChild(dummy); + resolve(url); + } else { + reject(new Error("Your browser does not support copying to the clipboard.")); + } + }); + } +} + +PFElement.create(PfeClipboard); + +export default PfeClipboard; +//# sourceMappingURL=pfe-clipboard.js.map diff --git a/elements/pfe-clipboard/dist/pfe-clipboard.js.map b/elements/pfe-clipboard/dist/pfe-clipboard.js.map new file mode 100644 index 0000000000..eea794d3ad --- /dev/null +++ b/elements/pfe-clipboard/dist/pfe-clipboard.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-clipboard.js","sources":["../_temp/pfe-clipboard.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeClipboard 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\nclass PfeClipboard extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n${!this.noIcon ? `\n
    \n \n \n \n
    \n` : \"\"}\n
    \n Copy URL\n
    \n
    \n Copied\n
    `;\n }\n\n static get tag() {\n return \"pfe-clipboard\";\n }\n\n static get meta() {\n return {\n title: \"Clipboard\",\n description: \"Copy current URL to clipboard.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-clipboard.html\";\n }\n\n get styleUrl() {\n return \"pfe-clipboard.scss\";\n }\n\n static get events() {\n return {\n copied: `${this.tag}:copied`\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Content;\n }\n\n static get properties() {\n return {\n noIcon: {\n title: \"No icon\",\n type: Boolean,\n observer: \"_noIconChanged\"\n },\n copiedDuration: {\n title: \"Success message duration (in seconds)\",\n type: Number,\n default: 3\n },\n role: {\n type: String,\n default: \"button\"\n },\n tabindex: {\n type: Number,\n default: 0\n }\n };\n }\n\n static get slots() {\n return {\n icon: {\n title: \"Icon\",\n description: \"This field can accept an SVG, pfe-icon component, or other format for displaying an icon.\",\n slotName: \"icon\",\n slotClass: \"pfe-clipboard__icon\",\n slotId: \"icon\"\n },\n text: {\n title: \"Default text\",\n slotName: \"text\",\n slotClass: \"pfe-clipboard__text\",\n slotId: \"text\"\n },\n textSuccess: {\n title: \"Success message\",\n description: \"Shown when the URL is successfully copied to the clipboard.\",\n slotName: \"text--success\",\n slotClass: \"pfe-clipboard__text--success\",\n slotId: \"text--success\"\n }\n };\n }\n\n constructor() {\n super(PfeClipboard, { type: PfeClipboard.PfeType });\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n // Since this element as the role of button we are going to listen\n // for click and as well as 'enter' and 'space' commands to trigger\n // the copy functionality\n this.addEventListener(\"click\", this._clickHandler.bind(this));\n this.addEventListener(\"keydown\", this._keydownHandler.bind(this));\n }\n\n disconnectedCallback() {\n this.removeEventListener(\"click\", this._clickHandler.bind(this));\n this.removeEventListener(\"keydown\", this._keydownHandler.bind(this));\n this.shadowRoot.removeEventListener(\"slotchange\", this._slotchangeHandler.bind(this));\n super.disconnectedCallback();\n }\n\n _noIconChanged(previousValue) {\n // dirty check to see if we should rerender the template\n if (this._rendered && this.noIcon !== previousValue) {\n this.render();\n }\n }\n\n _clickHandler(event) {\n // Execute the copy to clipboard functionality\n this.copyURLToClipboard()\n .then(url => {\n // Emit event that lets others know the user has \"copied\"\n // the url. We are also going to include the url that was\n // copied.\n this.emitEvent(PfeClipboard.events.copied, {\n detail: {\n url\n }\n });\n // Toggle the copied state. Use the this._formattedCopiedTimeout function\n // to an appropraite setTimout length.\n this.setAttribute(\"copied\", \"\");\n setTimeout(() => {\n this.removeAttribute(\"copied\");\n }, this._formattedCopiedTimeout());\n })\n .catch(error => {\n this.warn(error);\n });\n }\n\n // Formatted copied timeout value. Use the formattedCopiedTimeout function\n // to get a type safe, millisecond value of the timeout duration.\n _formattedCopiedTimeout() {\n const copiedDuration = Number(this.copiedDuration * 1000);\n if (!(copiedDuration > -1)) {\n this.warn(`copied-duration must be a valid number. Defaulting to 3 seconds.`);\n // default to 3 seconds\n return 3000;\n } else {\n return copiedDuration;\n }\n }\n\n // Listen for keyboard events and map them to their\n // corresponding mouse events.\n _keydownHandler(event) {\n let key = event.key || event.keyCode;\n switch (key) {\n case \"Enter\" || 13:\n this._clickHandler(event);\n break;\n case \" \" || 32:\n // Prevent the browser from scolling when the user hits the space key\n event.stopPropagation();\n event.preventDefault();\n this._clickHandler(event);\n break;\n }\n }\n\n /**\n * Copy url to the user's system clipboard\n *\n * If available, it will use the new Navigator API to access the system clipboard\n * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard\n *\n * If unavailable, it will use the legacy execCommand(\"copy\")\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand\n * @async\n * @return {Promise} url\n */\n copyURLToClipboard() {\n return new Promise((resolve, reject) => {\n const url = window.location.href;\n // If the Clipboard API is available then use that\n if (navigator.clipboard) {\n navigator.clipboard.writeText(url).then(resolve(url));\n }\n // If execCommand(\"copy\") exists then use that method\n else if (document.queryCommandEnabled(\"copy\")) {\n const dummy = document.createElement(\"input\");\n document.body.appendChild(dummy);\n dummy.value = url;\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n resolve(url);\n } else {\n reject(new Error(\"Your browser does not support copying to the clipboard.\"));\n }\n });\n }\n}\n\nPFElement.create(PfeClipboard);\n\nexport default PfeClipboard;\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA,MAAM,YAAY,SAAS,SAAS,CAAC;AACrC;AACA;AACA,EAAE,WAAW,OAAO,GAAG;AACvB,IAAI,OAAO,OAAO,CAAC;AACnB,GAAG;AACH;AACA;AACA,EAAE,IAAI,IAAI,GAAG;AACb,IAAI,OAAO,CAAC;AACZ;AACA,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA,CAAC,GAAG,EAAE,CAAC;AACP;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC,CAAC;AACR,GAAG;AACH;AACA,EAAE,WAAW,GAAG,GAAG;AACnB,IAAI,OAAO,eAAe,CAAC;AAC3B,GAAG;AACH;AACA,EAAE,WAAW,IAAI,GAAG;AACpB,IAAI,OAAO;AACX,MAAM,KAAK,EAAE,WAAW;AACxB,MAAM,WAAW,EAAE,gCAAgC;AACnD,KAAK,CAAC;AACN,GAAG;AACH;AACA,EAAE,IAAI,WAAW,GAAG;AACpB,IAAI,OAAO,oBAAoB,CAAC;AAChC,GAAG;AACH;AACA,EAAE,IAAI,QAAQ,GAAG;AACjB,I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ACb,QAAQ,MAAM,CAAC,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC,CAAC;AACrF,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH,CAAC;AACD;AACA,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC;;;;"} \ No newline at end of file diff --git a/elements/pfe-clipboard/dist/pfe-clipboard.min.css.map b/elements/pfe-clipboard/dist/pfe-clipboard.min.css.map new file mode 100644 index 0000000000..16337da282 --- /dev/null +++ b/elements/pfe-clipboard/dist/pfe-clipboard.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/pfe-clipboard.scss","pfe-clipboard.css","../../../pfe-sass/mixins/_mixins.scss"],"names":[],"mappings":"AAoBA,MACE,QAAA,YAAA,QAAA,aAAA,QAAA,YAAA,QAAA,KACA,iBAAA,EAAA,aAAA,EAAA,EAAA,KAAA,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KACA,kBAAA,OAAA,oBAAA,OAAA,eAAA,OAAA,YAAA,OACA,UAAA,oBAAA,UAAA,iBAAA,UAAA,YACA,MAAA,eAAA,MAAA,wEACA,YAAA,IAAA,YAAA,0EACA,UAAA,eAAA,UAAA,8CACA,OAAA,QACA,QAAA,IAAA,KAAA,QAAA,uCAGF,gBACE,QAAA,KAKA,qBACE,QAAA,YAAA,QAAA,aAAA,QAAA,YAAA,QAAA,KACA,MAAA,IAAA,MAAA,kEAEA,OAAA,KAAA,OAAA,wCACA,OAAA,EAAA,SAAA,EAAA,EAAA,OAAA,kDAEA,kBAAA,iFAPD,yBAUG,KAAA,kBAAA,KAAA,yFAGJ,qBACE,MAAA,eAAA,MAAA,wEAGF,8BACE,MAAA,kBAAA,MAAA,wGCKJ,4CDAA,qCAEE,QAAA,eCGF,2DDDA,oDAEE,QAAA,eCIF,uBDCA,uBAEE,MAAA,KCEF,+CDEA,wCAEE,uBAAA,iFCCF,oDDGA,wCAEE,uBAAA,iFEnFI,6CAAA,oCFuFJ,MAEE,QAAA,aAEF,qBACE,QAAA,aACA,aAAA,EAEF,qBACE,QAAA,aAEF,8BACE,QAAA","file":"pfe-clipboard.min.css","sourceRoot":"../src","sourcesContent":[null,":host {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 0;\n -webkit-flex: 0 0 auto;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n -webkit-box-align: center;\n -webkit-align-items: center;\n -ms-flex-align: center;\n align-items: center;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n color: #06c !important;\n color: var(--pfe-clipboard--Color, var(--pfe-broadcasted--link, #06c)) !important;\n font-weight: 300;\n font-weight: var(--pfe-clipboard--FontWeight, var(--pfe-theme--font-weight--light, 300));\n font-size: 1rem !important;\n font-size: var(--pfe-clipboard--FontSize, 1rem) !important;\n cursor: pointer;\n padding: 6px 16px;\n padding: var(--pfe-clipboard--Padding, 6px 16px);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.pfe-clipboard__icon {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n width: 1em;\n width: var(--pfe-clipboard--icon--Width, var(--pfe-theme--icon-size, 1em));\n height: auto;\n height: var(--pfe-clipboard--icon--Height, auto);\n margin: 0 0.4825rem 0 0;\n margin: var(--pfe-clipboard--icon--Margin, 0 0.4825rem 0 0);\n --pfe-icon--Color: var(--pfe-clipboard--icon--Color, var(--pfe-theme--color--text--muted, #6a6e73));\n}\n\n.pfe-clipboard__icon svg {\n fill: #6a6e73 !important;\n fill: var(--pfe-clipboard--icon--Color, var(--pfe-theme--color--text--muted, #6a6e73)) !important;\n}\n\n.pfe-clipboard__text {\n color: #06c !important;\n color: var(--pfe-clipboard--Color, var(--pfe-broadcasted--link, #06c)) !important;\n}\n\n.pfe-clipboard__text--success {\n color: #3e8635 !important;\n color: var(--pfe-clipboard--text--success--Color, var(--pfe-theme--color--feedback--success, #3e8635)) !important;\n}\n\n:host([copied]) .pfe-clipboard__text,\n.pfe-clipboard[copied] .pfe-clipboard__text {\n display: none !important;\n}\n\n:host(:not([copied])) .pfe-clipboard__text--success,\n.pfe-clipboard:not([copied]) .pfe-clipboard__text--success {\n display: none !important;\n}\n\n::slotted([slot=\"icon\"]),\n.pfe-clipboard__icon > * {\n width: 100%;\n}\n\n:host(:not([aria-disabled=\"true\"]):focus),\n:host(:not([aria-disabled=\"true\"]).focus-within) {\n --pfe-clipboard--Color: var(--pfe-clipboard--Color--focus, var(--pfe-broadcasted--link--focus, #004080));\n}\n\n:host(:not([aria-disabled=\"true\"]):hover),\n:host(:not([aria-disabled=\"true\"])) ::slotted(:hover) {\n --pfe-clipboard--Color: var(--pfe-clipboard--Color--hover, var(--pfe-broadcasted--link--hover, #004080));\n}\n\n@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n /* IE10+ */\n :host {\n display: inline-block;\n }\n .pfe-clipboard__icon {\n display: inline-block;\n margin-right: 0;\n }\n .pfe-clipboard__text {\n display: inline-block;\n }\n .pfe-clipboard__text--success {\n display: inline-block;\n }\n}\n\n/*# sourceMappingURL=pfe-clipboard.css.map */\n"]} \ No newline at end of file diff --git a/elements/pfe-clipboard/dist/pfe-clipboard.min.js b/elements/pfe-clipboard/dist/pfe-clipboard.min.js new file mode 100644 index 0000000000..7489ccb9ff --- /dev/null +++ b/elements/pfe-clipboard/dist/pfe-clipboard.min.js @@ -0,0 +1,26 @@ +import e from"../../pfelement/dist/pfelement.min.js"; +/*! + * PatternFly Elements: PfeClipboard 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * +*/class t extends e{static get version(){return"1.3.0"}get html(){return`\n\n${this.noIcon?"":'\n
    \n \n \n \n
    \n'}\n
    \n Copy URL\n
    \n`}static get tag(){return"pfe-clipboard"}static get meta(){return{title:"Clipboard",description:"Copy current URL to clipboard."}}get templateUrl(){return"pfe-clipboard.html"}get styleUrl(){return"pfe-clipboard.scss"}static get events(){return{copied:`${this.tag}:copied`}}static get PfeType(){return e.PfeTypes.Content}static get properties(){return{noIcon:{title:"No icon",type:Boolean,observer:"_noIconChanged"},copiedDuration:{title:"Success message duration (in seconds)",type:Number,default:3},role:{type:String,default:"button"},tabindex:{type:Number,default:0}}}static get slots(){return{icon:{title:"Icon",description:"This field can accept an SVG, pfe-icon component, or other format for displaying an icon.",slotName:"icon",slotClass:"pfe-clipboard__icon",slotId:"icon"},text:{title:"Default text",slotName:"text",slotClass:"pfe-clipboard__text",slotId:"text"},textSuccess:{title:"Success message",description:"Shown when the URL is successfully copied to the clipboard.",slotName:"text--success",slotClass:"pfe-clipboard__text--success",slotId:"text--success"}}}constructor(){super(t,{type:t.PfeType})}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._clickHandler.bind(this)),this.addEventListener("keydown",this._keydownHandler.bind(this))}disconnectedCallback(){this.removeEventListener("click",this._clickHandler.bind(this)),this.removeEventListener("keydown",this._keydownHandler.bind(this)),this.shadowRoot.removeEventListener("slotchange",this._slotchangeHandler.bind(this)),super.disconnectedCallback()}_noIconChanged(e){this._rendered&&this.noIcon!==e&&this.render()}_clickHandler(e){this.copyURLToClipboard().then(e=>{this.emitEvent(t.events.copied,{detail:{url:e}}),this.setAttribute("copied",""),setTimeout(()=>{this.removeAttribute("copied")},this._formattedCopiedTimeout())}).catch(e=>{this.warn(e)})}_formattedCopiedTimeout(){const e=Number(1e3*this.copiedDuration);return e>-1?e:(this.warn("copied-duration must be a valid number. Defaulting to 3 seconds."),3e3)}_keydownHandler(e){switch(e.key||e.keyCode){case"Enter":this._clickHandler(e);break;case" ":e.stopPropagation(),e.preventDefault(),this._clickHandler(e)}}copyURLToClipboard(){return new Promise((e,t)=>{const o=window.location.href;if(navigator.clipboard)navigator.clipboard.writeText(o).then(e(o));else if(document.queryCommandEnabled("copy")){const t=document.createElement("input");document.body.appendChild(t),t.value=o,t.select(),document.execCommand("copy"),document.body.removeChild(t),e(o)}else t(new Error("Your browser does not support copying to the clipboard."))})}}e.create(t);export default t; +//# sourceMappingURL=pfe-clipboard.min.js.map diff --git a/elements/pfe-clipboard/dist/pfe-clipboard.min.js.map b/elements/pfe-clipboard/dist/pfe-clipboard.min.js.map new file mode 100644 index 0000000000..702920a0be --- /dev/null +++ b/elements/pfe-clipboard/dist/pfe-clipboard.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-clipboard.min.js","sources":["../_temp/pfe-clipboard.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeClipboard 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\n\nclass PfeClipboard extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n${!this.noIcon ? `\n
    \n \n \n \n
    \n` : \"\"}\n
    \n Copy URL\n
    \n
    \n Copied\n
    `;\n }\n\n static get tag() {\n return \"pfe-clipboard\";\n }\n\n static get meta() {\n return {\n title: \"Clipboard\",\n description: \"Copy current URL to clipboard.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-clipboard.html\";\n }\n\n get styleUrl() {\n return \"pfe-clipboard.scss\";\n }\n\n static get events() {\n return {\n copied: `${this.tag}:copied`\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Content;\n }\n\n static get properties() {\n return {\n noIcon: {\n title: \"No icon\",\n type: Boolean,\n observer: \"_noIconChanged\"\n },\n copiedDuration: {\n title: \"Success message duration (in seconds)\",\n type: Number,\n default: 3\n },\n role: {\n type: String,\n default: \"button\"\n },\n tabindex: {\n type: Number,\n default: 0\n }\n };\n }\n\n static get slots() {\n return {\n icon: {\n title: \"Icon\",\n description: \"This field can accept an SVG, pfe-icon component, or other format for displaying an icon.\",\n slotName: \"icon\",\n slotClass: \"pfe-clipboard__icon\",\n slotId: \"icon\"\n },\n text: {\n title: \"Default text\",\n slotName: \"text\",\n slotClass: \"pfe-clipboard__text\",\n slotId: \"text\"\n },\n textSuccess: {\n title: \"Success message\",\n description: \"Shown when the URL is successfully copied to the clipboard.\",\n slotName: \"text--success\",\n slotClass: \"pfe-clipboard__text--success\",\n slotId: \"text--success\"\n }\n };\n }\n\n constructor() {\n super(PfeClipboard, { type: PfeClipboard.PfeType });\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n // Since this element as the role of button we are going to listen\n // for click and as well as 'enter' and 'space' commands to trigger\n // the copy functionality\n this.addEventListener(\"click\", this._clickHandler.bind(this));\n this.addEventListener(\"keydown\", this._keydownHandler.bind(this));\n }\n\n disconnectedCallback() {\n this.removeEventListener(\"click\", this._clickHandler.bind(this));\n this.removeEventListener(\"keydown\", this._keydownHandler.bind(this));\n this.shadowRoot.removeEventListener(\"slotchange\", this._slotchangeHandler.bind(this));\n super.disconnectedCallback();\n }\n\n _noIconChanged(previousValue) {\n // dirty check to see if we should rerender the template\n if (this._rendered && this.noIcon !== previousValue) {\n this.render();\n }\n }\n\n _clickHandler(event) {\n // Execute the copy to clipboard functionality\n this.copyURLToClipboard()\n .then(url => {\n // Emit event that lets others know the user has \"copied\"\n // the url. We are also going to include the url that was\n // copied.\n this.emitEvent(PfeClipboard.events.copied, {\n detail: {\n url\n }\n });\n // Toggle the copied state. Use the this._formattedCopiedTimeout function\n // to an appropraite setTimout length.\n this.setAttribute(\"copied\", \"\");\n setTimeout(() => {\n this.removeAttribute(\"copied\");\n }, this._formattedCopiedTimeout());\n })\n .catch(error => {\n this.warn(error);\n });\n }\n\n // Formatted copied timeout value. Use the formattedCopiedTimeout function\n // to get a type safe, millisecond value of the timeout duration.\n _formattedCopiedTimeout() {\n const copiedDuration = Number(this.copiedDuration * 1000);\n if (!(copiedDuration > -1)) {\n this.warn(`copied-duration must be a valid number. Defaulting to 3 seconds.`);\n // default to 3 seconds\n return 3000;\n } else {\n return copiedDuration;\n }\n }\n\n // Listen for keyboard events and map them to their\n // corresponding mouse events.\n _keydownHandler(event) {\n let key = event.key || event.keyCode;\n switch (key) {\n case \"Enter\" || 13:\n this._clickHandler(event);\n break;\n case \" \" || 32:\n // Prevent the browser from scolling when the user hits the space key\n event.stopPropagation();\n event.preventDefault();\n this._clickHandler(event);\n break;\n }\n }\n\n /**\n * Copy url to the user's system clipboard\n *\n * If available, it will use the new Navigator API to access the system clipboard\n * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard\n *\n * If unavailable, it will use the legacy execCommand(\"copy\")\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand\n * @async\n * @return {Promise} url\n */\n copyURLToClipboard() {\n return new Promise((resolve, reject) => {\n const url = window.location.href;\n // If the Clipboard API is available then use that\n if (navigator.clipboard) {\n navigator.clipboard.writeText(url).then(resolve(url));\n }\n // If execCommand(\"copy\") exists then use that method\n else if (document.queryCommandEnabled(\"copy\")) {\n const dummy = document.createElement(\"input\");\n document.body.appendChild(dummy);\n dummy.value = url;\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n resolve(url);\n } else {\n reject(new Error(\"Your browser does not support copying to the clipboard.\"));\n }\n });\n }\n}\n\nPFElement.create(PfeClipboard);\n\nexport default PfeClipboard;\n"],"names":["PfeClipboard","PFElement","version","html","this","noIcon","tag","meta","title","description","templateUrl","styleUrl","events","copied","PfeType","PfeTypes","Content","properties","type","Boolean","observer","copiedDuration","Number","default","role","String","tabindex","slots","icon","slotName","slotClass","slotId","text","textSuccess","[object Object]","super","connectedCallback","addEventListener","_clickHandler","bind","_keydownHandler","removeEventListener","shadowRoot","_slotchangeHandler","disconnectedCallback","previousValue","_rendered","render","event","copyURLToClipboard","then","url","emitEvent","detail","setAttribute","setTimeout","removeAttribute","_formattedCopiedTimeout","catch","error","warn","key","keyCode","stopPropagation","preventDefault","Promise","resolve","reject","window","location","href","navigator","clipboard","writeText","document","queryCommandEnabled","dummy","createElement","body","appendChild","value","select","execCommand","removeChild","Error","create"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAMA,UAAqBC,EAGz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,EAAaY,OAAOC,OAAQ,CACzCwC,OAAQ,CACNF,IAAAA,KAKJ/C,KAAKkD,aAAa,SAAU,IAC5BC,WAAW,KACTnD,KAAKoD,gBAAgB,WACpBpD,KAAKqD,6BAETC,MAAMC,IACLvD,KAAKwD,KAAKD,KAMhBzB,0BACE,MAAMb,EAAiBC,OAA6B,IAAtBlB,KAAKiB,gBACnC,OAAMA,GAAkB,EAKfA,GAJPjB,KAAKwD,KAAK,oEAEH,KAQX1B,gBAAgBc,GAEd,OADUA,EAAMa,KAAOb,EAAMc,SAE3B,IAAK,QACH1D,KAAKkC,cAAcU,GACnB,MACF,IAAK,IAEHA,EAAMe,kBACNf,EAAMgB,iBACN5D,KAAKkC,cAAcU,IAgBzBd,qBACE,OAAO,IAAI+B,QAAQ,CAACC,EAASC,KAC3B,MAAMhB,EAAMiB,OAAOC,SAASC,KAE5B,GAAIC,UAAUC,UACZD,UAAUC,UAAUC,UAAUtB,GAAKD,KAAKgB,EAAQf,SAG7C,GAAIuB,SAASC,oBAAoB,QAAS,CAC7C,MAAMC,EAAQF,SAASG,cAAc,SACrCH,SAASI,KAAKC,YAAYH,GAC1BA,EAAMI,MAAQ7B,EACdyB,EAAMK,SACNP,SAASQ,YAAY,QACrBR,SAASI,KAAKK,YAAYP,GAC1BV,EAAQf,QAERgB,EAAO,IAAIiB,MAAM,+DAMzBnF,EAAUoF,OAAOrF"} \ No newline at end of file diff --git a/elements/pfe-clipboard/dist/pfe-clipboard.umd.js b/elements/pfe-clipboard/dist/pfe-clipboard.umd.js new file mode 100644 index 0000000000..de338781ce --- /dev/null +++ b/elements/pfe-clipboard/dist/pfe-clipboard.umd.js @@ -0,0 +1,353 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../../pfelement/dist/pfelement.umd')) : + typeof define === 'function' && define.amd ? define(['../../pfelement/dist/pfelement.umd'], factory) : + (global = global || self, global.PfeClipboard = factory(global.PFElement)); +}(this, (function (PFElement) { 'use strict'; + + PFElement = PFElement && Object.prototype.hasOwnProperty.call(PFElement, 'default') ? PFElement['default'] : PFElement; + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } + }; + + var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + }; + + var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + }; + + /*! + * PatternFly Elements: PfeClipboard 1.3.0 + * @license + * Copyright 2021 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + + var PfeClipboard = function (_PFElement) { + inherits(PfeClipboard, _PFElement); + createClass(PfeClipboard, [{ + key: "html", + + + // Injected at build-time + get: function get() { + return "\n\n" + (!this.noIcon ? "\n
    \n \n \n \n
    \n" : "") + "\n
    \n Copy URL\n
    \n
    \n Copied\n
    "; + } + }, { + key: "templateUrl", + get: function get() { + return "pfe-clipboard.html"; + } + }, { + key: "styleUrl", + get: function get() { + return "pfe-clipboard.scss"; + } + }], [{ + key: "version", + + + // Injected at build-time + get: function get() { + return "1.3.0"; + } + }, { + key: "tag", + get: function get() { + return "pfe-clipboard"; + } + }, { + key: "meta", + get: function get() { + return { + title: "Clipboard", + description: "Copy current URL to clipboard." + }; + } + }, { + key: "events", + get: function get() { + return { + copied: this.tag + ":copied" + }; + } + + // Declare the type of this component + + }, { + key: "PfeType", + get: function get() { + return PFElement.PfeTypes.Content; + } + }, { + key: "properties", + get: function get() { + return { + noIcon: { + title: "No icon", + type: Boolean, + observer: "_noIconChanged" + }, + copiedDuration: { + title: "Success message duration (in seconds)", + type: Number, + default: 3 + }, + role: { + type: String, + default: "button" + }, + tabindex: { + type: Number, + default: 0 + } + }; + } + }, { + key: "slots", + get: function get() { + return { + icon: { + title: "Icon", + description: "This field can accept an SVG, pfe-icon component, or other format for displaying an icon.", + slotName: "icon", + slotClass: "pfe-clipboard__icon", + slotId: "icon" + }, + text: { + title: "Default text", + slotName: "text", + slotClass: "pfe-clipboard__text", + slotId: "text" + }, + textSuccess: { + title: "Success message", + description: "Shown when the URL is successfully copied to the clipboard.", + slotName: "text--success", + slotClass: "pfe-clipboard__text--success", + slotId: "text--success" + } + }; + } + }]); + + function PfeClipboard() { + classCallCheck(this, PfeClipboard); + return possibleConstructorReturn(this, (PfeClipboard.__proto__ || Object.getPrototypeOf(PfeClipboard)).call(this, PfeClipboard, { type: PfeClipboard.PfeType })); + } + + createClass(PfeClipboard, [{ + key: "connectedCallback", + value: function connectedCallback() { + get(PfeClipboard.prototype.__proto__ || Object.getPrototypeOf(PfeClipboard.prototype), "connectedCallback", this).call(this); + + // Since this element as the role of button we are going to listen + // for click and as well as 'enter' and 'space' commands to trigger + // the copy functionality + this.addEventListener("click", this._clickHandler.bind(this)); + this.addEventListener("keydown", this._keydownHandler.bind(this)); + } + }, { + key: "disconnectedCallback", + value: function disconnectedCallback() { + this.removeEventListener("click", this._clickHandler.bind(this)); + this.removeEventListener("keydown", this._keydownHandler.bind(this)); + this.shadowRoot.removeEventListener("slotchange", this._slotchangeHandler.bind(this)); + get(PfeClipboard.prototype.__proto__ || Object.getPrototypeOf(PfeClipboard.prototype), "disconnectedCallback", this).call(this); + } + }, { + key: "_noIconChanged", + value: function _noIconChanged(previousValue) { + // dirty check to see if we should rerender the template + if (this._rendered && this.noIcon !== previousValue) { + this.render(); + } + } + }, { + key: "_clickHandler", + value: function _clickHandler(event) { + var _this2 = this; + + // Execute the copy to clipboard functionality + this.copyURLToClipboard().then(function (url) { + // Emit event that lets others know the user has "copied" + // the url. We are also going to include the url that was + // copied. + _this2.emitEvent(PfeClipboard.events.copied, { + detail: { + url: url + } + }); + // Toggle the copied state. Use the this._formattedCopiedTimeout function + // to an appropraite setTimout length. + _this2.setAttribute("copied", ""); + setTimeout(function () { + _this2.removeAttribute("copied"); + }, _this2._formattedCopiedTimeout()); + }).catch(function (error) { + _this2.warn(error); + }); + } + + // Formatted copied timeout value. Use the formattedCopiedTimeout function + // to get a type safe, millisecond value of the timeout duration. + + }, { + key: "_formattedCopiedTimeout", + value: function _formattedCopiedTimeout() { + var copiedDuration = Number(this.copiedDuration * 1000); + if (!(copiedDuration > -1)) { + this.warn("copied-duration must be a valid number. Defaulting to 3 seconds."); + // default to 3 seconds + return 3000; + } else { + return copiedDuration; + } + } + + // Listen for keyboard events and map them to their + // corresponding mouse events. + + }, { + key: "_keydownHandler", + value: function _keydownHandler(event) { + var key = event.key || event.keyCode; + switch (key) { + case "Enter" : + this._clickHandler(event); + break; + case " " : + // Prevent the browser from scolling when the user hits the space key + event.stopPropagation(); + event.preventDefault(); + this._clickHandler(event); + break; + } + } + + /** + * Copy url to the user's system clipboard + * + * If available, it will use the new Navigator API to access the system clipboard + * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard + * + * If unavailable, it will use the legacy execCommand("copy") + * https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand + * @async + * @return {Promise} url + */ + + }, { + key: "copyURLToClipboard", + value: function copyURLToClipboard() { + return new Promise(function (resolve, reject) { + var url = window.location.href; + // If the Clipboard API is available then use that + if (navigator.clipboard) { + navigator.clipboard.writeText(url).then(resolve(url)); + } + // If execCommand("copy") exists then use that method + else if (document.queryCommandEnabled("copy")) { + var dummy = document.createElement("input"); + document.body.appendChild(dummy); + dummy.value = url; + dummy.select(); + document.execCommand("copy"); + document.body.removeChild(dummy); + resolve(url); + } else { + reject(new Error("Your browser does not support copying to the clipboard.")); + } + }); + } + }]); + return PfeClipboard; + }(PFElement); + + PFElement.create(PfeClipboard); + + return PfeClipboard; + +}))); +//# sourceMappingURL=pfe-clipboard.umd.js.map diff --git a/elements/pfe-clipboard/dist/pfe-clipboard.umd.js.map b/elements/pfe-clipboard/dist/pfe-clipboard.umd.js.map new file mode 100644 index 0000000000..0fda1e2900 --- /dev/null +++ b/elements/pfe-clipboard/dist/pfe-clipboard.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pfe-clipboard.umd.js","sources":["../_temp/pfe-clipboard.umd.js"],"sourcesContent":["/*!\n * PatternFly Elements: PfeClipboard 1.3.0\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\nimport PFElement from \"../../pfelement/dist/pfelement\";\n\nclass PfeClipboard extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.3.0\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n${!this.noIcon ? `\n
    \n \n \n \n
    \n` : \"\"}\n
    \n Copy URL\n
    \n
    \n Copied\n
    `;\n }\n\n static get tag() {\n return \"pfe-clipboard\";\n }\n\n static get meta() {\n return {\n title: \"Clipboard\",\n description: \"Copy current URL to clipboard.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-clipboard.html\";\n }\n\n get styleUrl() {\n return \"pfe-clipboard.scss\";\n }\n\n static get events() {\n return {\n copied: `${this.tag}:copied`\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Content;\n }\n\n static get properties() {\n return {\n noIcon: {\n title: \"No icon\",\n type: Boolean,\n observer: \"_noIconChanged\"\n },\n copiedDuration: {\n title: \"Success message duration (in seconds)\",\n type: Number,\n default: 3\n },\n role: {\n type: String,\n default: \"button\"\n },\n tabindex: {\n type: Number,\n default: 0\n }\n };\n }\n\n static get slots() {\n return {\n icon: {\n title: \"Icon\",\n description: \"This field can accept an SVG, pfe-icon component, or other format for displaying an icon.\",\n slotName: \"icon\",\n slotClass: \"pfe-clipboard__icon\",\n slotId: \"icon\"\n },\n text: {\n title: \"Default text\",\n slotName: \"text\",\n slotClass: \"pfe-clipboard__text\",\n slotId: \"text\"\n },\n textSuccess: {\n title: \"Success message\",\n description: \"Shown when the URL is successfully copied to the clipboard.\",\n slotName: \"text--success\",\n slotClass: \"pfe-clipboard__text--success\",\n slotId: \"text--success\"\n }\n };\n }\n\n constructor() {\n super(PfeClipboard, { type: PfeClipboard.PfeType });\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n // Since this element as the role of button we are going to listen\n // for click and as well as 'enter' and 'space' commands to trigger\n // the copy functionality\n this.addEventListener(\"click\", this._clickHandler.bind(this));\n this.addEventListener(\"keydown\", this._keydownHandler.bind(this));\n }\n\n disconnectedCallback() {\n this.removeEventListener(\"click\", this._clickHandler.bind(this));\n this.removeEventListener(\"keydown\", this._keydownHandler.bind(this));\n this.shadowRoot.removeEventListener(\"slotchange\", this._slotchangeHandler.bind(this));\n super.disconnectedCallback();\n }\n\n _noIconChanged(previousValue) {\n // dirty check to see if we should rerender the template\n if (this._rendered && this.noIcon !== previousValue) {\n this.render();\n }\n }\n\n _clickHandler(event) {\n // Execute the copy to clipboard functionality\n this.copyURLToClipboard()\n .then(url => {\n // Emit event that lets others know the user has \"copied\"\n // the url. We are also going to include the url that was\n // copied.\n this.emitEvent(PfeClipboard.events.copied, {\n detail: {\n url\n }\n });\n // Toggle the copied state. Use the this._formattedCopiedTimeout function\n // to an appropraite setTimout length.\n this.setAttribute(\"copied\", \"\");\n setTimeout(() => {\n this.removeAttribute(\"copied\");\n }, this._formattedCopiedTimeout());\n })\n .catch(error => {\n this.warn(error);\n });\n }\n\n // Formatted copied timeout value. Use the formattedCopiedTimeout function\n // to get a type safe, millisecond value of the timeout duration.\n _formattedCopiedTimeout() {\n const copiedDuration = Number(this.copiedDuration * 1000);\n if (!(copiedDuration > -1)) {\n this.warn(`copied-duration must be a valid number. Defaulting to 3 seconds.`);\n // default to 3 seconds\n return 3000;\n } else {\n return copiedDuration;\n }\n }\n\n // Listen for keyboard events and map them to their\n // corresponding mouse events.\n _keydownHandler(event) {\n let key = event.key || event.keyCode;\n switch (key) {\n case \"Enter\" || 13:\n this._clickHandler(event);\n break;\n case \" \" || 32:\n // Prevent the browser from scolling when the user hits the space key\n event.stopPropagation();\n event.preventDefault();\n this._clickHandler(event);\n break;\n }\n }\n\n /**\n * Copy url to the user's system clipboard\n *\n * If available, it will use the new Navigator API to access the system clipboard\n * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard\n *\n * If unavailable, it will use the legacy execCommand(\"copy\")\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand\n * @async\n * @return {Promise} url\n */\n copyURLToClipboard() {\n return new Promise((resolve, reject) => {\n const url = window.location.href;\n // If the Clipboard API is available then use that\n if (navigator.clipboard) {\n navigator.clipboard.writeText(url).then(resolve(url));\n }\n // If execCommand(\"copy\") exists then use that method\n else if (document.queryCommandEnabled(\"copy\")) {\n const dummy = document.createElement(\"input\");\n document.body.appendChild(dummy);\n dummy.value = url;\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n resolve(url);\n } else {\n reject(new Error(\"Your browser does not support copying to the clipboard.\"));\n }\n });\n }\n}\n\nPFElement.create(PfeClipboard);\n\nexport default PfeClipboard;\n"],"names":["PfeClipboard","noIcon","title","description","copied","tag","PFElement","PfeTypes","Content","type","Boolean","observer","copiedDuration","Number","default","role","String","tabindex","icon","slotName","slotClass","slotId","text","textSuccess","PfeType","addEventListener","_clickHandler","bind","_keydownHandler","removeEventListener","shadowRoot","_slotchangeHandler","previousValue","_rendered","render","event","copyURLToClipboard","then","emitEvent","events","detail","url","setAttribute","setTimeout","removeAttribute","_formattedCopiedTimeout","catch","warn","error","key","keyCode","stopPropagation","preventDefault","Promise","resolve","reject","window","location","href","navigator","clipboard","writeText","document","queryCommandEnabled","dummy","createElement","body","appendChild","value","select","execCommand","removeChild","Error","create"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;MA2BMA;;;;;;EAOJ;0BACW;EACT,whFAEF,CAAC,KAAKC,MAAN,i+BAME,EARA;EAeD;;;0BAaiB;EAChB,aAAO,oBAAP;EACD;;;0BAEc;EACb,aAAO,oBAAP;EACD;;;;;EAzCD;0BACqB;EACnB,aAAO,OAAP;EACD;;;0BAqBgB;EACf,aAAO,eAAP;EACD;;;0BAEiB;EAChB,aAAO;EACLC,eAAO,WADF;EAELC,qBAAa;EAFR,OAAP;EAID;;;0BAUmB;EAClB,aAAO;EACLC,gBAAW,KAAKC,GAAhB;EADK,OAAP;EAGD;;EAED;;;;0BACqB;EACnB,aAAOC,UAAUC,QAAV,CAAmBC,OAA1B;EACD;;;0BAEuB;EACtB,aAAO;EACLP,gBAAQ;EACNC,iBAAO,SADD;EAENO,gBAAMC,OAFA;EAGNC,oBAAU;EAHJ,SADH;EAMLC,wBAAgB;EACdV,iBAAO,uCADO;EAEdO,gBAAMI,MAFQ;EAGdC,mBAAS;EAHK,SANX;EAWLC,cAAM;EACJN,gBAAMO,MADF;EAEJF,mBAAS;EAFL,SAXD;EAeLG,kBAAU;EACRR,gBAAMI,MADE;EAERC,mBAAS;EAFD;EAfL,OAAP;EAoBD;;;0BAEkB;EACjB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qBAASI,IAAT,CAAcC,WAAd,CAA0BH,KAA1B;EACAA,kBAAMI,KAAN,GAAc3B,GAAd;EACAuB,kBAAMK,MAAN;EACAP,qBAASQ,WAAT,CAAqB,MAArB;EACAR,qBAASI,IAAT,CAAcK,WAAd,CAA0BP,KAA1B;EACAV,oBAAQb,GAAR;EACD,WARI,MAQE;EACLc,mBAAO,IAAIiB,KAAJ,CAAU,yDAAV,CAAP;EACD;EACF,OAlBM,CAAP;EAmBD;;;IAzNwBlE;;EA4N3BA,UAAUmE,MAAV,CAAiBzE,YAAjB;;;;;;;;"} \ No newline at end of file diff --git a/elements/pfe-clipboard/dist/pfe-clipboard.umd.min.js b/elements/pfe-clipboard/dist/pfe-clipboard.umd.min.js new file mode 100644 index 0000000000..bb57123f90 --- /dev/null +++ b/elements/pfe-clipboard/dist/pfe-clipboard.umd.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../pfelement/dist/pfelement.umd.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min"],t):(e=e||self).PfeClipboard=t(e.PFElement)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(e,t,o){return t&&i(e.prototype,t),o&&i(e,o),e};function i(e,t){for(var o=0;o:host{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;color:#06c!important;color:var(--pfe-clipboard--Color,var(--pfe-broadcasted--link,#06c))!important;font-weight:300;font-weight:var(--pfe-clipboard--FontWeight,var(--pfe-theme--font-weight--light,300));font-size:1rem!important;font-size:var(--pfe-clipboard--FontSize,1rem)!important;cursor:pointer;padding:6px 16px;padding:var(--pfe-clipboard--Padding,6px 16px)}:host([hidden]){display:none}.pfe-clipboard__icon{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:1em;width:var(--pfe-clipboard--icon--Width,var(--pfe-theme--icon-size,1em));height:auto;height:var(--pfe-clipboard--icon--Height,auto);margin:0 .4825rem 0 0;margin:var(--pfe-clipboard--icon--Margin,0 .4825rem 0 0);--pfe-icon--Color:var(--pfe-clipboard--icon--Color, var(--pfe-theme--color--text--muted, #6a6e73))}.pfe-clipboard__icon svg{fill:#6a6e73!important;fill:var(--pfe-clipboard--icon--Color,var(--pfe-theme--color--text--muted,#6a6e73))!important}.pfe-clipboard__text{color:#06c!important;color:var(--pfe-clipboard--Color,var(--pfe-broadcasted--link,#06c))!important}.pfe-clipboard__text--success{color:#3e8635!important;color:var(--pfe-clipboard--text--success--Color,var(--pfe-theme--color--feedback--success,#3e8635))!important}.pfe-clipboard[copied] .pfe-clipboard__text,:host([copied]) .pfe-clipboard__text{display:none!important}.pfe-clipboard:not([copied]) .pfe-clipboard__text--success,:host(:not([copied])) .pfe-clipboard__text--success{display:none!important}.pfe-clipboard__icon>*,::slotted([slot=icon]){width:100%}:host(:not([aria-disabled=true]).focus-within),:host(:not([aria-disabled=true]):focus){--pfe-clipboard--Color:var(--pfe-clipboard--Color--focus, var(--pfe-broadcasted--link--focus, #004080))}:host(:not([aria-disabled=true])) ::slotted(:hover),:host(:not([aria-disabled=true]):hover){--pfe-clipboard--Color:var(--pfe-clipboard--Color--hover, var(--pfe-broadcasted--link--hover, #004080))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{display:inline-block}.pfe-clipboard__icon{display:inline-block;margin-right:0}.pfe-clipboard__text{display:inline-block}.pfe-clipboard__text--success{display:inline-block}} /*# sourceMappingURL=pfe-clipboard.min.css.map */\n"+(this.noIcon?"":'\n
    \n \n \n \n
    \n')+'\n
    \n Copy URL\n
    \n'}},{key:"templateUrl",get:function(){return"pfe-clipboard.html"}},{key:"styleUrl",get:function(){return"pfe-clipboard.scss"}}],[{key:"version",get:function(){return"1.3.0"}},{key:"tag",get:function(){return"pfe-clipboard"}},{key:"meta",get:function(){return{title:"Clipboard",description:"Copy current URL to clipboard."}}},{key:"events",get:function(){return{copied:this.tag+":copied"}}},{key:"PfeType",get:function(){return e.PfeTypes.Content}},{key:"properties",get:function(){return{noIcon:{title:"No icon",type:Boolean,observer:"_noIconChanged"},copiedDuration:{title:"Success message duration (in seconds)",type:Number,default:3},role:{type:String,default:"button"},tabindex:{type:Number,default:0}}}},{key:"slots",get:function(){return{icon:{title:"Icon",description:"This field can accept an SVG, pfe-icon component, or other format for displaying an icon.",slotName:"icon",slotClass:"pfe-clipboard__icon",slotId:"icon"},text:{title:"Default text",slotName:"text",slotClass:"pfe-clipboard__text",slotId:"text"},textSuccess:{title:"Success message",description:"Shown when the URL is successfully copied to the clipboard.",slotName:"text--success",slotClass:"pfe-clipboard__text--success",slotId:"text--success"}}}}]),o(a,[{key:"connectedCallback",value:function(){n(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"connectedCallback",this).call(this),this.addEventListener("click",this._clickHandler.bind(this)),this.addEventListener("keydown",this._keydownHandler.bind(this))}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._clickHandler.bind(this)),this.removeEventListener("keydown",this._keydownHandler.bind(this)),this.shadowRoot.removeEventListener("slotchange",this._slotchangeHandler.bind(this)),n(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"disconnectedCallback",this).call(this)}},{key:"_noIconChanged",value:function(e){this._rendered&&this.noIcon!==e&&this.render()}},{key:"_clickHandler",value:function(e){var t=this;this.copyURLToClipboard().then(function(e){t.emitEvent(a.events.copied,{detail:{url:e}}),t.setAttribute("copied",""),setTimeout(function(){t.removeAttribute("copied")},t._formattedCopiedTimeout())}).catch(function(e){t.warn(e)})}},{key:"_formattedCopiedTimeout",value:function(){var e=Number(1e3*this.copiedDuration);return-1:host{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;color:#06c!important;color:var(--pfe-clipboard--Color,var(--pfe-broadcasted--link,#06c))!important;font-weight:300;font-weight:var(--pfe-clipboard--FontWeight,var(--pfe-theme--font-weight--light,300));font-size:1rem!important;font-size:var(--pfe-clipboard--FontSize,1rem)!important;cursor:pointer;padding:6px 16px;padding:var(--pfe-clipboard--Padding,6px 16px)}:host([hidden]){display:none}.pfe-clipboard__icon{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:1em;width:var(--pfe-clipboard--icon--Width,var(--pfe-theme--icon-size,1em));height:auto;height:var(--pfe-clipboard--icon--Height,auto);margin:0 .4825rem 0 0;margin:var(--pfe-clipboard--icon--Margin,0 .4825rem 0 0);--pfe-icon--Color:var(--pfe-clipboard--icon--Color, var(--pfe-theme--color--text--muted, #6a6e73))}.pfe-clipboard__icon svg{fill:#6a6e73!important;fill:var(--pfe-clipboard--icon--Color,var(--pfe-theme--color--text--muted,#6a6e73))!important}.pfe-clipboard__text{color:#06c!important;color:var(--pfe-clipboard--Color,var(--pfe-broadcasted--link,#06c))!important}.pfe-clipboard__text--success{color:#3e8635!important;color:var(--pfe-clipboard--text--success--Color,var(--pfe-theme--color--feedback--success,#3e8635))!important}.pfe-clipboard[copied] .pfe-clipboard__text,:host([copied]) .pfe-clipboard__text{display:none!important}.pfe-clipboard:not([copied]) .pfe-clipboard__text--success,:host(:not([copied])) .pfe-clipboard__text--success{display:none!important}.pfe-clipboard__icon>*,::slotted([slot=icon]){width:100%}:host(:not([aria-disabled=true]).focus-within),:host(:not([aria-disabled=true]):focus){--pfe-clipboard--Color:var(--pfe-clipboard--Color--focus, var(--pfe-broadcasted--link--focus, #004080))}:host(:not([aria-disabled=true])) ::slotted(:hover),:host(:not([aria-disabled=true]):hover){--pfe-clipboard--Color:var(--pfe-clipboard--Color--hover, var(--pfe-broadcasted--link--hover, #004080))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{display:inline-block}.pfe-clipboard__icon{display:inline-block;margin-right:0}.pfe-clipboard__text{display:inline-block}.pfe-clipboard__text--success{display:inline-block}} /*# sourceMappingURL=pfe-clipboard.min.css.map */\n${!this.noIcon ? `\n
    \n \n \n \n
    \n` : \"\"}\n
    \n Copy URL\n
    \n
    \n Copied\n
    `;\n }\n\n static get tag() {\n return \"pfe-clipboard\";\n }\n\n static get meta() {\n return {\n title: \"Clipboard\",\n description: \"Copy current URL to clipboard.\"\n };\n }\n\n get templateUrl() {\n return \"pfe-clipboard.html\";\n }\n\n get styleUrl() {\n return \"pfe-clipboard.scss\";\n }\n\n static get events() {\n return {\n copied: `${this.tag}:copied`\n };\n }\n\n // Declare the type of this component\n static get PfeType() {\n return PFElement.PfeTypes.Content;\n }\n\n static get properties() {\n return {\n noIcon: {\n title: \"No icon\",\n type: Boolean,\n observer: \"_noIconChanged\"\n },\n copiedDuration: {\n title: \"Success message duration (in seconds)\",\n type: Number,\n default: 3\n },\n role: {\n type: String,\n default: \"button\"\n },\n tabindex: {\n type: Number,\n default: 0\n }\n };\n }\n\n static get slots() {\n return {\n icon: {\n title: \"Icon\",\n description: \"This field can accept an SVG, pfe-icon component, or other format for displaying an icon.\",\n slotName: \"icon\",\n slotClass: \"pfe-clipboard__icon\",\n slotId: \"icon\"\n },\n text: {\n title: \"Default text\",\n slotName: \"text\",\n slotClass: \"pfe-clipboard__text\",\n slotId: \"text\"\n },\n textSuccess: {\n title: \"Success message\",\n description: \"Shown when the URL is successfully copied to the clipboard.\",\n slotName: \"text--success\",\n slotClass: \"pfe-clipboard__text--success\",\n slotId: \"text--success\"\n }\n };\n }\n\n constructor() {\n super(PfeClipboard, { type: PfeClipboard.PfeType });\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n // Since this element as the role of button we are going to listen\n // for click and as well as 'enter' and 'space' commands to trigger\n // the copy functionality\n this.addEventListener(\"click\", this._clickHandler.bind(this));\n this.addEventListener(\"keydown\", this._keydownHandler.bind(this));\n }\n\n disconnectedCallback() {\n this.removeEventListener(\"click\", this._clickHandler.bind(this));\n this.removeEventListener(\"keydown\", this._keydownHandler.bind(this));\n this.shadowRoot.removeEventListener(\"slotchange\", this._slotchangeHandler.bind(this));\n super.disconnectedCallback();\n }\n\n _noIconChanged(previousValue) {\n // dirty check to see if we should rerender the template\n if (this._rendered && this.noIcon !== previousValue) {\n this.render();\n }\n }\n\n _clickHandler(event) {\n // Execute the copy to clipboard functionality\n this.copyURLToClipboard()\n .then(url => {\n // Emit event that lets others know the user has \"copied\"\n // the url. We are also going to include the url that was\n // copied.\n this.emitEvent(PfeClipboard.events.copied, {\n detail: {\n url\n }\n });\n // Toggle the copied state. Use the this._formattedCopiedTimeout function\n // to an appropraite setTimout length.\n this.setAttribute(\"copied\", \"\");\n setTimeout(() => {\n this.removeAttribute(\"copied\");\n }, this._formattedCopiedTimeout());\n })\n .catch(error => {\n this.warn(error);\n });\n }\n\n // Formatted copied timeout value. Use the formattedCopiedTimeout function\n // to get a type safe, millisecond value of the timeout duration.\n _formattedCopiedTimeout() {\n const copiedDuration = Number(this.copiedDuration * 1000);\n if (!(copiedDuration > -1)) {\n this.warn(`copied-duration must be a valid number. Defaulting to 3 seconds.`);\n // default to 3 seconds\n return 3000;\n } else {\n return copiedDuration;\n }\n }\n\n // Listen for keyboard events and map them to their\n // corresponding mouse events.\n _keydownHandler(event) {\n let key = event.key || event.keyCode;\n switch (key) {\n case \"Enter\" || 13:\n this._clickHandler(event);\n break;\n case \" \" || 32:\n // Prevent the browser from scolling when the user hits the space key\n event.stopPropagation();\n event.preventDefault();\n this._clickHandler(event);\n break;\n }\n }\n\n /**\n * Copy url to the user's system clipboard\n *\n * If available, it will use the new Navigator API to access the system clipboard\n * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard\n *\n * If unavailable, it will use the legacy execCommand(\"copy\")\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand\n * @async\n * @return {Promise} url\n */\n copyURLToClipboard() {\n return new Promise((resolve, reject) => {\n const url = window.location.href;\n // If the Clipboard API is available then use that\n if (navigator.clipboard) {\n navigator.clipboard.writeText(url).then(resolve(url));\n }\n // If execCommand(\"copy\") exists then use that method\n else if (document.queryCommandEnabled(\"copy\")) {\n const dummy = document.createElement(\"input\");\n document.body.appendChild(dummy);\n dummy.value = url;\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n resolve(url);\n } else {\n reject(new Error(\"Your browser does not support copying to the clipboard.\"));\n }\n });\n }\n}\n\nPFElement.create(PfeClipboard);\n\nexport default PfeClipboard;\n"],"names":["PfeClipboard","PFElement","this","noIcon","tag","PfeTypes","Content","Boolean","Number","String","addEventListener","_clickHandler","bind","_keydownHandler","removeEventListener","shadowRoot","_slotchangeHandler","previousValue","_rendered","render","event","copyURLToClipboard","then","emitEvent","events","copied","setAttribute","removeAttribute","_this2","_formattedCopiedTimeout","catch","warn","error","copiedDuration","key","keyCode","stopPropagation","preventDefault","Promise","resolve","reject","dummy","url","window","location","href","navigator","clipboard","writeText","document","queryCommandEnabled","createElement","body","appendChild","value","select","execCommand","removeChild","Error","type","PfeType","create"],"mappings":"qkCA2BMA,+TAAqBC,kjFAWxBC,KAAKC,OAMJ,+sCAqBO,4DAIA,6DAtCA,0CAuBA,mDAIA,OACE,wBACM,uEAaR,QACMD,KAAKE,sDAMXH,EAAUI,SAASC,iDAInB,QACG,OACC,eACDC,iBACI,iCAEI,OACP,6CACDC,eACG,QAEL,MACEC,eACG,mBAED,MACFD,eACG,wCAMN,MACC,OACG,mBACM,qGACH,iBACC,6BACH,aAEJ,OACG,wBACG,iBACC,6BACH,oBAEG,OACJ,8BACM,uEACH,0BACC,sCACH,2KAePE,iBAAiB,QAASR,KAAKS,cAAcC,KAAKV,YAClDQ,iBAAiB,UAAWR,KAAKW,gBAAgBD,KAAKV,2DAItDY,oBAAoB,QAASZ,KAAKS,cAAcC,KAAKV,YACrDY,oBAAoB,UAAWZ,KAAKW,gBAAgBD,KAAKV,YACzDa,WAAWD,oBAAoB,aAAcZ,KAAKc,mBAAmBJ,KAAKV,kJAIlEe,GAETf,KAAKgB,WAAahB,KAAKC,SAAWc,QAC/BE,+CAIKC,mBAEPC,qBACFC,KAAK,cAICC,UAAUvB,EAAawB,OAAOC,OAAQ,QACjC,YAMLC,aAAa,SAAU,eACjB,aACJC,gBAAgB,WACpBC,EAAKC,6BAETC,MAAM,cACAC,KAAKC,2DAORC,EAAiBzB,OAA6B,IAAtBN,KAAK+B,uBACX,EAAlBA,EAKGA,QAJFF,yEAEE,6CAQKX,UACJA,EAAMc,KAAOd,EAAMe,aAEtB,aACExB,cAAcS,aAEhB,MAEGgB,oBACAC,sBACD1B,cAAcS,wDAiBhB,IAAIkB,QAAQ,SAACC,EAASC,OAQnBC,EAPFC,EAAMC,OAAOC,SAASC,KAExBC,UAAUC,oBACFA,UAAUC,UAAUN,GAAKpB,KAAKiB,EAAQG,IAGzCO,SAASC,oBAAoB,SAC9BT,EAAQQ,SAASE,cAAc,kBAC5BC,KAAKC,YAAYZ,KACpBa,MAAQZ,IACRa,kBACGC,YAAY,iBACZJ,KAAKK,YAAYhB,KAClBC,MAED,IAAIgB,MAAM,4JA7Gf1D,EAAc,CAAE2D,KAAM3D,EAAa4D,kBAmH7C3D,EAAU4D,OAAO7D"} \ No newline at end of file diff --git a/elements/pfe-clipboard/package.json b/elements/pfe-clipboard/package.json index 1e963bae86..27a373a39f 100644 --- a/elements/pfe-clipboard/package.json +++ b/elements/pfe-clipboard/package.json @@ -12,7 +12,7 @@ "assets": [], "preview": "clipboard.png" }, - "version": "1.2.0", + "version": "1.3.0", "keywords": [ "web-components", "html" @@ -53,9 +53,9 @@ ], "license": "MIT", "dependencies": { - "@patternfly/pfelement": "^1.2.0" + "@patternfly/pfelement": "^1.3.0" }, "devDependencies": { - "@patternfly/pfe-sass": "^1.2.0" + "@patternfly/pfe-sass": "^1.3.0" } } diff --git a/elements/pfe-codeblock/dist/pfe-codeblock-material-dark.css.map b/elements/pfe-codeblock/dist/pfe-codeblock-material-dark.css.map new file mode 100644 index 0000000000..eedf663fa4 --- /dev/null +++ b/elements/pfe-codeblock/dist/pfe-codeblock-material-dark.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-codeblock-material-dark.scss","../../pfe-sass/functions/_custom-properties.scss","pfe-codeblock-material-dark.css"],"names":[],"mappings":"AAgBA;;EAGE,gBAAgB;EAChB,gBAAgB;EAChB,oBAAoB;EACpB,kBAAkB;EAClB,iBAAiB;EACjB,cAbmB;EAcnB,mBAZoB;EAapB,wECWkC;EDXlC,6GCWkC;EDVlC,cAAc;EACd,kBAAkB;EAClB,gBAAW;IAAX,cAAW;OAAX,WAAW;EACX,qBAAa;MAAb,iBAAa;UAAb,aAAa;AEhBf;;AFEA;EAqBE,mBAvByB;AEO3B;;AFLA;;;;EAqBE,mBAvByB;AEO3B;;AFLA;EAyBE,mBAAmB;EACnB,oBAAoB;EACpB,cAAc;AEhBhB;;AFXA;EA+BE,cAAc;EACd,kBAAkB;EAClB,eAAe;EACf,mBAAmB;AEhBrB;;AFlBA;EAoCG,kBAAkB;EAClB,mBAAmB;EACnB,yBAAyB;AEd5B;;AFxBA;;;EA6CE,cAzDqB;AE0CvB;;AF9BA;EAiDE,YAAY;AEfd;;AFlCA;EAsDG,cA7DoB;AE6CvB;;AFtCA;EA0DG,cAtEoB;AEsDvB;;AF1CA;EA8DG,cAxEmB;AEwDtB;;AF9CA;EAkEG,cA5EmB;AE4DtB;;AFlDA;EAsEG,cA7EoB;AE6DvB;;AFtDA;EA0EG,cAtFoB;AEsEvB;;AF1DA;EA8EG,cAvFkB;AEuErB;;AF9DA;EAkFG,cA3FkB;AE2ErB;;AFlEA;EAsFG,cAlGoB;AEkFvB;;AFtEA;EA0FG,cArGoB;AEqFvB;;AF1EA;EA8FG,cApGuB;AEoF1B;;AF9EA;EAkGG,cAzGoB;AEyFvB;;AFlFA;EAsGG,cAnHiB;AEmGpB;;AFtFA;EA0GG,cAhHuB;AEgG1B;;AF1FA;EA8GG,cA3HiB;AE2GpB;;AF9FA;EAkHG,cAzHoB;AEyGvB;;AFlGA;EAsHG,cAjIoB;AEiHvB;;AFtGA;EA0HG,cAjIoB;EAkIpB,iBAAiB;AEhBpB;;AF3GA;EA+HG,cAtIoB;EAuIpB,iBAAiB;AEhBpB;;AFhHA;EAoIG,cA7IkB;AE6HrB;;AFpHA;EAwIG,cA/IoB;AE+HvB;;AFxHA;EA4IG,cAxJoB;AEwIvB;;AF5HA;EAgJG,cAxJkB;AEwIrB;;AFhIA;EAoJG,cA1JuB;AE0I1B;;AFpIA;EAwJG,cAjKkB;AEiJrB;;AFxIA;EA4JG,cAtKmB;AEsJtB;;AF5IA;EAgKG,cA1KmB;AE0JtB;;AFhJA;EAoKG,cA5KkB;AE4JrB;;AFpJA;EAwKG,cAnLoB;AEmKvB;;AFxJA;EA4KG,cAzLiB;AEyKpB;;AF5JA;EAgLG,cA1LmB;AE0KtB;;AFhKA;EAoLG,cA3LoB;AE2KvB;;AFpKA;EAwLG,cArMiB;AEqLpB;;AFxKA;EA4LG,cAxMoB;AEwLvB;;AF5KA;EAgMG,cA7MiB;AE6LpB;;AFhLA;EAoMG,cAjNiB;AEiMpB","file":"pfe-codeblock-material-dark.css","sourcesContent":["@import \"../../pfe-sass/pfe-sass\";\n\n//Define custom colors\n$custom-red: #FF6666;\n$custom-orange: #FE9A8C; //(red, #eee, etc.)\n$custom-yellow: #FFCB6B; //(height, width, cx, cy, etc.)\n$custom-green: #A5E844;\n$custom-teal: #80CBC4;\n$custom-blue: #73BCF7;\n$custom-purple: #C792EA;\n$custom-dark-gray: #B8BBBE; // (numbers and divider)\n$custom-gray: #B8BBBE; // (text)\n$custom-white: #FFF;\n$custom-black: #2f2f2f;\n$custom-hilight-bg: #363636;\n\n:host([code-theme=\"dark\"]) {\n\tcode[class*=\"language-\"],\n\tpre[class*=\"language-\"] {\n\t\ttext-align: left;\n\t\twhite-space: pre;\n\t\tword-spacing: normal;\n\t\tword-break: normal;\n\t\tword-wrap: normal;\n\t\tcolor: $custom-gray;\n\t\tbackground: $custom-black;\n\t\tfont-family: pfe-var(font-family--code);\n\t\tfont-size: 1em;\n\t\tline-height: 1.5em;\n\t\ttab-size: 4;\n\t\thyphens: none;\n\t}\n\n\tcode[class*=\"language-\"]::selection,\n\tpre[class*=\"language-\"]::selection,\n\tcode[class*=\"language-\"] ::selection,\n\tpre[class*=\"language-\"] ::selection {\n\t\tbackground: $custom-hilight-bg;\n\t}\n\n\t:not(pre) > code[class*=\"language-\"] {\n\t\twhite-space: normal;\n\t\tborder-radius: 0.2em;\n\t\tpadding: 0.1em;\n\t}\n\n\tpre[class*=\"language-\"] {\n\t\toverflow: auto;\n\t\tposition: relative;\n\t\tmargin: 0.5em 0;\n\t\tpadding: 1.25em 1em;\n\t\t&.line-numbers {\n\t\t\tposition: relative;\n\t\t\tpadding-left: 3.8em;\n\t\t\tcounter-reset: linenumber;\n\t\t}\n\t}\n\n\t.language-css > code,\n\t.language-sass > code,\n\t.language-scss > code {\n\t\tcolor: $custom-orange;\n\t}\n\n\t[class*=\"language-\"] .namespace {\n\t\topacity: 0.7;\n\t}\n\n\t.token {\n\t\t&.atrule {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.attr-name {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.attr-value {\n\t\t\tcolor: $custom-green;\n\t\t}\n\t\n\t\t&.attribute {\n\t\t\tcolor: $custom-green;\n\t\t}\n\t\n\t\t&.boolean {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.builtin {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.cdata {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.char {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.class {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.class-name {\n\t\t\tcolor: $custom-yellow;\n\t\t}\n\t\n\t\t&.comment {\n\t\t\tcolor: $custom-dark-gray;\n\t\t}\n\t\n\t\t&.constant {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.deleted {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.doctype {\n\t\t\tcolor: $custom-dark-gray;\n\t\t}\n\t\n\t\t&.entity {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.function {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.hexcode {\n\t\t\tcolor: $custom-yellow;\n\t\t}\n\t\n\t\t&.id {\n\t\t\tcolor: $custom-purple;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\n\t\t&.important {\n\t\t\tcolor: $custom-purple;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\n\t\t&.inserted {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.keyword {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.number {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.operator {\n\t\t\tcolor: $custom-blue;\n\t\t}\n\t\n\t\t&.prolog {\n\t\t\tcolor: $custom-dark-gray;\n\t\t}\n\t\n\t\t&.property {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.pseudo-class {\n\t\t\tcolor: $custom-green;\n\t\t}\n\t\n\t\t&.pseudo-element {\n\t\t\tcolor: $custom-green;\n\t\t}\n\t\n\t\t&.punctuation {\n\t\t\tcolor: $custom-blue;\n\t\t}\n\t\n\t\t&.regex {\n\t\t\tcolor: $custom-yellow;\n\t\t}\n\t\n\t\t&.selector {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.string {\n\t\t\tcolor: $custom-green;\n\t\t}\n\t\n\t\t&.symbol {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.tag {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.unit {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.url {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.variable {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t}\n}","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}",":host([code-theme=\"dark\"]) code[class*=\"language-\"],\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"] {\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n color: #B8BBBE;\n background: #2f2f2f;\n font-family: var(--pfe-theme--font-family--code, \"Overpass Mono\", Consolas, Monaco, \"Andale Mono\", monospace);\n font-size: 1em;\n line-height: 1.5em;\n tab-size: 4;\n hyphens: none;\n}\n\n:host([code-theme=\"dark\"]) code[class*=\"language-\"]::selection,\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"]::selection,\n:host([code-theme=\"dark\"]) code[class*=\"language-\"] ::selection,\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"] ::selection {\n background: #363636;\n}\n\n:host([code-theme=\"dark\"]) :not(pre) > code[class*=\"language-\"] {\n white-space: normal;\n border-radius: 0.2em;\n padding: 0.1em;\n}\n\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"] {\n overflow: auto;\n position: relative;\n margin: 0.5em 0;\n padding: 1.25em 1em;\n}\n\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"].line-numbers {\n position: relative;\n padding-left: 3.8em;\n counter-reset: linenumber;\n}\n\n:host([code-theme=\"dark\"]) .language-css > code,\n:host([code-theme=\"dark\"]) .language-sass > code,\n:host([code-theme=\"dark\"]) .language-scss > code {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) [class*=\"language-\"] .namespace {\n opacity: 0.7;\n}\n\n:host([code-theme=\"dark\"]) .token.atrule {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.attr-name {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.attr-value {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.attribute {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.boolean {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.builtin {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.cdata {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.char {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.class {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.class-name {\n color: #FFCB6B;\n}\n\n:host([code-theme=\"dark\"]) .token.comment {\n color: #B8BBBE;\n}\n\n:host([code-theme=\"dark\"]) .token.constant {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.deleted {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.doctype {\n color: #B8BBBE;\n}\n\n:host([code-theme=\"dark\"]) .token.entity {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.function {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.hexcode {\n color: #FFCB6B;\n}\n\n:host([code-theme=\"dark\"]) .token.id {\n color: #C792EA;\n font-weight: bold;\n}\n\n:host([code-theme=\"dark\"]) .token.important {\n color: #C792EA;\n font-weight: bold;\n}\n\n:host([code-theme=\"dark\"]) .token.inserted {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.keyword {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.number {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.operator {\n color: #73BCF7;\n}\n\n:host([code-theme=\"dark\"]) .token.prolog {\n color: #B8BBBE;\n}\n\n:host([code-theme=\"dark\"]) .token.property {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.pseudo-class {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.pseudo-element {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.punctuation {\n color: #73BCF7;\n}\n\n:host([code-theme=\"dark\"]) .token.regex {\n color: #FFCB6B;\n}\n\n:host([code-theme=\"dark\"]) .token.selector {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.string {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.symbol {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.tag {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.unit {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.url {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.variable {\n color: #FF6666;\n}\n"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-codeblock/dist/pfe-codeblock-material-dark.min.css.map b/elements/pfe-codeblock/dist/pfe-codeblock-material-dark.min.css.map new file mode 100644 index 0000000000..46a77a1c96 --- /dev/null +++ b/elements/pfe-codeblock/dist/pfe-codeblock-material-dark.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/pfe-codeblock-material-dark.scss","pfe-codeblock-material-dark.css"],"names":[],"mappings":"AAgBA,gDCfA,+CDkBE,WAAA,KACA,YAAA,IACA,aAAA,OACA,WAAA,OACA,UAAA,OACA,MAAA,QACA,WAAA,QACA,YAAA,eAAA,CAAA,QAAA,CAAA,MAAA,CAAA,aAAA,CAAA,UAAA,YAAA,iGACA,UAAA,IACA,YAAA,MACA,cAAA,EAAA,YAAA,EAAA,SAAA,EACA,gBAAA,KAAA,YAAA,KAAA,QAAA,KAdF,iEAAA,gEAAA,gEAAA,+DAqBE,WAAA,QCVF,4DDXA,2DCYA,2DAFA,0DDWE,WAAA,QArBF,0DAyBE,YAAA,OACA,cAAA,KACA,QAAA,KA3BF,+CA+BE,SAAA,KACA,SAAA,SACA,OAAA,KAAA,EACA,QAAA,OAAA,IAlCF,4DAoCG,SAAA,SACA,aAAA,MACA,cAAA,WAtCH,4CCoCA,6CACA,6CDQE,MAAA,QA7CF,uDAiDE,QAAA,GAjDF,uCAsDG,MAAA,QAtDH,0CA0DG,MAAA,QA1DH,2CA8DG,MAAA,QA9DH,0CAkEG,MAAA,QAlEH,wCAsEG,MAAA,QAtEH,wCA0EG,MAAA,QA1EH,sCA8EG,MAAA,QA9EH,qCAkFG,MAAA,QAlFH,sCAsFG,MAAA,QAtFH,2CA0FG,MAAA,QA1FH,wCA8FG,MAAA,QA9FH,yCAkGG,MAAA,QAlGH,wCAsGG,MAAA,KAtGH,wCA0GG,MAAA,QA1GH,uCA8GG,MAAA,KA9GH,yCAkHG,MAAA,QAlHH,wCAsHG,MAAA,QAtHH,mCA0HG,MAAA,QACA,YAAA,IA3HH,0CA+HG,MAAA,QACA,YAAA,IAhIH,yCAoIG,MAAA,QApIH,wCAwIG,MAAA,QAxIH,uCA4IG,MAAA,QA5IH,yCAgJG,MAAA,QAhJH,uCAoJG,MAAA,QApJH,yCAwJG,MAAA,QAxJH,6CA4JG,MAAA,QA5JH,+CAgKG,MAAA,QAhKH,4CAoKG,MAAA,QApKH,sCAwKG,MAAA,QAxKH,yCA4KG,MAAA,KA5KH,uCAgLG,MAAA,QAhLH,uCAoLG,MAAA,QApLH,oCAwLG,MAAA,KAxLH,qCA4LG,MAAA,QA5LH,oCAgMG,MAAA,KAhMH,yCAoMG,MAAA","file":"pfe-codeblock-material-dark.min.css","sourceRoot":"../src","sourcesContent":[null,":host([code-theme=\"dark\"]) code[class*=\"language-\"],\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"] {\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n color: #B8BBBE;\n background: #2f2f2f;\n font-family: \"Overpass Mono\", Consolas, Monaco, \"Andale Mono\", monospace;\n font-family: var(--pfe-theme--font-family--code, \"Overpass Mono\", Consolas, Monaco, \"Andale Mono\", monospace);\n font-size: 1em;\n line-height: 1.5em;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n -webkit-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n}\n\n:host([code-theme=\"dark\"]) code[class*=\"language-\"]::-moz-selection, :host([code-theme=\"dark\"]) pre[class*=\"language-\"]::-moz-selection, :host([code-theme=\"dark\"]) code[class*=\"language-\"] ::-moz-selection, :host([code-theme=\"dark\"]) pre[class*=\"language-\"] ::-moz-selection {\n background: #363636;\n}\n\n:host([code-theme=\"dark\"]) code[class*=\"language-\"]::selection,\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"]::selection,\n:host([code-theme=\"dark\"]) code[class*=\"language-\"] ::selection,\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"] ::selection {\n background: #363636;\n}\n\n:host([code-theme=\"dark\"]) :not(pre) > code[class*=\"language-\"] {\n white-space: normal;\n border-radius: 0.2em;\n padding: 0.1em;\n}\n\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"] {\n overflow: auto;\n position: relative;\n margin: 0.5em 0;\n padding: 1.25em 1em;\n}\n\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"].line-numbers {\n position: relative;\n padding-left: 3.8em;\n counter-reset: linenumber;\n}\n\n:host([code-theme=\"dark\"]) .language-css > code,\n:host([code-theme=\"dark\"]) .language-sass > code,\n:host([code-theme=\"dark\"]) .language-scss > code {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) [class*=\"language-\"] .namespace {\n opacity: 0.7;\n}\n\n:host([code-theme=\"dark\"]) .token.atrule {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.attr-name {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.attr-value {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.attribute {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.boolean {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.builtin {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.cdata {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.char {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.class {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.class-name {\n color: #FFCB6B;\n}\n\n:host([code-theme=\"dark\"]) .token.comment {\n color: #B8BBBE;\n}\n\n:host([code-theme=\"dark\"]) .token.constant {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.deleted {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.doctype {\n color: #B8BBBE;\n}\n\n:host([code-theme=\"dark\"]) .token.entity {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.function {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.hexcode {\n color: #FFCB6B;\n}\n\n:host([code-theme=\"dark\"]) .token.id {\n color: #C792EA;\n font-weight: bold;\n}\n\n:host([code-theme=\"dark\"]) .token.important {\n color: #C792EA;\n font-weight: bold;\n}\n\n:host([code-theme=\"dark\"]) .token.inserted {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.keyword {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.number {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.operator {\n color: #73BCF7;\n}\n\n:host([code-theme=\"dark\"]) .token.prolog {\n color: #B8BBBE;\n}\n\n:host([code-theme=\"dark\"]) .token.property {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.pseudo-class {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.pseudo-element {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.punctuation {\n color: #73BCF7;\n}\n\n:host([code-theme=\"dark\"]) .token.regex {\n color: #FFCB6B;\n}\n\n:host([code-theme=\"dark\"]) .token.selector {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.string {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.symbol {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.tag {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.unit {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.url {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.variable {\n color: #FF6666;\n}\n\n/*# sourceMappingURL=pfe-codeblock-material-dark.css.map */\n"]} \ No newline at end of file diff --git a/elements/pfe-codeblock/dist/pfe-codeblock-material-light.css.map b/elements/pfe-codeblock/dist/pfe-codeblock-material-light.css.map new file mode 100644 index 0000000000..736630bb74 --- /dev/null +++ b/elements/pfe-codeblock/dist/pfe-codeblock-material-light.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-codeblock-material-light.scss","../../pfe-sass/functions/_custom-properties.scss","pfe-codeblock-material-light.css"],"names":[],"mappings":"AAeA;;EAGE,gBAAgB;EAChB,gBAAgB;EAChB,oBAAoB;EACpB,kBAAkB;EAClB,iBAAiB;EACjB,cAfmB;EAgBnB,mBAdqB;EAerB,wECYkC;EDZlC,6GCYkC;EDXlC,cAAc;EACd,kBAAkB;EAClB,gBAAW;IAAX,cAAW;OAAX,WAAW;EACX,qBAAa;MAAb,iBAAa;UAAb,aAAa;AEff;;AFCA;EAqBE,mBAvByB;EAwBzB,cAzByB;AEU3B;;AFPA;;;;EAqBE,mBAvByB;EAwBzB,cAzByB;AEU3B;;AFPA;EA0BE,mBAAmB;EACnB,oBAAoB;EACpB,cAAc;AEfhB;;AFbA;EAgCE,cAAc;EACd,kBAAkB;EAClB,eAAe;EACf,mBAAmB;AEfrB;;AFpBA;;;EAyCE,cApDqB;AEqCvB;;AF1BA;EA6CE,YAAY;AEfd;;AF9BA;EAkDG,cA3DoB;AE2CvB;;AFlCA;EAsDG,cA9DkB;AE8CrB;;AFtCA;EA0DG,cArEoB;AEqDvB;;AF1CA;EA8DG,cAzEoB;AEyDvB;;AF9CA;EAkEG,cA3EoB;AE2DvB;;AFlDA;EAsEG,cA9EkB;AE8DrB;;AFtDA;EA0EG,cAlFkB;AEkErB;;AF1DA;EA8EG,cAtFkB;AEsErB;;AF9DA;EAkFG,cA1FkB;AE0ErB;;AFlEA;EAsFG,cAhGkB;AEgFrB;;AFtEA;EA0FG,cAhGwB;AEgF3B;;AF1EA;EA8FG,cAvGoB;AEuFvB;;AF9EA;EAkGG,cA9GiB;AE8FpB;;AFlFA;EAsGG,cA5GwB;AE4F3B;;AFtFA;EA0GG,cAtHiB;AEsGpB;;AF1FA;EA8GG,cAvHoB;AEuGvB;;AF9FA;EAkHG,cA7HoB;AE6GvB;;AFlGA;EAsHG,cA/HoB;EAgIpB,iBAAiB;AEhBpB;;AFvGA;EA2HG,cApIoB;EAqIpB,iBAAiB;AEhBpB;;AF5GA;EAgIG,cAxIkB;AEwHrB;;AFhHA;EAoIG,cA7IoB;AE6HvB;;AFpHA;EAwIG,cAnJoB;AEmIvB;;AFxHA;EA4IG,cApJkB;AEoIrB;;AF5HA;EAgJG,cAtJwB;AEsI3B;;AFhIA;EAoJG,cA5JkB;AE4IrB;;AFpIA;EAwJG,cAnKoB;AEmJvB;;AFxIA;EA4JG,cAvKoB;AEuJvB;;AF5IA;EAgKG,cAxKkB;AEwJrB;;AFhJA;EAoKG,cA9KkB;AE8JrB;;AFpJA;EAwKG,cApLiB;AEoKpB;;AFxJA;EA4KG,cAvLoB;AEuKvB;;AF5JA;EAgLG,cAzLoB;AEyKvB;;AFhKA;EAoLG,cAhMiB;AEgLpB;;AFpKA;EAwLG,cAnMoB;AEmLvB;;AFxKA;EA4LG,cAxMiB;AEwLpB;;AF5KA;EAgMG,cA5MiB;AE4LpB","file":"pfe-codeblock-material-light.css","sourcesContent":["@import \"../../pfe-sass/pfe-sass\";\n\n//Define custom colors\n$custom-red: #E74C3C;\n$custom-orange: #EC861B;\n$custom-blue: #1893D2;\n$custom-purple: #6743C6;\n$custom-teal: #39adb5;\n$custom-gray: #8A8D90; //(text)\n$custom-light-grey: #8A8D90; //(numbers and divider)\n$custom-white: #fafafa;\n$custom-black: #151515;\n$custom-hilight-fg: #263238;\n$custom-hilight-bg: #cceae7;\n\n:host {\n\tcode[class*=\"language-\"],\n\tpre[class*=\"language-\"] {\n\t\ttext-align: left;\n\t\twhite-space: pre;\n\t\tword-spacing: normal;\n\t\tword-break: normal;\n\t\tword-wrap: normal;\n\t\tcolor: $custom-gray;\n\t\tbackground: $custom-white;\n\t\tfont-family: pfe-var(font-family--code);\n\t\tfont-size: 1em;\n\t\tline-height: 1.5em;\n\t\ttab-size: 4;\n\t\thyphens: none;\n\t}\n\n\tcode[class*=\"language-\"]::selection,\n\tpre[class*=\"language-\"]::selection,\n\tcode[class*=\"language-\"] ::selection,\n\tpre[class*=\"language-\"] ::selection {\n\t\tbackground: $custom-hilight-bg;\n\t\tcolor: $custom-hilight-fg;\n\t}\n\n\t:not(pre) > code[class*=\"language-\"] {\n\t\twhite-space: normal;\n\t\tborder-radius: 0.2em;\n\t\tpadding: 0.1em;\n\t}\n\n\tpre[class*=\"language-\"] {\n\t\toverflow: auto;\n\t\tposition: relative;\n\t\tmargin: 0.5em 0;\n\t\tpadding: 1.25em 1em;\n\t}\n\n\t.language-css > code,\n\t.language-sass > code,\n\t.language-scss > code {\n\t\tcolor: $custom-orange;\n\t}\n\n\t[class*=\"language-\"] .namespace {\n\t\topacity: 0.7;\n\t}\n\n\t.token {\n\t\t&.atrule {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.attr-name {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.attr-value {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.attribute {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.boolean {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.builtin {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.cdata {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.char {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.class {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.class-name {\n\t\t\tcolor: $custom-blue;\n\t\t}\n\t\n\t\t&.comment {\n\t\t\tcolor: $custom-light-grey;\n\t\t}\n\t\n\t\t&.constant {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.deleted {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.doctype {\n\t\t\tcolor: $custom-light-grey;\n\t\t}\n\t\n\t\t&.entity {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.function {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.hexcode {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.id {\n\t\t\tcolor:$custom-purple;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\n\t\t&.important {\n\t\t\tcolor: $custom-purple;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\n\t\t&.inserted {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.keyword {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.number {\n\t\t\tcolor:$custom-orange;\n\t\t}\n\t\n\t\t&.operator {\n\t\t\tcolor:$custom-teal;\n\t\t}\n\t\n\t\t&.prolog {\n\t\t\tcolor: $custom-light-grey;\n\t\t}\n\t\n\t\t&.property {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.pseudo-class {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.pseudo-element {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.punctuation {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.regex {\n\t\t\tcolor: $custom-blue;\n\t\t}\n\t\n\t\t&.selector {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.string {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.symbol {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.tag {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.unit {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.url {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.variable {\n\t\t\tcolor: $custom-red;\n\t\t}\t\n\t}\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}",":host code[class*=\"language-\"],\n:host pre[class*=\"language-\"] {\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n color: #8A8D90;\n background: #fafafa;\n font-family: var(--pfe-theme--font-family--code, \"Overpass Mono\", Consolas, Monaco, \"Andale Mono\", monospace);\n font-size: 1em;\n line-height: 1.5em;\n tab-size: 4;\n hyphens: none;\n}\n\n:host code[class*=\"language-\"]::selection,\n:host pre[class*=\"language-\"]::selection,\n:host code[class*=\"language-\"] ::selection,\n:host pre[class*=\"language-\"] ::selection {\n background: #cceae7;\n color: #263238;\n}\n\n:host :not(pre) > code[class*=\"language-\"] {\n white-space: normal;\n border-radius: 0.2em;\n padding: 0.1em;\n}\n\n:host pre[class*=\"language-\"] {\n overflow: auto;\n position: relative;\n margin: 0.5em 0;\n padding: 1.25em 1em;\n}\n\n:host .language-css > code,\n:host .language-sass > code,\n:host .language-scss > code {\n color: #EC861B;\n}\n\n:host [class*=\"language-\"] .namespace {\n opacity: 0.7;\n}\n\n:host .token.atrule {\n color: #6743C6;\n}\n\n:host .token.attr-name {\n color: #39adb5;\n}\n\n:host .token.attr-value {\n color: #EC861B;\n}\n\n:host .token.attribute {\n color: #EC861B;\n}\n\n:host .token.boolean {\n color: #6743C6;\n}\n\n:host .token.builtin {\n color: #39adb5;\n}\n\n:host .token.cdata {\n color: #39adb5;\n}\n\n:host .token.char {\n color: #39adb5;\n}\n\n:host .token.class {\n color: #39adb5;\n}\n\n:host .token.class-name {\n color: #1893D2;\n}\n\n:host .token.comment {\n color: #8A8D90;\n}\n\n:host .token.constant {\n color: #6743C6;\n}\n\n:host .token.deleted {\n color: #E74C3C;\n}\n\n:host .token.doctype {\n color: #8A8D90;\n}\n\n:host .token.entity {\n color: #E74C3C;\n}\n\n:host .token.function {\n color: #6743C6;\n}\n\n:host .token.hexcode {\n color: #EC861B;\n}\n\n:host .token.id {\n color: #6743C6;\n font-weight: bold;\n}\n\n:host .token.important {\n color: #6743C6;\n font-weight: bold;\n}\n\n:host .token.inserted {\n color: #39adb5;\n}\n\n:host .token.keyword {\n color: #6743C6;\n}\n\n:host .token.number {\n color: #EC861B;\n}\n\n:host .token.operator {\n color: #39adb5;\n}\n\n:host .token.prolog {\n color: #8A8D90;\n}\n\n:host .token.property {\n color: #39adb5;\n}\n\n:host .token.pseudo-class {\n color: #EC861B;\n}\n\n:host .token.pseudo-element {\n color: #EC861B;\n}\n\n:host .token.punctuation {\n color: #39adb5;\n}\n\n:host .token.regex {\n color: #1893D2;\n}\n\n:host .token.selector {\n color: #E74C3C;\n}\n\n:host .token.string {\n color: #EC861B;\n}\n\n:host .token.symbol {\n color: #6743C6;\n}\n\n:host .token.tag {\n color: #E74C3C;\n}\n\n:host .token.unit {\n color: #EC861B;\n}\n\n:host .token.url {\n color: #E74C3C;\n}\n\n:host .token.variable {\n color: #E74C3C;\n}\n"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-codeblock/dist/pfe-codeblock-material-light.min.css.map b/elements/pfe-codeblock/dist/pfe-codeblock-material-light.min.css.map new file mode 100644 index 0000000000..af41e6e9ac --- /dev/null +++ b/elements/pfe-codeblock/dist/pfe-codeblock-material-light.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/pfe-codeblock-material-light.scss","pfe-codeblock-material-light.css"],"names":[],"mappings":"AAeA,6BCdA,4BDiBE,WAAA,KACA,YAAA,IACA,aAAA,OACA,WAAA,OACA,UAAA,OACA,MAAA,QACA,WAAA,QACA,YAAA,eAAA,CAAA,QAAA,CAAA,MAAA,CAAA,aAAA,CAAA,UAAA,YAAA,iGACA,UAAA,IACA,YAAA,MACA,cAAA,EAAA,YAAA,EAAA,SAAA,EACA,gBAAA,KAAA,YAAA,KAAA,QAAA,KAdF,8CAAA,6CAAA,6CAAA,4CAqBE,WAAA,QACA,MAAA,QCTF,yCDbA,wCCcA,wCAFA,uCDSE,WAAA,QACA,MAAA,QAtBF,uCA0BE,YAAA,OACA,cAAA,KACA,QAAA,KA5BF,4BAgCE,SAAA,KACA,SAAA,SACA,OAAA,KAAA,EACA,QAAA,OAAA,IAnCF,yBCiCA,0BACA,0BDOE,MAAA,QAzCF,oCA6CE,QAAA,GA7CF,oBAkDG,MAAA,QAlDH,uBAsDG,MAAA,QAtDH,wBA0DG,MAAA,QA1DH,uBA8DG,MAAA,QA9DH,qBAkEG,MAAA,QAlEH,qBAsEG,MAAA,QAtEH,mBA0EG,MAAA,QA1EH,kBA8EG,MAAA,QA9EH,mBAkFG,MAAA,QAlFH,wBAsFG,MAAA,QAtFH,qBA0FG,MAAA,QA1FH,sBA8FG,MAAA,QA9FH,qBAkGG,MAAA,QAlGH,qBAsGG,MAAA,QAtGH,oBA0GG,MAAA,QA1GH,sBA8GG,MAAA,QA9GH,qBAkHG,MAAA,QAlHH,gBAsHG,MAAA,QACA,YAAA,IAvHH,uBA2HG,MAAA,QACA,YAAA,IA5HH,sBAgIG,MAAA,QAhIH,qBAoIG,MAAA,QApIH,oBAwIG,MAAA,QAxIH,sBA4IG,MAAA,QA5IH,oBAgJG,MAAA,QAhJH,sBAoJG,MAAA,QApJH,0BAwJG,MAAA,QAxJH,4BA4JG,MAAA,QA5JH,yBAgKG,MAAA,QAhKH,mBAoKG,MAAA,QApKH,sBAwKG,MAAA,QAxKH,oBA4KG,MAAA,QA5KH,oBAgLG,MAAA,QAhLH,iBAoLG,MAAA,QApLH,kBAwLG,MAAA,QAxLH,iBA4LG,MAAA,QA5LH,sBAgMG,MAAA","file":"pfe-codeblock-material-light.min.css","sourceRoot":"../src","sourcesContent":[null,":host code[class*=\"language-\"],\n:host pre[class*=\"language-\"] {\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n color: #8A8D90;\n background: #fafafa;\n font-family: \"Overpass Mono\", Consolas, Monaco, \"Andale Mono\", monospace;\n font-family: var(--pfe-theme--font-family--code, \"Overpass Mono\", Consolas, Monaco, \"Andale Mono\", monospace);\n font-size: 1em;\n line-height: 1.5em;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n -webkit-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n}\n\n:host code[class*=\"language-\"]::-moz-selection, :host pre[class*=\"language-\"]::-moz-selection, :host code[class*=\"language-\"] ::-moz-selection, :host pre[class*=\"language-\"] ::-moz-selection {\n background: #cceae7;\n color: #263238;\n}\n\n:host code[class*=\"language-\"]::selection,\n:host pre[class*=\"language-\"]::selection,\n:host code[class*=\"language-\"] ::selection,\n:host pre[class*=\"language-\"] ::selection {\n background: #cceae7;\n color: #263238;\n}\n\n:host :not(pre) > code[class*=\"language-\"] {\n white-space: normal;\n border-radius: 0.2em;\n padding: 0.1em;\n}\n\n:host pre[class*=\"language-\"] {\n overflow: auto;\n position: relative;\n margin: 0.5em 0;\n padding: 1.25em 1em;\n}\n\n:host .language-css > code,\n:host .language-sass > code,\n:host .language-scss > code {\n color: #EC861B;\n}\n\n:host [class*=\"language-\"] .namespace {\n opacity: 0.7;\n}\n\n:host .token.atrule {\n color: #6743C6;\n}\n\n:host .token.attr-name {\n color: #39adb5;\n}\n\n:host .token.attr-value {\n color: #EC861B;\n}\n\n:host .token.attribute {\n color: #EC861B;\n}\n\n:host .token.boolean {\n color: #6743C6;\n}\n\n:host .token.builtin {\n color: #39adb5;\n}\n\n:host .token.cdata {\n color: #39adb5;\n}\n\n:host .token.char {\n color: #39adb5;\n}\n\n:host .token.class {\n color: #39adb5;\n}\n\n:host .token.class-name {\n color: #1893D2;\n}\n\n:host .token.comment {\n color: #8A8D90;\n}\n\n:host .token.constant {\n color: #6743C6;\n}\n\n:host .token.deleted {\n color: #E74C3C;\n}\n\n:host .token.doctype {\n color: #8A8D90;\n}\n\n:host .token.entity {\n color: #E74C3C;\n}\n\n:host .token.function {\n color: #6743C6;\n}\n\n:host .token.hexcode {\n color: #EC861B;\n}\n\n:host .token.id {\n color: #6743C6;\n font-weight: bold;\n}\n\n:host .token.important {\n color: #6743C6;\n font-weight: bold;\n}\n\n:host .token.inserted {\n color: #39adb5;\n}\n\n:host .token.keyword {\n color: #6743C6;\n}\n\n:host .token.number {\n color: #EC861B;\n}\n\n:host .token.operator {\n color: #39adb5;\n}\n\n:host .token.prolog {\n color: #8A8D90;\n}\n\n:host .token.property {\n color: #39adb5;\n}\n\n:host .token.pseudo-class {\n color: #EC861B;\n}\n\n:host .token.pseudo-element {\n color: #EC861B;\n}\n\n:host .token.punctuation {\n color: #39adb5;\n}\n\n:host .token.regex {\n color: #1893D2;\n}\n\n:host .token.selector {\n color: #E74C3C;\n}\n\n:host .token.string {\n color: #EC861B;\n}\n\n:host .token.symbol {\n color: #6743C6;\n}\n\n:host .token.tag {\n color: #E74C3C;\n}\n\n:host .token.unit {\n color: #EC861B;\n}\n\n:host .token.url {\n color: #E74C3C;\n}\n\n:host .token.variable {\n color: #E74C3C;\n}\n\n/*# sourceMappingURL=pfe-codeblock-material-light.css.map */\n"]} \ No newline at end of file diff --git a/elements/pfe-codeblock/dist/pfe-codeblock.css.map b/elements/pfe-codeblock/dist/pfe-codeblock.css.map new file mode 100644 index 0000000000..3240859650 --- /dev/null +++ b/elements/pfe-codeblock/dist/pfe-codeblock.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["pfe-codeblock-material-light.scss","../../pfe-sass/functions/_custom-properties.scss","pfe-codeblock.css","pfe-codeblock-material-dark.scss","../../../node_modules/prismjs/plugins/line-numbers/prism-line-numbers.css","pfe-codeblock.scss"],"names":[],"mappings":"AAeA;;EAGE,gBAAgB;EAChB,gBAAgB;EAChB,oBAAoB;EACpB,kBAAkB;EAClB,iBAAiB;EACjB,cAfmB;EAgBnB,mBAdqB;EAerB,wECYkC;EDZlC,6GCYkC;EDXlC,cAAc;EACd,kBAAkB;EAClB,gBAAW;IAAX,cAAW;OAAX,WAAW;EACX,qBAAa;MAAb,iBAAa;UAAb,aAAa;AEff;;AFCA;EAqBE,mBAvByB;EAwBzB,cAzByB;AEU3B;;AFPA;;;;EAqBE,mBAvByB;EAw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custom colors\n$custom-red: #E74C3C;\n$custom-orange: #EC861B;\n$custom-blue: #1893D2;\n$custom-purple: #6743C6;\n$custom-teal: #39adb5;\n$custom-gray: #8A8D90; //(text)\n$custom-light-grey: #8A8D90; //(numbers and divider)\n$custom-white: #fafafa;\n$custom-black: #151515;\n$custom-hilight-fg: #263238;\n$custom-hilight-bg: #cceae7;\n\n:host {\n\tcode[class*=\"language-\"],\n\tpre[class*=\"language-\"] {\n\t\ttext-align: left;\n\t\twhite-space: pre;\n\t\tword-spacing: normal;\n\t\tword-break: normal;\n\t\tword-wrap: normal;\n\t\tcolor: $custom-gray;\n\t\tbackground: $custom-white;\n\t\tfont-family: pfe-var(font-family--code);\n\t\tfont-size: 1em;\n\t\tline-height: 1.5em;\n\t\ttab-size: 4;\n\t\thyphens: none;\n\t}\n\n\tcode[class*=\"language-\"]::selection,\n\tpre[class*=\"language-\"]::selection,\n\tcode[class*=\"language-\"] ::selection,\n\tpre[class*=\"language-\"] ::selection {\n\t\tbackground: $custom-hilight-bg;\n\t\tcolor: $custom-hilight-fg;\n\t}\n\n\t:not(pre) > code[class*=\"language-\"] {\n\t\twhite-space: normal;\n\t\tborder-radius: 0.2em;\n\t\tpadding: 0.1em;\n\t}\n\n\tpre[class*=\"language-\"] {\n\t\toverflow: auto;\n\t\tposition: relative;\n\t\tmargin: 0.5em 0;\n\t\tpadding: 1.25em 1em;\n\t}\n\n\t.language-css > code,\n\t.language-sass > code,\n\t.language-scss > code {\n\t\tcolor: $custom-orange;\n\t}\n\n\t[class*=\"language-\"] .namespace {\n\t\topacity: 0.7;\n\t}\n\n\t.token {\n\t\t&.atrule {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.attr-name {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.attr-value {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.attribute {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.boolean {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.builtin {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.cdata {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.char {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.class {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.class-name {\n\t\t\tcolor: $custom-blue;\n\t\t}\n\t\n\t\t&.comment {\n\t\t\tcolor: $custom-light-grey;\n\t\t}\n\t\n\t\t&.constant {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.deleted {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.doctype {\n\t\t\tcolor: $custom-light-grey;\n\t\t}\n\t\n\t\t&.entity {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.function {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.hexcode {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.id {\n\t\t\tcolor:$custom-purple;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\n\t\t&.important {\n\t\t\tcolor: $custom-purple;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\n\t\t&.inserted {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.keyword {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.number {\n\t\t\tcolor:$custom-orange;\n\t\t}\n\t\n\t\t&.operator {\n\t\t\tcolor:$custom-teal;\n\t\t}\n\t\n\t\t&.prolog {\n\t\t\tcolor: $custom-light-grey;\n\t\t}\n\t\n\t\t&.property {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.pseudo-class {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.pseudo-element {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.punctuation {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.regex {\n\t\t\tcolor: $custom-blue;\n\t\t}\n\t\n\t\t&.selector {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.string {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.symbol {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.tag {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.unit {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.url {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.variable {\n\t\t\tcolor: $custom-red;\n\t\t}\t\n\t}\n}\n","////\n/// Tools for leveraging custom property stacks\n/// @group custom-properties\n/// @author castastrophe\n////\n\n/// Get full theme stack with a fallback from the provided map - used by pfe-var and pfe-zindex\n/// @param {String} $category - Category name to be appended to variables within the map/system\n/// @param {String} $key - Variable name to be used and prepended with --pfe-theme\n/// @param {Map} $map - Sass map of variables\n/// @param {String} $fallback [null] - Optional fallback override\n/// @param {Boolean} $use-fallback [true] - Optional hook to return a stack with no fallback value\n/// @requires $custom-prop-prefix\n/// @return {String} theme stack with fallback value from a sass map\n@function pfe-get-from-map($category, $key, $map, $fallback: null, $prefix: \"#{$custom-prop-prefix}-theme\", $use-fallback: true) {\n // Start building the variable declaration\n $var-declaration: \"--#{$prefix}--\";\n @if $prefix == \"pf-c\" {\n $var-declaration: \"--#{$prefix}-\"; // one dash at the end\n }\n // If the category exists, inject that into the string\n @if $category != \"\" {\n $var-declaration: \"#{$var-declaration}#{$category}--\";\n }\n // Append the key to the string\n $var-declaration: \"#{$var-declaration}#{$key}\";\n\n // If the fallback is not provided but use-fallback is set to true\n @if $fallback == null and $use-fallback and map-get($map, $key) != null {\n $fallback: map-get($map, $key);\n }\n @if $fallback != null {\n // Create the variable declaration\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration}); \n}\n\n\n\n/// Returns CSS Var for the local component-scoped variable\n/// @param {String} $cssvar - Variable identifiers which are postfixed and combined using '--'\n/// @param {String} $region - Identifies the region or slot to which this is assigned\n/// @see $custom-prop-prefix\n/// @see $LOCAL\n/// @example\n/// :host {\n/// padding-top: #{pfe-local(paddingTop)};\n/// padding-bottom: #{pfe-local(paddingBottom)};\n/// }\n@function pfe-local($cssvar, $fallback: null, $region: null) {\n // If a fallback is not defined, use the global variables map\n @if $fallback == null and length($LOCAL-VARIABLES) > 0 {\n @if $region == null {\n $fallback: map-get($LOCAL-VARIABLES, $cssvar);\n }\n @else {\n $submap: map-get($LOCAL-VARIABLES, $region);\n @if type-of($submap) == \"map\" {\n $fallback: map-deep-get($LOCAL-VARIABLES, $region, $cssvar);\n }\n }\n }\n\n // If a region value exists, build the region string\n @if $region != null {\n $region: \"__#{$region}\";\n }\n\n // Start building the variable declaration\n $var-declaration: \"--#{$custom-prop-prefix}-#{$LOCAL}#{$region}--#{to-string($cssvar, '--')}\";\n \n @if $fallback != null {\n $var-declaration: \"#{$var-declaration}, #{$fallback}\";\n }\n\n // Return the variable declaration string\n @return var(#{$var-declaration});\n}\n\n/// Fetches a CSS variable stack for broadcasted variables, providing a hook for context\n/// to influence the styles of children elements such as p tags or links.\n/// @param {String} $broadcast - name of the broadcast variable to apply\n/// @requires {String} $custom-prop-prefix - Name of repo, which is \"pfe\"\n/// @example - scss\n/// :host {\n/// color: pfe-broadcasted(link);\n/// }\n/// @example - css\n/// :host {\n/// color: var(--pfe-broadcasted--link, #06c);\n/// }\n@function pfe-broadcasted($broadcast, $use-fallback: true) {\n $fallback: \"\";\n @if $use-fallback {\n $fallback: \", #{map-get($pfe-broadcasted, #{to-string($broadcast,'--')})}\";\t\n }\n @if not index($BROADCAST-VARS, first(str-split($broadcast, '--'))) {\n @error \"--#{$custom-prop-prefix}-broadcasted--#{$broadcast} variable is not currently supported.\";\n }\n @else {\n @return var(--#{$custom-prop-prefix}-broadcasted--#{to-string($broadcast,'--')}#{unquote($fallback)});\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme--zindex\n/// @requires {Map} $pfe-zindex - SASS Map of z-index values\n/// @see $pfe-zindex\n/// @example - scss - In your component styles\n/// .my-element {\n/// z-index: pfe-zindex( content );\n/// }\n\n@function pfe-zindex($cssvar) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-zindex, $var-name) != null {\n @return pfe-get-from-map(\"zindex\", $var-name, $pfe-zindex);\n }\n @else {\n @error \"The key for #{$var-name} could not be found in the $pfe-zindex map.\";\n }\n}\n\n/// Returns the value (only) of a property from the respective maps\n/// Similar to pfe-var, but does not include css variable in the compiled CSS\n/// @param {String} $name - Name of the key for the map\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example - scss - In your component styles\n/// .my-element {\n/// background-color: pfe-fetch( ui-base );\n/// }\n@function pfe-fetch($name) {\n $var-name: to-string($name, \"--\");\n @if map-get($LOCAL-VARIABLES, $var-name) != null {\n @return map-get($LOCAL-VARIABLES, $var-name);\n }\n @if map-get($pfe-vars, $var-name) != null {\n @return map-get($pfe-vars, $var-name);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return map-get($pfe-colors, $var-name);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return map-get($pfe-broadcasted, $var-name);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return map-get($pfe-typography-base, $var-name);\n }\n\n // PATTERNFLY CORE\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return map-get($pf-type-sizing, $var-name);\n }\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return map-get($pf-type-sizing--component, $var-name);\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return map-get($pf-type-sizing--modifers, $var-name);\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return map-get($pf-type-sizing--content, $var-name);\n }\n // DEPRECATED\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return map-get($pfe-typography-base-deprecated, $var-name);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return map-get($pfe-typography-deprecated, $var-name);\n }\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}\n\n/// Returns CSS variable stack with exposed theme variable and respective fallback\n/// @param {String} $cssvar - Variable name to be used and prepended with --pfe-theme\n/// @param {String} $fallback [null] - Optional custom fallback\n/// @see $pfe-vars\n/// @see $pfe-colors\n/// @see $pfe-broadcasted\n/// @example scss - In your component styles\n/// .my-element {\n/// padding: pfe-var( container-spacer );\n/// font-size: pfe-var( font-size );\n/// }\n/// @example - css Rendered output\n/// .my-element {\n/// padding: var(--pfe-theme--container-spacer, 16px);\n/// font-size: var(--pfe-theme--font-size, 16px);\n/// }\n@function pfe-var($cssvar, $fallback: null) {\n $var-name: to-string($cssvar, \"--\");\n @if map-get($pfe-vars, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-vars, $fallback);\n }\n @else if map-get($pfe-colors, $var-name) != null {\n @return pfe-get-from-map(\"color\", $var-name, $pfe-colors, $fallback);\n }\n @else if map-get($pfe-broadcasted, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-broadcasted);\n }\n @else if map-get($pfe-typography-base, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base, $fallback);\n }\n // PATTERNFLY CORE:\n @else if map-get($pf-type-sizing, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing, $fallback, $prefix: \"pf-global\");\n }\n @else if map-get($pf-type-sizing--modifers, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--modifers, $fallback, $prefix: \"pf-c\");\n }\n @else if map-get($pf-type-sizing--content, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--content, $fallback, $prefix: \"pf-c\");\n }\n // PFE components (must be below core)\n @else if map-get($pf-type-sizing--component, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pf-type-sizing--component, $fallback);\n }\n\n // DEPRECATED:\n @else if map-get($pfe-typography-base-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-base-deprecated, $fallback);\n }\n @else if map-get($pfe-typography-deprecated, $var-name) != null {\n @return pfe-get-from-map(\"\", $var-name, $pfe-typography-deprecated, $fallback);\n }\n\n @else {\n @error \"#{$var-name} could not be found.\";\n }\n}",":host code[class*=\"language-\"],\n:host pre[class*=\"language-\"] {\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n color: #8A8D90;\n background: #fafafa;\n font-family: var(--pfe-theme--font-family--code, \"Overpass Mono\", Consolas, Monaco, \"Andale Mono\", monospace);\n font-size: 1em;\n line-height: 1.5em;\n tab-size: 4;\n hyphens: none;\n}\n\n:host code[class*=\"language-\"]::selection,\n:host pre[class*=\"language-\"]::selection,\n:host code[class*=\"language-\"] ::selection,\n:host pre[class*=\"language-\"] ::selection {\n background: #cceae7;\n color: #263238;\n}\n\n:host :not(pre) > code[class*=\"language-\"] {\n white-space: normal;\n border-radius: 0.2em;\n padding: 0.1em;\n}\n\n:host pre[class*=\"language-\"] {\n overflow: auto;\n position: relative;\n margin: 0.5em 0;\n padding: 1.25em 1em;\n}\n\n:host .language-css > code,\n:host .language-sass > code,\n:host .language-scss > code {\n color: #EC861B;\n}\n\n:host [class*=\"language-\"] .namespace {\n opacity: 0.7;\n}\n\n:host .token.atrule {\n color: #6743C6;\n}\n\n:host .token.attr-name {\n color: #39adb5;\n}\n\n:host .token.attr-value {\n color: #EC861B;\n}\n\n:host .token.attribute {\n color: #EC861B;\n}\n\n:host .token.boolean {\n color: #6743C6;\n}\n\n:host .token.builtin {\n color: #39adb5;\n}\n\n:host .token.cdata {\n color: #39adb5;\n}\n\n:host .token.char {\n color: #39adb5;\n}\n\n:host .token.class {\n color: #39adb5;\n}\n\n:host .token.class-name {\n color: #1893D2;\n}\n\n:host .token.comment {\n color: #8A8D90;\n}\n\n:host .token.constant {\n color: #6743C6;\n}\n\n:host .token.deleted {\n color: #E74C3C;\n}\n\n:host .token.doctype {\n color: #8A8D90;\n}\n\n:host .token.entity {\n color: #E74C3C;\n}\n\n:host .token.function {\n color: #6743C6;\n}\n\n:host .token.hexcode {\n color: #EC861B;\n}\n\n:host .token.id {\n color: #6743C6;\n font-weight: bold;\n}\n\n:host .token.important {\n color: #6743C6;\n font-weight: bold;\n}\n\n:host .token.inserted {\n color: #39adb5;\n}\n\n:host .token.keyword {\n color: #6743C6;\n}\n\n:host .token.number {\n color: #EC861B;\n}\n\n:host .token.operator {\n color: #39adb5;\n}\n\n:host .token.prolog {\n color: #8A8D90;\n}\n\n:host .token.property {\n color: #39adb5;\n}\n\n:host .token.pseudo-class {\n color: #EC861B;\n}\n\n:host .token.pseudo-element {\n color: #EC861B;\n}\n\n:host .token.punctuation {\n color: #39adb5;\n}\n\n:host .token.regex {\n color: #1893D2;\n}\n\n:host .token.selector {\n color: #E74C3C;\n}\n\n:host .token.string {\n color: #EC861B;\n}\n\n:host .token.symbol {\n color: #6743C6;\n}\n\n:host .token.tag {\n color: #E74C3C;\n}\n\n:host .token.unit {\n color: #EC861B;\n}\n\n:host .token.url {\n color: #E74C3C;\n}\n\n:host .token.variable {\n color: #E74C3C;\n}\n\n:host([code-theme=\"dark\"]) code[class*=\"language-\"],\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"] {\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n color: #B8BBBE;\n background: #2f2f2f;\n font-family: var(--pfe-theme--font-family--code, \"Overpass Mono\", Consolas, Monaco, \"Andale Mono\", monospace);\n font-size: 1em;\n line-height: 1.5em;\n tab-size: 4;\n hyphens: none;\n}\n\n:host([code-theme=\"dark\"]) code[class*=\"language-\"]::selection,\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"]::selection,\n:host([code-theme=\"dark\"]) code[class*=\"language-\"] ::selection,\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"] ::selection {\n background: #363636;\n}\n\n:host([code-theme=\"dark\"]) :not(pre) > code[class*=\"language-\"] {\n white-space: normal;\n border-radius: 0.2em;\n padding: 0.1em;\n}\n\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"] {\n overflow: auto;\n position: relative;\n margin: 0.5em 0;\n padding: 1.25em 1em;\n}\n\n:host([code-theme=\"dark\"]) pre[class*=\"language-\"].line-numbers {\n position: relative;\n padding-left: 3.8em;\n counter-reset: linenumber;\n}\n\n:host([code-theme=\"dark\"]) .language-css > code,\n:host([code-theme=\"dark\"]) .language-sass > code,\n:host([code-theme=\"dark\"]) .language-scss > code {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) [class*=\"language-\"] .namespace {\n opacity: 0.7;\n}\n\n:host([code-theme=\"dark\"]) .token.atrule {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.attr-name {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.attr-value {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.attribute {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.boolean {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.builtin {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.cdata {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.char {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.class {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.class-name {\n color: #FFCB6B;\n}\n\n:host([code-theme=\"dark\"]) .token.comment {\n color: #B8BBBE;\n}\n\n:host([code-theme=\"dark\"]) .token.constant {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.deleted {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.doctype {\n color: #B8BBBE;\n}\n\n:host([code-theme=\"dark\"]) .token.entity {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.function {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.hexcode {\n color: #FFCB6B;\n}\n\n:host([code-theme=\"dark\"]) .token.id {\n color: #C792EA;\n font-weight: bold;\n}\n\n:host([code-theme=\"dark\"]) .token.important {\n color: #C792EA;\n font-weight: bold;\n}\n\n:host([code-theme=\"dark\"]) .token.inserted {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.keyword {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.number {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.operator {\n color: #73BCF7;\n}\n\n:host([code-theme=\"dark\"]) .token.prolog {\n color: #B8BBBE;\n}\n\n:host([code-theme=\"dark\"]) .token.property {\n color: #80CBC4;\n}\n\n:host([code-theme=\"dark\"]) .token.pseudo-class {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.pseudo-element {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.punctuation {\n color: #73BCF7;\n}\n\n:host([code-theme=\"dark\"]) .token.regex {\n color: #FFCB6B;\n}\n\n:host([code-theme=\"dark\"]) .token.selector {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.string {\n color: #A5E844;\n}\n\n:host([code-theme=\"dark\"]) .token.symbol {\n color: #C792EA;\n}\n\n:host([code-theme=\"dark\"]) .token.tag {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.unit {\n color: #FE9A8C;\n}\n\n:host([code-theme=\"dark\"]) .token.url {\n color: #FF6666;\n}\n\n:host([code-theme=\"dark\"]) .token.variable {\n color: #FF6666;\n}\n\npre[class*=\"language-\"].line-numbers {\n position: relative;\n padding-left: 3.8em;\n counter-reset: linenumber;\n}\n\npre[class*=\"language-\"].line-numbers > code {\n position: relative;\n white-space: inherit;\n}\n\n.line-numbers .line-numbers-rows {\n position: absolute;\n pointer-events: none;\n top: 0;\n font-size: 100%;\n left: -3.8em;\n width: 3em;\n /* works for line-numbers below 1000 lines */\n letter-spacing: -1px;\n border-right: 1px solid #999;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.line-numbers-rows > span {\n display: block;\n counter-increment: linenumber;\n}\n\n.line-numbers-rows > span:before {\n content: counter(linenumber);\n color: #999;\n display: block;\n padding-right: 0.8em;\n text-align: right;\n}\n\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n","@import \"../../pfe-sass/pfe-sass\";\n\n//Define custom colors\n$custom-red: #FF6666;\n$custom-orange: #FE9A8C; //(red, #eee, etc.)\n$custom-yellow: #FFCB6B; //(height, width, cx, cy, etc.)\n$custom-green: #A5E844;\n$custom-teal: #80CBC4;\n$custom-blue: #73BCF7;\n$custom-purple: #C792EA;\n$custom-dark-gray: #B8BBBE; // (numbers and divider)\n$custom-gray: #B8BBBE; // (text)\n$custom-white: #FFF;\n$custom-black: #2f2f2f;\n$custom-hilight-bg: #363636;\n\n:host([code-theme=\"dark\"]) {\n\tcode[class*=\"language-\"],\n\tpre[class*=\"language-\"] {\n\t\ttext-align: left;\n\t\twhite-space: pre;\n\t\tword-spacing: normal;\n\t\tword-break: normal;\n\t\tword-wrap: normal;\n\t\tcolor: $custom-gray;\n\t\tbackground: $custom-black;\n\t\tfont-family: pfe-var(font-family--code);\n\t\tfont-size: 1em;\n\t\tline-height: 1.5em;\n\t\ttab-size: 4;\n\t\thyphens: none;\n\t}\n\n\tcode[class*=\"language-\"]::selection,\n\tpre[class*=\"language-\"]::selection,\n\tcode[class*=\"language-\"] ::selection,\n\tpre[class*=\"language-\"] ::selection {\n\t\tbackground: $custom-hilight-bg;\n\t}\n\n\t:not(pre) > code[class*=\"language-\"] {\n\t\twhite-space: normal;\n\t\tborder-radius: 0.2em;\n\t\tpadding: 0.1em;\n\t}\n\n\tpre[class*=\"language-\"] {\n\t\toverflow: auto;\n\t\tposition: relative;\n\t\tmargin: 0.5em 0;\n\t\tpadding: 1.25em 1em;\n\t\t&.line-numbers {\n\t\t\tposition: relative;\n\t\t\tpadding-left: 3.8em;\n\t\t\tcounter-reset: linenumber;\n\t\t}\n\t}\n\n\t.language-css > code,\n\t.language-sass > code,\n\t.language-scss > code {\n\t\tcolor: $custom-orange;\n\t}\n\n\t[class*=\"language-\"] .namespace {\n\t\topacity: 0.7;\n\t}\n\n\t.token {\n\t\t&.atrule {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.attr-name {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.attr-value {\n\t\t\tcolor: $custom-green;\n\t\t}\n\t\n\t\t&.attribute {\n\t\t\tcolor: $custom-green;\n\t\t}\n\t\n\t\t&.boolean {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.builtin {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.cdata {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.char {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.class {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.class-name {\n\t\t\tcolor: $custom-yellow;\n\t\t}\n\t\n\t\t&.comment {\n\t\t\tcolor: $custom-dark-gray;\n\t\t}\n\t\n\t\t&.constant {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.deleted {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.doctype {\n\t\t\tcolor: $custom-dark-gray;\n\t\t}\n\t\n\t\t&.entity {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.function {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.hexcode {\n\t\t\tcolor: $custom-yellow;\n\t\t}\n\t\n\t\t&.id {\n\t\t\tcolor: $custom-purple;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\n\t\t&.important {\n\t\t\tcolor: $custom-purple;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\n\t\t&.inserted {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.keyword {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.number {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.operator {\n\t\t\tcolor: $custom-blue;\n\t\t}\n\t\n\t\t&.prolog {\n\t\t\tcolor: $custom-dark-gray;\n\t\t}\n\t\n\t\t&.property {\n\t\t\tcolor: $custom-teal;\n\t\t}\n\t\n\t\t&.pseudo-class {\n\t\t\tcolor: $custom-green;\n\t\t}\n\t\n\t\t&.pseudo-element {\n\t\t\tcolor: $custom-green;\n\t\t}\n\t\n\t\t&.punctuation {\n\t\t\tcolor: $custom-blue;\n\t\t}\n\t\n\t\t&.regex {\n\t\t\tcolor: $custom-yellow;\n\t\t}\n\t\n\t\t&.selector {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.string {\n\t\t\tcolor: $custom-green;\n\t\t}\n\t\n\t\t&.symbol {\n\t\t\tcolor: $custom-purple;\n\t\t}\n\t\n\t\t&.tag {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.unit {\n\t\t\tcolor: $custom-orange;\n\t\t}\n\t\n\t\t&.url {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t\n\t\t&.variable {\n\t\t\tcolor: $custom-red;\n\t\t}\n\t}\n}","pre[class*=\"language-\"].line-numbers {\n\tposition: relative;\n\tpadding-left: 3.8em;\n\tcounter-reset: linenumber;\n}\n\npre[class*=\"language-\"].line-numbers > code {\n\tposition: relative;\n\twhite-space: inherit;\n}\n\n.line-numbers .line-numbers-rows {\n\tposition: absolute;\n\tpointer-events: none;\n\ttop: 0;\n\tfont-size: 100%;\n\tleft: -3.8em;\n\twidth: 3em; /* works for line-numbers below 1000 lines */\n\tletter-spacing: -1px;\n\tborder-right: 1px solid #999;\n\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\n}\n\n\t.line-numbers-rows > span {\n\t\tdisplay: block;\n\t\tcounter-increment: linenumber;\n\t}\n\n\t\t.line-numbers-rows > span:before {\n\t\t\tcontent: counter(linenumber);\n\t\t\tcolor: #999;\n\t\t\tdisplay: block;\n\t\t\tpadding-right: 0.8em;\n\t\t\ttext-align: right;\n\t\t}\n","// Please see the pfe-sass README for guidance on using these tools\n@import \"../../pfe-sass/pfe-sass\";\n@import \"./pfe-codeblock-material-light.scss\";\n@import \"./pfe-codeblock-material-dark.scss\";\n@import \"../../../node_modules/prismjs/plugins/line-numbers/prism-line-numbers\";\n\n\n$LOCAL: codeblock;\n\n// This variable is global so that helper functions can reference it\n$LOCAL-VARIABLES: ();\n\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n\n"],"sourceRoot":"../src"} \ No newline at end of file diff --git a/elements/pfe-codeblock/dist/pfe-codeblock.js b/elements/pfe-codeblock/dist/pfe-codeblock.js new file mode 100644 index 0000000000..e747a7348d --- /dev/null +++ b/elements/pfe-codeblock/dist/pfe-codeblock.js @@ -0,0 +1,2078 @@ +import PFElement from '../../pfelement/dist/pfelement.js'; + +// Polyfills +// @POLYFILL Array.includes +// https://tc39.github.io/ecma262/#sec-array.prototype.includes +if (!Array.prototype.includes) { + Object.defineProperty(Array.prototype, "includes", { + value: function(valueToFind, fromIndex) { + if (this == null) { + throw new TypeError('"this" is null or not defined'); + } + + // 1. Let O be ? ToObject(this value). + var o = Object(this); + + // 2. Let len be ? ToLength(? Get(O, "length")). + var len = o.length >>> 0; + + // 3. If len is 0, return false. + if (len === 0) { + return false; + } + + // 4. Let n be ? ToInteger(fromIndex). + // (If fromIndex is undefined, this step produces the value 0.) + var n = fromIndex | 0; + + // 5. If n ≥ 0, then + // a. Let k be n. + // 6. Else n < 0, + // a. Let k be len + n. + // b. If k < 0, let k be 0. + var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); + + function sameValueZero(x, y) { + return x === y || (typeof x === "number" && typeof y === "number" && isNaN(x) && isNaN(y)); + } + + // 7. Repeat, while k < len + while (k < len) { + // a. Let elementK be the result of ? Get(O, ! ToString(k)). + // b. If SameValueZero(valueToFind, elementK) is true, return true. + if (sameValueZero(o[k], valueToFind)) { + return true; + } + // c. Increase k by 1. + k++; + } + + // 8. Return false + return false; + } + }); +} +// End Polyfills + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var prism = createCommonjsModule(function (module) { +/* ********************************************** + Begin prism-core.js +********************************************** */ + +/// + +var _self = (typeof window !== 'undefined') + ? window // if in browser + : ( + (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) + ? self // if in worker + : {} // if in node js + ); + +/** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + */ +var Prism = (function (_self){ + +// Private helper vars +var lang = /\blang(?:uage)?-([\w-]+)\b/i; +var uniqueId = 0; + + +var _ = { + /** + * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the + * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load + * additional languages or plugins yourself. + * + * By setting this value to `true`, Prism will not automatically highlight all code elements on the page. + * + * You obviously have to change this value before the automatic highlighting started. To do this, you can add an + * empty Prism object into the global scope before loading the Prism script like this: + * + * ```js + * window.Prism = window.Prism || {}; + * Prism.manual = true; + * // add a new