Socket
Socket
Sign inDemoInstall

@patternfly/pfelement

Package Overview
Dependencies
Maintainers
12
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@patternfly/pfelement - npm Package Compare versions

Comparing version 1.0.0-prerelease.55 to 1.0.0-prerelease.56

2

dist/pfelement.umd.min.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.PFElement=t()}(this,function(){"use strict";var o=function(){return null};function i(){o("[reveal] web components ready"),o("[reveal] elements ready, revealing the body"),window.document.body.removeAttribute("unresolved")}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e};function r(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var h="pfe-",t=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(a,HTMLElement),e(a,[{key:"cssVariable",value:function(e,t,n){var o=2<arguments.length&&void 0!==n?n:this;return e="--"!==e.substr(0,2)?"--"+e:e,t&&o.style.setProperty(e,t),window.getComputedStyle(o).getPropertyValue(e).trim()}},{key:"has_slot",value:function(e){return this.querySelector("[slot='"+e+"']")}},{key:"has_slots",value:function(e){return[].concat(c(this.querySelectorAll("[slot='"+e+"']")))}},{key:"context_update",value:function(){var e=this.querySelectorAll("[pfelement]"),t=this.cssVariable("theme");this.hasAttribute("pfe-theme")&&(t=this.getAttribute("pfe-theme"),this.cssVariable("theme",t)),this.context_set(t),[].concat(c(e)).map(function(e){e.connected&&e.context_set(t)})}},{key:"context_set",value:function(e){var t=this.cssVariable("theme");!(t=t||this.getAttribute("pfe-theme"))&&e&&(t=e),t&&this.hasAttribute("pfelement")&&this.setAttribute("on",t)}},{key:"randomId",get:function(){return"pfe-"+Math.random().toString(36).substr(2,9)}},{key:"version",get:function(){return this._pfeClass.version}},{key:"pfeType",get:function(){return this.getAttribute(h+"type")},set:function(e){this.setAttribute(h+"type",e)}}],[{key:"create",value:function(e){window.customElements.define(e.tag,e)}},{key:"debugLog",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return null!==t&&(a._debugLog=!!t),a._debugLog}},{key:"log",value:function(){var e;a.debugLog()&&(e=console).log.apply(e,arguments)}},{key:"PfeTypes",get:function(){return{Container:"container",Content:"content",Combo:"combo"}}},{key:"version",get:function(){return"{{version}}"}},{key:"observedAttributes",get:function(){return["pfe-theme"]}}]),e(a,[{key:"connectedCallback",value:function(){this.connected=!0,this.log("Connecting..."),window.ShadyCSS&&(this.log("Styling..."),window.ShadyCSS.styleElement(this),this.log("Styled.")),!this.hasAttribute("pfelement")&&this.hasAttribute("on")&&console.warn(this.tag+(this.id?"[#"+this.id+"]":"")+': The "on" attribute is protected and should not be manually added to a component. The base class will manage this value for you on upgrade.'),this.classList.add("PFElement"),this.setAttribute("pfelement",""),"object"===u(this.props)&&(this._mapSchemaToProperties(this.tag,this.props),this.log("Properties attached.")),"object"===u(this.slots)&&(this._mapSchemaToSlots(this.tag,this.slots),this.log("Slots attached.")),this._queue.length&&this._processQueue(),this.context_update(),this.log("Connected.")}},{key:"disconnectedCallback",value:function(){this.log("Disconnecting..."),this.connected=!1,this.log("Disconnected.")}},{key:"attributeChangedCallback",value:function(e,t,n){if(this._pfeClass.cascadingAttributes){var o=this._pfeClass.cascadingAttributes[e];o&&this._copyAttribute(e,o),"pfe-theme"===e&&this.context_update()}}},{key:"_copyAttribute",value:function(e,t){var n=[].concat(c(this.querySelectorAll(t)),c(this.shadowRoot.querySelectorAll(t))),o=this.getAttribute(e),i=null==o?"removeAttribute":"setAttribute",r=!0,s=!1,a=void 0;try{for(var l,u=n[Symbol.iterator]();!(r=(l=u.next()).done);r=!0)l.value[i](e,o)}catch(e){s=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(s)throw a}}}},{key:"_mapSchemaToProperties",value:function(s,a){var l=this;this.log("Mapping properties..."),Object.keys(a).forEach(function(e){var t=a[e];if("object"===(void 0===t?"undefined":u(t))){var n=!0,o=e;if(l[e]=t,l[e].value=null,void 0!==l[e].prefixed&&(n=l[e].prefixed),n&&(o=h+e),l.hasAttribute(o))l[e].value=l.getAttribute(o);else if(t.default){var i=l._hasDependency(s,t.options),r=!t.options||t.options&&!t.options.dependencies.length;(i||r)&&(l.setAttribute(o,t.default),l[e].value=t.default)}}}),this.log("Properties mapped.")}},{key:"_hasDependency",value:function(e,t){for(var n=t?t.dependencies:[],o=!1,i=0;i<n.length;i+=1){var r="slot"===n[i].type&&0<this.has_slots(e+"--"+n[i].id).length,s="attribute"===n[i].type&&this.getAttribute(h+n[i].id);if(r||s){o=!0;break}}return o}},{key:"_mapSchemaToSlots",value:function(i,r){var s=this;this.log("Validate slots..."),Object.keys(r).forEach(function(e){var t=r[e];if("object"===(void 0===t?"undefined":u(t))){var n=!1,o=[];t.namedSlot?(0<(o=s.has_slots(i+"--"+e)).length&&(t.nodes=o,n=!0),0<(o=s.has_slots(""+e)).length&&(t.nodes=o,n=!0)):0<(o=[].concat(c(s.children)).filter(function(e){return!e.hasAttribute("slot")})).length&&(t.nodes=o,n=!0),n?s.setAttribute("has_"+e,""):s.removeAttribute("has_"+e)}}),this.log("Slots validated.")}},{key:"_queueAction",value:function(e){this._queue.push(e)}},{key:"_processQueue",value:function(){var t=this;this._queue.forEach(function(e){t["_"+e.type](e.data)}),this._queue=[]}},{key:"_setProperty",value:function(e){var t=e.name,n=e.value;this[t]=n}},{key:"var",value:function(e){return a.var(e,this)}},{key:"render",value:function(){this.shadowRoot.innerHTML="",this.template.innerHTML=this.html,window.ShadyCSS&&window.ShadyCSS.prepareTemplate(this.template,this.tag),this.shadowRoot.appendChild(this.template.content.cloneNode(!0))}},{key:"log",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];a.log.apply(a,["["+this.tag+"]"].concat(t))}},{key:"emitEvent",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{},o=n.bubbles,i=void 0===o||o,r=n.cancelable,s=void 0!==r&&r,a=n.composed,l=void 0!==a&&a,u=n.detail,c=void 0===u?{}:u;this.log("Custom event: "+e),this.dispatchEvent(new CustomEvent(e,{bubbles:i,cancelable:s,composed:l,detail:c}))}}],[{key:"var",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:document.body;return window.getComputedStyle(n).getPropertyValue(e).trim()}}]),a);function a(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=t.type,o=void 0===n?null:n,i=t.delayRender,r=void 0!==i&&i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return s.connected=!1,s._pfeClass=e,s.tag=e.tag,s.props=e.properties,s.slots=e.slots,s._queue=[],s.template=document.createElement("template"),s.log("Constructing..."),s.attachShadow({mode:"open"}),o&&s._queueAction({type:"setProperty",data:{name:"pfeType",value:o}}),r||(s.log("Render..."),s.render(),s.log("Rendered.")),s.log("Constructed."),s}return function(e){o=e;var t=window.WebComponents,n=t&&window.WebComponents.ready;!t||n?i():window.addEventListener("WebComponentsReady",i)}(t.log),t});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.PFElement=t()}(this,function(){"use strict";var o=function(){return null};function i(){o("[reveal] web components ready"),o("[reveal] elements ready, revealing the body"),window.document.body.removeAttribute("unresolved")}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e};function r(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function c(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var u=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},h="pfe-",t=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(d,HTMLElement),e(d,[{key:"cssVariable",value:function(e,t,n){var o=2<arguments.length&&void 0!==n?n:this;return e="--"!==e.substr(0,2)?"--"+e:e,t&&o.style.setProperty(e,t),window.getComputedStyle(o).getPropertyValue(e).trim()}},{key:"has_slot",value:function(e){return this.querySelector("[slot='"+e+"']")}},{key:"has_slots",value:function(e){return[].concat(c(this.querySelectorAll("[slot='"+e+"']")))}},{key:"context_update",value:function(){var e=this.querySelectorAll("[pfelement]"),t=this.cssVariable("theme");this.hasAttribute("pfe-theme")&&(t=this.getAttribute("pfe-theme"),this.cssVariable("theme",t)),this.context_set(t),[].concat(c(e)).map(function(e){e.connected&&e.context_set(t)})}},{key:"context_set",value:function(e){var t=this.cssVariable("theme");!(t=t||this.getAttribute("pfe-theme"))&&e&&(t=e),t&&this.hasAttribute("pfelement")&&this.setAttribute("on",t)}},{key:"randomId",get:function(){return"pfe-"+Math.random().toString(36).substr(2,9)}},{key:"version",get:function(){return this._pfeClass.version}},{key:"pfeType",get:function(){return this.getAttribute(h+"type")},set:function(e){this.setAttribute(h+"type",e)}}],[{key:"create",value:function(e){window.customElements.define(e.tag,e)}},{key:"debugLog",value:function(e){var t=0<arguments.length&&void 0!==e?e:null;return null!==t&&(d._debugLog=!!t),d._debugLog}},{key:"log",value:function(){var e;d.debugLog()&&(e=console).log.apply(e,arguments)}},{key:"PfeTypes",get:function(){return{Container:"container",Content:"content",Combo:"combo"}}},{key:"version",get:function(){return"{{version}}"}},{key:"observedAttributes",get:function(){return["pfe-theme"]}}]),e(d,[{key:"connectedCallback",value:function(){this.connected=!0,this.log("Connecting..."),window.ShadyCSS&&(this.log("Styling..."),window.ShadyCSS.styleElement(this),this.log("Styled.")),!this.hasAttribute("pfelement")&&this.hasAttribute("on")&&console.warn(this.tag+(this.id?"[#"+this.id+"]":"")+': The "on" attribute is protected and should not be manually added to a component. The base class will manage this value for you on upgrade.'),this.classList.add("PFElement"),this.setAttribute("pfelement",""),"object"===l(this.props)&&(this._mapSchemaToProperties(this.tag,this.props),this.log("Properties attached.")),"object"===l(this.slots)&&(this._mapSchemaToSlots(this.tag,this.slots),this.log("Slots attached.")),this._queue.length&&this._processQueue(),this.context_update(),this.log("Connected.")}},{key:"disconnectedCallback",value:function(){this.log("Disconnecting..."),this.connected=!1,this.log("Disconnected.")}},{key:"attributeChangedCallback",value:function(e){var t;this._pfeClass.cascadingAttributes&&((t=this._pfeClass.cascadingAttributes[e])&&this._copyAttribute(e,t),"pfe-theme"===e&&this.context_update())}},{key:"_copyAttribute",value:function(e,t){var n=[].concat(c(this.querySelectorAll(t)),c(this.shadowRoot.querySelectorAll(t))),o=this.getAttribute(e),i=null==o?"removeAttribute":"setAttribute",r=!0,s=!1,a=void 0;try{for(var u,l=n[Symbol.iterator]();!(r=(u=l.next()).done);r=!0)u.value[i](e,o)}catch(e){s=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(s)throw a}}}},{key:"_mapSchemaToProperties",value:function(s,a){var u=this;this.log("Mapping properties..."),Object.keys(a).forEach(function(e){var t,n,o,i,r=a[e];"object"===(void 0===r?"undefined":l(r))&&(t=!0,u[n=e]=r,u[e].value=null,void 0!==u[e].prefixed&&(t=u[e].prefixed),t&&(n=h+e),u.hasAttribute(n)?u[e].value=u.getAttribute(n):r.default&&(o=u._hasDependency(s,r.options),i=!r.options||r.options&&!r.options.dependencies.length,(o||i)&&(u.setAttribute(n,r.default),u[e].value=r.default)))}),this.log("Properties mapped.")}},{key:"_hasDependency",value:function(e,t){for(var n=t?t.dependencies:[],o=!1,i=0;i<n.length;i+=1){var r="slot"===n[i].type&&0<this.has_slots(e+"--"+n[i].id).length,s="attribute"===n[i].type&&this.getAttribute(h+n[i].id);if(r||s){o=!0;break}}return o}},{key:"_mapSchemaToSlots",value:function(i,r){var s=this;this.log("Validate slots..."),Object.keys(r).forEach(function(e){var t,n,o=r[e];"object"===(void 0===o?"undefined":l(o))&&(t=!1,n=[],o.namedSlot?(0<(n=s.has_slots(i+"--"+e)).length&&(o.nodes=n,t=!0),0<(n=s.has_slots(""+e)).length&&(o.nodes=n,t=!0)):0<(n=[].concat(c(s.children)).filter(function(e){return!e.hasAttribute("slot")})).length&&(o.nodes=n,t=!0),t?s.setAttribute("has_"+e,""):s.removeAttribute("has_"+e))}),this.log("Slots validated.")}},{key:"_queueAction",value:function(e){this._queue.push(e)}},{key:"_processQueue",value:function(){var t=this;this._queue.forEach(function(e){t["_"+e.type](e.data)}),this._queue=[]}},{key:"_setProperty",value:function(e){var t=e.name,n=e.value;this[t]=n}},{key:"var",value:function(e){return d.var(e,this)}},{key:"render",value:function(){this.shadowRoot.innerHTML="",this.template.innerHTML=this.html,window.ShadyCSS&&window.ShadyCSS.prepareTemplate(this.template,this.tag),this.shadowRoot.appendChild(this.template.content.cloneNode(!0))}},{key:"log",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];d.log.apply(d,["["+this.tag+"]"].concat(t))}},{key:"emitEvent",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{},o=n.bubbles,i=void 0===o||o,r=n.cancelable,s=void 0!==r&&r,a=n.composed,u=void 0!==a&&a,l=n.detail,c=void 0===l?{}:l;this.log("Custom event: "+e),this.dispatchEvent(new CustomEvent(e,{bubbles:i,cancelable:s,composed:u,detail:c}))}}],[{key:"var",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:document.body;return window.getComputedStyle(n).getPropertyValue(e).trim()}}]),d);function d(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=t.type,o=void 0===n?null:n,i=t.delayRender,r=void 0!==i&&i;a(this,d);var s=u(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return s.connected=!1,s._pfeClass=e,s.tag=e.tag,s.props=e.properties,s.slots=e.slots,s._queue=[],s.template=document.createElement("template"),s.log("Constructing..."),s.attachShadow({mode:"open"}),o&&s._queueAction({type:"setProperty",data:{name:"pfeType",value:o}}),r||(s.log("Render..."),s.render(),s.log("Rendered.")),s.log("Constructed."),s}return function(e){o=e;var t=window.WebComponents,n=t&&window.WebComponents.ready;!t||n?i():window.addEventListener("WebComponentsReady",i)}(t.log),t});
//# sourceMappingURL=pfelement.umd.min.js.map

@@ -11,3 +11,3 @@ {

},
"version": "1.0.0-prerelease.55",
"version": "1.0.0-prerelease.56",
"publishConfig": {

@@ -57,3 +57,3 @@ "access": "public"

},
"gitHead": "3b60a6f1114595a7ff261aad4e26ed1b33beb532"
"gitHead": "efed86135e85925182445801ab89570b3bcec5ca"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc