Socket
Socket
Sign inDemoInstall

@patternfly/pfe-toast

Package Overview
Dependencies
3
Maintainers
13
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.0 to 1.5.0

4

dist/pfe-toast.js
import PFElement from '../../pfelement/dist/pfelement.js';
/*!
* PatternFly Elements: PfeToast 1.4.0
* PatternFly Elements: PfeToast 1.5.0
* @license

@@ -32,3 +32,3 @@ * Copyright 2021 Red Hat, Inc.

static get version() {
return "1.4.0";
return "1.5.0";
}

@@ -35,0 +35,0 @@

import t from"../../pfelement/dist/pfelement.min.js";
/*!
* PatternFly Elements: PfeToast 1.4.0
* PatternFly Elements: PfeToast 1.5.0
* @license

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

*
*/class e extends t{static get version(){return"1.4.0"}get html(){return'\n<style>@charset "UTF-8";:host{-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:calc(-1 * (500px + 50px));right:var(--pfe-toast--Right,calc(-1 * (var(--pfe-toast--MaxWidth,500px) + var(--pfe-toast--Right--offset,50px))));top:50px;top:var(--pfe-toast--Top,50px);-webkit-transition:right .3s cubic-bezier(.465,.183,.153,.946);transition:right .3s cubic-bezier(.465,.183,.153,.946);-webkit-transition:right var(--pfe-theme--animation-speed,.3s) var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:right var(--pfe-theme--animation-speed,.3s) var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));will-change:right;max-width:500px;max-width:var(--pfe-toast--MaxWidth,500px);min-width:250px;min-width:var(--pfe-toast--MinWidth,250px)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{right:0}}@media only screen and (max-width:575px){:host{max-width:calc(500px / 2);max-width:calc(var(--pfe-toast--MaxWidth,500px)/ 2);min-width:calc(250px / 2);min-width:calc(var(--pfe-toast--MinWidth,250px)/ 2)}}:host([hidden]){display:none}:host(.open){--pfe-toast--Right:50px}:host(:not(.open)){--pfe-toast--Right:calc(-1 * var(--pfe-toast--MaxWidth, 500px) + var(--pfe-toast--Right--offset, 50px))}::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:#fff;background-color:var(--pfe-toast__container--BackgroundColor,var(--pfe-theme--color--surface--lightest,#fff));-webkit-box-shadow:0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12);box-shadow:0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12);-webkit-box-shadow:var(--pfe-toast__container--BoxShadow,var(--pfe-theme--box-shadow--lg,0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12)));box-shadow:var(--pfe-toast__container--BoxShadow,var(--pfe-theme--box-shadow--lg,0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12)));color:#151515;color:var(--pfe-toast__container--Color,var(--pfe-theme--color--text,#151515));padding:1rem;padding:var(--pfe-toast__container--Padding,var(--pfe-theme--container-padding,1rem))}.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:0;padding:var(--pfe-toast__close--Padding,var(--pfe-toast__close--PaddingTop,0) var(--pfe-toast__close--PaddingRight,0) var(--pfe-toast__close--PaddingBottom,0) var(--pfe-toast__close--PaddingLeft,0))}.pfe-toast__close>svg{fill:#3c3f42;fill:var(--pfe-toast__close--svg--Fill,var(--pfe-theme--color--feedback--default--darkest,#3c3f42));height:12px;height:var(--pfe-toast__close--svg--Height,12px);width:12px;width:var(--pfe-toast__close--svg--Width,12px)}.pfe-toast__close:hover>svg{fill:#333;fill:var(--pfe-toast__close--svg--Fill--hover,#333)} /*# sourceMappingURL=pfe-toast.min.css.map */</style>\n<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 schemaProperties(){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"}static get PfeType(){return t.PfeTypes.Container}static get properties(){return{closeLabel:{title:"Close label",type:String,default:"Close",observer:"_closeLabelChanged"},autoDismiss:{title:"Auto dismiss",type:String,observer:"_autoDismissChanged"}}}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)}_closeLabelChanged(){this._toastCloseButton.setAttribute("aria-label",this.closeLabel)}_autoDismissChanged(t,e){this.doesAutoDismiss=!!e,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=null!==this.autoDismiss,this._toastCloseButton.setAttribute("aria-label",this.closeLabel),this._setAccessibility(),this.setAttribute("hidden",""),this._toastCloseButton.addEventListener("click",this.close),this.addEventListener("keydown",this._keydownHandler)}disconnectedCallback(){super.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.autoDismiss)),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.5.0"}get html(){return'\n<style>@charset "UTF-8";:host{-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:calc(-1 * (500px + 50px));right:var(--pfe-toast--Right,calc(-1 * (var(--pfe-toast--MaxWidth,500px) + var(--pfe-toast--Right--offset,50px))));top:50px;top:var(--pfe-toast--Top,50px);-webkit-transition:right .3s cubic-bezier(.465,.183,.153,.946);transition:right .3s cubic-bezier(.465,.183,.153,.946);-webkit-transition:right var(--pfe-theme--animation-speed,.3s) var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:right var(--pfe-theme--animation-speed,.3s) var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));will-change:right;max-width:500px;max-width:var(--pfe-toast--MaxWidth,500px);min-width:250px;min-width:var(--pfe-toast--MinWidth,250px)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{right:0}}@media only screen and (max-width:575px){:host{max-width:calc(500px / 2);max-width:calc(var(--pfe-toast--MaxWidth,500px)/ 2);min-width:calc(250px / 2);min-width:calc(var(--pfe-toast--MinWidth,250px)/ 2)}}:host([hidden]){display:none}:host(.open){--pfe-toast--Right:50px}:host(:not(.open)){--pfe-toast--Right:calc(-1 * var(--pfe-toast--MaxWidth, 500px) + var(--pfe-toast--Right--offset, 50px))}::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:#fff;background-color:var(--pfe-toast__container--BackgroundColor,var(--pfe-theme--color--surface--lightest,#fff));-webkit-box-shadow:0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12);box-shadow:0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12);-webkit-box-shadow:var(--pfe-toast__container--BoxShadow,var(--pfe-theme--box-shadow--lg,0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12)));box-shadow:var(--pfe-toast__container--BoxShadow,var(--pfe-theme--box-shadow--lg,0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12)));color:#151515;color:var(--pfe-toast__container--Color,var(--pfe-theme--color--text,#151515));padding:1rem;padding:var(--pfe-toast__container--Padding,var(--pfe-theme--container-padding,1rem))}.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:0;padding:var(--pfe-toast__close--Padding,var(--pfe-toast__close--PaddingTop,0) var(--pfe-toast__close--PaddingRight,0) var(--pfe-toast__close--PaddingBottom,0) var(--pfe-toast__close--PaddingLeft,0))}.pfe-toast__close>svg{fill:#3c3f42;fill:var(--pfe-toast__close--svg--Fill,var(--pfe-theme--color--feedback--default--darkest,#3c3f42));height:12px;height:var(--pfe-toast__close--svg--Height,12px);width:12px;width:var(--pfe-toast__close--svg--Width,12px)}.pfe-toast__close:hover>svg{fill:#333;fill:var(--pfe-toast__close--svg--Fill--hover,#333)} /*# sourceMappingURL=pfe-toast.min.css.map */</style>\n<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 schemaProperties(){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"}static get PfeType(){return t.PfeTypes.Container}static get properties(){return{closeLabel:{title:"Close label",type:String,default:"Close",observer:"_closeLabelChanged"},autoDismiss:{title:"Auto dismiss",type:String,observer:"_autoDismissChanged"}}}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)}_closeLabelChanged(){this._toastCloseButton.setAttribute("aria-label",this.closeLabel)}_autoDismissChanged(t,e){this.doesAutoDismiss=!!e,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=null!==this.autoDismiss,this._toastCloseButton.setAttribute("aria-label",this.closeLabel),this._setAccessibility(),this.setAttribute("hidden",""),this._toastCloseButton.addEventListener("click",this.close),this.addEventListener("keydown",this._keydownHandler)}disconnectedCallback(){super.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.autoDismiss)),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.4.0
* PatternFly Elements: PfeToast 1.5.0
* @license

@@ -143,3 +143,3 @@ * Copyright 2021 Red Hat, Inc.

get: function get() {
return "1.4.0";
return "1.5.0";
}

@@ -146,0 +146,0 @@ }, {

@@ -1,2 +0,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).PfeToast=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")},o=function(t,e,o){return e&&i(t.prototype,e),o&&i(t,o),t};function i(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,o){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0!==i){if("value"in i)return i.value;i=i.get;return void 0!==i?i.call(o):void 0}if(null!==(t=Object.getPrototypeOf(t)))return s(t,e,o)}var a=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},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)}(r,t),o(r,[{key:"html",get:function(){return'\n<style>@charset "UTF-8";:host{-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:calc(-1 * (500px + 50px));right:var(--pfe-toast--Right,calc(-1 * (var(--pfe-toast--MaxWidth,500px) + var(--pfe-toast--Right--offset,50px))));top:50px;top:var(--pfe-toast--Top,50px);-webkit-transition:right .3s cubic-bezier(.465,.183,.153,.946);transition:right .3s cubic-bezier(.465,.183,.153,.946);-webkit-transition:right var(--pfe-theme--animation-speed,.3s) var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:right var(--pfe-theme--animation-speed,.3s) var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));will-change:right;max-width:500px;max-width:var(--pfe-toast--MaxWidth,500px);min-width:250px;min-width:var(--pfe-toast--MinWidth,250px)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{right:0}}@media only screen and (max-width:575px){:host{max-width:calc(500px / 2);max-width:calc(var(--pfe-toast--MaxWidth,500px)/ 2);min-width:calc(250px / 2);min-width:calc(var(--pfe-toast--MinWidth,250px)/ 2)}}:host([hidden]){display:none}:host(.open){--pfe-toast--Right:50px}:host(:not(.open)){--pfe-toast--Right:calc(-1 * var(--pfe-toast--MaxWidth, 500px) + var(--pfe-toast--Right--offset, 50px))}::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:#fff;background-color:var(--pfe-toast__container--BackgroundColor,var(--pfe-theme--color--surface--lightest,#fff));-webkit-box-shadow:0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12);box-shadow:0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12);-webkit-box-shadow:var(--pfe-toast__container--BoxShadow,var(--pfe-theme--box-shadow--lg,0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12)));box-shadow:var(--pfe-toast__container--BoxShadow,var(--pfe-theme--box-shadow--lg,0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12)));color:#151515;color:var(--pfe-toast__container--Color,var(--pfe-theme--color--text,#151515));padding:1rem;padding:var(--pfe-toast__container--Padding,var(--pfe-theme--container-padding,1rem))}.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:0;padding:var(--pfe-toast__close--Padding,var(--pfe-toast__close--PaddingTop,0) var(--pfe-toast__close--PaddingRight,0) var(--pfe-toast__close--PaddingBottom,0) var(--pfe-toast__close--PaddingLeft,0))}.pfe-toast__close>svg{fill:#3c3f42;fill:var(--pfe-toast__close--svg--Fill,var(--pfe-theme--color--feedback--default--darkest,#3c3f42));height:12px;height:var(--pfe-toast__close--svg--Height,12px);width:12px;width:var(--pfe-toast__close--svg--Width,12px)}.pfe-toast__close:hover>svg{fill:#333;fill:var(--pfe-toast__close--svg--Fill--hover,#333)} /*# sourceMappingURL=pfe-toast.min.css.map */</style>\n<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:"version",get:function(){return"1.4.0"}},{key:"schemaProperties",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:"properties",get:function(){return{closeLabel:{title:"Close label",type:String,default:"Close",observer:"_closeLabelChanged"},autoDismiss:{title:"Auto dismiss",type:String,observer:"_autoDismissChanged"}}}}]),o(r,[{key:"_closeLabelChanged",value:function(){this._toastCloseButton.setAttribute("aria-label",this.closeLabel)}},{key:"_autoDismissChanged",value:function(t,e){this.doesAutoDismiss=!!e,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(){s(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"connectedCallback",this).call(this),this.doesAutoDismiss=null!==this.autoDismiss,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(){s(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"disconnectedCallback",this).call(this),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.autoDismiss)),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)}}}]),r);function r(){e(this,r);var t=a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,r));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.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min"],e):(t=t||self).PfeToast=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")},o=function(t,e,o){return e&&i(t.prototype,e),o&&i(t,o),t};function i(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,o){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0!==i){if("value"in i)return i.value;i=i.get;return void 0!==i?i.call(o):void 0}if(null!==(t=Object.getPrototypeOf(t)))return s(t,e,o)}var a=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},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)}(r,t),o(r,[{key:"html",get:function(){return'\n<style>@charset "UTF-8";:host{-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:calc(-1 * (500px + 50px));right:var(--pfe-toast--Right,calc(-1 * (var(--pfe-toast--MaxWidth,500px) + var(--pfe-toast--Right--offset,50px))));top:50px;top:var(--pfe-toast--Top,50px);-webkit-transition:right .3s cubic-bezier(.465,.183,.153,.946);transition:right .3s cubic-bezier(.465,.183,.153,.946);-webkit-transition:right var(--pfe-theme--animation-speed,.3s) var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:right var(--pfe-theme--animation-speed,.3s) var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));will-change:right;max-width:500px;max-width:var(--pfe-toast--MaxWidth,500px);min-width:250px;min-width:var(--pfe-toast--MinWidth,250px)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{right:0}}@media only screen and (max-width:575px){:host{max-width:calc(500px / 2);max-width:calc(var(--pfe-toast--MaxWidth,500px)/ 2);min-width:calc(250px / 2);min-width:calc(var(--pfe-toast--MinWidth,250px)/ 2)}}:host([hidden]){display:none}:host(.open){--pfe-toast--Right:50px}:host(:not(.open)){--pfe-toast--Right:calc(-1 * var(--pfe-toast--MaxWidth, 500px) + var(--pfe-toast--Right--offset, 50px))}::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:#fff;background-color:var(--pfe-toast__container--BackgroundColor,var(--pfe-theme--color--surface--lightest,#fff));-webkit-box-shadow:0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12);box-shadow:0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12);-webkit-box-shadow:var(--pfe-toast__container--BoxShadow,var(--pfe-theme--box-shadow--lg,0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12)));box-shadow:var(--pfe-toast__container--BoxShadow,var(--pfe-theme--box-shadow--lg,0 .1875rem .4375rem .1875rem rgba(3,3,3,.13),0 .6875rem 1.5rem 1rem rgba(3,3,3,.12)));color:#151515;color:var(--pfe-toast__container--Color,var(--pfe-theme--color--text,#151515));padding:1rem;padding:var(--pfe-toast__container--Padding,var(--pfe-theme--container-padding,1rem))}.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:0;padding:var(--pfe-toast__close--Padding,var(--pfe-toast__close--PaddingTop,0) var(--pfe-toast__close--PaddingRight,0) var(--pfe-toast__close--PaddingBottom,0) var(--pfe-toast__close--PaddingLeft,0))}.pfe-toast__close>svg{fill:#3c3f42;fill:var(--pfe-toast__close--svg--Fill,var(--pfe-theme--color--feedback--default--darkest,#3c3f42));height:12px;height:var(--pfe-toast__close--svg--Height,12px);width:12px;width:var(--pfe-toast__close--svg--Width,12px)}.pfe-toast__close:hover>svg{fill:#333;fill:var(--pfe-toast__close--svg--Fill--hover,#333)} /*# sourceMappingURL=pfe-toast.min.css.map */</style>\n<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:"version",get:function(){return"1.5.0"}},{key:"schemaProperties",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:"properties",get:function(){return{closeLabel:{title:"Close label",type:String,default:"Close",observer:"_closeLabelChanged"},autoDismiss:{title:"Auto dismiss",type:String,observer:"_autoDismissChanged"}}}}]),o(r,[{key:"_closeLabelChanged",value:function(){this._toastCloseButton.setAttribute("aria-label",this.closeLabel)}},{key:"_autoDismissChanged",value:function(t,e){this.doesAutoDismiss=!!e,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(){s(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"connectedCallback",this).call(this),this.doesAutoDismiss=null!==this.autoDismiss,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(){s(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"disconnectedCallback",this).call(this),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.autoDismiss)),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)}}}]),r);function r(){e(this,r);var t=a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,r));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

@@ -8,3 +8,3 @@ {

},
"version": "1.4.0",
"version": "1.5.0",
"description": "Toast element for PatternFly Elements",

@@ -49,4 +49,4 @@ "keywords": [

"dependencies": {
"@patternfly/pfe-sass": "^1.4.0",
"@patternfly/pfelement": "^1.4.0"
"@patternfly/pfe-sass": "^1.5.0",
"@patternfly/pfelement": "^1.5.0"
},

@@ -57,3 +57,3 @@ "generator-pfelement-version": "1.3.0",

},
"gitHead": "54602c91c3570d923f848fce2f3d7ce61e3cdfd2"
"gitHead": "f6a7fc24f517ffdc80a75a1d9056a8c94562b252"
}

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