@corva/ui 0.26.0-10 → 0.26.0-11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=function(o,r,t){return 100*(o-r)/(t-r)},r=function(o,r,t){return o*(t-r)/100},t=function(o,r,t,n,f){return o<n?{from:n,to:t}:o>t-f?{from:t-f,to:t}:{from:o,to:t}},n=function(o,r,t,n,f){return o>n?{from:r,to:n}:o<r+f?{from:r,to:r+f}:{from:r,to:o}};export{o as calculatePercentForValue,r as calculateValueFromPercent,t as updateFromValue,n as updateToValue};
|
|
1
|
+
var o=function(o,r,t){return 100*(o-r)/(t-r)},r=function(o,r,t){return r+o*(t-r)/100},t=function(o,r,t,n,f){return o<n?{from:n,to:t}:o>t-f?{from:t-f,to:t}:{from:o,to:t}},n=function(o,r,t,n,f){return o>n?{from:r,to:n}:o<r+f?{from:r,to:r+f}:{from:r,to:o}};export{o as calculatePercentForValue,r as calculateValueFromPercent,t as updateFromValue,n as updateToValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{withStyles as l,Grid as t,Typography as r,Switch as
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{withStyles as l,Grid as t,Typography as r,Switch as o}from"@material-ui/core";import{forwardRef as s}from"react";import c from"prop-types";import n from"classnames";import d from"./style.css.js";var b=s((function(l,s){var c,b,m=l.title,p=l.leftLabel,h=l.rightLabel,f=l.checked,g=l.onChange,u=l.disabled,L=l.classes,D=l.size,k=l.className,w=p&&h;return a("div",{className:k,children:[m&&i("div",{className:d.switchControlTitle,children:m}),a(t,{component:"label",container:!0,alignItems:"center",spacing:0,children:[p&&i(t,{item:!0,children:i(r,{variant:"body2",className:n(L.label,"small"===D&&L.labelSmall,!f&&!u&&L.activeLabel,u&&L.disabledLabel),children:p})}),i(t,{item:!0,children:i(o,{ref:s,checked:f,onChange:g,color:"primary",disabled:u,classes:{root:L.root,switchBase:n((c={},e(c,L.switchBase,w||f&&!u),e(c,L.switchBaseDisabled,u&&(w||f)),e(c,L.switchBaseDisabledNoLabels,!w&&u&&!f),c)),track:n((b={},e(b,L.track,w||f&&!u),e(b,L.trackDisabled,u&&(w||f)),e(b,L.trackDisabledNoLabels,!w&&u&&!f),b))},size:D})}),h&&i(t,{item:!0,children:i(r,{variant:"body2",className:n(L.label,"small"===D&&L.labelSmall,f&&!u&&L.activeLabel,u&&L.disabledLabel),children:h})})]})]})}));b.propTypes={title:c.string,leftLabel:c.string,rightLabel:c.string,checked:c.bool.isRequired,onChange:c.func.isRequired,disabled:c.bool,classes:c.shape({}).isRequired,size:c.string,className:c.string},b.defaultProps={title:"",leftLabel:"",rightLabel:"",disabled:!1,size:"medium",className:""};var m=l({root:{width:60,height:40,padding:13,"&.MuiSwitch-sizeSmall":{width:52,height:36,padding:13},"& .MuiSwitch-switchBase":{padding:10}},switchBase:{padding:10,color:"#03BCD4"},switchBaseDisabled:{color:"#196069 !important"},track:{backgroundColor:"#196069 !important",opacity:"1 !important",border:"none"},trackDisabled:{backgroundColor:"#223D40 !important",opacity:"1 !important",border:"none"},switchBaseDisabledNoLabels:{color:"#545454 !important"},trackDisabledNoLabels:{backgroundColor:"#3D3D3D !important",opacity:"1 !important",border:"none"},label:{display:"flex",justifyContent:"center",flexDirection:"column",fontSize:"16px",lineHeight:"22px",color:"#bdbdbd",margin:"8px 0px",cursor:"pointer"},labelSmall:{fontSize:"14px",lineHeight:"20px"},disabledLabel:{cursor:"default",color:"#616161"},activeLabel:{color:"#ffffff"}})(b);export default m;
|