kwant-ui 3.39.3-dev.4 → 3.39.3-dev.5
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MSTypes } from './types';
|
|
2
|
-
declare const MultiSelect: ({ width, options, activeOptions, setActiveOptions, placeholder, label, variant, dropdownSelectProps, avatarProps, tooltipContent, tooltipPosition, }: MSTypes) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const MultiSelect: ({ width, options, activeOptions, setActiveOptions, placeholder, label, variant, dropdownSelectProps, avatarProps, tooltipContent, tooltipPosition, labelTrimCount, }: MSTypes) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export { MultiSelect };
|
package/dist/index.es.js
CHANGED
|
@@ -3238,7 +3238,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
|
|
|
3238
3238
|
}
|
|
3239
3239
|
}
|
|
3240
3240
|
}
|
|
3241
|
-
`,kc={collapseOnSelect:!1,width:"100%",offsetTop:"80px",searchable:!0,toggleOnTargetClick:!1},Sc=e(nt,{icon:"keyboard_arrow_down",width:20,height:20,fill:A.grey.grey400}),Rc=e(nt,{icon:"keyboard_arrow_up",width:20,height:20,fill:A.grey.grey400});e(nt,{icon:"close_circle",width:20,height:20,fill:A.grey.grey400});const Dc=e(nt,{icon:"check",width:16,height:12,fill:A.green.green400}),Ic=({option:r,isSelected:n,variant:a,hasImage:c,avatarProps:i})=>{const{label:o="",image:s}=r;return t("div",{className:`multi-select-option ${n&&"active"}`,children:[c&&e(ar,{src:s,alt:o,size:"xs",...i}),t("div",{className:"multi-select-option__head",children:["checkbox"===a&&e(Be,{checked:n}),o]}),"normal"===a&&n&&e("div",{className:"multi-select-option__tail",children:Dc})]})},Tc=({filterLabel:t,onChipClose:r})=>e("div",{className:"selected",children:e(Ec,{size:"small",type:"secondary",label:`${t}`,showActionButton:!0,onClick:e=>{e.preventDefault(),e.stopPropagation()},onClose:e=>{e.preventDefault(),r(),e.stopPropagation()}})}),Nc=({width:r,options:n=[],activeOptions:a=[],setActiveOptions:c,placeholder:i,label:o,variant:s="normal",dropdownSelectProps:l,avatarProps:h,tooltipContent:v,tooltipPosition:u="right-center"})=>{const
|
|
3241
|
+
`,kc={collapseOnSelect:!1,width:"100%",offsetTop:"80px",searchable:!0,toggleOnTargetClick:!1},Sc=e(nt,{icon:"keyboard_arrow_down",width:20,height:20,fill:A.grey.grey400}),Rc=e(nt,{icon:"keyboard_arrow_up",width:20,height:20,fill:A.grey.grey400});e(nt,{icon:"close_circle",width:20,height:20,fill:A.grey.grey400});const Dc=e(nt,{icon:"check",width:16,height:12,fill:A.green.green400}),Ic=({option:r,isSelected:n,variant:a,hasImage:c,avatarProps:i})=>{const{label:o="",image:s}=r;return t("div",{className:`multi-select-option ${n&&"active"}`,children:[c&&e(ar,{src:s,alt:o,size:"xs",...i}),t("div",{className:"multi-select-option__head",children:["checkbox"===a&&e(Be,{checked:n}),o]}),"normal"===a&&n&&e("div",{className:"multi-select-option__tail",children:Dc})]})},Tc=({filterLabel:t,onChipClose:r})=>e("div",{className:"selected",children:e(Ec,{size:"small",type:"secondary",label:`${t}`,showActionButton:!0,onClick:e=>{e.preventDefault(),e.stopPropagation()},onClose:e=>{e.preventDefault(),r(),e.stopPropagation()}})}),Nc=({width:r,options:n=[],activeOptions:a=[],setActiveOptions:c,placeholder:i,label:o,variant:s="normal",dropdownSelectProps:l,avatarProps:h,tooltipContent:v,tooltipPosition:u="right-center",labelTrimCount:g=11})=>{const m=n.some((e=>"image"in e)),[d,f]=p(!1),w=_((()=>{const t=a?.length;return(t>3?a.slice(0,3):a).map((t=>{let r=(e=>e&&e.length>12?e.slice(0,11)+"..":e)(t?.label);return e(Tc,{filterLabel:r,onChipClose:()=>(e=>{let t=[...a].filter((t=>t.value!==e.value));c(t)})(t)})}))}),[a,g]),b=e=>a.some((t=>t.value===e));return e(Bc,{width:r,children:e(lr,{...kc,onSelect:e=>{if(a.find((t=>t.value===e.value))){let t=[...a].filter((t=>t.value!==e.value));c([...t])}else c([...a,e])},data:n,opened:d,onClose:()=>f(!1),itemComponent:({label:t,value:r,image:n})=>e(Ic,{option:{label:t,value:r,image:n},isSelected:b(r),variant:s,hasImage:m,avatarProps:h}),...l,children:t("div",{className:"select-container",children:[t("div",{className:"select-container__label",children:[o,v&&e(Je,{children:e(be,{tooltipContent:()=>v,position:u,offset:"10px",top:"8px",children:e(nt,{icon:"info",width:16,height:16,fill:A.grey.grey400})})})]}),e("div",{className:"select-container__body",children:t("div",{className:`select-input-container ${d&&"focus"}`,onClick:()=>{f(!0)},id:"select-input-container",children:[t("div",{className:"select-input-container__body",children:[w,a?.length>3&&e(Ec,{onClick:e=>{e.preventDefault(),e.stopPropogation()},size:"small",type:"secondary",label:"+"+(a.length-3)}),0===a?.length&&e("div",{className:"placeholder",children:i||"Select"})]}),e("div",{className:"select-input-container__icon",children:d?Rc:Sc})]})})]})})})},Fc=n.div`
|
|
3242
3242
|
position: relative;
|
|
3243
3243
|
|
|
3244
3244
|
.upload-avatar {
|