@bothub-chat/ui 2.62.0-fix-documentizer-05afe994-6fdc-4549-97da-0bd84e763a21 → 2.62.0-fix-revers-dnd-5c9648b1-351b-49a0-a30e-f58d12a4ecbc
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{jsxs as t,jsx as r}from"react/jsx-runtime";import a,{forwardRef as l,useId as i,useState as n,useCallback as s}from"react";import{Typography as o}from"../typography/index.js";import{DropzoneFieldStyled as p,DropzoneFieldLabels as d,DropzoneFieldRightLabelsContainer as c,DropzoneFieldRightLabel as m,DropzoneFieldInput as f,DropzoneFieldPlaceholder as h}from"./styled.js";const u=l((l,u)=>{var{leftLabel:g,rightLabels:v,placeholder:y,files:b,onChange:L,fullWidth:W=!1,disabled:D=!1,multiple:C=!0,accept:j}=l,w=e(l,["leftLabel","rightLabels","placeholder","files","onChange","fullWidth","disabled","multiple","accept"]);const x=i(),[A,M]=n(!1),O=s(e=>{null==L||L(e)},[L]),[T,F]=Array.isArray(b)?[b,O]:n([]),$=s(e=>{var t;const r=[...null!==(t=e.currentTarget.files)&&void 0!==t?t:[]];F(C?[...new Map([...T
|
|
1
|
+
import{__rest as e}from"tslib";import{jsxs as t,jsx as r}from"react/jsx-runtime";import a,{forwardRef as l,useId as i,useState as n,useCallback as s}from"react";import{Typography as o}from"../typography/index.js";import{DropzoneFieldStyled as p,DropzoneFieldLabels as d,DropzoneFieldRightLabelsContainer as c,DropzoneFieldRightLabel as m,DropzoneFieldInput as f,DropzoneFieldPlaceholder as h}from"./styled.js";const u=l((l,u)=>{var{leftLabel:g,rightLabels:v,placeholder:y,files:b,onChange:L,fullWidth:W=!1,disabled:D=!1,multiple:C=!0,accept:j}=l,w=e(l,["leftLabel","rightLabels","placeholder","files","onChange","fullWidth","disabled","multiple","accept"]);const x=i(),[A,M]=n(!1),O=s(e=>{null==L||L(e)},[L]),[T,F]=Array.isArray(b)?[b,O]:n([]),$=s(e=>{var t;const r=[...null!==(t=e.currentTarget.files)&&void 0!==t?t:[]];F(C?[...new Map([...r,...T].map(e=>[e.name,e])).values()]:[...r].slice(0,1))},[T,F,C]),k=s(e=>{var t;e.preventDefault();const r=[...null!==(t=e.dataTransfer.files)&&void 0!==t?t:[]].filter(e=>((e,t)=>!t||t.split(",").map(e=>e.trim()).some(t=>t.startsWith(".")?e.name.toLowerCase().endsWith(t.toLowerCase()):t.endsWith("/*")?e.type.startsWith(t.replace("/*","")):e.type===t))(e,j));F(C?[...new Map([...r,...T].map(e=>[e.name,e])).values()]:[...r].slice(0,1)),M(!1)},[T,F,C,j]),q=s(e=>{e.preventDefault(),M(!0)},[]),z=s(e=>{e.preventDefault(),M(!1)},[]);return t(p,Object.assign({onDrop:k,onDragOver:q,onDragLeave:z,$fullWidth:W,"data-dragged":A},w,{children:[t(d,{children:[g&&"string"==typeof g?r(o,{variant:"body-m-regular",children:g}):g,!!v&&r(c,{children:v.map((e,t)=>r(a.Fragment,{children:"string"==typeof e?r(m,{children:e}):e},t))})]}),r(f,{id:x,type:"file",multiple:C,accept:j,onChange:$,disabled:D,ref:u}),!!y&&r(h,{children:y})]}))});export{u as DropzoneField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useLayoutEffect as i}from"react";import"tslib";import{IconProvider as n}from"../../../../icon/context.js";import"../../../../icon/styled.js";import"@react-spring/web";import"react-markdown";import"react-dom";import"../../../../portal/styled.js";import"../../../../tooltip/styled.js";import"../../../../tooltip/arrow/styled.js";import"../../../../../theme/index.js";import"../../../../tooltip/context.js";import{Checkbox as r}from"../../../../checkbox/index.js";import{SelectFieldCheckboxGroupOptionStyled as l,SelectFieldCheckboxGroupOptionHead as c,SelectFieldCheckboxGroupOptionHeadLeftSide as s,SelectFieldCheckboxGroupOptionHeadTextWrapper as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useLayoutEffect as i}from"react";import"tslib";import{IconProvider as n}from"../../../../icon/context.js";import"../../../../icon/styled.js";import"@react-spring/web";import"react-markdown";import"react-dom";import"../../../../portal/styled.js";import"../../../../tooltip/styled.js";import"../../../../tooltip/arrow/styled.js";import"../../../../../theme/index.js";import"../../../../tooltip/context.js";import{Checkbox as r}from"../../../../checkbox/index.js";import{SelectFieldCheckboxGroupOptionStyled as l,SelectFieldCheckboxGroupOptionHead as c,SelectFieldCheckboxGroupOptionHeadLeftSide as s,SelectFieldCheckboxGroupOptionHeadTextWrapper as d,SelectFieldCheckboxGroupOptionHeadText as p,SelectFieldCheckboxGroupOptionHeadCounter as m,SelectFieldCheckboxGroupOptionHeadRightSide as a,SelectFieldCheckboxGroupOptionArrow as h,SelectFieldCheckboxGroupOptionContent as f,ShowMoreButton as g}from"./styled.js";import{useTheme as y}from"../../../../../theme/hook.js";const k=({item:k,value:u,size:j,data:b,onOptionClick:x,onGroupCheckboxClick:v,icon:C,SelectFieldOptions:w})=>{var z,O;const I=y(),[F,Z]=o(!1),[$,B]=o("string"!=typeof k&&(null!==(z=k.open)&&void 0!==z&&z));let G;G="string"!=typeof k&&!!k.disabled;const P="string"!=typeof k?k.open:void 0;i(()=>{"string"!=typeof k&&B(Boolean(k.open))},[P]);const S="string"==typeof k?k:null!==(O=k.label)&&void 0!==O?O:k.value,q=b.length>5,A=F?b:b.slice(0,5),D=()=>{if(!b||0===b.length)return null;const e=b.filter(e=>"string"!=typeof e),t=e.filter(e=>"selected"in e&&!0===e.selected).length,o=e.length;return 0===t?null:t===o&&o>0?"все":t},E="string"!=typeof k&&"selected"in k&&k.selected,H="string"!=typeof k&&"checkedIcon"in k&&k.checkedIcon;return e(l,{children:[e(c,Object.assign({$disabled:G},!G&&{onClick:()=>{B(e=>!e)}},{children:[e(s,{children:["object"==typeof k&&k.icon&&t(n,{size:16,fill:I.colors.base.white,children:k.icon}),e(d,{children:[t(p,{children:S}),t(m,{children:null!==D()&&`(${D()})`})]})]}),e(a,{children:[C||t(h,{style:{transform:$?"rotateZ(180deg)":"rotateZ(0deg)"}}),t("div",{onClick:e=>{e.stopPropagation(),null==v||v(k)},children:t(r,{displayFlex:!0,checkedIcon:H,checked:E,size:16})})]})]})),$&&e(f,{children:[t(w,{value:u,data:A,size:j,onOptionClick:x}),q&&t(g,{onClick:()=>{Z(e=>!e)},children:F?"Скрыть ":"Показать "})]})]})};export{k as SelectFieldCheckboxGroupOption};
|
package/package.json
CHANGED