@patternfly/pfe-button
Advanced tools
Comparing version 1.2.0 to 1.3.0
import PFElement from '../../pfelement/dist/pfelement.js'; | ||
/*! | ||
* PatternFly Elements: PfeButton 1.2.0 | ||
* PatternFly Elements: PfeButton 1.3.0 | ||
* @license | ||
@@ -56,3 +56,3 @@ * Copyright 2021 Red Hat, Inc. | ||
static get version() { | ||
return "1.2.0"; | ||
return "1.3.0"; | ||
} | ||
@@ -59,0 +59,0 @@ |
import t from"../../pfelement/dist/pfelement.min.js"; | ||
/*! | ||
* PatternFly Elements: PfeButton 1.2.0 | ||
* PatternFly Elements: PfeButton 1.3.0 | ||
* @license | ||
@@ -26,3 +26,3 @@ * Copyright 2021 Red Hat, Inc. | ||
*/ | ||
const r={childList:!0},e={characterData:!0,attributes:!0,subtree:!0,childList:!0},o=["style"];class a extends t{static get version(){return"1.2.0"}get html(){return'\n<style>: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 */</style>\n<span id="internalBtn"></span>'}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; | ||
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<style>: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 */</style>\n<span id="internalBtn"></span>'}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 |
@@ -83,3 +83,3 @@ (function (global, factory) { | ||
/*! | ||
* PatternFly Elements: PfeButton 1.2.0 | ||
* PatternFly Elements: PfeButton 1.3.0 | ||
* @license | ||
@@ -166,3 +166,3 @@ * Copyright 2021 Red Hat, Inc. | ||
get: function get() { | ||
return "1.2.0"; | ||
return "1.3.0"; | ||
} | ||
@@ -169,0 +169,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).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<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function n(t,e,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,e);if(void 0!==o){if("value"in o)return o.value;o=o.get;return void 0!==o?o.call(r):void 0}if(t=Object.getPrototypeOf(t),null!==t)return n(t,e,r)}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},i={childList:!0},l={characterData:!0,attributes:!0,subtree:!0,childList:!0},c=["style"],r=(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)}(u,t),r(u,[{key:"html",get:function(){return'\n<style>: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 */</style>\n<span id="internalBtn"></span>'}},{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.2.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}); | ||
!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<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function n(t,e,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,e);if(void 0!==o){if("value"in o)return o.value;o=o.get;return void 0!==o?o.call(r):void 0}if(t=Object.getPrototypeOf(t),null!==t)return n(t,e,r)}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},i={childList:!0},l={characterData:!0,attributes:!0,subtree:!0,childList:!0},c=["style"],r=(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)}(u,t),r(u,[{key:"html",get:function(){return'\n<style>: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 */</style>\n<span id="internalBtn"></span>'}},{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 |
@@ -15,3 +15,3 @@ { | ||
}, | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"keywords": [ | ||
@@ -64,8 +64,8 @@ "web-components", | ||
"dependencies": { | ||
"@patternfly/pfelement": "^1.2.0" | ||
"@patternfly/pfelement": "^1.3.0" | ||
}, | ||
"devDependencies": { | ||
"@patternfly/pfe-sass": "^1.2.0" | ||
"@patternfly/pfe-sass": "^1.3.0" | ||
}, | ||
"gitHead": "db67dc4ce94b993024e4f8125f1bd4abfbd763f4" | ||
"gitHead": "2efa529fe9cfb9d21390089349f7921b82df7f03" | ||
} |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
141223
0
Updated@patternfly/pfelement@^1.3.0