@inntechcorp/it-design 2.1.30 → 2.1.31
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
CHANGED
|
@@ -2224,7 +2224,7 @@ function(t,o){e.exports?e.exports=o($A()):o(t.moment)}(GA,(function(e){void 0===
|
|
|
2224
2224
|
pointer-events: none;
|
|
2225
2225
|
/* z-index: 1; */
|
|
2226
2226
|
|
|
2227
|
-
`,ou=({id:o,errorMessage:p="",isOpen:n=!1,locked:M=!1,disabled:r=!1,showSearch:c=!1,labelType:z="single",size:i="default",placeholder:a,value:O,label:s,prefix:d,
|
|
2227
|
+
`,ou=({id:o,errorMessage:p="",isOpen:n=!1,locked:M=!1,disabled:r=!1,showSearch:c=!1,labelType:z="single",size:i="default",placeholder:a,value:O,label:s,prefix:d,suffix:A,icon:l,image:u,onFocus:f,onBlur:q,onShow:h,onFilter:W})=>{const g=t.useRef(null),[m,R]=t.useState(!1),[v,L]=t.useState(!1);t.useEffect((()=>{R(n)}),[n]);const y=()=>{if(""!==p)return e.jsx(Ql,{"data-icon":"i",className:"itd-select-failed itd-failed-status",onPointerOver:()=>L(!0),onPointerOut:()=>L(!1),children:v?e.jsx(eu,{className:"itd-select-error-tooltip itd-error-tooltip",children:p}):null})};return e.jsxs(Vl,{$showSearch:c,className:"itd-select-selector",onClick:c?void 0:()=>{f(),m&&h(!1)},children:[(()=>{if(d)return d})(),l?e.jsx(Gl,{className:"itd-icon "+l}):u?u.indexOf(".svg")>-1?e.jsx(b.ReactSVG,{src:u,className:"itd-image itd-svg"}):e.jsx(Ul,{src:u,height:"20",brokenHeight:"20",className:"itd-image"}):void 0,e.jsx(Hl,{className:"itd-select-selection-item",children:"floating"===z?e.jsx(Fl,{id:o,placeholder:a,label:s||void 0,size:i,value:O}):e.jsx(_l,{id:o,placeholder:a,label:s||void 0,size:i,isOpen:m,showSearch:c,disabled:r,onFocus:f,onBlur:q,onFilter:W,ref:g})}),(()=>{if(""!==p)return e.jsx(tu,{className:"itd-error-border"})})(),e.jsxs(Zl,{className:"itd-select-suffix",children:[A,e.jsx(Yl,{$open:m,className:"itd-select-arrow",children:e.jsx(zl,{})}),M?e.jsx(Jl,{className:"itd-svg",width:"18",height:"18"}):null,y()]})]})};
|
|
2228
2228
|
/*!
|
|
2229
2229
|
* OverlayScrollbars
|
|
2230
2230
|
* Version: 2.0.3
|
|
@@ -3255,7 +3255,7 @@ function pu(e,t){if(fu(e))for(let o=0;o<e.length&&!1!==t(e[o],o,e);o++);else e&&
|
|
|
3255
3255
|
}
|
|
3256
3256
|
`}
|
|
3257
3257
|
|
|
3258
|
-
`,Yh=t.forwardRef((({id:o="itd-select-"+sa(),position:p="bottom",direction:b="right",size:n="default",variant:M="default",placeholder:r="Please Select",className:c="",multi:z=!1,disabled:i=!1,showSearch:a=!1,locked:O=!1,floating:s=!1,options:d=[],value:A,defaultValue:l,label:u,prefix:f,
|
|
3258
|
+
`,Yh=t.forwardRef((({id:o="itd-select-"+sa(),position:p="bottom",direction:b="right",size:n="default",variant:M="default",placeholder:r="Please Select",className:c="",multi:z=!1,disabled:i=!1,showSearch:a=!1,locked:O=!1,floating:s=!1,options:d=[],value:A,defaultValue:l,label:u,prefix:f,suffix:q,icon:h,image:W,style:g,onChange:m,onUpdate:R},v)=>{const L=t.useRef(null),[y,N]=t.useState(!1),[x,B]=t.useState(""),[w,X]=t.useState(void 0),[S,k]=t.useState("");t.useEffect((()=>{y||B("")}),[y]),t.useEffect((()=>{void 0!==l&&X(l)}),[l]),t.useEffect((()=>{void 0!==A&&X(A)}),[A]),Yr(L,(()=>{y&&N(!1)})),Gr((()=>{y&&N(!1)}));const T=(e,t=!0,o=!0)=>{R&&R(e,t,o)};t.useImperativeHandle(v,(()=>({reset(e=!0,t=!0){const o=l||(z?[]:void 0);X(o),k(""),T(o,e,t)},setValue(e,t=!0,o=!0){X(e),T(e,t,o)},getValue:()=>w||(z?[]:""),setError(e){k(e||"")},clear(){}})));const E=()=>"x-small"===n?"xs":"small"===n?"sm":"medium"===n?"md":"default"===n?"df":"large"===n?"lg":"x-large"===n?"xlg":"df";return e.jsxs(Hh,{ref:L,className:(()=>{let e="itd-select";return e+=" itd-select-"+M,e+=" itd-select-"+(z?"multi":"single"),e+=" itd-select-"+b,e+=" itd-select-"+E(),y&&(e+=" itd-select-open"),S&&(e+=" itd-select-status-error"),i&&(e+=" itd-select-disabled"),a&&(e+=" itd-select-search"),h&&(e+=" itd-icon"),W&&(e+=" itd-image"),""!==c&&(e+=" "+c),e})(),...(()=>{let e={style:void 0,disabled:!1,$hasImage:null!=W,$hasIcon:null!=h,$size:E(),$filled:void 0!==w};return i&&(e.disabled=!0),g&&(e.style=g),e})(),children:[e.jsx(ou,{id:o,labelType:s?"floating":"single",value:w,placeholder:d.length>0?r:"",onChange:e=>{N(e)},onFocus:()=>{N(!0)},onBlur:()=>{N(!1)},onShow:e=>{N(e)},onFilter:e=>{y&&B(e)},errorMessage:S,size:n,icon:h,prefix:f,suffix:q,image:W,label:(()=>{if(u)return u;if(void 0===w)return;let e="";if(z){const t=d.filter((e=>e.value===w[0]))[0];Array.isArray(w)&&(1===w.length?t&&(e=t.label):w.length>1&&(e=el("placeholders.multipleSelection",{count:w.length})))}else{const t=d.filter((e=>e.value===w))[0];t&&(e=t.label)}return e})(),disabled:i,isOpen:y,multi:z,locked:O,showSearch:a}),e.jsx(jh,{onClose:()=>{N(!1)},onChange:e=>{k(""),T(e),X(e),z||N(!1),m&&m(e)},defaultValue:w,position:p,direction:b,isOpen:y,multi:z,children:(()=>{let o=[];return d.map((e=>{if(""!==x&&"string"==typeof e.value&&"string"==typeof e.label&&!e.value.includes(x.toLocaleLowerCase())&&!(e=>{if("string"==typeof e)return e.toLocaleLowerCase();let t="";return e.map((e=>{"string"==typeof e&&(t+=e.toLocaleLowerCase())})),t})(e.label).includes(x.toLocaleLowerCase()))return;let p={value:e.value,label:e.label};e.icon&&(p={...p,icon:e.icon}),e.image&&(p={...p,image:e.image}),e.key&&(p={...p,customKey:e.key}),z&&w&&Array.isArray(w)&&(p={...p,checked:w.includes(e.value.toString())}),o.push(t.createElement(kl,{...p,key:e.key?e.key:e.value.toString()}))})),0===o.length&&o.push(e.jsx("div",{className:"itd-select-not-found",style:{padding:"20px",textAlign:"center"},children:"Not Found"},"not-found")),o})()})]})}));Yh.displayName="Select";const Gh=Di.div`
|
|
3259
3259
|
|
|
3260
3260
|
display : flex;
|
|
3261
3261
|
flex-direction : ${e=>e.$horizontal?"row":"column"};
|
package/dist/index.d.ts
CHANGED
|
@@ -980,6 +980,7 @@ type SelectProps = {
|
|
|
980
980
|
className?: string;
|
|
981
981
|
placeholder?: string;
|
|
982
982
|
prefix?: ChildrenProps;
|
|
983
|
+
suffix?: ChildrenProps;
|
|
983
984
|
icon?: string;
|
|
984
985
|
image?: string;
|
|
985
986
|
disabled?: boolean;
|
|
@@ -1005,6 +1006,7 @@ type SelectToggleProps = {
|
|
|
1005
1006
|
placeholder: string;
|
|
1006
1007
|
icon?: string;
|
|
1007
1008
|
prefix?: ChildrenProps;
|
|
1009
|
+
suffix?: ChildrenProps;
|
|
1008
1010
|
image?: string;
|
|
1009
1011
|
size: ITDSize;
|
|
1010
1012
|
onFocus: () => void;
|
package/dist/index.esm.js
CHANGED
|
@@ -2224,7 +2224,7 @@ function(t,o){e.exports?e.exports=o(Il()):o(t.moment)}(Vl,(function(e){void 0===
|
|
|
2224
2224
|
pointer-events: none;
|
|
2225
2225
|
/* z-index: 1; */
|
|
2226
2226
|
|
|
2227
|
-
`,af=({id:t,errorMessage:p="",isOpen:b=!1,locked:n=!1,disabled:M=!1,showSearch:i=!1,labelType:a="single",size:O="default",placeholder:s,value:A,label:d,prefix:l,
|
|
2227
|
+
`,af=({id:t,errorMessage:p="",isOpen:b=!1,locked:n=!1,disabled:M=!1,showSearch:i=!1,labelType:a="single",size:O="default",placeholder:s,value:A,label:d,prefix:l,suffix:u,icon:f,image:q,onFocus:h,onBlur:W,onShow:g,onFilter:m})=>{const R=c(null),[v,y]=r(!1),[N,B]=r(!1);z((()=>{y(b)}),[b]);const w=()=>{if(""!==p)return e(nf,{"data-icon":"i",className:"itd-select-failed itd-failed-status",onPointerOver:()=>B(!0),onPointerOut:()=>B(!1),children:N?e(cf,{className:"itd-select-error-tooltip itd-error-tooltip",children:p}):null})};return o(ef,{$showSearch:i,className:"itd-select-selector",onClick:i?void 0:()=>{h(),v&&g(!1)},children:[(()=>{if(l)return l})(),f?e(pf,{className:"itd-icon "+f}):q?q.indexOf(".svg")>-1?e(L,{src:q,className:"itd-image itd-svg"}):e(Zu,{src:q,height:"20",brokenHeight:"20",className:"itd-image"}):void 0,e(tf,{className:"itd-select-selection-item",children:"floating"===a?e(Qu,{id:t,placeholder:s,label:d||void 0,size:O,value:A}):e(Uu,{id:t,placeholder:s,label:d||void 0,size:O,isOpen:v,showSearch:i,disabled:M,onFocus:h,onBlur:W,onFilter:m,ref:R})}),(()=>{if(""!==p)return e(zf,{className:"itd-error-border"})})(),o(rf,{className:"itd-select-suffix",children:[u,e(of,{$open:v,className:"itd-select-arrow",children:e(lu,{})}),n?e(Mf,{className:"itd-svg",width:"18",height:"18"}):null,w()]})]})};
|
|
2228
2228
|
/*!
|
|
2229
2229
|
* OverlayScrollbars
|
|
2230
2230
|
* Version: 2.0.3
|
|
@@ -3255,7 +3255,7 @@ function Of(e,t){if(yf(e))for(let o=0;o<e.length&&!1!==t(e[o],o,e);o++);else e&&
|
|
|
3255
3255
|
}
|
|
3256
3256
|
`}
|
|
3257
3257
|
|
|
3258
|
-
`,og=u((({id:t="itd-select-"+Ha(),position:p="bottom",direction:b="right",size:n="default",variant:M="default",placeholder:i="Please Select",className:a="",multi:O=!1,disabled:A=!1,showSearch:d=!1,locked:l=!1,floating:u=!1,options:f=[],value:h,defaultValue:W,label:g,prefix:m,
|
|
3258
|
+
`,og=u((({id:t="itd-select-"+Ha(),position:p="bottom",direction:b="right",size:n="default",variant:M="default",placeholder:i="Please Select",className:a="",multi:O=!1,disabled:A=!1,showSearch:d=!1,locked:l=!1,floating:u=!1,options:f=[],value:h,defaultValue:W,label:g,prefix:m,suffix:R,icon:v,image:L,style:y,onChange:N,onUpdate:B},w)=>{const x=c(null),[X,k]=r(!1),[S,T]=r(""),[E,_]=r(void 0),[C,P]=r("");z((()=>{X||T("")}),[X]),z((()=>{void 0!==W&&_(W)}),[W]),z((()=>{void 0!==h&&_(h)}),[h]),gc(x,(()=>{X&&k(!1)})),mc((()=>{X&&k(!1)}));const D=(e,t=!0,o=!0)=>{B&&B(e,t,o)};q(w,(()=>({reset(e=!0,t=!0){const o=W||(O?[]:void 0);_(o),P(""),D(o,e,t)},setValue(e,t=!0,o=!0){_(e),D(e,t,o)},getValue:()=>E||(O?[]:""),setError(e){P(e||"")},clear(){}})));const I=()=>"x-small"===n?"xs":"small"===n?"sm":"medium"===n?"md":"default"===n?"df":"large"===n?"lg":"x-large"===n?"xlg":"df";return o(tg,{ref:x,className:(()=>{let e="itd-select";return e+=" itd-select-"+M,e+=" itd-select-"+(O?"multi":"single"),e+=" itd-select-"+b,e+=" itd-select-"+I(),X&&(e+=" itd-select-open"),C&&(e+=" itd-select-status-error"),A&&(e+=" itd-select-disabled"),d&&(e+=" itd-select-search"),v&&(e+=" itd-icon"),L&&(e+=" itd-image"),""!==a&&(e+=" "+a),e})(),...(()=>{let e={style:void 0,disabled:!1,$hasImage:null!=L,$hasIcon:null!=v,$size:I(),$filled:void 0!==E};return A&&(e.disabled=!0),y&&(e.style=y),e})(),children:[e(af,{id:t,labelType:u?"floating":"single",value:E,placeholder:f.length>0?i:"",onChange:e=>{k(e)},onFocus:()=>{k(!0)},onBlur:()=>{k(!1)},onShow:e=>{k(e)},onFilter:e=>{X&&T(e)},errorMessage:C,size:n,icon:v,prefix:m,suffix:R,image:L,label:(()=>{if(g)return g;if(void 0===E)return;let e="";if(O){const t=f.filter((e=>e.value===E[0]))[0];Array.isArray(E)&&(1===E.length?t&&(e=t.label):E.length>1&&(e=ou("placeholders.multipleSelection",{count:E.length})))}else{const t=f.filter((e=>e.value===E))[0];t&&(e=t.label)}return e})(),disabled:A,isOpen:X,multi:O,locked:l,showSearch:d}),e(GW,{onClose:()=>{k(!1)},onChange:e=>{P(""),D(e),_(e),O||k(!1),N&&N(e)},defaultValue:E,position:p,direction:b,isOpen:X,multi:O,children:(()=>{let t=[];return f.map((e=>{if(""!==S&&"string"==typeof e.value&&"string"==typeof e.label&&!e.value.includes(S.toLocaleLowerCase())&&!(e=>{if("string"==typeof e)return e.toLocaleLowerCase();let t="";return e.map((e=>{"string"==typeof e&&(t+=e.toLocaleLowerCase())})),t})(e.label).includes(S.toLocaleLowerCase()))return;let o={value:e.value,label:e.label};e.icon&&(o={...o,icon:e.icon}),e.image&&(o={...o,image:e.image}),e.key&&(o={...o,customKey:e.key}),O&&E&&Array.isArray(E)&&(o={...o,checked:E.includes(e.value.toString())}),t.push(s(Fu,{...o,key:e.key?e.key:e.value.toString()}))})),0===t.length&&t.push(e("div",{className:"itd-select-not-found",style:{padding:"20px",textAlign:"center"},children:"Not Found"},"not-found")),t})()})]})}));og.displayName="Select";const pg=ha.div`
|
|
3259
3259
|
|
|
3260
3260
|
display : flex;
|
|
3261
3261
|
flex-direction : ${e=>e.$horizontal?"row":"column"};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectToggleProps } from '../../index';
|
|
2
|
-
declare const Toggle: ({ id, errorMessage, isOpen, locked, disabled, showSearch, labelType, size, placeholder, value, label, prefix, icon, image, onFocus, onBlur, onShow, onFilter }: SelectToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Toggle: ({ id, errorMessage, isOpen, locked, disabled, showSearch, labelType, size, placeholder, value, label, prefix, suffix, icon, image, onFocus, onBlur, onShow, onFilter }: SelectToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Toggle;
|
|
@@ -14,6 +14,7 @@ export type SelectProps = {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
prefix?: ChildrenProps;
|
|
17
|
+
suffix?: ChildrenProps;
|
|
17
18
|
icon?: string;
|
|
18
19
|
image?: string;
|
|
19
20
|
disabled?: boolean;
|
|
@@ -39,6 +40,7 @@ export type SelectToggleProps = {
|
|
|
39
40
|
placeholder: string;
|
|
40
41
|
icon?: string;
|
|
41
42
|
prefix?: ChildrenProps;
|
|
43
|
+
suffix?: ChildrenProps;
|
|
42
44
|
image?: string;
|
|
43
45
|
size: ITDSize;
|
|
44
46
|
onFocus: () => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ITDSizeSlug } from "../index";
|
|
2
|
-
export default function GetSizeBySizeSlug(size: ITDSizeSlug): "
|
|
2
|
+
export default function GetSizeBySizeSlug(size: ITDSizeSlug): "large" | "small" | "x-small" | "medium" | "default" | "x-large" | "df";
|