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

essy-react-controls

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

essy-react-controls - npm Package Compare versions

Comparing version 1.0.24 to 1.0.25

2

index.js

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

module.exports=function(e){var t={};function a(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=6)}([function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("essy-util-ui")},function(e,t){e.exports=require("essy-util-misc")},function(e,t){e.exports=require("essy-react-icons")},function(e,t){e.exports=require("essy-react-hooks")},function(e,t,a){"use strict";a.r(t),a.d(t,"Button",(function(){return b})),a.d(t,"ButtonSplit",(function(){return f})),a.d(t,"Checkbox",(function(){return h})),a.d(t,"Input",(function(){return v})),a.d(t,"InputBasic",(function(){return g})),a.d(t,"SpikeLoader",(function(){return d})),a.d(t,"SpikeLoaderMask",(function(){return y})),a.d(t,"Toggle",(function(){return k}));var n=a(1),o=a.n(n),l=a(0),r=a.n(l),i=a(2),c=a(3),s=a(4);const u={small:8,medium:10,large:12};function d({small:e,medium:t,text:a,white:n}){const l=u[e?"small":t?"medium":"large"];return o.a.createElement("div",{className:Object(i.classNames)("erc-spike-loader",e&&"small",t&&"medium",n&&"white")},a.length?o.a.createElement("div",{className:"erc-spike-loader-text"},a):null,o.a.createElement("div",{className:"erc-spike-loader-icon"},Object(c.getArray)(l).map((e,t)=>o.a.createElement("div",{key:t}))))}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}function b({active:e,alt:t,arrow:a,block:n,border:l,btnRef:r,cancel:c,children:u,disabled:b,icon:p,iconSize:f,inverse:h,light:v,loading:g,minWidth:y,onClick:k,outline:x,secondary:N,small:E,text:C,warning:w}){const O={className:Object(i.classNames)("erc-btn",e&&"active",t&&"alt",a&&"arrow",n&&"block",l&&"border",c&&"cancel",h&&"inverse",v&&"light",void 0!==g&&"loader",x&&"outline",!t&&!N&&!w&&"primary",N&&"secondary",E&&"sm",y&&"min-width",w&&"warning"),disabled:b||g,onClick:k,...r&&{ref:r}};return o.a.createElement("button",O,function(){const e=[];if(g)return o.a.createElement(d,m({key:"0"},E?{small:E}:{medium:!0}));if(p){const t=f||(E?[12,12]:[16,16]);e.push(o.a.createElement(s.Icon,{key:"1",height:t[1],icon:p,width:t[0]}))}if(C)e.push(o.a.createElement("span",{key:"2",className:"text"},C));else if(u)return u;return e}())}d.defaultProps={medium:!1,small:!1,text:"",white:!1},d.propTypes={medium:r.a.bool,small:r.a.bool,text:r.a.string,white:r.a.bool},b.defaultProps={active:!1,alt:!1,arrow:!1,block:!1,border:!1,cancel:!1,disabled:!1,icon:!1,inverse:!1,light:!1,minWidth:!1,onClick:c.fnIdentity,outline:!1,secondary:!1,small:!1,warning:!1},b.propTypes={active:r.a.bool,alt:r.a.bool,arrow:r.a.bool,block:r.a.bool,border:r.a.bool,btnRef:r.a.object,cancel:r.a.bool,disabled:r.a.bool,icon:r.a.oneOfType([r.a.object,r.a.bool]),iconSize:r.a.array,inverse:r.a.bool,light:r.a.bool,loading:r.a.bool,minWidth:r.a.bool,onClick:r.a.func,outline:r.a.bool,secondary:r.a.bool,small:r.a.bool,text:r.a.string,warning:r.a.bool};var p=a(5);function f({disabled:e,disabledBtn:t,items:a,onClick:l,onClickItem:r,small:c,text:s}){const[u,d]=Object(n.useState)(!1),m=Object(n.useCallback)(()=>d(!1),[]);return Object(p.useEventListener)(document,"click",m,u),o.a.createElement("div",{className:Object(i.classNames)("erc-btn-split",c&&"sm")},o.a.createElement("div",{className:"btns"},o.a.createElement(b,{disabled:e||t,onClick:l,small:c,text:s}),o.a.createElement(b,{arrow:!0,onClick:()=>d(!u),small:c})),u&&o.a.createElement("div",{className:"erc-btn-split-menu"},a.map((e,t)=>o.a.createElement("div",{key:t,className:"erc-btn-split-item",onClick:()=>function(e,t){d(!1),r(e,t)}(e,t)},e))))}function h({checked:e,children:t,className:a,indeterminate:n,onChange:l}){return o.a.createElement("label",{className:Object(i.classNames)("erc-checkbox",a)},o.a.createElement("input",{className:"erc-checkbox-default",checked:e,onChange:e=>l(e.target.checked),ref:e=>e&&(e.indeterminate=!!n),type:"checkbox"}),o.a.createElement("span",{className:"erc-checkbox-custom"}),o.a.createElement("span",{className:"erc-checkbox-content"},t))}function v({autoComplete:e,disabled:t,invalid:a,label:l,note:r,onBlur:c,onChange:u,passwordShow:d,textarea:m,type:b,validator:p,value:f}){const[h,v]=Object(n.useState)(!1),[g,y]=Object(n.useState)(!1),k=l.replace(/\s/g,""),x={disabled:t,name:k,onBlur:()=>{v(!1),c()},onChange:e=>u(e.target.value),onFocus:()=>v(!0),type:g?"text":b,value:f,...!e&&{autoComplete:"off"}};return o.a.createElement("div",{className:Object(i.classNames)("erc-input",t&&"disabled",h&&"focused",a&&!h&&"invalid",m&&"textarea",f.length&&"value")},o.a.createElement("label",{htmlFor:k},l),m?o.a.createElement("textarea",x):o.a.createElement("input",x),d&&f.length?o.a.createElement("div",{className:"icon-wrap",onClick:()=>y(!g)},o.a.createElement(s.Icon,{className:g?"active":"inactive",height:20,icon:s.icons.EyeIcon,width:20})):null,!h&&o.a.createElement("div",{className:"invalid",dangerouslySetInnerHTML:{__html:a||"&nbsp;"}}),r.length?o.a.createElement("div",{className:"note"},r):null)}function g({autoComplete:e,disabled:t,invalid:a,note:l,onBlur:r,onChange:c,onKeyDown:s,placeholder:u,small:d,type:m,value:b}){const[p,f]=Object(n.useState)(!1),h={disabled:t,name:u?u.replace(/\s/g,""):"noname",onBlur:()=>{f(!1),r()},onChange:e=>c(e.target.value),onFocus:()=>f(!0),onKeyDown:s,type:m,value:b,...!e&&{autoComplete:"off"}};return o.a.createElement("div",{className:Object(i.classNames)("erc-input-basic",d&&"sm",a&&!p&&"invalid")},o.a.createElement("input",h),l.length?o.a.createElement("div",{className:"note"},l):null)}function y(e){return o.a.createElement("div",{className:"erc-spike-loader-mask"},o.a.createElement(d,e))}function k({disabled:e,error:t,on:a,onClick:n,text:l,white:r}){return o.a.createElement("div",{className:Object(i.classNames)("erc-toggle",a&&"on",t&&"error",r&&"white",e&&"disabled"),onClick:e?()=>{}:n},o.a.createElement("div",{className:"track"},o.a.createElement("div",{className:"knob"})),o.a.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:l}}))}f.defaultProps={disabled:!1,disabledBtn:!1,small:!1},f.propTypes={disabled:r.a.bool,disabledBtn:r.a.bool,items:r.a.array.isRequired,onClick:r.a.func.isRequired,onClickItem:r.a.func.isRequired,small:r.a.bool,text:r.a.string.isRequired},h.propTypes={checked:r.a.bool.isRequired,className:r.a.string,indeterminate:r.a.bool,onChange:r.a.func.isRequired},v.defaultProps={autoComplete:!0,disabled:!1,invalid:!1,note:"",onBlur:c.fnNoOp,passwordShow:!1,textarea:!1,type:"text",validator:c.fnNoOp},v.propTypes={autoComplete:r.a.bool,disabled:r.a.bool,invalid:r.a.oneOfType([r.a.bool,r.a.string]),label:r.a.string.isRequired,note:r.a.string,onBlur:r.a.func,onChange:r.a.func.isRequired,passwordShow:r.a.bool,textarea:r.a.bool,type:r.a.string,validator:r.a.func,value:r.a.string.isRequired},g.defaultProps={autoComplete:!0,disabled:!1,note:"",onBlur:c.fnNoOp,onKeyDown:c.fnNoOp,placeholder:"",type:"text"},g.propTypes={autoComplete:r.a.bool,disabled:r.a.bool,invalid:r.a.bool,note:r.a.string,onBlur:r.a.func,onChange:r.a.func.isRequired,onKeyDown:r.a.func,placeholder:r.a.string,small:r.a.bool,type:r.a.string,value:r.a.string.isRequired},k.defaultProps={disabled:!1,error:!1,on:!1,onClick:c.fnIdentity,text:"",white:!1},k.propTypes={disabled:r.a.bool,error:r.a.bool,on:r.a.bool,onClick:r.a.func,text:r.a.string,white:r.a.bool}}]);
module.exports=function(e){var t={};function a(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=6)}([function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("essy-util-ui")},function(e,t){e.exports=require("essy-util-misc")},function(e,t){e.exports=require("essy-react-icons")},function(e,t){e.exports=require("essy-react-hooks")},function(e,t,a){"use strict";a.r(t),a.d(t,"Button",(function(){return b})),a.d(t,"ButtonSplit",(function(){return f})),a.d(t,"Checkbox",(function(){return h})),a.d(t,"Input",(function(){return v})),a.d(t,"InputBasic",(function(){return g})),a.d(t,"SpikeLoader",(function(){return d})),a.d(t,"SpikeLoaderMask",(function(){return y})),a.d(t,"Toggle",(function(){return k}));var n=a(1),o=a.n(n),l=a(0),r=a.n(l),i=a(2),c=a(3),s=a(4);const u={small:8,medium:10,large:12};function d({small:e,medium:t,text:a,white:n}){const l=u[e?"small":t?"medium":"large"];return o.a.createElement("div",{className:Object(i.classNames)("erc-spike-loader",e&&"small",t&&"medium",n&&"white")},a.length?o.a.createElement("div",{className:"erc-spike-loader-text"},a):null,o.a.createElement("div",{className:"erc-spike-loader-icon"},Object(c.getArray)(l).map((e,t)=>o.a.createElement("div",{key:t}))))}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}function b({active:e,alt:t,arrow:a,block:n,border:l,btnRef:r,cancel:c,children:u,disabled:b,icon:p,iconSize:f,inverse:h,light:v,loading:g,minWidth:y,onClick:k,outline:x,secondary:E,small:N,text:C,warning:w}){const O={className:Object(i.classNames)("erc-btn",e&&"active",t&&"alt",a&&"arrow",n&&"block",l&&"border",c&&"cancel",h&&"inverse",v&&"light",void 0!==g&&"loader",x&&"outline",!t&&!E&&!w&&"primary",E&&"secondary",N&&"sm",y&&"min-width",w&&"warning"),disabled:b||g,onClick:k,...r&&{ref:r}};return o.a.createElement("button",O,function(){const e=[];if(g)return o.a.createElement(d,m({key:"0"},N?{small:N}:{medium:!0}));if(p){const t=f||(N?[12,12]:[16,16]);e.push(o.a.createElement(s.Icon,{key:"1",height:t[1],icon:p,width:t[0]}))}if(C)e.push(o.a.createElement("span",{key:"2",className:"text"},C));else if(u)return u;return e}())}d.defaultProps={medium:!1,small:!1,text:"",white:!1},d.propTypes={medium:r.a.bool,small:r.a.bool,text:r.a.string,white:r.a.bool},b.defaultProps={active:!1,alt:!1,arrow:!1,block:!1,border:!1,cancel:!1,disabled:!1,icon:!1,inverse:!1,light:!1,minWidth:!1,onClick:c.fnIdentity,outline:!1,secondary:!1,small:!1,warning:!1},b.propTypes={active:r.a.bool,alt:r.a.bool,arrow:r.a.bool,block:r.a.bool,border:r.a.bool,btnRef:r.a.object,cancel:r.a.bool,disabled:r.a.bool,icon:r.a.oneOfType([r.a.object,r.a.bool]),iconSize:r.a.array,inverse:r.a.bool,light:r.a.bool,loading:r.a.bool,minWidth:r.a.bool,onClick:r.a.func,outline:r.a.bool,secondary:r.a.bool,small:r.a.bool,text:r.a.string,warning:r.a.bool};var p=a(5);function f({disabled:e,disabledBtn:t,items:a,onClick:l,onClickItem:r,small:c,text:s}){const[u,d]=Object(n.useState)(!1),m=Object(n.useCallback)(()=>d(!1),[]);return Object(p.useEventListener)(document,"click",m,u),o.a.createElement("div",{className:Object(i.classNames)("erc-btn-split",c&&"sm")},o.a.createElement("div",{className:"btns"},o.a.createElement(b,{disabled:e||t,onClick:l,small:c,text:s}),o.a.createElement(b,{arrow:!0,onClick:()=>d(!u),small:c})),u&&o.a.createElement("div",{className:"erc-btn-split-menu"},a.map((e,t)=>o.a.createElement("div",{key:t,className:"erc-btn-split-item",onClick:()=>function(e,t){d(!1),r(e,t)}(e,t)},e))))}function h({checked:e,children:t,className:a,indeterminate:n,onChange:l}){return o.a.createElement("label",{className:Object(i.classNames)("erc-checkbox",a)},o.a.createElement("input",{className:"erc-checkbox-default",checked:e,onChange:e=>l(e.target.checked),ref:e=>e&&(e.indeterminate=!!n),type:"checkbox"}),o.a.createElement("span",{className:"erc-checkbox-custom"}),o.a.createElement("span",{className:"erc-checkbox-content"},t))}function v({autoComplete:e,disabled:t,invalid:a,label:l,note:r,onBlur:c,onChange:u,passwordShow:d,textarea:m,type:b,validator:p,value:f}){const[h,v]=Object(n.useState)(!1),[g,y]=Object(n.useState)(!1),k=l.replace(/\s/g,""),x={disabled:t,name:k,onBlur:()=>{v(!1),c()},onChange:e=>u(e.target.value),onFocus:()=>v(!0),type:g?"text":b,value:f,...!e&&{autoComplete:"off"}};return o.a.createElement("div",{className:Object(i.classNames)("erc-input",t&&"disabled",h&&"focused",a&&!h&&"invalid",m&&"textarea",f.length&&"value")},o.a.createElement("label",{htmlFor:k},l),m?o.a.createElement("textarea",x):o.a.createElement("input",x),d&&f.length?o.a.createElement("div",{className:"icon-wrap",onClick:()=>y(!g)},o.a.createElement(s.Icon,{className:g?"active":"inactive",height:20,icon:s.icons.EyeIcon,width:20})):null,!h&&o.a.createElement("div",{className:"invalid",dangerouslySetInnerHTML:{__html:a||"&nbsp;"}}),r.length?o.a.createElement("div",{className:"note"},r):null)}function g({autoComplete:e,disabled:t,invalid:a,note:l,onBlur:r,onChange:c,onKeyDown:s,placeholder:u,small:d,textarea:m,type:b,value:p}){const[f,h]=Object(n.useState)(!1),v={disabled:t,name:u?u.replace(/\s/g,""):"noname",onBlur:()=>{h(!1),r()},onChange:e=>c(e.target.value),onFocus:()=>h(!0),onKeyDown:s,type:b,value:p,...!e&&{autoComplete:"off"}};return o.a.createElement("div",{className:Object(i.classNames)("erc-input-basic",d&&"sm",a&&!f&&"invalid")},m?o.a.createElement("textarea",v):o.a.createElement("input",v),l.length?o.a.createElement("div",{className:"note"},l):null)}function y(e){return o.a.createElement("div",{className:"erc-spike-loader-mask"},o.a.createElement(d,e))}function k({disabled:e,error:t,on:a,onClick:n,text:l,white:r}){return o.a.createElement("div",{className:Object(i.classNames)("erc-toggle",a&&"on",t&&"error",r&&"white",e&&"disabled"),onClick:e?()=>{}:n},o.a.createElement("div",{className:"track"},o.a.createElement("div",{className:"knob"})),o.a.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:l}}))}f.defaultProps={disabled:!1,disabledBtn:!1,small:!1},f.propTypes={disabled:r.a.bool,disabledBtn:r.a.bool,items:r.a.array.isRequired,onClick:r.a.func.isRequired,onClickItem:r.a.func.isRequired,small:r.a.bool,text:r.a.string.isRequired},h.propTypes={checked:r.a.bool.isRequired,className:r.a.string,indeterminate:r.a.bool,onChange:r.a.func.isRequired},v.defaultProps={autoComplete:!0,disabled:!1,invalid:!1,note:"",onBlur:c.fnNoOp,passwordShow:!1,textarea:!1,type:"text",validator:c.fnNoOp},v.propTypes={autoComplete:r.a.bool,disabled:r.a.bool,invalid:r.a.oneOfType([r.a.bool,r.a.string]),label:r.a.string.isRequired,note:r.a.string,onBlur:r.a.func,onChange:r.a.func.isRequired,passwordShow:r.a.bool,textarea:r.a.bool,type:r.a.string,validator:r.a.func,value:r.a.string.isRequired},g.defaultProps={autoComplete:!0,disabled:!1,note:"",onBlur:c.fnNoOp,onKeyDown:c.fnNoOp,placeholder:"",type:"text"},g.propTypes={autoComplete:r.a.bool,disabled:r.a.bool,invalid:r.a.bool,note:r.a.string,onBlur:r.a.func,onChange:r.a.func.isRequired,onKeyDown:r.a.func,placeholder:r.a.string,small:r.a.bool,textarea:r.a.bool,type:r.a.string,value:r.a.string.isRequired},k.defaultProps={disabled:!1,error:!1,on:!1,onClick:c.fnIdentity,text:"",white:!1},k.propTypes={disabled:r.a.bool,error:r.a.bool,on:r.a.bool,onClick:r.a.func,text:r.a.string,white:r.a.bool}}]);
{
"name": "essy-react-controls",
"version": "1.0.24",
"version": "1.0.25",
"description": "React control components.",

@@ -5,0 +5,0 @@ "main": "index.js",

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