essy-react-controls
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -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 d})),a.d(t,"ButtonIcon",(function(){return b})),a.d(t,"ButtonSplit",(function(){return f})),a.d(t,"Input",(function(){return v})),a.d(t,"SpikeLoader",(function(){return u})),a.d(t,"SpikeLoaderMask",(function(){return g})),a.d(t,"Toggle",(function(){return h}));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 u({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 d({active:e,alt:t,arrow:a,block:o,cancel:r,children:s,disabled:c,icon:d,inverse:m,loading:b,minWidth:p,onClick:f,outline:v,ref:g,secondary:h,small:y,text:k,warning:x}){const w=g||Object(n.useRef)();return l.a.createElement("button",{className:Object(i.classNames)("erc-btn",e&&"active",t&&"alt",a&&"arrow",o&&"block",r&&"cancel",d&&"icon",m&&"inverse",void 0!==b&&"loader",v&&"outline",!t&&!d&&!h&&!x&&"primary",h&&"secondary",y&&"sm",p&&"min-width",x&&"warning"),disabled:c||b,onClick:f,ref:w},b?l.a.createElement(u,y?{small:y}:{medium:!0}):a?null:k||s)}u.defaultProps={medium:!1,small:!1,text:"",white:!1},u.propTypes={medium:r.a.bool,small:r.a.bool,text:r.a.string,white:r.a.bool},d.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},d.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,ref:r.a.object,secondary:r.a.bool,small:r.a.bool,text:r.a.string,warning:r.a.bool};var m=a(4);function b({active:e,disabled:t,height:a,icon:n,onClick:o,ref:r,text:i,width:s}){return l.a.createElement(d,{active:e,disabled:t,icon:!0,onClick:o,ref:r},l.a.createElement(m.Icon,{height:a,icon:n,text:i,width:s}))}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,ref:r.a.object,text:r.a.string,width:r.a.number};var p=a(5);function f({disabled:e,disabledBtn:t,items:a,onClick:o,onClickItem:r,small:s,text:c}){const[u,m]=Object(n.useState)(!1),b=Object(n.useCallback)(()=>m(!1),[]);return Object(p.useEventListener)(document,"click",b,u),l.a.createElement("div",{className:Object(i.classNames)("erc-btn-split",s&&"sm")},l.a.createElement("div",{className:"btns"},l.a.createElement(d,{disabled:e||t,onClick:o,small:s,text:c}),l.a.createElement(d,{arrow:!0,onClick:()=>m(!u),small:s})),u&&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 v({autoComplete:e,disabled:t,invalid:a,label:o,note:r,onBlur:s,onChange:c,passwordShow:u,textarea:d,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",d&&"textarea",f.length&&"value")},l.a.createElement("label",{htmlFor:k},o),d?l.a.createElement("textarea",x):l.a.createElement("input",x),u&&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 g(e){return l.a.createElement("div",{className:"erc-spike-loader-mask"},l.a.createElement(u,e))}function h({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}}))}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},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: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},h.defaultProps={disabled:!1,error:!1,on:!1,onClick:s.fnIdentity,text:"",white:!1},h.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 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 d})),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 u})),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 u({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 d({active:e,alt:t,arrow:a,block:o,cancel:r,children:s,disabled:c,icon:d,inverse:m,loading:b,minWidth:p,onClick:f,outline:v,ref:g,secondary:h,small:y,text:k,warning:x}){const w=g||Object(n.useRef)();return l.a.createElement("button",{className:Object(i.classNames)("erc-btn",e&&"active",t&&"alt",a&&"arrow",o&&"block",r&&"cancel",d&&"icon",m&&"inverse",void 0!==b&&"loader",v&&"outline",!t&&!d&&!h&&!x&&"primary",h&&"secondary",y&&"sm",p&&"min-width",x&&"warning"),disabled:c||b,onClick:f,ref:w},b?l.a.createElement(u,y?{small:y}:{medium:!0}):a?null:k||s)}u.defaultProps={medium:!1,small:!1,text:"",white:!1},u.propTypes={medium:r.a.bool,small:r.a.bool,text:r.a.string,white:r.a.bool},d.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},d.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,ref:r.a.object,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(d,{active:e,disabled:t,icon:!0,onClick:o,ref:s},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,ref:r.a.object,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[u,m]=Object(n.useState)(!1),b=Object(n.useCallback)(()=>m(!1),[]);return Object(f.useEventListener)(document,"click",b,u),l.a.createElement("div",{className:Object(i.classNames)("erc-btn-split",s&&"sm")},l.a.createElement("div",{className:"btns"},l.a.createElement(d,{disabled:e||t,onClick:o,small:s,text:c}),l.a.createElement(d,{arrow:!0,onClick:()=>m(!u),small:s})),u&&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:u,textarea:d,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",d&&"textarea",f.length&&"value")},l.a.createElement("label",{htmlFor:k},o),d?l.a.createElement("textarea",x):l.a.createElement("input",x),u&&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(u,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}}]); |
{ | ||
"name": "essy-react-controls", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "React control components.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
27907