@lrnwebcomponents/responsive-utility
Advanced tools
Comparing version 4.0.8 to 4.0.11
@@ -15,3 +15,3 @@ { | ||
}, | ||
"version": "4.0.8", | ||
"version": "4.0.11", | ||
"description": "Automated conversion of responsive-utility/", | ||
@@ -42,13 +42,13 @@ "repository": { | ||
"@juggle/resize-observer": "^3.0.0", | ||
"lit": "^2.1.4" | ||
"lit": "^2.2.0" | ||
}, | ||
"devDependencies": { | ||
"@lrnwebcomponents/deduping-fix": "^4.0.0", | ||
"@lrnwebcomponents/storybook-utilities": "^4.0.8", | ||
"@open-wc/testing": "3.0.3", | ||
"@lrnwebcomponents/storybook-utilities": "^4.0.11", | ||
"@open-wc/testing": "3.0.4", | ||
"@polymer/iron-component-page": "github:PolymerElements/iron-component-page", | ||
"@polymer/iron-demo-helpers": "3.1.0", | ||
"@web/dev-server": "0.1.28", | ||
"@web/dev-server": "0.1.30", | ||
"@webcomponents/webcomponentsjs": "2.6.0", | ||
"concurrently": "5.3.0", | ||
"concurrently": "7.0.0", | ||
"gulp-babel": "8.0.0", | ||
@@ -66,3 +66,3 @@ "lodash": "^4.17.21", | ||
], | ||
"gitHead": "546e19dc98d156fe786ad6410a8229e3a4167deb" | ||
"gitHead": "c1e94ecfc66f79da031bf277e9afa654e23143b7" | ||
} |
@@ -124,5 +124,4 @@ import { LitElement, html, css } from "lit"; | ||
if (window.ResponsiveUtility.instance == null) { | ||
window.ResponsiveUtility.instance = document.createElement( | ||
"responsive-utility" | ||
); | ||
window.ResponsiveUtility.instance = | ||
document.createElement("responsive-utility"); | ||
} | ||
@@ -129,0 +128,0 @@ document.body.appendChild(window.ResponsiveUtility.instance); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lit"),require("@juggle/resize-observer")):"function"==typeof define&&define.amd?define(["exports","lit","@juggle/resize-observer"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ResponsiveUtility={},e.lit,e.resizeObserver)}(this,(function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=r(e);if(t){var o=r(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return l(this,n)}}function c(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}function a(){return a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=c(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},a.apply(this,arguments)}var f;window.ResponsiveUtility={},window.ResponsiveUtility.instance=null;var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(v,e);var l,c,d,p=u(v);function v(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v),(e=p.call(this)).details=[],null==window.ResponsiveUtility.instance&&(window.ResponsiveUtility.instance=s(e)),e}return l=v,d=[{key:"tag",get:function(){return"responsive-utility"}}],(c=[{key:"render",value:function(){return t.html(f||(e=[" <slot></slot> "],n||(n=e.slice(0)),f=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))));var e,n}},{key:"connectedCallback",value:function(){a(r(v.prototype),"connectedCallback",this).call(this),window.addEventListener("responsive-element",this.responiveElementEvent.bind(this)),window.addEventListener("delete-responsive-element",this.deleteResponiveElementEvent.bind(this))}},{key:"disconnectedCallback",value:function(){window.removeEventListener("responsive-element",this.responiveElementEvent.bind(this)),window.removeEventListener("delete-responsive-element",this.deleteResponiveElementEvent.bind(this)),a(r(v.prototype),"disconnectedCallback",this).call(this)}},{key:"responiveElementEvent",value:function(e){var t={element:e.detail.element,attribute:e.detail.attribute||"responsive-size",sm:e.detail.sm||900,md:e.detail.md||1200,lg:e.detail.lg||1500,xl:e.detail.xl||1800,custom:e.detail.custom||"responsive-width"};t.observer=this._getObserver(t),t.observer.observe(t.element),this.details.push(t),window.ResponsiveUtility.setSize(t)}},{key:"_getObserver",value:function(e){return new n.ResizeObserver((function(t){return t.forEach((function(t){return window.ResponsiveUtility.setSize(e,t.contentBoxSize||t.borderBoxSize||t.contentRect||t.target?t.target.offsetWidth:0)}))}))}},{key:"deleteResponiveElementEvent",value:function(e){this.details=this.details.filter((function(t){return e.detail!==t}))}}])&&i(l.prototype,c),d&&i(l,d),v}(t.LitElement);window.customElements.define(d.tag,d),window.ResponsiveUtility.requestAvailability=function(){null==window.ResponsiveUtility.instance&&(window.ResponsiveUtility.instance=document.createElement("responsive-utility")),document.body.appendChild(window.ResponsiveUtility.instance)},window.ResponsiveUtility.setSize=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=e.element,r=e.attribute,o=e.custom;t=n<e.sm?"xs":n<e.md?"sm":n<e.lg?"md":n<e.xl?"lg":"xl",i.getAttribute(o)&&n===i.getAttribute(o)||i.setAttribute(o,n),i.getAttribute(r)&&t===i.getAttribute(r)||i.setAttribute(r,t)},e.ResponsiveUtility=d,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lit"),require("@juggle/resize-observer")):"function"==typeof define&&define.amd?define(["exports","lit","@juggle/resize-observer"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ResponsiveUtility={},e.lit,e.resizeObserver)}(this,(function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=r(e);if(t){var o=r(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return l(this,n)}}function c(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}function a(){return a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=c(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},a.apply(this,arguments)}var f;window.ResponsiveUtility={},window.ResponsiveUtility.instance=null;var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(v,e);var l,c,d,p=u(v);function v(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v),(e=p.call(this)).details=[],null==window.ResponsiveUtility.instance&&(window.ResponsiveUtility.instance=s(e)),e}return l=v,d=[{key:"tag",get:function(){return"responsive-utility"}}],(c=[{key:"render",value:function(){return t.html(f||(e=[" <slot></slot> "],n||(n=e.slice(0)),f=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))));var e,n}},{key:"connectedCallback",value:function(){a(r(v.prototype),"connectedCallback",this).call(this),window.addEventListener("responsive-element",this.responiveElementEvent.bind(this)),window.addEventListener("delete-responsive-element",this.deleteResponiveElementEvent.bind(this))}},{key:"disconnectedCallback",value:function(){window.removeEventListener("responsive-element",this.responiveElementEvent.bind(this)),window.removeEventListener("delete-responsive-element",this.deleteResponiveElementEvent.bind(this)),a(r(v.prototype),"disconnectedCallback",this).call(this)}},{key:"responiveElementEvent",value:function(e){var t={element:e.detail.element,attribute:e.detail.attribute||"responsive-size",sm:e.detail.sm||900,md:e.detail.md||1200,lg:e.detail.lg||1500,xl:e.detail.xl||1800,custom:e.detail.custom||"responsive-width"};t.observer=this._getObserver(t),t.observer.observe(t.element),this.details.push(t),window.ResponsiveUtility.setSize(t)}},{key:"_getObserver",value:function(e){return new n.ResizeObserver((function(t){return t.forEach((function(t){return window.ResponsiveUtility.setSize(e,t.contentBoxSize||t.borderBoxSize||t.contentRect||t.target?t.target.offsetWidth:0)}))}))}},{key:"deleteResponiveElementEvent",value:function(e){this.details=this.details.filter((function(t){return e.detail!==t}))}}])&&i(l.prototype,c),d&&i(l,d),Object.defineProperty(l,"prototype",{writable:!1}),v}(t.LitElement);window.customElements.define(d.tag,d),window.ResponsiveUtility.requestAvailability=function(){null==window.ResponsiveUtility.instance&&(window.ResponsiveUtility.instance=document.createElement("responsive-utility")),document.body.appendChild(window.ResponsiveUtility.instance)},window.ResponsiveUtility.setSize=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=e.element,r=e.attribute,o=e.custom;t=n<e.sm?"xs":n<e.md?"sm":n<e.lg?"md":n<e.xl?"lg":"xl",i.getAttribute(o)&&n===i.getAttribute(o)||i.setAttribute(o,n),i.getAttribute(r)&&t===i.getAttribute(r)||i.setAttribute(r,t)},e.ResponsiveUtility=d,Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -124,5 +124,4 @@ import { LitElement, html, css } from "lit"; | ||
if (window.ResponsiveUtility.instance == null) { | ||
window.ResponsiveUtility.instance = document.createElement( | ||
"responsive-utility" | ||
); | ||
window.ResponsiveUtility.instance = | ||
document.createElement("responsive-utility"); | ||
} | ||
@@ -129,0 +128,0 @@ document.body.appendChild(window.ResponsiveUtility.instance); |
@@ -60,2 +60,2 @@ { | ||
"valueSets": [] | ||
} | ||
} |
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
73551
1243
Updatedlit@^2.2.0