@lrnwebcomponents/responsive-utility
Advanced tools
Comparing version 2.0.6 to 2.0.7
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "Automated conversion of responsive-utility/", | ||
@@ -63,3 +63,3 @@ "repository": { | ||
], | ||
"gitHead": "2eb358e606b807a0b9bac11f3476674fe8c6cd2c" | ||
"gitHead": "33e63ccd15a4f3edd788b4a843c2d15f7089cae6" | ||
} |
@@ -1,1 +0,1 @@ | ||
define(["exports","./node_modules/@polymer/polymer/polymer-legacy.js","./node_modules/@polymer/polymer/lib/utils/async.js","./node_modules/@polymer/iron-resizable-behavior/iron-resizable-behavior.js"],function(_exports,_polymerLegacy,async,_ironResizableBehavior){"use strict";Object.defineProperty(_exports,"__esModule",{value:!0});_exports.ResponsiveUtility=void 0;async=babelHelpers.interopRequireWildcard(async);function _templateObject_3b3c5490344811e99ff92f1b8d635b59(){var data=babelHelpers.taggedTemplateLiteral(["\n <style>\n :host {\n display: inline;\n }\n </style>\n <slot></slot>\n "]);_templateObject_3b3c5490344811e99ff92f1b8d635b59=function _templateObject_3b3c5490344811e99ff92f1b8d635b59(){return data};return data}window.ResponsiveUtility={};window.ResponsiveUtility.instance=null;var ResponsiveUtility=(0,_polymerLegacy.Polymer)({_template:(0,_polymerLegacy.html)(_templateObject_3b3c5490344811e99ff92f1b8d635b59()),is:"responsive-utility",behaviors:[_ironResizableBehavior.IronResizableBehavior],listeners:{"iron-resize":"_onIronResize"},properties:{details:{type:Array,value:[]}},created:function created(){var root=this;if(null==window.ResponsiveUtility.instance){window.ResponsiveUtility.instance=root}window.addEventListener("responsive-element",function(e){var detail={element:e.detail.element,attribute:e.detail.attribute!==void 0&&null!==e.detail.attribute?e.detail.attribute:"responsive-size",relativeToParent:e.detail.relativeToParent!==void 0&&null!==e.detail.relativeToParent?e.detail.relativeToParent:!0,sm:e.detail.sm!==void 0&&null!==e.detail.sm?e.detail.sm:900,md:e.detail.md!==void 0&&null!==e.detail.md?e.detail.md:1200,lg:e.detail.lg!==void 0&&null!==e.detail.lg?e.detail.lg:1500,xl:e.detail.xl!==void 0&&null!==e.detail.xl?e.detail.lg:1800};if("ResizeObserver"in window&&!0===detail.relativeToParent){var resize=new ResizeObserver(function(){window.ResponsiveUtility.setSize(detail)}),observable=e.detail.parentNode!==void 0&&null!==e.detail.parentNode?e.detail.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.detail.element.parentNode.host:e.detail.element.parentNode:e.detail.element;resize.observe(observable)}root.push("details",detail);window.ResponsiveUtility.setSize(detail)});window.addEventListener("delete-responsive-element",function(e){for(var i=0;i<this.details.length;i++){if(e.detail===detail[i])root.splice("details",i,1)}})},_onIronResize:function _onIronResize(){for(var i=0;i<this.details.length;i++){window.ResponsiveUtility.setSize(this.details[i])}}});_exports.ResponsiveUtility=ResponsiveUtility;window.ResponsiveUtility.requestAvailability=function(){if(null==window.ResponsiveUtility.instance){window.ResponsiveUtility.instance=document.createElement("responsive-utility")}document.body.appendChild(window.ResponsiveUtility.instance)};window.ResponsiveUtility.setSize=function(detail){var size,width=window.ResponsiveUtility._getWidth(detail);if(width<detail.sm){size="xs"}else if(width<detail.md){size="sm"}else if(width<detail.lg){size="md"}else if(width<detail.xl){size="lg"}else{size="xl"}if(detail.element.getAttribute(detail.attribute)===void 0||size!==detail.element.getAttribute(detail.attribute)){detail.element.setAttribute(detail.attribute,size)}};window.ResponsiveUtility._getWidth=function(detail){var el=detail.element;if(!0===detail.relativeToParent){if(el.offsetWidth!==void 0&&null!==el.offsetWidth&&0<el.offsetWidth){return el.offsetWidth}else if(null!==el.parentNode){return el.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?el.parentNode.host.offsetWidth:el.parentNode.offsetWidth}}return window.outerWidth}}); | ||
define(["exports","./node_modules/@polymer/polymer/polymer-legacy.js","./node_modules/@polymer/polymer/lib/utils/async.js","./node_modules/@polymer/iron-resizable-behavior/iron-resizable-behavior.js"],function(_exports,_polymerLegacy,async,_ironResizableBehavior){"use strict";Object.defineProperty(_exports,"__esModule",{value:!0});_exports.ResponsiveUtility=void 0;async=babelHelpers.interopRequireWildcard(async);function _templateObject_02129d4034da11e9bfc54d33adbd029c(){var data=babelHelpers.taggedTemplateLiteral(["\n <style>\n :host {\n display: inline;\n }\n </style>\n <slot></slot>\n "]);_templateObject_02129d4034da11e9bfc54d33adbd029c=function _templateObject_02129d4034da11e9bfc54d33adbd029c(){return data};return data}window.ResponsiveUtility={};window.ResponsiveUtility.instance=null;var ResponsiveUtility=(0,_polymerLegacy.Polymer)({_template:(0,_polymerLegacy.html)(_templateObject_02129d4034da11e9bfc54d33adbd029c()),is:"responsive-utility",behaviors:[_ironResizableBehavior.IronResizableBehavior],listeners:{"iron-resize":"_onIronResize"},properties:{details:{type:Array,value:[]}},created:function created(){var root=this;if(null==window.ResponsiveUtility.instance){window.ResponsiveUtility.instance=root}window.addEventListener("responsive-element",function(e){var detail={element:e.detail.element,attribute:e.detail.attribute!==void 0&&null!==e.detail.attribute?e.detail.attribute:"responsive-size",relativeToParent:e.detail.relativeToParent!==void 0&&null!==e.detail.relativeToParent?e.detail.relativeToParent:!0,sm:e.detail.sm!==void 0&&null!==e.detail.sm?e.detail.sm:900,md:e.detail.md!==void 0&&null!==e.detail.md?e.detail.md:1200,lg:e.detail.lg!==void 0&&null!==e.detail.lg?e.detail.lg:1500,xl:e.detail.xl!==void 0&&null!==e.detail.xl?e.detail.lg:1800};if("ResizeObserver"in window&&!0===detail.relativeToParent){var resize=new ResizeObserver(function(){window.ResponsiveUtility.setSize(detail)}),observable=e.detail.parentNode!==void 0&&null!==e.detail.parentNode?e.detail.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.detail.element.parentNode.host:e.detail.element.parentNode:e.detail.element;resize.observe(observable)}root.push("details",detail);window.ResponsiveUtility.setSize(detail)});window.addEventListener("delete-responsive-element",function(e){for(var i=0;i<this.details.length;i++){if(e.detail===detail[i])root.splice("details",i,1)}})},_onIronResize:function _onIronResize(){for(var i=0;i<this.details.length;i++){window.ResponsiveUtility.setSize(this.details[i])}}});_exports.ResponsiveUtility=ResponsiveUtility;window.ResponsiveUtility.requestAvailability=function(){if(null==window.ResponsiveUtility.instance){window.ResponsiveUtility.instance=document.createElement("responsive-utility")}document.body.appendChild(window.ResponsiveUtility.instance)};window.ResponsiveUtility.setSize=function(detail){var size,width=window.ResponsiveUtility._getWidth(detail);if(width<detail.sm){size="xs"}else if(width<detail.md){size="sm"}else if(width<detail.lg){size="md"}else if(width<detail.xl){size="lg"}else{size="xl"}if(detail.element.getAttribute(detail.attribute)===void 0||size!==detail.element.getAttribute(detail.attribute)){detail.element.setAttribute(detail.attribute,size)}};window.ResponsiveUtility._getWidth=function(detail){var el=detail.element;if(!0===detail.relativeToParent){if(el.offsetWidth!==void 0&&null!==el.offsetWidth&&0<el.offsetWidth){return el.offsetWidth}else if(null!==el.parentNode){return el.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?el.parentNode.host.offsetWidth:el.parentNode.offsetWidth}}return window.outerWidth}}); |
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