@inntechcorp/it-design 2.1.31 → 2.1.32
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.cjs.js +5 -1
- package/dist/index.esm.js +5 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1727,7 +1727,7 @@ function(t,o){e.exports?e.exports=o($A()):o(t.moment)}(GA,(function(e){void 0===
|
|
|
1727
1727
|
justify-content: flex-start;
|
|
1728
1728
|
gap: 10px;
|
|
1729
1729
|
|
|
1730
|
-
`;const ml=t.forwardRef((({id:o="itd-checkbox-group-"+sa(),className:p="",disabled:b,value:n,defaultValue:M,
|
|
1730
|
+
`;const ml=t.forwardRef((({id:o="itd-checkbox-group-"+sa(),className:p="",disabled:b,value:n,defaultValue:M,children:r,onChange:c,onUpdate:z},i)=>{const[a,O]=t.useState([]),[s,d]=t.useState([]),[A,l]=t.useState("");t.useEffect((()=>{O(f)}),[r]),t.useEffect((()=>{M&&d(M)}),[M]),t.useEffect((()=>{Wl(s,n)||d(n||[])}),[n]),t.useEffect((()=>{let e=[];s.forEach((t=>{e.push(t)})),c&&c(e),h(e)}),[s]);const u=()=>{if(r)return q(r)};let f=[];const q=e=>t.Children.map(e,(e=>{if(!function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}(e))return e;let o;if(e.type===xl){let p={ref:t.createRef(),onChange:e=>{(e=>{let t=s;if(e.value){if(e.checked)t=[...s,e.value];else{const o=s.indexOf(e.value);if(o>-1){let e=[...s];e.splice(o,1),t=e}}d(t)}})(e)},children:q(e.props.children)};s.indexOf(e.props.value)>-1&&!e.props.disabled&&(p.checked=!0),void 0!==b&&(p.disabled=b),o=t.cloneElement(e,p),f.push(e.props.value)}else o=t.cloneElement(e,{children:q(e.props.children)});return o}));t.useImperativeHandle(i,(()=>({reset(e=!0,t=!0){this.selectAll(!1),d([]),l(""),h([],e,t)},setValue(e=[],t=!0,o=!0){d(e),h(e,t,o)},getValue:()=>s,setError(e=""){l(e)},clear(){d([]),this.selectAll(!1)},selectAll(e){d(e?a:[]),h(e?a:[]),c&&c(e?a:[])}})));const h=(e,t=!0,o=!0)=>{z&&z(e,t,o)},W=()=>{let e="itd-checkbox-group";return""!==A&&(e+=" itd-checkbox-group-error"),b&&(e+=" itd-checkbox-group-disabled"),""!==p&&(e+=" "+p),e};return e.jsx(gl,{id:o,className:W(),children:u()})}));ml.displayName="ITD-CheckboxGroup";const Rl=Di.label`
|
|
1731
1731
|
|
|
1732
1732
|
display: flex;
|
|
1733
1733
|
align-items: center;
|
|
@@ -4366,6 +4366,10 @@ function pu(e,t){if(fu(e))for(let o=0;o<e.length&&!1!==t(e[o],o,e);o++);else e&&
|
|
|
4366
4366
|
color: #99a1b7;
|
|
4367
4367
|
}
|
|
4368
4368
|
|
|
4369
|
+
&:disabled {
|
|
4370
|
+
color: #99a1b7AA;
|
|
4371
|
+
}
|
|
4372
|
+
|
|
4369
4373
|
}
|
|
4370
4374
|
|
|
4371
4375
|
/* ------------------------ */
|
package/dist/index.esm.js
CHANGED
|
@@ -1727,7 +1727,7 @@ function(t,o){e.exports?e.exports=o(Il()):o(t.moment)}(Vl,(function(e){void 0===
|
|
|
1727
1727
|
justify-content: flex-start;
|
|
1728
1728
|
gap: 10px;
|
|
1729
1729
|
|
|
1730
|
-
`;const xu=u((({id:t="itd-checkbox-group-"+Ha(),className:o="",disabled:p,value:b,defaultValue:n,
|
|
1730
|
+
`;const xu=u((({id:t="itd-checkbox-group-"+Ha(),className:o="",disabled:p,value:b,defaultValue:n,children:M,onChange:c,onUpdate:i},a)=>{const[O,s]=r([]),[A,l]=r([]),[u,W]=r("");z((()=>{s(m)}),[M]),z((()=>{n&&l(n)}),[n]),z((()=>{Bu(A,b)||l(b||[])}),[b]),z((()=>{let e=[];A.forEach((t=>{e.push(t)})),c&&c(e),v(e)}),[A]);const g=()=>{if(M)return R(M)};let m=[];const R=e=>f.map(e,(e=>{if(!function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}(e))return e;let t;if(e.type===_u){let o={ref:h(),onChange:e=>{(e=>{let t=A;if(e.value){if(e.checked)t=[...A,e.value];else{const o=A.indexOf(e.value);if(o>-1){let e=[...A];e.splice(o,1),t=e}}l(t)}})(e)},children:R(e.props.children)};A.indexOf(e.props.value)>-1&&!e.props.disabled&&(o.checked=!0),void 0!==p&&(o.disabled=p),t=d(e,o),m.push(e.props.value)}else t=d(e,{children:R(e.props.children)});return t}));q(a,(()=>({reset(e=!0,t=!0){this.selectAll(!1),l([]),W(""),v([],e,t)},setValue(e=[],t=!0,o=!0){l(e),v(e,t,o)},getValue:()=>A,setError(e=""){W(e)},clear(){l([]),this.selectAll(!1)},selectAll(e){l(e?O:[]),v(e?O:[]),c&&c(e?O:[])}})));const v=(e,t=!0,o=!0)=>{i&&i(e,t,o)};return e(wu,{id:t,className:(()=>{let e="itd-checkbox-group";return""!==u&&(e+=" itd-checkbox-group-error"),p&&(e+=" itd-checkbox-group-disabled"),""!==o&&(e+=" "+o),e})(),children:g()})}));xu.displayName="ITD-CheckboxGroup";const Xu=ha.label`
|
|
1731
1731
|
|
|
1732
1732
|
display: flex;
|
|
1733
1733
|
align-items: center;
|
|
@@ -4366,6 +4366,10 @@ function Of(e,t){if(yf(e))for(let o=0;o<e.length&&!1!==t(e[o],o,e);o++);else e&&
|
|
|
4366
4366
|
color: #99a1b7;
|
|
4367
4367
|
}
|
|
4368
4368
|
|
|
4369
|
+
&:disabled {
|
|
4370
|
+
color: #99a1b7AA;
|
|
4371
|
+
}
|
|
4372
|
+
|
|
4369
4373
|
}
|
|
4370
4374
|
|
|
4371
4375
|
/* ------------------------ */
|