@wework/ray-core
Advanced tools
Comparing version 1.8.6-alpha.14 to 1.8.6-alpha.15
@@ -111,5 +111,8 @@ 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; } | ||
value: function set(value) { | ||
this._inputElement.value = value; | ||
this._inputElement.value = value; // IE11 fix: can't use new Event() | ||
this._inputElement.dispatchEvent(new Event('change')); | ||
var event = document.createEvent('HTMLEvents'); | ||
event.initEvent('change', true, true); | ||
this._inputElement.dispatchEvent(event); | ||
} | ||
@@ -116,0 +119,0 @@ }, { |
{ | ||
"name": "@wework/ray-core", | ||
"version": "1.8.6-alpha.14+5784303", | ||
"version": "1.8.6-alpha.15+1679241", | ||
"main": "umd/index.js", | ||
@@ -80,3 +80,3 @@ "module": "es/index.js", | ||
], | ||
"gitHead": "57843035dbcc61e0ea9de93f206aba61168b130b", | ||
"gitHead": "1679241f2f99093e9e636f51363ef6909ade1f3d", | ||
"repository": { | ||
@@ -83,0 +83,0 @@ "type": "git", |
@@ -703,5 +703,8 @@ this.Ray = this.Ray || {}; | ||
value: function set(value) { | ||
this._inputElement.value = value; | ||
this._inputElement.value = value; // IE11 fix: can't use new Event() | ||
this._inputElement.dispatchEvent(new Event('change')); | ||
var event = document.createEvent('HTMLEvents'); | ||
event.initEvent('change', true, true); | ||
this._inputElement.dispatchEvent(event); | ||
} | ||
@@ -708,0 +711,0 @@ }, { |
@@ -1,2 +0,2 @@ | ||
this.Ray=this.Ray||{},this.Ray.Core=function(t){"use strict";var y=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 E=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 o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function i(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){i(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=E.document,L=h(m)&&h(m.createElement),g=!_&&!v(function(){return 7!=Object.defineProperty((t="div",L?m.createElement(t):{}),"a",{get:function(){return 7}}).a;var t}),b=Object.defineProperty,C={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),g)try{return b(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}},w=_?function(t,e,n){return C.f(t,e,S(1,n))}:function(t,e,n){return t[e]=n,t},A={}.hasOwnProperty,T=function(t,e){return A.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=E[e]||(E[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 o=I("src"),e="toString",i=(""+x).split(e);p.inspectSource=function(t){return x.call(t)},(t.exports=function(t,e,n,r){var s="function"==typeof n;s&&(T(n,"name")||w(n,"name",e)),t[e]!==n&&(s&&(T(n,o)||w(n,o,t[e]?""+t[e]:i.join(String(e)))),t===E?t[e]=n:r?t[e]?t[e]=n:w(t,e,n):(delete t[e],w(t,e,n)))})(Function.prototype,e,function(){return"function"==typeof this&&this[o]||x.call(this)})}),j="prototype",D=function t(e,n,r){var s,o,i,c,u=e&t.F,a=e&t.G,l=e&t.P,f=e&t.B,h=a?E:e&t.S?E[n]||(E[n]={}):(E[n]||{})[j],d=a?p:p[n]||(p[n]={}),v=d[j]||(d[j]={});for(s in a&&(r=n),r)i=((o=!u&&h&&void 0!==h[s])?h:r)[s],c=f&&o?y(i,E):l&&"function"==typeof i?y(Function.call,i):i,h&&P(h,s,i,e&t.U),d[s]!=i&&w(d,s,c),l&&v[s]!=i&&(v[s]=i)};E.core=p,D.F=1,D.G=2,D.S=4,D.P=8,D.B=16,D.W=32,D.U=64,D.R=128;var M=D,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=E.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?C.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){}M(M.S+M.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,o,i=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=$(i);if(l&&(a=y(a,2<u?arguments[2]:void 0,2)),null!=h&&(c!=Array||(void 0===(o=h)||V.Array!==o&&B[q]!==o)))for(s=h.call(i),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(i.length));f<e;f++)z(n,f,l?a(i[f],f):i[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"),ot="includes";M(M.P+M.F*function(e){var n=/./;try{"/./"[e](n)}catch(t){try{return n[st]=!1,!"/./"[e](n)}catch(t){}}return!0}(ot),"String",{includes:function(t){return!!~rt(this,t,ot).indexOf(t,1<arguments.length?arguments[1]:void 0)}});var it={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),i(this,"onFocus",function(){e._root.classList.add(e.constructor.cssClasses.ACTIVE)}),i(this,"onBlur",function(){e._root.classList.remove(e.constructor.cssClasses.ACTIVE)}),i(this,"onChange",function(){e.assignClasses()}),i(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 o(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 it}},{key:"strings",get:function(){return ct}}]),o(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,this._inputElement.dispatchEvent(new Event("change"))}},{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}();i(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),i(this,"onMousedown",function(t){t.preventDefault(),e._inputElement.focus()}),i(this,"onFocus",function(){e._root.classList.add(e.constructor.cssClasses.ACTIVE)}),i(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 o(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)})}}]),o(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),o(e,null,[{key:"cssClasses",get:function(){return lt}},{key:"strings",get:function(){return ht.TEXT_FIELD}}]),e}();i(vt,"instances",new WeakMap);var yt=function(t){function e(){return s(this,e),f(this,a(e).apply(this,arguments))}return u(e,dt),o(e,null,[{key:"cssClasses",get:function(){return ft}},{key:"strings",get:function(){return ht.TEXT_AREA}}]),e}();i(yt,"instances",new WeakMap);var Et=function(){function r(t,e){var n=this;s(this,r),i(this,"onClick",function(){n.state.active=!n.state.active,n.assignClasses()}),i(this,"onSpace",function(t){"Space"!==t.code&&" "!==t.key||(n.state.active=!n.state.active,n.assignClasses())}),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 o(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"}}}]),o(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)}}]),r}();i(Et,"instances",new WeakMap);var pt=Object.freeze({Select:at,TextField:vt,TextArea:yt,Chip:Et});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=Et,t.Select=at,t.TextArea=yt,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 y=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 E=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 o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function i(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){i(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=E.document,L=h(m)&&h(m.createElement),g=!_&&!v(function(){return 7!=Object.defineProperty((t="div",L?m.createElement(t):{}),"a",{get:function(){return 7}}).a;var t}),b=Object.defineProperty,C={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),g)try{return b(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 C.f(t,e,S(1,n))}:function(t,e,n){return t[e]=n,t},w={}.hasOwnProperty,T=function(t,e){return w.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=E[e]||(E[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 o=I("src"),e="toString",i=(""+x).split(e);p.inspectSource=function(t){return x.call(t)},(t.exports=function(t,e,n,r){var s="function"==typeof n;s&&(T(n,"name")||A(n,"name",e)),t[e]!==n&&(s&&(T(n,o)||A(n,o,t[e]?""+t[e]:i.join(String(e)))),t===E?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[o]||x.call(this)})}),j="prototype",M=function t(e,n,r){var s,o,i,c,u=e&t.F,a=e&t.G,l=e&t.P,f=e&t.B,h=a?E:e&t.S?E[n]||(E[n]={}):(E[n]||{})[j],d=a?p:p[n]||(p[n]={}),v=d[j]||(d[j]={});for(s in a&&(r=n),r)i=((o=!u&&h&&void 0!==h[s])?h:r)[s],c=f&&o?y(i,E):l&&"function"==typeof i?y(Function.call,i):i,h&&P(h,s,i,e&t.U),d[s]!=i&&A(d,s,c),l&&v[s]!=i&&(v[s]=i)};E.core=p,M.F=1,M.G=2,M.S=4,M.P=8,M.B=16,M.W=32,M.U=64,M.R=128;var D=M,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=E.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?C.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,o,i=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=$(i);if(l&&(a=y(a,2<u?arguments[2]:void 0,2)),null!=h&&(c!=Array||(void 0===(o=h)||V.Array!==o&&B[q]!==o)))for(s=h.call(i),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(i.length));f<e;f++)z(n,f,l?a(i[f],f):i[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"),ot="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}(ot),"String",{includes:function(t){return!!~rt(this,t,ot).indexOf(t,1<arguments.length?arguments[1]:void 0)}});var it={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),i(this,"onFocus",function(){e._root.classList.add(e.constructor.cssClasses.ACTIVE)}),i(this,"onBlur",function(){e._root.classList.remove(e.constructor.cssClasses.ACTIVE)}),i(this,"onChange",function(){e.assignClasses()}),i(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 o(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 it}},{key:"strings",get:function(){return ct}}]),o(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}();i(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),i(this,"onMousedown",function(t){t.preventDefault(),e._inputElement.focus()}),i(this,"onFocus",function(){e._root.classList.add(e.constructor.cssClasses.ACTIVE)}),i(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 o(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)})}}]),o(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),o(e,null,[{key:"cssClasses",get:function(){return lt}},{key:"strings",get:function(){return ht.TEXT_FIELD}}]),e}();i(vt,"instances",new WeakMap);var yt=function(t){function e(){return s(this,e),f(this,a(e).apply(this,arguments))}return u(e,dt),o(e,null,[{key:"cssClasses",get:function(){return ft}},{key:"strings",get:function(){return ht.TEXT_AREA}}]),e}();i(yt,"instances",new WeakMap);var Et=function(){function r(t,e){var n=this;s(this,r),i(this,"onClick",function(){n.state.active=!n.state.active,n.assignClasses()}),i(this,"onSpace",function(t){"Space"!==t.code&&" "!==t.key||(n.state.active=!n.state.active,n.assignClasses())}),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 o(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"}}}]),o(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)}}]),r}();i(Et,"instances",new WeakMap);var pt=Object.freeze({Select:at,TextField:vt,TextArea:yt,Chip:Et});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=Et,t.Select=at,t.TextArea=yt,t.TextField=vt,t.settings={prefix:"ray-",breakpointsInPixels:{phone:0,tablet:600,desktop:1195}},t}({}); | ||
//# sourceMappingURL=ray-core.min.js.map |
@@ -69,3 +69,7 @@ import { CSS_CLASSES, STRINGS } from './constants'; | ||
this._inputElement.value = value; | ||
this._inputElement.dispatchEvent(new Event('change')); | ||
// IE11 fix: can't use new Event() | ||
const event = document.createEvent('HTMLEvents'); | ||
event.initEvent('change', true, true); | ||
this._inputElement.dispatchEvent(event); | ||
} | ||
@@ -72,0 +76,0 @@ |
@@ -128,5 +128,8 @@ (function (global, factory) { | ||
value: function set(value) { | ||
this._inputElement.value = value; | ||
this._inputElement.value = value; // IE11 fix: can't use new Event() | ||
this._inputElement.dispatchEvent(new Event('change')); | ||
var event = document.createEvent('HTMLEvents'); | ||
event.initEvent('change', true, true); | ||
this._inputElement.dispatchEvent(event); | ||
} | ||
@@ -133,0 +136,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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
684037
6492