Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lrnwebcomponents/responsive-utility

Package Overview
Dependencies
Maintainers
4
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lrnwebcomponents/responsive-utility - npm Package Compare versions

Comparing version 0.0.34 to 0.0.35

23

build/es5-amd/responsive-utility.js

@@ -8,7 +8,7 @@ define([

async = babelHelpers.interopRequireWildcard(async);
function _templateObject_1b4b98a0ecf211e882ef4d386d12ffe1() {
function _templateObject_c83ae2e0f1e411e89dd4711b8b5dec47() {
var data = babelHelpers.taggedTemplateLiteral([
"\n <style>\n :host {\n display: inline;\n }\n </style>\n <slot></slot>\n"
]);
_templateObject_1b4b98a0ecf211e882ef4d386d12ffe1 = function() {
_templateObject_c83ae2e0f1e411e89dd4711b8b5dec47 = function _templateObject_c83ae2e0f1e411e89dd4711b8b5dec47() {
return data;

@@ -22,3 +22,3 @@ };

_template: (0, _polymerLegacy.html)(
_templateObject_1b4b98a0ecf211e882ef4d386d12ffe1()
_templateObject_c83ae2e0f1e411e89dd4711b8b5dec47()
),

@@ -92,9 +92,3 @@ is: "responsive-utility",

: !0,
testBreakpoint = function(width, breakpoint, def) {
var val =
breakpoint !== void 0 && null !== breakpoint ? breakpoint : def;
return width < val;
},
size,
width = (function getWidth() {
getWidth = function getWidth() {
if (null !== target.element.parentNode && !0 === relative) {

@@ -109,3 +103,10 @@ if (

return window.outerWidth;
})();
},
testBreakpoint = function testBreakpoint(width, breakpoint, def) {
var val =
breakpoint !== void 0 && null !== breakpoint ? breakpoint : def;
return width < val;
},
size,
width = getWidth();
if (testBreakpoint(width, target.sm, 600)) {

@@ -112,0 +113,0 @@ size = "xs";

@@ -85,8 +85,3 @@ import {

: !0,
testBreakpoint = function(width, breakpoint, def) {
let val = breakpoint !== void 0 && null !== breakpoint ? breakpoint : def;
return width < val;
},
size,
width = (function() {
getWidth = function() {
if (null !== target.element.parentNode && !0 === relative) {

@@ -101,3 +96,9 @@ if (

return window.outerWidth;
})();
},
testBreakpoint = function(width, breakpoint, def) {
let val = breakpoint !== void 0 && null !== breakpoint ? breakpoint : def;
return width < val;
},
size,
width = getWidth();
if (testBreakpoint(width, target.sm, 600)) {

@@ -104,0 +105,0 @@ size = "xs";

@@ -14,3 +14,3 @@ {

},
"version": "0.0.34",
"version": "0.0.35",
"description": "Automated conversion of responsive-utility/",

@@ -43,3 +43,3 @@ "repository": {

"devDependencies": {
"@lrnwebcomponents/deduping-fix": "^0.0.34",
"@lrnwebcomponents/deduping-fix": "^0.0.35",
"@polymer/iron-component-page": "github:PolymerElements/iron-component-page",

@@ -64,3 +64,3 @@ "@polymer/iron-demo-helpers": "3.0.2",

],
"gitHead": "85bf1e684f0f88c1ce807c92255af222057eeaa0"
"gitHead": "71dcc2b61045070a009e654226e6c0892f11a854"
}

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

define(["./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(_polymerLegacy,async,_ironResizableBehavior){"use strict";async=babelHelpers.interopRequireWildcard(async);function _templateObject_1b4b98a0ecf211e882ef4d386d12ffe1(){var data=babelHelpers.taggedTemplateLiteral(["\n <style>\n :host {\n display: inline;\n }\n </style>\n <slot></slot>\n"]);_templateObject_1b4b98a0ecf211e882ef4d386d12ffe1=function(){return data};return data}window.ResponsiveUtility={};window.ResponsiveUtility.instance=null;(0,_polymerLegacy.Polymer)({_template:(0,_polymerLegacy.html)(_templateObject_1b4b98a0ecf211e882ef4d386d12ffe1()),is:"responsive-utility",behaviors:[_ironResizableBehavior.IronResizableBehavior],listeners:{"iron-resize":"_onIronResize"},properties:{targets:{type:Array,value:[]}},created:function created(){var root=this;if(null==window.ResponsiveUtility.instance){window.ResponsiveUtility.instance=root}document.body.addEventListener("responsive-element",function(e){var relative=e.detail.relativeToParent!==void 0&&null!==e.detail.relativeToParent?e.detail.relativeToParent:!0;if("ResizeObserver"in window&&!0===relative.relativeToParent){var parent=e.detail.element.parentNode,resize=new ResizeObserver(function(){window.ResponsiveUtility.setSize(e.detail)});if(parent.nodeType===Node.DOCUMENT_FRAGMENT_NODE){parent=parent.host}resize.observe(parent)}root.push("targets",e.detail);window.ResponsiveUtility.setSize(e.detail)});document.body.addEventListener("delete-responsive-element",function(e){for(var i=0;i<this.targets.length;i++){if(e.detail===target[i])root.splice("targets",i,1)}})},_onIronResize:function _onIronResize(){for(var i=0;i<this.targets.length;i++){window.ResponsiveUtility.setSize(this.targets[i])}}});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(target){var element=target.element,attribute=target.attribute!==void 0&&null!==target.attribute?target.attribute:"responsive-size",size=window.ResponsiveUtility.getSize(target);if(element.getAttribute(attribute)===void 0||size!==element.getAttribute(attribute)){element.setAttribute(attribute,size)}};window.ResponsiveUtility.getSize=function(target){var relative=target.relativeToParent!==void 0&&null!==target.relativeToParent?target.relativeToParent:!0,testBreakpoint=function(width,breakpoint,def){var val=breakpoint!==void 0&&null!==breakpoint?breakpoint:def;return width<val},size,width=function getWidth(){if(null!==target.element.parentNode&&!0===relative){if(target.element.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){return target.element.parentNode.host.offsetWidth}return target.element.parentNode.offsetWidth}return window.outerWidth}();if(testBreakpoint(width,target.sm,600)){size="xs"}else if(testBreakpoint(width,target.md,900)){size="sm"}else if(testBreakpoint(width,target.lg,1200)){size="md"}else if(testBreakpoint(width,target.xl,1200)){size="lg"}else{size="xl"}return size}});
define(["./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(_polymerLegacy,async,_ironResizableBehavior){"use strict";async=babelHelpers.interopRequireWildcard(async);function _templateObject_c83ae2e0f1e411e89dd4711b8b5dec47(){var data=babelHelpers.taggedTemplateLiteral(["\n <style>\n :host {\n display: inline;\n }\n </style>\n <slot></slot>\n"]);_templateObject_c83ae2e0f1e411e89dd4711b8b5dec47=function _templateObject_c83ae2e0f1e411e89dd4711b8b5dec47(){return data};return data}window.ResponsiveUtility={};window.ResponsiveUtility.instance=null;(0,_polymerLegacy.Polymer)({_template:(0,_polymerLegacy.html)(_templateObject_c83ae2e0f1e411e89dd4711b8b5dec47()),is:"responsive-utility",behaviors:[_ironResizableBehavior.IronResizableBehavior],listeners:{"iron-resize":"_onIronResize"},properties:{targets:{type:Array,value:[]}},created:function created(){var root=this;if(null==window.ResponsiveUtility.instance){window.ResponsiveUtility.instance=root}document.body.addEventListener("responsive-element",function(e){var relative=e.detail.relativeToParent!==void 0&&null!==e.detail.relativeToParent?e.detail.relativeToParent:!0;if("ResizeObserver"in window&&!0===relative.relativeToParent){var parent=e.detail.element.parentNode,resize=new ResizeObserver(function(){window.ResponsiveUtility.setSize(e.detail)});if(parent.nodeType===Node.DOCUMENT_FRAGMENT_NODE){parent=parent.host}resize.observe(parent)}root.push("targets",e.detail);window.ResponsiveUtility.setSize(e.detail)});document.body.addEventListener("delete-responsive-element",function(e){for(var i=0;i<this.targets.length;i++){if(e.detail===target[i])root.splice("targets",i,1)}})},_onIronResize:function _onIronResize(){for(var i=0;i<this.targets.length;i++){window.ResponsiveUtility.setSize(this.targets[i])}}});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(target){var element=target.element,attribute=target.attribute!==void 0&&null!==target.attribute?target.attribute:"responsive-size",size=window.ResponsiveUtility.getSize(target);if(element.getAttribute(attribute)===void 0||size!==element.getAttribute(attribute)){element.setAttribute(attribute,size)}};window.ResponsiveUtility.getSize=function(target){var relative=target.relativeToParent!==void 0&&null!==target.relativeToParent?target.relativeToParent:!0,getWidth=function getWidth(){if(null!==target.element.parentNode&&!0===relative){if(target.element.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){return target.element.parentNode.host.offsetWidth}return target.element.parentNode.offsetWidth}return window.outerWidth},testBreakpoint=function testBreakpoint(width,breakpoint,def){var val=breakpoint!==void 0&&null!==breakpoint?breakpoint:def;return width<val},size,width=getWidth();if(testBreakpoint(width,target.sm,600)){size="xs"}else if(testBreakpoint(width,target.md,900)){size="sm"}else if(testBreakpoint(width,target.lg,1200)){size="md"}else if(testBreakpoint(width,target.xl,1200)){size="lg"}else{size="xl"}return size}});

@@ -8,2 +8,2 @@ import{html,Polymer}from"./node_modules/@polymer/polymer/polymer-legacy.js";import*as async from"./node_modules/@polymer/polymer/lib/utils/async.js";import{IronResizableBehavior}from"./node_modules/@polymer/iron-resizable-behavior/iron-resizable-behavior.js";window.ResponsiveUtility={};window.ResponsiveUtility.instance=null;Polymer({_template:html`

<slot></slot>
`,is:"responsive-utility",behaviors:[IronResizableBehavior],listeners:{"iron-resize":"_onIronResize"},properties:{targets:{type:Array,value:[]}},created:function(){let root=this;if(null==window.ResponsiveUtility.instance){window.ResponsiveUtility.instance=root}document.body.addEventListener("responsive-element",function(e){let relative=e.detail.relativeToParent!==void 0&&null!==e.detail.relativeToParent?e.detail.relativeToParent:!0;if("ResizeObserver"in window&&!0===relative.relativeToParent){let parent=e.detail.element.parentNode,resize=new ResizeObserver(function(){window.ResponsiveUtility.setSize(e.detail)});if(parent.nodeType===Node.DOCUMENT_FRAGMENT_NODE){parent=parent.host}resize.observe(parent)}root.push("targets",e.detail);window.ResponsiveUtility.setSize(e.detail)});document.body.addEventListener("delete-responsive-element",function(e){for(let i=0;i<this.targets.length;i++){if(e.detail===target[i])root.splice("targets",i,1)}})},_onIronResize:function(){for(let i=0;i<this.targets.length;i++){window.ResponsiveUtility.setSize(this.targets[i])}}});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(target){let element=target.element,attribute=target.attribute!==void 0&&null!==target.attribute?target.attribute:"responsive-size",size=window.ResponsiveUtility.getSize(target);if(element.getAttribute(attribute)===void 0||size!==element.getAttribute(attribute)){element.setAttribute(attribute,size)}};window.ResponsiveUtility.getSize=function(target){let relative=target.relativeToParent!==void 0&&null!==target.relativeToParent?target.relativeToParent:!0,testBreakpoint=function(width,breakpoint,def){let val=breakpoint!==void 0&&null!==breakpoint?breakpoint:def;return width<val},size,width=function(){if(null!==target.element.parentNode&&!0===relative){if(target.element.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){return target.element.parentNode.host.offsetWidth}return target.element.parentNode.offsetWidth}return window.outerWidth}();if(testBreakpoint(width,target.sm,600)){size="xs"}else if(testBreakpoint(width,target.md,900)){size="sm"}else if(testBreakpoint(width,target.lg,1200)){size="md"}else if(testBreakpoint(width,target.xl,1200)){size="lg"}else{size="xl"}return size};
`,is:"responsive-utility",behaviors:[IronResizableBehavior],listeners:{"iron-resize":"_onIronResize"},properties:{targets:{type:Array,value:[]}},created:function(){let root=this;if(null==window.ResponsiveUtility.instance){window.ResponsiveUtility.instance=root}document.body.addEventListener("responsive-element",function(e){let relative=e.detail.relativeToParent!==void 0&&null!==e.detail.relativeToParent?e.detail.relativeToParent:!0;if("ResizeObserver"in window&&!0===relative.relativeToParent){let parent=e.detail.element.parentNode,resize=new ResizeObserver(function(){window.ResponsiveUtility.setSize(e.detail)});if(parent.nodeType===Node.DOCUMENT_FRAGMENT_NODE){parent=parent.host}resize.observe(parent)}root.push("targets",e.detail);window.ResponsiveUtility.setSize(e.detail)});document.body.addEventListener("delete-responsive-element",function(e){for(let i=0;i<this.targets.length;i++){if(e.detail===target[i])root.splice("targets",i,1)}})},_onIronResize:function(){for(let i=0;i<this.targets.length;i++){window.ResponsiveUtility.setSize(this.targets[i])}}});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(target){let element=target.element,attribute=target.attribute!==void 0&&null!==target.attribute?target.attribute:"responsive-size",size=window.ResponsiveUtility.getSize(target);if(element.getAttribute(attribute)===void 0||size!==element.getAttribute(attribute)){element.setAttribute(attribute,size)}};window.ResponsiveUtility.getSize=function(target){let relative=target.relativeToParent!==void 0&&null!==target.relativeToParent?target.relativeToParent:!0,getWidth=function(){if(null!==target.element.parentNode&&!0===relative){if(target.element.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){return target.element.parentNode.host.offsetWidth}return target.element.parentNode.offsetWidth}return window.outerWidth},testBreakpoint=function(width,breakpoint,def){let val=breakpoint!==void 0&&null!==breakpoint?breakpoint:def;return width<val},size,width=getWidth();if(testBreakpoint(width,target.sm,600)){size="xs"}else if(testBreakpoint(width,target.md,900)){size="sm"}else if(testBreakpoint(width,target.lg,1200)){size="md"}else if(testBreakpoint(width,target.xl,1200)){size="lg"}else{size="xl"}return size};

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