groundfloor-react-ui 1.3.8 → 1.3.9
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 +5 -1
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/index.es.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
|
-
`,Ve=({data:e,onClick:l,clickable:o,breakingPoint:n,breakingNumber:c,customShapeStyle:s})=>{const
|
|
509
|
+
`,Ve=({data:e,onClick:l,clickable:o,breakingPoint:n,breakingNumber:c,customShapeStyle:s,customShapeLabelStyle:d,customShapeValueStyle:p})=>{const m=b()||R,[u,g]=i(0),[f,h]=i({next:!0,prev:!1}),[y,x]=i(100),C=e.length,v=()=>{h(u-1==0?{next:!0,prev:!1}:{next:!0,prev:!0}),g((e=>e-1))},A=()=>{g((e=>e+1));let e=Math.ceil(100/y);h(C-e===u?{next:!1,prev:!0}:{next:!0,prev:!0})},{width:w}=ae();r((()=>{S()}),[w]);const S=()=>{let e=0;switch(!0){case 1===C:e=100;break;case w<=576:e=85;break;case w<=n:e=50;break;case C<=c:e=100/C;break;case C>c&&w>n&&w<=900:e=Math.ceil(w/22);break;case C>c&&w>900&&w<=1020:e=Math.ceil(w/24);break;case C>c&&w>1020&&w<=1200:e=Math.ceil(w/27);break;case C>c&&w>1200&&w<=1440:e=Math.ceil(w/40);break;case C>c&&w>1440:let t=Math.ceil(w/85);e=t<=20?t:20;break;default:e=100}x(e)};return t.createElement(a,null," ",C>0&&t.createElement(a,null," ",t.createElement("div",{style:{display:C<=c||w<=n?"block":"flex",width:"100%",alignItems:"center",gap:"4px"}}," ",C>c&&w>n&&t.createElement(Ce,{btnStyle:{backgroundColor:"transparent",padding:0,border:"none"},disabled:!f.prev,onClick:v},t.createElement(_,{icon:"chevron-left",color:m.variant[f.prev?"primary-2":"neutral-3"],size:22,customstyles:{display:"flex",justifyContent:"center",alignItems:"center"}})),t.createElement("div",{style:{display:"flex",alignItems:"center",overflow:"hidden",width:"100%",justifyContent:"space-between"}},e.map(((i,r)=>t.createElement("div",{key:r,style:{scrollSnapAlign:"center",minWidth:`${y}%`,transform:`translateX(-${100*u}%)`,transition:"transform 0.5s ease-in-out"}},t.createElement("div",{style:{width:"100%",height:"100%"}},t.createElement(Ee,{customShapeStyle:s,identity:0===r?"first-arrow":e.length-1-r==0?"last-arrow":"others",backgroundColor:i?.backgroundColor,theme:m,clickable:o,onClick:()=>o?l(i):null},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px",minWidth:"100%",height:"100%"},title:`value: ${i.value}, status: ${i.label}`},t.createElement("span",{style:{fontSize:"22px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:i?.color?i.color:m.variant.white,...p}},i.value),t.createElement("span",{style:{fontSize:"14px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:i?.color?i.color:m.variant.white,...d}},i.label))))," ")))," ")," ",C>c&&w>n&&t.createElement(Ce,{btnStyle:{backgroundColor:"transparent",padding:0,border:"none"},disabled:!f.next,onClick:A},t.createElement(_,{icon:"chevron-right",color:m.variant[f.next?"primary-2":"neutral-3"],size:22,customstyles:{display:"flex",justifyContent:"center",alignItems:"center"}}))),w<=n&&e.length>1&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",margin:"8px 0",gap:"16px"}}," ",t.createElement(Ce,{btnStyle:{backgroundColor:"transparent",padding:"6px",border:".5px solid "+m.variant["neutral-4"],boxShadow:"-20px 5px 37px rgba(56, 66, 100, 0.0880136)"},disabled:!f.prev,onClick:v},t.createElement(_,{icon:"chevron-left",color:m.variant[f.prev?"primary-2":"neutral-3"],size:10,customstyles:{display:"flex",justifyContent:"center",alignItems:"center"}})),t.createElement(Ce,{btnStyle:{backgroundColor:"transparent",padding:"6px",border:".5px solid "+m.variant["neutral-4"],boxShadow:"-20px 5px 37px rgba(56, 66, 100, 0.0880136)"},disabled:!f.next,onClick:A},t.createElement(_,{icon:"chevron-right",color:m.variant[f.next?"primary-2":"neutral-3"],size:10,customstyles:{display:"flex",justifyContent:"center",alignItems:"center"}})))))};Ve.propTypes={data:e.array,onClick:e.func,clickable:e.bool,breakingPoint:e.number,breakingNumber:e.number,customShapeStyle:e.object,customShapeLabelStyle:e.object,customShapeValueStyle:e.object},Ve.defaultProps={data:[],onClick:()=>null,clickable:!1,breakingPoint:768,breakingNumber:5,customShapeStyle:{},customShapeLabelStyle:{},customShapeValueStyle:{}};const Me=m.img`
|
|
506
510
|
//Set the styles from the default styles object
|
|
507
511
|
${({inBuiltCss:e,type:t,size:l,customStyles:o})=>{if(e){let i={};if(e[t]){for(const t in e.common)i[t]=e.common[t];for(const l in e[t])i[l]=e[t][l],delete e.common[l];for(const o in e[`${t}${l}`])i[o]=e[`${t}${l}`][o],delete e.common[o]}return{...i,...o}}}}
|
|
508
512
|
`,ze=({customStyles:e,type:l,size:a,alt:n,src:c,handleImageStatus:s,...d})=>{const[p,m]=i("loading"),b=o(null),u=()=>{m("loaded"),s&&s("loaded")},g=()=>{m("failed"),s&&s("failed")};return r((()=>{const e=b.current;if(e)return e.addEventListener("load",u),e.addEventListener("error",g),()=>{e.removeEventListener("load",u),e.removeEventListener("error",g)}}),[p]),t.createElement(Me,z({},d,{inBuiltCss:F,customStyles:e,type:l,alt:n,src:c,ref:b,size:a}))};ze.propTypes={customStyles:e.object,type:e.string,size:e.oneOf(["SM","MD","LG"]),alt:e.string,src:e.string,handleImageStatus:e.func},ze.defaultProps={customStyles:{},type:"image",alt:"image alternative",src:null,handleImageStatus:null};const Be=m.span`
|
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`
|