@inntechcorp/it-design 2.1.90 → 2.1.91
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.
|
@@ -6,6 +6,8 @@ declare const Content: import("styled-components/dist/types").IStyledComponentBa
|
|
|
6
6
|
declare const Arrow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
7
7
|
$width?: number;
|
|
8
8
|
$height?: number;
|
|
9
|
+
$isSingle?: boolean;
|
|
10
|
+
$isOpen?: boolean;
|
|
9
11
|
}>> & string;
|
|
10
12
|
declare const Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
11
13
|
$height: number;
|
package/dist/index.cjs.js
CHANGED
|
@@ -3505,9 +3505,9 @@ function ga(e,b){if(Da(e))for(let o=0;o<e.length&&!1!==b(e[o],o,e);o++);else e&&
|
|
|
3505
3505
|
|
|
3506
3506
|
`,Vl=Rt.div`
|
|
3507
3507
|
|
|
3508
|
-
transition: all 0.25s ease-out;
|
|
3509
|
-
margin-left: auto;
|
|
3510
|
-
transform: rotate(0deg);
|
|
3508
|
+
transition : all 0.25s ease-out;
|
|
3509
|
+
margin-left : auto;
|
|
3510
|
+
transform : ${e=>e.$isSingle?"rotate(-90deg)":e.$isOpen?"rotate(-180deg)":"rotate(0deg)"};
|
|
3511
3511
|
|
|
3512
3512
|
width: ${e=>e.$width+"px"};
|
|
3513
3513
|
height: ${e=>e.$height+"px"};
|
|
@@ -3563,7 +3563,7 @@ function ga(e,b){if(Da(e))for(let o=0;o<e.length&&!1!==b(e[o],o,e);o++);else e&&
|
|
|
3563
3563
|
font-size: 14px;
|
|
3564
3564
|
line-height: 14px;
|
|
3565
3565
|
|
|
3566
|
-
`,Kl=({useLink:e=!1,onlyOne:b=!1,subMenuLinkArrow:p=!0,subMenuHeight:z=60,itemHeight:t=40,iconSize:c=22,arrowSize:n=10,className:r="",onChange:O,children:i})=>{const[a,s]=M.useState(""),A=e=>{s(e),O&&O(e)};return o.jsx(Gl,{className:"itd-accordion-menu "+r,children:(()=>{if(i)return"string"==typeof i?i:M.Children.map(i,(o=>M.cloneElement(o,{...o.props,useLink:e,onlyOne:b,subMenuLinkArrow:p,subMenuHeight:z,itemHeight:t,iconSize:c,arrowSize:n,isSelected:a===o.props.id,onChange:A})))})()})};Kl.SubMenu=function({id:e="",link:b="",icon:p="",title:z="",isSelected:t=!1,useLink:c=!1,onlyOne:n=!1,subMenuLinkArrow:O=!0,end:i=!1,subMenuHeight:a=60,itemHeight:s=40,iconSize:A=10,arrowSize:d=20,onChange:l=()=>{},children:q=null}){const u=r.useLocation(),[f,W]=M.useState(!1),[h,m]=M.useState(!1),[R,g]=M.useState("0px"),L=M.useRef(null);M.useEffect((()=>{v()&&L.current&&(L.current.style=`${L.current.scrollHeight}px`)}),[]),M.useEffect((()=>{!t&&n&&m(!1)}),[t]),M.useEffect((()=>{h&&l(e),g(h&&L.current?`${L.current.scrollHeight}px`:"0px")}),[h]),M.useEffect((()=>{const e=v();W(e),e&&m(!0)}),[u]);const v=()=>{if(!c&&t)return!0;let e=!1;return q&&Array.isArray(q)?q.forEach((b=>{u.pathname.indexOf(b?.props.link)>-1&&(e=!0)})):u.pathname.indexOf(b)>-1&&(e=!0),e},N=()=>{m(!h)},y=()=>o.jsx(Vl,{className:"itd-accordion-menu-header-arrow-icon itd-svg",$width:d,$height:d,children:o.jsx(Bi,{width:d,height:d})}),x=()=>{let e="itd-accordion-menu-header-icon";return"string"!=typeof p?e+=" itd-icon":""!==p&&(e+=" itd-icon "+p),e},B=()=>{let e="itd-accordion-menu-sub-menu";return h&&(e+=" itd-accordion-menu-sub-menu-open"),q||(e+=" itd-accordion-menu-sub-menu-single"),f&&(e+=" itd-accordion-menu-sub-menu-active"),q&&(e+=" itd-accordion-menu-sub-menu-multiple"),e};return o.jsxs(Il,{className:B(),children:[q?o.jsxs(Ul,{$height:a,onClick:N,className:"itd-accordion-menu-header",children:[o.jsx(Fl,{className:x(),$size:A,children:"string"==typeof p?null:p}),o.jsx("span",{className:"itd-accordion-menu-header-text",children:z}),y()]}):o.jsxs(Ul,{$height:a,className:"itd-accordion-menu-header",as:r.NavLink,to:b,end:i,children:[o.jsx(Fl,{className:x(),$size:A,children:"string"==typeof p?null:p}),o.jsx("span",{className:"itd-accordion-menu-header-text",children:z}),O?y():null]}),q?o.jsx($l,{ref:L,style:{maxHeight:`${R}`},className:"itd-accordion-menu-collapse",children:M.Children.map(q,(e=>M.cloneElement(e,{...e.props,itemHeight:s,arrowSize:d,active:u.pathname.indexOf(e.props.link)>-1})))}):null]})},Kl.Item=({link:e="",itemHeight:b=40,arrowSize:M=20,active:p=!1,end:z=!1,children:t=null})=>o.jsx("li",{className:"itd-accordion-menu-content-item",children:o.jsxs(Hl,{$itemHeight:b,$isActive:p,className:"itd-accordion-menu-content",as:r.NavLink,end:z,to:e,children:[o.jsx("span",{className:"itd-accordion-menu-content-header-text",children:t}),o.jsx(Yl,{width:M,height:M,as:Bi,className:"itd-accordion-menu-content-header-arrow-icon itd-svg"})]})});const Ql=Rt.div`
|
|
3566
|
+
`,Kl=({useLink:e=!1,onlyOne:b=!1,subMenuLinkArrow:p=!0,subMenuHeight:z=60,itemHeight:t=40,iconSize:c=22,arrowSize:n=10,className:r="",onChange:O,children:i})=>{const[a,s]=M.useState(""),A=e=>{s(e),O&&O(e)};return o.jsx(Gl,{className:"itd-accordion-menu "+r,children:(()=>{if(i)return"string"==typeof i?i:M.Children.map(i,(o=>M.cloneElement(o,{...o.props,useLink:e,onlyOne:b,subMenuLinkArrow:p,subMenuHeight:z,itemHeight:t,iconSize:c,arrowSize:n,isSelected:a===o.props.id,onChange:A})))})()})};Kl.SubMenu=function({id:e="",link:b="",icon:p="",title:z="",isSelected:t=!1,useLink:c=!1,onlyOne:n=!1,subMenuLinkArrow:O=!0,end:i=!1,subMenuHeight:a=60,itemHeight:s=40,iconSize:A=10,arrowSize:d=20,onChange:l=()=>{},children:q=null}){const u=r.useLocation(),[f,W]=M.useState(!1),[h,m]=M.useState(!1),[R,g]=M.useState("0px"),L=M.useRef(null);M.useEffect((()=>{v()&&L.current&&(L.current.style=`${L.current.scrollHeight}px`)}),[]),M.useEffect((()=>{!t&&n&&m(!1)}),[t]),M.useEffect((()=>{h&&l(e),g(h&&L.current?`${L.current.scrollHeight}px`:"0px")}),[h]),M.useEffect((()=>{const e=v();W(e),e&&m(!0)}),[u]);const v=()=>{if(!c&&t)return!0;let e=!1;return q&&Array.isArray(q)?q.forEach((b=>{u.pathname.indexOf(b?.props.link)>-1&&(e=!0)})):u.pathname.indexOf(b)>-1&&(e=!0),e},N=()=>{m(!h)},y=()=>o.jsx(Vl,{className:"itd-accordion-menu-header-arrow-icon itd-svg",$width:d,$height:d,$isSingle:!q,$isOpen:h,children:o.jsx(Bi,{width:d,height:d})}),x=()=>{let e="itd-accordion-menu-header-icon";return"string"!=typeof p?e+=" itd-icon":""!==p&&(e+=" itd-icon "+p),e},B=()=>{let e="itd-accordion-menu-sub-menu";return h&&(e+=" itd-accordion-menu-sub-menu-open"),q||(e+=" itd-accordion-menu-sub-menu-single"),f&&(e+=" itd-accordion-menu-sub-menu-active"),q&&(e+=" itd-accordion-menu-sub-menu-multiple"),e};return o.jsxs(Il,{className:B(),children:[q?o.jsxs(Ul,{$height:a,onClick:N,className:"itd-accordion-menu-header",children:[o.jsx(Fl,{className:x(),$size:A,children:"string"==typeof p?null:p}),o.jsx("span",{className:"itd-accordion-menu-header-text",children:z}),y()]}):o.jsxs(Ul,{$height:a,className:"itd-accordion-menu-header",as:r.NavLink,to:b,end:i,children:[o.jsx(Fl,{className:x(),$size:A,children:"string"==typeof p?null:p}),o.jsx("span",{className:"itd-accordion-menu-header-text",children:z}),O?y():null]}),q?o.jsx($l,{ref:L,style:{maxHeight:`${R}`},className:"itd-accordion-menu-collapse",children:M.Children.map(q,(e=>M.cloneElement(e,{...e.props,itemHeight:s,arrowSize:d,active:u.pathname.indexOf(e.props.link)>-1})))}):null]})},Kl.Item=({link:e="",itemHeight:b=40,arrowSize:M=20,active:p=!1,end:z=!1,children:t=null})=>o.jsx("li",{className:"itd-accordion-menu-content-item",children:o.jsxs(Hl,{$itemHeight:b,$isActive:p,className:"itd-accordion-menu-content",as:r.NavLink,end:z,to:e,children:[o.jsx("span",{className:"itd-accordion-menu-content-header-text",children:t}),o.jsx(Yl,{width:M,height:M,as:Bi,className:"itd-accordion-menu-content-header-arrow-icon itd-svg"})]})});const Ql=Rt.div`
|
|
3567
3567
|
|
|
3568
3568
|
position: relative;
|
|
3569
3569
|
cursor: pointer;
|
package/dist/index.esm.js
CHANGED
|
@@ -3505,9 +3505,9 @@ function kA(e,b){if(YA(e))for(let M=0;M<e.length&&!1!==b(e[M],M,e);M++);else e&&
|
|
|
3505
3505
|
|
|
3506
3506
|
`,eu=pc.div`
|
|
3507
3507
|
|
|
3508
|
-
transition: all 0.25s ease-out;
|
|
3509
|
-
margin-left: auto;
|
|
3510
|
-
transform: rotate(0deg);
|
|
3508
|
+
transition : all 0.25s ease-out;
|
|
3509
|
+
margin-left : auto;
|
|
3510
|
+
transform : ${e=>e.$isSingle?"rotate(-90deg)":e.$isOpen?"rotate(-180deg)":"rotate(0deg)"};
|
|
3511
3511
|
|
|
3512
3512
|
width: ${e=>e.$width+"px"};
|
|
3513
3513
|
height: ${e=>e.$height+"px"};
|
|
@@ -3563,7 +3563,7 @@ function kA(e,b){if(YA(e))for(let M=0;M<e.length&&!1!==b(e[M],M,e);M++);else e&&
|
|
|
3563
3563
|
font-size: 14px;
|
|
3564
3564
|
line-height: 14px;
|
|
3565
3565
|
|
|
3566
|
-
`,zu=({useLink:e=!1,onlyOne:b=!1,subMenuLinkArrow:M=!0,subMenuHeight:p=60,itemHeight:z=40,iconSize:t=22,arrowSize:c=10,className:O="",onChange:r,children:i})=>{const[a,A]=n(""),s=e=>{A(e),r&&r(e)};return o(pu,{className:"itd-accordion-menu "+O,children:(()=>{if(i)return"string"==typeof i?i:m.map(i,(o=>l(o,{...o.props,useLink:e,onlyOne:b,subMenuLinkArrow:M,subMenuHeight:p,itemHeight:z,iconSize:t,arrowSize:c,isSelected:a===o.props.id,onChange:s})))})()})};zu.SubMenu=function({id:e="",link:b="",icon:M="",title:p="",isSelected:t=!1,useLink:c=!1,onlyOne:i=!1,subMenuLinkArrow:a=!0,end:A=!1,subMenuHeight:s=60,itemHeight:d=40,iconSize:q=10,arrowSize:u=20,onChange:f=()=>{},children:W=null}){const h=_(),[R,g]=n(!1),[L,v]=n(!1),[N,y]=n("0px"),B=r(null);O((()=>{x()&&B.current&&(B.current.style=`${B.current.scrollHeight}px`)}),[]),O((()=>{!t&&i&&v(!1)}),[t]),O((()=>{L&&f(e),y(L&&B.current?`${B.current.scrollHeight}px`:"0px")}),[L]),O((()=>{const e=x();g(e),e&&v(!0)}),[h]);const x=()=>{if(!c&&t)return!0;let e=!1;return W&&Array.isArray(W)?W.forEach((b=>{h.pathname.indexOf(b?.props.link)>-1&&(e=!0)})):h.pathname.indexOf(b)>-1&&(e=!0),e},w=()=>{v(!L)},X=()=>o(eu,{className:"itd-accordion-menu-header-arrow-icon itd-svg",$width:u,$height:u,children:o(Ca,{width:u,height:u})}),k=()=>{let e="itd-accordion-menu-header-icon";return"string"!=typeof M?e+=" itd-icon":""!==M&&(e+=" itd-icon "+M),e};return z(Qq,{className:(()=>{let e="itd-accordion-menu-sub-menu";return L&&(e+=" itd-accordion-menu-sub-menu-open"),W||(e+=" itd-accordion-menu-sub-menu-single"),R&&(e+=" itd-accordion-menu-sub-menu-active"),W&&(e+=" itd-accordion-menu-sub-menu-multiple"),e})(),children:[z(bu,W?{$height:s,onClick:w,className:"itd-accordion-menu-header",children:[o(Jq,{className:k(),$size:q,children:"string"==typeof M?null:M}),o("span",{className:"itd-accordion-menu-header-text",children:p}),X()]}:{$height:s,className:"itd-accordion-menu-header",as:S,to:b,end:A,children:[o(Jq,{className:k(),$size:q,children:"string"==typeof M?null:M}),o("span",{className:"itd-accordion-menu-header-text",children:p}),a?X():null]}),W?o(Zq,{ref:B,style:{maxHeight:`${N}`},className:"itd-accordion-menu-collapse",children:m.map(W,(e=>l(e,{...e.props,itemHeight:d,arrowSize:u,active:h.pathname.indexOf(e.props.link)>-1})))}):null]})},zu.Item=({link:e="",itemHeight:b=40,arrowSize:M=20,active:p=!1,end:t=!1,children:c=null})=>o("li",{className:"itd-accordion-menu-content-item",children:z(Mu,{$itemHeight:b,$isActive:p,className:"itd-accordion-menu-content",as:S,end:t,to:e,children:[o("span",{className:"itd-accordion-menu-content-header-text",children:c}),o(ou,{width:M,height:M,as:Ca,className:"itd-accordion-menu-content-header-arrow-icon itd-svg"})]})});const tu=pc.div`
|
|
3566
|
+
`,zu=({useLink:e=!1,onlyOne:b=!1,subMenuLinkArrow:M=!0,subMenuHeight:p=60,itemHeight:z=40,iconSize:t=22,arrowSize:c=10,className:O="",onChange:r,children:i})=>{const[a,A]=n(""),s=e=>{A(e),r&&r(e)};return o(pu,{className:"itd-accordion-menu "+O,children:(()=>{if(i)return"string"==typeof i?i:m.map(i,(o=>l(o,{...o.props,useLink:e,onlyOne:b,subMenuLinkArrow:M,subMenuHeight:p,itemHeight:z,iconSize:t,arrowSize:c,isSelected:a===o.props.id,onChange:s})))})()})};zu.SubMenu=function({id:e="",link:b="",icon:M="",title:p="",isSelected:t=!1,useLink:c=!1,onlyOne:i=!1,subMenuLinkArrow:a=!0,end:A=!1,subMenuHeight:s=60,itemHeight:d=40,iconSize:q=10,arrowSize:u=20,onChange:f=()=>{},children:W=null}){const h=_(),[R,g]=n(!1),[L,v]=n(!1),[N,y]=n("0px"),B=r(null);O((()=>{x()&&B.current&&(B.current.style=`${B.current.scrollHeight}px`)}),[]),O((()=>{!t&&i&&v(!1)}),[t]),O((()=>{L&&f(e),y(L&&B.current?`${B.current.scrollHeight}px`:"0px")}),[L]),O((()=>{const e=x();g(e),e&&v(!0)}),[h]);const x=()=>{if(!c&&t)return!0;let e=!1;return W&&Array.isArray(W)?W.forEach((b=>{h.pathname.indexOf(b?.props.link)>-1&&(e=!0)})):h.pathname.indexOf(b)>-1&&(e=!0),e},w=()=>{v(!L)},X=()=>o(eu,{className:"itd-accordion-menu-header-arrow-icon itd-svg",$width:u,$height:u,$isSingle:!W,$isOpen:L,children:o(Ca,{width:u,height:u})}),k=()=>{let e="itd-accordion-menu-header-icon";return"string"!=typeof M?e+=" itd-icon":""!==M&&(e+=" itd-icon "+M),e};return z(Qq,{className:(()=>{let e="itd-accordion-menu-sub-menu";return L&&(e+=" itd-accordion-menu-sub-menu-open"),W||(e+=" itd-accordion-menu-sub-menu-single"),R&&(e+=" itd-accordion-menu-sub-menu-active"),W&&(e+=" itd-accordion-menu-sub-menu-multiple"),e})(),children:[z(bu,W?{$height:s,onClick:w,className:"itd-accordion-menu-header",children:[o(Jq,{className:k(),$size:q,children:"string"==typeof M?null:M}),o("span",{className:"itd-accordion-menu-header-text",children:p}),X()]}:{$height:s,className:"itd-accordion-menu-header",as:S,to:b,end:A,children:[o(Jq,{className:k(),$size:q,children:"string"==typeof M?null:M}),o("span",{className:"itd-accordion-menu-header-text",children:p}),a?X():null]}),W?o(Zq,{ref:B,style:{maxHeight:`${N}`},className:"itd-accordion-menu-collapse",children:m.map(W,(e=>l(e,{...e.props,itemHeight:d,arrowSize:u,active:h.pathname.indexOf(e.props.link)>-1})))}):null]})},zu.Item=({link:e="",itemHeight:b=40,arrowSize:M=20,active:p=!1,end:t=!1,children:c=null})=>o("li",{className:"itd-accordion-menu-content-item",children:z(Mu,{$itemHeight:b,$isActive:p,className:"itd-accordion-menu-content",as:S,end:t,to:e,children:[o("span",{className:"itd-accordion-menu-content-header-text",children:c}),o(ou,{width:M,height:M,as:Ca,className:"itd-accordion-menu-content-header-arrow-icon itd-svg"})]})});const tu=pc.div`
|
|
3567
3567
|
|
|
3568
3568
|
position: relative;
|
|
3569
3569
|
cursor: pointer;
|