@wework/ray-core
Advanced tools
Comparing version 1.3.9 to 1.3.10
@@ -6,2 +6,10 @@ # Change Log | ||
## [1.3.10](https://github.com/wework/ray/compare/@wework/ray-core@1.3.9...@wework/ray-core@1.3.10) (2019-05-17) | ||
**Note:** Version bump only for package @wework/ray-core | ||
## [1.3.9](https://github.com/wework/ray/compare/@wework/ray-core@1.3.8...@wework/ray-core@1.3.9) (2019-05-17) | ||
@@ -8,0 +16,0 @@ |
@@ -5,6 +5,3 @@ import * as components from '../../components'; | ||
var Component = components[componentKey]; | ||
if (Component.createAll) { | ||
Component.createAll(); | ||
} | ||
Component.createAll(); | ||
}); | ||
@@ -11,0 +8,0 @@ } |
{ | ||
"name": "@wework/ray-core", | ||
"version": "1.3.9", | ||
"version": "1.3.10", | ||
"main": "umd/index.js", | ||
@@ -80,3 +80,3 @@ "module": "es/index.js", | ||
], | ||
"gitHead": "580babeea6912b4988eb38ddc4ff6058e5de7f31", | ||
"gitHead": "cfef4f7e3f85108d0887b688f53772906581b902", | ||
"repository": { | ||
@@ -83,0 +83,0 @@ "type": "git", |
@@ -557,6 +557,3 @@ this.Ray = this.Ray || {}; | ||
var Component = components[componentKey]; | ||
if (Component.createAll) { | ||
Component.createAll(); | ||
} | ||
Component.createAll(); | ||
}); | ||
@@ -563,0 +560,0 @@ } |
@@ -1,2 +0,2 @@ | ||
this.Ray=this.Ray||{},this.Ray.Core=function(e){"use strict";var E=require("./_ctx"),t=require("./_export"),_=require("./_to-object"),f=require("./_iter-call"),d=require("./_is-array-iter"),v=require("./_to-length"),y=require("./_create-property"),p=require("./core.get-iterator-method");t(t.S+t.F*!require("./_iter-detect")(function(e){}),"Array",{from:function(e){var t,s,n,r,i=_(e),o="function"==typeof this?this:Array,c=arguments.length,u=1<c?arguments[1]:void 0,a=void 0!==u,l=0,h=p(i);if(a&&(u=E(u,2<c?arguments[2]:void 0,2)),null==h||o==Array&&d(h))for(s=new o(t=v(i.length));l<t;l++)y(s,l,a?u(i[l],l):i[l]);else for(r=h.call(i),s=new o;!(n=r.next()).done;l++)y(s,l,a?f(r,u,[n.value,l],!0):n.value);return s.length=l,s}});var s=require("./_export"),n=require("./_string-context"),r="includes";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var s=0;s<t.length;s++){var n=t[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t,s){return t&&o(e.prototype,t),s&&o(e,s),e}function u(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function a(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{},n=Object.keys(s);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(s).filter(function(e){return Object.getOwnPropertyDescriptor(s,e).enumerable}))),n.forEach(function(e){u(t,e,s[e])})}return t}function l(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&&L(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}s(s.P+s.F*require("./_fails-is-regexp")(r),"String",{includes:function(e){return!!~n(this,e,r).indexOf(e,1<arguments.length?arguments[1]:void 0)}});var C={ACTIVE:"ray-select--active",REQUIRED:"ray-select--required",HAS_VALUE:"ray-select--has-value",PLACEHOLDER_MODE:"ray-select--placeholder-mode",EL__INPUT:"ray-select__input"},g={INIT_SELECTOR:".ray-select"};function A(e){if(e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.")}var b=function(){function s(e){var t=this;if(i(this,s),u(this,"onFocus",function(){t._root.classList.add(t.constructor.cssClasses.ACTIVE)}),u(this,"onBlur",function(){t._root.classList.remove(t.constructor.cssClasses.ACTIVE)}),u(this,"onChange",function(){t.assignClasses()}),u(this,"_getCurrentValueOptionElement",function(){return t._inputElement.options[t._inputElement.selectedIndex]}),this._root=e,this._inputElement=this._root.querySelector(".".concat(this.constructor.cssClasses.EL__INPUT)),!this._inputElement)throw new Error("Select must have an input element with a class of .".concat(this.constructor.cssClasses.EL__INPUT));this._bindEventListeners(),this.assignClasses(),this.constructor.instances.set(this._root,this)}return c(s,null,[{key:"create",value:function(e,t){return this.instances.get(e)||new this(e,t)}},{key:"createAll",value:function(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=a({initSelector:this.strings.INIT_SELECTOR},s);A(e),Array.from(e.querySelectorAll(n.initSelector)).forEach(function(e){return t.create(e,n)})}},{key:"cssClasses",get:function(){return C}},{key:"strings",get:function(){return g}}]),c(s,[{key:"_bindEventListeners",value:function(){this._inputElement.addEventListener("focus",this.onFocus),this._inputElement.addEventListener("blur",this.onBlur),this._inputElement.addEventListener("change",this.onChange)}},{key:"isRequired",value:function(){return this._inputElement.required}},{key:"value",value:function(){return this._inputElement.value}},{key:"set",value:function(e){this._inputElement.value=e,this._inputElement.dispatchEvent(new Event("change"))}},{key:"assignClasses",value:function(){var e=this._getCurrentValueOptionElement();e&&e.innerHTML?e.dataset.rayPlaceholder?(this._root.classList.add(this.constructor.cssClasses.PLACEHOLDER_MODE),this._root.classList.remove(this.constructor.cssClasses.HAS_VALUE)):(this._root.classList.add(this.constructor.cssClasses.HAS_VALUE),this._root.classList.remove(this.constructor.cssClasses.PLACEHOLDER_MODE)):this._root.classList.remove(this.constructor.cssClasses.PLACEHOLDER_MODE,this.constructor.cssClasses.HAS_VALUE),this.isRequired()?this._root.classList.add(this.constructor.cssClasses.REQUIRED):this._root.classList.remove(this.constructor.cssClasses.REQUIRED)}},{key:"destroy",value:function(){this._inputElement.removeEventListener("focus",this.onFocus),this._inputElement.removeEventListener("blur",this.onBlur),this._inputElement.removeEventListener("change",this.onChange),this.constructor.instances.delete(this._root)}}]),s}();u(b,"instances",new WeakMap);var T={BASE:"ray-text-field",ACTIVE:"ray-text-field--active",REQUIRED:"ray-text-field--required",EL__INPUT:"ray-text-field__input",EL__LABEL:"ray-text-field__label",HAS_VALUE:"ray-text-field--has-value"},O={BASE:"ray-text-area",ACTIVE:"ray-text-area--active",REQUIRED:"ray-text-area--required",EL__INPUT:"ray-text-area__input",EL__LABEL:"ray-text-area__label",HAS_VALUE:"ray-text-area--has-value"},w={TEXT_FIELD:{INIT_SELECTOR:".".concat(T.BASE)},TEXT_AREA:{INIT_SELECTOR:".".concat(O.BASE)}},S=function(){function s(e){var t=this;if(i(this,s),u(this,"onMousedown",function(e){e.preventDefault(),t._inputElement.focus()}),u(this,"onFocus",function(){t._root.classList.add(t.constructor.cssClasses.ACTIVE)}),u(this,"onBlur",function(){t._root.classList.remove(t.constructor.cssClasses.ACTIVE),t.assignClasses()}),this._root=e,this._inputElement=this._root.querySelector(".".concat(this.constructor.cssClasses.EL__INPUT)),this._labelElement=this._root.querySelector(".".concat(this.constructor.cssClasses.EL__LABEL)),!this._inputElement)throw new Error("TextField must have an input element with a class of .".concat(this.constructor.cssClasses.EL__INPUT));this.assignClasses(),this._bindEventListeners(),this.constructor.instances.set(this._root,this)}return c(s,null,[{key:"create",value:function(e,t){return this.instances.get(e)||new this(e,t)}},{key:"createAll",value:function(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=a({initSelector:this.strings.INIT_SELECTOR},s);A(e),Array.from(e.querySelectorAll(n.initSelector)).forEach(function(e){return t.create(e,n)})}}]),c(s,[{key:"_bindEventListeners",value:function(){this._inputElement.addEventListener("focus",this.onFocus),this._inputElement.addEventListener("blur",this.onBlur),this._labelElement.addEventListener("mousedown",this.onMousedown)}},{key:"value",value:function(){return this._inputElement.value}},{key:"isRequired",value:function(){return this._inputElement.required}},{key:"set",value:function(e){this._inputElement.value=e}},{key:"assignClasses",value:function(){this.value()?this._root.classList.add(this.constructor.cssClasses.HAS_VALUE):this._root.classList.remove(this.constructor.cssClasses.HAS_VALUE),this.isRequired()?this._root.classList.add(this.constructor.cssClasses.REQUIRED):this._root.classList.remove(this.constructor.cssClasses.REQUIRED)}},{key:"destroy",value:function(){this._inputElement.removeEventListener("focus",this.onFocus),this._inputElement.removeEventListener("blur",this.onBlur),this._labelElement.removeEventListener("mousedown",this.onMousedown),this.constructor.instances.delete(this._root)}}]),s}(),I=function(e){function t(){return i(this,t),m(this,h(t).apply(this,arguments))}return l(t,S),c(t,null,[{key:"cssClasses",get:function(){return T}},{key:"strings",get:function(){return w.TEXT_FIELD}}]),t}();u(I,"instances",new WeakMap);var R=function(e){function t(){return i(this,t),m(this,h(t).apply(this,arguments))}return l(t,S),c(t,null,[{key:"cssClasses",get:function(){return O}},{key:"strings",get:function(){return w.TEXT_AREA}}]),t}();u(R,"instances",new WeakMap);var k=Object.freeze({Select:b,TextField:I,TextArea:R});function x(){Object.keys(k).forEach(function(e){var t=k[e];t.createAll&&t.createAll()})}return"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?x():window.addEventListener("DOMContentLoaded",x)),e.Select=b,e.TextArea=R,e.TextField=I,e.settings={prefix:"ray-",breakpointsInPixels:{phone:0,tablet:600,desktop:1195}},e}({}); | ||
this.Ray=this.Ray||{},this.Ray.Core=function(e){"use strict";var E=require("./_ctx"),t=require("./_export"),_=require("./_to-object"),f=require("./_iter-call"),d=require("./_is-array-iter"),v=require("./_to-length"),y=require("./_create-property"),p=require("./core.get-iterator-method");t(t.S+t.F*!require("./_iter-detect")(function(e){}),"Array",{from:function(e){var t,s,n,r,i=_(e),o="function"==typeof this?this:Array,c=arguments.length,u=1<c?arguments[1]:void 0,a=void 0!==u,l=0,h=p(i);if(a&&(u=E(u,2<c?arguments[2]:void 0,2)),null==h||o==Array&&d(h))for(s=new o(t=v(i.length));l<t;l++)y(s,l,a?u(i[l],l):i[l]);else for(r=h.call(i),s=new o;!(n=r.next()).done;l++)y(s,l,a?f(r,u,[n.value,l],!0):n.value);return s.length=l,s}});var s=require("./_export"),n=require("./_string-context"),r="includes";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var s=0;s<t.length;s++){var n=t[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t,s){return t&&o(e.prototype,t),s&&o(e,s),e}function u(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function a(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{},n=Object.keys(s);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(s).filter(function(e){return Object.getOwnPropertyDescriptor(s,e).enumerable}))),n.forEach(function(e){u(t,e,s[e])})}return t}function l(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&&L(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}s(s.P+s.F*require("./_fails-is-regexp")(r),"String",{includes:function(e){return!!~n(this,e,r).indexOf(e,1<arguments.length?arguments[1]:void 0)}});var C={ACTIVE:"ray-select--active",REQUIRED:"ray-select--required",HAS_VALUE:"ray-select--has-value",PLACEHOLDER_MODE:"ray-select--placeholder-mode",EL__INPUT:"ray-select__input"},g={INIT_SELECTOR:".ray-select"};function A(e){if(e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.")}var b=function(){function s(e){var t=this;if(i(this,s),u(this,"onFocus",function(){t._root.classList.add(t.constructor.cssClasses.ACTIVE)}),u(this,"onBlur",function(){t._root.classList.remove(t.constructor.cssClasses.ACTIVE)}),u(this,"onChange",function(){t.assignClasses()}),u(this,"_getCurrentValueOptionElement",function(){return t._inputElement.options[t._inputElement.selectedIndex]}),this._root=e,this._inputElement=this._root.querySelector(".".concat(this.constructor.cssClasses.EL__INPUT)),!this._inputElement)throw new Error("Select must have an input element with a class of .".concat(this.constructor.cssClasses.EL__INPUT));this._bindEventListeners(),this.assignClasses(),this.constructor.instances.set(this._root,this)}return c(s,null,[{key:"create",value:function(e,t){return this.instances.get(e)||new this(e,t)}},{key:"createAll",value:function(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=a({initSelector:this.strings.INIT_SELECTOR},s);A(e),Array.from(e.querySelectorAll(n.initSelector)).forEach(function(e){return t.create(e,n)})}},{key:"cssClasses",get:function(){return C}},{key:"strings",get:function(){return g}}]),c(s,[{key:"_bindEventListeners",value:function(){this._inputElement.addEventListener("focus",this.onFocus),this._inputElement.addEventListener("blur",this.onBlur),this._inputElement.addEventListener("change",this.onChange)}},{key:"isRequired",value:function(){return this._inputElement.required}},{key:"value",value:function(){return this._inputElement.value}},{key:"set",value:function(e){this._inputElement.value=e,this._inputElement.dispatchEvent(new Event("change"))}},{key:"assignClasses",value:function(){var e=this._getCurrentValueOptionElement();e&&e.innerHTML?e.dataset.rayPlaceholder?(this._root.classList.add(this.constructor.cssClasses.PLACEHOLDER_MODE),this._root.classList.remove(this.constructor.cssClasses.HAS_VALUE)):(this._root.classList.add(this.constructor.cssClasses.HAS_VALUE),this._root.classList.remove(this.constructor.cssClasses.PLACEHOLDER_MODE)):this._root.classList.remove(this.constructor.cssClasses.PLACEHOLDER_MODE,this.constructor.cssClasses.HAS_VALUE),this.isRequired()?this._root.classList.add(this.constructor.cssClasses.REQUIRED):this._root.classList.remove(this.constructor.cssClasses.REQUIRED)}},{key:"destroy",value:function(){this._inputElement.removeEventListener("focus",this.onFocus),this._inputElement.removeEventListener("blur",this.onBlur),this._inputElement.removeEventListener("change",this.onChange),this.constructor.instances.delete(this._root)}}]),s}();u(b,"instances",new WeakMap);var T={BASE:"ray-text-field",ACTIVE:"ray-text-field--active",REQUIRED:"ray-text-field--required",EL__INPUT:"ray-text-field__input",EL__LABEL:"ray-text-field__label",HAS_VALUE:"ray-text-field--has-value"},O={BASE:"ray-text-area",ACTIVE:"ray-text-area--active",REQUIRED:"ray-text-area--required",EL__INPUT:"ray-text-area__input",EL__LABEL:"ray-text-area__label",HAS_VALUE:"ray-text-area--has-value"},w={TEXT_FIELD:{INIT_SELECTOR:".".concat(T.BASE)},TEXT_AREA:{INIT_SELECTOR:".".concat(O.BASE)}},S=function(){function s(e){var t=this;if(i(this,s),u(this,"onMousedown",function(e){e.preventDefault(),t._inputElement.focus()}),u(this,"onFocus",function(){t._root.classList.add(t.constructor.cssClasses.ACTIVE)}),u(this,"onBlur",function(){t._root.classList.remove(t.constructor.cssClasses.ACTIVE),t.assignClasses()}),this._root=e,this._inputElement=this._root.querySelector(".".concat(this.constructor.cssClasses.EL__INPUT)),this._labelElement=this._root.querySelector(".".concat(this.constructor.cssClasses.EL__LABEL)),!this._inputElement)throw new Error("TextField must have an input element with a class of .".concat(this.constructor.cssClasses.EL__INPUT));this.assignClasses(),this._bindEventListeners(),this.constructor.instances.set(this._root,this)}return c(s,null,[{key:"create",value:function(e,t){return this.instances.get(e)||new this(e,t)}},{key:"createAll",value:function(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=a({initSelector:this.strings.INIT_SELECTOR},s);A(e),Array.from(e.querySelectorAll(n.initSelector)).forEach(function(e){return t.create(e,n)})}}]),c(s,[{key:"_bindEventListeners",value:function(){this._inputElement.addEventListener("focus",this.onFocus),this._inputElement.addEventListener("blur",this.onBlur),this._labelElement.addEventListener("mousedown",this.onMousedown)}},{key:"value",value:function(){return this._inputElement.value}},{key:"isRequired",value:function(){return this._inputElement.required}},{key:"set",value:function(e){this._inputElement.value=e}},{key:"assignClasses",value:function(){this.value()?this._root.classList.add(this.constructor.cssClasses.HAS_VALUE):this._root.classList.remove(this.constructor.cssClasses.HAS_VALUE),this.isRequired()?this._root.classList.add(this.constructor.cssClasses.REQUIRED):this._root.classList.remove(this.constructor.cssClasses.REQUIRED)}},{key:"destroy",value:function(){this._inputElement.removeEventListener("focus",this.onFocus),this._inputElement.removeEventListener("blur",this.onBlur),this._labelElement.removeEventListener("mousedown",this.onMousedown),this.constructor.instances.delete(this._root)}}]),s}(),I=function(e){function t(){return i(this,t),m(this,h(t).apply(this,arguments))}return l(t,S),c(t,null,[{key:"cssClasses",get:function(){return T}},{key:"strings",get:function(){return w.TEXT_FIELD}}]),t}();u(I,"instances",new WeakMap);var R=function(e){function t(){return i(this,t),m(this,h(t).apply(this,arguments))}return l(t,S),c(t,null,[{key:"cssClasses",get:function(){return O}},{key:"strings",get:function(){return w.TEXT_AREA}}]),t}();u(R,"instances",new WeakMap);var k=Object.freeze({Select:b,TextField:I,TextArea:R});function x(){Object.keys(k).forEach(function(e){k[e].createAll()})}return"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?x():window.addEventListener("DOMContentLoaded",x)),e.Select=b,e.TextArea=R,e.TextField=I,e.settings={prefix:"ray-",breakpointsInPixels:{phone:0,tablet:600,desktop:1195}},e}({}); | ||
//# sourceMappingURL=ray-core.min.js.map |
@@ -7,5 +7,3 @@ import * as components from '../../components'; | ||
if (Component.createAll) { | ||
Component.createAll(); | ||
} | ||
Component.createAll(); | ||
}); | ||
@@ -12,0 +10,0 @@ } |
@@ -28,6 +28,3 @@ (function (global, factory) { | ||
var Component = components[componentKey]; | ||
if (Component.createAll) { | ||
Component.createAll(); | ||
} | ||
Component.createAll(); | ||
}); | ||
@@ -34,0 +31,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
502885
5000