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

@wework/ray-core

Package Overview
Dependencies
Maintainers
40
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 1.8.6-alpha.23 to 1.8.6-alpha.24

2

es/components/chip/index.js

@@ -76,2 +76,4 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

_this2.emitChange();
event.preventDefault();
}

@@ -78,0 +80,0 @@ });

4

package.json
{
"name": "@wework/ray-core",
"version": "1.8.6-alpha.23+edd8045",
"version": "1.8.6-alpha.24+27f0daa",
"main": "umd/index.js",

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

],
"gitHead": "edd8045553b5487b69cb2b39ac695dd367c1989e",
"gitHead": "27f0daab75d1478762b39ec8dbdade5e3bcceda7",
"repository": {

@@ -83,0 +83,0 @@ "type": "git",

@@ -1027,2 +1027,4 @@ this.Ray = this.Ray || {};

_this2.emitChange();
event.preventDefault();
}

@@ -1029,0 +1031,0 @@ });

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

this.Ray=this.Ray||{},this.Ray.Core=function(t){"use strict";var E=function(r,s,t){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(r),void 0===s)return r;switch(t){case 1:return function(t){return r.call(s,t)};case 2:return function(t,e){return r.call(s,t,e)};case 3:return function(t,e,n){return r.call(s,t,e,n)}}return function(){return r.apply(s,arguments)}};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var y=e(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),p=e(function(t){var e=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=e)});p.version;function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(t){o(e,t,n[t])})}return e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var h=function(t){return"object"===n(t)?null!==t:"function"==typeof t},d=function(t){if(!h(t))throw TypeError(t+" is not an object!");return t},v=function(t){try{return!!t()}catch(t){return!0}},_=!v(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),m=y.document,g=h(m)&&h(m.createElement),L=!_&&!v(function(){return 7!=Object.defineProperty((t="div",g?m.createElement(t):{}),"a",{get:function(){return 7}}).a;var t}),C=Object.defineProperty,b={f:_?Object.defineProperty:function(t,e,n){if(d(t),e=function(t,e){if(!h(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!h(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!h(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!h(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}(e,!0),d(n),L)try{return C(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},S=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},A=_?function(t,e,n){return b.f(t,e,S(1,n))}:function(t,e,n){return t[e]=n,t},T={}.hasOwnProperty,w=function(t,e){return T.call(t,e)},O=0,k=Math.random(),I=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++O+k).toString(36))},R=e(function(t){var e="__core-js_shared__",n=y[e]||(y[e]={});(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:p.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),x=R("native-function-to-string",Function.toString),P=e(function(t){var i=I("src"),e="toString",o=(""+x).split(e);p.inspectSource=function(t){return x.call(t)},(t.exports=function(t,e,n,r){var s="function"==typeof n;s&&(w(n,"name")||A(n,"name",e)),t[e]!==n&&(s&&(w(n,i)||A(n,i,t[e]?""+t[e]:o.join(String(e)))),t===y?t[e]=n:r?t[e]?t[e]=n:A(t,e,n):(delete t[e],A(t,e,n)))})(Function.prototype,e,function(){return"function"==typeof this&&this[i]||x.call(this)})}),M="prototype",j=function t(e,n,r){var s,i,o,c,u=e&t.F,a=e&t.G,l=e&t.P,f=e&t.B,h=a?y:e&t.S?y[n]||(y[n]={}):(y[n]||{})[M],d=a?p:p[n]||(p[n]={}),v=d[M]||(d[M]={});for(s in a&&(r=n),r)o=((i=!u&&h&&void 0!==h[s])?h:r)[s],c=f&&i?E(o,y):l&&"function"==typeof o?E(Function.call,o):o,h&&P(h,s,o,e&t.U),d[s]!=o&&A(d,s,c),l&&v[s]!=o&&(v[s]=o)};y.core=p,j.F=1,j.G=2,j.S=4,j.P=8,j.B=16,j.W=32,j.U=64,j.R=128;var D=j,U=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},N=function(e,t,n,r){try{return r?t(d(n)[0],n[1]):t(n)}catch(t){var s=e.return;throw void 0!==s&&d(s.call(e)),t}},V={},F=e(function(t){var e=R("wks"),n=y.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:I)("Symbol."+t))}).store=e}),q=F("iterator"),B=Array.prototype,H=Math.ceil,Q=Math.floor,W=Math.min,X=function(t){return 0<t?W((e=t,isNaN(e=+e)?0:(0<e?Q:H)(e)),9007199254740991):0;var e},z=function(t,e,n){e in t?b.f(t,e,S(0,n)):t[e]=n},G={}.toString,J=function(t){return G.call(t).slice(8,-1)},K=F("toStringTag"),Y="Arguments"==J(function(){return arguments}()),Z=F("iterator"),$=p.getIteratorMethod=function(t){if(null!=t)return t[Z]||t["@@iterator"]||V[(e=t,void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(n=Object(e),K))?r:Y?J(n):"Object"==(s=J(n))&&"function"==typeof n.callee?"Arguments":s)];var e,n,r,s},tt=F("iterator"),et=!1;try{[7][tt]().return=function(){et=!0}}catch(t){}D(D.S+D.F*!function(t,e){if(!e&&!et)return!1;var n=!1;try{var r=[7],s=r[tt]();s.next=function(){return{done:n=!0}},r[tt]=function(){return s},t(r)}catch(t){}return n}(function(t){}),"Array",{from:function(t){var e,n,r,s,i,o=Object(U(t)),c="function"==typeof this?this:Array,u=arguments.length,a=1<u?arguments[1]:void 0,l=void 0!==a,f=0,h=$(o);if(l&&(a=E(a,2<u?arguments[2]:void 0,2)),null!=h&&(c!=Array||(void 0===(i=h)||V.Array!==i&&B[q]!==i)))for(s=h.call(o),n=new c;!(r=s.next()).done;f++)z(n,f,l?N(s,a,[r.value,f],!0):r.value);else for(n=new c(e=X(o.length));f<e;f++)z(n,f,l?a(o[f],f):o[f]);return n.length=f,n}});var nt=F("match"),rt=function(t,e,n){if(h(r=e)&&(void 0!==(s=r[nt])?s:"RegExp"==J(r)))throw TypeError("String#"+n+" doesn't accept regex!");var r,s;return String(U(t))},st=F("match"),it="includes";D(D.P+D.F*function(e){var n=/./;try{"/./"[e](n)}catch(t){try{return n[st]=!1,!"/./"[e](n)}catch(t){}}return!0}(it),"String",{includes:function(t){return!!~rt(this,t,it).indexOf(t,1<arguments.length?arguments[1]:void 0)}});var ot={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"},ct={INIT_SELECTOR:".ray-select"};function ut(t){if(t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.")}var at=function(){function n(t){var e=this;if(s(this,n),o(this,"onFocus",function(){e._root.classList.add(e.constructor.cssClasses.ACTIVE)}),o(this,"onBlur",function(){e._root.classList.remove(e.constructor.cssClasses.ACTIVE)}),o(this,"onChange",function(){e.assignClasses()}),o(this,"_getCurrentValueOptionElement",function(){return e._inputElement.options[e._inputElement.selectedIndex]}),this._root=t,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 i(n,null,[{key:"create",value:function(t,e){return this.instances.get(t)||new this(t,e)}},{key:"createAll",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=c({initSelector:this.strings.INIT_SELECTOR},n);ut(t),Array.from(t.querySelectorAll(r.initSelector)).forEach(function(t){return e.create(t,r)})}},{key:"cssClasses",get:function(){return ot}},{key:"strings",get:function(){return ct}}]),i(n,[{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(t){this._inputElement.value=t;var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!0),this._inputElement.dispatchEvent(e)}},{key:"assignClasses",value:function(){var t=this._getCurrentValueOptionElement();t&&t.innerHTML?t.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)}}]),n}();o(at,"instances",new WeakMap);var lt={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"},ft={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"},ht={TEXT_FIELD:{INIT_SELECTOR:".".concat(lt.BASE)},TEXT_AREA:{INIT_SELECTOR:".".concat(ft.BASE)}},dt=function(){function n(t){var e=this;if(s(this,n),o(this,"onMousedown",function(t){t.preventDefault(),e._inputElement.focus()}),o(this,"onFocus",function(){e._root.classList.add(e.constructor.cssClasses.ACTIVE)}),o(this,"onBlur",function(){e._root.classList.remove(e.constructor.cssClasses.ACTIVE),e.assignClasses()}),this._root=t,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 i(n,null,[{key:"create",value:function(t,e){return this.instances.get(t)||new this(t,e)}},{key:"createAll",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=c({initSelector:this.strings.INIT_SELECTOR},n);ut(t),Array.from(t.querySelectorAll(r.initSelector)).forEach(function(t){return e.create(t,r)})}}]),i(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:"isRequired",value:function(){return this._inputElement.required}},{key:"set",value:function(t){this._inputElement.value=t}},{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)}}]),n}(),vt=function(t){function e(){return s(this,e),f(this,a(e).apply(this,arguments))}return u(e,dt),i(e,null,[{key:"cssClasses",get:function(){return lt}},{key:"strings",get:function(){return ht.TEXT_FIELD}}]),e}();o(vt,"instances",new WeakMap);var Et=function(t){function e(){return s(this,e),f(this,a(e).apply(this,arguments))}return u(e,dt),i(e,null,[{key:"cssClasses",get:function(){return ft}},{key:"strings",get:function(){return ht.TEXT_AREA}}]),e}();o(Et,"instances",new WeakMap);var yt=function(){function r(t,e){var n=this;s(this,r),o(this,"onClick",function(){n.state.active=!n.state.active,n.assignClasses(),n.emitChange()}),o(this,"onSpace",function(t){"Space"!==t.code&&" "!==t.key||(n.state.active=!n.state.active,n.assignClasses(),n.emitChange())}),this._root=t,this._options=e,this.constructor.instances.set(this._root,this),this.state={active:this._root.classList.contains(this.constructor.cssClasses.ACTIVE)},this._bindEventListeners(),this.assignClasses()}return i(r,null,[{key:"create",value:function(t,e){return this.instances.get(t)||new this(t,e)}},{key:"createAll",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{active:!1},r=c({initSelector:this.strings.INIT_SELECTOR},n);Array.from(t.querySelectorAll(r.initSelector)).forEach(function(t){return e.create(t,r)})}},{key:"cssClasses",get:function(){return{ACTIVE:"ray-chip--active"}}},{key:"strings",get:function(){return{INIT_SELECTOR:".ray-chip"}}}]),i(r,[{key:"_bindEventListeners",value:function(){this._root.addEventListener("mousedown",this.onClick),this._root.addEventListener("keydown",this.onSpace)}},{key:"assignClasses",value:function(){this.state.active?this._root.classList.add(this.constructor.cssClasses.ACTIVE):this._root.classList.remove(this.constructor.cssClasses.ACTIVE)}},{key:"destroy",value:function(){this._root.removeEventListener("mousedown",this.onClick),this.constructor.instances.delete(this._root)}},{key:"emitChange",value:function(){var t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!0),this._root.dispatchEvent(t)}},{key:"set",value:function(t){this.state.active=t,this.assignClasses(),this.emitChange()}}]),r}();o(yt,"instances",new WeakMap);var pt=Object.freeze({Select:at,TextField:vt,TextArea:Et,Chip:yt});function _t(){Object.keys(pt).forEach(function(t){pt[t].createAll()})}return"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?_t():window.addEventListener("DOMContentLoaded",_t)),function(){if("undefined"!=typeof document){var t="js-ray-enable-accessibility";document.addEventListener("keydown",function(){document.body.classList.add(t)}),document.addEventListener("mousedown",function(){document.body.classList.remove(t)})}}(),t.Chip=yt,t.Select=at,t.TextArea=Et,t.TextField=vt,t.settings={prefix:"ray-",breakpointsInPixels:{phone:0,tablet:600,desktop:1195}},t}({});
this.Ray=this.Ray||{},this.Ray.Core=function(t){"use strict";var E=function(r,s,t){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(r),void 0===s)return r;switch(t){case 1:return function(t){return r.call(s,t)};case 2:return function(t,e){return r.call(s,t,e)};case 3:return function(t,e,n){return r.call(s,t,e,n)}}return function(){return r.apply(s,arguments)}};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var y=e(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),p=e(function(t){var e=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=e)});p.version;function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(t){o(e,t,n[t])})}return e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var h=function(t){return"object"===n(t)?null!==t:"function"==typeof t},v=function(t){if(!h(t))throw TypeError(t+" is not an object!");return t},d=function(t){try{return!!t()}catch(t){return!0}},_=!d(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),m=y.document,g=h(m)&&h(m.createElement),L=!_&&!d(function(){return 7!=Object.defineProperty((t="div",g?m.createElement(t):{}),"a",{get:function(){return 7}}).a;var t}),C=Object.defineProperty,b={f:_?Object.defineProperty:function(t,e,n){if(v(t),e=function(t,e){if(!h(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!h(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!h(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!h(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}(e,!0),v(n),L)try{return C(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},S=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},A=_?function(t,e,n){return b.f(t,e,S(1,n))}:function(t,e,n){return t[e]=n,t},T={}.hasOwnProperty,w=function(t,e){return T.call(t,e)},O=0,k=Math.random(),I=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++O+k).toString(36))},R=e(function(t){var e="__core-js_shared__",n=y[e]||(y[e]={});(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:p.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),x=R("native-function-to-string",Function.toString),P=e(function(t){var i=I("src"),e="toString",o=(""+x).split(e);p.inspectSource=function(t){return x.call(t)},(t.exports=function(t,e,n,r){var s="function"==typeof n;s&&(w(n,"name")||A(n,"name",e)),t[e]!==n&&(s&&(w(n,i)||A(n,i,t[e]?""+t[e]:o.join(String(e)))),t===y?t[e]=n:r?t[e]?t[e]=n:A(t,e,n):(delete t[e],A(t,e,n)))})(Function.prototype,e,function(){return"function"==typeof this&&this[i]||x.call(this)})}),M="prototype",j=function t(e,n,r){var s,i,o,c,u=e&t.F,a=e&t.G,l=e&t.P,f=e&t.B,h=a?y:e&t.S?y[n]||(y[n]={}):(y[n]||{})[M],v=a?p:p[n]||(p[n]={}),d=v[M]||(v[M]={});for(s in a&&(r=n),r)o=((i=!u&&h&&void 0!==h[s])?h:r)[s],c=f&&i?E(o,y):l&&"function"==typeof o?E(Function.call,o):o,h&&P(h,s,o,e&t.U),v[s]!=o&&A(v,s,c),l&&d[s]!=o&&(d[s]=o)};y.core=p,j.F=1,j.G=2,j.S=4,j.P=8,j.B=16,j.W=32,j.U=64,j.R=128;var D=j,U=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},N=function(e,t,n,r){try{return r?t(v(n)[0],n[1]):t(n)}catch(t){var s=e.return;throw void 0!==s&&v(s.call(e)),t}},V={},F=e(function(t){var e=R("wks"),n=y.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:I)("Symbol."+t))}).store=e}),q=F("iterator"),B=Array.prototype,H=Math.ceil,Q=Math.floor,W=Math.min,X=function(t){return 0<t?W((e=t,isNaN(e=+e)?0:(0<e?Q:H)(e)),9007199254740991):0;var e},z=function(t,e,n){e in t?b.f(t,e,S(0,n)):t[e]=n},G={}.toString,J=function(t){return G.call(t).slice(8,-1)},K=F("toStringTag"),Y="Arguments"==J(function(){return arguments}()),Z=F("iterator"),$=p.getIteratorMethod=function(t){if(null!=t)return t[Z]||t["@@iterator"]||V[(e=t,void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(n=Object(e),K))?r:Y?J(n):"Object"==(s=J(n))&&"function"==typeof n.callee?"Arguments":s)];var e,n,r,s},tt=F("iterator"),et=!1;try{[7][tt]().return=function(){et=!0}}catch(t){}D(D.S+D.F*!function(t,e){if(!e&&!et)return!1;var n=!1;try{var r=[7],s=r[tt]();s.next=function(){return{done:n=!0}},r[tt]=function(){return s},t(r)}catch(t){}return n}(function(t){}),"Array",{from:function(t){var e,n,r,s,i,o=Object(U(t)),c="function"==typeof this?this:Array,u=arguments.length,a=1<u?arguments[1]:void 0,l=void 0!==a,f=0,h=$(o);if(l&&(a=E(a,2<u?arguments[2]:void 0,2)),null!=h&&(c!=Array||(void 0===(i=h)||V.Array!==i&&B[q]!==i)))for(s=h.call(o),n=new c;!(r=s.next()).done;f++)z(n,f,l?N(s,a,[r.value,f],!0):r.value);else for(n=new c(e=X(o.length));f<e;f++)z(n,f,l?a(o[f],f):o[f]);return n.length=f,n}});var nt=F("match"),rt=function(t,e,n){if(h(r=e)&&(void 0!==(s=r[nt])?s:"RegExp"==J(r)))throw TypeError("String#"+n+" doesn't accept regex!");var r,s;return String(U(t))},st=F("match"),it="includes";D(D.P+D.F*function(e){var n=/./;try{"/./"[e](n)}catch(t){try{return n[st]=!1,!"/./"[e](n)}catch(t){}}return!0}(it),"String",{includes:function(t){return!!~rt(this,t,it).indexOf(t,1<arguments.length?arguments[1]:void 0)}});var ot={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"},ct={INIT_SELECTOR:".ray-select"};function ut(t){if(t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.")}var at=function(){function n(t){var e=this;if(s(this,n),o(this,"onFocus",function(){e._root.classList.add(e.constructor.cssClasses.ACTIVE)}),o(this,"onBlur",function(){e._root.classList.remove(e.constructor.cssClasses.ACTIVE)}),o(this,"onChange",function(){e.assignClasses()}),o(this,"_getCurrentValueOptionElement",function(){return e._inputElement.options[e._inputElement.selectedIndex]}),this._root=t,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 i(n,null,[{key:"create",value:function(t,e){return this.instances.get(t)||new this(t,e)}},{key:"createAll",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=c({initSelector:this.strings.INIT_SELECTOR},n);ut(t),Array.from(t.querySelectorAll(r.initSelector)).forEach(function(t){return e.create(t,r)})}},{key:"cssClasses",get:function(){return ot}},{key:"strings",get:function(){return ct}}]),i(n,[{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(t){this._inputElement.value=t;var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!0),this._inputElement.dispatchEvent(e)}},{key:"assignClasses",value:function(){var t=this._getCurrentValueOptionElement();t&&t.innerHTML?t.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)}}]),n}();o(at,"instances",new WeakMap);var lt={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"},ft={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"},ht={TEXT_FIELD:{INIT_SELECTOR:".".concat(lt.BASE)},TEXT_AREA:{INIT_SELECTOR:".".concat(ft.BASE)}},vt=function(){function n(t){var e=this;if(s(this,n),o(this,"onMousedown",function(t){t.preventDefault(),e._inputElement.focus()}),o(this,"onFocus",function(){e._root.classList.add(e.constructor.cssClasses.ACTIVE)}),o(this,"onBlur",function(){e._root.classList.remove(e.constructor.cssClasses.ACTIVE),e.assignClasses()}),this._root=t,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 i(n,null,[{key:"create",value:function(t,e){return this.instances.get(t)||new this(t,e)}},{key:"createAll",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=c({initSelector:this.strings.INIT_SELECTOR},n);ut(t),Array.from(t.querySelectorAll(r.initSelector)).forEach(function(t){return e.create(t,r)})}}]),i(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:"isRequired",value:function(){return this._inputElement.required}},{key:"set",value:function(t){this._inputElement.value=t}},{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)}}]),n}(),dt=function(t){function e(){return s(this,e),f(this,a(e).apply(this,arguments))}return u(e,vt),i(e,null,[{key:"cssClasses",get:function(){return lt}},{key:"strings",get:function(){return ht.TEXT_FIELD}}]),e}();o(dt,"instances",new WeakMap);var Et=function(t){function e(){return s(this,e),f(this,a(e).apply(this,arguments))}return u(e,vt),i(e,null,[{key:"cssClasses",get:function(){return ft}},{key:"strings",get:function(){return ht.TEXT_AREA}}]),e}();o(Et,"instances",new WeakMap);var yt=function(){function r(t,e){var n=this;s(this,r),o(this,"onClick",function(){n.state.active=!n.state.active,n.assignClasses(),n.emitChange()}),o(this,"onSpace",function(t){"Space"!==t.code&&" "!==t.key||(n.state.active=!n.state.active,n.assignClasses(),n.emitChange(),t.preventDefault())}),this._root=t,this._options=e,this.constructor.instances.set(this._root,this),this.state={active:this._root.classList.contains(this.constructor.cssClasses.ACTIVE)},this._bindEventListeners(),this.assignClasses()}return i(r,null,[{key:"create",value:function(t,e){return this.instances.get(t)||new this(t,e)}},{key:"createAll",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{active:!1},r=c({initSelector:this.strings.INIT_SELECTOR},n);Array.from(t.querySelectorAll(r.initSelector)).forEach(function(t){return e.create(t,r)})}},{key:"cssClasses",get:function(){return{ACTIVE:"ray-chip--active"}}},{key:"strings",get:function(){return{INIT_SELECTOR:".ray-chip"}}}]),i(r,[{key:"_bindEventListeners",value:function(){this._root.addEventListener("mousedown",this.onClick),this._root.addEventListener("keydown",this.onSpace)}},{key:"assignClasses",value:function(){this.state.active?this._root.classList.add(this.constructor.cssClasses.ACTIVE):this._root.classList.remove(this.constructor.cssClasses.ACTIVE)}},{key:"destroy",value:function(){this._root.removeEventListener("mousedown",this.onClick),this.constructor.instances.delete(this._root)}},{key:"emitChange",value:function(){var t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!0),this._root.dispatchEvent(t)}},{key:"set",value:function(t){this.state.active=t,this.assignClasses(),this.emitChange()}}]),r}();o(yt,"instances",new WeakMap);var pt=Object.freeze({Select:at,TextField:dt,TextArea:Et,Chip:yt});function _t(){Object.keys(pt).forEach(function(t){pt[t].createAll()})}return"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?_t():window.addEventListener("DOMContentLoaded",_t)),function(){if("undefined"!=typeof document){var t="js-ray-enable-accessibility";document.addEventListener("keydown",function(){document.body.classList.add(t)}),document.addEventListener("mousedown",function(){document.body.classList.remove(t)})}}(),t.Chip=yt,t.Select=at,t.TextArea=Et,t.TextField=dt,t.settings={prefix:"ray-",breakpointsInPixels:{phone:0,tablet:600,desktop:1195}},t}({});
//# sourceMappingURL=ray-core.min.js.map

@@ -68,2 +68,3 @@ class Chip {

this.emitChange();
event.preventDefault();
}

@@ -70,0 +71,0 @@ };

@@ -96,2 +96,4 @@ (function (global, factory) {

_this2.emitChange();
event.preventDefault();
}

@@ -98,0 +100,0 @@ });

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