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

@wework/ray-core

Package Overview
Dependencies
Maintainers
27
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.1.0 to 1.2.0

11

CHANGELOG.md

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

# [1.2.0](https://github.com/wework/ray/compare/@wework/ray-core@1.1.0...@wework/ray-core@1.2.0) (2019-05-08)
### Features
* **settings:** export breakpoints from settings ([#79](https://github.com/wework/ray/issues/79)) ([280ad02](https://github.com/wework/ray/commit/280ad02))
# [1.1.0](https://github.com/wework/ray/compare/@wework/ray-core@1.0.5...@wework/ray-core@1.1.0) (2019-05-08)

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

7

es/global/js/settings.js
export default {
prefix: 'ray-'
prefix: 'ray-',
breakpointsInPixels: {
phone: 0,
tablet: 600,
desktop: 1195
}
};

3

es/index.js
import './global/js/polyfills';
import boot from './global/js/boot';
boot();
export * from './components';
export * from './components';
export { default as settings } from './global/js/settings';
{
"name": "@wework/ray-core",
"version": "1.1.0",
"version": "1.2.0",
"main": "umd/index.js",

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

],
"gitHead": "4f43459a329164254ee49c96aad545c3c0f9e6fd",
"gitHead": "d1bf7b06fdaf6376cf35555257ce6dad01a4d6cd",
"keywords": [

@@ -80,0 +80,0 @@ "wework",

@@ -548,2 +548,11 @@ this.Ray = this.Ray || {};

var settings = {
prefix: 'ray-',
breakpointsInPixels: {
phone: 0,
tablet: 600,
desktop: 1195
}
};
boot();

@@ -554,2 +563,3 @@

exports.TextField = TextField;
exports.settings = settings;

@@ -556,0 +566,0 @@ return exports;

@@ -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,n,s,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(n=new o(t=v(i.length));l<t;l++)y(n,l,a?u(i[l],l):i[l]);else for(r=h.call(i),n=new o;!(s=r.next()).done;l++)y(n,l,a?f(r,u,[s.value,l],!0):s.value);return n.length=l,n}});var n=require("./_export"),s=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 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)}}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]:{},s=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),s.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&&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}n(n.P+n.F*require("./_fails-is-regexp")(r),"String",{includes:function(e){return!!~s(this,e,r).indexOf(e,1<arguments.length?arguments[1]:void 0)}});var g={ACTIVE:"ray-select--active",HAS_VALUE:"ray-select--has-value",PLACEHOLDER_MODE:"ray-select--placeholder-mode",EL__INPUT:"ray-select__input"},A={INIT_SELECTOR:".ray-select"};function C(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 T=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]:{},s=a({initSelector:this.strings.INIT_SELECTOR},n);C(e),Array.from(e.querySelectorAll(s.initSelector)).forEach(function(e){return t.create(e,s)})}},{key:"cssClasses",get:function(){return g}},{key:"strings",get:function(){return A}}]),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(T,"instances",new WeakMap);var b={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"},O={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"},w={TEXT_FIELD:{INIT_SELECTOR:".".concat(b.BASE)},TEXT_AREA:{INIT_SELECTOR:".".concat(O.BASE)}},S=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]:{},s=a({initSelector:this.strings.INIT_SELECTOR},n);C(e),Array.from(e.querySelectorAll(s.initSelector)).forEach(function(e){return t.create(e,s)})}}]),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}(),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 b}},{key:"strings",get:function(){return w.TEXT_FIELD}}]),t}();u(I,"instances",new WeakMap);var k=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(k,"instances",new WeakMap);var x=Object.freeze({Select:T,TextField:I,TextArea:k});function P(){Object.keys(x).forEach(function(e){var t=x[e];t.createAll&&t.createAll()})}return"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?P():window.addEventListener("DOMContentLoaded",P)),e.Select=T,e.TextArea=k,e.TextField=I,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,n,s,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(n=new o(t=v(i.length));l<t;l++)y(n,l,a?u(i[l],l):i[l]);else for(r=h.call(i),n=new o;!(s=r.next()).done;l++)y(n,l,a?f(r,u,[s.value,l],!0):s.value);return n.length=l,n}});var n=require("./_export"),s=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 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)}}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]:{},s=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),s.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&&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}n(n.P+n.F*require("./_fails-is-regexp")(r),"String",{includes:function(e){return!!~s(this,e,r).indexOf(e,1<arguments.length?arguments[1]:void 0)}});var g={ACTIVE:"ray-select--active",HAS_VALUE:"ray-select--has-value",PLACEHOLDER_MODE:"ray-select--placeholder-mode",EL__INPUT:"ray-select__input"},A={INIT_SELECTOR:".ray-select"};function C(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 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]:{},s=a({initSelector:this.strings.INIT_SELECTOR},n);C(e),Array.from(e.querySelectorAll(s.initSelector)).forEach(function(e){return t.create(e,s)})}},{key:"cssClasses",get:function(){return g}},{key:"strings",get:function(){return A}}]),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(b,"instances",new WeakMap);var T={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"},O={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"},w={TEXT_FIELD:{INIT_SELECTOR:".".concat(T.BASE)},TEXT_AREA:{INIT_SELECTOR:".".concat(O.BASE)}},S=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]:{},s=a({initSelector:this.strings.INIT_SELECTOR},n);C(e),Array.from(e.querySelectorAll(s.initSelector)).forEach(function(e){return t.create(e,s)})}}]),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}(),k=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(k,"instances",new WeakMap);var 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 O}},{key:"strings",get:function(){return w.TEXT_AREA}}]),t}();u(I,"instances",new WeakMap);var x=Object.freeze({Select:b,TextField:k,TextArea:I});function P(){Object.keys(x).forEach(function(e){var t=x[e];t.createAll&&t.createAll()})}return"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?P():window.addEventListener("DOMContentLoaded",P)),e.Select=b,e.TextArea=I,e.TextField=k,e.settings={prefix:"ray-",breakpointsInPixels:{phone:0,tablet:600,desktop:1195}},e}({});
//# sourceMappingURL=ray-core.min.js.map
export default {
prefix: 'ray-'
prefix: 'ray-',
breakpointsInPixels: {
phone: 0,
tablet: 600,
desktop: 1195
}
};

@@ -7,1 +7,2 @@ import './global/js/polyfills';

export * from './components';
export { default as settings } from './global/js/settings';

@@ -21,5 +21,10 @@ (function (global, factory) {

var _default = {
prefix: 'ray-'
prefix: 'ray-',
breakpointsInPixels: {
phone: 0,
tablet: 600,
desktop: 1195
}
};
_exports.default = _default;
});
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "./global/js/polyfills", "./global/js/boot", "./components"], factory);
define(["exports", "./global/js/polyfills", "./global/js/boot", "./components", "./global/js/settings"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("./global/js/polyfills"), require("./global/js/boot"), require("./components"));
factory(exports, require("./global/js/polyfills"), require("./global/js/boot"), require("./components"), require("./global/js/settings"));
} else {

@@ -10,6 +10,6 @@ var mod = {

};
factory(mod.exports, global.polyfills, global.boot, global.components);
factory(mod.exports, global.polyfills, global.boot, global.components, global.settings);
global.index = mod.exports;
}
})(this, function (_exports, _polyfills, _boot, _components) {
})(this, function (_exports, _polyfills, _boot, _components, _settings) {
"use strict";

@@ -20,5 +20,15 @@

});
var _exportNames = {
settings: true
};
Object.defineProperty(_exports, "settings", {
enumerable: true,
get: function get() {
return _settings.default;
}
});
_boot = _interopRequireDefault(_boot);
Object.keys(_components).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(_exports, key, {

@@ -31,2 +41,3 @@ enumerable: true,

});
_settings = _interopRequireDefault(_settings);

@@ -33,0 +44,0 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

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