Socket
Socket
Sign inDemoInstall

@patternfly/pfe-toast

Package Overview
Dependencies
3
Maintainers
10
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-prerelease.37 to 1.0.0-prerelease.39

16

dist/pfe-toast.js
import PFElement from '../../pfelement/dist/pfelement.js';
/*!
* PatternFly Elements: PfeToast 1.0.0-prerelease.37
* PatternFly Elements: PfeToast 1.0.0-prerelease.39
* @license

@@ -30,3 +30,3 @@ * Copyright 2020 Red Hat, Inc.

static get version() {
return "1.0.0-prerelease.37";
return "1.0.0-prerelease.39";
}

@@ -97,3 +97,5 @@

this._content = this.shadowRoot.querySelector(`.${this.tag}__content`);
this._toastCloseButton = this.shadowRoot.querySelector(`.${this.tag}__close`);
this._toastCloseButton = this.shadowRoot.querySelector(
`.${this.tag}__close`
);

@@ -108,5 +110,5 @@ // events

switch (attr) {
case 'close-label':
case "close-label":
this._toastCloseButton.setAttribute("aria-label", this.closeLabel);
case 'auto-dismiss':
case "auto-dismiss":
this.doesAutoDismiss = !!newValue;

@@ -217,4 +219,4 @@ this._setAccessibility();

const digits = value.match(/\d+/) || [8000];
const unit = value.match(/\D+/) || '';
return unit[0] === 's' ? (digits[0] * 1000) : digits[0];
const unit = value.match(/\D+/) || "";
return unit[0] === "s" ? digits[0] * 1000 : digits[0];
}

@@ -221,0 +223,0 @@

@@ -35,3 +35,3 @@ {

"title": "Auto dismiss",
"type": "string"
"type": "string"
},

@@ -38,0 +38,0 @@ "close_label": {

import t from"../../pfelement/dist/pfelement.min.js";
/*!
* PatternFly Elements: PfeToast 1.0.0-prerelease.37
* PatternFly Elements: PfeToast 1.0.0-prerelease.39
* @license

@@ -25,3 +25,3 @@ * Copyright 2020 Red Hat, Inc.

*
*/class e extends t{static get version(){return"1.0.0-prerelease.37"}get html(){return'<style>@charset "UTF-8";:host{--pfe-toast--Top:50px;--pfe-toast--MaxWidth:500px;--pfe-toast--MinWidth:250px;--pfe-toast--Right--offset:50px;--pfe-toast--Right:calc(-1 * (var(--pfe-toast--MaxWidth) + var(--pfe-toast--Right--offset)));--pfe-toast__container--BackgroundColor:var(--pfe-theme--color--surface--lightest, #fff);--pfe-toast__container--BoxShadow:rgba(3, 3, 3, 0.13) 0px 3px 7px 3px,rgba(3, 3, 3, 0.12) 0px 11px 24px 16px;--pfe-toast__container--Color:var(--pfe-theme--color--text, #333);--pfe-toast__container--Padding:1rem;--pfe-toast__close--svg--Fill:var(--pfe-theme--color--feedback--default--darkest, #464646);--pfe-toast__close--svg--Fill--hover:#333;--pfe-toast__close--svg--Height:12px;--pfe-toast__close--svg--Width:12px;--pfe-toast__close--PaddingTop:0;--pfe-toast__close--PaddingRight:0;--pfe-toast__close--PaddingBottom:0;--pfe-toast__close--PaddingLeft:0;--pfe-toast__close--Padding:var(--pfe-toast__close--PaddingTop) var(--pfe-toast__close--PaddingRight) var(--pfe-toast__close--PaddingBottom) var(--pfe-toast__close--PaddingLeft);-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;position:absolute;right:var(--pfe-toast--Right);top:var(--pfe-toast--Top);-webkit-transition:right .5s ease-in-out;transition:right .5s ease-in-out;will-change:right;max-width:var(--pfe-toast--MaxWidth);min-width:var(--pfe-toast--MinWidth)}@media only screen and (max-width:575px){:host{max-width:calc(var(--pfe-toast--MaxWidth)/ 2);min-width:calc(var(--pfe-toast--MinWidth)/ 2)}}:host([hidden]){display:none}:host(.open){--pfe-toast--Right:50px}:host(:not(.open)){--pfe-toast--Right:calc(-1 * (var(--pfe-toast--MaxWidth) + var(--pfe-toast--Right--offset)))}::slotted(:first-child){margin-top:0}::slotted(button){background:0 0;border-radius:0;display:inline-block;margin-bottom:0;margin-right:1rem;padding: .5rem .75rem;text-align:center}.pfe-toast__container{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;background-color:var(--pfe-toast__container--BackgroundColor);-webkit-box-shadow:var(--pfe-toast__container--BoxShadow);box-shadow:var(--pfe-toast__container--BoxShadow);color:var(--pfe-toast__container--Color);padding:var(--pfe-toast__container--Padding)}.pfe-toast__content{-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.pfe-toast__close{-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;background-color:transparent;border:none;cursor:pointer;margin:0;padding:var(--pfe-toast__close--Padding)}.pfe-toast__close>svg{fill:var(--pfe-toast__close--svg--Fill);height:var(--pfe-toast__close--svg--Height);width:var(--pfe-toast__close--svg--Width)}.pfe-toast__close:hover>svg{fill:var(--pfe-toast__close--svg--Fill--hover)}\n/*# sourceMappingURL=pfe-toast.min.css.map */\n</style><div class="pfe-toast__container">\n <div class="pfe-toast__content">\n <slot></slot>\n </div>\n <button class="pfe-toast__close">\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32"\n height="32" viewBox="-11 11 22 23">\n <path\n d="M30 16.669v-1.331c0-0.363-0.131-0.675-0.394-0.938s-0.575-0.394-0.938-0.394h-10.669v-10.65c0-0.362-0.131-0.675-0.394-0.938s-0.575-0.394-0.938-0.394h-1.331c-0.363 0-0.675 0.131-0.938 0.394s-0.394 0.575-0.394 0.938v10.644h-10.675c-0.362 0-0.675 0.131-0.938 0.394s-0.394 0.575-0.394 0.938v1.331c0 0.363 0.131 0.675 0.394 0.938s0.575 0.394 0.938 0.394h10.669v10.644c0 0.363 0.131 0.675 0.394 0.938 0.262 0.262 0.575 0.394 0.938 0.394h1.331c0.363 0 0.675-0.131 0.938-0.394s0.394-0.575 0.394-0.938v-10.637h10.669c0.363 0 0.675-0.131 0.938-0.394 0.269-0.262 0.4-0.575 0.4-0.938z"\n transform="rotate(45)" />\n </svg>\n </button>\n</div>'}static get properties(){return{auto_dismiss:{title:"Auto dismiss",type:"string"},close_label:{title:"Close label",type:"string"}}}static get slots(){return{content:{title:"Content",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"raw"}]}}}}static get tag(){return"pfe-toast"}get templateUrl(){return"pfe-toast.html"}get schemaUrl(){return"pfe-toast.json"}get styleUrl(){return"pfe-toast.scss"}get closeLabel(){return this.getAttribute("close-label")||"Close"}static get PfeType(){return t.PfeTypes.Container}static get observedAttributes(){return["auto-dismiss","close-label"]}constructor(){super(e),this.isOpen=!1,this.doesAutoDismiss=!1,this._container=this.shadowRoot.querySelector(`.${this.tag}__container`),this._content=this.shadowRoot.querySelector(`.${this.tag}__content`),this._toastCloseButton=this.shadowRoot.querySelector(`.${this.tag}__close`),this.open=this.open.bind(this),this.close=this.close.bind(this),this.toggle=this.toggle.bind(this)}attributeChangedCallback(t,e,s){switch(t){case"close-label":this._toastCloseButton.setAttribute("aria-label",this.closeLabel);case"auto-dismiss":this.doesAutoDismiss=!!s,this._setAccessibility()}}_setAccessibility(){this.doesAutoDismiss?(this.removeAttribute("aria-label"),this.removeAttribute("aria-describedby"),this.setAttribute("role","alert"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true")):(this.removeAttribute("aria-live"),this.removeAttribute("aria-atomic"),this.setAttribute("role","alertdialog"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Alert dialog"),this.setAttribute("aria-describedby",`${this.tag}__content`))}connectedCallback(){super.connectedCallback(),this.doesAutoDismiss=this.hasAttribute("auto-dismiss"),this._toastCloseButton.setAttribute("aria-label",this.closeLabel),this._setAccessibility(),this.setAttribute("hidden",""),this._toastCloseButton.addEventListener("click",this.close),this.addEventListener("keydown",this._keydownHandler)}disconnectedCallback(){this._toastCloseButton.removeEventListener("click",this.close),this.removeEventListener("keydown",this._keydownHandler)}open(t){return t&&t.preventDefault(),this.isOpen=!0,this.removeAttribute("hidden"),setTimeout(()=>{this.classList.add("open")},500),this.dispatchEvent(new CustomEvent(`${this.tag}:open`,{detail:{},bubbles:!0})),this.doesAutoDismiss&&setTimeout(()=>{this.close()},this._toMilliseconds(this.getAttribute("auto-dismiss"))),this}close(t){return t&&t.preventDefault(),this.isOpen=!1,this.classList.remove("open"),setTimeout(()=>{this.setAttribute("hidden","")},500),this.dispatchEvent(new CustomEvent(`${this.tag}:close`,{detail:{},bubbles:!0})),this}toggle(t){return this.isOpen?this.close(t):this.open(t),this}_toMilliseconds(t){const e=t.match(/\d+/)||[8e3];return"s"===(t.match(/\D+/)||"")[0]?1e3*e[0]:e[0]}_keydownHandler(t){let e=t.target||window.event.srcElement;switch(t.key||t.keyCode){case"Escape":case"Esc":case 27:this.close(t);break;case"Enter":case 13:e===this._toastCloseButton&&this.close(t)}}}t.create(e);export default e;
*/class e extends t{static get version(){return"1.0.0-prerelease.39"}get html(){return'<style>@charset "UTF-8";:host{--pfe-toast--Top:50px;--pfe-toast--MaxWidth:500px;--pfe-toast--MinWidth:250px;--pfe-toast--Right--offset:50px;--pfe-toast--Right:calc(-1 * (var(--pfe-toast--MaxWidth) + var(--pfe-toast--Right--offset)));--pfe-toast__container--BackgroundColor:var(--pfe-theme--color--surface--lightest, #fff);--pfe-toast__container--BoxShadow:rgba(3, 3, 3, 0.13) 0px 3px 7px 3px,rgba(3, 3, 3, 0.12) 0px 11px 24px 16px;--pfe-toast__container--Color:var(--pfe-theme--color--text, #333);--pfe-toast__container--Padding:1rem;--pfe-toast__close--svg--Fill:var(--pfe-theme--color--feedback--default--darkest, #464646);--pfe-toast__close--svg--Fill--hover:#333;--pfe-toast__close--svg--Height:12px;--pfe-toast__close--svg--Width:12px;--pfe-toast__close--PaddingTop:0;--pfe-toast__close--PaddingRight:0;--pfe-toast__close--PaddingBottom:0;--pfe-toast__close--PaddingLeft:0;--pfe-toast__close--Padding:var(--pfe-toast__close--PaddingTop) var(--pfe-toast__close--PaddingRight) var(--pfe-toast__close--PaddingBottom) var(--pfe-toast__close--PaddingLeft);-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;position:absolute;right:var(--pfe-toast--Right);top:var(--pfe-toast--Top);-webkit-transition:right .5s ease-in-out;transition:right .5s ease-in-out;will-change:right;max-width:var(--pfe-toast--MaxWidth);min-width:var(--pfe-toast--MinWidth)}@media only screen and (max-width:575px){:host{max-width:calc(var(--pfe-toast--MaxWidth)/ 2);min-width:calc(var(--pfe-toast--MinWidth)/ 2)}}:host([hidden]){display:none}:host(.open){--pfe-toast--Right:50px}:host(:not(.open)){--pfe-toast--Right:calc(-1 * (var(--pfe-toast--MaxWidth) + var(--pfe-toast--Right--offset)))}::slotted(:first-child){margin-top:0}::slotted(button){background:0 0;border-radius:0;display:inline-block;margin-bottom:0;margin-right:1rem;padding: .5rem .75rem;text-align:center}.pfe-toast__container{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;background-color:var(--pfe-toast__container--BackgroundColor);-webkit-box-shadow:var(--pfe-toast__container--BoxShadow);box-shadow:var(--pfe-toast__container--BoxShadow);color:var(--pfe-toast__container--Color);padding:var(--pfe-toast__container--Padding)}.pfe-toast__content{-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.pfe-toast__close{-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;background-color:transparent;border:none;cursor:pointer;margin:0;padding:var(--pfe-toast__close--Padding)}.pfe-toast__close>svg{fill:var(--pfe-toast__close--svg--Fill);height:var(--pfe-toast__close--svg--Height);width:var(--pfe-toast__close--svg--Width)}.pfe-toast__close:hover>svg{fill:var(--pfe-toast__close--svg--Fill--hover)}\n/*# sourceMappingURL=pfe-toast.min.css.map */\n</style><div class="pfe-toast__container">\n <div class="pfe-toast__content">\n <slot></slot>\n </div>\n <button class="pfe-toast__close">\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32"\n height="32" viewBox="-11 11 22 23">\n <path\n d="M30 16.669v-1.331c0-0.363-0.131-0.675-0.394-0.938s-0.575-0.394-0.938-0.394h-10.669v-10.65c0-0.362-0.131-0.675-0.394-0.938s-0.575-0.394-0.938-0.394h-1.331c-0.363 0-0.675 0.131-0.938 0.394s-0.394 0.575-0.394 0.938v10.644h-10.675c-0.362 0-0.675 0.131-0.938 0.394s-0.394 0.575-0.394 0.938v1.331c0 0.363 0.131 0.675 0.394 0.938s0.575 0.394 0.938 0.394h10.669v10.644c0 0.363 0.131 0.675 0.394 0.938 0.262 0.262 0.575 0.394 0.938 0.394h1.331c0.363 0 0.675-0.131 0.938-0.394s0.394-0.575 0.394-0.938v-10.637h10.669c0.363 0 0.675-0.131 0.938-0.394 0.269-0.262 0.4-0.575 0.4-0.938z"\n transform="rotate(45)" />\n </svg>\n </button>\n</div>'}static get properties(){return{auto_dismiss:{title:"Auto dismiss",type:"string"},close_label:{title:"Close label",type:"string"}}}static get slots(){return{content:{title:"Content",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"raw"}]}}}}static get tag(){return"pfe-toast"}get templateUrl(){return"pfe-toast.html"}get schemaUrl(){return"pfe-toast.json"}get styleUrl(){return"pfe-toast.scss"}get closeLabel(){return this.getAttribute("close-label")||"Close"}static get PfeType(){return t.PfeTypes.Container}static get observedAttributes(){return["auto-dismiss","close-label"]}constructor(){super(e),this.isOpen=!1,this.doesAutoDismiss=!1,this._container=this.shadowRoot.querySelector(`.${this.tag}__container`),this._content=this.shadowRoot.querySelector(`.${this.tag}__content`),this._toastCloseButton=this.shadowRoot.querySelector(`.${this.tag}__close`),this.open=this.open.bind(this),this.close=this.close.bind(this),this.toggle=this.toggle.bind(this)}attributeChangedCallback(t,e,s){switch(t){case"close-label":this._toastCloseButton.setAttribute("aria-label",this.closeLabel);case"auto-dismiss":this.doesAutoDismiss=!!s,this._setAccessibility()}}_setAccessibility(){this.doesAutoDismiss?(this.removeAttribute("aria-label"),this.removeAttribute("aria-describedby"),this.setAttribute("role","alert"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true")):(this.removeAttribute("aria-live"),this.removeAttribute("aria-atomic"),this.setAttribute("role","alertdialog"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Alert dialog"),this.setAttribute("aria-describedby",`${this.tag}__content`))}connectedCallback(){super.connectedCallback(),this.doesAutoDismiss=this.hasAttribute("auto-dismiss"),this._toastCloseButton.setAttribute("aria-label",this.closeLabel),this._setAccessibility(),this.setAttribute("hidden",""),this._toastCloseButton.addEventListener("click",this.close),this.addEventListener("keydown",this._keydownHandler)}disconnectedCallback(){this._toastCloseButton.removeEventListener("click",this.close),this.removeEventListener("keydown",this._keydownHandler)}open(t){return t&&t.preventDefault(),this.isOpen=!0,this.removeAttribute("hidden"),setTimeout(()=>{this.classList.add("open")},500),this.dispatchEvent(new CustomEvent(`${this.tag}:open`,{detail:{},bubbles:!0})),this.doesAutoDismiss&&setTimeout(()=>{this.close()},this._toMilliseconds(this.getAttribute("auto-dismiss"))),this}close(t){return t&&t.preventDefault(),this.isOpen=!1,this.classList.remove("open"),setTimeout(()=>{this.setAttribute("hidden","")},500),this.dispatchEvent(new CustomEvent(`${this.tag}:close`,{detail:{},bubbles:!0})),this}toggle(t){return this.isOpen?this.close(t):this.open(t),this}_toMilliseconds(t){const e=t.match(/\d+/)||[8e3];return"s"===(t.match(/\D+/)||"")[0]?1e3*e[0]:e[0]}_keydownHandler(t){let e=t.target||window.event.srcElement;switch(t.key||t.keyCode){case"Escape":case"Esc":case 27:this.close(t);break;case"Enter":case 13:e===this._toastCloseButton&&this.close(t)}}}t.create(e);export default e;
//# sourceMappingURL=pfe-toast.min.js.map

@@ -83,3 +83,3 @@ (function (global, factory) {

/*!
* PatternFly Elements: PfeToast 1.0.0-prerelease.37
* PatternFly Elements: PfeToast 1.0.0-prerelease.39
* @license

@@ -138,3 +138,3 @@ * Copyright 2020 Red Hat, Inc.

get: function get$$1() {
return "1.0.0-prerelease.37";
return "1.0.0-prerelease.39";
}

@@ -193,5 +193,5 @@ }, {

switch (attr) {
case 'close-label':
case "close-label":
this._toastCloseButton.setAttribute("aria-label", this.closeLabel);
case 'auto-dismiss':
case "auto-dismiss":
this.doesAutoDismiss = !!newValue;

@@ -309,4 +309,4 @@ this._setAccessibility();

var digits = value.match(/\d+/) || [8000];
var unit = value.match(/\D+/) || '';
return unit[0] === 's' ? digits[0] * 1000 : digits[0];
var unit = value.match(/\D+/) || "";
return unit[0] === "s" ? digits[0] * 1000 : digits[0];
}

@@ -313,0 +313,0 @@ }, {

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("../../pfelement/dist/pfelement.umd")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd"],e):t.PfeToast=e(t.PFElement)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e=function(t,e,o){return e&&s(t.prototype,e),o&&s(t,o),t};function s(t,e){for(var o=0;o<e.length;o++){var s=e[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}var o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(i,t),e(i,[{key:"html",get:function(){return'<style>@charset "UTF-8";:host{--pfe-toast--Top:50px;--pfe-toast--MaxWidth:500px;--pfe-toast--MinWidth:250px;--pfe-toast--Right--offset:50px;--pfe-toast--Right:calc(-1 * (var(--pfe-toast--MaxWidth) + var(--pfe-toast--Right--offset)));--pfe-toast__container--BackgroundColor:var(--pfe-theme--color--surface--lightest, #fff);--pfe-toast__container--BoxShadow:rgba(3, 3, 3, 0.13) 0px 3px 7px 3px,rgba(3, 3, 3, 0.12) 0px 11px 24px 16px;--pfe-toast__container--Color:var(--pfe-theme--color--text, #333);--pfe-toast__container--Padding:1rem;--pfe-toast__close--svg--Fill:var(--pfe-theme--color--feedback--default--darkest, #464646);--pfe-toast__close--svg--Fill--hover:#333;--pfe-toast__close--svg--Height:12px;--pfe-toast__close--svg--Width:12px;--pfe-toast__close--PaddingTop:0;--pfe-toast__close--PaddingRight:0;--pfe-toast__close--PaddingBottom:0;--pfe-toast__close--PaddingLeft:0;--pfe-toast__close--Padding:var(--pfe-toast__close--PaddingTop) var(--pfe-toast__close--PaddingRight) var(--pfe-toast__close--PaddingBottom) var(--pfe-toast__close--PaddingLeft);-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;position:absolute;right:var(--pfe-toast--Right);top:var(--pfe-toast--Top);-webkit-transition:right .5s ease-in-out;transition:right .5s ease-in-out;will-change:right;max-width:var(--pfe-toast--MaxWidth);min-width:var(--pfe-toast--MinWidth)}@media only screen and (max-width:575px){:host{max-width:calc(var(--pfe-toast--MaxWidth)/ 2);min-width:calc(var(--pfe-toast--MinWidth)/ 2)}}:host([hidden]){display:none}:host(.open){--pfe-toast--Right:50px}:host(:not(.open)){--pfe-toast--Right:calc(-1 * (var(--pfe-toast--MaxWidth) + var(--pfe-toast--Right--offset)))}::slotted(:first-child){margin-top:0}::slotted(button){background:0 0;border-radius:0;display:inline-block;margin-bottom:0;margin-right:1rem;padding: .5rem .75rem;text-align:center}.pfe-toast__container{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;background-color:var(--pfe-toast__container--BackgroundColor);-webkit-box-shadow:var(--pfe-toast__container--BoxShadow);box-shadow:var(--pfe-toast__container--BoxShadow);color:var(--pfe-toast__container--Color);padding:var(--pfe-toast__container--Padding)}.pfe-toast__content{-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.pfe-toast__close{-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;background-color:transparent;border:none;cursor:pointer;margin:0;padding:var(--pfe-toast__close--Padding)}.pfe-toast__close>svg{fill:var(--pfe-toast__close--svg--Fill);height:var(--pfe-toast__close--svg--Height);width:var(--pfe-toast__close--svg--Width)}.pfe-toast__close:hover>svg{fill:var(--pfe-toast__close--svg--Fill--hover)}\n/*# sourceMappingURL=pfe-toast.min.css.map */\n</style><div class="pfe-toast__container">\n <div class="pfe-toast__content">\n <slot></slot>\n </div>\n <button class="pfe-toast__close">\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32"\n height="32" viewBox="-11 11 22 23">\n <path\n d="M30 16.669v-1.331c0-0.363-0.131-0.675-0.394-0.938s-0.575-0.394-0.938-0.394h-10.669v-10.65c0-0.362-0.131-0.675-0.394-0.938s-0.575-0.394-0.938-0.394h-1.331c-0.363 0-0.675 0.131-0.938 0.394s-0.394 0.575-0.394 0.938v10.644h-10.675c-0.362 0-0.675 0.131-0.938 0.394s-0.394 0.575-0.394 0.938v1.331c0 0.363 0.131 0.675 0.394 0.938s0.575 0.394 0.938 0.394h10.669v10.644c0 0.363 0.131 0.675 0.394 0.938 0.262 0.262 0.575 0.394 0.938 0.394h1.331c0.363 0 0.675-0.131 0.938-0.394s0.394-0.575 0.394-0.938v-10.637h10.669c0.363 0 0.675-0.131 0.938-0.394 0.269-0.262 0.4-0.575 0.4-0.938z"\n transform="rotate(45)" />\n </svg>\n </button>\n</div>'}},{key:"templateUrl",get:function(){return"pfe-toast.html"}},{key:"schemaUrl",get:function(){return"pfe-toast.json"}},{key:"styleUrl",get:function(){return"pfe-toast.scss"}},{key:"closeLabel",get:function(){return this.getAttribute("close-label")||"Close"}}],[{key:"version",get:function(){return"1.0.0-prerelease.37"}},{key:"properties",get:function(){return{auto_dismiss:{title:"Auto dismiss",type:"string"},close_label:{title:"Close label",type:"string"}}}},{key:"slots",get:function(){return{content:{title:"Content",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"raw"}]}}}}},{key:"tag",get:function(){return"pfe-toast"}},{key:"PfeType",get:function(){return t.PfeTypes.Container}},{key:"observedAttributes",get:function(){return["auto-dismiss","close-label"]}}]),e(i,[{key:"attributeChangedCallback",value:function(t,e,o){switch(t){case"close-label":this._toastCloseButton.setAttribute("aria-label",this.closeLabel);case"auto-dismiss":this.doesAutoDismiss=!!o,this._setAccessibility()}}},{key:"_setAccessibility",value:function(){this.doesAutoDismiss?(this.removeAttribute("aria-label"),this.removeAttribute("aria-describedby"),this.setAttribute("role","alert"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true")):(this.removeAttribute("aria-live"),this.removeAttribute("aria-atomic"),this.setAttribute("role","alertdialog"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Alert dialog"),this.setAttribute("aria-describedby",this.tag+"__content"))}},{key:"connectedCallback",value:function(){(function t(e,o,s){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,o);if(void 0===i){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,o,s)}if("value"in i)return i.value;var n=i.get;return void 0!==n?n.call(s):void 0})(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"connectedCallback",this).call(this),this.doesAutoDismiss=this.hasAttribute("auto-dismiss"),this._toastCloseButton.setAttribute("aria-label",this.closeLabel),this._setAccessibility(),this.setAttribute("hidden",""),this._toastCloseButton.addEventListener("click",this.close),this.addEventListener("keydown",this._keydownHandler)}},{key:"disconnectedCallback",value:function(){this._toastCloseButton.removeEventListener("click",this.close),this.removeEventListener("keydown",this._keydownHandler)}},{key:"open",value:function(t){var e=this;return t&&t.preventDefault(),this.isOpen=!0,this.removeAttribute("hidden"),setTimeout(function(){e.classList.add("open")},500),this.dispatchEvent(new CustomEvent(this.tag+":open",{detail:{},bubbles:!0})),this.doesAutoDismiss&&setTimeout(function(){e.close()},this._toMilliseconds(this.getAttribute("auto-dismiss"))),this}},{key:"close",value:function(t){var e=this;return t&&t.preventDefault(),this.isOpen=!1,this.classList.remove("open"),setTimeout(function(){e.setAttribute("hidden","")},500),this.dispatchEvent(new CustomEvent(this.tag+":close",{detail:{},bubbles:!0})),this}},{key:"toggle",value:function(t){return this.isOpen?this.close(t):this.open(t),this}},{key:"_toMilliseconds",value:function(t){var e=t.match(/\d+/)||[8e3];return"s"===(t.match(/\D+/)||"")[0]?1e3*e[0]:e[0]}},{key:"_keydownHandler",value:function(t){var e=t.target||window.event.srcElement;switch(t.key||t.keyCode){case"Escape":case"Esc":case 27:this.close(t);break;case"Enter":case 13:e===this._toastCloseButton&&this.close(t)}}}]),i);function i(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,i));return t.isOpen=!1,t.doesAutoDismiss=!1,t._container=t.shadowRoot.querySelector("."+t.tag+"__container"),t._content=t.shadowRoot.querySelector("."+t.tag+"__content"),t._toastCloseButton=t.shadowRoot.querySelector("."+t.tag+"__close"),t.open=t.open.bind(t),t.close=t.close.bind(t),t.toggle=t.toggle.bind(t),t}return t.create(o),o});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("../../pfelement/dist/pfelement.umd")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd"],e):t.PfeToast=e(t.PFElement)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e=function(t,e,o){return e&&s(t.prototype,e),o&&s(t,o),t};function s(t,e){for(var o=0;o<e.length;o++){var s=e[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}var o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(i,t),e(i,[{key:"html",get:function(){return'<style>@charset "UTF-8";:host{--pfe-toast--Top:50px;--pfe-toast--MaxWidth:500px;--pfe-toast--MinWidth:250px;--pfe-toast--Right--offset:50px;--pfe-toast--Right:calc(-1 * (var(--pfe-toast--MaxWidth) + var(--pfe-toast--Right--offset)));--pfe-toast__container--BackgroundColor:var(--pfe-theme--color--surface--lightest, #fff);--pfe-toast__container--BoxShadow:rgba(3, 3, 3, 0.13) 0px 3px 7px 3px,rgba(3, 3, 3, 0.12) 0px 11px 24px 16px;--pfe-toast__container--Color:var(--pfe-theme--color--text, #333);--pfe-toast__container--Padding:1rem;--pfe-toast__close--svg--Fill:var(--pfe-theme--color--feedback--default--darkest, #464646);--pfe-toast__close--svg--Fill--hover:#333;--pfe-toast__close--svg--Height:12px;--pfe-toast__close--svg--Width:12px;--pfe-toast__close--PaddingTop:0;--pfe-toast__close--PaddingRight:0;--pfe-toast__close--PaddingBottom:0;--pfe-toast__close--PaddingLeft:0;--pfe-toast__close--Padding:var(--pfe-toast__close--PaddingTop) var(--pfe-toast__close--PaddingRight) var(--pfe-toast__close--PaddingBottom) var(--pfe-toast__close--PaddingLeft);-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;position:absolute;right:var(--pfe-toast--Right);top:var(--pfe-toast--Top);-webkit-transition:right .5s ease-in-out;transition:right .5s ease-in-out;will-change:right;max-width:var(--pfe-toast--MaxWidth);min-width:var(--pfe-toast--MinWidth)}@media only screen and (max-width:575px){:host{max-width:calc(var(--pfe-toast--MaxWidth)/ 2);min-width:calc(var(--pfe-toast--MinWidth)/ 2)}}:host([hidden]){display:none}:host(.open){--pfe-toast--Right:50px}:host(:not(.open)){--pfe-toast--Right:calc(-1 * (var(--pfe-toast--MaxWidth) + var(--pfe-toast--Right--offset)))}::slotted(:first-child){margin-top:0}::slotted(button){background:0 0;border-radius:0;display:inline-block;margin-bottom:0;margin-right:1rem;padding: .5rem .75rem;text-align:center}.pfe-toast__container{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;background-color:var(--pfe-toast__container--BackgroundColor);-webkit-box-shadow:var(--pfe-toast__container--BoxShadow);box-shadow:var(--pfe-toast__container--BoxShadow);color:var(--pfe-toast__container--Color);padding:var(--pfe-toast__container--Padding)}.pfe-toast__content{-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.pfe-toast__close{-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;background-color:transparent;border:none;cursor:pointer;margin:0;padding:var(--pfe-toast__close--Padding)}.pfe-toast__close>svg{fill:var(--pfe-toast__close--svg--Fill);height:var(--pfe-toast__close--svg--Height);width:var(--pfe-toast__close--svg--Width)}.pfe-toast__close:hover>svg{fill:var(--pfe-toast__close--svg--Fill--hover)}\n/*# sourceMappingURL=pfe-toast.min.css.map */\n</style><div class="pfe-toast__container">\n <div class="pfe-toast__content">\n <slot></slot>\n </div>\n <button class="pfe-toast__close">\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32"\n height="32" viewBox="-11 11 22 23">\n <path\n d="M30 16.669v-1.331c0-0.363-0.131-0.675-0.394-0.938s-0.575-0.394-0.938-0.394h-10.669v-10.65c0-0.362-0.131-0.675-0.394-0.938s-0.575-0.394-0.938-0.394h-1.331c-0.363 0-0.675 0.131-0.938 0.394s-0.394 0.575-0.394 0.938v10.644h-10.675c-0.362 0-0.675 0.131-0.938 0.394s-0.394 0.575-0.394 0.938v1.331c0 0.363 0.131 0.675 0.394 0.938s0.575 0.394 0.938 0.394h10.669v10.644c0 0.363 0.131 0.675 0.394 0.938 0.262 0.262 0.575 0.394 0.938 0.394h1.331c0.363 0 0.675-0.131 0.938-0.394s0.394-0.575 0.394-0.938v-10.637h10.669c0.363 0 0.675-0.131 0.938-0.394 0.269-0.262 0.4-0.575 0.4-0.938z"\n transform="rotate(45)" />\n </svg>\n </button>\n</div>'}},{key:"templateUrl",get:function(){return"pfe-toast.html"}},{key:"schemaUrl",get:function(){return"pfe-toast.json"}},{key:"styleUrl",get:function(){return"pfe-toast.scss"}},{key:"closeLabel",get:function(){return this.getAttribute("close-label")||"Close"}}],[{key:"version",get:function(){return"1.0.0-prerelease.39"}},{key:"properties",get:function(){return{auto_dismiss:{title:"Auto dismiss",type:"string"},close_label:{title:"Close label",type:"string"}}}},{key:"slots",get:function(){return{content:{title:"Content",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"raw"}]}}}}},{key:"tag",get:function(){return"pfe-toast"}},{key:"PfeType",get:function(){return t.PfeTypes.Container}},{key:"observedAttributes",get:function(){return["auto-dismiss","close-label"]}}]),e(i,[{key:"attributeChangedCallback",value:function(t,e,o){switch(t){case"close-label":this._toastCloseButton.setAttribute("aria-label",this.closeLabel);case"auto-dismiss":this.doesAutoDismiss=!!o,this._setAccessibility()}}},{key:"_setAccessibility",value:function(){this.doesAutoDismiss?(this.removeAttribute("aria-label"),this.removeAttribute("aria-describedby"),this.setAttribute("role","alert"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","true")):(this.removeAttribute("aria-live"),this.removeAttribute("aria-atomic"),this.setAttribute("role","alertdialog"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Alert dialog"),this.setAttribute("aria-describedby",this.tag+"__content"))}},{key:"connectedCallback",value:function(){(function t(e,o,s){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,o);if(void 0===i){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,o,s)}if("value"in i)return i.value;var n=i.get;return void 0!==n?n.call(s):void 0})(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"connectedCallback",this).call(this),this.doesAutoDismiss=this.hasAttribute("auto-dismiss"),this._toastCloseButton.setAttribute("aria-label",this.closeLabel),this._setAccessibility(),this.setAttribute("hidden",""),this._toastCloseButton.addEventListener("click",this.close),this.addEventListener("keydown",this._keydownHandler)}},{key:"disconnectedCallback",value:function(){this._toastCloseButton.removeEventListener("click",this.close),this.removeEventListener("keydown",this._keydownHandler)}},{key:"open",value:function(t){var e=this;return t&&t.preventDefault(),this.isOpen=!0,this.removeAttribute("hidden"),setTimeout(function(){e.classList.add("open")},500),this.dispatchEvent(new CustomEvent(this.tag+":open",{detail:{},bubbles:!0})),this.doesAutoDismiss&&setTimeout(function(){e.close()},this._toMilliseconds(this.getAttribute("auto-dismiss"))),this}},{key:"close",value:function(t){var e=this;return t&&t.preventDefault(),this.isOpen=!1,this.classList.remove("open"),setTimeout(function(){e.setAttribute("hidden","")},500),this.dispatchEvent(new CustomEvent(this.tag+":close",{detail:{},bubbles:!0})),this}},{key:"toggle",value:function(t){return this.isOpen?this.close(t):this.open(t),this}},{key:"_toMilliseconds",value:function(t){var e=t.match(/\d+/)||[8e3];return"s"===(t.match(/\D+/)||"")[0]?1e3*e[0]:e[0]}},{key:"_keydownHandler",value:function(t){var e=t.target||window.event.srcElement;switch(t.key||t.keyCode){case"Escape":case"Esc":case 27:this.close(t);break;case"Enter":case 13:e===this._toastCloseButton&&this.close(t)}}}]),i);function i(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,i));return t.isOpen=!1,t.doesAutoDismiss=!1,t._container=t.shadowRoot.querySelector("."+t.tag+"__container"),t._content=t.shadowRoot.querySelector("."+t.tag+"__content"),t._toastCloseButton=t.shadowRoot.querySelector("."+t.tag+"__close"),t.open=t.open.bind(t),t.close=t.close.bind(t),t.toggle=t.toggle.bind(t),t}return t.create(o),o});
//# sourceMappingURL=pfe-toast.umd.min.js.map

@@ -7,3 +7,3 @@ {

},
"version": "1.0.0-prerelease.37",
"version": "1.0.0-prerelease.39",
"description": "Toast element for PatternFly Elements",

@@ -38,7 +38,7 @@ "keywords": [

"dependencies": {
"@patternfly/pfe-sass": "^1.0.0-prerelease.37",
"@patternfly/pfelement": "^1.0.0-prerelease.36"
"@patternfly/pfe-sass": "^1.0.0-prerelease.39",
"@patternfly/pfelement": "^1.0.0-prerelease.39"
},
"generator-pfelement-version": "1.3.0",
"gitHead": "85d265e3f697be6219c26ab7e5f893206f19f40f"
"gitHead": "1b6d7c929db9b9583022b3536dddcdfa0c37d36a"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc