Comparing version 0.2.0 to 0.3.0
@@ -1,1 +0,1 @@ | ||
!function(e){function t(s){if(n[s])return n[s].exports;var i=n[s]={exports:{},id:s,loaded:!1};return e[s].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var s=n(1);s.keys().forEach(s)},function(e,t,n){function s(e){return n(i(e))}function i(e){return o[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var o={"./components/forms":2,"./components/forms.js":2};s.keys=function(){return Object.keys(o)},s.resolve=i,e.exports=s,s.id=1},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,n,s){return n&&e(t.prototype,n),s&&e(t,s),t}}();Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){var t="form",i={events:"change",selectors:".input, select, .select, .textarea"},o=function(){function t(s,o){n(this,t),o=e.extend({},i,o||{}),this._element=e(s),this._options=o,this.listeners(),this.toggleFieldsActiveClass()}return s(t,[{key:"listeners",value:function(){e(document).on(this._options.events,this._options.selectors,this.onFieldChange.bind(this))}},{key:"onFieldChange",value:function(e){this.toggleActiveClass(e.target)}},{key:"shouldInputBeActive",value:function(e){return!(!e.value&&!e.placeholder)}},{key:"toggleActiveClass",value:function(t){var n=e(t),s=n.parents(".field");if(s.length)return!s.hasClass("active")&&this.shouldInputBeActive(t)?s.addClass("active"):s.hasClass("active")&&!this.shouldInputBeActive(t)?s.removeClass("active"):void 0}},{key:"toggleFieldsActiveClass",value:function(){Array.prototype.forEach.call(this._element.find(this._options.selectors),this.toggleActiveClass.bind(this))}}]),t}();return e.fn[t]=function(n){return n=n||{},this.each(function(){e.data(this,t)||e.data(this,t,new o(this,n))})},o}(jQuery)}]); | ||
!function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var i=n(1);i.keys().forEach(i)},function(e,t,n){function i(e){return n(r(e))}function r(e){return s[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var s={"./components/form":2,"./components/form.js":2,"./components/lazy-load":3,"./components/lazy-load.js":3,"./components/validation":6,"./components/validation.js":6,"./components/validation/confirm":11,"./components/validation/confirm.js":11,"./components/validation/defaults":9,"./components/validation/defaults.js":9,"./components/validation/email":14,"./components/validation/email.js":14,"./components/validation/maxlength":13,"./components/validation/maxlength.js":13,"./components/validation/minlength":12,"./components/validation/minlength.js":12,"./components/validation/required":10,"./components/validation/required.js":10};i.keys=function(){return Object.keys(s)},i.resolve=r,e.exports=i,i.id=1},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){var t="form",r={events:"change",selectors:".input, select, .select, .textarea"},s=function(){function t(i,s){n(this,t),s=e.extend({},r,s||{}),this._element=e(i),this._options=s,this.bindListeners(),this.toggleFieldsActiveClass()}return i(t,[{key:"bindListeners",value:function(){e(document).on(this._options.events,this._options.selectors,this.onFieldChange.bind(this))}},{key:"onFieldChange",value:function(e){this.toggleActiveClass(e.target)}},{key:"shouldInputBeActive",value:function(e){return!(!e.value&&!e.placeholder)}},{key:"toggleActiveClass",value:function(t){var n=e(t),i=n.parents(".field");if(i.length)return!i.hasClass("active")&&this.shouldInputBeActive(t)?i.addClass("active"):i.hasClass("active")&&!this.shouldInputBeActive(t)?i.removeClass("active"):void 0}},{key:"toggleFieldsActiveClass",value:function(){Array.prototype.forEach.call(this._element.find(this._options.selectors),this.toggleActiveClass.bind(this))}}]),t}();return e.fn[t]=function(n){return n=n||{},this.each(function(){e.data(this,t)||e.data(this,t,new s(this,n))})},s}(jQuery)},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),a=i(o),l=n(5),u=i(l);t["default"]=function(e){var t="lazyload",n={throttle:1e3,offset:200,selector:"data-lazy"},i=function(){function t(i,s){r(this,t),s=e.extend({},n,s||{}),this._element=i,this._options=s}return s(t,[{key:"init",value:function(){return this.bindListeners(),this.checkVisiblePlaceholders(),this}},{key:"bindListeners",value:function(){this.onScrollHandler=(0,a["default"])(this.onScroll.bind(this),this._options.throttle),e(window).on("scroll",this.onScrollHandler)}},{key:"onScroll",value:function(){return this._element.length?this.checkVisiblePlaceholders():e(window).off("scroll",this.onScrollHandler)}},{key:"checkVisiblePlaceholders",value:function(){this.windowHeight=e(window).height(),this.windowWidth=e(window).width(),Array.prototype.forEach.call(this._element,this.checkPlaceholder.bind(this))}},{key:"checkPlaceholder",value:function(e){this.isPlaceholderVisible(e)&&(this.renderImage(e),(0,u["default"])(this._element,e))}},{key:"isPlaceholderVisible",value:function(e){return e.getBoundingClientRect().top<=this.windowHeight+this._options.offset}},{key:"renderImage",value:function(e){e.parentNode.replaceChild(this.createImage(e),e)}},{key:"createImage",value:function(e){var t=document.createElement("img");return this.parseAttributes(t,e.attributes),t.removeAttribute("data-lazy"),e.getAttribute("data-srcset")?(this.parseBreakpoints(t,e.getAttribute("data-srcset")),t):(t.src=e.getAttribute("data-src"),t)}},{key:"parseAttributes",value:function(e,t){var n=this;return Array.prototype.forEach.call(t,function(t){(t.name!==n._options.selector||"data-srcset"!==t.name||"data-src"!==t.name)&&e.setAttribute(t.name,t.value)}),e}},{key:"parseBreakpoints",value:function(e,t){e.removeAttribute("data-srcset"),t=t.split(",").map(function(e){return e=e.trim().split(" "),{src:e[0],width:e[1]}}).sort(function(e,t){return t.width-e.width});for(var n=0;n<t.length;n++){var i=t[n];if(i.width<=this.windowWidth){e.src=i.src;break}}return e}},{key:"destroy",value:function(){e(window).off("scroll",this.onScrollHandler)}}]),t}();return e.fn[t]=function(n){return n=n||{},this.each(function(){e.data(this,t)||e.data(this,t,new i(this,n).init())})},i}(jQuery)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){var n=!0;return function(){if(n){for(var i=arguments.length,r=Array(i),s=0;i>s;s++)r[s]=arguments[s];e.apply(this,r),n=!1,setTimeout(function(){return n=!0},t)}}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){Array.prototype.splice.call(e,Array.prototype.indexOf.call(e,t))}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(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)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),a=i(o),l=n(9),u=i(l);t["default"]=function(e){var t="validation",n={events:"blur",selector:"[data-required]"},i=function(){function t(i,s){r(this,t),this._element=i,this._options=e.extend({},n,s||{})}return s(t,[{key:"init",value:function(){this._fields=this._element.find(this._options.selector),this.bindListeners()}},{key:"bindListeners",value:function(){var e=this;this.handler=function(t){e.validate(t.target)},this._element.off(this._options.events,this._options.selector,this.handler),this._element.on(this._options.events,this._options.selector,this.handler)}},{key:"validate",value:function(e){var t=this,n=e.getAttribute("data-validate");return n?(n=n.split(" ").reduce(function(n,i){return t.rules[i].call(t,e,t._element)||n.push(i),n},[]),a["default"].emit("validation:"+(n.length?"error":"success"),e,n),!n.length):void 0}},{key:"validateAll",value:function(){return Array.prototype.map.call(this._element.find(this._options.selector),this.validate,this).every(function(e){return e})}}]),t}();return i.prototype.rules=u["default"],e.fn[t]=function(n){return n=n||{},this.each(function(){e.data(this,t)||e.data(this,t,new i(this,n).init())})},i}(jQuery)},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),s=i(r);t["default"]=new s["default"]},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function r(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!r(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,r,a,l,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],o(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(s(n))for(a=Array.prototype.slice.call(arguments,1),u=n.slice(),r=u.length,l=0;r>l;l++)u[l].apply(this,a);return!0},n.prototype.addListener=function(e,t){var r;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned&&(r=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,r,o,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(a=o;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(0>r)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),s=i(r),o=n(11),a=i(o),l=n(12),u=i(l),c=n(13),h=i(c),f=n(14),d=i(f);t["default"]={required:s["default"],confirm:a["default"],minlength:u["default"],maxlength:h["default"],email:d["default"]}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){return"checkbox"===e.type?e.checked:"radio"===e.type?t.find('[name="'+e.name+'"]:checked').length:!!e.value.trim()}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){return e.value===t.find('[name="'+e.getAttribute("data-confirm")+"]").val()}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return e.value.length>=e.getAttribute("data-minlength")}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return e.value.length<=e.getAttribute("maxlength")}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e.value)}}]); |
{ | ||
"name": "garden", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "A styleguide based on Leroy Merlin needs", | ||
@@ -63,3 +63,2 @@ "main": "dist/js/garden.min.js", | ||
"karma-webpack": "^1.7.0", | ||
"lost": "^6.6.2", | ||
"marked": "^0.3.5", | ||
@@ -75,2 +74,3 @@ "metalsmith": "^2.1.0", | ||
"phantomjs": "^1.9.19", | ||
"postcss-calc": "^5.2.0", | ||
"postcss-color-function": "^2.0.0", | ||
@@ -82,2 +82,3 @@ "postcss-conditionals": "^2.0.0", | ||
"postcss-font-magician": "^1.4.0", | ||
"postcss-for": "^2.0.1", | ||
"postcss-import": "^7.1.3", | ||
@@ -84,0 +85,0 @@ "postcss-mixins": "^3.0.2", |
@@ -28,3 +28,13 @@ { | ||
"panel-height": "165px", | ||
"panel-large-height": "335px" | ||
"panel-large-height": "335px", | ||
"breakpoint-xs": "480px", | ||
"breakpoint-sm": "768px", | ||
"breakpoint-md": "960px", | ||
"breakpoint-lg": "1120px", | ||
"breakpoint-xl": "1280px", | ||
"columns": "12", | ||
"gutter-width": "20px", | ||
"grid-limit": "980px" | ||
} |
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
Sorry, the diff of this file is not supported yet
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
112686
77
1104
0
68