groundfloor-react-ui 1.3.27 → 1.3.29
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 +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -813,7 +813,7 @@ opacity: ${({disabled:e,disabledOpacity:t})=>e?t:"1"};
|
|
|
813
813
|
// custom styles
|
|
814
814
|
${({checkBoxInnerStyle:e})=>e}
|
|
815
815
|
`;pt.defaultProps={theme:R};const mt=m.span`
|
|
816
|
-
|
|
816
|
+
word-break: break-word;
|
|
817
817
|
|
|
818
818
|
//Set the styles from the default styles object
|
|
819
819
|
${({inBuiltCss:e,type:t})=>T(e,t)}
|
|
@@ -838,7 +838,7 @@ opacity: ${({disabled:e,disabledOpacity:t})=>e?t:"1"};
|
|
|
838
838
|
`,ut=m.div`
|
|
839
839
|
flex-direction: ${({inline:e})=>e?"row":"column"};
|
|
840
840
|
width: ${({inline:e})=>e?"initial":"auto"};
|
|
841
|
-
`,gt=({getCheckedArr:e,checkBoxOuterStyle:l,checkBoxInnerStyle:o,optionTextStyle:i,defaultBorderColor:a,defaultTextColor:n,checkedTextColor:c,checkedCheckBoxColor:s,labelStyle:d,label:p,options:m,setOptions:u,wrapperStyles:g,inline:f,wrapperStyle:h,isRequired:y,iconProps:C,disabledOpacity:x,disableAllCheckbox:v,...
|
|
841
|
+
`,gt=({getCheckedArr:e,checkBoxOuterStyle:l,checkBoxInnerStyle:o,optionTextStyle:i,defaultBorderColor:a,defaultTextColor:n,checkedTextColor:c,checkedCheckBoxColor:s,labelStyle:d,label:p,options:m,setOptions:u,wrapperStyles:g,inline:f,wrapperStyle:h,isRequired:y,iconProps:C,disabledOpacity:x,disableAllCheckbox:v,maximumCheckLimit:w,...A})=>{const S=b()||R;r((()=>{if(v){let e=[...m];e.map((e=>{e.disabled=!0})),u(e)}k(m,w),V(m)}),[]);const k=(e,t)=>{let l=[...e],o=0;for(let e of l)e.checked&&o++;if(o>t&&t>0){let e=o-t,i=l.length-1;for(;e&&i>=0;)l[i].checked&&(l[i].checked=!1,l[i].disabled=!0,e--),i--;for(let e=0;e<l.length;e++)l[e].checked||(l[e].disabled=!0);u(l)}},E=e=>{let t=0;for(let e of m)e.checked&&t++;if(e===t){let e=[...m];for(let t of e)t.checked||(t.disabled=!0);u(e)}else{let e=[...m];for(let t of e)t.checked||(t.disabled=!1);u(e)}},V=t=>{let l=t.filter((e=>!1!==e.checked));e(l)},M=Object.assign({display:"flex",flexDirection:"column",flexWrap:"wrap"},h);return t.createElement("div",z({style:M},A),t.createElement("div",{style:{display:"flex"}},t.createElement(lt,z({customStyles:d,type:"check-label",text:p},A)),y&&t.createElement("div",{style:{marginLeft:"4px",color:`${S.variant.error}`}},"*")),t.createElement(ut,z({style:{display:"flex",flexWrap:"wrap"},inline:f},A),m?.map(((e,r)=>t.createElement(bt,z({inline:f,id:e.id,key:`${e.name}-${r}`,onClick:()=>{!e.disabled&&((e,t,l)=>{let o=[...m];o[t].checked=!e.checked,u(o),V(o),l&&E(l)})(e,r,w)},wrapperStyles:g},A),e.checked?t.createElement(pt,z({theme:S,inBuiltCss:F,defaultCheckBoxInnerStyle:"checkBox-inner",checkBoxInnerStyle:{...o,cursor:e?.disabled?"not-allowed ":" pointer",borderColor:e?.disabled&&e?.disabledColor},defaultBorderColor:a,checkedCheckBoxColor:s,checked:e.checked,disabled:e.disabled,disabledOpacity:x},A),t.createElement(_,z({icon:"check-icon",size:18,color:"white"},C))):t.createElement(dt,z({inBuiltCss:F,defaultCheckBoxOuterStyle:"checkBox-outer",checkBoxOuterStyle:{...l,cursor:e?.disabled?"not-allowed ":" pointer",borderColor:e?.disabledColor},defaultBorderColor:a,theme:S,disabled:e.disabled,disabledOpacity:x},A)),t.createElement(mt,{theme:S,inline:f,optionTextStyle:{...i,cursor:e?.disabled?"not-allowed ":" pointer",color:e?.disabledColor},checked:e.checked,defaultTextColor:n,checkedTextColor:c,disabled:e.disabled,disabledOpacity:x},e.label))))))};gt.propTypes={wrapperStyle:e.object,label:e.string,labelStyle:e.object,checkBoxOuterStyle:e.object,checkBoxInnerStyle:e.object,optionTextStyle:e.object,defaultTextColor:e.string,checkedTextColor:e.string,defaultBorderColor:e.string,checkedCheckBoxColor:e.string,inline:e.bool,options:e.array,setOptions:e.func,getCheckedArr:e.func,isRequired:e.bool,wrapperStyles:e.object,iconProps:e.object,disabledOpacity:e.number,disableAllCheckbox:e.bool,maximumCheckLimit:e.number},gt.defaultProps={label:"",inline:!1,options:[],setOptions:()=>{},getCheckedArr:()=>{},labelStyle:{},checkBoxOuterStyle:{},checkBoxInnerStyle:{},isRequired:!0,wrapperStyles:{},iconProps:{},disabledOpacity:.5,disableAllCheckbox:!1,maximumCheckLimit:0};const ft=m.div`
|
|
842
842
|
border: 1px solid ${({theme:e})=>e.additional.border};
|
|
843
843
|
background-color: ${({isDisabled:e,theme:t})=>e?t.variant["neutral-5"]:t.additional.white};
|
|
844
844
|
cursor: ${({isDisabled:e})=>e?"not-allowed":"pointer"};
|
package/dist/index.js
CHANGED
|
@@ -813,7 +813,7 @@ opacity: ${({disabled:e,disabledOpacity:t})=>e?t:"1"};
|
|
|
813
813
|
// custom styles
|
|
814
814
|
${({checkBoxInnerStyle:e})=>e}
|
|
815
815
|
`;nt.defaultProps={theme:H};const ct=h.default.span`
|
|
816
|
-
|
|
816
|
+
word-break: break-word;
|
|
817
817
|
|
|
818
818
|
//Set the styles from the default styles object
|
|
819
819
|
${({inBuiltCss:e,type:t})=>R(e,t)}
|
|
@@ -838,7 +838,7 @@ opacity: ${({disabled:e,disabledOpacity:t})=>e?t:"1"};
|
|
|
838
838
|
`,st=h.default.div`
|
|
839
839
|
flex-direction: ${({inline:e})=>e?"row":"column"};
|
|
840
840
|
width: ${({inline:e})=>e?"initial":"auto"};
|
|
841
|
-
`,ut=({getCheckedArr:e,checkBoxOuterStyle:a,checkBoxInnerStyle:o,optionTextStyle:r,defaultBorderColor:i,defaultTextColor:n,checkedTextColor:c,checkedCheckBoxColor:d,labelStyle:s,label:u,options:p,setOptions:f,wrapperStyles:m,inline:b,wrapperStyle:h,isRequired:y,iconProps:x,disabledOpacity:C,disableAllCheckbox:v,...
|
|
841
|
+
`,ut=({getCheckedArr:e,checkBoxOuterStyle:a,checkBoxInnerStyle:o,optionTextStyle:r,defaultBorderColor:i,defaultTextColor:n,checkedTextColor:c,checkedCheckBoxColor:d,labelStyle:s,label:u,options:p,setOptions:f,wrapperStyles:m,inline:b,wrapperStyle:h,isRequired:y,iconProps:x,disabledOpacity:C,disableAllCheckbox:v,maximumCheckLimit:w,...A})=>{const S=l.useTheme()||H;t.useEffect((()=>{if(v){let e=[...p];e.map((e=>{e.disabled=!0})),f(e)}k(p,w),M(p)}),[]);const k=(e,t)=>{let l=[...e],a=0;for(let e of l)e.checked&&a++;if(a>t&&t>0){let e=a-t,o=l.length-1;for(;e&&o>=0;)l[o].checked&&(l[o].checked=!1,l[o].disabled=!0,e--),o--;for(let e=0;e<l.length;e++)l[e].checked||(l[e].disabled=!0);f(l)}},V=e=>{let t=0;for(let e of p)e.checked&&t++;if(e===t){let e=[...p];for(let t of e)t.checked||(t.disabled=!0);f(e)}else{let e=[...p];for(let t of e)t.checked||(t.disabled=!1);f(e)}},M=t=>{let l=t.filter((e=>!1!==e.checked));e(l)},B=Object.assign({display:"flex",flexDirection:"column",flexWrap:"wrap"},h);return g.default.createElement("div",E({style:B},A),g.default.createElement("div",{style:{display:"flex"}},g.default.createElement($e,E({customStyles:s,type:"check-label",text:u},A)),y&&g.default.createElement("div",{style:{marginLeft:"4px",color:`${S.variant.error}`}},"*")),g.default.createElement(st,E({style:{display:"flex",flexWrap:"wrap"},inline:b},A),p?.map(((e,t)=>g.default.createElement(dt,E({inline:b,id:e.id,key:`${e.name}-${t}`,onClick:()=>{!e.disabled&&((e,t,l)=>{let a=[...p];a[t].checked=!e.checked,f(a),M(a),l&&V(l)})(e,t,w)},wrapperStyles:m},A),e.checked?g.default.createElement(nt,E({theme:S,inBuiltCss:P,defaultCheckBoxInnerStyle:"checkBox-inner",checkBoxInnerStyle:{...o,cursor:e?.disabled?"not-allowed ":" pointer",borderColor:e?.disabled&&e?.disabledColor},defaultBorderColor:i,checkedCheckBoxColor:d,checked:e.checked,disabled:e.disabled,disabledOpacity:C},A),g.default.createElement(Q,E({icon:"check-icon",size:18,color:"white"},x))):g.default.createElement(it,E({inBuiltCss:P,defaultCheckBoxOuterStyle:"checkBox-outer",checkBoxOuterStyle:{...a,cursor:e?.disabled?"not-allowed ":" pointer",borderColor:e?.disabledColor},defaultBorderColor:i,theme:S,disabled:e.disabled,disabledOpacity:C},A)),g.default.createElement(ct,{theme:S,inline:b,optionTextStyle:{...r,cursor:e?.disabled?"not-allowed ":" pointer",color:e?.disabledColor},checked:e.checked,defaultTextColor:n,checkedTextColor:c,disabled:e.disabled,disabledOpacity:C},e.label))))))};ut.propTypes={wrapperStyle:b.default.object,label:b.default.string,labelStyle:b.default.object,checkBoxOuterStyle:b.default.object,checkBoxInnerStyle:b.default.object,optionTextStyle:b.default.object,defaultTextColor:b.default.string,checkedTextColor:b.default.string,defaultBorderColor:b.default.string,checkedCheckBoxColor:b.default.string,inline:b.default.bool,options:b.default.array,setOptions:b.default.func,getCheckedArr:b.default.func,isRequired:b.default.bool,wrapperStyles:b.default.object,iconProps:b.default.object,disabledOpacity:b.default.number,disableAllCheckbox:b.default.bool,maximumCheckLimit:b.default.number},ut.defaultProps={label:"",inline:!1,options:[],setOptions:()=>{},getCheckedArr:()=>{},labelStyle:{},checkBoxOuterStyle:{},checkBoxInnerStyle:{},isRequired:!0,wrapperStyles:{},iconProps:{},disabledOpacity:.5,disableAllCheckbox:!1,maximumCheckLimit:0};const pt=h.default.div`
|
|
842
842
|
border: 1px solid ${({theme:e})=>e.additional.border};
|
|
843
843
|
background-color: ${({isDisabled:e,theme:t})=>e?t.variant["neutral-5"]:t.additional.white};
|
|
844
844
|
cursor: ${({isDisabled:e})=>e?"not-allowed":"pointer"};
|