essy-react-controls
Advanced tools
Comparing version 1.0.13 to 1.0.14
@@ -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,"Input",(function(){return v})),a.d(t,"SpikeLoader",(function(){return d})),a.d(t,"SpikeLoaderMask",(function(){return y})),a.d(t,"Toggle",(function(){return g}));var n=a(1),o=a.n(n),r=a(0),l=a.n(r),i=a(2),s=a(3),c=a(4);const u={small:8,medium:10,large:12};function d({small:e,medium:t,text:a,white:n}){const r=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(s.getArray)(r).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:r,btnRef:l,cancel:s,children:u,disabled:b,icon:p,iconSize:f,inverse:v,loading:y,minWidth:g,onClick:h,outline:k,secondary:x,small:E,text:w,warning:N}){const O={className:Object(i.classNames)("erc-btn",e&&"active",t&&"alt",a&&"arrow",n&&"block",r&&"border",s&&"cancel",v&&"inverse",void 0!==y&&"loader",k&&"outline",!t&&!x&&!N&&"primary",x&&"secondary",E&&"sm",g&&"min-width",N&&"warning"),disabled:b||y,onClick:h,...l&&{ref:l}};return o.a.createElement("button",O,function(){const e=[];if(y)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(c.Icon,{key:"1",height:t[1],icon:p,width:t[0]}))}if(w)e.push(o.a.createElement("span",{key:"2",className:"text"},w));else if(u)return u;return e}())}d.defaultProps={medium:!1,small:!1,text:"",white:!1},d.propTypes={medium:l.a.bool,small:l.a.bool,text:l.a.string,white:l.a.bool},b.defaultProps={active:!1,alt:!1,arrow:!1,block:!1,border:!1,cancel:!1,disabled:!1,icon:!1,inverse:!1,minWidth:!1,onClick:s.fnIdentity,outline:!1,secondary:!1,small:!1,warning:!1},b.propTypes={active:l.a.bool,alt:l.a.bool,arrow:l.a.bool,block:l.a.bool,border:l.a.bool,btnRef:l.a.object,cancel:l.a.bool,disabled:l.a.bool,icon:l.a.oneOfType([l.a.object,l.a.bool]),iconSize:l.a.array,inverse:l.a.bool,loading:l.a.bool,minWidth:l.a.bool,onClick:l.a.func,outline:l.a.bool,secondary:l.a.bool,small:l.a.bool,text:l.a.string,warning:l.a.bool};var p=a(5);function f({disabled:e,disabledBtn:t,items:a,onClick:r,onClickItem:l,small:s,text:c}){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",s&&"sm")},o.a.createElement("div",{className:"btns"},o.a.createElement(b,{disabled:e||t,onClick:r,small:s,text:c}),o.a.createElement(b,{arrow:!0,onClick:()=>d(!u),small:s})),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),l(e,t)}(e,t)},e))))}function v({autoComplete:e,disabled:t,invalid:a,label:r,note:l,onBlur:s,onChange:u,passwordShow:d,textarea:m,type:b,validator:p,value:f}){const[v,y]=Object(n.useState)(!1),[g,h]=Object(n.useState)(!1),k=r.replace(/\s/g,""),x={disabled:t,name:k,onBlur:()=>{y(!1),s()},onChange:e=>u(e.target.value),onFocus:()=>y(!0),type:g?"text":b,value:f,...!e&&{autoComplete:"off"}};return o.a.createElement("div",{className:Object(i.classNames)("eri-input",t&&"disabled",v&&"focused",a&&!v&&"invalid",m&&"textarea",f.length&&"value")},o.a.createElement("label",{htmlFor:k},r),m?o.a.createElement("textarea",x):o.a.createElement("input",x),d&&f.length?o.a.createElement("div",{className:"icon-wrap",onClick:()=>h(!g)},o.a.createElement(c.Icon,{className:g?"active":"inactive",height:20,icon:c.icons.EyeIcon,width:20})):null,!v&&o.a.createElement("div",{className:"invalid",dangerouslySetInnerHTML:{__html:a||" "}}),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 g({disabled:e,error:t,on:a,onClick:n,text:r,white:l}){return o.a.createElement("div",{className:Object(i.classNames)("erc-toggle",a&&"on",t&&"error",l&&"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:r}}))}f.defaultProps={disabled:!1,disabledBtn:!1,small:!1},f.propTypes={disabled:l.a.bool,disabledBtn:l.a.bool,items:l.a.array.isRequired,onClick:l.a.func.isRequired,onClickItem:l.a.func.isRequired,small:l.a.bool,text:l.a.string.isRequired},v.defaultProps={autoComplete:!0,disabled:!1,invalid:!1,note:"",onBlur:s.fnNoOp,passwordShow:!1,textarea:!1,type:"text",validator:s.fnNoOp,value:""},v.propTypes={autoComplete:l.a.bool,disabled:l.a.bool,invalid:l.a.oneOfType([l.a.bool,l.a.string]),label:l.a.string.isRequired,note:l.a.string,onBlur:l.a.func,onChange:l.a.func.isRequired,passwordShow:l.a.bool,textarea:l.a.bool,type:l.a.string,validator:l.a.func,value:l.a.string.isRequired},g.defaultProps={disabled:!1,error:!1,on:!1,onClick:s.fnIdentity,text:"",white:!1},g.propTypes={disabled:l.a.bool,error:l.a.bool,on:l.a.bool,onClick:l.a.func,text:l.a.string,white:l.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,"Input",(function(){return v})),a.d(t,"SpikeLoader",(function(){return d})),a.d(t,"SpikeLoaderMask",(function(){return y})),a.d(t,"Toggle",(function(){return g}));var n=a(1),o=a.n(n),r=a(0),l=a.n(r),i=a(2),s=a(3),c=a(4);const u={small:8,medium:10,large:12};function d({small:e,medium:t,text:a,white:n}){const r=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(s.getArray)(r).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:r,btnRef:l,cancel:s,children:u,disabled:b,icon:p,iconSize:f,inverse:v,light:y,loading:g,minWidth:h,onClick:k,outline:x,secondary:E,small:w,text:N,warning:O}){const C={className:Object(i.classNames)("erc-btn",e&&"active",t&&"alt",a&&"arrow",n&&"block",r&&"border",s&&"cancel",v&&"inverse",y&&"light",void 0!==g&&"loader",x&&"outline",!t&&!E&&!O&&"primary",E&&"secondary",w&&"sm",h&&"min-width",O&&"warning"),disabled:b||g,onClick:k,...l&&{ref:l}};return o.a.createElement("button",C,function(){const e=[];if(g)return o.a.createElement(d,m({key:"0"},w?{small:w}:{medium:!0}));if(p){const t=f||(w?[12,12]:[16,16]);e.push(o.a.createElement(c.Icon,{key:"1",height:t[1],icon:p,width:t[0]}))}if(N)e.push(o.a.createElement("span",{key:"2",className:"text"},N));else if(u)return u;return e}())}d.defaultProps={medium:!1,small:!1,text:"",white:!1},d.propTypes={medium:l.a.bool,small:l.a.bool,text:l.a.string,white:l.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:s.fnIdentity,outline:!1,secondary:!1,small:!1,warning:!1},b.propTypes={active:l.a.bool,alt:l.a.bool,arrow:l.a.bool,block:l.a.bool,border:l.a.bool,btnRef:l.a.object,cancel:l.a.bool,disabled:l.a.bool,icon:l.a.oneOfType([l.a.object,l.a.bool]),iconSize:l.a.array,inverse:l.a.bool,light:l.a.bool,loading:l.a.bool,minWidth:l.a.bool,onClick:l.a.func,outline:l.a.bool,secondary:l.a.bool,small:l.a.bool,text:l.a.string,warning:l.a.bool};var p=a(5);function f({disabled:e,disabledBtn:t,items:a,onClick:r,onClickItem:l,small:s,text:c}){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",s&&"sm")},o.a.createElement("div",{className:"btns"},o.a.createElement(b,{disabled:e||t,onClick:r,small:s,text:c}),o.a.createElement(b,{arrow:!0,onClick:()=>d(!u),small:s})),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),l(e,t)}(e,t)},e))))}function v({autoComplete:e,disabled:t,invalid:a,label:r,note:l,onBlur:s,onChange:u,passwordShow:d,textarea:m,type:b,validator:p,value:f}){const[v,y]=Object(n.useState)(!1),[g,h]=Object(n.useState)(!1),k=r.replace(/\s/g,""),x={disabled:t,name:k,onBlur:()=>{y(!1),s()},onChange:e=>u(e.target.value),onFocus:()=>y(!0),type:g?"text":b,value:f,...!e&&{autoComplete:"off"}};return o.a.createElement("div",{className:Object(i.classNames)("eri-input",t&&"disabled",v&&"focused",a&&!v&&"invalid",m&&"textarea",f.length&&"value")},o.a.createElement("label",{htmlFor:k},r),m?o.a.createElement("textarea",x):o.a.createElement("input",x),d&&f.length?o.a.createElement("div",{className:"icon-wrap",onClick:()=>h(!g)},o.a.createElement(c.Icon,{className:g?"active":"inactive",height:20,icon:c.icons.EyeIcon,width:20})):null,!v&&o.a.createElement("div",{className:"invalid",dangerouslySetInnerHTML:{__html:a||" "}}),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 g({disabled:e,error:t,on:a,onClick:n,text:r,white:l}){return o.a.createElement("div",{className:Object(i.classNames)("erc-toggle",a&&"on",t&&"error",l&&"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:r}}))}f.defaultProps={disabled:!1,disabledBtn:!1,small:!1},f.propTypes={disabled:l.a.bool,disabledBtn:l.a.bool,items:l.a.array.isRequired,onClick:l.a.func.isRequired,onClickItem:l.a.func.isRequired,small:l.a.bool,text:l.a.string.isRequired},v.defaultProps={autoComplete:!0,disabled:!1,invalid:!1,note:"",onBlur:s.fnNoOp,passwordShow:!1,textarea:!1,type:"text",validator:s.fnNoOp,value:""},v.propTypes={autoComplete:l.a.bool,disabled:l.a.bool,invalid:l.a.oneOfType([l.a.bool,l.a.string]),label:l.a.string.isRequired,note:l.a.string,onBlur:l.a.func,onChange:l.a.func.isRequired,passwordShow:l.a.bool,textarea:l.a.bool,type:l.a.string,validator:l.a.func,value:l.a.string.isRequired},g.defaultProps={disabled:!1,error:!1,on:!1,onClick:s.fnIdentity,text:"",white:!1},g.propTypes={disabled:l.a.bool,error:l.a.bool,on:l.a.bool,onClick:l.a.func,text:l.a.string,white:l.a.bool}}]); |
{ | ||
"name": "essy-react-controls", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "React control components.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
27956