@bothub-chat/ui 2.52.0 → 2.52.1-develop-011da72d-ddf6-43a3-b775-c456101669d9

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 +1 @@
1
- import{__rest as e}from"tslib";import{jsx as l,jsxs as t,Fragment as a}from"react/jsx-runtime";import{useCallback as r,useState as o,useMemo as i}from"react";import{SelectFieldLabel as n,SelectFieldStyled as d,SelectFieldInput as s,SelectFieldSkeleton as c,SelectFieldInputLeftSide as u,SelectFieldSearchSimpleIcon as p,SelectFieldSearchIcon as h,SelectFieldInputNative as m,SelectFieldPlaceholder as b,SelectFieldInputSide as S,SelectFieldClearButton as f,SelectFieldLoader as C,SelectFieldArrow as y,SelectFieldErrorText as g}from"./styled.js";export{SelectFieldColorValueText,SelectFieldValue,SelectFieldValueColor,SelectFieldValueList,SelectFieldValueListItem,SelectFieldValueText,SelectFieldValues}from"./styled.js";import{Skeleton as k}from"../skeleton/index.js";import{SelectModal as $}from"./select-modal/index.js";import{SelectFieldInputValue as v}from"./nodes/value/index.js";import{SelectFieldProvider as x}from"./context.js";export{SelectFieldConsumer,SelectFieldContext,useSelectFieldContext}from"./context.js";import{useSelectField as V}from"./useSelectField.js";const F=F=>{var{className:W,label:j,placeholder:P,data:I,fullWidth:O=!1,contentWidth:T,error:A,skeleton:L=!1,blur:z=!1,size:G="small",disableSelect:M=!1,disableScrollbar:N=!1,empty:R,after:w,loading:B=!1,searchSampleIcon:D=!1,enableInput:q=!1,inputType:E="text",inputValue:H,clearable:J=!1,disablePortal:K,tabs:Q,search:U,searchPlaceholder:X,resetStyleState:Y,children:Z,modalWidth:_,dataTest:ee,selectedColor:le,compactWidth:te,modalStyles:ae,openedModel:re,onSearch:oe,onOptionClick:ie,onGroupCheckboxClick:ne,onInputChange:de,onPointerLeave:se}=F,ce=e(F,["className","label","placeholder","data","fullWidth","contentWidth","error","skeleton","blur","size","disableSelect","disableScrollbar","empty","after","loading","searchSampleIcon","enableInput","inputType","inputValue","clearable","disablePortal","tabs","search","searchPlaceholder","resetStyleState","children","modalWidth","dataTest","selectedColor","compactWidth","modalStyles","openedModel","onSearch","onOptionClick","onGroupCheckboxClick","onInputChange","onPointerLeave"]);const ue=V(ce),{isOpen:pe,triggerRef:he,value:me,disabled:be,multiple:Se,handleClose:fe,handleInputClick:Ce,setValue:ye}=ue,ge=e(ue,["isOpen","triggerRef","value","disabled","multiple","handleClose","handleInputClick","setValue"]),ke=r(e=>{null==de||de(e)},[de]),[$e,ve]=void 0===H?o(""):[H,ke],[xe,Ve]=o(!1),Fe=i(()=>q&&"search"===E,[q,E]),We=i(()=>Se&&Array.isArray(me)&&me.length>0,[Se,me]),je=i(()=>L?l(n,{children:l(k,{width:100})}):"string"==typeof j?l(n,{children:j}):j,[L,j]),Pe=r((e,l)=>{if(l.stopPropagation(),Array.isArray(me)){if("string"==typeof e)return void ye(me.filter(l=>"string"==typeof l?l!==e:l.value!==e));ye(me.filter(l=>"string"==typeof l?l!==e.value:l.value!==e.value))}fe()},[me]),Ie=r(e=>{ve(e.currentTarget.value)},[ve]),Oe=r(()=>{ye(null),ve("")},[ye,ve]);return l(x,{selectRef:he,handleSelectClick:Ce.bind(null,!1),children:t(d,{$fullWidth:O,$disabled:be,className:W,onPointerLeave:se,children:[je,null!=Z?Z:l(a,{children:L?l(s,{$open:!1,$error:!1,$disabled:!1,$skeleton:!0,$loading:!1,$blur:z,$multiple:!1,ref:he,children:l(c,{})}):t(s,{$open:pe,$error:!!A,$disabled:be,$skeleton:!1,$blur:z,$loading:B,$multiple:We,ref:he,onClick:Ce.bind(null,!1),"data-test":ee,children:[t(u,{children:[(!me||Array.isArray(me)&&0===me.length)&&t(a,{children:[Fe&&l(D?p:h,{$focus:xe}),q?l(m,{type:E,value:$e,placeholder:P,disabled:be,onClick:Ce.bind(null,!0),onChange:Ie,onFocus:Ve.bind(null,!0),onBlur:Ve.bind(null,!1)}):l(b,{$open:pe,children:P})]}),l(v,{value:me,handleValueDelete:Pe})]}),t(S,{children:[(me&&(J||q)||Fe&&!B&&$e)&&l(f,{onClick:Oe}),B&&l(C,{}),l(y,{$isOpen:pe})]})]})}),l($,Object.assign({},ge,{isOpen:pe,data:I,contentWidth:T,size:G,disableSelect:M,disableScrollbar:N,empty:R,after:w,tabs:Q,search:U,searchPlaceholder:X,resetStyleState:Y,blur:z,disablePortal:K,value:me,multiple:Se,onSearch:oe,onOptionClick:ie,onGroupCheckboxClick:ne,handleClose:fe,setValue:ye,modalWidth:_,selectedColor:le,compactWidth:te,modalStyles:ae,openedModel:re})),A&&l(g,{children:A})]})})};export{F as SelectField,y as SelectFieldArrow,f as SelectFieldClearButton,g as SelectFieldErrorText,s as SelectFieldInput,u as SelectFieldInputLeftSide,m as SelectFieldInputNative,S as SelectFieldInputSide,n as SelectFieldLabel,C as SelectFieldLoader,b as SelectFieldPlaceholder,x as SelectFieldProvider,h as SelectFieldSearchIcon,p as SelectFieldSearchSimpleIcon,c as SelectFieldSkeleton,d as SelectFieldStyled,$ as SelectModal,V as useSelectField};
1
+ import{__rest as e}from"tslib";import{jsx as l,jsxs as t,Fragment as a}from"react/jsx-runtime";import{useCallback as r,useState as o,useMemo as i}from"react";import{SelectFieldLabel as n,SelectFieldStyled as d,SelectFieldInput as s,SelectFieldSkeleton as c,SelectFieldInputLeftSide as u,SelectFieldSearchSimpleIcon as p,SelectFieldSearchIcon as h,SelectFieldInputNative as m,SelectFieldPlaceholder as b,SelectFieldInputSide as S,SelectFieldClearButton as f,SelectFieldLoader as C,SelectFieldArrow as y,SelectFieldErrorText as g}from"./styled.js";export{SelectFieldColorValueText,SelectFieldValue,SelectFieldValueColor,SelectFieldValueList,SelectFieldValueListItem,SelectFieldValueText,SelectFieldValues}from"./styled.js";import{Skeleton as k}from"../skeleton/index.js";import{SelectModal as $}from"./select-modal/index.js";import{SelectFieldInputValue as v}from"./nodes/value/index.js";import{SelectFieldProvider as x}from"./context.js";export{SelectFieldConsumer,SelectFieldContext,useSelectFieldContext}from"./context.js";import{useSelectField as V}from"./useSelectField.js";const F=F=>{var{className:W,label:j,placeholder:P,data:I,fullWidth:O=!1,contentWidth:T,error:A,skeleton:L=!1,blur:z=!1,size:G="small",disableSelect:M=!1,disableScrollbar:N=!1,empty:R,after:w,loading:B=!1,searchSampleIcon:D=!1,enableInput:q=!1,inputType:E="text",inputValue:H,clearable:J=!1,disablePortal:K,tabs:Q,search:U,searchPlaceholder:X,resetStyleState:Y,children:Z,modalWidth:_,dataTest:ee,selectedColor:le,compactWidth:te,modalStyles:ae,openedModel:re,onSearch:oe,onOptionClick:ie,onGroupCheckboxClick:ne,onInputChange:de,onPointerLeave:se}=F,ce=e(F,["className","label","placeholder","data","fullWidth","contentWidth","error","skeleton","blur","size","disableSelect","disableScrollbar","empty","after","loading","searchSampleIcon","enableInput","inputType","inputValue","clearable","disablePortal","tabs","search","searchPlaceholder","resetStyleState","children","modalWidth","dataTest","selectedColor","compactWidth","modalStyles","openedModel","onSearch","onOptionClick","onGroupCheckboxClick","onInputChange","onPointerLeave"]);const ue=V(ce),{isOpen:pe,triggerRef:he,value:me,disabled:be,multiple:Se,handleClose:fe,handleInputClick:Ce,setValue:ye}=ue,ge=e(ue,["isOpen","triggerRef","value","disabled","multiple","handleClose","handleInputClick","setValue"]),ke=r(e=>{null==de||de(e)},[de]),[$e,ve]=void 0===H?o(""):[H,ke],[xe,Ve]=o(!1),Fe=i(()=>q&&"search"===E,[q,E]),We=i(()=>Se&&Array.isArray(me)&&me.length>0,[Se,me]),je=i(()=>L&&null!=j?l(n,{children:l(k,{width:100})}):"string"==typeof j?l(n,{children:j}):j,[L,j]),Pe=r((e,l)=>{if(l.stopPropagation(),Array.isArray(me)){if("string"==typeof e)return void ye(me.filter(l=>"string"==typeof l?l!==e:l.value!==e));ye(me.filter(l=>"string"==typeof l?l!==e.value:l.value!==e.value))}fe()},[me]),Ie=r(e=>{ve(e.currentTarget.value)},[ve]),Oe=r(()=>{ye(null),ve("")},[ye,ve]);return l(x,{selectRef:he,handleSelectClick:Ce.bind(null,!1),children:t(d,{$fullWidth:O,$disabled:be,className:W,onPointerLeave:se,children:[je,null!=Z?Z:l(a,{children:L?l(s,{$open:!1,$error:!1,$disabled:!1,$skeleton:!0,$loading:!1,$blur:z,$multiple:!1,ref:he,children:l(c,{})}):t(s,{$open:pe,$error:!!A,$disabled:be,$skeleton:!1,$blur:z,$loading:B,$multiple:We,ref:he,onClick:Ce.bind(null,!1),"data-test":ee,children:[t(u,{children:[(!me||Array.isArray(me)&&0===me.length)&&t(a,{children:[Fe&&l(D?p:h,{$focus:xe}),q?l(m,{type:E,value:$e,placeholder:P,disabled:be,onClick:Ce.bind(null,!0),onChange:Ie,onFocus:Ve.bind(null,!0),onBlur:Ve.bind(null,!1)}):l(b,{$open:pe,children:P})]}),l(v,{value:me,handleValueDelete:Pe})]}),t(S,{children:[(me&&(J||q)||Fe&&!B&&$e)&&l(f,{onClick:Oe}),B&&l(C,{}),l(y,{$isOpen:pe})]})]})}),l($,Object.assign({},ge,{isOpen:pe,data:I,contentWidth:T,size:G,disableSelect:M,disableScrollbar:N,empty:R,after:w,tabs:Q,search:U,searchPlaceholder:X,resetStyleState:Y,blur:z,disablePortal:K,value:me,multiple:Se,onSearch:oe,onOptionClick:ie,onGroupCheckboxClick:ne,handleClose:fe,setValue:ye,modalWidth:_,selectedColor:le,compactWidth:te,modalStyles:ae,openedModel:re})),A&&l(g,{children:A})]})})};export{F as SelectField,y as SelectFieldArrow,f as SelectFieldClearButton,g as SelectFieldErrorText,s as SelectFieldInput,u as SelectFieldInputLeftSide,m as SelectFieldInputNative,S as SelectFieldInputSide,n as SelectFieldLabel,C as SelectFieldLoader,b as SelectFieldPlaceholder,x as SelectFieldProvider,h as SelectFieldSearchIcon,p as SelectFieldSearchSimpleIcon,c as SelectFieldSkeleton,d as SelectFieldStyled,$ as SelectModal,V as useSelectField};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bothub-chat/ui",
3
- "version": "2.52.0",
3
+ "version": "2.52.1-develop-011da72d-ddf6-43a3-b775-c456101669d9",
4
4
  "description": "Bothub UI Components",
5
5
  "keywords": [
6
6
  "bot",