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

@wework/ray-core

Package Overview
Dependencies
Maintainers
24
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wework/ray-core - npm Package Compare versions

Comparing version 0.4.4 to 0.4.5

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [0.4.5](https://github.com/WeConnect/ray/compare/@wework/ray-core@0.4.4...@wework/ray-core@0.4.5) (2019-04-15)
### Bug Fixes
* **text-field:** add has-value class in create ([#116](https://github.com/WeConnect/ray/issues/116)) ([6d158e8](https://github.com/WeConnect/ray/commit/6d158e8))
## [0.4.4](https://github.com/WeConnect/ray/compare/@wework/ray-core@0.4.3...@wework/ray-core@0.4.4) (2019-04-11)

@@ -8,0 +19,0 @@

17

es/components/text-field/index.js

@@ -74,7 +74,3 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

if (_this2.value()) {
_this2._root.classList.add(_this2.constructor.cssClasses.HAS_VALUE);
} else {
_this2._root.classList.remove(_this2.constructor.cssClasses.HAS_VALUE);
}
_this2.assignClasses();
});

@@ -90,2 +86,4 @@

this.assignClasses();
this._bindEventListeners();

@@ -117,2 +115,11 @@

}, {
key: "assignClasses",
value: function assignClasses() {
if (this.value()) {
this._root.classList.add(this.constructor.cssClasses.HAS_VALUE);
} else {
this._root.classList.remove(this.constructor.cssClasses.HAS_VALUE);
}
}
}, {
key: "destroy",

@@ -119,0 +126,0 @@ value: function destroy() {

{
"name": "@wework/ray-core",
"version": "0.4.4",
"version": "0.4.5",
"main": "umd/index.js",

@@ -76,3 +76,3 @@ "module": "es/index.js",

],
"gitHead": "79416b897cd8aac2881a2c9d0d7155a5cf853e4a",
"gitHead": "e1138f08b13e0a98250801d3980f5dc3a8e1ff45",
"keywords": [

@@ -79,0 +79,0 @@ "wework",

@@ -456,7 +456,3 @@ this.Ray = this.Ray || {};

if (_this2.value()) {
_this2._root.classList.add(_this2.constructor.cssClasses.HAS_VALUE);
} else {
_this2._root.classList.remove(_this2.constructor.cssClasses.HAS_VALUE);
}
_this2.assignClasses();
});

@@ -472,2 +468,4 @@

this.assignClasses();
this._bindEventListeners();

@@ -499,2 +497,11 @@

}, {
key: "assignClasses",
value: function assignClasses() {
if (this.value()) {
this._root.classList.add(this.constructor.cssClasses.HAS_VALUE);
} else {
this._root.classList.remove(this.constructor.cssClasses.HAS_VALUE);
}
}
}, {
key: "destroy",

@@ -501,0 +508,0 @@ value: function destroy() {

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

this.Ray=this.Ray||{},this.Ray.Core=function(e){"use strict";var f=require("./_ctx"),t=require("./_export"),E=require("./_to-object"),_=require("./_iter-call"),d=require("./_is-array-iter"),y=require("./_to-length"),v=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,n,r,s,o=E(e),i="function"==typeof this?this:Array,c=arguments.length,u=1<c?arguments[1]:void 0,a=void 0!==u,l=0,h=p(o);if(a&&(u=f(u,2<c?arguments[2]:void 0,2)),null==h||i==Array&&d(h))for(n=new i(t=y(o.length));l<t;l++)v(n,l,a?u(o[l],l):o[l]);else for(s=h.call(o),n=new i;!(r=s.next()).done;l++)v(n,l,a?_(s,u,[r.value,l],!0):r.value);return n.length=l,n}});var n=require("./_export"),r=require("./_string-context"),s="includes";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(e){u(t,e,n[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&&g(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){if(null==e)return{};var n,r,s=function(e,t){if(null==e)return{};var n,r,s={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],0<=t.indexOf(n)||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function L(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}function b(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n(n.P+n.F*require("./_fails-is-regexp")(s),"String",{includes:function(e){return!!~r(this,e,s).indexOf(e,1<arguments.length?arguments[1]:void 0)}});var A={ACTIVE:"ray-select--active",HAS_VALUE:"ray-select--has-value",PLACEHOLDER_MODE:"ray-select--placeholder-mode",EL__INPUT:"ray-select__input"},O={INIT_SELECTOR:".ray-select"};function T(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 w=function(){function n(e){var t=this;if(o(this,n),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(n,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,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=a({initSelector:this.strings.INIT_SELECTOR},n);T(e),Array.from(e.querySelectorAll(r.initSelector)).forEach(function(e){return t.create(e,r)})}},{key:"cssClasses",get:function(){return A}},{key:"strings",get:function(){return O}}]),c(n,[{key:"_bindEventListeners",value:function(){this._inputElement.addEventListener("focus",this.onFocus),this._inputElement.addEventListener("blur",this.onBlur),this._inputElement.addEventListener("change",this.onChange)}},{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)}},{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)}}]),n}();u(w,"instances",new WeakMap);var C={BASE:"ray-text-field",ACTIVE:"ray-text-field--active",EL__INPUT:"ray-text-field__input",EL__LABEL:"ray-text-field__label",HAS_VALUE:"ray-text-field--has-value"},S={BASE:"ray-text-area",ACTIVE:"ray-text-area--active",EL__INPUT:"ray-text-area__input",EL__LABEL:"ray-text-area__label",HAS_VALUE:"ray-text-area--has-value"},I={TEXT_FIELD:{INIT_SELECTOR:".".concat(C.BASE)},TEXT_AREA:{INIT_SELECTOR:".".concat(S.BASE)}},k=function(){function n(e){var t=this;if(o(this,n),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.value()?t._root.classList.add(t.constructor.cssClasses.HAS_VALUE):t._root.classList.remove(t.constructor.cssClasses.HAS_VALUE)}),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._bindEventListeners(),this.constructor.instances.set(this._root,this)}return c(n,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,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=a({initSelector:this.strings.INIT_SELECTOR},n);T(e),Array.from(e.querySelectorAll(r.initSelector)).forEach(function(e){return t.create(e,r)})}}]),c(n,[{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:"set",value:function(e){this._inputElement.value=e}},{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)}}]),n}(),x=function(e){function t(){return o(this,t),L(this,h(t).apply(this,arguments))}return l(t,k),c(t,null,[{key:"cssClasses",get:function(){return C}},{key:"strings",get:function(){return I.TEXT_FIELD}}]),t}();u(x,"instances",new WeakMap);var j=function(e){function t(){return o(this,t),L(this,h(t).apply(this,arguments))}return l(t,k),c(t,null,[{key:"cssClasses",get:function(){return S}},{key:"strings",get:function(){return I.TEXT_AREA}}]),t}();u(j,"instances",new WeakMap);var P=Object.freeze({Select:w,TextField:x,TextArea:j});function B(e){var t,n,r=e.logType,s=e.message,o=e.includeInBuild,i=m(e,["logType","message","includeInBuild"]);o&&(t=console)[r].apply(t,["[ray] ".concat(s)].concat(b((n=i,0===Object.keys(n).length&&n.constructor===Object?[]:i))))}var D={log:function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=arguments.length,r=new Array(2<n?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];B(a({logType:"log",message:e,includeInBuild:t},r))},warn:function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=arguments.length,r=new Array(2<n?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];B(a({logType:"warn",message:e,includeInBuild:t},r))},error:function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=arguments.length,r=new Array(2<n?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];B(a({logType:"error",message:e,includeInBuild:t},r))},debug:function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=arguments.length,r=new Array(2<n?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];B(a({logType:"debug",message:e,includeInBuild:t},r))}};function N(){D.debug("booting"),Object.keys(P).forEach(function(e){var t=P[e];t.createAll&&(D.debug("instantiating ".concat(e)),t.createAll())})}return"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?N():window.addEventListener("DOMContentLoaded",N)),e.Select=w,e.TextField=x,e.TextArea=j,e}({});
this.Ray=this.Ray||{},this.Ray.Core=function(e){"use strict";var f=require("./_ctx"),t=require("./_export"),E=require("./_to-object"),_=require("./_iter-call"),d=require("./_is-array-iter"),y=require("./_to-length"),v=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,n,r,s,i=E(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=f(u,2<c?arguments[2]:void 0,2)),null==h||o==Array&&d(h))for(n=new o(t=y(i.length));l<t;l++)v(n,l,a?u(i[l],l):i[l]);else for(s=h.call(i),n=new o;!(r=s.next()).done;l++)v(n,l,a?_(s,u,[r.value,l],!0):r.value);return n.length=l,n}});var n=require("./_export"),r=require("./_string-context"),s="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 n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(e){u(t,e,n[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&&g(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){if(null==e)return{};var n,r,s=function(e,t){if(null==e)return{};var n,r,s={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function L(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}function b(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n(n.P+n.F*require("./_fails-is-regexp")(s),"String",{includes:function(e){return!!~r(this,e,s).indexOf(e,1<arguments.length?arguments[1]:void 0)}});var A={ACTIVE:"ray-select--active",HAS_VALUE:"ray-select--has-value",PLACEHOLDER_MODE:"ray-select--placeholder-mode",EL__INPUT:"ray-select__input"},O={INIT_SELECTOR:".ray-select"};function T(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 C=function(){function n(e){var t=this;if(i(this,n),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(n,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,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=a({initSelector:this.strings.INIT_SELECTOR},n);T(e),Array.from(e.querySelectorAll(r.initSelector)).forEach(function(e){return t.create(e,r)})}},{key:"cssClasses",get:function(){return A}},{key:"strings",get:function(){return O}}]),c(n,[{key:"_bindEventListeners",value:function(){this._inputElement.addEventListener("focus",this.onFocus),this._inputElement.addEventListener("blur",this.onBlur),this._inputElement.addEventListener("change",this.onChange)}},{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)}},{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)}}]),n}();u(C,"instances",new WeakMap);var w={BASE:"ray-text-field",ACTIVE:"ray-text-field--active",EL__INPUT:"ray-text-field__input",EL__LABEL:"ray-text-field__label",HAS_VALUE:"ray-text-field--has-value"},S={BASE:"ray-text-area",ACTIVE:"ray-text-area--active",EL__INPUT:"ray-text-area__input",EL__LABEL:"ray-text-area__label",HAS_VALUE:"ray-text-area--has-value"},I={TEXT_FIELD:{INIT_SELECTOR:".".concat(w.BASE)},TEXT_AREA:{INIT_SELECTOR:".".concat(S.BASE)}},k=function(){function n(e){var t=this;if(i(this,n),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(n,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,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=a({initSelector:this.strings.INIT_SELECTOR},n);T(e),Array.from(e.querySelectorAll(r.initSelector)).forEach(function(e){return t.create(e,r)})}}]),c(n,[{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:"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)}},{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)}}]),n}(),x=function(e){function t(){return i(this,t),L(this,h(t).apply(this,arguments))}return l(t,k),c(t,null,[{key:"cssClasses",get:function(){return w}},{key:"strings",get:function(){return I.TEXT_FIELD}}]),t}();u(x,"instances",new WeakMap);var j=function(e){function t(){return i(this,t),L(this,h(t).apply(this,arguments))}return l(t,k),c(t,null,[{key:"cssClasses",get:function(){return S}},{key:"strings",get:function(){return I.TEXT_AREA}}]),t}();u(j,"instances",new WeakMap);var P=Object.freeze({Select:C,TextField:x,TextArea:j});function B(e){var t,n,r=e.logType,s=e.message,i=e.includeInBuild,o=m(e,["logType","message","includeInBuild"]);i&&(t=console)[r].apply(t,["[ray] ".concat(s)].concat(b((n=o,0===Object.keys(n).length&&n.constructor===Object?[]:o))))}var D={log:function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=arguments.length,r=new Array(2<n?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];B(a({logType:"log",message:e,includeInBuild:t},r))},warn:function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=arguments.length,r=new Array(2<n?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];B(a({logType:"warn",message:e,includeInBuild:t},r))},error:function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=arguments.length,r=new Array(2<n?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];B(a({logType:"error",message:e,includeInBuild:t},r))},debug:function(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=arguments.length,r=new Array(2<n?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];B(a({logType:"debug",message:e,includeInBuild:t},r))}};function N(){D.debug("booting"),Object.keys(P).forEach(function(e){var t=P[e];t.createAll&&(D.debug("instantiating ".concat(e)),t.createAll())})}return"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?N():window.addEventListener("DOMContentLoaded",N)),e.Select=C,e.TextField=x,e.TextArea=j,e}({});
//# sourceMappingURL=ray-core.min.js.map

@@ -40,2 +40,3 @@ import { CSS_CLASSES, STRINGS } from './constants';

this.assignClasses();
this._bindEventListeners();

@@ -73,2 +74,6 @@

this.assignClasses();
};
assignClasses() {
if (this.value()) {

@@ -79,3 +84,3 @@ this._root.classList.add(this.constructor.cssClasses.HAS_VALUE);

}
};
}

@@ -82,0 +87,0 @@ destroy() {

@@ -91,7 +91,3 @@ (function (global, factory) {

if (_this2.value()) {
_this2._root.classList.add(_this2.constructor.cssClasses.HAS_VALUE);
} else {
_this2._root.classList.remove(_this2.constructor.cssClasses.HAS_VALUE);
}
_this2.assignClasses();
});

@@ -107,2 +103,4 @@

this.assignClasses();
this._bindEventListeners();

@@ -134,2 +132,11 @@

}, {
key: "assignClasses",
value: function assignClasses() {
if (this.value()) {
this._root.classList.add(this.constructor.cssClasses.HAS_VALUE);
} else {
this._root.classList.remove(this.constructor.cssClasses.HAS_VALUE);
}
}
}, {
key: "destroy",

@@ -136,0 +143,0 @@ value: function destroy() {

Sorry, the diff of this file is not supported yet

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