groundfloor-react-ui 1.3.8 → 1.3.10
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.
- package/dist/index.es.js +182 -178
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -501,8 +501,12 @@ ${({customStyles:e})=>e}
|
|
|
501
501
|
border-bottom-right-radius: ${({identity:e})=>"last-arrow"===e?"20px":0};
|
|
502
502
|
|
|
503
503
|
margin-left: ${({identity:e})=>"first-arrow"!==e?"-5px":0};
|
|
504
|
+
/* &:hover {
|
|
505
|
+
//your code
|
|
506
|
+
transform: scale(1.5);
|
|
507
|
+
} */
|
|
504
508
|
${({customShapeStyle:e})=>e}
|
|
505
|
-
`,we=({data:e,onClick:a,clickable:o,breakingPoint:r,breakingNumber:i,customShapeStyle:n})=>{const
|
|
509
|
+
`,we=({data:e,onClick:a,clickable:o,breakingPoint:r,breakingNumber:i,customShapeStyle:n,customShapeLabelStyle:c,customShapeValueStyle:d})=>{const s=l.useTheme()||H,[u,p]=t.useState(0),[f,m]=t.useState({next:!0,prev:!1}),[b,h]=t.useState(100),y=e.length,x=()=>{m(u-1==0?{next:!0,prev:!1}:{next:!0,prev:!0}),p((e=>e-1))},C=()=>{p((e=>e+1));let e=Math.ceil(100/b);m(y-e===u?{next:!1,prev:!0}:{next:!0,prev:!0})},{width:v}=ae();t.useEffect((()=>{A()}),[v]);const A=()=>{let e=0;switch(!0){case 1===y:e=100;break;case v<=576:e=85;break;case v<=r:e=50;break;case y<=i:e=100/y;break;case y>i&&v>r&&v<=900:e=Math.ceil(v/22);break;case y>i&&v>900&&v<=1020:e=Math.ceil(v/24);break;case y>i&&v>1020&&v<=1200:e=Math.ceil(v/27);break;case y>i&&v>1200&&v<=1440:e=Math.ceil(v/40);break;case y>i&&v>1440:let t=Math.ceil(v/85);e=t<=20?t:20;break;default:e=100}h(e)};return g.default.createElement(t.Fragment,null," ",y>0&&g.default.createElement(t.Fragment,null," ",g.default.createElement("div",{style:{display:y<=i||v<=r?"block":"flex",width:"100%",alignItems:"center",gap:"4px"}}," ",y>i&&v>r&&g.default.createElement(ge,{btnStyle:{backgroundColor:"transparent",padding:0,border:"none"},disabled:!f.prev,onClick:x},g.default.createElement(Q,{icon:"chevron-left",color:s.variant[f.prev?"primary-2":"neutral-3"],size:22,customstyles:{display:"flex",justifyContent:"center",alignItems:"center"}})),g.default.createElement("div",{style:{display:"flex",alignItems:"center",overflow:"hidden",width:"100%",justifyContent:"space-between"}},e.map(((t,l)=>g.default.createElement("div",{key:l,style:{scrollSnapAlign:"center",minWidth:`${b}%`,transform:`translateX(-${100*u}%)`,transition:"transform 0.5s ease-in-out"}},g.default.createElement("div",{style:{width:"100%",height:"100%"}},g.default.createElement(Ae,{customShapeStyle:n,identity:0===l?"first-arrow":e.length-1-l==0?"last-arrow":"others",backgroundColor:t?.backgroundColor,theme:s,clickable:o,onClick:()=>o?a(t):null},g.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px",minWidth:"100%",height:"100%"},title:`value: ${t.value}, status: ${t.label}`},g.default.createElement("span",{style:{fontSize:"22px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:t?.color?t.color:s.variant.white,...d}},t.value),g.default.createElement("span",{style:{fontSize:"14px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:t?.color?t.color:s.variant.white,...c}},t.label))))," ")))," ")," ",y>i&&v>r&&g.default.createElement(ge,{btnStyle:{backgroundColor:"transparent",padding:0,border:"none"},disabled:!f.next,onClick:C},g.default.createElement(Q,{icon:"chevron-right",color:s.variant[f.next?"primary-2":"neutral-3"],size:22,customstyles:{display:"flex",justifyContent:"center",alignItems:"center"}}))),v<=r&&e.length>1&&g.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",margin:"8px 0",gap:"16px"}}," ",g.default.createElement(ge,{btnStyle:{backgroundColor:"transparent",padding:"6px",border:".5px solid "+s.variant["neutral-4"],boxShadow:"-20px 5px 37px rgba(56, 66, 100, 0.0880136)"},disabled:!f.prev,onClick:x},g.default.createElement(Q,{icon:"chevron-left",color:s.variant[f.prev?"primary-2":"neutral-3"],size:10,customstyles:{display:"flex",justifyContent:"center",alignItems:"center"}})),g.default.createElement(ge,{btnStyle:{backgroundColor:"transparent",padding:"6px",border:".5px solid "+s.variant["neutral-4"],boxShadow:"-20px 5px 37px rgba(56, 66, 100, 0.0880136)"},disabled:!f.next,onClick:C},g.default.createElement(Q,{icon:"chevron-right",color:s.variant[f.next?"primary-2":"neutral-3"],size:10,customstyles:{display:"flex",justifyContent:"center",alignItems:"center"}})))))};we.propTypes={data:b.default.array,onClick:b.default.func,clickable:b.default.bool,breakingPoint:b.default.number,breakingNumber:b.default.number,customShapeStyle:b.default.object,customShapeLabelStyle:b.default.object,customShapeValueStyle:b.default.object},we.defaultProps={data:[],onClick:()=>null,clickable:!1,breakingPoint:768,breakingNumber:5,customShapeStyle:{},customShapeLabelStyle:{},customShapeValueStyle:{}};const Se=h.default.img`
|
|
506
510
|
//Set the styles from the default styles object
|
|
507
511
|
${({inBuiltCss:e,type:t,size:l,customStyles:a})=>{if(e){let o={};if(e[t]){for(const t in e.common)o[t]=e.common[t];for(const l in e[t])o[l]=e[t][l],delete e.common[l];for(const a in e[`${t}${l}`])o[a]=e[`${t}${l}`][a],delete e.common[a]}return{...o,...a}}}}
|
|
508
512
|
`,ke=({customStyles:e,type:l,size:a,alt:o,src:r,handleImageStatus:i,...n})=>{const[c,d]=t.useState("loading"),s=t.useRef(null),u=()=>{d("loaded"),i&&i("loaded")},p=()=>{d("failed"),i&&i("failed")};return t.useEffect((()=>{const e=s.current;if(e)return e.addEventListener("load",u),e.addEventListener("error",p),()=>{e.removeEventListener("load",u),e.removeEventListener("error",p)}}),[c]),g.default.createElement(Se,E({},n,{inBuiltCss:R,customStyles:e,type:l,alt:o,src:r,ref:s,size:a}))};ke.propTypes={customStyles:b.default.object,type:b.default.string,size:b.default.oneOf(["SM","MD","LG"]),alt:b.default.string,src:b.default.string,handleImageStatus:b.default.func},ke.defaultProps={customStyles:{},type:"image",alt:"image alternative",src:null,handleImageStatus:null};const Ee=h.default.span`
|
|
@@ -1331,7 +1335,7 @@ cursor: ${({isDisabled:e})=>e?"not-allowed":"pointer"};
|
|
|
1331
1335
|
margin-top: -15.5px;
|
|
1332
1336
|
cursor: pointer;
|
|
1333
1337
|
line-height: normal !important;
|
|
1334
|
-
`,Dt=({getValue:e,children:t,...l})=>{const a=e().length;return g.default.createElement(c.components.ValueContainer,E({"data-accordion":"contentClickFalse"},l),g.default.createElement("span",{"data-accordion":"contentClickFalse"}),t,a>1&&g.default.createElement("span",{className:"text-more-alt"},"& ",a-1," more"))},Ot=({label:e,labelStyle:
|
|
1338
|
+
`,Dt=({getValue:e,children:t,...l})=>{const a=e().length;return g.default.createElement(c.components.ValueContainer,E({"data-accordion":"contentClickFalse"},l),g.default.createElement("span",{"data-accordion":"contentClickFalse"}),t,a>1&&g.default.createElement("span",{className:"text-more-alt"},"& ",a-1," more"))},Ot=({label:e,labelStyle:a,optionArr:o,selectedValue:r,setSelectedValue:i,placeHolder:n,isClearable:d,isValid:s,height:u,fontSize:p,loadOptions:f,onInputChange:m,clearSelected:b,customWrapperStyles:h,customLabelStyles:y,isRequired:x,dropdownType:C,isDisabled:v,isLoading:A,id:w,iconName:S,iconStyles:k,iconColor:V,iconSize:M,showIndicator:z,leftIcon:B,leftIconColor:L,leftIconSize:I,backgroundColor:P,placeHolderColor:W,indicatorBackgroundColor:T,inputColor:F,menuListFooter:j,customSelectStyles:q,errorMessage:Z,maximumSelectOptionLimit:D,maximumSelectOptionLimitMessage:O,...G})=>{const X=l.useTheme()||H,J=e=>{const t={width:"15px",height:"15px",borderRadius:"2px",padding:"4px",fontSize:"8px",lineHeight:"10px",minWidth:"15px",minHeight:"15px",boxSizing:"content-box"},l=g.default.createElement("div",{style:{...t,backgroundColor:e?.data?.color??X.primary["primary-1"]}},g.default.createElement(Q,{icon:"check-icon",color:"white"})),a=g.default.createElement("div",{style:{...t,backgroundColor:"#e0e7ff"}});return console.log(e),g.default.createElement(c.components.Option,e,g.default.createElement("div",{"data-accordion":"contentClickFalse",style:{display:"flex",justifyContent:"flex-start",alignItems:"center",width:"100%"}},"further-details"!==e.value&&(e.isSelected?l:a),g.default.createElement("div",{className:"text-main-alt","data-accordion":"contentClickFalse",style:{marginLeft:"10px"}},e.label)))},U=({index:e,...t})=>{const l=t?.data?.label||"Select";return!e&&g.default.createElement("span",{className:"text-main-alt-value"},l)},Y={control:(e,t)=>({...e,border:s?P&&s?"1px solid "+P:"1px solid "+X.border:"1px solid "+X.ui.error,minWidth:"singleSelect"===C||"asyncSingleSelect"===C?"120px":"185px",height:`${u}px`,minHeight:`${u}px`,boxShadow:(t.isSelected||t.isFocused)&&"none",backgroundColor:t.isDisabled?X.variant["neutral-5"]:P||X.additional.white}),placeholder:e=>({...e,fontSize:p+"px",marginLeft:"0px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",width:"auto",maxWidth:"89%",marginRight:"0px",color:W||"hsl(0, 0%, 50%)"}),dropdownIndicator:e=>({...e,height:`${u}px`,display:"flex",justifyContent:"center",alignItems:"center",paddingLeft:"2px",backgroundColor:T||"transparent",borderBottomLeftRadius:"0",borderBottomRightRadius:"4.32px",borderTopLeftRadius:0,borderTopRightRadius:"4.32px",position:"relative",top:"-1px",right:"-1px"}),clearIndicator:e=>({...e,height:`${u}px`,display:"flex",justifyContent:"center",alignItems:"center",paddingLeft:"0px"}),valueContainer:e=>({...e,fontSize:p+"px",marginTop:"-4px"}),indicatorsContainer:e=>({...e,padding:0}),menu:e=>({...e,border:"none",marginTop:"1px",borderTopRightRadius:"0px",borderTopLeftRadius:"0px",outline:"none",boxShadow:"0px 6px 20px rgba(56, 66, 100, 0.15)",borderRadius:"4.32px",fontSize:p+"px",width:"100%",minWidth:"singleSelect"===C||"asyncSingleSelect"===C?"120px":"185px"}),singleValue:e=>({...e,fontSize:p+"px",marginLeft:"0px",width:"auto",marginRight:0,display:"grid"}),multiValue:e=>({...e,marginLeft:"0px",width:"auto",display:"grid"}),input:e=>({...e,fontSize:p+"px",color:F||"hsl(0, 0%, 20%)",padding:0,margin:0}),option:(e,t)=>({...e,backgroundColor:t.isSelected||t.isFocused?X.neutral["neutral-5"]:X.additional.white,padding:"10px",cursor:t.isDisabled?"not-allowed":"pointer",color:"#081348",opacity:t.isDisabled?.6:1,width:"inherit",boxSizing:"initial"}),menuPortal:e=>({...e,zIndex:99999999}),...q},N={DropdownIndicator:e=>{const t=g.default.createElement(c.components.DropdownIndicator,e,g.default.createElement(Zt,{"data-accordion":"contentClickFalse"},g.default.createElement(Q,{icon:S,color:V,size:M,customstyles:k,"data-accordion":"contentClickFalse"})));return!0===z?t:null},ValueContainer:Dt,IndicatorSeparator:()=>null,ClearIndicator:e=>g.default.createElement(c.components.ClearIndicator,e,d?g.default.createElement(Zt,{onClick:()=>{b(),e.clearValue()},"data-accordion":"contentClickFalse"},g.default.createElement(Q,{icon:"cross-icon",color:"black",size:8,"data-accordion":"contentClickFalse"})):null),MenuList:e=>{const{MenuListHeader:l=null,MenuListFooter:a=null}=e.selectProps.components,o=e.getValue().length||0;return g.default.createElement(c.components.MenuList,E({},e,{"data-accordion":"contentClickFalse"}),o<D?g.default.createElement(t.Fragment,null,e.children.length&&l,e.children,e.children.length&&a):g.default.createElement("div",{style:{margin:15}},O))},MenuListFooter:j};let K=null;switch(C){case"multiSelect":K=g.default.createElement(Gt,E({type:"multiSelect",MultiValue:U,Option:J,value:r,CommonRenderedComponent:N,optionArr:o,placeHolder:n,isDisabled:v,stylesComp:Y,setSelectedValue:i,isLoading:A,id:w,isClearable:d},G));break;case"asyncSingleSelect":K=g.default.createElement(Xt,E({CommonRenderedComponent:N,loadOptions:f,onInputChange:m,styles:Y,placeholder:n,onChange:i,isLoading:A,isDisabled:v,id:w,value:r,isClearable:d},G));break;case"asyncMultiSelect":K=g.default.createElement(Xt,E({type:"asyncMultiSelect",CommonRenderedComponent:N,MultiValue:U,Option:J,onChange:i,placeholder:n,styles:Y,isDisabled:v,isLoading:A,loadOptions:f,onInputChange:m,id:w,isClearable:d,value:r},G));break;default:K=g.default.createElement(Gt,E({type:"singleSelect",value:{value:r?r.value:"",label:r?r.label:""},CommonRenderedComponent:N,optionArr:o,placeHolder:n,isDisabled:v,stylesComp:Y,setSelectedValue:i,isLoading:A,id:w,isClearable:d},G))}return g.default.createElement(jt,{style:h,backgroundColor:P,isValid:s,fontSize:p,theme:X,isDisabled:v},e&&g.default.createElement(qt,{inBuiltCss:R,labelWrapperStyle:"selectComp-label-wrapper",style:y},g.default.createElement($e,{customStyles:a,type:"label-text",text:e,style:{marginBottom:"8px",paddingBottom:"0px"}}),x&&g.default.createElement("div",{style:{marginLeft:"4px",color:`${X.ui.error}`}},"*")),K,!s&&Z)},Gt=({type:e,Option:t,value:l,CommonRenderedComponent:a,MultiValue:o,optionArr:r,placeHolder:i,isDisabled:n,stylesComp:c,setSelectedValue:d,isLoading:s,id:u,isClearable:p,...f})=>{let m={...a};return"multiSelect"===e&&(m.MultiValue=o,m.Option=t),g.default.createElement(v.default,E({className:"select-manage-page contentClickFalse",classNamePrefix:"new-select",name:"select-dropdown",components:m,options:r,placeholder:i,isDisabled:n,value:l,styles:c,onChange:d,isLoading:s,id:u,isClearable:p,isMulti:"multiSelect"===e,hideSelectedOptions:!1,closeMenuOnSelect:"multiSelect"!==e,menuShouldScrollIntoView:!1,"data-accordion":"contentClickFalse"},f))},Xt=({CommonRenderedComponent:e,MultiValue:t,Option:l,type:a,id:o,styles:r,...i})=>{let n={...e};return"asyncMultiSelect"===a&&(n.MultiValue=t,n.Option=l),g.default.createElement(A.default,E({className:"select-manage-page contentClickFalse ",classNamePrefix:"new-select",name:"select-dropdown",components:n,isMulti:"asyncMultiSelect"===a,defaultOptions:!0,hideSelectedOptions:!1,closeMenuOnSelect:"asyncMultiSelect"!==a,isSearchable:!0,styles:r,menuShouldScrollIntoView:!1,"data-accordion":"contentClickFalse",id:o},i))};Ot.propTypes={label:b.default.string,labelStyle:b.default.object,optionArr:b.default.array,selectedValue:b.default.object,setSelectedValue:b.default.func,placeHolder:b.default.string,fontSize:b.default.number,clearSelected:b.default.func,loadOptions:b.default.func,onInputChange:b.default.func,customWrapperStyles:b.default.object,customLabelStyles:b.default.object,isRequired:b.default.bool,dropdownType:b.default.string,isDisabled:b.default.bool,isLoading:b.default.bool,isValid:b.default.bool,height:b.default.number,isClearable:b.default.bool,id:b.default.string,iconName:b.default.string,iconColor:b.default.string,iconSize:b.default.number,leftIcon:b.default.string,leftIconColor:b.default.string,leftIconSize:b.default.number,showIndicator:b.default.bool,backgroundColor:b.default.string,placeHolderColor:b.default.string,inputColor:b.default.string,menuListFooter:b.default.any,customSelectStyles:b.default.object,maximumSelectOptionLimit:b.default.number,maximumSelectOptionLimitMessage:b.default.string},Ot.defaultProps={label:"",labelStyle:{},optionArr:[],selectedValue:{},setSelectedValue:void 0,placeHolder:"Select an option",isValid:!0,isClearable:!1,height:31,fontSize:14,loadOptions:()=>{},onInputChange:()=>{},clearSelected:()=>{},customWrapperStyles:{},customLabelStyles:{},isRequired:!1,dropdownType:"singleSelect",isDisabled:!1,isLoading:!1,id:"",iconName:"triangle-down",iconColor:"black",iconSize:8,leftIcon:"",leftIconColor:"black",leftIconSize:10,showIndicator:!0,customSelectStyles:{},maximumSelectOptionLimit:1e4,maximumSelectOptionLimitMessage:"Max limit achieved"};const Jt=h.default.div`
|
|
1335
1339
|
//Set the styles from the default styles object
|
|
1336
1340
|
${({inBuiltCss:e,defaultStyles:t})=>P(e,t)}
|
|
1337
1341
|
|