essy-react-controls
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -1,1 +0,1 @@ | ||
module.exports=function(e){var t={};function a(n){if(t[n])return t[n].exports;var l=t[n]={i:n,l:!1,exports:{}};return e[n].call(l.exports,l,l.exports,a),l.l=!0,l.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 l in e)a.d(n,l,function(t){return e[t]}.bind(null,l));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 u})),a.d(t,"ButtonIcon",(function(){return p})),a.d(t,"ButtonSplit",(function(){return v})),a.d(t,"Input",(function(){return g})),a.d(t,"SpikeLoader",(function(){return d})),a.d(t,"SpikeLoaderMask",(function(){return h})),a.d(t,"Toggle",(function(){return y}));var n=a(1),l=a.n(n),o=a(0),r=a.n(o),i=a(2),s=a(3);const c={small:8,medium:10,large:12};function d({small:e,medium:t,text:a,white:n}){const o=c[e?"small":t?"medium":"large"];return l.a.createElement("div",{className:Object(i.classNames)("erc-spike-loader",e&&"small",t&&"medium",n&&"white")},a.length?l.a.createElement("div",{className:"erc-spike-loader-text"},a):null,l.a.createElement("div",{className:"erc-spike-loader-icon"},Object(s.getArray)(o).map((e,t)=>l.a.createElement("div",{key:t}))))}function u({active:e,alt:t,arrow:a,block:n,cancel:o,children:r,disabled:s,icon:c,inverse:u,loading:m,minWidth:b,onClick:p,outline:f,secondary:v,small:g,text:h,warning:y}){return l.a.createElement("button",{className:Object(i.classNames)("erc-btn",e&&"active",t&&"alt",a&&"arrow",n&&"block",o&&"cancel",c&&"icon",u&&"inverse",void 0!==m&&"loader",f&&"outline",!t&&!c&&!v&&!y&&"primary",v&&"secondary",g&&"sm",b&&"min-width",y&&"warning"),disabled:s||m,onClick:p},m?l.a.createElement(d,g?{small:g}:{medium:!0}):a?null:h||r)}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},u.defaultProps={active:!1,alt:!1,arrow:!1,block:!1,cancel:!1,disabled:!1,icon:!1,inverse:!1,minWidth:!1,onClick:s.fnIdentity,outline:!1,secondary:!1,small:!1,warning:!1},u.propTypes={active:r.a.bool,alt:r.a.bool,arrow:r.a.bool,block:r.a.bool,cancel:r.a.bool,disabled:r.a.bool,icon:r.a.bool,inverse: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 m=a(4);const b=l.a.forwardRef(({active:e,disabled:t,height:a,icon:n,onClick:o,text:r,width:i},s)=>l.a.createElement("div",{className:"erc-btn-icon",ref:s},l.a.createElement(u,{active:e,disabled:t,icon:!0,onClick:o},l.a.createElement(m.Icon,{height:a,icon:n,text:r,width:i}))));var p=b;b.defaultProps={active:!1,disabled:!1,height:20,width:20},b.propTypes={active:r.a.bool,disabled:r.a.bool,height:r.a.number,icon:r.a.shape({fillRule:r.a.string,path:r.a.string.isRequired,transform:r.a.string,viewBox:r.a.string.isRequired}),onClick:r.a.func.isRequired,text:r.a.string,width:r.a.number};var f=a(5);function v({disabled:e,disabledBtn:t,items:a,onClick:o,onClickItem:r,small:s,text:c}){const[d,m]=Object(n.useState)(!1),b=Object(n.useCallback)(()=>m(!1),[]);return Object(f.useEventListener)(document,"click",b,d),l.a.createElement("div",{className:Object(i.classNames)("erc-btn-split",s&&"sm")},l.a.createElement("div",{className:"btns"},l.a.createElement(u,{disabled:e||t,onClick:o,small:s,text:c}),l.a.createElement(u,{arrow:!0,onClick:()=>m(!d),small:s})),d&&l.a.createElement("div",{className:"erc-btn-split-menu"},a.map((e,t)=>l.a.createElement("div",{key:t,className:"erc-btn-split-item",onClick:()=>function(e,t){m(!1),r(e,t)}(e,t)},e))))}function g({autoComplete:e,disabled:t,invalid:a,label:o,note:r,onBlur:s,onChange:c,passwordShow:d,textarea:u,type:b,validator:p,value:f}){const[v,g]=Object(n.useState)(!1),[h,y]=Object(n.useState)(!1),k=o.replace(/\s/g,""),x={disabled:t,name:k,onBlur:()=>{g(!1),s()},onChange:e=>c(e.target.value),onFocus:()=>g(!0),type:h?"text":b,value:f,...!e&&{autoComplete:"off"}};return l.a.createElement("div",{className:Object(i.classNames)("eri-input",t&&"disabled",v&&"focused",a&&!v&&"invalid",u&&"textarea",f.length&&"value")},l.a.createElement("label",{htmlFor:k},o),u?l.a.createElement("textarea",x):l.a.createElement("input",x),d&&f.length?l.a.createElement("div",{className:"icon-wrap",onClick:()=>y(!h)},l.a.createElement(m.Icon,{className:h?"active":"inactive",height:20,icon:m.icons.EyeIcon,width:20})):null,!v&&l.a.createElement("div",{className:"invalid",dangerouslySetInnerHTML:{__html:a||" "}}),r.length?l.a.createElement("div",{className:"note"},r):null)}function h(e){return l.a.createElement("div",{className:"erc-spike-loader-mask"},l.a.createElement(d,e))}function y({disabled:e,error:t,on:a,onClick:n,text:o,white:r}){return l.a.createElement("div",{className:Object(i.classNames)("erc-toggle",a&&"on",t&&"error",r&&"white",e&&"disabled"),onClick:e?()=>{}:n},l.a.createElement("div",{className:"track"},l.a.createElement("div",{className:"knob"})),l.a.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:o}}))}v.defaultProps={disabled:!1,disabledBtn:!1,small:!1},v.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},g.defaultProps={autoComplete:!0,disabled:!1,invalid:!1,note:"",onBlur:s.fnNoOp,passwordShow:!1,textarea:!1,type:"text",validator:s.fnNoOp,value:""},g.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},y.defaultProps={disabled:!1,error:!1,on:!1,onClick:s.fnIdentity,text:"",white:!1},y.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,"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,inverse:f,loading:v,minWidth:y,onClick:g,outline:h,secondary:k,small:x,text:E,warning:w}){const N={className:Object(i.classNames)("erc-btn",e&&"active",t&&"alt",a&&"arrow",n&&"block",r&&"border",s&&"cancel",f&&"inverse",void 0!==v&&"loader",h&&"outline",!t&&!k&&!w&&"primary",k&&"secondary",x&&"sm",y&&"min-width",w&&"warning"),disabled:b||v,onClick:g,...l&&{ref:l}};return o.a.createElement("button",N,function(){const e=[];if(v)return o.a.createElement(d,m({key:"0"},x?{small:x}:{medium:!0}));if(p){const t=x?[12,12]:[16,16];e.push(o.a.createElement(c.Icon,{key:"1",height:t[1],icon:p,width:t[2]}))}if(E)e.push(o.a.createElement("span",{key:"2",className:"text"},E));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]),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}}]); |
{ | ||
"name": "essy-react-controls", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"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
27517